diff --git a/2018/02/21/git/index.html b/2018/02/21/git/index.html new file mode 100644 index 0000000..6874024 --- /dev/null +++ b/2018/02/21/git/index.html @@ -0,0 +1,833 @@ + + + + + + + + + 常用 Git 命令清单 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2018/03/03/RWMutex-in-go/index.html b/2018/03/03/RWMutex-in-go/index.html new file mode 100644 index 0000000..c8547de --- /dev/null +++ b/2018/03/03/RWMutex-in-go/index.html @@ -0,0 +1,836 @@ + + + + + + + + + RWMutex in go | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2018/05/01/nginx-accel-redirect/index.html b/2018/05/01/nginx-accel-redirect/index.html new file mode 100644 index 0000000..e0f21cf --- /dev/null +++ b/2018/05/01/nginx-accel-redirect/index.html @@ -0,0 +1,824 @@ + + + + + + + + + nginx-accel-redirect | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2018/06/03/HTTPS-explained-with-carrier-pigeons/index.html b/2018/06/03/HTTPS-explained-with-carrier-pigeons/index.html new file mode 100644 index 0000000..60f5baf --- /dev/null +++ b/2018/06/03/HTTPS-explained-with-carrier-pigeons/index.html @@ -0,0 +1,840 @@ + + + + + + + + + HTTPS explained with carrier pigeons | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2018/06/03/HTTPS-performacne-tips/index.html b/2018/06/03/HTTPS-performacne-tips/index.html new file mode 100644 index 0000000..e2824c5 --- /dev/null +++ b/2018/06/03/HTTPS-performacne-tips/index.html @@ -0,0 +1,839 @@ + + + + + + + + + HTTPS performacne tips | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2018/06/03/nginx-forward-http-x-forwarded-proto-header/index.html b/2018/06/03/nginx-forward-http-x-forwarded-proto-header/index.html new file mode 100644 index 0000000..86fbfea --- /dev/null +++ b/2018/06/03/nginx-forward-http-x-forwarded-proto-header/index.html @@ -0,0 +1,863 @@ + + + + + + + + + nginx-forward-http-x-forwarded-proto-header | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2018/06/24/Unique-ID-generator/index.html b/2018/06/24/Unique-ID-generator/index.html new file mode 100644 index 0000000..7a5a348 --- /dev/null +++ b/2018/06/24/Unique-ID-generator/index.html @@ -0,0 +1,881 @@ + + + + + + + + + Unique ID generator | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2018/09/09/upload-file-via-http/index.html b/2018/09/09/upload-file-via-http/index.html new file mode 100644 index 0000000..2ef9b7d --- /dev/null +++ b/2018/09/09/upload-file-via-http/index.html @@ -0,0 +1,828 @@ + + + + + + + + + upload file via http | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2018/10/29/Puppeteer-coverage/index.html b/2018/10/29/Puppeteer-coverage/index.html new file mode 100644 index 0000000..ddce8da --- /dev/null +++ b/2018/10/29/Puppeteer-coverage/index.html @@ -0,0 +1,823 @@ + + + + + + + + + Puppeteer coverage | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2019/03/16/golang-pprof/index.html b/2019/03/16/golang-pprof/index.html new file mode 100644 index 0000000..4d00f95 --- /dev/null +++ b/2019/03/16/golang-pprof/index.html @@ -0,0 +1,827 @@ + + + + + + + + + golang pprof | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2019/08/21/groupcache/index.html b/2019/08/21/groupcache/index.html new file mode 100644 index 0000000..2119226 --- /dev/null +++ b/2019/08/21/groupcache/index.html @@ -0,0 +1,823 @@ + + + + + + + + + groupcache | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2019/09/13/docker-nginx-install/index.html b/2019/09/13/docker-nginx-install/index.html new file mode 100644 index 0000000..d2f4a03 --- /dev/null +++ b/2019/09/13/docker-nginx-install/index.html @@ -0,0 +1,825 @@ + + + + + + + + + docker nginx install | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2019/11/17/docker-redis-install/index.html b/2019/11/17/docker-redis-install/index.html new file mode 100644 index 0000000..61da4ad --- /dev/null +++ b/2019/11/17/docker-redis-install/index.html @@ -0,0 +1,834 @@ + + + + + + + + + docker redis install | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2019/12/15/golang-viper-tips/index.html b/2019/12/15/golang-viper-tips/index.html new file mode 100644 index 0000000..32337a5 --- /dev/null +++ b/2019/12/15/golang-viper-tips/index.html @@ -0,0 +1,857 @@ + + + + + + + + + golang viper tips | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2020/04/06/intern-recruitment/index.html b/2020/04/06/intern-recruitment/index.html new file mode 100644 index 0000000..229c4b1 --- /dev/null +++ b/2020/04/06/intern-recruitment/index.html @@ -0,0 +1,846 @@ + + + + + + + + + intern-recruitment | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2020/06/08/gomicro-config/index.html b/2020/06/08/gomicro-config/index.html new file mode 100644 index 0000000..5937025 --- /dev/null +++ b/2020/06/08/gomicro-config/index.html @@ -0,0 +1,851 @@ + + + + + + + + + gomicro-config | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2020/06/14/Functional-options-for-friendly-APIs/index.html b/2020/06/14/Functional-options-for-friendly-APIs/index.html new file mode 100644 index 0000000..2086bad --- /dev/null +++ b/2020/06/14/Functional-options-for-friendly-APIs/index.html @@ -0,0 +1,845 @@ + + + + + + + + + Functional options for friendly APIs | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2020/06/27/Tencent-Scf-Version-Manage/index.html b/2020/06/27/Tencent-Scf-Version-Manage/index.html new file mode 100644 index 0000000..435920d --- /dev/null +++ b/2020/06/27/Tencent-Scf-Version-Manage/index.html @@ -0,0 +1,869 @@ + + + + + + + + + Tencent Scf Version Manage | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2020/07/02/Introduction-to-Go-Modules/index.html b/2020/07/02/Introduction-to-Go-Modules/index.html new file mode 100644 index 0000000..918ef8d --- /dev/null +++ b/2020/07/02/Introduction-to-Go-Modules/index.html @@ -0,0 +1,903 @@ + + + + + + + + + Introduction to Go Modules | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2020/10/05/Vscode-Remote-Connect-failed/index.html b/2020/10/05/Vscode-Remote-Connect-failed/index.html new file mode 100644 index 0000000..6c8536c --- /dev/null +++ b/2020/10/05/Vscode-Remote-Connect-failed/index.html @@ -0,0 +1,830 @@ + + + + + + + + + Vscode Remote Connect failed | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2020/12/26/Introduction-to-memberlist/index.html b/2020/12/26/Introduction-to-memberlist/index.html new file mode 100644 index 0000000..f8066a4 --- /dev/null +++ b/2020/12/26/Introduction-to-memberlist/index.html @@ -0,0 +1,1082 @@ + + + + + + + + + Introduction-to-memberlist | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2021/10/04/libuv-source/index.html b/2021/10/04/libuv-source/index.html new file mode 100644 index 0000000..897b9cc --- /dev/null +++ b/2021/10/04/libuv-source/index.html @@ -0,0 +1,877 @@ + + + + + + + + + libuv-source | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2021/10/10/Reliable-Cron-across-the-Planet/index.html b/2021/10/10/Reliable-Cron-across-the-Planet/index.html new file mode 100644 index 0000000..ce393d0 --- /dev/null +++ b/2021/10/10/Reliable-Cron-across-the-Planet/index.html @@ -0,0 +1,903 @@ + + + + + + + + + Reliable Cron across the Planet | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2021/12/04/Application-Tracking/index.html b/2021/12/04/Application-Tracking/index.html new file mode 100644 index 0000000..72ef3e3 --- /dev/null +++ b/2021/12/04/Application-Tracking/index.html @@ -0,0 +1,907 @@ + + + + + + + + + Application Tracking | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2022/01/07/Open-Tracing/index.html b/2022/01/07/Open-Tracing/index.html new file mode 100644 index 0000000..c9c04a2 --- /dev/null +++ b/2022/01/07/Open-Tracing/index.html @@ -0,0 +1,968 @@ + + + + + + + + + Open Tracing | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2022/01/10/Microservices-in-Action/index.html b/2022/01/10/Microservices-in-Action/index.html new file mode 100644 index 0000000..a8682fd --- /dev/null +++ b/2022/01/10/Microservices-in-Action/index.html @@ -0,0 +1,1076 @@ + + + + + + + + + Microservices in Action | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2022/03/02/seckill-md/index.html b/2022/03/02/seckill-md/index.html new file mode 100644 index 0000000..3cbeeef --- /dev/null +++ b/2022/03/02/seckill-md/index.html @@ -0,0 +1,894 @@ + + + + + + + + + 秒杀系统核心设计 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2022/03/05/Tencent-COS-Image-Service/index.html b/2022/03/05/Tencent-COS-Image-Service/index.html new file mode 100644 index 0000000..87603d0 --- /dev/null +++ b/2022/03/05/Tencent-COS-Image-Service/index.html @@ -0,0 +1,855 @@ + + + + + + + + + 使用腾讯云cos+cdn搭建图片服务器 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2023/09/18/Introduct-to-go-clean-template/index.html b/2023/09/18/Introduct-to-go-clean-template/index.html new file mode 100644 index 0000000..1d97751 --- /dev/null +++ b/2023/09/18/Introduct-to-go-clean-template/index.html @@ -0,0 +1,906 @@ + + + + + + + + + Introduct to go-clean-template | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2023/09/18/Introduct-to-temporalio/index.html b/2023/09/18/Introduct-to-temporalio/index.html new file mode 100644 index 0000000..eab8ac7 --- /dev/null +++ b/2023/09/18/Introduct-to-temporalio/index.html @@ -0,0 +1,890 @@ + + + + + + + + + Introduct to temporalio | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/2023/10/07/Memos-Code-Analyze/index.html b/2023/10/07/Memos-Code-Analyze/index.html new file mode 100644 index 0000000..c0255c7 --- /dev/null +++ b/2023/10/07/Memos-Code-Analyze/index.html @@ -0,0 +1,1114 @@ + + + + + + + + + memos code analyze | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/about-site/index.html b/about-site/index.html new file mode 100644 index 0000000..7bed808 --- /dev/null +++ b/about-site/index.html @@ -0,0 +1,774 @@ + + + + + + + + + about-site | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2018/02/index.html b/archives/2018/02/index.html new file mode 100644 index 0000000..316ebeb --- /dev/null +++ b/archives/2018/02/index.html @@ -0,0 +1,655 @@ + + + + + + + + + Archives: 2018/2 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2018/03/index.html b/archives/2018/03/index.html new file mode 100644 index 0000000..0db45e0 --- /dev/null +++ b/archives/2018/03/index.html @@ -0,0 +1,655 @@ + + + + + + + + + Archives: 2018/3 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2018/05/index.html b/archives/2018/05/index.html new file mode 100644 index 0000000..70c060b --- /dev/null +++ b/archives/2018/05/index.html @@ -0,0 +1,659 @@ + + + + + + + + + Archives: 2018/5 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2018/06/index.html b/archives/2018/06/index.html new file mode 100644 index 0000000..c5b6574 --- /dev/null +++ b/archives/2018/06/index.html @@ -0,0 +1,788 @@ + + + + + + + + + Archives: 2018/6 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2018/09/index.html b/archives/2018/09/index.html new file mode 100644 index 0000000..c6d75ac --- /dev/null +++ b/archives/2018/09/index.html @@ -0,0 +1,655 @@ + + + + + + + + + Archives: 2018/9 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2018/10/index.html b/archives/2018/10/index.html new file mode 100644 index 0000000..7089686 --- /dev/null +++ b/archives/2018/10/index.html @@ -0,0 +1,655 @@ + + + + + + + + + Archives: 2018/10 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2018/index.html b/archives/2018/index.html new file mode 100644 index 0000000..72f3b3a --- /dev/null +++ b/archives/2018/index.html @@ -0,0 +1,1007 @@ + + + + + + + + + Archives: 2018 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2019/03/index.html b/archives/2019/03/index.html new file mode 100644 index 0000000..7912b56 --- /dev/null +++ b/archives/2019/03/index.html @@ -0,0 +1,655 @@ + + + + + + + + + Archives: 2019/3 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2019/08/index.html b/archives/2019/08/index.html new file mode 100644 index 0000000..dbd0a2d --- /dev/null +++ b/archives/2019/08/index.html @@ -0,0 +1,655 @@ + + + + + + + + + Archives: 2019/8 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2019/09/index.html b/archives/2019/09/index.html new file mode 100644 index 0000000..6f044be --- /dev/null +++ b/archives/2019/09/index.html @@ -0,0 +1,659 @@ + + + + + + + + + Archives: 2019/9 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2019/11/index.html b/archives/2019/11/index.html new file mode 100644 index 0000000..3d5a19d --- /dev/null +++ b/archives/2019/11/index.html @@ -0,0 +1,659 @@ + + + + + + + + + Archives: 2019/11 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2019/12/index.html b/archives/2019/12/index.html new file mode 100644 index 0000000..5ea29f3 --- /dev/null +++ b/archives/2019/12/index.html @@ -0,0 +1,655 @@ + + + + + + + + + Archives: 2019/12 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2019/index.html b/archives/2019/index.html new file mode 100644 index 0000000..bfc8353 --- /dev/null +++ b/archives/2019/index.html @@ -0,0 +1,835 @@ + + + + + + + + + Archives: 2019 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2020/04/index.html b/archives/2020/04/index.html new file mode 100644 index 0000000..687f202 --- /dev/null +++ b/archives/2020/04/index.html @@ -0,0 +1,655 @@ + + + + + + + + + Archives: 2020/4 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2020/06/index.html b/archives/2020/06/index.html new file mode 100644 index 0000000..d479b95 --- /dev/null +++ b/archives/2020/06/index.html @@ -0,0 +1,749 @@ + + + + + + + + + Archives: 2020/6 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2020/07/index.html b/archives/2020/07/index.html new file mode 100644 index 0000000..0ce712a --- /dev/null +++ b/archives/2020/07/index.html @@ -0,0 +1,655 @@ + + + + + + + + + Archives: 2020/7 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2020/10/index.html b/archives/2020/10/index.html new file mode 100644 index 0000000..eca2497 --- /dev/null +++ b/archives/2020/10/index.html @@ -0,0 +1,659 @@ + + + + + + + + + Archives: 2020/10 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2020/12/index.html b/archives/2020/12/index.html new file mode 100644 index 0000000..7aca0fe --- /dev/null +++ b/archives/2020/12/index.html @@ -0,0 +1,663 @@ + + + + + + + + + Archives: 2020/12 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2020/index.html b/archives/2020/index.html new file mode 100644 index 0000000..d26efb8 --- /dev/null +++ b/archives/2020/index.html @@ -0,0 +1,933 @@ + + + + + + + + + Archives: 2020 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2021/10/index.html b/archives/2021/10/index.html new file mode 100644 index 0000000..19293cc --- /dev/null +++ b/archives/2021/10/index.html @@ -0,0 +1,702 @@ + + + + + + + + + Archives: 2021/10 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2021/12/index.html b/archives/2021/12/index.html new file mode 100644 index 0000000..c5a8bf2 --- /dev/null +++ b/archives/2021/12/index.html @@ -0,0 +1,655 @@ + + + + + + + + + Archives: 2021/12 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2021/index.html b/archives/2021/index.html new file mode 100644 index 0000000..949d3d1 --- /dev/null +++ b/archives/2021/index.html @@ -0,0 +1,745 @@ + + + + + + + + + Archives: 2021 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2022/01/index.html b/archives/2022/01/index.html new file mode 100644 index 0000000..99c5966 --- /dev/null +++ b/archives/2022/01/index.html @@ -0,0 +1,702 @@ + + + + + + + + + Archives: 2022/1 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2022/03/index.html b/archives/2022/03/index.html new file mode 100644 index 0000000..74fb737 --- /dev/null +++ b/archives/2022/03/index.html @@ -0,0 +1,702 @@ + + + + + + + + + Archives: 2022/3 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2022/index.html b/archives/2022/index.html new file mode 100644 index 0000000..2d44a1e --- /dev/null +++ b/archives/2022/index.html @@ -0,0 +1,792 @@ + + + + + + + + + Archives: 2022 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2023/09/index.html b/archives/2023/09/index.html new file mode 100644 index 0000000..2a48fa5 --- /dev/null +++ b/archives/2023/09/index.html @@ -0,0 +1,710 @@ + + + + + + + + + Archives: 2023/9 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2023/10/index.html b/archives/2023/10/index.html new file mode 100644 index 0000000..94f7e4c --- /dev/null +++ b/archives/2023/10/index.html @@ -0,0 +1,659 @@ + + + + + + + + + Archives: 2023/10 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/2023/index.html b/archives/2023/index.html new file mode 100644 index 0000000..1246962 --- /dev/null +++ b/archives/2023/index.html @@ -0,0 +1,757 @@ + + + + + + + + + Archives: 2023 | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/index.html b/archives/index.html new file mode 100644 index 0000000..828c651 --- /dev/null +++ b/archives/index.html @@ -0,0 +1,1094 @@ + + + + + + + + + Archives | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/page/2/index.html b/archives/page/2/index.html new file mode 100644 index 0000000..aa1e2cd --- /dev/null +++ b/archives/page/2/index.html @@ -0,0 +1,1084 @@ + + + + + + + + + Archives | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/page/3/index.html b/archives/page/3/index.html new file mode 100644 index 0000000..f52cfe2 --- /dev/null +++ b/archives/page/3/index.html @@ -0,0 +1,1064 @@ + + + + + + + + + Archives | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/archives/page/4/index.html b/archives/page/4/index.html new file mode 100644 index 0000000..12f2eeb --- /dev/null +++ b/archives/page/4/index.html @@ -0,0 +1,659 @@ + + + + + + + + + Archives | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/categories/index.html b/categories/index.html new file mode 100644 index 0000000..5ec6111 --- /dev/null +++ b/categories/index.html @@ -0,0 +1,768 @@ + + + + + + + + + categories | Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/content.json b/content.json new file mode 100644 index 0000000..43282a6 --- /dev/null +++ b/content.json @@ -0,0 +1 @@ +[{"title":"memos code analyze","date":"2023-10-07T08:04:51.908Z","path":"2023/10/07/Memos-Code-Analyze/","tags":[{"name":"golang","slug":"golang","permalink":"https://www.goroutine.cn/tags/golang/"},{"name":"memos","slug":"memos","permalink":"https://www.goroutine.cn/tags/memos/"}]},{"title":"Introduct to temporalio","date":"2023-09-18T15:42:06.533Z","path":"2023/09/18/Introduct-to-temporalio/","tags":[{"name":"工作流引擎","slug":"工作流引擎","permalink":"https://www.goroutine.cn/tags/%E5%B7%A5%E4%BD%9C%E6%B5%81%E5%BC%95%E6%93%8E/"},{"name":"Golang","slug":"Golang","permalink":"https://www.goroutine.cn/tags/Golang/"}]},{"title":"Introduct to go-clean-template","date":"2023-09-18T15:35:08.677Z","path":"2023/09/18/Introduct-to-go-clean-template/","tags":[{"name":"golang","slug":"golang","permalink":"https://www.goroutine.cn/tags/golang/"},{"name":"Microservices","slug":"Microservices","permalink":"https://www.goroutine.cn/tags/Microservices/"},{"name":"Architecture","slug":"Architecture","permalink":"https://www.goroutine.cn/tags/Architecture/"}]},{"title":"使用腾讯云cos+cdn搭建图片服务器","date":"2022-03-05T13:20:28.000Z","path":"2022/03/05/Tencent-COS-Image-Service/","tags":[{"name":"COS","slug":"COS","permalink":"https://www.goroutine.cn/tags/COS/"}]},{"title":"秒杀系统核心设计","date":"2022-03-02T15:12:44.000Z","path":"2022/03/02/seckill-md/","tags":[{"name":"Architecture","slug":"Architecture","permalink":"https://www.goroutine.cn/tags/Architecture/"},{"name":"秒杀","slug":"秒杀","permalink":"https://www.goroutine.cn/tags/%E7%A7%92%E6%9D%80/"}]},{"title":"Microservices in Action","date":"2022-01-10T12:24:33.000Z","path":"2022/01/10/Microservices-in-Action/","tags":[{"name":"Microservices","slug":"Microservices","permalink":"https://www.goroutine.cn/tags/Microservices/"},{"name":"Readingnotes","slug":"Readingnotes","permalink":"https://www.goroutine.cn/tags/Readingnotes/"}]},{"title":"Open Tracing","date":"2022-01-07T09:45:03.000Z","path":"2022/01/07/Open-Tracing/","tags":[{"name":"可观测","slug":"可观测","permalink":"https://www.goroutine.cn/tags/%E5%8F%AF%E8%A7%82%E6%B5%8B/"}]},{"title":"Application Tracking","date":"2021-12-04T12:41:25.000Z","path":"2021/12/04/Application-Tracking/","tags":[{"name":"可观测","slug":"可观测","permalink":"https://www.goroutine.cn/tags/%E5%8F%AF%E8%A7%82%E6%B5%8B/"}]},{"title":"Reliable Cron across the Planet","date":"2021-10-10T11:29:13.000Z","path":"2021/10/10/Reliable-Cron-across-the-Planet/","tags":[{"name":"分布式","slug":"分布式","permalink":"https://www.goroutine.cn/tags/%E5%88%86%E5%B8%83%E5%BC%8F/"},{"name":"cron","slug":"cron","permalink":"https://www.goroutine.cn/tags/cron/"}]},{"title":"libuv-source","date":"2021-10-04T03:00:51.000Z","path":"2021/10/04/libuv-source/","tags":[{"name":"libuv","slug":"libuv","permalink":"https://www.goroutine.cn/tags/libuv/"}]},{"title":"Introduction-to-memberlist","date":"2020-12-26T15:35:38.000Z","path":"2020/12/26/Introduction-to-memberlist/","tags":[{"name":"memberlist","slug":"memberlist","permalink":"https://www.goroutine.cn/tags/memberlist/"},{"name":"gossip","slug":"gossip","permalink":"https://www.goroutine.cn/tags/gossip/"},{"name":"分布式","slug":"分布式","permalink":"https://www.goroutine.cn/tags/%E5%88%86%E5%B8%83%E5%BC%8F/"}]},{"title":"Vscode Remote Connect failed","date":"2020-10-05T02:23:52.000Z","path":"2020/10/05/Vscode-Remote-Connect-failed/","tags":[{"name":"Vscode","slug":"Vscode","permalink":"https://www.goroutine.cn/tags/Vscode/"},{"name":"远程开发","slug":"远程开发","permalink":"https://www.goroutine.cn/tags/%E8%BF%9C%E7%A8%8B%E5%BC%80%E5%8F%91/"}]},{"title":"Introduction to Go Modules","date":"2020-07-02T11:59:58.000Z","path":"2020/07/02/Introduction-to-Go-Modules/","tags":[{"name":"golang","slug":"golang","permalink":"https://www.goroutine.cn/tags/golang/"}]},{"title":"Tencent Scf Version Manage","date":"2020-06-27T03:39:22.000Z","path":"2020/06/27/Tencent-Scf-Version-Manage/","tags":[{"name":"golang","slug":"golang","permalink":"https://www.goroutine.cn/tags/golang/"},{"name":"云函数","slug":"云函数","permalink":"https://www.goroutine.cn/tags/%E4%BA%91%E5%87%BD%E6%95%B0/"}]},{"title":"Functional options for friendly APIs","date":"2020-06-14T03:56:00.000Z","path":"2020/06/14/Functional-options-for-friendly-APIs/","tags":[{"name":"Configuration","slug":"Configuration","permalink":"https://www.goroutine.cn/tags/Configuration/"}]},{"title":"gomicro-config","date":"2020-06-08T14:41:46.000Z","path":"2020/06/08/gomicro-config/","tags":[{"name":"golang","slug":"golang","permalink":"https://www.goroutine.cn/tags/golang/"},{"name":"Microservices","slug":"Microservices","permalink":"https://www.goroutine.cn/tags/Microservices/"}]},{"title":"intern-recruitment","date":"2020-04-06T01:41:37.000Z","path":"2020/04/06/intern-recruitment/","tags":[{"name":"随笔","slug":"随笔","permalink":"https://www.goroutine.cn/tags/%E9%9A%8F%E7%AC%94/"}]},{"title":"golang viper tips","date":"2019-12-15T03:19:55.000Z","path":"2019/12/15/golang-viper-tips/","tags":[{"name":"Configuration","slug":"Configuration","permalink":"https://www.goroutine.cn/tags/Configuration/"}]},{"title":"docker redis install","date":"2019-11-16T16:02:16.000Z","path":"2019/11/17/docker-redis-install/","tags":[{"name":"docker","slug":"docker","permalink":"https://www.goroutine.cn/tags/docker/"},{"name":"redis","slug":"redis","permalink":"https://www.goroutine.cn/tags/redis/"}]},{"title":"docker nginx install","date":"2019-09-12T16:02:16.000Z","path":"2019/09/13/docker-nginx-install/","tags":[{"name":"docker","slug":"docker","permalink":"https://www.goroutine.cn/tags/docker/"},{"name":"nginx","slug":"nginx","permalink":"https://www.goroutine.cn/tags/nginx/"}]},{"title":"groupcache","date":"2019-08-21T15:31:42.000Z","path":"2019/08/21/groupcache/","tags":[{"name":"groupcache","slug":"groupcache","permalink":"https://www.goroutine.cn/tags/groupcache/"}]},{"title":"golang pprof","date":"2019-03-15T16:22:38.000Z","path":"2019/03/16/golang-pprof/","tags":[{"name":"golang","slug":"golang","permalink":"https://www.goroutine.cn/tags/golang/"}]},{"title":"Puppeteer coverage","date":"2018-10-29T12:24:15.000Z","path":"2018/10/29/Puppeteer-coverage/","tags":[{"name":"Puppeteer","slug":"Puppeteer","permalink":"https://www.goroutine.cn/tags/Puppeteer/"}]},{"title":"upload file via http","date":"2018-09-09T11:02:53.000Z","path":"2018/09/09/upload-file-via-http/","tags":[{"name":"nginx","slug":"nginx","permalink":"https://www.goroutine.cn/tags/nginx/"}]},{"title":"Unique ID generator","date":"2018-06-24T13:15:54.000Z","path":"2018/06/24/Unique-ID-generator/","tags":[{"name":"wechat","slug":"wechat","permalink":"https://www.goroutine.cn/tags/wechat/"},{"name":"UUID","slug":"UUID","permalink":"https://www.goroutine.cn/tags/UUID/"}]},{"title":"HTTPS performacne tips","date":"2018-06-03T10:32:33.000Z","path":"2018/06/03/HTTPS-performacne-tips/","tags":[{"name":"HTTPS","slug":"HTTPS","permalink":"https://www.goroutine.cn/tags/HTTPS/"}]},{"title":"HTTPS explained with carrier pigeons","date":"2018-06-03T08:15:33.000Z","path":"2018/06/03/HTTPS-explained-with-carrier-pigeons/","tags":[{"name":"HTTPS","slug":"HTTPS","permalink":"https://www.goroutine.cn/tags/HTTPS/"}]},{"title":"nginx-forward-http-x-forwarded-proto-header","date":"2018-06-03T00:16:59.000Z","path":"2018/06/03/nginx-forward-http-x-forwarded-proto-header/","tags":[{"name":"nginx","slug":"nginx","permalink":"https://www.goroutine.cn/tags/nginx/"}]},{"title":"nginx-accel-redirect","date":"2018-05-01T06:12:03.000Z","path":"2018/05/01/nginx-accel-redirect/","tags":[{"name":"nginx","slug":"nginx","permalink":"https://www.goroutine.cn/tags/nginx/"},{"name":"Authentication","slug":"Authentication","permalink":"https://www.goroutine.cn/tags/Authentication/"}]},{"title":"RWMutex in go","date":"2018-03-03T11:54:54.000Z","path":"2018/03/03/RWMutex-in-go/","tags":[{"name":"RWMutex","slug":"RWMutex","permalink":"https://www.goroutine.cn/tags/RWMutex/"}]},{"title":"常用 Git 命令清单","date":"2018-02-21T14:04:27.000Z","path":"2018/02/21/git/","tags":[{"name":"git","slug":"git","permalink":"https://www.goroutine.cn/tags/git/"}]}] \ No newline at end of file diff --git a/fonts/default-skin.b257fa.svg b/fonts/default-skin.b257fa.svg new file mode 100644 index 0000000..9d5f0c6 --- /dev/null +++ b/fonts/default-skin.b257fa.svg @@ -0,0 +1 @@ +default-skin 2 \ No newline at end of file diff --git a/fonts/fonteditor.3da1ef.woff b/fonts/fonteditor.3da1ef.woff new file mode 100644 index 0000000..1b4d090 Binary files /dev/null and b/fonts/fonteditor.3da1ef.woff differ diff --git a/fonts/fonteditor.3e0d4a.svg b/fonts/fonteditor.3e0d4a.svg new file mode 100644 index 0000000..8260185 --- /dev/null +++ b/fonts/fonteditor.3e0d4a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/fonts/fonteditor.86c132.eot b/fonts/fonteditor.86c132.eot new file mode 100644 index 0000000..e24809c Binary files /dev/null and b/fonts/fonteditor.86c132.eot differ diff --git a/fonts/fonteditor.bbc4b5.woff2 b/fonts/fonteditor.bbc4b5.woff2 new file mode 100644 index 0000000..798e514 Binary files /dev/null and b/fonts/fonteditor.bbc4b5.woff2 differ diff --git a/fonts/fonteditor.fe4d8a.ttf b/fonts/fonteditor.fe4d8a.ttf new file mode 100644 index 0000000..e0b54da Binary files /dev/null and b/fonts/fonteditor.fe4d8a.ttf differ diff --git a/fonts/tooltip.4004ff.svg b/fonts/tooltip.4004ff.svg new file mode 100644 index 0000000..252cb39 --- /dev/null +++ b/fonts/tooltip.4004ff.svg @@ -0,0 +1,6 @@ + + + + + diff --git a/gitment/APlayer.min.js b/gitment/APlayer.min.js new file mode 100644 index 0000000..b52c3cd --- /dev/null +++ b/gitment/APlayer.min.js @@ -0,0 +1,8 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("APlayer",[],t):"object"==typeof exports?exports.APlayer=t():e.APlayer=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var a=n[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=13)}([function(e,t,n){var r=n(3);"string"==typeof r&&(r=[[e.i,r,""]]);n(10)(r,{});r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function a(e){return 3*e.length/4-r(e)}function i(e){var t,n,a,i,o,l,s=e.length;o=r(e),l=new c(3*s/4-o),a=o>0?s-4:s;var u=0;for(t=0,n=0;t>16&255,l[u++]=i>>8&255,l[u++]=255&i;return 2===o?(i=p[e.charCodeAt(t)]<<2|p[e.charCodeAt(t+1)]>>4,l[u++]=255&i):1===o&&(i=p[e.charCodeAt(t)]<<10|p[e.charCodeAt(t+1)]<<4|p[e.charCodeAt(t+2)]>>2,l[u++]=i>>8&255,l[u++]=255&i),l}function o(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function l(e,t,n){for(var r,a=[],i=t;ip?p:s+o));return 1===r?(t=e[n-1],a+=u[t>>2],a+=u[t<<4&63],a+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],a+=u[t>>10],a+=u[t>>4&63],a+=u[t<<2&63],a+="="),i.push(a),i.join("")}t.byteLength=a,t.toByteArray=i,t.fromByteArray=s;for(var u=[],p=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=h.length;f=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),o.alloc(+e)}function g(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Q(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,n);case"utf8":case"utf-8":return L(this,t,n);case"ascii":return S(this,t,n);case"latin1":case"binary":return N(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function b(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function w(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:A(e,t,n,r,a);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):A(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function A(e,t,n,r,a){function i(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,l=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,l/=2,s/=2,n/=2}var u;if(a){var p=-1;for(u=n;ul&&(n=l-s),u=n;u>=0;u--){for(var c=!0,h=0;ha&&(r=a):r=a;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var o=0;o239?4:i>223?3:i>191?2:1;if(a+l<=n){var s,u,p,c;switch(l){case 1:i<128&&(o=i);break;case 2:s=e[a+1],128==(192&s)&&(c=(31&i)<<6|63&s)>127&&(o=c);break;case 3:s=e[a+1],u=e[a+2],128==(192&s)&&128==(192&u)&&(c=(15&i)<<12|(63&s)<<6|63&u)>2047&&(c<55296||c>57343)&&(o=c);break;case 4:s=e[a+1],u=e[a+2],p=e[a+3],128==(192&s)&&128==(192&u)&&128==(192&p)&&(c=(15&i)<<18|(63&s)<<12|(63&u)<<6|63&p)>65535&&c<1114112&&(o=c)}}null===o?(o=65533,l=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),a+=l}return C(r)}function C(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var a="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function Y(e,t,n,r,a,i){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function O(e,t,n,r){t<0&&(t=65535+t+1);for(var a=0,i=Math.min(e.length-n,2);a>>8*(r?a:1-a)}function q(e,t,n,r){t<0&&(t=4294967295+t+1);for(var a=0,i=Math.min(e.length-n,4);a>>8*(r?a:3-a)&255}function j(e,t,n,r,a,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(e,t,n,r,a){return a||j(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(e,t,n,r,23,4),n+4}function D(e,t,n,r,a){return a||j(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(e,t,n,r,52,8),n+8}function J(e){if(e=H(e).replace(te,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function H(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function _(e){return e<16?"0"+e.toString(16):e.toString(16)}function G(e,t){t=t||1/0;for(var n,r=e.length,a=null,i=[],o=0;o55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function Z(e){for(var t=[],n=0;n>8,a=n%256,i.push(a),i.push(r);return i}function Q(e){return W.toByteArray(J(e))}function V(e,t,n,r){for(var a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function K(e){return e!==e}/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var W=n(1),X=n(6),$=n(7);t.Buffer=o,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:r(),t.kMaxLength=a(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return l(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return u(null,e,t,n)},o.allocUnsafe=function(e){return p(null,e)},o.allocUnsafeSlow=function(e){return p(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,a=0,i=Math.min(n,r);a0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},o.prototype.compare=function(e,t,n,r,a){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,a>>>=0,this===e)return 0;for(var i=a-r,l=n-t,s=Math.min(i,l),u=this.slice(r,a),p=e.slice(t,n),c=0;ca)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return E(this,e,t,n);case"utf8":case"utf-8":return x(this,e,t,n);case"ascii":return T(this,e,t,n);case"latin1":case"binary":return B(this,e,t,n);case"base64":return M(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(a*=256);)r+=this[e+--t]*a;return r},o.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],a=1,i=0;++i=a&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,a=1,i=this[e+--r];r>0&&(a*=256);)i+=this[e+--r]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},o.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},o.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),X.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),X.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),X.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),X.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){Y(this,e,t,n,Math.pow(2,8*n)-1,0)}var a=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+a]=e/i&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):q(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):q(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);Y(this,e,t,n,a-1,-a)}var i=0,o=1,l=0;for(this[t]=255&e;++i>0)-l&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var a=Math.pow(2,8*n-1);Y(this,e,t,n,a-1,-a)}var i=n-1,o=1,l=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===l&&0!==this[t+i+1]&&(l=1),this[t+i]=(e/o>>0)-l&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):q(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Y(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):q(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return z(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return z(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--a)e[a+t]=this[a+n];else if(i<1e3||!o.TYPED_ARRAY_SUPPORT)for(a=0;a>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var i;if("number"==typeof e)for(i=t;i>1,p=-7,c=n?a-1:0,h=n?-1:1,f=e[t+c];for(c+=h,i=f&(1<<-p)-1,f>>=-p,p+=l;p>0;i=256*i+e[t+c],c+=h,p-=8);for(o=i&(1<<-p)-1,i>>=-p,p+=r;p>0;o=256*o+e[t+c],c+=h,p-=8);if(0===i)i=1-u;else{if(i===s)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),i-=u}return(f?-1:1)*o*Math.pow(2,i-r)},t.write=function(e,t,n,r,a,i){var o,l,s,u=8*i-a-1,p=(1<>1,h=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:i-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,o=p):(o=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-o))<1&&(o--,s*=2),t+=o+c>=1?h/s:h*Math.pow(2,1-c),t*s>=2&&(o++,s/=2),o+c>=p?(l=0,o=p):o+c>=1?(l=(t*s-1)*Math.pow(2,a),o+=c):(l=t*Math.pow(2,c-1)*Math.pow(2,a),o=0));a>=8;e[n+f]=255&l,f+=d,l/=256,a-=8);for(o=o<0;e[n+f]=255&o,f+=d,o/=256,u-=8);e[n+f-d]|=128*y}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var a=e[r];"."===a?e.splice(r,1):".."===a?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!a;i--){var o=i>=0?arguments[i]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,a="/"===o.charAt(0))}return t=n(r(t.split("/"),function(e){return!!e}),!a).join("/"),(a?"/":"")+t||"."},t.normalize=function(e){var a=t.isAbsolute(e),i="/"===o(e,-1);return e=n(r(e.split("/"),function(e){return!!e}),!a).join("/"),e||a||(e="."),e&&i&&(e+="/"),(a?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var a=r(e.split("/")),i=r(n.split("/")),o=Math.min(a.length,i.length),l=o,s=0;s1)for(var n=1;n=0&&v.splice(t,1)}function o(e){var t=document.createElement("style");return t.type="text/css",a(e,t),t}function l(e){var t=document.createElement("link");return t.rel="stylesheet",a(e,t),t}function s(e,t){var n,r,a;if(t.singleton){var s=g++;n=m||(m=o(t)),r=u.bind(null,n,s,!1),a=u.bind(null,n,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=l(t),r=c.bind(null,n),a=function(){i(n),n.href&&URL.revokeObjectURL(n.href)}):(n=o(t),r=p.bind(null,n),a=function(){i(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else a()}}function u(e,t,n,r){var a=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=b(t,a);else{var i=document.createTextNode(a),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(i,o[t]):e.appendChild(i)}}function p(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function c(e,t){var n=t.css,r=t.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([n],{type:"text/css"}),i=e.href;e.href=URL.createObjectURL(a),i&&URL.revokeObjectURL(i)}var h={},f=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}},d=f(function(){return/msie [6-9]\b/.test(self.navigator.userAgent.toLowerCase())}),y=f(function(){return document.head||document.getElementsByTagName("head")[0]}),m=null,g=0,v=[];e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},void 0===t.singleton&&(t.singleton=d()),void 0===t.insertAt&&(t.insertAt="bottom");var a=r(e);return n(a,t),function(e){for(var i=[],o=0;o\n \n \n \n '},this.isMobile=/mobile/i.test(window.navigator.userAgent),this.isMobile&&(t.autoplay=!1);var s={element:document.getElementsByClassName("aplayer")[0],narrow:!1,autoplay:!1,mutex:!0,showlrc:0,theme:"#b7daff",mode:"circulation"};for(var u in s)s.hasOwnProperty(u)&&!t.hasOwnProperty(u)&&(t[u]=s[u]);if(this.option=t,this.audios=[],this.mode=t.mode,this.secondToTime=function(e){if(isNaN(e))return"00:00";var t=function(e){return e<10?"0"+e:""+e},n=parseInt(e/60),r=parseInt(e-60*n),a=parseInt(n/60),i=parseInt(e/60-60*parseInt(e/60/60));return e>=3600?t(a)+":"+t(i)+":"+t(r):t(n)+":"+t(r)},this.element=this.option.element,2===this.option.showlrc||this.option.showlrc===!0){this.savelrc=[];for(var p=0;p0?t:0,t=t<1?t:1,y[e+"Bar"].style[n]=100*t+"%"},this.updateLrc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.audio.currentTime;if(i.lrcIndex>i.lrc.length-1||e=i.lrc[i.lrcIndex+1][0])for(var t=0;t=i.lrc[t][0]&&(!i.lrc[t+1]||e1&&this.element.classList.add("aplayer-withlist"),this.multiple||"circulation"===this.mode||"order"===this.mode||(this.mode="circulation"),this.getRandomOrder();for(var f='\n
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n - 00:00 / 00:00\n \n
\n \n
\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n
    ',d=0;d\n \n '+(d+1)+'\n '+this.option.music[d].title+'\n '+this.option.music[d].author+"\n ";f+="\n
\n
",this.element.innerHTML=f,this.element.offsetWidth<300&&(this.element.getElementsByClassName("aplayer-icon-mode")[0].style.display="none"),this.ptime=this.element.getElementsByClassName("aplayer-ptime")[0],this.element.getElementsByClassName("aplayer-info")[0].offsetWidth<200&&this.element.getElementsByClassName("aplayer-time")[0].classList.add("aplayer-time-narrow");var y={};y.barWrap=this.element.getElementsByClassName("aplayer-bar-wrap")[0],this.option.narrow&&this.element.classList.add("aplayer-narrow"),this.button=this.element.getElementsByClassName("aplayer-button")[0],this.button.addEventListener("click",function(e){i.toggle()});var m=this.element.getElementsByClassName("aplayer-list")[0];m.addEventListener("click",function(e){var t=void 0;t="LI"===e.target.tagName.toUpperCase()?e.target:e.target.parentElement;var n=parseInt(t.getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;n!==i.playIndex?(i.setMusic(n),i.play()):i.toggle()}),y.playedBar=this.element.getElementsByClassName("aplayer-played")[0],y.loadedBar=this.element.getElementsByClassName("aplayer-loaded")[0];var g=this.element.getElementsByClassName("aplayer-thumb")[0],v=void 0;y.barWrap.addEventListener("click",function(e){var t=e||window.event;v=y.barWrap.clientWidth;var r=(t.clientX-n(y.barWrap))/v;isNaN(i.audio.duration)?i.updateBar("played",0,"width"):(i.updateBar("played",r,"width"),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(r*i.audio.duration),i.audio.currentTime=parseFloat(y.playedBar.style.width)/100*i.audio.duration)}),g.addEventListener("mouseover",function(){g.style.background=i.option.theme}),g.addEventListener("mouseout",function(){g.style.background="#fff"});var b=function(e){var t=e||window.event,r=(t.clientX-n(y.barWrap))/v;r=r>0?r:0,r=r<1?r:1,i.updateBar("played",r,"width"),i.option.showlrc&&i.updateLrc(parseFloat(y.playedBar.style.width)/100*i.audio.duration),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(r*i.audio.duration)},w=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",b),isNaN(i.audio.duration)?i.updateBar("played",0,"width"):(i.audio.currentTime=parseFloat(y.playedBar.style.width)/100*i.audio.duration,i.playedTime=setInterval(function(){i.updateBar("played",i.audio.currentTime/i.audio.duration,"width"),i.option.showlrc&&i.updateLrc(),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(i.audio.currentTime),i.trigger("playing")},100))};g.addEventListener("mousedown",function(){v=y.barWrap.clientWidth,clearInterval(i.playedTime),document.addEventListener("mousemove",b),document.addEventListener("mouseup",w)}),y.volumeBar=this.element.getElementsByClassName("aplayer-volume")[0];var A=this.element.getElementsByClassName("aplayer-volume-bar")[0];this.volumeicon=this.element.getElementsByClassName("aplayer-time")[0].getElementsByTagName("button")[0];var E=35;this.element.getElementsByClassName("aplayer-volume-bar-wrap")[0].addEventListener("click",function(e){var t=e||window.event,n=(E-t.clientY+r(A))/E;n=n>0?n:0,n=n<1?n:1,i.volume(n)}),this.volumeicon.addEventListener("click",function(){i.audio.muted?(i.audio.muted=!1,i.volumeicon.className=1===i.audio.volume?"aplayer-icon aplayer-icon-volume-up":"aplayer-icon aplayer-icon-volume-down",1===i.audio.volume?(i.volumeicon.className="aplayer-icon aplayer-icon-volume-up",i.volumeicon.innerHTML=i.getSVG("volume-up")):(i.volumeicon.className="aplayer-icon aplayer-icon-volume-down",i.volumeicon.innerHTML=i.getSVG("volume-down")),i.updateBar("volume",i.audio.volume,"height")):(i.audio.muted=!0,i.volumeicon.className="aplayer-icon aplayer-icon-volume-off",i.volumeicon.innerHTML=i.getSVG("volume-off"),i.updateBar("volume",0,"height"))});var x=this.element.getElementsByClassName("aplayer-icon-mode")[0];x.addEventListener("click",function(){i.multiple?"random"===i.mode?i.mode="single":"single"===i.mode?i.mode="order":"order"===i.mode?i.mode="circulation":"circulation"===i.mode&&(i.mode="random"):"circulation"===i.mode?i.mode="order":i.mode="circulation",x.innerHTML=i.getSVG(i.mode),i.audio.loop=!(i.multiple||"order"===i.mode)}),m.style.height=m.offsetHeight+"px",this.element.getElementsByClassName("aplayer-icon-menu")[0].addEventListener("click",function(){m.classList.contains("aplayer-list-hide")?m.classList.remove("aplayer-list-hide"):m.classList.add("aplayer-list-hide")}),"random"===this.mode?this.setMusic(this.randomOrder[0]):this.setMusic(0),o.push(this)}return i(e,[{key:"setMusic",value:function(e){var t=this;void 0!==e&&(this.playIndex=e);var n=this.playIndex;this.music=this.option.music[n],this.music.pic&&(this.element.getElementsByClassName("aplayer-pic")[0].style.backgroundImage="url('"+this.music.pic+"')"),this.element.getElementsByClassName("aplayer-title")[0].innerHTML=this.music.title,this.element.getElementsByClassName("aplayer-author")[0].innerHTML=" - "+this.music.author,this.element.getElementsByClassName("aplayer-list-light")[0]&&this.element.getElementsByClassName("aplayer-list-light")[0].classList.remove("aplayer-list-light"),this.element.getElementsByClassName("aplayer-list")[0].getElementsByTagName("li")[n].classList.add("aplayer-list-light"),this.audio&&(this.pause(),this.audio.currentTime=0),this.element.getElementsByClassName("aplayer-list")[0].scrollTop=33*n,this.audios[n]?(this.audio=this.audios[n],this.audio.volume=parseInt(this.element.getElementsByClassName("aplayer-volume")[0].style.height)/100,this.audio.currentTime=0):(this.audio=document.createElement("audio"),this.audio.src=this.music.url,this.audio.preload=this.option.preload?this.option.preload:"auto",this.audio.addEventListener("play",function(){if(t.button.classList.contains("aplayer-play")){if(t.button.classList.remove("aplayer-play"),t.button.classList.add("aplayer-pause"),t.button.innerHTML="",setTimeout(function(){t.button.innerHTML='\n "},100),t.option.mutex)for(var e=0;e'+t.getSVG("play")+" "},100),clearInterval(t.playedTime),t.trigger("pause"))}),this.audio.addEventListener("durationchange",function(){1!==t.audio.duration&&(t.element.getElementsByClassName("aplayer-dtime")[0].innerHTML=t.secondToTime(t.audio.duration))}),this.audio.addEventListener("progress",function(){var e=t.audio.buffered.length?t.audio.buffered.end(t.audio.buffered.length-1)/t.audio.duration:0;t.updateBar("loaded",e,"width")}),this.audio.addEventListener("error",function(){t.element.getElementsByClassName("aplayer-author")[0].innerHTML=" - Error happens ╥﹏╥",t.trigger("pause")}),this.audio.addEventListener("canplay",function(){t.trigger("canplay")}),this.ended=!1,this.audio.addEventListener("ended",function(){if(t.multiple){if(t.isMobile)return t.ended=!0,void t.pause();0!==t.audio.currentTime&&("random"===t.mode?t.setMusic(t.nextRandomNum()):"single"===t.mode?t.setMusic(t.playIndex):"order"===t.mode?t.playIndex=200&&l.status<300||304===l.status?(i=l.responseText,t.lrcs[a]=r(i)):(console.log("Request was unsuccessful: "+l.status),t.lrcs[a]=[["00:00","Not available"]]),t.lrc=t.lrcs[a];var e="";t.lrcContents=t.element.getElementsByClassName("aplayer-lrc-contents")[0];for(var n=0;n"+t.lrc[n][1]+"

";t.lrcContents.innerHTML=e,t.lrcIndex||(t.lrcIndex=0),t.lrcContents.getElementsByTagName("p")[0].classList.add("aplayer-lrc-current"),t.lrcContents.style.transform="translateY(0px)",t.lrcContents.style.webkitTransform="translateY(0px)"}};var s=void 0;s=this.option.music[a].lrc,l.open("get",s,!0),l.send(null)}i?this.lrcs[a]=r(i):3===this.option.showlrc?this.lrcs[a]=[["00:00","Loading"]]:this.lrcs[a]=[["00:00","Not available"]]}this.lrc=this.lrcs[a];var u="";this.lrcContents=this.element.getElementsByClassName("aplayer-lrc-contents")[0];for(var p=0;p"+this.lrc[p][1]+"

";this.lrcContents.innerHTML=u,this.lrcIndex||(this.lrcIndex=0),this.lrcContents.getElementsByTagName("p")[0].classList.add("aplayer-lrc-current"),this.lrcContents.style.transform="translateY(0px)",this.lrcContents.style.webkitTransform="translateY(0px)"}1!==this.audio.duration&&(this.element.getElementsByClassName("aplayer-dtime")[0].innerHTML=this.audio.duration?this.secondToTime(this.audio.duration):"00:00"),this.option.autoplay&&!this.isMobile&&this.play(),this.option.autoplay=!0,this.isMobile&&this.pause()}},{key:"play",value:function(e){"[object Number]"===Object.prototype.toString.call(e)&&(this.audio.currentTime=e),this.audio.paused&&this.audio.play()}},{key:"pause",value:function(){this.audio.paused||this.audio.pause()}},{key:"volume",value:function(e){this.updateBar("volume",e,"height"),this.audio.volume=e,this.audio.muted&&(this.audio.muted=!1),1===e?(this.volumeicon.className="aplayer-icon aplayer-icon-volume-up",this.volumeicon.innerHTML=this.getSVG("volume-up")):(this.volumeicon.className="aplayer-icon aplayer-icon-volume-down",this.volumeicon.innerHTML=this.getSVG("volume-down"))}},{key:"on",value:function(e,t){"function"==typeof t&&this.event[e].push(t)}},{key:"toggle",value:function(){this.button.classList.contains("aplayer-play")?this.play():this.button.classList.contains("aplayer-pause")&&this.pause()}},{key:"getRandomOrder",value:function(){function e(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}function t(t){for(var n,r=t.length,a=new Array(r),i=0;i\n \n '+(this.option.music.length-e.length+a+1)+'\n '+e[a].title+'\n '+e[a].author+"\n ";n.innerHTML+=r,this.multiple||(this.multiple=!0,this.element.classList.add("aplayer-withlist"),this.audio.loop=!1),t.style.height="auto",t.style.height=t.offsetHeight+"px",this.getRandomOrder()}}]),e}();e.exports=l}])}); +//# sourceMappingURL=APlayer.min.js.map diff --git a/img/alipay.jpg b/img/alipay.jpg new file mode 100644 index 0000000..a66dfa1 Binary files /dev/null and b/img/alipay.jpg differ diff --git a/img/biubiubiu.gif b/img/biubiubiu.gif new file mode 100644 index 0000000..d7ef2b0 Binary files /dev/null and b/img/biubiubiu.gif differ diff --git a/img/default-skin.png b/img/default-skin.png new file mode 100644 index 0000000..441c502 Binary files /dev/null and b/img/default-skin.png differ diff --git a/img/forkme.png b/img/forkme.png new file mode 100644 index 0000000..c380274 Binary files /dev/null and b/img/forkme.png differ diff --git a/img/gitee.svg b/img/gitee.svg new file mode 100644 index 0000000..626ab00 --- /dev/null +++ b/img/gitee.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/img/head.jpg b/img/head.jpg new file mode 100644 index 0000000..37a86a2 Binary files /dev/null and b/img/head.jpg differ diff --git a/img/preloader.gif b/img/preloader.gif new file mode 100644 index 0000000..b8faa69 Binary files /dev/null and b/img/preloader.gif differ diff --git a/img/scrollbar_arrow.png b/img/scrollbar_arrow.png new file mode 100644 index 0000000..81bba97 Binary files /dev/null and b/img/scrollbar_arrow.png differ diff --git a/img/weixin.png b/img/weixin.png new file mode 100644 index 0000000..b96ad09 Binary files /dev/null and b/img/weixin.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..a1c295b --- /dev/null +++ b/index.html @@ -0,0 +1,1553 @@ + + + + + + + + + Utopian + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+
+ +
+ +
+
+ + + + Fork me on GitHub + + + + +
+ +
+ + +
+ + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + +
+
+

tag:

+ + +
+
    +

    + 缺失模块。
    1、请确保node版本大于6.2
    2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
    npm i hexo-generator-json-content --save

    + 3、在根目录_config.yml里添加配置: +

    +  jsonContent:
    +    meta: false
    +    pages: false
    +    posts:
    +      title: true
    +      date: true
    +      path: true
    +      text: false
    +      raw: false
    +      content: false
    +      slug: false
    +      updated: false
    +      comments: false
    +      link: false
    +      permalink: false
    +      excerpt: false
    +      categories: false
    +      tags: true
    +
    +

    +
  • + +

    + + +

    +

    + + +

    +
  • +
+
+ + + +
+ + + +
+ + + +
+ + +
主要涉及技术:
后端开发、微服务、分布式
公众号开发、开源爱好者、Linux
+ +
+ +
+ +
+ + +
+ + + + + + + + + + + + + + diff --git a/lib/busuanzi.pure.js b/lib/busuanzi.pure.js new file mode 100644 index 0000000..2b60732 --- /dev/null +++ b/lib/busuanzi.pure.js @@ -0,0 +1 @@ +var bszCaller,bszTag;!function(){var t,e,n,a=!1,c=[];ready=function(t){return a||"interactive"===document.readyState||"complete"===document.readyState?t.call(document):c.push(function(){return t.call(this)}),this},e=function(){for(var t=0,e=c.length;t:first-child,.gitment-editor-preview>:first-child{margin-top:0!important}.gitment-comment-body>:last-child,.gitment-editor-preview>:last-child{margin-bottom:0!important}.gitment-editor-body textarea{display:block;max-height:500px;resize:vertical;max-width:100%;margin:0;line-height:1.6;background-color:#fff;color:#333;vertical-align:middle;border:none;border-radius:0;outline:0;box-shadow:none;overflow:visible}.gitment-editor-body textarea:focus{background-color:#fff}.gitment-editor-preview{background-color:transparent;line-height:1.5;word-wrap:break-word}.gitment-editor-footer{padding:0;margin-top:10px}.gitment-editor-footer::after{display:table;clear:both;content:""}a.gitment-editor-footer-tip{display:inline-block;padding-top:10px;font-size:12px;color:#666}a.gitment-editor-footer-tip:hover{color:#2196F3;text-decoration:none}.gitment-comments-pagination{list-style:none;text-align:right;border-radius:0;margin:-19px 0 19px}.gitment-comments-page-item{display:inline-block;cursor:pointer;border:1px solid #CFD8DC;margin-left:-1px;padding:.25rem .5rem}.gitment-comments-page-item.gitment-selected,.gitment-comments-page-item:hover{background-color:#f5f5f5}.gitment-comments-init-btn,.gitment-editor-submit{color:#fff;background-color:#00BCD4;position:relative;display:inline-block;padding:7px 13px;font-size:14px;font-weight:600;line-height:20px;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-size:110% 110%;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gitment-comments-init-btn:hover,.gitment-editor-submit:hover{background-color:#00ACC1}.gitment-comments-init-btn:disabled,.gitment-editor-submit:disabled{color:rgba(255,255,255,.75);background-color:#4DD0E1;box-shadow:none}.gitment-editor-submit{float:right}.gitment-footer-container{margin-top:30px;margin-bottom:20px;text-align:right;font-size:12px}.gitment-markdown{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;color:#333;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px;line-height:1.5;word-wrap:break-word}.gitment-markdown .pl-c{color:#969896}.gitment-markdown .pl-c1,.gitment-markdown .pl-s .pl-v{color:#0086b3}.gitment-markdown .pl-e,.gitment-markdown .pl-en{color:#795da3}.gitment-markdown .pl-s .pl-s1,.gitment-markdown .pl-smi{color:#333}.gitment-markdown .pl-ent{color:#63a35c}.gitment-markdown .pl-k{color:#a71d5d}.gitment-markdown .pl-pds,.gitment-markdown .pl-s,.gitment-markdown .pl-s .pl-pse .pl-s1,.gitment-markdown .pl-sr,.gitment-markdown .pl-sr .pl-cce,.gitment-markdown .pl-sr .pl-sra,.gitment-markdown .pl-sr .pl-sre{color:#183691}.gitment-markdown .pl-smw,.gitment-markdown .pl-v{color:#ed6a43}.gitment-markdown .pl-bu{color:#b52a1d}.gitment-markdown .pl-c2,.gitment-markdown .pl-ii{color:#f8f8f8;background-color:#b52a1d}.gitment-markdown .pl-c2::before{content:"^M"}.gitment-markdown .pl-sr .pl-cce{font-weight:700;color:#63a35c}.gitment-markdown .pl-ml{color:#693a17}.gitment-markdown .pl-mh,.gitment-markdown .pl-mh .pl-en,.gitment-markdown .pl-ms{font-weight:700;color:#1d3e81}.gitment-markdown .pl-mq{color:teal}.gitment-markdown .pl-mi{font-style:italic;color:#333}.gitment-markdown .pl-mb{font-weight:700;color:#333}.gitment-markdown .pl-md{color:#bd2c00;background-color:#ffecec}.gitment-markdown .pl-mi1{color:#55a532;background-color:#eaffea}.gitment-markdown .pl-mc{color:#ef9700;background-color:#ffe3b4}.gitment-markdown .pl-mi2{color:#d8d8d8;background-color:grey}.gitment-markdown .pl-mdr{font-weight:700;color:#795da3}.gitment-markdown .pl-mo{color:#1d3e81}.gitment-markdown .pl-ba{color:#595e62}.gitment-markdown .pl-sg{color:silver}.gitment-markdown .pl-corl{text-decoration:underline;color:#183691}.gitment-markdown .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.gitment-markdown hr::after,.gitment-markdown hr::before,.gitment-markdown::after,.gitment-markdown::before{display:table;content:""}.gitment-markdown a{background-color:transparent;-webkit-text-decoration-skip:objects;color:#0366d6;text-decoration:none}.gitment-markdown a:active,.gitment-markdown a:hover{outline-width:0}.gitment-markdown h1{margin:.67em 0}.gitment-markdown img{border-style:none}.gitment-markdown svg:not(:root){overflow:hidden}.gitment-markdown hr{box-sizing:content-box}.gitment-markdown input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.gitment-markdown [type=checkbox]{box-sizing:border-box;padding:0}.gitment-markdown *{box-sizing:border-box}.gitment-markdown a:hover{text-decoration:underline}.gitment-markdown strong{font-weight:600}.gitment-markdown td,.gitment-markdown th{padding:0}.gitment-markdown blockquote{margin:0}.gitment-markdown ol ol,.gitment-markdown ul ol{list-style-type:lower-roman}.gitment-markdown ol ol ol,.gitment-markdown ol ul ol,.gitment-markdown ul ol ol,.gitment-markdown ul ul ol{list-style-type:lower-alpha}.gitment-markdown dd{margin-left:0}.gitment-markdown code{font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace}.gitment-markdown pre{font:12px SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;word-wrap:normal}.gitment-markdown .pl-0{padding-left:0!important}.gitment-markdown .pl-1{padding-left:4px!important}.gitment-markdown .pl-2{padding-left:8px!important}.gitment-markdown .pl-3{padding-left:16px!important}.gitment-markdown .pl-4{padding-left:24px!important}.gitment-markdown .pl-5{padding-left:32px!important}.gitment-markdown .pl-6{padding-left:40px!important}.gitment-markdown>:first-child{margin-top:0!important}.gitment-markdown>:last-child{margin-bottom:0!important}.gitment-markdown a:not([href]){color:inherit;text-decoration:none}.gitment-markdown .anchor{float:left;padding-right:4px;margin-left:-20px;line-height:1}.gitment-markdown .anchor:focus{outline:0}.gitment-markdown blockquote,.gitment-markdown dl,.gitment-markdown ol,.gitment-markdown p,.gitment-markdown pre,.gitment-markdown table,.gitment-markdown ul{margin-top:0;margin-bottom:16px}.gitment-markdown hr{overflow:hidden;background:#e1e4e8;height:.25em;padding:0;margin:24px 0;border:0}.gitment-markdown blockquote{padding:0 1em;color:#6a737d;border-left:.25em solid #dfe2e5}.gitment-markdown h1,.gitment-markdown h2{padding-bottom:.3em;border-bottom:1px solid #eaecef}.gitment-markdown blockquote>:first-child{margin-top:0}.gitment-markdown blockquote>:last-child{margin-bottom:0}.gitment-markdown h1,.gitment-markdown h2,.gitment-markdown h3,.gitment-markdown h4,.gitment-markdown h5,.gitment-markdown h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.gitment-markdown h1 .octicon-link,.gitment-markdown h2 .octicon-link,.gitment-markdown h3 .octicon-link,.gitment-markdown h4 .octicon-link,.gitment-markdown h5 .octicon-link,.gitment-markdown h6 .octicon-link{color:#1b1f23;vertical-align:middle;visibility:hidden}.gitment-markdown h1:hover .anchor,.gitment-markdown h2:hover .anchor,.gitment-markdown h3:hover .anchor,.gitment-markdown h4:hover .anchor,.gitment-markdown h5:hover .anchor,.gitment-markdown h6:hover .anchor{text-decoration:none}.gitment-markdown h1:hover .anchor .octicon-link,.gitment-markdown h2:hover .anchor .octicon-link,.gitment-markdown h3:hover .anchor .octicon-link,.gitment-markdown h4:hover .anchor .octicon-link,.gitment-markdown h5:hover .anchor .octicon-link,.gitment-markdown h6:hover .anchor .octicon-link{visibility:visible}.gitment-markdown h1{font-size:2em}.gitment-markdown h2{font-size:1.5em}.gitment-markdown h3{font-size:1.25em}.gitment-markdown h4{font-size:1em}.gitment-markdown h5{font-size:.875em}.gitment-markdown h6{font-size:.85em;color:#6a737d}.gitment-markdown ol,.gitment-markdown ul{padding-left:2em}.gitment-markdown ol ol,.gitment-markdown ol ul,.gitment-markdown ul ol,.gitment-markdown ul ul{margin-top:0;margin-bottom:0}.gitment-markdown li>p{margin-top:16px}.gitment-markdown li+li{margin-top:.25em}.gitment-markdown dl{padding:0}.gitment-markdown dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:600}.gitment-markdown dl dd{padding:0 16px;margin-bottom:16px}.gitment-markdown table{border-spacing:0;border-collapse:collapse;display:block;width:100%;overflow:auto}.gitment-markdown table th{font-weight:600}.gitment-markdown table td,.gitment-markdown table th{padding:6px 13px;border:1px solid #dfe2e5}.gitment-markdown table tr{background-color:#fff;border-top:1px solid #c6cbd1}.gitment-markdown table tr:nth-child(2n){background-color:#f5f5f5}.gitment-markdown img{max-width:100%;box-sizing:content-box;background-color:#fff}.gitment-markdown code{padding:.2em 0;margin:0;font-size:85%;background-color:rgba(27,31,35,.05);border-radius:0}.gitment-markdown code::after,.gitment-markdown code::before{letter-spacing:-.2em;content:"\00a0"}.gitment-markdown pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:0 0;border:0}.gitment-markdown .highlight{margin-bottom:16px}.gitment-markdown .highlight pre{margin-bottom:0;word-break:normal}.gitment-markdown .highlight pre,.gitment-markdown pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f5f5f5;border-radius:0}.gitment-markdown pre code{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.gitment-markdown pre code::after,.gitment-markdown pre code::before{content:normal}.gitment-markdown .full-commit .btn-outline:not(:disabled):hover{color:#005cc5;border-color:#005cc5}.gitment-markdown kbd{display:inline-block;padding:3px 5px;font:11px SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;line-height:10px;color:#444d56;vertical-align:middle;background-color:#fcfcfc;border:1px solid #c6cbd1;border-bottom-color:#959da5;border-radius:0;box-shadow:inset 0 -1px 0 #959da5}.gitment-markdown :checked+.radio-label{position:relative;z-index:1;border-color:#0366d6}.gitment-markdown .task-list-item{list-style-type:none}.gitment-markdown .task-list-item+.task-list-item{margin-top:3px}.gitment-markdown .task-list-item input{margin:0 .2em .25em -1.6em;vertical-align:middle}.gitment-markdown hr{border-bottom-color:#eee}.giteement-role-label{background:grey;color:#fff;border:1px solid #000;cursor:default;border-radius:4px;margin-left:5px}.giteement-at-ol{background:#f7f7f7;color:#40485b;display:inline-block;border:1px solid #DDD;border-radius:3px;box-shadow:0 0 5px rgba(0,0,0,.1);padding:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Liberation Sans","PingFang SC","Microsoft YaHei","Hiragino Sans GB","Wenquanyi Micro Hei","WenQuanYi Zen Hei","ST Heiti",SimHei,"WenQuanYi Zen Hei Sharp",sans-serif;font-size:14px;line-height:1.33}.giteement-at-li{list-style:none;border-bottom:1px solid #DDD;cursor:pointer;padding:5px 10px}.giteement-at-li-tail{border-bottom:0}.giteement-at-li-select,.giteement-at-li:hover{background:#36F;color:#fff}.giteement-at-div{position:absolute;display:none}.giteement-at-outdiv{position:relative}.textarea-mirror{padding:16px} \ No newline at end of file diff --git a/lib/giteement.browser.js b/lib/giteement.browser.js new file mode 100644 index 0000000..836b642 --- /dev/null +++ b/lib/giteement.browser.js @@ -0,0 +1 @@ +var _typeof3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof2="function"==typeof Symbol&&"symbol"==_typeof3(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof3(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof3(e)},_typeof="function"==typeof Symbol&&"symbol"==_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)},Giteement=function(n){var o={};function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}return r.m=n,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==(void 0===t?"undefined":_typeof(t))&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=126)}([function(e,o,Jn){(function(In){var e,t,n,Rn="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof(e)};n=function(){var e,r;function M(){return e.apply(null,arguments)}function s(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function d(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function u(e){return void 0===e}function l(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function c(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function _(e,t){var n,o=[];for(n=0;n>>0,o=0;oge(e)?(i=e+1,s-ge(e)):(i=e,s),{year:i,dayOfYear:a}}function Ie(e,t,n){var o,r,i=Fe(e.year(),t,n),a=Math.floor((e.dayOfYear()-i-1)/7)+1;return a<1?o=a+Re(r=e.year()-1,t,n):a>Re(e.year(),t,n)?(o=a-Re(e.year(),t,n),r=e.year()+1):(r=e.year(),o=a),{week:o,year:r}}function Re(e,t,n){var o=Fe(e,t,n),r=Fe(e+1,t,n);return(ge(e)-o+r)/7}R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),O("week","w"),O("isoWeek","W"),C("week",5),C("isoWeek",5),de("w",K),de("ww",K,V),de("W",K),de("WW",K,V),_e(["w","ww","W","WW"],function(e,t,n,o){t[o.substr(0,1)]=k(e)}),R("d",0,"do","day"),R("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),R("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),R("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),O("day","d"),O("weekday","e"),O("isoWeekday","E"),C("day",11),C("weekday",11),C("isoWeekday",11),de("d",K),de("e",K),de("E",K),de("dd",function(e,t){return t.weekdaysMinRegex(e)}),de("ddd",function(e,t){return t.weekdaysShortRegex(e)}),de("dddd",function(e,t){return t.weekdaysRegex(e)}),_e(["dd","ddd","dddd"],function(e,t,n,o){var r=n._locale.weekdaysParse(e,o,n._strict);null!=r?t.d=r:L(n).invalidWeekday=e}),_e(["d","e","E"],function(e,t,n,o){t[o]=k(e)});var Je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),qe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ue="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ve=ae,Be=ae,Ge=ae;function $e(){function e(e,t){return t.length-e.length}var t,n,o,r,i,a=[],s=[],d=[],u=[];for(t=0;t<7;t++)n=f([2e3,1]).day(t),o=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),i=this.weekdays(n,""),a.push(o),s.push(r),d.push(i),u.push(o),u.push(r),u.push(i);for(a.sort(e),s.sort(e),d.sort(e),u.sort(e),t=0;t<7;t++)s[t]=ue(s[t]),d[t]=ue(d[t]),u[t]=ue(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Ke(){return this.hours()%12||12}function Ze(e,t){R(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Xe(e,t){return t._meridiemParse}R("H",["HH",2],0,"hour"),R("h",["hh",2],0,Ke),R("k",["kk",2],0,function(){return this.hours()||24}),R("hmm",0,0,function(){return""+Ke.apply(this)+W(this.minutes(),2)}),R("hmmss",0,0,function(){return""+Ke.apply(this)+W(this.minutes(),2)+W(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+W(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+W(this.minutes(),2)+W(this.seconds(),2)}),Ze("a",!0),Ze("A",!1),O("hour","h"),C("hour",13),de("a",Xe),de("A",Xe),de("H",K),de("h",K),de("k",K),de("HH",K,V),de("hh",K,V),de("kk",K,V),de("hmm",Z),de("hmmss",X),de("Hmm",Z),de("Hmmss",X),ce(["H","HH"],ye),ce(["k","kk"],function(e,t,n){var o=k(e);t[ye]=24===o?0:o}),ce(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ce(["h","hh"],function(e,t,n){t[ye]=k(e),L(n).bigHour=!0}),ce("hmm",function(e,t,n){var o=e.length-2;t[ye]=k(e.substr(0,o)),t[he]=k(e.substr(o)),L(n).bigHour=!0}),ce("hmmss",function(e,t,n){var o=e.length-4,r=e.length-2;t[ye]=k(e.substr(0,o)),t[he]=k(e.substr(o,2)),t[Me]=k(e.substr(r)),L(n).bigHour=!0}),ce("Hmm",function(e,t,n){var o=e.length-2;t[ye]=k(e.substr(0,o)),t[he]=k(e.substr(o))}),ce("Hmmss",function(e,t,n){var o=e.length-4,r=e.length-2;t[ye]=k(e.substr(0,o)),t[he]=k(e.substr(o,2)),t[Me]=k(e.substr(r))});var Qe,et=De("Hours",!0),tt={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:He,monthsShort:Oe,week:{dow:0,doy:6},weekdays:Je,weekdaysMin:Ue,weekdaysShort:qe,meridiemParse:/[ap]\.?m?\.?/i},nt={},ot={};function rt(e){return e?e.toLowerCase().replace("_","-"):e}function it(e){var t=null;if(!nt[e]&&void 0!==In&&In&&In.exports)try{t=Qe._abbr,Jn(131)("./"+e),at(t)}catch(e){}return nt[e]}function at(e,t){var n;return e&&((n=u(t)?dt(e):st(e,t))?Qe=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Qe._abbr}function st(e,t){if(null===t)return delete nt[e],null;var n,o=tt;if(t.abbr=e,null!=nt[e])w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),o=nt[e]._config;else if(null!=t.parentLocale)if(null!=nt[t.parentLocale])o=nt[t.parentLocale]._config;else{if(null==(n=it(t.parentLocale)))return ot[t.parentLocale]||(ot[t.parentLocale]=[]),ot[t.parentLocale].push({name:e,config:t}),null;o=n._config}return nt[e]=new j(x(o,t)),ot[e]&&ot[e].forEach(function(e){st(e.name,e.config)}),at(e),nt[e]}function dt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Qe;if(!s(e)){if(t=it(e))return t;e=[e]}return function(e){for(var t,n,o,r,i=0;i=t&&a(r,n,!0)>=t-1)break;t--}i++}return Qe}(e)}function ut(e){var t,n=e._a;return n&&-2===L(e).overflow&&(t=n[fe]<0||11xe(n[me],n[fe])?pe:n[ye]<0||24Re(n,i,a)?L(e)._overflowWeeks=!0:null!=d?L(e)._overflowWeekday=!0:(s=ze(n,o,r,i,a),e._a[me]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(i=lt(e._a[me],o[me]),(e._dayOfYear>ge(i)||0===e._dayOfYear)&&(L(e)._overflowDayOfYear=!0),n=Ne(i,0,e._dayOfYear),e._a[fe]=n.getUTCMonth(),e._a[pe]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=d[t]=o[t];for(;t<7;t++)e._a[t]=d[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ye]&&0===e._a[he]&&0===e._a[Me]&&0===e._a[ve]&&(e._nextDay=!0,e._a[ye]=0),e._d=(e._useUTC?Ne:function(e,t,n,o,r,i,a){var s=new Date(e,t,n,o,r,i,a);return e<100&&0<=e&&isFinite(s.getFullYear())&&s.setFullYear(e),s}).apply(null,d),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ye]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(L(e).weekdayMismatch=!0)}}var _t=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,mt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ft=/Z|[+-]\d\d(?::?\d\d)?/,pt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],yt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ht=/^\/?Date\((\-?\d+)/i;function Mt(e){var t,n,o,r,i,a,s=e._i,d=_t.exec(s)||mt.exec(s);if(d){for(L(e).iso=!0,t=0,n=pt.length;t(i=Re(e,o,r))&&(t=i),function(e,t,n,o,r){var i=ze(e,t,n,o,r),a=Ne(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}.call(this,e,t,n,o,r))}R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Xt("gggg","weekYear"),Xt("ggggg","weekYear"),Xt("GGGG","isoWeekYear"),Xt("GGGGG","isoWeekYear"),O("weekYear","gg"),O("isoWeekYear","GG"),C("weekYear",1),C("isoWeekYear",1),de("G",oe),de("g",oe),de("GG",K,V),de("gg",K,V),de("GGGG",ee,G),de("gggg",ee,G),de("GGGGG",te,$),de("ggggg",te,$),_e(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,o){t[o.substr(0,2)]=k(e)}),_e(["gg","GG"],function(e,t,n,o){t[o]=M.parseTwoDigitYear(e)}),R("Q",0,"Qo","quarter"),O("quarter","Q"),C("quarter",7),de("Q",U),ce("Q",function(e,t){t[fe]=3*(k(e)-1)}),R("D",["DD",2],"Do","date"),O("date","D"),C("date",9),de("D",K),de("DD",K,V),de("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ce(["D","DD"],pe),ce("Do",function(e,t){t[pe]=k(e.match(K)[0])});var en=De("Date",!0);R("DDD",["DDDD",3],"DDDo","dayOfYear"),O("dayOfYear","DDD"),C("dayOfYear",4),de("DDD",Q),de("DDDD",B),ce(["DDD","DDDD"],function(e,t,n){n._dayOfYear=k(e)}),R("m",["mm",2],0,"minute"),O("minute","m"),C("minute",14),de("m",K),de("mm",K,V),ce(["m","mm"],he);var tn=De("Minutes",!1);R("s",["ss",2],0,"second"),O("second","s"),C("second",15),de("s",K),de("ss",K,V),ce(["s","ss"],Me);var nn,on=De("Seconds",!1);for(R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),O("millisecond","ms"),C("millisecond",16),de("S",Q,U),de("SS",Q,V),de("SSS",Q,B),nn="SSSS";nn.length<=9;nn+="S")de(nn,ne);function rn(e,t){t[ve]=k(1e3*("0."+e))}for(nn="S";nn.length<=9;nn+="S")ce(nn,rn);var an=De("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var sn=b.prototype;function dn(e){return e}sn.add=Vt,sn.calendar=function(e,t){var n=e||St(),o=Ct(n,this).startOf("day"),r=M.calendarFormat(this,o)||"sameElse",i=t&&(T(t[r])?t[r].call(this,n):t[r]);return this.format(i||this.localeData().calendar(r,this,St(n)))},sn.clone=function(){return new b(this)},sn.diff=function(e,t,n){var o,r,i;if(!this.isValid())return NaN;if(!(o=Ct(e,this)).isValid())return NaN;switch(r=6e4*(o.utcOffset()-this.utcOffset()),t=E(t)){case"year":i=Gt(this,o)/12;break;case"month":i=Gt(this,o);break;case"quarter":i=Gt(this,o)/3;break;case"second":i=(this-o)/1e3;break;case"minute":i=(this-o)/6e4;break;case"hour":i=(this-o)/36e5;break;case"day":i=(this-o-r)/864e5;break;case"week":i=(this-o-r)/6048e5;break;default:i=this-o}return n?i:Y(i)},sn.endOf=function(e){return void 0===(e=E(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))},sn.format=function(e){e=e||(this.isUtc()?M.defaultFormatUtc:M.defaultFormat);var t=J(this,e);return this.localeData().postformat(t)},sn.from=function(e,t){return this.isValid()&&(g(e)&&e.isValid()||St(e).isValid())?It({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},sn.fromNow=function(e){return this.from(St(),e)},sn.to=function(e,t){return this.isValid()&&(g(e)&&e.isValid()||St(e).isValid())?It({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},sn.toNow=function(e){return this.to(St(),e)},sn.get=function(e){return T(this[e=E(e)])?this[e]():this},sn.invalidAt=function(){return L(this).overflow},sn.isAfter=function(e,t){var n=g(e)?e:St(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=E(u(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},sn.isLocal=function(){return!!this.isValid()&&!this._isUTC},sn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},sn.isUtc=Nt,sn.isUTC=Nt,sn.zoneAbbr=function(){return this._isUTC?"UTC":""},sn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},sn.dates=n("dates accessor is deprecated. Use date instead.",en),sn.months=n("months accessor is deprecated. Use month instead",Ae),sn.years=n("years accessor is deprecated. Use year instead",Se),sn.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),sn.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!u(this._isDSTShifted))return this._isDSTShifted;var e={};if(h(e,this),(e=Yt(e))._a){var t=e._isUTC?f(e._a):St(e._a);this._isDSTShifted=this.isValid()&&0=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||0o&&(o=s.dependenciesState);for(n.length=r,e.newObserving=null,i=t.length;i--;)0===(s=t[i]).diffValue&&je(s,e),s.diffValue=0;for(;r--;){var s;1===(s=n[r]).diffValue&&(s.diffValue=0,u=e,(d=s).observers.add(u),d.lowestObserverState>u.dependenciesState&&(d.lowestObserverState=u.dependenciesState))}var d,u;o!==Q.UP_TO_DATE&&(e.dependenciesState=o,e.onBecomeStale())}(e),o}function ve(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)je(t[n],e);e.dependenciesState=Q.NOT_TRACKING}function Le(e){var t=be();try{return e()}finally{ge(t)}}function be(){var e=De.trackingDerivation;return De.trackingDerivation=null,e}function ge(e){De.trackingDerivation=e}function Ye(e){if(e.dependenciesState!==Q.UP_TO_DATE){e.dependenciesState=Q.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=Q.UP_TO_DATE}}function ke(){this.version=5,this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.enforceActions=!1,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.disableErrorBoundaries=!1}var Se=["mobxGuid","spyListeners","enforceActions","computedRequiresReaction","disableErrorBoundaries","runId"],De=new ke,we=!1,Te=xe();function xe(){return"undefined"!=typeof window?window:e}function je(e,t){e.observers.delete(t),0===e.observers.size&&He(e)}function He(e){!1===e.isPendingUnobservation&&(e.isPendingUnobservation=!0,De.pendingUnobservations.push(e))}function Oe(){De.inBatch++}function Ee(){if(0==--De.inBatch){ze();for(var e=De.pendingUnobservations,t=0;t",e):2===arguments.length&&"function"==typeof t?$(e,t):1===arguments.length&&"string"==typeof e?Ue(e):!0!==o?Ue(t).apply(null,arguments):void h(e,t,$(e.name||t,n.value))};function Be(e,t,n){h(e,t,$(t,n.bind(e)))}function Ge(e,t){void 0===t&&(t=p);var n,o=t&&t.name||e.name||"Autorun@"+y();if(t.scheduler||t.delay){var r=Ke(t),i=!1;n=new Ce(o,function(){i||(i=!0,r(function(){i=!1,n.isDisposed||n.track(a)}))},t.onError)}else n=new Ce(o,function(){this.track(a)},t.onError);function a(){e(n)}return n.schedule(),n.getDisposer()}Ve.bound=function(e,t,n,o){return!0===o?(Be(e,t,n.value),null):n?{configurable:!0,enumerable:!1,get:function(){return Be(this,t,n.value||n.initializer.call(this)),this[t]},set:qe}:{enumerable:!1,configurable:!0,set:function(e){Be(this,t,e)},get:function(){}}};var $e=function(e){return e()};function Ke(t){return t.scheduler?t.scheduler:t.delay?function(e){return setTimeout(e,t.delay)}:$e}function Ze(e,t,n){return Qe("onBecomeObserved",e,t,n)}function Xe(e,t,n){return Qe("onBecomeUnobserved",e,t,n)}function Qe(e,t,n,o){var r="string"==typeof n?Vt(t,n):Vt(t),i="string"==typeof n?o:n,a=r[e];return"function"!=typeof a?d(!1):(r[e]=function(){a.call(this),i.call(this)},function(){r[e]=a})}function et(e,t,n,o){var r=tt(o=W(o));return zt(e,o.name,r.enhancer),t&&nt(e,t,n,r),e}function tt(e){return e.defaultDecorator||(!1===e.deep?z:N)}function nt(e,t,n,o){Oe();try{for(var r in t){var i=Object.getOwnPropertyDescriptor(t,r),a=(n&&r in n?n[r]:i.get?B:o)(e,r,i,!0);a&&Object.defineProperty(e,r,a)}}finally{Ee()}}function ot(e,t){return rt(Vt(e,t))}function rt(e){var t,n,o={name:e.name};return e.observing&&0=e.length&&(e.length=t+1),e[t]=n,Ee()}else{Oe();var r=t;try{for(var i in r)_t(e,i,r[i])}finally{Ee()}}}function mt(e,t){return Ut(e)?Bt(e).has(t):Ct(e)?e.has(t):Et(e)?0<=t&&t";return function(){var s,e=arguments,d=++at,u=Ve(c+" - runid: "+d+" - init",n).apply(this,e),l=void 0,t=new Promise(function(t,n){var o=0;function r(e){var t;l=void 0;try{t=Ve(c+" - runid: "+d+" - yield "+o++,u.next).call(u,e)}catch(e){return n(e)}a(t)}function i(e){var t;l=void 0;try{t=Ve(c+" - runid: "+d+" - yield "+o++,u.throw).call(u,e)}catch(e){return n(e)}a(t)}function a(e){if(!e||"function"!=typeof e.then)return e.done?t(e.value):(l=Promise.resolve(e.value)).then(r,i);e.then(a,n)}s=n,r(void 0)});return t.cancel=Ve(c+" - runid: "+d+" - cancel",function(){try{l&&st(l);var e=u.return(),t=Promise.resolve(e.value);t.then(i,i),st(t),s(new Error("FLOW_CANCELLED"))}catch(e){s(e)}}),t}},en.toJS=function(e,t){return lt(e)?("boolean"==typeof t&&(t={detectCycles:t}),!0===(t=t||ft).detectCycles&&(n=new Map),function n(e,o,r){if(!lt(e))return e;if(!0===o.detectCycles&&null!==e&&"object"===(void 0===e?"undefined":f(e))&&r.has(e))return r.get(e);if(Et(e)){var t=pt(r,e,[],o),i=e.map(function(e){return n(e,o,r)});t.length=i.length;for(var a=0,s=i.length;a"+n.comments+" ":"")+"\n ",o.appendChild(r);var i=document.createElement("a");return i.className="gitment-header-issue-link",i.href=n.html_url,i.target="_blank",i.innerText="Issue Page",o.appendChild(i),o}function i(e,u){var l=e.meta,t=e.comments,n=e.currentPage,o=e.user,r=e.error,i=document.createElement("div");if(i.lang="en-US",i.className="gitment-container gitment-comments-container",r){var a=document.createElement("div");if(a.className="gitment-comments-error",r===L.NOT_INITIALIZED_ERROR&&o.login&&o.login.toLowerCase()===u.owner.toLowerCase()){var s=document.createElement("div"),d=document.createElement("button");d.className="gitment-comments-init-btn",d.onclick=function(){d.setAttribute("disabled",!0),u.init().catch(function(e){d.removeAttribute("disabled"),alert(e)})},d.innerText="初始化评论",s.appendChild(d),a.appendChild(s)}else a.innerText=r;return i.appendChild(a),i}if(void 0===t){var c=document.createElement("div");return c.innerText="Loading comments...",c.className="gitment-comments-loading",i.appendChild(c),i}if(!t.length){var _=document.createElement("div");return _.className="gitment-comments-empty",_.innerText="暂时没有评论!",i.appendChild(_),i}var m=document.createElement("ul");if(m.className="gitment-comments-list",t.forEach(function(e){var t,n,o,r,i=new Date(e.created_at),a=document.createElement("li");a.className="gitment-comment",a.innerHTML='\n \n \n \n
\n
\n \n '+e.user.name+"\n \n "+(l.user.login==e.user.login?' 博主':"")+'\n 评论创建于\n '+(0,b.default)(i).format("YYYY年MM月DD日")+'\n
\n
\n
\n ',t=u,(r=(o=(n=e).body).match(/^@[^ ]*/g))&&0u.maxCommentHeight&&(d.classList.add("gitment-comment-body-folded"),d.style.maxHeight=u.maxCommentHeight+"px",d.title="Click to Expand",d.onclick=function(){d.classList.remove("gitment-comment-body-folded"),d.style.maxHeight="",d.title="",d.onclick=null})},a.appendChild(s),m.appendChild(a)}),i.appendChild(m),l){var f=Math.ceil(l.comments/u.perPage);if(1\n \n ':t.isLoggingIn?'
'+y.spinner+"
":'\n '+y.giteehub+"\n ")+'\n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n ",t.login&&(i.querySelector(".gitment-editor-logout-link").onclick=function(){return n.logout()});var d=i.querySelector(".gitment-editor-write-field"),u=i.querySelector(".gitment-editor-preview-field"),l=d.querySelector("textarea");l.oninput=function(){l.style.height="auto";var e=window.getComputedStyle(l,null),t=parseInt(e.height,10),n=l.clientHeight,o=l.scrollHeight;n"),n=(0,c.default)("
"),o=(0,c.default)("
    "),r={},i=0;i"):(0,c.default)("
  1. ")).text(a.login+" "+a.name),o.append(s)}}n.append(o),t.append(n),(0,c.default)(this.container).append(t),(0,c.default)(document).off("keydown.atwhouser").on("keydown.atwhouser",function(e){if(40===e.keyCode){var t=(0,c.default)(".giteement-at-li-select").next();(0,c.default)(".giteement-at-li-select").removeClass("giteement-at-li-select"),0==t.length?(0,c.default)(".giteement-at-li:first").addClass("giteement-at-li-select"):t.addClass("giteement-at-li-select")}else if(38===e.keyCode){var n=(0,c.default)(".giteement-at-li-select").prev();(0,c.default)(".giteement-at-li-select").removeClass("giteement-at-li-select"),0==n.length?(0,c.default)(".giteement-at-li:last").addClass("giteement-at-li-select"):n.addClass("giteement-at-li-select")}})}}},{key:"init",value:function(){this.addListener()}},{key:"addListener",value:function(){var t=this;t.jqElement.on("compositionstart",function(){console.log("---compositionstart")}).on("compositionend",function(){console.log("---compositionend")}).on("keyup.atwhoInner",function(e){t.onKeyup(e)}).on("keydown.atwhoInner",function(e){t.altflg&&(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode||e.preventDefault()),t.onKeydown(e)}).on("blur.atwhoInner",function(){(0,c.default)(".giteement-at-div").hide(),this.altflg=!1}).on("click.atwhoInner",function(){console.log("---click.atwhoInner")}).on("scroll.atwhoInner",function(){console.log("---scroll.atwhoInner")})}},{key:"onKeyup",value:function(e){if("@"===this.jqElement.val().substring(0,this.jqElement[0].selectionEnd)){if(this.altflg){if(13===e.keyCode){var t=(0,c.default)(".giteement-at-li-select").text().split(" ")[1]+" ";this.jqElement[0].setRangeText(t),this.jqElement[0].selectionStart=this.jqElement[0].selectionEnd=this.jqElement.val().length,(0,c.default)(".giteement-at-div").hide(),this.altflg=!1}return}var n=function(e){function t(e){return e.replace(/<|>|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"
    ")}var n=e.selectionEnd,o=e.value.slice(0,n),r=e.value.slice(n),i='
    '+t(o)+'|'+t(r)+"
    ",a=(0,c.default)(i),s=(0,c.default)(e);s.after(a);var d=document.getElementById("cursor").getBoundingClientRect(),u=d.left,l=d.top-s.outerHeight(!0)+7;return a.remove(),{x:u,y:l}}(this.jqElement[0]),o=(0,c.default)(".giteement-at-outdiv")[0].getBoundingClientRect();(0,c.default)(".giteement-at-div").css("left",n.x-o.left+"px"),(0,c.default)(".giteement-at-div").css("top",n.y-o.top+"px"),(0,c.default)(".giteement-at-li-select").removeClass("giteement-at-li-select"),(0,c.default)((0,c.default)(".giteement-at-li")[0]).addClass("giteement-at-li-select"),(0,c.default)(".giteement-at-div").show(),this.altflg=!0}else(0,c.default)(".giteement-at-div").hide(),this.altflg=!1}},{key:"onKeydown",value:function(e){this.altflg&&(38!==e.keyCode&&40!==e.keyCode&&13!==e.keyCode||e.preventDefault())}}]),a);function a(){var e=0>10|55296,1023&o|56320)}function r(){g()}var e,m,L,i,a,f,_,p,b,d,u,g,Y,s,k,y,l,h,M,S="sizzle"+1*new Date,v=n.document,D=0,o=0,w=ae(),T=ae(),x=ae(),j=function(e,t){return e===t&&(u=!0),0},H={}.hasOwnProperty,t=[],O=t.pop,E=t.push,A=t.push,P=t.slice,C=function(e,t){for(var n=0,o=e.length;n+~]|"+N+")"+N+"*"),V=new RegExp("="+N+"*([^\\]'\"]*?)"+N+"*\\]","g"),B=new RegExp(I),G=new RegExp("^"+F+"$"),$={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+I),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+N+"*(even|odd|(([+-]|)(\\d*)n|)"+N+"*(?:([+-]|)"+N+"*(\\d+)|))"+N+"*\\)|)","i"),bool:new RegExp("^(?:"+W+")$","i"),needsContext:new RegExp("^"+N+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+N+"*((?:-\\d)?\\d*)"+N+"*\\)|)(?=[^-]|$)","i")},K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,X=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+N+"?|("+N+")|.)","ig"),ne=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,oe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=Me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{A.apply(t=P.call(v.childNodes),v.childNodes),t[v.childNodes.length].nodeType}catch(n){A={apply:t.length?function(e,t){E.apply(e,P.call(t))}:function(e,t){for(var n=e.length,o=0;e[n++]=t[o++];);e.length=n-1}}}function ie(e,t,n,o){var r,i,a,s,d,u,l,c=t&&t.ownerDocument,_=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==_&&9!==_&&11!==_)return n;if(!o&&((t?t.ownerDocument||t:v)!==Y&&g(t),t=t||Y,k)){if(11!==_&&(d=Q.exec(e)))if(r=d[1]){if(9===_){if(!(a=t.getElementById(r)))return n;if(a.id===r)return n.push(a),n}else if(c&&(a=c.getElementById(r))&&M(t,a)&&a.id===r)return n.push(a),n}else{if(d[2])return A.apply(n,t.getElementsByTagName(e)),n;if((r=d[3])&&m.getElementsByClassName&&t.getElementsByClassName)return A.apply(n,t.getElementsByClassName(r)),n}if(m.qsa&&!x[e+" "]&&(!y||!y.test(e))){if(1!==_)c=t,l=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(ne,oe):t.setAttribute("id",s=S),i=(u=f(e)).length;i--;)u[i]="#"+s+" "+he(u[i]);l=u.join(","),c=ee.test(e)&&pe(t.parentNode)||t}if(l)try{return A.apply(n,c.querySelectorAll(l)),n}catch(e){}finally{s===S&&t.removeAttribute("id")}}}return p(e.replace(J,"$1"),t,n,o)}function ae(){var o=[];return function e(t,n){return o.push(t+" ")>L.cacheLength&&delete e[o.shift()],e[t+" "]=n}}function se(e){return e[S]=!0,e}function de(e){var t=Y.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ue(e,t){for(var n=e.split("|"),o=n.length;o--;)L.attrHandle[n[o]]=t}function le(e,t){var n=t&&e,o=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(o)return o;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ce(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function _e(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function me(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&re(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function fe(a){return se(function(i){return i=+i,se(function(e,t){for(var n,o=a([],e.length,i),r=o.length;r--;)e[n=o[r]]&&(e[n]=!(t[n]=e[n]))})})}function pe(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in m=ie.support={},a=ie.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},g=ie.setDocument=function(e){var t,n,o=e?e.ownerDocument||e:v;return o!==Y&&9===o.nodeType&&o.documentElement&&(s=(Y=o).documentElement,k=!a(Y),v!==Y&&(n=Y.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",r,!1):n.attachEvent&&n.attachEvent("onunload",r)),m.attributes=de(function(e){return e.className="i",!e.getAttribute("className")}),m.getElementsByTagName=de(function(e){return e.appendChild(Y.createComment("")),!e.getElementsByTagName("*").length}),m.getElementsByClassName=X.test(Y.getElementsByClassName),m.getById=de(function(e){return s.appendChild(e).id=S,!Y.getElementsByName||!Y.getElementsByName(S).length}),m.getById?(L.filter.ID=function(e){var t=e.replace(te,c);return function(e){return e.getAttribute("id")===t}},L.find.ID=function(e,t){if(void 0!==t.getElementById&&k){var n=t.getElementById(e);return n?[n]:[]}}):(L.filter.ID=function(e){var n=e.replace(te,c);return function(e){var t=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},L.find.ID=function(e,t){if(void 0!==t.getElementById&&k){var n,o,r,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(r=t.getElementsByName(e),o=0;i=r[o++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),L.find.TAG=m.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):m.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,o=[],r=0,i=t.getElementsByTagName(e);if("*"!==e)return i;for(;n=i[r++];)1===n.nodeType&&o.push(n);return o},L.find.CLASS=m.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&k)return t.getElementsByClassName(e)},l=[],y=[],(m.qsa=X.test(Y.querySelectorAll))&&(de(function(e){s.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+N+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+N+"*(?:value|"+W+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]")}),de(function(e){e.innerHTML="";var t=Y.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+N+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),s.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(m.matchesSelector=X.test(h=s.matches||s.webkitMatchesSelector||s.mozMatchesSelector||s.oMatchesSelector||s.msMatchesSelector))&&de(function(e){m.disconnectedMatch=h.call(e,"*"),h.call(e,"[s!='']:x"),l.push("!=",I)}),y=y.length&&new RegExp(y.join("|")),l=l.length&&new RegExp(l.join("|")),t=X.test(s.compareDocumentPosition),M=t||X.test(s.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,o=t&&t.parentNode;return e===o||!(!o||1!==o.nodeType||!(n.contains?n.contains(o):e.compareDocumentPosition&&16&e.compareDocumentPosition(o)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return u=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!m.sortDetached&&t.compareDocumentPosition(e)===n?e===Y||e.ownerDocument===v&&M(v,e)?-1:t===Y||t.ownerDocument===v&&M(v,t)?1:d?C(d,e)-C(d,t):0:4&n?-1:1)}:function(e,t){if(e===t)return u=!0,0;var n,o=0,r=e.parentNode,i=t.parentNode,a=[e],s=[t];if(!r||!i)return e===Y?-1:t===Y?1:r?-1:i?1:d?C(d,e)-C(d,t):0;if(r===i)return le(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[o]===s[o];)o++;return o?le(a[o],s[o]):a[o]===v?-1:s[o]===v?1:0}),Y},ie.matches=function(e,t){return ie(e,null,null,t)},ie.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Y&&g(e),t=t.replace(V,"='$1']"),m.matchesSelector&&k&&!x[t+" "]&&(!l||!l.test(t))&&(!y||!y.test(t)))try{var n=h.call(e,t);if(n||m.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,c),e[3]=(e[3]||e[4]||e[5]||"").replace(te,c),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ie.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ie.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&B.test(n)&&(t=f(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,c).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=w[e+" "];return t||(t=new RegExp("(^|"+N+")"+e+"("+N+"|$)"))&&w(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,o,r){return function(e){var t=ie.attr(e,n);return null==t?"!="===o:!o||(t+="","="===o?t===r:"!="===o?t!==r:"^="===o?r&&0===t.indexOf(r):"*="===o?r&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function x(e,n,o){return v(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==o}):n.nodeType?S.grep(e,function(e){return e===n!==o}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var o,r;if(!e)return this;if(n=n||j,"string"!=typeof e)return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this);if(!(o="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:H.exec(e))||!o[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(o[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(o[1],t&&t.nodeType?t.ownerDocument||t:k,!0)),T.test(o[1])&&S.isPlainObject(t))for(o in t)v(this[o])?this[o](t[o]):this.attr(o,t[o]);return this}return(r=k.getElementById(o[2]))&&(this[0]=r,this.length=1),this}).prototype=S.fn,j=S(k);var O=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]+)/i,le=/^$|^module$|\/(?:java|ecma)script/i,ce={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function _e(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&w(e,t)?S.merge([e],n):n}function me(e,t){for(var n=0,o=e.length;nx",M.noCloneChecked=!!fe.cloneNode(!0).lastChild.defaultValue;var Me=k.documentElement,ve=/^key/,Le=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,be=/^([^.]*)(?:\.(.+)|)/;function ge(){return!0}function Ye(){return!1}function ke(){try{return k.activeElement}catch(e){}}function Se(e,t,n,o,r,i){var a,s;if("object"===(void 0===t?"undefined":rn(t))){for(s in"string"!=typeof n&&(o=o||n,n=void 0),t)Se(e,s,n,o,t[s],i);return e}if(null==o&&null==r?(r=n,o=n=void 0):null==r&&("string"==typeof n?(r=o,o=void 0):(r=o,o=n,n=void 0)),!1===r)r=Ye;else if(!r)return e;return 1===i&&(a=r,(r=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,r,o,n)})}S.event={global:{},add:function(t,e,n,o,r){var i,a,s,d,u,l,c,_,m,f,p,y=$.get(t);if(y)for(n.handler&&(n=(i=n).handler,r=i.selector),r&&S.find.matchesSelector(Me,r),n.guid||(n.guid=S.guid++),(d=y.events)||(d=y.events={}),(a=y.handle)||(a=y.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(P)||[""]).length;u--;)m=p=(s=be.exec(e[u])||[])[1],f=(s[2]||"").split(".").sort(),m&&(c=S.event.special[m]||{},m=(r?c.delegateType:c.bindType)||m,c=S.event.special[m]||{},l=S.extend({type:m,origType:p,data:o,handler:n,guid:n.guid,selector:r,needsContext:r&&S.expr.match.needsContext.test(r),namespace:f.join(".")},i),(_=d[m])||((_=d[m]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(t,o,f,a)||t.addEventListener&&t.addEventListener(m,a)),c.add&&(c.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),r?_.splice(_.delegateCount++,0,l):_.push(l),S.event.global[m]=!0)},remove:function(e,t,n,o,r){var i,a,s,d,u,l,c,_,m,f,p,y=$.hasData(e)&&$.get(e);if(y&&(d=y.events)){for(u=(t=(t||"").match(P)||[""]).length;u--;)if(m=p=(s=be.exec(t[u])||[])[1],f=(s[2]||"").split(".").sort(),m){for(c=S.event.special[m]||{},_=d[m=(o?c.delegateType:c.bindType)||m]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=_.length;i--;)l=_[i],!r&&p!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||o&&o!==l.selector&&("**"!==o||!l.selector)||(_.splice(i,1),l.selector&&_.delegateCount--,c.remove&&c.remove.call(e,l));a&&!_.length&&(c.teardown&&!1!==c.teardown.call(e,f,y.handle)||S.removeEvent(e,m,y.handle),delete d[m])}else for(m in d)S.event.remove(e,m+t[u],n,o,!0);S.isEmptyObject(d)&&$.remove(e,"handle events")}},dispatch:function(e){var t,n,o,r,i,a,s=S.event.fix(e),d=new Array(arguments.length),u=($.get(this,"events")||{})[s.type]||[],l=S.event.special[s.type]||{};for(d[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,we=/\s*$/g;function je(e,t){return w(e,"table")&&w(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ee(e,t){var n,o,r,i,a,s,d,u;if(1===t.nodeType){if($.hasData(e)&&(i=$.access(e),a=$.set(t,i),u=i.events))for(r in delete a.handle,a.events={},u)for(n=0,o=u[r].length;n")},clone:function(e,t,n){var o,r,i,a,s,d,u,l=e.cloneNode(!0),c=S.contains(e.ownerDocument,e);if(!(M.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=_e(l),o=0,r=(i=_e(e)).length;o").prop({charset:n.scriptCharset,src:n.url}).on("load error",r=function(e){o.remove(),r=null,e&&t("error"===e.type?404:200,e.type)}),k.head.appendChild(o[0])},abort:function(){r&&r()}}});var Zt,Xt=[],Qt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+xt++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var o,r,i,a=!1!==e.jsonp&&(Qt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return o=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Qt,"$1"+o):!1!==e.jsonp&&(e.url+=(jt.test(e.url)?"&":"?")+e.jsonp+"="+o),e.converters["script json"]=function(){return i||S.error(o+" was not called"),i[0]},e.dataTypes[0]="json",r=Y[o],Y[o]=function(){i=arguments},n.always(function(){void 0===r?S(Y).removeProp(o):Y[o]=r,e[o]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(o)),i&&v(r)&&r(i[0]),i=r=void 0}),"script"}),M.createHTMLDocument=((Zt=k.implementation.createHTMLDocument("").body).innerHTML="
    ",2===Zt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(M.createHTMLDocument?((o=(t=k.implementation.createHTMLDocument("")).createElement("base")).href=k.location.href,t.head.appendChild(o)):t=k),i=!n&&[],(r=T.exec(e))?[t.createElement(r[1])]:(r=he([e],t,i),i&&i.length&&S(i).remove(),S.merge([],r.childNodes)));var o,r,i},S.fn.load=function(e,t,n){var o,r,i,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(o):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,i||[e.responseText,t,e])})}),this},S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var o,r,i,a,s,d,u=S.css(e,"position"),l=S(e),c={};"static"===u&&(e.style.position="relative"),s=l.offset(),i=S.css(e,"top"),d=S.css(e,"left"),r=("absolute"===u||"fixed"===u)&&-1<(i+d).indexOf("auto")?(a=(o=l.position()).top,o.left):(a=parseFloat(i)||0,parseFloat(d)||0),v(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(c.top=t.top-s.top+a),null!=t.left&&(c.left=t.left-s.left+r),"using"in t?t.using.call(e,c):l.css(c)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,o=this[0];return o?o.getClientRects().length?(e=o.getBoundingClientRect(),n=o.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,o=this[0],r={top:0,left:0};if("fixed"===S.css(o,"position"))t=o.getBoundingClientRect();else{for(t=this.offset(),n=o.ownerDocument,e=o.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==o&&1===e.nodeType&&((r=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),r.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-r.top-S.css(o,"marginTop",!0),left:t.left-r.left-S.css(o,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||Me})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,r){var i="pageYOffset"===r;S.fn[t]=function(e){return R(this,function(e,t,n){var o;if(p(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===n)return o?o[r]:e[t];o?o.scrollTo(i?o.pageXOffset:n,i?n:o.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Be(M.pixelPosition,function(e,t){if(t)return t=Ve(e,n),Je.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(o,i){S.fn[i]=function(e,t){var n=arguments.length&&(o||"boolean"!=typeof e),r=o||(!0===e||!0===t?"margin":"border");return R(this,function(e,t,n){var o;return p(e)?0===i.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+a],o["scroll"+a],e.body["offset"+a],o["offset"+a],o["client"+a])):void 0===n?S.css(e,t,r):S.style(e,t,n,r)},s,n?e:void 0,n)}})}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0:first-child,.gitment-editor-preview>:first-child{margin-top:0!important}.gitment-comment-body>:last-child,.gitment-editor-preview>:last-child{margin-bottom:0!important}.gitment-editor-body textarea{display:block;max-height:500px;resize:vertical;max-width:100%;margin:0;line-height:1.6;background-color:#fff;color:#333;vertical-align:middle;border:none;border-radius:0;outline:0;box-shadow:none;overflow:visible}.gitment-editor-body textarea:focus{background-color:#fff}.gitment-editor-preview{background-color:transparent;line-height:1.5;word-wrap:break-word}.gitment-editor-footer{padding:0;margin-top:10px}.gitment-editor-footer::after{display:table;clear:both;content:""}a.gitment-editor-footer-tip{display:inline-block;padding-top:10px;font-size:12px;color:#666}a.gitment-editor-footer-tip:hover{color:#2196F3;text-decoration:none}.gitment-comments-pagination{list-style:none;text-align:right;border-radius:0;margin:-19px 0 19px}.gitment-comments-page-item{display:inline-block;cursor:pointer;border:1px solid #CFD8DC;margin-left:-1px;padding:.25rem .5rem}.gitment-comments-page-item.gitment-selected,.gitment-comments-page-item:hover{background-color:#f5f5f5}.gitment-comments-init-btn,.gitment-editor-submit{color:#fff;background-color:#00BCD4;position:relative;display:inline-block;padding:7px 13px;font-size:14px;font-weight:600;line-height:20px;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-size:110% 110%;border:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.gitment-comments-init-btn:hover,.gitment-editor-submit:hover{background-color:#00ACC1}.gitment-comments-init-btn:disabled,.gitment-editor-submit:disabled{color:rgba(255,255,255,.75);background-color:#4DD0E1;box-shadow:none}.gitment-editor-submit{float:right}.gitment-footer-container{margin-top:30px;margin-bottom:20px;text-align:right;font-size:12px}.gitment-markdown{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;color:#333;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:16px;line-height:1.5;word-wrap:break-word}.gitment-markdown .pl-c{color:#969896}.gitment-markdown .pl-c1,.gitment-markdown .pl-s .pl-v{color:#0086b3}.gitment-markdown .pl-e,.gitment-markdown .pl-en{color:#795da3}.gitment-markdown .pl-s .pl-s1,.gitment-markdown .pl-smi{color:#333}.gitment-markdown .pl-ent{color:#63a35c}.gitment-markdown .pl-k{color:#a71d5d}.gitment-markdown .pl-pds,.gitment-markdown .pl-s,.gitment-markdown .pl-s .pl-pse .pl-s1,.gitment-markdown .pl-sr,.gitment-markdown .pl-sr .pl-cce,.gitment-markdown .pl-sr .pl-sra,.gitment-markdown .pl-sr .pl-sre{color:#183691}.gitment-markdown .pl-smw,.gitment-markdown .pl-v{color:#ed6a43}.gitment-markdown .pl-bu{color:#b52a1d}.gitment-markdown .pl-c2,.gitment-markdown .pl-ii{color:#f8f8f8;background-color:#b52a1d}.gitment-markdown .pl-c2::before{content:"^M"}.gitment-markdown .pl-sr .pl-cce{font-weight:700;color:#63a35c}.gitment-markdown .pl-ml{color:#693a17}.gitment-markdown .pl-mh,.gitment-markdown .pl-mh .pl-en,.gitment-markdown .pl-ms{font-weight:700;color:#1d3e81}.gitment-markdown .pl-mq{color:teal}.gitment-markdown .pl-mi{font-style:italic;color:#333}.gitment-markdown .pl-mb{font-weight:700;color:#333}.gitment-markdown .pl-md{color:#bd2c00;background-color:#ffecec}.gitment-markdown .pl-mi1{color:#55a532;background-color:#eaffea}.gitment-markdown .pl-mc{color:#ef9700;background-color:#ffe3b4}.gitment-markdown .pl-mi2{color:#d8d8d8;background-color:grey}.gitment-markdown .pl-mdr{font-weight:700;color:#795da3}.gitment-markdown .pl-mo{color:#1d3e81}.gitment-markdown .pl-ba{color:#595e62}.gitment-markdown .pl-sg{color:silver}.gitment-markdown .pl-corl{text-decoration:underline;color:#183691}.gitment-markdown .octicon{display:inline-block;fill:currentColor;vertical-align:text-bottom}.gitment-markdown hr::after,.gitment-markdown hr::before,.gitment-markdown::after,.gitment-markdown::before{display:table;content:""}.gitment-markdown a{background-color:transparent;-webkit-text-decoration-skip:objects;color:#0366d6;text-decoration:none}.gitment-markdown a:active,.gitment-markdown a:hover{outline-width:0}.gitment-markdown h1{margin:.67em 0}.gitment-markdown img{border-style:none}.gitment-markdown svg:not(:root){overflow:hidden}.gitment-markdown hr{box-sizing:content-box}.gitment-markdown input{font:inherit;margin:0;overflow:visible;font-family:inherit;font-size:inherit;line-height:inherit}.gitment-markdown [type=checkbox]{box-sizing:border-box;padding:0}.gitment-markdown *{box-sizing:border-box}.gitment-markdown a:hover{text-decoration:underline}.gitment-markdown strong{font-weight:600}.gitment-markdown td,.gitment-markdown th{padding:0}.gitment-markdown blockquote{margin:0}.gitment-markdown ol ol,.gitment-markdown ul ol{list-style-type:lower-roman}.gitment-markdown ol ol ol,.gitment-markdown ol ul ol,.gitment-markdown ul ol ol,.gitment-markdown ul ul ol{list-style-type:lower-alpha}.gitment-markdown dd{margin-left:0}.gitment-markdown code{font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace}.gitment-markdown pre{font:12px SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;word-wrap:normal}.gitment-markdown .pl-0{padding-left:0!important}.gitment-markdown .pl-1{padding-left:4px!important}.gitment-markdown .pl-2{padding-left:8px!important}.gitment-markdown .pl-3{padding-left:16px!important}.gitment-markdown .pl-4{padding-left:24px!important}.gitment-markdown .pl-5{padding-left:32px!important}.gitment-markdown .pl-6{padding-left:40px!important}.gitment-markdown>:first-child{margin-top:0!important}.gitment-markdown>:last-child{margin-bottom:0!important}.gitment-markdown a:not([href]){color:inherit;text-decoration:none}.gitment-markdown .anchor{float:left;padding-right:4px;margin-left:-20px;line-height:1}.gitment-markdown .anchor:focus{outline:0}.gitment-markdown blockquote,.gitment-markdown dl,.gitment-markdown ol,.gitment-markdown p,.gitment-markdown pre,.gitment-markdown table,.gitment-markdown ul{margin-top:0;margin-bottom:16px}.gitment-markdown hr{overflow:hidden;background:#e1e4e8;height:.25em;padding:0;margin:24px 0;border:0}.gitment-markdown blockquote{padding:0 1em;color:#6a737d;border-left:.25em solid #dfe2e5}.gitment-markdown h1,.gitment-markdown h2{padding-bottom:.3em;border-bottom:1px solid #eaecef}.gitment-markdown blockquote>:first-child{margin-top:0}.gitment-markdown blockquote>:last-child{margin-bottom:0}.gitment-markdown h1,.gitment-markdown h2,.gitment-markdown h3,.gitment-markdown h4,.gitment-markdown h5,.gitment-markdown h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.gitment-markdown h1 .octicon-link,.gitment-markdown h2 .octicon-link,.gitment-markdown h3 .octicon-link,.gitment-markdown h4 .octicon-link,.gitment-markdown h5 .octicon-link,.gitment-markdown h6 .octicon-link{color:#1b1f23;vertical-align:middle;visibility:hidden}.gitment-markdown h1:hover .anchor,.gitment-markdown h2:hover .anchor,.gitment-markdown h3:hover .anchor,.gitment-markdown h4:hover .anchor,.gitment-markdown h5:hover .anchor,.gitment-markdown h6:hover .anchor{text-decoration:none}.gitment-markdown h1:hover .anchor .octicon-link,.gitment-markdown h2:hover .anchor .octicon-link,.gitment-markdown h3:hover .anchor .octicon-link,.gitment-markdown h4:hover .anchor .octicon-link,.gitment-markdown h5:hover .anchor .octicon-link,.gitment-markdown h6:hover .anchor .octicon-link{visibility:visible}.gitment-markdown h1{font-size:2em}.gitment-markdown h2{font-size:1.5em}.gitment-markdown h3{font-size:1.25em}.gitment-markdown h4{font-size:1em}.gitment-markdown h5{font-size:.875em}.gitment-markdown h6{font-size:.85em;color:#6a737d}.gitment-markdown ol,.gitment-markdown ul{padding-left:2em}.gitment-markdown ol ol,.gitment-markdown ol ul,.gitment-markdown ul ol,.gitment-markdown ul ul{margin-top:0;margin-bottom:0}.gitment-markdown li>p{margin-top:16px}.gitment-markdown li+li{margin-top:.25em}.gitment-markdown dl{padding:0}.gitment-markdown dl dt{padding:0;margin-top:16px;font-size:1em;font-style:italic;font-weight:600}.gitment-markdown dl dd{padding:0 16px;margin-bottom:16px}.gitment-markdown table{border-spacing:0;border-collapse:collapse;display:block;width:100%;overflow:auto}.gitment-markdown table th{font-weight:600}.gitment-markdown table td,.gitment-markdown table th{padding:6px 13px;border:1px solid #dfe2e5}.gitment-markdown table tr{background-color:#fff;border-top:1px solid #c6cbd1}.gitment-markdown table tr:nth-child(2n){background-color:#f5f5f5}.gitment-markdown img{max-width:100%;box-sizing:content-box;background-color:#fff}.gitment-markdown code{padding:.2em 0;margin:0;font-size:85%;background-color:rgba(27,31,35,.05);border-radius:0}.gitment-markdown code::after,.gitment-markdown code::before{letter-spacing:-.2em;content:"\00a0"}.gitment-markdown pre>code{padding:0;margin:0;font-size:100%;word-break:normal;white-space:pre;background:0 0;border:0}.gitment-markdown .highlight{margin-bottom:16px}.gitment-markdown .highlight pre{margin-bottom:0;word-break:normal}.gitment-markdown .highlight pre,.gitment-markdown pre{padding:16px;overflow:auto;font-size:85%;line-height:1.45;background-color:#f5f5f5;border-radius:0}.gitment-markdown pre code{display:inline;max-width:auto;padding:0;margin:0;overflow:visible;line-height:inherit;word-wrap:normal;background-color:transparent;border:0}.gitment-markdown pre code::after,.gitment-markdown pre code::before{content:normal}.gitment-markdown .full-commit .btn-outline:not(:disabled):hover{color:#005cc5;border-color:#005cc5}.gitment-markdown kbd{display:inline-block;padding:3px 5px;font:11px SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;line-height:10px;color:#444d56;vertical-align:middle;background-color:#fcfcfc;border:1px solid #c6cbd1;border-bottom-color:#959da5;border-radius:0;box-shadow:inset 0 -1px 0 #959da5}.gitment-markdown :checked+.radio-label{position:relative;z-index:1;border-color:#0366d6}.gitment-markdown .task-list-item{list-style-type:none}.gitment-markdown .task-list-item+.task-list-item{margin-top:3px}.gitment-markdown .task-list-item input{margin:0 .2em .25em -1.6em;vertical-align:middle}.gitment-markdown hr{border-bottom-color:#eee} \ No newline at end of file diff --git a/lib/gitment.js b/lib/gitment.js new file mode 100644 index 0000000..804167c --- /dev/null +++ b/lib/gitment.js @@ -0,0 +1,4145 @@ +var Gitment = + /******/ + (function (modules) { // webpackBootstrap + /******/ // The module cache + /******/ + var installedModules = {}; + /******/ + /******/ // The require function + /******/ + function __webpack_require__(moduleId) { + /******/ + /******/ // Check if module is in cache + /******/ + if (installedModules[moduleId]) + /******/ + return installedModules[moduleId].exports; + /******/ + /******/ // Create a new module (and put it into the cache) + /******/ + var module = installedModules[moduleId] = { + /******/ + i: moduleId, + /******/ + l: false, + /******/ + exports: {} + /******/ + }; + /******/ + /******/ // Execute the module function + /******/ + modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + /******/ + /******/ // Flag the module as loaded + /******/ + module.l = true; + /******/ + /******/ // Return the exports of the module + /******/ + return module.exports; + /******/ + } + /******/ + /******/ + /******/ // expose the modules object (__webpack_modules__) + /******/ + __webpack_require__.m = modules; + /******/ + /******/ // expose the module cache + /******/ + __webpack_require__.c = installedModules; + /******/ + /******/ // identity function for calling harmony imports with the correct context + /******/ + __webpack_require__.i = function (value) { + return value; + }; + /******/ + /******/ // define getter function for harmony exports + /******/ + __webpack_require__.d = function (exports, name, getter) { + /******/ + if (!__webpack_require__.o(exports, name)) { + /******/ + Object.defineProperty(exports, name, { + /******/ + configurable: false, + /******/ + enumerable: true, + /******/ + get: getter + /******/ + }); + /******/ + } + /******/ + }; + /******/ + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ + __webpack_require__.n = function (module) { + /******/ + var getter = module && module.__esModule ? + /******/ + function getDefault() { + return module['default']; + } : + /******/ + function getModuleExports() { + return module; + }; + /******/ + __webpack_require__.d(getter, 'a', getter); + /******/ + return getter; + /******/ + }; + /******/ + /******/ // Object.prototype.hasOwnProperty.call + /******/ + __webpack_require__.o = function (object, property) { + return Object.prototype.hasOwnProperty.call(object, property); + }; + /******/ + /******/ // __webpack_public_path__ + /******/ + __webpack_require__.p = ""; + /******/ + /******/ // Load entry module and return exports + /******/ + return __webpack_require__(__webpack_require__.s = 5); + /******/ + }) +/************************************************************************/ +/******/ +([ + /* 0 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + Object.defineProperty(exports, "__esModule", { + value: true + }); + var LS_ACCESS_TOKEN_KEY = exports.LS_ACCESS_TOKEN_KEY = 'gitment-comments-token'; + var LS_USER_KEY = exports.LS_USER_KEY = 'gitment-user-info'; + + var NOT_INITIALIZED_ERROR = exports.NOT_INITIALIZED_ERROR = new Error('Comments Not Initialized'); + + /***/ + }), + /* 1 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + /* WEBPACK VAR INJECTION */ + (function (global) { + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + var __extends = undefined && undefined.__extends || function () { + var extendStatics = Object.setPrototypeOf || { + __proto__: [] + } + instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + return function (d, b) { + extendStatics(d, b); + + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + }(); + Object.defineProperty(exports, "__esModule", { + value: true + }); + registerGlobals(); + exports.extras = { + allowStateChanges: allowStateChanges, + deepEqual: deepEqual, + getAtom: getAtom, + getDebugName: getDebugName, + getDependencyTree: getDependencyTree, + getAdministration: getAdministration, + getGlobalState: getGlobalState, + getObserverTree: getObserverTree, + isComputingDerivation: isComputingDerivation, + isSpyEnabled: isSpyEnabled, + onReactionError: onReactionError, + resetGlobalState: resetGlobalState, + shareGlobalState: shareGlobalState, + spyReport: spyReport, + spyReportEnd: spyReportEnd, + spyReportStart: spyReportStart, + setReactionScheduler: setReactionScheduler + }; + if ((typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === "undefined" ? "undefined" : _typeof(__MOBX_DEVTOOLS_GLOBAL_HOOK__)) === "object") { + __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx(module.exports); + } + module.exports.default = module.exports; + var actionFieldDecorator = createClassPropertyDecorator(function (target, key, value, args, originalDescriptor) { + var actionName = args && args.length === 1 ? args[0] : value.name || key || ""; + var wrappedAction = action(actionName, value); + addHiddenProp(target, key, wrappedAction); + }, function (key) { + return this[key]; + }, function () { + invariant(false, getMessage("m001")); + }, false, true); + var boundActionDecorator = createClassPropertyDecorator(function (target, key, value) { + defineBoundAction(target, key, value); + }, function (key) { + return this[key]; + }, function () { + invariant(false, getMessage("m001")); + }, false, false); + var action = function action(arg1, arg2, arg3, arg4) { + if (arguments.length === 1 && typeof arg1 === "function") return createAction(arg1.name || "", arg1); + if (arguments.length === 2 && typeof arg2 === "function") return createAction(arg1, arg2); + if (arguments.length === 1 && typeof arg1 === "string") return namedActionDecorator(arg1); + return namedActionDecorator(arg2).apply(null, arguments); + }; + exports.action = action; + action.bound = function boundAction(arg1, arg2, arg3) { + if (typeof arg1 === "function") { + var action_1 = createAction("", arg1); + action_1.autoBind = true; + return action_1; + } + return boundActionDecorator.apply(null, arguments); + }; + + function namedActionDecorator(name) { + return function (target, prop, descriptor) { + if (descriptor && typeof descriptor.value === "function") { + descriptor.value = createAction(name, descriptor.value); + descriptor.enumerable = false; + descriptor.configurable = true; + return descriptor; + } + return actionFieldDecorator(name).apply(this, arguments); + }; + } + + function runInAction(arg1, arg2, arg3) { + var actionName = typeof arg1 === "string" ? arg1 : arg1.name || ""; + var fn = typeof arg1 === "function" ? arg1 : arg2; + var scope = typeof arg1 === "function" ? arg2 : arg3; + invariant(typeof fn === "function", getMessage("m002")); + invariant(fn.length === 0, getMessage("m003")); + invariant(typeof actionName === "string" && actionName.length > 0, "actions should have valid names, got: '" + actionName + "'"); + return executeAction(actionName, fn, scope, undefined); + } + exports.runInAction = runInAction; + + function isAction(thing) { + return typeof thing === "function" && thing.isMobxAction === true; + } + exports.isAction = isAction; + + function defineBoundAction(target, propertyName, fn) { + var res = function res() { + return executeAction(propertyName, fn, target, arguments); + }; + res.isMobxAction = true; + addHiddenProp(target, propertyName, res); + } + + function autorun(arg1, arg2, arg3) { + var name, view, scope; + if (typeof arg1 === "string") { + name = arg1; + view = arg2; + scope = arg3; + } else { + name = arg1.name || "Autorun@" + getNextId(); + view = arg1; + scope = arg2; + } + invariant(typeof view === "function", getMessage("m004")); + invariant(isAction(view) === false, getMessage("m005")); + if (scope) view = view.bind(scope); + var reaction = new Reaction(name, function () { + this.track(reactionRunner); + }); + + function reactionRunner() { + view(reaction); + } + reaction.schedule(); + return reaction.getDisposer(); + } + exports.autorun = autorun; + + function when(arg1, arg2, arg3, arg4) { + var name, predicate, effect, scope; + if (typeof arg1 === "string") { + name = arg1; + predicate = arg2; + effect = arg3; + scope = arg4; + } else { + name = "When@" + getNextId(); + predicate = arg1; + effect = arg2; + scope = arg3; + } + var disposer = autorun(name, function (r) { + if (predicate.call(scope)) { + r.dispose(); + var prevUntracked = untrackedStart(); + effect.call(scope); + untrackedEnd(prevUntracked); + } + }); + return disposer; + } + exports.when = when; + + function autorunAsync(arg1, arg2, arg3, arg4) { + var name, func, delay, scope; + if (typeof arg1 === "string") { + name = arg1; + func = arg2; + delay = arg3; + scope = arg4; + } else { + name = arg1.name || "AutorunAsync@" + getNextId(); + func = arg1; + delay = arg2; + scope = arg3; + } + invariant(isAction(func) === false, getMessage("m006")); + if (delay === void 0) delay = 1; + if (scope) func = func.bind(scope); + var isScheduled = false; + var r = new Reaction(name, function () { + if (!isScheduled) { + isScheduled = true; + setTimeout(function () { + isScheduled = false; + if (!r.isDisposed) r.track(reactionRunner); + }, delay); + } + }); + + function reactionRunner() { + func(r); + } + r.schedule(); + return r.getDisposer(); + } + exports.autorunAsync = autorunAsync; + + function reaction(expression, effect, arg3) { + if (arguments.length > 3) { + fail(getMessage("m007")); + } + if (isModifierDescriptor(expression)) { + fail(getMessage("m008")); + } + var opts; + if ((typeof arg3 === "undefined" ? "undefined" : _typeof(arg3)) === "object") { + opts = arg3; + } else { + opts = {}; + } + opts.name = opts.name || expression.name || effect.name || "Reaction@" + getNextId(); + opts.fireImmediately = arg3 === true || opts.fireImmediately === true; + opts.delay = opts.delay || 0; + opts.compareStructural = opts.compareStructural || opts.struct || false; + effect = action(opts.name, opts.context ? effect.bind(opts.context) : effect); + if (opts.context) { + expression = expression.bind(opts.context); + } + var firstTime = true; + var isScheduled = false; + var nextValue; + var r = new Reaction(opts.name, function () { + if (firstTime || opts.delay < 1) { + reactionRunner(); + } else if (!isScheduled) { + isScheduled = true; + setTimeout(function () { + isScheduled = false; + reactionRunner(); + }, opts.delay); + } + }); + + function reactionRunner() { + if (r.isDisposed) return; + var changed = false; + r.track(function () { + var v = expression(r); + changed = valueDidChange(opts.compareStructural, nextValue, v); + nextValue = v; + }); + if (firstTime && opts.fireImmediately) effect(nextValue, r); + if (!firstTime && changed === true) effect(nextValue, r); + if (firstTime) firstTime = false; + } + r.schedule(); + return r.getDisposer(); + } + exports.reaction = reaction; + + function createComputedDecorator(compareStructural) { + return createClassPropertyDecorator(function (target, name, _, __, originalDescriptor) { + invariant(typeof originalDescriptor !== "undefined", getMessage("m009")); + invariant(typeof originalDescriptor.get === "function", getMessage("m010")); + var adm = asObservableObject(target, ""); + defineComputedProperty(adm, name, originalDescriptor.get, originalDescriptor.set, compareStructural, false); + }, function (name) { + var observable = this.$mobx.values[name]; + if (observable === undefined) return undefined; + return observable.get(); + }, function (name, value) { + this.$mobx.values[name].set(value); + }, false, false); + } + var computedDecorator = createComputedDecorator(false); + var computedStructDecorator = createComputedDecorator(true); + var computed = function computed(arg1, arg2, arg3) { + if (typeof arg2 === "string") { + return computedDecorator.apply(null, arguments); + } + invariant(typeof arg1 === "function", getMessage("m011")); + invariant(arguments.length < 3, getMessage("m012")); + var opts = (typeof arg2 === "undefined" ? "undefined" : _typeof(arg2)) === "object" ? arg2 : {}; + opts.setter = typeof arg2 === "function" ? arg2 : opts.setter; + return new ComputedValue(arg1, opts.context, opts.compareStructural || opts.struct || false, opts.name || arg1.name || "", opts.setter); + }; + exports.computed = computed; + computed.struct = computedStructDecorator; + + function createTransformer(transformer, onCleanup) { + invariant(typeof transformer === "function" && transformer.length < 2, "createTransformer expects a function that accepts one argument"); + var objectCache = {}; + var resetId = globalState.resetId; + var Transformer = function (_super) { + __extends(Transformer, _super); + + function Transformer(sourceIdentifier, sourceObject) { + var _this = _super.call(this, function () { + return transformer(sourceObject); + }, undefined, false, "Transformer-" + transformer.name + "-" + sourceIdentifier, undefined) || this; + _this.sourceIdentifier = sourceIdentifier; + _this.sourceObject = sourceObject; + return _this; + } + Transformer.prototype.onBecomeUnobserved = function () { + var lastValue = this.value; + _super.prototype.onBecomeUnobserved.call(this); + delete objectCache[this.sourceIdentifier]; + if (onCleanup) onCleanup(lastValue, this.sourceObject); + }; + return Transformer; + }(ComputedValue); + return function (object) { + if (resetId !== globalState.resetId) { + objectCache = {}; + resetId = globalState.resetId; + } + var identifier = getMemoizationId(object); + var reactiveTransformer = objectCache[identifier]; + if (reactiveTransformer) return reactiveTransformer.get(); + reactiveTransformer = objectCache[identifier] = new Transformer(identifier, object); + return reactiveTransformer.get(); + }; + } + exports.createTransformer = createTransformer; + + function getMemoizationId(object) { + if (object === null || (typeof object === "undefined" ? "undefined" : _typeof(object)) !== "object") throw new Error("[mobx] transform expected some kind of object, got: " + object); + var tid = object.$transformId; + if (tid === undefined) { + tid = getNextId(); + addHiddenProp(object, "$transformId", tid); + } + return tid; + } + + function expr(expr, scope) { + if (!isComputingDerivation()) console.warn(getMessage("m013")); + return computed(expr, { + context: scope + }).get(); + } + exports.expr = expr; + + function extendObservable(target) { + var properties = []; + for (var _i = 1; _i < arguments.length; _i++) { + properties[_i - 1] = arguments[_i]; + } + return extendObservableHelper(target, deepEnhancer, properties); + } + exports.extendObservable = extendObservable; + + function extendShallowObservable(target) { + var properties = []; + for (var _i = 1; _i < arguments.length; _i++) { + properties[_i - 1] = arguments[_i]; + } + return extendObservableHelper(target, referenceEnhancer, properties); + } + exports.extendShallowObservable = extendShallowObservable; + + function extendObservableHelper(target, defaultEnhancer, properties) { + invariant(arguments.length >= 2, getMessage("m014")); + invariant((typeof target === "undefined" ? "undefined" : _typeof(target)) === "object", getMessage("m015")); + invariant(!isObservableMap(target), getMessage("m016")); + properties.forEach(function (propSet) { + invariant((typeof propSet === "undefined" ? "undefined" : _typeof(propSet)) === "object", getMessage("m017")); + invariant(!isObservable(propSet), getMessage("m018")); + }); + var adm = asObservableObject(target); + var definedProps = {}; + for (var i = properties.length - 1; i >= 0; i--) { + var propSet = properties[i]; + for (var key in propSet) { + if (definedProps[key] !== true && hasOwnProperty(propSet, key)) { + definedProps[key] = true; + if (target === propSet && !isPropertyConfigurable(target, key)) continue; + var descriptor = Object.getOwnPropertyDescriptor(propSet, key); + defineObservablePropertyFromDescriptor(adm, key, descriptor, defaultEnhancer); + } + } + } + return target; + } + + function getDependencyTree(thing, property) { + return nodeToDependencyTree(getAtom(thing, property)); + } + + function nodeToDependencyTree(node) { + var result = { + name: node.name + }; + if (node.observing && node.observing.length > 0) result.dependencies = unique(node.observing).map(nodeToDependencyTree); + return result; + } + + function getObserverTree(thing, property) { + return nodeToObserverTree(getAtom(thing, property)); + } + + function nodeToObserverTree(node) { + var result = { + name: node.name + }; + if (hasObservers(node)) result.observers = getObservers(node).map(nodeToObserverTree); + return result; + } + + function intercept(thing, propOrHandler, handler) { + if (typeof handler === "function") return interceptProperty(thing, propOrHandler, handler); + else return interceptInterceptable(thing, propOrHandler); + } + exports.intercept = intercept; + + function interceptInterceptable(thing, handler) { + return getAdministration(thing).intercept(handler); + } + + function interceptProperty(thing, property, handler) { + return getAdministration(thing, property).intercept(handler); + } + + function isComputed(value, property) { + if (value === null || value === undefined) return false; + if (property !== undefined) { + if (isObservableObject(value) === false) return false; + var atom = getAtom(value, property); + return isComputedValue(atom); + } + return isComputedValue(value); + } + exports.isComputed = isComputed; + + function isObservable(value, property) { + if (value === null || value === undefined) return false; + if (property !== undefined) { + if (isObservableArray(value) || isObservableMap(value)) throw new Error(getMessage("m019")); + else if (isObservableObject(value)) { + var o = value.$mobx; + return o.values && !!o.values[property]; + } + return false; + } + return isObservableObject(value) || !!value.$mobx || isAtom(value) || isReaction(value) || isComputedValue(value); + } + exports.isObservable = isObservable; + var deepDecorator = createDecoratorForEnhancer(deepEnhancer); + var shallowDecorator = createDecoratorForEnhancer(shallowEnhancer); + var refDecorator = createDecoratorForEnhancer(referenceEnhancer); + var deepStructDecorator = createDecoratorForEnhancer(deepStructEnhancer); + var refStructDecorator = createDecoratorForEnhancer(refStructEnhancer); + + function createObservable(v) { + if (v === void 0) { + v = undefined; + } + if (typeof arguments[1] === "string") return deepDecorator.apply(null, arguments); + invariant(arguments.length <= 1, getMessage("m021")); + invariant(!isModifierDescriptor(v), getMessage("m020")); + if (isObservable(v)) return v; + var res = deepEnhancer(v, undefined, undefined); + if (res !== v) return res; + return observable.box(v); + } + var IObservableFactories = function () { + function IObservableFactories() {} + IObservableFactories.prototype.box = function (value, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("box"); + return new ObservableValue(value, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowBox = function (value, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowBox"); + return new ObservableValue(value, referenceEnhancer, name); + }; + IObservableFactories.prototype.array = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("array"); + return new ObservableArray(initialValues, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowArray = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowArray"); + return new ObservableArray(initialValues, referenceEnhancer, name); + }; + IObservableFactories.prototype.map = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("map"); + return new ObservableMap(initialValues, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowMap = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowMap"); + return new ObservableMap(initialValues, referenceEnhancer, name); + }; + IObservableFactories.prototype.object = function (props, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("object"); + var res = {}; + asObservableObject(res, name); + extendObservable(res, props); + return res; + }; + IObservableFactories.prototype.shallowObject = function (props, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowObject"); + var res = {}; + asObservableObject(res, name); + extendShallowObservable(res, props); + return res; + }; + IObservableFactories.prototype.ref = function () { + if (arguments.length < 2) { + return createModifierDescriptor(referenceEnhancer, arguments[0]); + } else { + return refDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.shallow = function () { + if (arguments.length < 2) { + return createModifierDescriptor(shallowEnhancer, arguments[0]); + } else { + return shallowDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.deep = function () { + if (arguments.length < 2) { + return createModifierDescriptor(deepEnhancer, arguments[0]); + } else { + return deepDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.struct = function () { + if (arguments.length < 2) { + return createModifierDescriptor(deepStructEnhancer, arguments[0]); + } else { + return deepStructDecorator.apply(null, arguments); + } + }; + return IObservableFactories; + }(); + exports.IObservableFactories = IObservableFactories; + var observable = createObservable; + exports.observable = observable; + Object.keys(IObservableFactories.prototype).forEach(function (key) { + return observable[key] = IObservableFactories.prototype[key]; + }); + observable.deep.struct = observable.struct; + observable.ref.struct = function () { + if (arguments.length < 2) { + return createModifierDescriptor(refStructEnhancer, arguments[0]); + } else { + return refStructDecorator.apply(null, arguments); + } + }; + + function incorrectlyUsedAsDecorator(methodName) { + fail("Expected one or two arguments to observable." + methodName + ". Did you accidentally try to use observable." + methodName + " as decorator?"); + } + + function createDecoratorForEnhancer(enhancer) { + invariant(!!enhancer, ":("); + return createClassPropertyDecorator(function (target, name, baseValue, _, baseDescriptor) { + assertPropertyConfigurable(target, name); + invariant(!baseDescriptor || !baseDescriptor.get, getMessage("m022")); + var adm = asObservableObject(target, undefined); + defineObservableProperty(adm, name, baseValue, enhancer); + }, function (name) { + var observable = this.$mobx.values[name]; + if (observable === undefined) return undefined; + return observable.get(); + }, function (name, value) { + setPropertyValue(this, name, value); + }, true, false); + } + + function observe(thing, propOrCb, cbOrFire, fireImmediately) { + if (typeof cbOrFire === "function") return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately); + else return observeObservable(thing, propOrCb, cbOrFire); + } + exports.observe = observe; + + function observeObservable(thing, listener, fireImmediately) { + return getAdministration(thing).observe(listener, fireImmediately); + } + + function observeObservableProperty(thing, property, listener, fireImmediately) { + return getAdministration(thing, property).observe(listener, fireImmediately); + } + + function toJS(source, detectCycles, __alreadySeen) { + if (detectCycles === void 0) { + detectCycles = true; + } + if (__alreadySeen === void 0) { + __alreadySeen = []; + } + + function cache(value) { + if (detectCycles) __alreadySeen.push([source, value]); + return value; + } + if (isObservable(source)) { + if (detectCycles && __alreadySeen === null) __alreadySeen = []; + if (detectCycles && source !== null && (typeof source === "undefined" ? "undefined" : _typeof(source)) === "object") { + for (var i = 0, l = __alreadySeen.length; i < l; i++) { + if (__alreadySeen[i][0] === source) return __alreadySeen[i][1]; + } + } + if (isObservableArray(source)) { + var res = cache([]); + var toAdd = source.map(function (value) { + return toJS(value, detectCycles, __alreadySeen); + }); + res.length = toAdd.length; + for (var i = 0, l = toAdd.length; i < l; i++) { + res[i] = toAdd[i]; + } + return res; + } + if (isObservableObject(source)) { + var res = cache({}); + for (var key in source) { + res[key] = toJS(source[key], detectCycles, __alreadySeen); + } + return res; + } + if (isObservableMap(source)) { + var res_1 = cache({}); + source.forEach(function (value, key) { + return res_1[key] = toJS(value, detectCycles, __alreadySeen); + }); + return res_1; + } + if (isObservableValue(source)) return toJS(source.get(), detectCycles, __alreadySeen); + } + return source; + } + exports.toJS = toJS; + + function transaction(action, thisArg) { + if (thisArg === void 0) { + thisArg = undefined; + } + deprecated(getMessage("m023")); + return runInTransaction.apply(undefined, arguments); + } + exports.transaction = transaction; + + function runInTransaction(action, thisArg) { + if (thisArg === void 0) { + thisArg = undefined; + } + return executeAction("", action); + } + + function log(msg) { + console.log(msg); + return msg; + } + + function whyRun(thing, prop) { + switch (arguments.length) { + case 0: + thing = globalState.trackingDerivation; + if (!thing) return log(getMessage("m024")); + break; + case 2: + thing = getAtom(thing, prop); + break; + } + thing = getAtom(thing); + if (isComputedValue(thing)) return log(thing.whyRun()); + else if (isReaction(thing)) return log(thing.whyRun()); + return fail(getMessage("m025")); + } + exports.whyRun = whyRun; + + function createAction(actionName, fn) { + invariant(typeof fn === "function", getMessage("m026")); + invariant(typeof actionName === "string" && actionName.length > 0, "actions should have valid names, got: '" + actionName + "'"); + var res = function res() { + return executeAction(actionName, fn, this, arguments); + }; + res.originalFn = fn; + res.isMobxAction = true; + return res; + } + + function executeAction(actionName, fn, scope, args) { + var runInfo = startAction(actionName, fn, scope, args); + try { + return fn.apply(scope, args); + } finally { + endAction(runInfo); + } + } + + function startAction(actionName, fn, scope, args) { + var notifySpy = isSpyEnabled() && !!actionName; + var startTime = 0; + if (notifySpy) { + startTime = Date.now(); + var l = args && args.length || 0; + var flattendArgs = new Array(l); + if (l > 0) + for (var i = 0; i < l; i++) { + flattendArgs[i] = args[i]; + } + spyReportStart({ + type: "action", + name: actionName, + fn: fn, + object: scope, + arguments: flattendArgs + }); + } + var prevDerivation = untrackedStart(); + startBatch(); + var prevAllowStateChanges = allowStateChangesStart(true); + return { + prevDerivation: prevDerivation, + prevAllowStateChanges: prevAllowStateChanges, + notifySpy: notifySpy, + startTime: startTime + }; + } + + function endAction(runInfo) { + allowStateChangesEnd(runInfo.prevAllowStateChanges); + endBatch(); + untrackedEnd(runInfo.prevDerivation); + if (runInfo.notifySpy) spyReportEnd({ + time: Date.now() - runInfo.startTime + }); + } + + function useStrict(strict) { + invariant(globalState.trackingDerivation === null, getMessage("m028")); + globalState.strictMode = strict; + globalState.allowStateChanges = !strict; + } + exports.useStrict = useStrict; + + function isStrictModeEnabled() { + return globalState.strictMode; + } + exports.isStrictModeEnabled = isStrictModeEnabled; + + function allowStateChanges(allowStateChanges, func) { + var prev = allowStateChangesStart(allowStateChanges); + var res; + try { + res = func(); + } finally { + allowStateChangesEnd(prev); + } + return res; + } + + function allowStateChangesStart(allowStateChanges) { + var prev = globalState.allowStateChanges; + globalState.allowStateChanges = allowStateChanges; + return prev; + } + + function allowStateChangesEnd(prev) { + globalState.allowStateChanges = prev; + } + var BaseAtom = function () { + function BaseAtom(name) { + if (name === void 0) { + name = "Atom@" + getNextId(); + } + this.name = name; + this.isPendingUnobservation = true; + this.observers = []; + this.observersIndexes = {}; + this.diffValue = 0; + this.lastAccessedBy = 0; + this.lowestObserverState = IDerivationState.NOT_TRACKING; + } + BaseAtom.prototype.onBecomeUnobserved = function () {}; + BaseAtom.prototype.reportObserved = function () { + reportObserved(this); + }; + BaseAtom.prototype.reportChanged = function () { + startBatch(); + propagateChanged(this); + endBatch(); + }; + BaseAtom.prototype.toString = function () { + return this.name; + }; + return BaseAtom; + }(); + exports.BaseAtom = BaseAtom; + var Atom = function (_super) { + __extends(Atom, _super); + + function Atom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) { + if (name === void 0) { + name = "Atom@" + getNextId(); + } + if (onBecomeObservedHandler === void 0) { + onBecomeObservedHandler = noop; + } + if (onBecomeUnobservedHandler === void 0) { + onBecomeUnobservedHandler = noop; + } + var _this = _super.call(this, name) || this; + _this.name = name; + _this.onBecomeObservedHandler = onBecomeObservedHandler; + _this.onBecomeUnobservedHandler = onBecomeUnobservedHandler; + _this.isPendingUnobservation = false; + _this.isBeingTracked = false; + return _this; + } + Atom.prototype.reportObserved = function () { + startBatch(); + _super.prototype.reportObserved.call(this); + if (!this.isBeingTracked) { + this.isBeingTracked = true; + this.onBecomeObservedHandler(); + } + endBatch(); + return !!globalState.trackingDerivation; + }; + Atom.prototype.onBecomeUnobserved = function () { + this.isBeingTracked = false; + this.onBecomeUnobservedHandler(); + }; + return Atom; + }(BaseAtom); + exports.Atom = Atom; + var isAtom = createInstanceofPredicate("Atom", BaseAtom); + var ComputedValue = function () { + function ComputedValue(derivation, scope, compareStructural, name, setter) { + this.derivation = derivation; + this.scope = scope; + this.compareStructural = compareStructural; + this.dependenciesState = IDerivationState.NOT_TRACKING; + this.observing = []; + this.newObserving = null; + this.isPendingUnobservation = false; + this.observers = []; + this.observersIndexes = {}; + this.diffValue = 0; + this.runId = 0; + this.lastAccessedBy = 0; + this.lowestObserverState = IDerivationState.UP_TO_DATE; + this.unboundDepsCount = 0; + this.__mapid = "#" + getNextId(); + this.value = undefined; + this.isComputing = false; + this.isRunningSetter = false; + this.name = name || "ComputedValue@" + getNextId(); + if (setter) this.setter = createAction(name + "-setter", setter); + } + ComputedValue.prototype.onBecomeStale = function () { + propagateMaybeChanged(this); + }; + ComputedValue.prototype.onBecomeUnobserved = function () { + invariant(this.dependenciesState !== IDerivationState.NOT_TRACKING, getMessage("m029")); + clearObserving(this); + this.value = undefined; + }; + ComputedValue.prototype.get = function () { + invariant(!this.isComputing, "Cycle detected in computation " + this.name, this.derivation); + if (globalState.inBatch === 0) { + startBatch(); + if (shouldCompute(this)) this.value = this.computeValue(false); + endBatch(); + } else { + reportObserved(this); + if (shouldCompute(this)) + if (this.trackAndCompute()) propagateChangeConfirmed(this); + } + var result = this.value; + if (isCaughtException(result)) throw result.cause; + return result; + }; + ComputedValue.prototype.peek = function () { + var res = this.computeValue(false); + if (isCaughtException(res)) throw res.cause; + return res; + }; + ComputedValue.prototype.set = function (value) { + if (this.setter) { + invariant(!this.isRunningSetter, "The setter of computed value '" + this.name + "' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"); + this.isRunningSetter = true; + try { + this.setter.call(this.scope, value); + } finally { + this.isRunningSetter = false; + } + } else invariant(false, "[ComputedValue '" + this.name + "'] It is not possible to assign a new value to a computed value."); + }; + ComputedValue.prototype.trackAndCompute = function () { + if (isSpyEnabled()) { + spyReport({ + object: this.scope, + type: "compute", + fn: this.derivation + }); + } + var oldValue = this.value; + var newValue = this.value = this.computeValue(true); + return isCaughtException(newValue) || valueDidChange(this.compareStructural, newValue, oldValue); + }; + ComputedValue.prototype.computeValue = function (track) { + this.isComputing = true; + globalState.computationDepth++; + var res; + if (track) { + res = trackDerivedFunction(this, this.derivation, this.scope); + } else { + try { + res = this.derivation.call(this.scope); + } catch (e) { + res = new CaughtException(e); + } + } + globalState.computationDepth--; + this.isComputing = false; + return res; + };; + ComputedValue.prototype.observe = function (listener, fireImmediately) { + var _this = this; + var firstTime = true; + var prevValue = undefined; + return autorun(function () { + var newValue = _this.get(); + if (!firstTime || fireImmediately) { + var prevU = untrackedStart(); + listener({ + type: "update", + object: _this, + newValue: newValue, + oldValue: prevValue + }); + untrackedEnd(prevU); + } + firstTime = false; + prevValue = newValue; + }); + }; + ComputedValue.prototype.toJSON = function () { + return this.get(); + }; + ComputedValue.prototype.toString = function () { + return this.name + "[" + this.derivation.toString() + "]"; + }; + ComputedValue.prototype.valueOf = function () { + return toPrimitive(this.get()); + };; + ComputedValue.prototype.whyRun = function () { + var isTracking = Boolean(globalState.trackingDerivation); + var observing = unique(this.isComputing ? this.newObserving : this.observing).map(function (dep) { + return dep.name; + }); + var observers = unique(getObservers(this).map(function (dep) { + return dep.name; + })); + return "\nWhyRun? computation '" + this.name + "':\n * Running because: " + (isTracking ? "[active] the value of this computation is needed by a reaction" : this.isComputing ? "[get] The value of this computed was requested outside a reaction" : "[idle] not running at the moment") + "\n" + (this.dependenciesState === IDerivationState.NOT_TRACKING ? getMessage("m032") : " * This computation will re-run if any of the following observables changes:\n " + joinStrings(observing) + "\n " + (this.isComputing && isTracking ? " (... or any observable accessed during the remainder of the current run)" : "") + "\n\t" + getMessage("m038") + "\n\n * If the outcome of this computation changes, the following observers will be re-run:\n " + joinStrings(observers) + "\n"); + }; + return ComputedValue; + }(); + ComputedValue.prototype[primitiveSymbol()] = ComputedValue.prototype.valueOf; + var isComputedValue = createInstanceofPredicate("ComputedValue", ComputedValue); + var IDerivationState; + (function (IDerivationState) { + IDerivationState[IDerivationState["NOT_TRACKING"] = -1] = "NOT_TRACKING"; + IDerivationState[IDerivationState["UP_TO_DATE"] = 0] = "UP_TO_DATE"; + IDerivationState[IDerivationState["POSSIBLY_STALE"] = 1] = "POSSIBLY_STALE"; + IDerivationState[IDerivationState["STALE"] = 2] = "STALE"; + })(IDerivationState || (IDerivationState = {})); + exports.IDerivationState = IDerivationState; + var CaughtException = function () { + function CaughtException(cause) { + this.cause = cause; + } + return CaughtException; + }(); + + function isCaughtException(e) { + return e instanceof CaughtException; + } + + function shouldCompute(derivation) { + switch (derivation.dependenciesState) { + case IDerivationState.UP_TO_DATE: + return false; + case IDerivationState.NOT_TRACKING: + case IDerivationState.STALE: + return true; + case IDerivationState.POSSIBLY_STALE: { + var prevUntracked = untrackedStart(); + var obs = derivation.observing, + l = obs.length; + for (var i = 0; i < l; i++) { + var obj = obs[i]; + if (isComputedValue(obj)) { + try { + obj.get(); + } catch (e) { + untrackedEnd(prevUntracked); + return true; + } + if (derivation.dependenciesState === IDerivationState.STALE) { + untrackedEnd(prevUntracked); + return true; + } + } + } + changeDependenciesStateTo0(derivation); + untrackedEnd(prevUntracked); + return false; + } + } + } + + function isComputingDerivation() { + return globalState.trackingDerivation !== null; + } + + function checkIfStateModificationsAreAllowed(atom) { + var hasObservers = atom.observers.length > 0; + if (globalState.computationDepth > 0 && hasObservers) fail(getMessage("m031") + atom.name); + if (!globalState.allowStateChanges && hasObservers) fail(getMessage(globalState.strictMode ? "m030a" : "m030b") + atom.name); + } + + function trackDerivedFunction(derivation, f, context) { + changeDependenciesStateTo0(derivation); + derivation.newObserving = new Array(derivation.observing.length + 100); + derivation.unboundDepsCount = 0; + derivation.runId = ++globalState.runId; + var prevTracking = globalState.trackingDerivation; + globalState.trackingDerivation = derivation; + var result; + try { + result = f.call(context); + } catch (e) { + result = new CaughtException(e); + } + globalState.trackingDerivation = prevTracking; + bindDependencies(derivation); + return result; + } + + function bindDependencies(derivation) { + var prevObserving = derivation.observing; + var observing = derivation.observing = derivation.newObserving; + derivation.newObserving = null; + var i0 = 0, + l = derivation.unboundDepsCount; + for (var i = 0; i < l; i++) { + var dep = observing[i]; + if (dep.diffValue === 0) { + dep.diffValue = 1; + if (i0 !== i) observing[i0] = dep; + i0++; + } + } + observing.length = i0; + l = prevObserving.length; + while (l--) { + var dep = prevObserving[l]; + if (dep.diffValue === 0) { + removeObserver(dep, derivation); + } + dep.diffValue = 0; + } + while (i0--) { + var dep = observing[i0]; + if (dep.diffValue === 1) { + dep.diffValue = 0; + addObserver(dep, derivation); + } + } + } + + function clearObserving(derivation) { + var obs = derivation.observing; + var i = obs.length; + while (i--) { + removeObserver(obs[i], derivation); + } + derivation.dependenciesState = IDerivationState.NOT_TRACKING; + obs.length = 0; + } + + function untracked(action) { + var prev = untrackedStart(); + var res = action(); + untrackedEnd(prev); + return res; + } + exports.untracked = untracked; + + function untrackedStart() { + var prev = globalState.trackingDerivation; + globalState.trackingDerivation = null; + return prev; + } + + function untrackedEnd(prev) { + globalState.trackingDerivation = prev; + } + + function changeDependenciesStateTo0(derivation) { + if (derivation.dependenciesState === IDerivationState.UP_TO_DATE) return; + derivation.dependenciesState = IDerivationState.UP_TO_DATE; + var obs = derivation.observing; + var i = obs.length; + while (i--) { + obs[i].lowestObserverState = IDerivationState.UP_TO_DATE; + } + } + var persistentKeys = ["mobxGuid", "resetId", "spyListeners", "strictMode", "runId"]; + var MobXGlobals = function () { + function MobXGlobals() { + this.version = 5; + this.trackingDerivation = null; + this.computationDepth = 0; + this.runId = 0; + this.mobxGuid = 0; + this.inBatch = 0; + this.pendingUnobservations = []; + this.pendingReactions = []; + this.isRunningReactions = false; + this.allowStateChanges = true; + this.strictMode = false; + this.resetId = 0; + this.spyListeners = []; + this.globalReactionErrorHandlers = []; + } + return MobXGlobals; + }(); + var globalState = new MobXGlobals(); + + function shareGlobalState() { + var global = getGlobal(); + var ownState = globalState; + if (global.__mobservableTrackingStack || global.__mobservableViewStack) throw new Error("[mobx] An incompatible version of mobservable is already loaded."); + if (global.__mobxGlobal && global.__mobxGlobal.version !== ownState.version) throw new Error("[mobx] An incompatible version of mobx is already loaded."); + if (global.__mobxGlobal) globalState = global.__mobxGlobal; + else global.__mobxGlobal = ownState; + } + + function getGlobalState() { + return globalState; + } + + function registerGlobals() {} + + function resetGlobalState() { + globalState.resetId++; + var defaultGlobals = new MobXGlobals(); + for (var key in defaultGlobals) { + if (persistentKeys.indexOf(key) === -1) globalState[key] = defaultGlobals[key]; + } + globalState.allowStateChanges = !globalState.strictMode; + } + + function hasObservers(observable) { + return observable.observers && observable.observers.length > 0; + } + + function getObservers(observable) { + return observable.observers; + } + + function invariantObservers(observable) { + var list = observable.observers; + var map = observable.observersIndexes; + var l = list.length; + for (var i = 0; i < l; i++) { + var id = list[i].__mapid; + if (i) { + invariant(map[id] === i, "INTERNAL ERROR maps derivation.__mapid to index in list"); + } else { + invariant(!(id in map), "INTERNAL ERROR observer on index 0 shouldnt be held in map."); + } + } + invariant(list.length === 0 || Object.keys(map).length === list.length - 1, "INTERNAL ERROR there is no junk in map"); + } + + function addObserver(observable, node) { + var l = observable.observers.length; + if (l) { + observable.observersIndexes[node.__mapid] = l; + } + observable.observers[l] = node; + if (observable.lowestObserverState > node.dependenciesState) observable.lowestObserverState = node.dependenciesState; + } + + function removeObserver(observable, node) { + if (observable.observers.length === 1) { + observable.observers.length = 0; + queueForUnobservation(observable); + } else { + var list = observable.observers; + var map_1 = observable.observersIndexes; + var filler = list.pop(); + if (filler !== node) { + var index = map_1[node.__mapid] || 0; + if (index) { + map_1[filler.__mapid] = index; + } else { + delete map_1[filler.__mapid]; + } + list[index] = filler; + } + delete map_1[node.__mapid]; + } + } + + function queueForUnobservation(observable) { + if (!observable.isPendingUnobservation) { + observable.isPendingUnobservation = true; + globalState.pendingUnobservations.push(observable); + } + } + + function startBatch() { + globalState.inBatch++; + } + + function endBatch() { + if (--globalState.inBatch === 0) { + runReactions(); + var list = globalState.pendingUnobservations; + for (var i = 0; i < list.length; i++) { + var observable_1 = list[i]; + observable_1.isPendingUnobservation = false; + if (observable_1.observers.length === 0) { + observable_1.onBecomeUnobserved(); + } + } + globalState.pendingUnobservations = []; + } + } + + function reportObserved(observable) { + var derivation = globalState.trackingDerivation; + if (derivation !== null) { + if (derivation.runId !== observable.lastAccessedBy) { + observable.lastAccessedBy = derivation.runId; + derivation.newObserving[derivation.unboundDepsCount++] = observable; + } + } else if (observable.observers.length === 0) { + queueForUnobservation(observable); + } + } + + function invariantLOS(observable, msg) { + var min = getObservers(observable).reduce(function (a, b) { + return Math.min(a, b.dependenciesState); + }, 2); + if (min >= observable.lowestObserverState) return; + throw new Error("lowestObserverState is wrong for " + msg + " because " + min + " < " + observable.lowestObserverState); + } + + function propagateChanged(observable) { + if (observable.lowestObserverState === IDerivationState.STALE) return; + observable.lowestObserverState = IDerivationState.STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.UP_TO_DATE) d.onBecomeStale(); + d.dependenciesState = IDerivationState.STALE; + } + } + + function propagateChangeConfirmed(observable) { + if (observable.lowestObserverState === IDerivationState.STALE) return; + observable.lowestObserverState = IDerivationState.STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.POSSIBLY_STALE) d.dependenciesState = IDerivationState.STALE; + else if (d.dependenciesState === IDerivationState.UP_TO_DATE) observable.lowestObserverState = IDerivationState.UP_TO_DATE; + } + } + + function propagateMaybeChanged(observable) { + if (observable.lowestObserverState !== IDerivationState.UP_TO_DATE) return; + observable.lowestObserverState = IDerivationState.POSSIBLY_STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.UP_TO_DATE) { + d.dependenciesState = IDerivationState.POSSIBLY_STALE; + d.onBecomeStale(); + } + } + } + var Reaction = function () { + function Reaction(name, onInvalidate) { + if (name === void 0) { + name = "Reaction@" + getNextId(); + } + this.name = name; + this.onInvalidate = onInvalidate; + this.observing = []; + this.newObserving = []; + this.dependenciesState = IDerivationState.NOT_TRACKING; + this.diffValue = 0; + this.runId = 0; + this.unboundDepsCount = 0; + this.__mapid = "#" + getNextId(); + this.isDisposed = false; + this._isScheduled = false; + this._isTrackPending = false; + this._isRunning = false; + } + Reaction.prototype.onBecomeStale = function () { + this.schedule(); + }; + Reaction.prototype.schedule = function () { + if (!this._isScheduled) { + this._isScheduled = true; + globalState.pendingReactions.push(this); + runReactions(); + } + }; + Reaction.prototype.isScheduled = function () { + return this._isScheduled; + }; + Reaction.prototype.runReaction = function () { + if (!this.isDisposed) { + startBatch(); + this._isScheduled = false; + if (shouldCompute(this)) { + this._isTrackPending = true; + this.onInvalidate(); + if (this._isTrackPending && isSpyEnabled()) { + spyReport({ + object: this, + type: "scheduled-reaction" + }); + } + } + endBatch(); + } + }; + Reaction.prototype.track = function (fn) { + startBatch(); + var notify = isSpyEnabled(); + var startTime; + if (notify) { + startTime = Date.now(); + spyReportStart({ + object: this, + type: "reaction", + fn: fn + }); + } + this._isRunning = true; + var result = trackDerivedFunction(this, fn, undefined); + this._isRunning = false; + this._isTrackPending = false; + if (this.isDisposed) { + clearObserving(this); + } + if (isCaughtException(result)) this.reportExceptionInDerivation(result.cause); + if (notify) { + spyReportEnd({ + time: Date.now() - startTime + }); + } + endBatch(); + }; + Reaction.prototype.reportExceptionInDerivation = function (error) { + var _this = this; + if (this.errorHandler) { + this.errorHandler(error, this); + return; + } + var message = "[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '" + this; + var messageToUser = getMessage("m037"); + console.error(message || messageToUser, error); + if (isSpyEnabled()) { + spyReport({ + type: "error", + message: message, + error: error, + object: this + }); + } + globalState.globalReactionErrorHandlers.forEach(function (f) { + return f(error, _this); + }); + }; + Reaction.prototype.dispose = function () { + if (!this.isDisposed) { + this.isDisposed = true; + if (!this._isRunning) { + startBatch(); + clearObserving(this); + endBatch(); + } + } + }; + Reaction.prototype.getDisposer = function () { + var r = this.dispose.bind(this); + r.$mobx = this; + r.onError = registerErrorHandler; + return r; + }; + Reaction.prototype.toString = function () { + return "Reaction[" + this.name + "]"; + }; + Reaction.prototype.whyRun = function () { + var observing = unique(this._isRunning ? this.newObserving : this.observing).map(function (dep) { + return dep.name; + }); + return "\nWhyRun? reaction '" + this.name + "':\n * Status: [" + (this.isDisposed ? "stopped" : this._isRunning ? "running" : this.isScheduled() ? "scheduled" : "idle") + "]\n * This reaction will re-run if any of the following observables changes:\n " + joinStrings(observing) + "\n " + (this._isRunning ? " (... or any observable accessed during the remainder of the current run)" : "") + "\n\t" + getMessage("m038") + "\n"; + }; + return Reaction; + }(); + exports.Reaction = Reaction; + + function registerErrorHandler(handler) { + invariant(this && this.$mobx && isReaction(this.$mobx), "Invalid `this`"); + invariant(!this.$mobx.errorHandler, "Only one onErrorHandler can be registered"); + this.$mobx.errorHandler = handler; + } + + function onReactionError(handler) { + globalState.globalReactionErrorHandlers.push(handler); + return function () { + var idx = globalState.globalReactionErrorHandlers.indexOf(handler); + if (idx >= 0) globalState.globalReactionErrorHandlers.splice(idx, 1); + }; + } + var MAX_REACTION_ITERATIONS = 100; + var reactionScheduler = function reactionScheduler(f) { + return f(); + }; + + function runReactions() { + if (globalState.inBatch > 0 || globalState.isRunningReactions) return; + reactionScheduler(runReactionsHelper); + } + + function runReactionsHelper() { + globalState.isRunningReactions = true; + var allReactions = globalState.pendingReactions; + var iterations = 0; + while (allReactions.length > 0) { + if (++iterations === MAX_REACTION_ITERATIONS) { + console.error("Reaction doesn't converge to a stable state after " + MAX_REACTION_ITERATIONS + " iterations." + (" Probably there is a cycle in the reactive function: " + allReactions[0])); + allReactions.splice(0); + } + var remainingReactions = allReactions.splice(0); + for (var i = 0, l = remainingReactions.length; i < l; i++) { + remainingReactions[i].runReaction(); + } + } + globalState.isRunningReactions = false; + } + var isReaction = createInstanceofPredicate("Reaction", Reaction); + + function setReactionScheduler(fn) { + var baseScheduler = reactionScheduler; + reactionScheduler = function reactionScheduler(f) { + return fn(function () { + return baseScheduler(f); + }); + }; + } + + function isSpyEnabled() { + return !!globalState.spyListeners.length; + } + + function spyReport(event) { + if (!globalState.spyListeners.length) return; + var listeners = globalState.spyListeners; + for (var i = 0, l = listeners.length; i < l; i++) { + listeners[i](event); + } + } + + function spyReportStart(event) { + var change = objectAssign({}, event, { + spyReportStart: true + }); + spyReport(change); + } + var END_EVENT = { + spyReportEnd: true + }; + + function spyReportEnd(change) { + if (change) spyReport(objectAssign({}, change, END_EVENT)); + else spyReport(END_EVENT); + } + + function spy(listener) { + globalState.spyListeners.push(listener); + return once(function () { + var idx = globalState.spyListeners.indexOf(listener); + if (idx !== -1) globalState.spyListeners.splice(idx, 1); + }); + } + exports.spy = spy; + + function hasInterceptors(interceptable) { + return interceptable.interceptors && interceptable.interceptors.length > 0; + } + + function registerInterceptor(interceptable, handler) { + var interceptors = interceptable.interceptors || (interceptable.interceptors = []); + interceptors.push(handler); + return once(function () { + var idx = interceptors.indexOf(handler); + if (idx !== -1) interceptors.splice(idx, 1); + }); + } + + function interceptChange(interceptable, change) { + var prevU = untrackedStart(); + try { + var interceptors = interceptable.interceptors; + if (interceptors) + for (var i = 0, l = interceptors.length; i < l; i++) { + change = interceptors[i](change); + invariant(!change || change.type, "Intercept handlers should return nothing or a change object"); + if (!change) break; + } + return change; + } finally { + untrackedEnd(prevU); + } + } + + function hasListeners(listenable) { + return listenable.changeListeners && listenable.changeListeners.length > 0; + } + + function registerListener(listenable, handler) { + var listeners = listenable.changeListeners || (listenable.changeListeners = []); + listeners.push(handler); + return once(function () { + var idx = listeners.indexOf(handler); + if (idx !== -1) listeners.splice(idx, 1); + }); + } + + function notifyListeners(listenable, change) { + var prevU = untrackedStart(); + var listeners = listenable.changeListeners; + if (!listeners) return; + listeners = listeners.slice(); + for (var i = 0, l = listeners.length; i < l; i++) { + listeners[i](change); + } + untrackedEnd(prevU); + } + + function asReference(value) { + deprecated("asReference is deprecated, use observable.ref instead"); + return observable.ref(value); + } + exports.asReference = asReference; + + function asStructure(value) { + deprecated("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."); + return observable.struct(value); + } + exports.asStructure = asStructure; + + function asFlat(value) { + deprecated("asFlat is deprecated, use observable.shallow instead"); + return observable.shallow(value); + } + exports.asFlat = asFlat; + + function asMap(data) { + deprecated("asMap is deprecated, use observable.map or observable.shallowMap instead"); + return observable.map(data || {}); + } + exports.asMap = asMap; + + function isModifierDescriptor(thing) { + return (typeof thing === "undefined" ? "undefined" : _typeof(thing)) === "object" && thing !== null && thing.isMobxModifierDescriptor === true; + } + exports.isModifierDescriptor = isModifierDescriptor; + + function createModifierDescriptor(enhancer, initialValue) { + invariant(!isModifierDescriptor(initialValue), "Modifiers cannot be nested"); + return { + isMobxModifierDescriptor: true, + initialValue: initialValue, + enhancer: enhancer + }; + } + + function deepEnhancer(v, _, name) { + if (isModifierDescriptor(v)) fail("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"); + if (isObservable(v)) return v; + if (Array.isArray(v)) return observable.array(v, name); + if (isPlainObject(v)) return observable.object(v, name); + if (isES6Map(v)) return observable.map(v, name); + return v; + } + + function shallowEnhancer(v, _, name) { + if (isModifierDescriptor(v)) fail("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"); + if (v === undefined || v === null) return v; + if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v)) return v; + if (Array.isArray(v)) return observable.shallowArray(v, name); + if (isPlainObject(v)) return observable.shallowObject(v, name); + if (isES6Map(v)) return observable.shallowMap(v, name); + return fail("The shallow modifier / decorator can only used in combination with arrays, objects and maps"); + } + + function referenceEnhancer(newValue) { + return newValue; + } + + function deepStructEnhancer(v, oldValue, name) { + if (deepEqual(v, oldValue)) return oldValue; + if (isObservable(v)) return v; + if (Array.isArray(v)) return new ObservableArray(v, deepStructEnhancer, name); + if (isES6Map(v)) return new ObservableMap(v, deepStructEnhancer, name); + if (isPlainObject(v)) { + var res = {}; + asObservableObject(res, name); + extendObservableHelper(res, deepStructEnhancer, [v]); + return res; + } + return v; + } + + function refStructEnhancer(v, oldValue, name) { + if (deepEqual(v, oldValue)) return oldValue; + return v; + } + var MAX_SPLICE_SIZE = 10000; + var safariPrototypeSetterInheritanceBug = function () { + var v = false; + var p = {}; + Object.defineProperty(p, "0", { + set: function set() { + v = true; + } + }); + Object.create(p)["0"] = 1; + return v === false; + }(); + var OBSERVABLE_ARRAY_BUFFER_SIZE = 0; + var StubArray = function () { + function StubArray() {} + return StubArray; + }(); + StubArray.prototype = []; + var ObservableArrayAdministration = function () { + function ObservableArrayAdministration(name, enhancer, array, owned) { + this.array = array; + this.owned = owned; + this.lastKnownLength = 0; + this.interceptors = null; + this.changeListeners = null; + this.atom = new BaseAtom(name || "ObservableArray@" + getNextId()); + this.enhancer = function (newV, oldV) { + return enhancer(newV, oldV, name + "[..]"); + }; + } + ObservableArrayAdministration.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + ObservableArrayAdministration.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately === void 0) { + fireImmediately = false; + } + if (fireImmediately) { + listener({ + object: this.array, + type: "splice", + index: 0, + added: this.values.slice(), + addedCount: this.values.length, + removed: [], + removedCount: 0 + }); + } + return registerListener(this, listener); + }; + ObservableArrayAdministration.prototype.getArrayLength = function () { + this.atom.reportObserved(); + return this.values.length; + }; + ObservableArrayAdministration.prototype.setArrayLength = function (newLength) { + if (typeof newLength !== "number" || newLength < 0) throw new Error("[mobx.array] Out of range: " + newLength); + var currentLength = this.values.length; + if (newLength === currentLength) return; + else if (newLength > currentLength) { + var newItems = new Array(newLength - currentLength); + for (var i = 0; i < newLength - currentLength; i++) { + newItems[i] = undefined; + } + this.spliceWithArray(currentLength, 0, newItems); + } else this.spliceWithArray(newLength, currentLength - newLength); + }; + ObservableArrayAdministration.prototype.updateArrayLength = function (oldLength, delta) { + if (oldLength !== this.lastKnownLength) throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?"); + this.lastKnownLength += delta; + if (delta > 0 && oldLength + delta + 1 > OBSERVABLE_ARRAY_BUFFER_SIZE) reserveArrayBuffer(oldLength + delta + 1); + }; + ObservableArrayAdministration.prototype.spliceWithArray = function (index, deleteCount, newItems) { + var _this = this; + checkIfStateModificationsAreAllowed(this.atom); + var length = this.values.length; + if (index === undefined) index = 0; + else if (index > length) index = length; + else if (index < 0) index = Math.max(0, length + index); + if (arguments.length === 1) deleteCount = length - index; + else if (deleteCount === undefined || deleteCount === null) deleteCount = 0; + else deleteCount = Math.max(0, Math.min(deleteCount, length - index)); + if (newItems === undefined) newItems = []; + if (hasInterceptors(this)) { + var change = interceptChange(this, { + object: this.array, + type: "splice", + index: index, + removedCount: deleteCount, + added: newItems + }); + if (!change) return EMPTY_ARRAY; + deleteCount = change.removedCount; + newItems = change.added; + } + newItems = newItems.map(function (v) { + return _this.enhancer(v, undefined); + }); + var lengthDelta = newItems.length - deleteCount; + this.updateArrayLength(length, lengthDelta); + var res = this.spliceItemsIntoValues(index, deleteCount, newItems); + if (deleteCount !== 0 || newItems.length !== 0) this.notifyArraySplice(index, newItems, res); + return res; + }; + ObservableArrayAdministration.prototype.spliceItemsIntoValues = function (index, deleteCount, newItems) { + if (newItems.length < MAX_SPLICE_SIZE) { + return (_a = this.values).splice.apply(_a, [index, deleteCount].concat(newItems)); + } else { + var res = this.values.slice(index, index + deleteCount); + this.values = this.values.slice(0, index).concat(newItems, this.values.slice(index + deleteCount)); + return res; + } + var _a; + }; + ObservableArrayAdministration.prototype.notifyArrayChildUpdate = function (index, newValue, oldValue) { + var notifySpy = !this.owned && isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + object: this.array, + type: "update", + index: index, + newValue: newValue, + oldValue: oldValue + } : null; + if (notifySpy) spyReportStart(change); + this.atom.reportChanged(); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + ObservableArrayAdministration.prototype.notifyArraySplice = function (index, added, removed) { + var notifySpy = !this.owned && isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + object: this.array, + type: "splice", + index: index, + removed: removed, + added: added, + removedCount: removed.length, + addedCount: added.length + } : null; + if (notifySpy) spyReportStart(change); + this.atom.reportChanged(); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + return ObservableArrayAdministration; + }(); + var ObservableArray = function (_super) { + __extends(ObservableArray, _super); + + function ObservableArray(initialValues, enhancer, name, owned) { + if (name === void 0) { + name = "ObservableArray@" + getNextId(); + } + if (owned === void 0) { + owned = false; + } + var _this = _super.call(this) || this; + var adm = new ObservableArrayAdministration(name, enhancer, _this, owned); + addHiddenFinalProp(_this, "$mobx", adm); + if (initialValues && initialValues.length) { + adm.updateArrayLength(0, initialValues.length); + adm.values = initialValues.map(function (v) { + return enhancer(v, undefined, name + "[..]"); + }); + adm.notifyArraySplice(0, adm.values.slice(), EMPTY_ARRAY); + } else { + adm.values = []; + } + if (safariPrototypeSetterInheritanceBug) { + Object.defineProperty(adm.array, "0", ENTRY_0); + } + return _this; + } + ObservableArray.prototype.intercept = function (handler) { + return this.$mobx.intercept(handler); + }; + ObservableArray.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately === void 0) { + fireImmediately = false; + } + return this.$mobx.observe(listener, fireImmediately); + }; + ObservableArray.prototype.clear = function () { + return this.splice(0); + }; + ObservableArray.prototype.concat = function () { + var arrays = []; + for (var _i = 0; _i < arguments.length; _i++) { + arrays[_i] = arguments[_i]; + } + this.$mobx.atom.reportObserved(); + return Array.prototype.concat.apply(this.peek(), arrays.map(function (a) { + return isObservableArray(a) ? a.peek() : a; + })); + }; + ObservableArray.prototype.replace = function (newItems) { + return this.$mobx.spliceWithArray(0, this.$mobx.values.length, newItems); + }; + ObservableArray.prototype.toJS = function () { + return this.slice(); + }; + ObservableArray.prototype.toJSON = function () { + return this.toJS(); + }; + ObservableArray.prototype.peek = function () { + return this.$mobx.values; + }; + ObservableArray.prototype.find = function (predicate, thisArg, fromIndex) { + if (fromIndex === void 0) { + fromIndex = 0; + } + this.$mobx.atom.reportObserved(); + var items = this.$mobx.values, + l = items.length; + for (var i = fromIndex; i < l; i++) { + if (predicate.call(thisArg, items[i], i, this)) return items[i]; + } + return undefined; + }; + ObservableArray.prototype.splice = function (index, deleteCount) { + var newItems = []; + for (var _i = 2; _i < arguments.length; _i++) { + newItems[_i - 2] = arguments[_i]; + } + switch (arguments.length) { + case 0: + return []; + case 1: + return this.$mobx.spliceWithArray(index); + case 2: + return this.$mobx.spliceWithArray(index, deleteCount); + } + return this.$mobx.spliceWithArray(index, deleteCount, newItems); + }; + ObservableArray.prototype.spliceWithArray = function (index, deleteCount, newItems) { + return this.$mobx.spliceWithArray(index, deleteCount, newItems); + }; + ObservableArray.prototype.push = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + var adm = this.$mobx; + adm.spliceWithArray(adm.values.length, 0, items); + return adm.values.length; + }; + ObservableArray.prototype.pop = function () { + return this.splice(Math.max(this.$mobx.values.length - 1, 0), 1)[0]; + }; + ObservableArray.prototype.shift = function () { + return this.splice(0, 1)[0]; + }; + ObservableArray.prototype.unshift = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + var adm = this.$mobx; + adm.spliceWithArray(0, 0, items); + return adm.values.length; + }; + ObservableArray.prototype.reverse = function () { + this.$mobx.atom.reportObserved(); + var clone = this.slice(); + return clone.reverse.apply(clone, arguments); + }; + ObservableArray.prototype.sort = function (compareFn) { + this.$mobx.atom.reportObserved(); + var clone = this.slice(); + return clone.sort.apply(clone, arguments); + }; + ObservableArray.prototype.remove = function (value) { + var idx = this.$mobx.values.indexOf(value); + if (idx > -1) { + this.splice(idx, 1); + return true; + } + return false; + }; + ObservableArray.prototype.move = function (fromIndex, toIndex) { + function checkIndex(index) { + if (index < 0) { + throw new Error("[mobx.array] Index out of bounds: " + index + " is negative"); + } + var length = this.$mobx.values.length; + if (index >= length) { + throw new Error("[mobx.array] Index out of bounds: " + index + " is not smaller than " + length); + } + } + checkIndex.call(this, fromIndex); + checkIndex.call(this, toIndex); + if (fromIndex === toIndex) { + return; + } + var oldItems = this.$mobx.values; + var newItems; + if (fromIndex < toIndex) { + newItems = oldItems.slice(0, fromIndex).concat(oldItems.slice(fromIndex + 1, toIndex + 1), [oldItems[fromIndex]], oldItems.slice(toIndex + 1)); + } else { + newItems = oldItems.slice(0, toIndex).concat([oldItems[fromIndex]], oldItems.slice(toIndex, fromIndex), oldItems.slice(fromIndex + 1)); + } + this.replace(newItems); + }; + ObservableArray.prototype.toString = function () { + this.$mobx.atom.reportObserved(); + return Array.prototype.toString.apply(this.$mobx.values, arguments); + }; + ObservableArray.prototype.toLocaleString = function () { + this.$mobx.atom.reportObserved(); + return Array.prototype.toLocaleString.apply(this.$mobx.values, arguments); + }; + return ObservableArray; + }(StubArray); + declareIterator(ObservableArray.prototype, function () { + return arrayAsIterator(this.slice()); + }); + makeNonEnumerable(ObservableArray.prototype, ["constructor", "intercept", "observe", "clear", "concat", "replace", "toJS", "toJSON", "peek", "find", "splice", "spliceWithArray", "push", "pop", "shift", "unshift", "reverse", "sort", "remove", "move", "toString", "toLocaleString"]); + Object.defineProperty(ObservableArray.prototype, "length", { + enumerable: false, + configurable: true, + get: function get() { + return this.$mobx.getArrayLength(); + }, + set: function set(newLength) { + this.$mobx.setArrayLength(newLength); + } + }); + ["every", "filter", "forEach", "indexOf", "join", "lastIndexOf", "map", "reduce", "reduceRight", "slice", "some"].forEach(function (funcName) { + var baseFunc = Array.prototype[funcName]; + invariant(typeof baseFunc === "function", "Base function not defined on Array prototype: '" + funcName + "'"); + addHiddenProp(ObservableArray.prototype, funcName, function () { + this.$mobx.atom.reportObserved(); + return baseFunc.apply(this.$mobx.values, arguments); + }); + }); + var ENTRY_0 = { + configurable: true, + enumerable: false, + set: createArraySetter(0), + get: createArrayGetter(0) + }; + + function createArrayBufferItem(index) { + var set = createArraySetter(index); + var get = createArrayGetter(index); + Object.defineProperty(ObservableArray.prototype, "" + index, { + enumerable: false, + configurable: true, + set: set, + get: get + }); + } + + function createArraySetter(index) { + return function (newValue) { + var adm = this.$mobx; + var values = adm.values; + if (index < values.length) { + checkIfStateModificationsAreAllowed(adm.atom); + var oldValue = values[index]; + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + type: "update", + object: adm.array, + index: index, + newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + newValue = adm.enhancer(newValue, oldValue); + var changed = newValue !== oldValue; + if (changed) { + values[index] = newValue; + adm.notifyArrayChildUpdate(index, newValue, oldValue); + } + } else if (index === values.length) { + adm.spliceWithArray(index, 0, [newValue]); + } else throw new Error("[mobx.array] Index out of bounds, " + index + " is larger than " + values.length); + }; + } + + function createArrayGetter(index) { + return function () { + var impl = this.$mobx; + if (impl) { + if (index < impl.values.length) { + impl.atom.reportObserved(); + return impl.values[index]; + } + console.warn("[mobx.array] Attempt to read an array index (" + index + ") that is out of bounds (" + impl.values.length + "). Please check length first. Out of bound indices will not be tracked by MobX"); + } + return undefined; + }; + } + + function reserveArrayBuffer(max) { + for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max; index++) { + createArrayBufferItem(index); + } + OBSERVABLE_ARRAY_BUFFER_SIZE = max; + } + reserveArrayBuffer(1000); + var isObservableArrayAdministration = createInstanceofPredicate("ObservableArrayAdministration", ObservableArrayAdministration); + + function isObservableArray(thing) { + return isObject(thing) && isObservableArrayAdministration(thing.$mobx); + } + exports.isObservableArray = isObservableArray; + var ObservableMapMarker = {}; + var ObservableMap = function () { + function ObservableMap(initialData, enhancer, name) { + if (enhancer === void 0) { + enhancer = deepEnhancer; + } + if (name === void 0) { + name = "ObservableMap@" + getNextId(); + } + this.enhancer = enhancer; + this.name = name; + this.$mobx = ObservableMapMarker; + this._data = {}; + this._hasMap = {}; + this._keys = new ObservableArray(undefined, referenceEnhancer, this.name + ".keys()", true); + this.interceptors = null; + this.changeListeners = null; + this.merge(initialData); + } + ObservableMap.prototype._has = function (key) { + return typeof this._data[key] !== "undefined"; + }; + ObservableMap.prototype.has = function (key) { + if (!this.isValidKey(key)) return false; + key = "" + key; + if (this._hasMap[key]) return this._hasMap[key].get(); + return this._updateHasMapEntry(key, false).get(); + }; + ObservableMap.prototype.set = function (key, value) { + this.assertValidKey(key); + key = "" + key; + var hasKey = this._has(key); + if (hasInterceptors(this)) { + var change = interceptChange(this, { + type: hasKey ? "update" : "add", + object: this, + newValue: value, + name: key + }); + if (!change) return this; + value = change.newValue; + } + if (hasKey) { + this._updateValue(key, value); + } else { + this._addValue(key, value); + } + return this; + }; + ObservableMap.prototype.delete = function (key) { + var _this = this; + this.assertValidKey(key); + key = "" + key; + if (hasInterceptors(this)) { + var change = interceptChange(this, { + type: "delete", + object: this, + name: key + }); + if (!change) return false; + } + if (this._has(key)) { + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "delete", + object: this, + oldValue: this._data[key].value, + name: key + } : null; + if (notifySpy) spyReportStart(change); + runInTransaction(function () { + _this._keys.remove(key); + _this._updateHasMapEntry(key, false); + var observable = _this._data[key]; + observable.setNewValue(undefined); + _this._data[key] = undefined; + }); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + return true; + } + return false; + }; + ObservableMap.prototype._updateHasMapEntry = function (key, value) { + var entry = this._hasMap[key]; + if (entry) { + entry.setNewValue(value); + } else { + entry = this._hasMap[key] = new ObservableValue(value, referenceEnhancer, this.name + "." + key + "?", false); + } + return entry; + }; + ObservableMap.prototype._updateValue = function (name, newValue) { + var observable = this._data[name]; + newValue = observable.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "update", + object: this, + oldValue: observable.value, + name: name, + newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + observable.setNewValue(newValue); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + } + }; + ObservableMap.prototype._addValue = function (name, newValue) { + var _this = this; + runInTransaction(function () { + var observable = _this._data[name] = new ObservableValue(newValue, _this.enhancer, _this.name + "." + name, false); + newValue = observable.value; + _this._updateHasMapEntry(name, true); + _this._keys.push(name); + }); + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "add", + object: this, + name: name, + newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + ObservableMap.prototype.get = function (key) { + key = "" + key; + if (this.has(key)) return this._data[key].get(); + return undefined; + }; + ObservableMap.prototype.keys = function () { + return arrayAsIterator(this._keys.slice()); + }; + ObservableMap.prototype.values = function () { + return arrayAsIterator(this._keys.map(this.get, this)); + }; + ObservableMap.prototype.entries = function () { + var _this = this; + return arrayAsIterator(this._keys.map(function (key) { + return [key, _this.get(key)]; + })); + }; + ObservableMap.prototype.forEach = function (callback, thisArg) { + var _this = this; + this.keys().forEach(function (key) { + return callback.call(thisArg, _this.get(key), key, _this); + }); + }; + ObservableMap.prototype.merge = function (other) { + var _this = this; + if (isObservableMap(other)) { + other = other.toJS(); + } + runInTransaction(function () { + if (isPlainObject(other)) Object.keys(other).forEach(function (key) { + return _this.set(key, other[key]); + }); + else if (Array.isArray(other)) other.forEach(function (_a) { + var key = _a[0], + value = _a[1]; + return _this.set(key, value); + }); + else if (isES6Map(other)) other.forEach(function (value, key) { + return _this.set(key, value); + }); + else if (other !== null && other !== undefined) fail("Cannot initialize map from " + other); + }); + return this; + }; + ObservableMap.prototype.clear = function () { + var _this = this; + runInTransaction(function () { + untracked(function () { + _this.keys().forEach(_this.delete, _this); + }); + }); + }; + ObservableMap.prototype.replace = function (values) { + var _this = this; + runInTransaction(function () { + _this.clear(); + _this.merge(values); + }); + return this; + }; + Object.defineProperty(ObservableMap.prototype, "size", { + get: function get() { + return this._keys.length; + }, + enumerable: true, + configurable: true + }); + ObservableMap.prototype.toJS = function () { + var _this = this; + var res = {}; + this.keys().forEach(function (key) { + return res[key] = _this.get(key); + }); + return res; + }; + ObservableMap.prototype.toJSON = function () { + return this.toJS(); + }; + ObservableMap.prototype.isValidKey = function (key) { + if (key === null || key === undefined) return false; + if (typeof key === "string" || typeof key === "number" || typeof key === "boolean") return true; + return false; + }; + ObservableMap.prototype.assertValidKey = function (key) { + if (!this.isValidKey(key)) throw new Error("[mobx.map] Invalid key: '" + key + "', only strings, numbers and booleans are accepted as key in observable maps."); + }; + ObservableMap.prototype.toString = function () { + var _this = this; + return this.name + "[{ " + this.keys().map(function (key) { + return key + ": " + ("" + _this.get(key)); + }).join(", ") + " }]"; + }; + ObservableMap.prototype.observe = function (listener, fireImmediately) { + invariant(fireImmediately !== true, getMessage("m033")); + return registerListener(this, listener); + }; + ObservableMap.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + return ObservableMap; + }(); + exports.ObservableMap = ObservableMap; + declareIterator(ObservableMap.prototype, function () { + return this.entries(); + }); + + function map(initialValues) { + deprecated("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"); + return observable.map(initialValues); + } + exports.map = map; + var isObservableMap = createInstanceofPredicate("ObservableMap", ObservableMap); + exports.isObservableMap = isObservableMap; + var ObservableObjectAdministration = function () { + function ObservableObjectAdministration(target, name) { + this.target = target; + this.name = name; + this.values = {}; + this.changeListeners = null; + this.interceptors = null; + } + ObservableObjectAdministration.prototype.observe = function (callback, fireImmediately) { + invariant(fireImmediately !== true, "`observe` doesn't support the fire immediately property for observable objects."); + return registerListener(this, callback); + }; + ObservableObjectAdministration.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + return ObservableObjectAdministration; + }(); + + function asObservableObject(target, name) { + if (isObservableObject(target)) return target.$mobx; + invariant(Object.isExtensible(target), getMessage("m035")); + if (!isPlainObject(target)) name = (target.constructor.name || "ObservableObject") + "@" + getNextId(); + if (!name) name = "ObservableObject@" + getNextId(); + var adm = new ObservableObjectAdministration(target, name); + addHiddenFinalProp(target, "$mobx", adm); + return adm; + } + + function defineObservablePropertyFromDescriptor(adm, propName, descriptor, defaultEnhancer) { + if (adm.values[propName]) { + invariant("value" in descriptor, "The property " + propName + " in " + adm.name + " is already observable, cannot redefine it as computed property"); + adm.target[propName] = descriptor.value; + return; + } + if ("value" in descriptor) { + if (isModifierDescriptor(descriptor.value)) { + var modifierDescriptor = descriptor.value; + defineObservableProperty(adm, propName, modifierDescriptor.initialValue, modifierDescriptor.enhancer); + } else if (isAction(descriptor.value) && descriptor.value.autoBind === true) { + defineBoundAction(adm.target, propName, descriptor.value.originalFn); + } else if (isComputedValue(descriptor.value)) { + defineComputedPropertyFromComputedValue(adm, propName, descriptor.value); + } else { + defineObservableProperty(adm, propName, descriptor.value, defaultEnhancer); + } + } else { + defineComputedProperty(adm, propName, descriptor.get, descriptor.set, false, true); + } + } + + function defineObservableProperty(adm, propName, newValue, enhancer) { + assertPropertyConfigurable(adm.target, propName); + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + object: adm.target, + name: propName, + type: "add", + newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + var observable = adm.values[propName] = new ObservableValue(newValue, enhancer, adm.name + "." + propName, false); + newValue = observable.value; + Object.defineProperty(adm.target, propName, generateObservablePropConfig(propName)); + notifyPropertyAddition(adm, adm.target, propName, newValue); + } + + function defineComputedProperty(adm, propName, getter, setter, compareStructural, asInstanceProperty) { + if (asInstanceProperty) assertPropertyConfigurable(adm.target, propName); + adm.values[propName] = new ComputedValue(getter, adm.target, compareStructural, adm.name + "." + propName, setter); + if (asInstanceProperty) { + Object.defineProperty(adm.target, propName, generateComputedPropConfig(propName)); + } + } + + function defineComputedPropertyFromComputedValue(adm, propName, computedValue) { + var name = adm.name + "." + propName; + computedValue.name = name; + if (!computedValue.scope) computedValue.scope = adm.target; + adm.values[propName] = computedValue; + Object.defineProperty(adm.target, propName, generateComputedPropConfig(propName)); + } + var observablePropertyConfigs = {}; + var computedPropertyConfigs = {}; + + function generateObservablePropConfig(propName) { + return observablePropertyConfigs[propName] || (observablePropertyConfigs[propName] = { + configurable: true, + enumerable: true, + get: function get() { + return this.$mobx.values[propName].get(); + }, + set: function set(v) { + setPropertyValue(this, propName, v); + } + }); + } + + function generateComputedPropConfig(propName) { + return computedPropertyConfigs[propName] || (computedPropertyConfigs[propName] = { + configurable: true, + enumerable: false, + get: function get() { + return this.$mobx.values[propName].get(); + }, + set: function set(v) { + return this.$mobx.values[propName].set(v); + } + }); + } + + function setPropertyValue(instance, name, newValue) { + var adm = instance.$mobx; + var observable = adm.values[name]; + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + type: "update", + object: instance, + name: name, + newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + newValue = observable.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notify = hasListeners(adm); + var notifySpy = isSpyEnabled(); + var change = notify || notifySpy ? { + type: "update", + object: instance, + oldValue: observable.value, + name: name, + newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + observable.setNewValue(newValue); + if (notify) notifyListeners(adm, change); + if (notifySpy) spyReportEnd(); + } + } + + function notifyPropertyAddition(adm, object, name, newValue) { + var notify = hasListeners(adm); + var notifySpy = isSpyEnabled(); + var change = notify || notifySpy ? { + type: "add", + object: object, + name: name, + newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + if (notify) notifyListeners(adm, change); + if (notifySpy) spyReportEnd(); + } + var isObservableObjectAdministration = createInstanceofPredicate("ObservableObjectAdministration", ObservableObjectAdministration); + + function isObservableObject(thing) { + if (isObject(thing)) { + runLazyInitializers(thing); + return isObservableObjectAdministration(thing.$mobx); + } + return false; + } + exports.isObservableObject = isObservableObject; + var UNCHANGED = {}; + var ObservableValue = function (_super) { + __extends(ObservableValue, _super); + + function ObservableValue(value, enhancer, name, notifySpy) { + if (name === void 0) { + name = "ObservableValue@" + getNextId(); + } + if (notifySpy === void 0) { + notifySpy = true; + } + var _this = _super.call(this, name) || this; + _this.enhancer = enhancer; + _this.hasUnreportedChange = false; + _this.value = enhancer(value, undefined, name); + if (notifySpy && isSpyEnabled()) { + spyReport({ + type: "create", + object: _this, + newValue: _this.value + }); + } + return _this; + } + ObservableValue.prototype.set = function (newValue) { + var oldValue = this.value; + newValue = this.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notifySpy = isSpyEnabled(); + if (notifySpy) { + spyReportStart({ + type: "update", + object: this, + newValue: newValue, + oldValue: oldValue + }); + } + this.setNewValue(newValue); + if (notifySpy) spyReportEnd(); + } + }; + ObservableValue.prototype.prepareNewValue = function (newValue) { + checkIfStateModificationsAreAllowed(this); + if (hasInterceptors(this)) { + var change = interceptChange(this, { + object: this, + type: "update", + newValue: newValue + }); + if (!change) return UNCHANGED; + newValue = change.newValue; + } + newValue = this.enhancer(newValue, this.value, this.name); + return this.value !== newValue ? newValue : UNCHANGED; + }; + ObservableValue.prototype.setNewValue = function (newValue) { + var oldValue = this.value; + this.value = newValue; + this.reportChanged(); + if (hasListeners(this)) { + notifyListeners(this, { + type: "update", + object: this, + newValue: newValue, + oldValue: oldValue + }); + } + }; + ObservableValue.prototype.get = function () { + this.reportObserved(); + return this.value; + }; + ObservableValue.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + ObservableValue.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately) listener({ + object: this, + type: "update", + newValue: this.value, + oldValue: undefined + }); + return registerListener(this, listener); + }; + ObservableValue.prototype.toJSON = function () { + return this.get(); + }; + ObservableValue.prototype.toString = function () { + return this.name + "[" + this.value + "]"; + }; + ObservableValue.prototype.valueOf = function () { + return toPrimitive(this.get()); + }; + return ObservableValue; + }(BaseAtom); + ObservableValue.prototype[primitiveSymbol()] = ObservableValue.prototype.valueOf; + var isObservableValue = createInstanceofPredicate("ObservableValue", ObservableValue); + exports.isBoxedObservable = isObservableValue; + + function getAtom(thing, property) { + if ((typeof thing === "undefined" ? "undefined" : _typeof(thing)) === "object" && thing !== null) { + if (isObservableArray(thing)) { + invariant(property === undefined, getMessage("m036")); + return thing.$mobx.atom; + } + if (isObservableMap(thing)) { + var anyThing = thing; + if (property === undefined) return getAtom(anyThing._keys); + var observable_2 = anyThing._data[property] || anyThing._hasMap[property]; + invariant(!!observable_2, "the entry '" + property + "' does not exist in the observable map '" + getDebugName(thing) + "'"); + return observable_2; + } + runLazyInitializers(thing); + if (isObservableObject(thing)) { + if (!property) return fail("please specify a property"); + var observable_3 = thing.$mobx.values[property]; + invariant(!!observable_3, "no observable property '" + property + "' found on the observable object '" + getDebugName(thing) + "'"); + return observable_3; + } + if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) { + return thing; + } + } else if (typeof thing === "function") { + if (isReaction(thing.$mobx)) { + return thing.$mobx; + } + } + return fail("Cannot obtain atom from " + thing); + } + + function getAdministration(thing, property) { + invariant(thing, "Expecting some object"); + if (property !== undefined) return getAdministration(getAtom(thing, property)); + if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) return thing; + if (isObservableMap(thing)) return thing; + runLazyInitializers(thing); + if (thing.$mobx) return thing.$mobx; + invariant(false, "Cannot obtain administration from " + thing); + } + + function getDebugName(thing, property) { + var named; + if (property !== undefined) named = getAtom(thing, property); + else if (isObservableObject(thing) || isObservableMap(thing)) named = getAdministration(thing); + else named = getAtom(thing); + return named.name; + } + + function createClassPropertyDecorator(onInitialize, _get, _set, enumerable, allowCustomArguments) { + function classPropertyDecorator(target, key, descriptor, customArgs, argLen) { + if (argLen === void 0) { + argLen = 0; + } + invariant(allowCustomArguments || quacksLikeADecorator(arguments), "This function is a decorator, but it wasn't invoked like a decorator"); + if (!descriptor) { + var newDescriptor = { + enumerable: enumerable, + configurable: true, + get: function get() { + if (!this.__mobxInitializedProps || this.__mobxInitializedProps[key] !== true) typescriptInitializeProperty(this, key, undefined, onInitialize, customArgs, descriptor); + return _get.call(this, key); + }, + set: function set(v) { + if (!this.__mobxInitializedProps || this.__mobxInitializedProps[key] !== true) { + typescriptInitializeProperty(this, key, v, onInitialize, customArgs, descriptor); + } else { + _set.call(this, key, v); + } + } + }; + if (arguments.length < 3 || arguments.length === 5 && argLen < 3) { + Object.defineProperty(target, key, newDescriptor); + } + return newDescriptor; + } else { + if (!hasOwnProperty(target, "__mobxLazyInitializers")) { + addHiddenProp(target, "__mobxLazyInitializers", target.__mobxLazyInitializers && target.__mobxLazyInitializers.slice() || []); + } + var value_1 = descriptor.value, + initializer_1 = descriptor.initializer; + target.__mobxLazyInitializers.push(function (instance) { + onInitialize(instance, key, initializer_1 ? initializer_1.call(instance) : value_1, customArgs, descriptor); + }); + return { + enumerable: enumerable, + configurable: true, + get: function get() { + if (this.__mobxDidRunLazyInitializers !== true) runLazyInitializers(this); + return _get.call(this, key); + }, + set: function set(v) { + if (this.__mobxDidRunLazyInitializers !== true) runLazyInitializers(this); + _set.call(this, key, v); + } + }; + } + } + if (allowCustomArguments) { + return function () { + if (quacksLikeADecorator(arguments)) return classPropertyDecorator.apply(null, arguments); + var outerArgs = arguments; + var argLen = arguments.length; + return function (target, key, descriptor) { + return classPropertyDecorator(target, key, descriptor, outerArgs, argLen); + }; + }; + } + return classPropertyDecorator; + } + + function typescriptInitializeProperty(instance, key, v, onInitialize, customArgs, baseDescriptor) { + if (!hasOwnProperty(instance, "__mobxInitializedProps")) addHiddenProp(instance, "__mobxInitializedProps", {}); + instance.__mobxInitializedProps[key] = true; + onInitialize(instance, key, v, customArgs, baseDescriptor); + } + + function runLazyInitializers(instance) { + if (instance.__mobxDidRunLazyInitializers === true) return; + if (instance.__mobxLazyInitializers) { + addHiddenProp(instance, "__mobxDidRunLazyInitializers", true); + instance.__mobxDidRunLazyInitializers && instance.__mobxLazyInitializers.forEach(function (initializer) { + return initializer(instance); + }); + } + } + + function quacksLikeADecorator(args) { + return (args.length === 2 || args.length === 3) && typeof args[1] === "string"; + } + + function iteratorSymbol() { + return typeof Symbol === "function" && Symbol.iterator || "@@iterator"; + } + var IS_ITERATING_MARKER = "__$$iterating"; + + function arrayAsIterator(array) { + invariant(array[IS_ITERATING_MARKER] !== true, "Illegal state: cannot recycle array as iterator"); + addHiddenFinalProp(array, IS_ITERATING_MARKER, true); + var idx = -1; + addHiddenFinalProp(array, "next", function next() { + idx++; + return { + done: idx >= this.length, + value: idx < this.length ? this[idx] : undefined + }; + }); + return array; + } + + function declareIterator(prototType, iteratorFactory) { + addHiddenFinalProp(prototType, iteratorSymbol(), iteratorFactory); + } + var messages = { + "m001": "It is not allowed to assign new values to @action fields", + "m002": "`runInAction` expects a function", + "m003": "`runInAction` expects a function without arguments", + "m004": "autorun expects a function", + "m005": "Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.", + "m006": "Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.", + "m007": "reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object", + "m008": "wrapping reaction expression in `asReference` is no longer supported, use options object instead", + "m009": "@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.", + "m010": "@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'", + "m011": "First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments", + "m012": "computed takes one or two arguments if used as function", + "m013": "[mobx.expr] 'expr' should only be used inside other reactive functions.", + "m014": "extendObservable expected 2 or more arguments", + "m015": "extendObservable expects an object as first argument", + "m016": "extendObservable should not be used on maps, use map.merge instead", + "m017": "all arguments of extendObservable should be objects", + "m018": "extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540", + "m019": "[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.", + "m020": "modifiers can only be used for individual object properties", + "m021": "observable expects zero or one arguments", + "m022": "@observable can not be used on getters, use @computed instead", + "m023": "Using `transaction` is deprecated, use `runInAction` or `(@)action` instead.", + "m024": "whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested its value.", + "m025": "whyRun can only be used on reactions and computed values", + "m026": "`action` can only be invoked on functions", + "m028": "It is not allowed to set `useStrict` when a derivation is running", + "m029": "INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row", + "m030a": "Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ", + "m030b": "Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ", + "m031": "Computed values are not allowed to not cause side effects by changing observables that are already being observed. Tried to modify: ", + "m032": "* This computation is suspended (not in use by any reaction) and won't run automatically.\n Didn't expect this computation to be suspended at this point?\n 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).", + "m033": "`observe` doesn't support the fire immediately property for observable maps.", + "m034": "`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead", + "m035": "Cannot make the designated object observable; it is not extensible", + "m036": "It is not possible to get index atoms from arrays", + "m037": "Hi there! I'm sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle \"(...)\" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error(\"Oops\")` instead of `throw \"Oops\"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling \"Pause on caught exception\".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn't help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n", + "m038": "Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n" + }; + + function getMessage(id) { + return messages[id]; + } + var EMPTY_ARRAY = []; + Object.freeze(EMPTY_ARRAY); + + function getGlobal() { + return global; + } + + function getNextId() { + return ++globalState.mobxGuid; + } + + function fail(message, thing) { + invariant(false, message, thing); + throw "X"; + } + + function invariant(check, message, thing) { + if (!check) throw new Error("[mobx] Invariant failed: " + message + (thing ? " in '" + thing + "'" : "")); + } + var deprecatedMessages = []; + + function deprecated(msg) { + if (deprecatedMessages.indexOf(msg) !== -1) return false; + deprecatedMessages.push(msg); + console.error("[mobx] Deprecated: " + msg); + return true; + } + + function once(func) { + var invoked = false; + return function () { + if (invoked) return; + invoked = true; + return func.apply(this, arguments); + }; + } + var noop = function noop() {}; + + function unique(list) { + var res = []; + list.forEach(function (item) { + if (res.indexOf(item) === -1) res.push(item); + }); + return res; + } + + function joinStrings(things, limit, separator) { + if (limit === void 0) { + limit = 100; + } + if (separator === void 0) { + separator = " - "; + } + if (!things) return ""; + var sliced = things.slice(0, limit); + return "" + sliced.join(separator) + (things.length > limit ? " (... and " + (things.length - limit) + "more)" : ""); + } + + function isObject(value) { + return value !== null && (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object"; + } + + function isPlainObject(value) { + if (value === null || (typeof value === "undefined" ? "undefined" : _typeof(value)) !== "object") return false; + var proto = Object.getPrototypeOf(value); + return proto === Object.prototype || proto === null; + } + + function objectAssign() { + var res = arguments[0]; + for (var i = 1, l = arguments.length; i < l; i++) { + var source = arguments[i]; + for (var key in source) { + if (hasOwnProperty(source, key)) { + res[key] = source[key]; + } + } + } + return res; + } + + function valueDidChange(compareStructural, oldValue, newValue) { + if (typeof oldValue === 'number' && isNaN(oldValue)) { + return typeof newValue !== 'number' || !isNaN(newValue); + } + return compareStructural ? !deepEqual(oldValue, newValue) : oldValue !== newValue; + } + var prototypeHasOwnProperty = Object.prototype.hasOwnProperty; + + function hasOwnProperty(object, propName) { + return prototypeHasOwnProperty.call(object, propName); + } + + function makeNonEnumerable(object, propNames) { + for (var i = 0; i < propNames.length; i++) { + addHiddenProp(object, propNames[i], object[propNames[i]]); + } + } + + function addHiddenProp(object, propName, value) { + Object.defineProperty(object, propName, { + enumerable: false, + writable: true, + configurable: true, + value: value + }); + } + + function addHiddenFinalProp(object, propName, value) { + Object.defineProperty(object, propName, { + enumerable: false, + writable: false, + configurable: true, + value: value + }); + } + + function isPropertyConfigurable(object, prop) { + var descriptor = Object.getOwnPropertyDescriptor(object, prop); + return !descriptor || descriptor.configurable !== false && descriptor.writable !== false; + } + + function assertPropertyConfigurable(object, prop) { + invariant(isPropertyConfigurable(object, prop), "Cannot make property '" + prop + "' observable, it is not configurable and writable in the target object"); + } + + function getEnumerableKeys(obj) { + var res = []; + for (var key in obj) { + res.push(key); + } + return res; + } + + function deepEqual(a, b) { + if (a === null && b === null) return true; + if (a === undefined && b === undefined) return true; + if ((typeof a === "undefined" ? "undefined" : _typeof(a)) !== "object") return a === b; + var aIsArray = isArrayLike(a); + var aIsMap = isMapLike(a); + if (aIsArray !== isArrayLike(b)) { + return false; + } else if (aIsMap !== isMapLike(b)) { + return false; + } else if (aIsArray) { + if (a.length !== b.length) return false; + for (var i = a.length - 1; i >= 0; i--) { + if (!deepEqual(a[i], b[i])) return false; + } + return true; + } else if (aIsMap) { + if (a.size !== b.size) return false; + var equals_1 = true; + a.forEach(function (value, key) { + equals_1 = equals_1 && deepEqual(b.get(key), value); + }); + return equals_1; + } else if ((typeof a === "undefined" ? "undefined" : _typeof(a)) === "object" && (typeof b === "undefined" ? "undefined" : _typeof(b)) === "object") { + if (a === null || b === null) return false; + if (isMapLike(a) && isMapLike(b)) { + if (a.size !== b.size) return false; + return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries()); + } + if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length) return false; + for (var prop in a) { + if (!(prop in b)) return false; + if (!deepEqual(a[prop], b[prop])) return false; + } + return true; + } + return false; + } + + function createInstanceofPredicate(name, clazz) { + var propName = "isMobX" + name; + clazz.prototype[propName] = true; + return function (x) { + return isObject(x) && x[propName] === true; + }; + } + + function isArrayLike(x) { + return Array.isArray(x) || isObservableArray(x); + } + exports.isArrayLike = isArrayLike; + + function isMapLike(x) { + return isES6Map(x) || isObservableMap(x); + } + + function isES6Map(thing) { + if (getGlobal().Map !== undefined && thing instanceof getGlobal().Map) return true; + return false; + } + + function primitiveSymbol() { + return typeof Symbol === "function" && Symbol.toPrimitive || "@@toPrimitive"; + } + + function toPrimitive(value) { + return value === null ? null : (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object" ? "" + value : value; + } + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(4))) + + /***/ + }), + /* 2 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; + }(); + + var _icons = __webpack_require__(6); + + var _constants = __webpack_require__(0); + + function renderHeader(_ref, instance) { + var meta = _ref.meta, + user = _ref.user, + reactions = _ref.reactions; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-header-container'; + + var likeButton = document.createElement('span'); + var likedReaction = reactions.find(function (reaction) { + return reaction.content === 'heart' && reaction.user.login === user.login; + }); + likeButton.className = 'gitment-header-like-btn'; + likeButton.innerHTML = '\n ' + _icons.heart + '\n ' + (likedReaction ? 'Unlike' : 'Like') + '\n ' + (meta.reactions && meta.reactions.heart ? ' \u2022 ' + meta.reactions.heart + ' Liked' : '') + '\n '; + + if (likedReaction) { + likeButton.classList.add('liked'); + likeButton.onclick = function () { + return instance.unlike(); + }; + } else { + likeButton.classList.remove('liked'); + likeButton.onclick = function () { + return instance.like(); + }; + } + container.appendChild(likeButton); + + var commentsCount = document.createElement('span'); + commentsCount.innerHTML = '\n ' + (meta.comments ? ' \u2022 ' + meta.comments + ' Comments' : '') + '\n '; + container.appendChild(commentsCount); + + var issueLink = document.createElement('a'); + issueLink.className = 'gitment-header-issue-link'; + issueLink.href = meta.html_url; + issueLink.target = '_blank'; + issueLink.innerText = 'Issue Page'; + container.appendChild(issueLink); + + return container; + } + + function renderComments(_ref2, instance) { + var meta = _ref2.meta, + comments = _ref2.comments, + commentReactions = _ref2.commentReactions, + currentPage = _ref2.currentPage, + user = _ref2.user, + error = _ref2.error; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-comments-container'; + + if (error) { + var errorBlock = document.createElement('div'); + errorBlock.className = 'gitment-comments-error'; + + if (error === _constants.NOT_INITIALIZED_ERROR && user.login && user.login.toLowerCase() === instance.owner.toLowerCase()) { + var initHint = document.createElement('div'); + var initButton = document.createElement('button'); + initButton.className = 'gitment-comments-init-btn'; + initButton.onclick = function () { + initButton.setAttribute('disabled', true); + instance.init().catch(function (e) { + initButton.removeAttribute('disabled'); + alert(e); + }); + }; + initButton.innerText = '初始化评论'; + initHint.appendChild(initButton); + errorBlock.appendChild(initHint); + } else { + errorBlock.innerText = error; + } + container.appendChild(errorBlock); + return container; + } else if (comments === undefined) { + var loading = document.createElement('div'); + loading.innerText = '评论加载中...'; + loading.className = 'gitment-comments-loading'; + container.appendChild(loading); + return container; + } else if (!comments.length) { + var emptyBlock = document.createElement('div'); + emptyBlock.className = 'gitment-comments-empty'; + emptyBlock.innerText = '暂无评论,来过就留点痕迹吧'; + container.appendChild(emptyBlock); + return container; + } + + var commentsList = document.createElement('ul'); + commentsList.className = 'gitment-comments-list'; + + comments.forEach(function (comment) { + var createDate = new Date(comment.created_at); + var updateDate = new Date(comment.updated_at); + var commentItem = document.createElement('li'); + commentItem.className = 'gitment-comment'; + commentItem.innerHTML = '\n \n \n \n
    \n
    \n \n ' + comment.user.login + '\n \n 评论于\n ' + createDate.toDateString() + '\n ' + (createDate.toString() !== updateDate.toString() ? ' \u2022 已编辑' : '') + '\n
    ' + _icons.heart + ' ' + (comment.reactions.heart || '') + '
    \n
    \n
    ' + comment.body_html + '
    \n
    \n '; + var likeButton = commentItem.querySelector('.gitment-comment-like-btn'); + var likedReaction = commentReactions[comment.id] && commentReactions[comment.id].find(function (reaction) { + return reaction.content === 'heart' && reaction.user.login === user.login; + }); + if (likedReaction) { + likeButton.classList.add('liked'); + likeButton.onclick = function () { + return instance.unlikeAComment(comment.id); + }; + } else { + likeButton.classList.remove('liked'); + likeButton.onclick = function () { + return instance.likeAComment(comment.id); + }; + } + + // dirty + // use a blank image to trigger height calculating when element rendered + var imgTrigger = document.createElement('img'); + var markdownBody = commentItem.querySelector('.gitment-comment-body'); + imgTrigger.className = 'gitment-hidden'; + imgTrigger.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + imgTrigger.onload = function () { + if (markdownBody.clientHeight > instance.maxCommentHeight) { + markdownBody.classList.add('gitment-comment-body-folded'); + markdownBody.style.maxHeight = instance.maxCommentHeight + 'px'; + markdownBody.title = 'Click to Expand'; + markdownBody.onclick = function () { + markdownBody.classList.remove('gitment-comment-body-folded'); + markdownBody.style.maxHeight = ''; + markdownBody.title = ''; + markdownBody.onclick = null; + }; + } + }; + commentItem.appendChild(imgTrigger); + + commentsList.appendChild(commentItem); + }); + + container.appendChild(commentsList); + + if (meta) { + var pageCount = Math.ceil(meta.comments / instance.perPage); + if (pageCount > 1) { + var pagination = document.createElement('ul'); + pagination.className = 'gitment-comments-pagination'; + + if (currentPage > 1) { + var previousButton = document.createElement('li'); + previousButton.className = 'gitment-comments-page-item'; + previousButton.innerText = 'Previous'; + previousButton.onclick = function () { + return instance.goto(currentPage - 1); + }; + pagination.appendChild(previousButton); + } + + var _loop = function _loop(i) { + var pageItem = document.createElement('li'); + pageItem.className = 'gitment-comments-page-item'; + pageItem.innerText = i; + pageItem.onclick = function () { + return instance.goto(i); + }; + if (currentPage === i) pageItem.classList.add('gitment-selected'); + pagination.appendChild(pageItem); + }; + + for (var i = 1; i <= pageCount; i++) { + _loop(i); + } + + if (currentPage < pageCount) { + var nextButton = document.createElement('li'); + nextButton.className = 'gitment-comments-page-item'; + nextButton.innerText = 'Next'; + nextButton.onclick = function () { + return instance.goto(currentPage + 1); + }; + pagination.appendChild(nextButton); + } + + container.appendChild(pagination); + } + } + + return container; + } + + function renderEditor(_ref3, instance) { + var user = _ref3.user, + error = _ref3.error; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-editor-container'; + + var shouldDisable = user.login && !error ? '' : 'disabled'; + var disabledTip = user.login ? '' : 'Login to Comment'; + container.innerHTML = '\n ' + (user.login ? '\n \n ' : user.isLoggingIn ? '
    ' + _icons.spinner + '
    ' : '\n ' + _icons.github + '\n ') + '\n \n
    \n
    \n \n \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n \n '; + if (user.login) { + container.querySelector('.gitment-editor-logout-link').onclick = function () { + return instance.logout(); + }; + } + + var writeField = container.querySelector('.gitment-editor-write-field'); + var previewField = container.querySelector('.gitment-editor-preview-field'); + + var textarea = writeField.querySelector('textarea'); + textarea.oninput = function () { + textarea.style.height = 'auto'; + var style = window.getComputedStyle(textarea, null); + var height = parseInt(style.height, 10); + var clientHeight = textarea.clientHeight; + var scrollHeight = textarea.scrollHeight; + if (clientHeight < scrollHeight) { + textarea.style.height = height + scrollHeight - clientHeight + 'px'; + } + }; + + var _container$querySelec = container.querySelectorAll('.gitment-editor-tab'), + _container$querySelec2 = _slicedToArray(_container$querySelec, 2), + writeTab = _container$querySelec2[0], + previewTab = _container$querySelec2[1]; + + writeTab.onclick = function () { + writeTab.classList.add('gitment-selected'); + previewTab.classList.remove('gitment-selected'); + writeField.classList.remove('gitment-hidden'); + previewField.classList.add('gitment-hidden'); + + textarea.focus(); + }; + previewTab.onclick = function () { + previewTab.classList.add('gitment-selected'); + writeTab.classList.remove('gitment-selected'); + previewField.classList.remove('gitment-hidden'); + writeField.classList.add('gitment-hidden'); + + var preview = previewField.querySelector('.gitment-editor-preview'); + var content = textarea.value.trim(); + if (!content) { + preview.innerText = '无可预览内容'; + return; + } + + preview.innerText = '加载预览中...'; + instance.markdown(content).then(function (html) { + return preview.innerHTML = html; + }); + }; + + var submitButton = container.querySelector('.gitment-editor-submit'); + submitButton.onclick = function () { + submitButton.innerText = 'Submitting...'; + submitButton.setAttribute('disabled', true); + instance.post(textarea.value.trim()).then(function (data) { + textarea.value = ''; + textarea.style.height = 'auto'; + submitButton.removeAttribute('disabled'); + submitButton.innerText = '发表评论'; + }).catch(function (e) { + alert(e); + submitButton.removeAttribute('disabled'); + submitButton.innerText = '发表评论'; + }); + }; + + return container; + } + + function renderFooter() { + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-footer-container'; + container.innerHTML = '\n Powered by\n \n Gitment\n \n '; + return container; + } + + function render(state, instance) { + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-root-container'; + container.appendChild(instance.renderHeader(state, instance)); + container.appendChild(instance.renderComments(state, instance)); + container.appendChild(instance.renderEditor(state, instance)); + container.appendChild(instance.renderFooter(state, instance)); + return container; + } + + exports.default = { + render: render, + renderHeader: renderHeader, + renderComments: renderComments, + renderEditor: renderEditor, + renderFooter: renderFooter + }; + + /***/ + }), + /* 3 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.http = exports.Query = exports.isString = undefined; + + var _slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; + }(); + + exports.getTargetContainer = getTargetContainer; + + var _constants = __webpack_require__(0); + + var isString = exports.isString = function isString(s) { + return toString.call(s) === '[object String]'; + }; + + function getTargetContainer(container) { + var targetContainer = void 0; + if (container instanceof Element) { + targetContainer = container; + } else if (isString(container)) { + targetContainer = document.getElementById(container); + } else { + targetContainer = document.createElement('div'); + } + + return targetContainer; + } + + var Query = exports.Query = { + parse: function parse() { + var search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.search; + + if (!search) return {}; + var queryString = search[0] === '?' ? search.substring(1) : search; + var query = {}; + queryString.split('&').forEach(function (queryStr) { + var _queryStr$split = queryStr.split('='), + _queryStr$split2 = _slicedToArray(_queryStr$split, 2), + key = _queryStr$split2[0], + value = _queryStr$split2[1]; + + if (key) query[key] = value; + }); + + return query; + }, + stringify: function stringify(query) { + var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '?'; + + var queryString = Object.keys(query).map(function (key) { + return key + '=' + encodeURIComponent(query[key] || ''); + }).join('&'); + return queryString ? prefix + queryString : ''; + } + }; + + function ajaxFactory(method) { + return function (apiPath) { + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var base = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'https://api.github.com'; + + var req = new XMLHttpRequest(); + var token = localStorage.getItem(_constants.LS_ACCESS_TOKEN_KEY); + + var url = '' + base + apiPath; + var body = null; + if (method === 'GET' || method === 'DELETE') { + url += Query.stringify(data); + } + + var p = new Promise(function (resolve, reject) { + req.addEventListener('load', function () { + var contentType = req.getResponseHeader('content-type'); + var res = req.responseText; + if (!/json/.test(contentType)) { + resolve(res); + return; + } + var data = req.responseText ? JSON.parse(res) : {}; + if (data.message) { + reject(new Error(data.message)); + } else { + resolve(data); + } + }); + req.addEventListener('error', function (error) { + return reject(error); + }); + }); + req.open(method, url, true); + + req.setRequestHeader('Accept', 'application/vnd.github.squirrel-girl-preview, application/vnd.github.html+json'); + if (token) { + req.setRequestHeader('Authorization', 'token ' + token); + } + if (method !== 'GET' && method !== 'DELETE') { + body = JSON.stringify(data); + req.setRequestHeader('Content-Type', 'application/json'); + req.setRequestHeader('Accept', 'application/json'); + } + + req.send(body); + return p; + }; + } + + var http = exports.http = { + get: ajaxFactory('GET'), + post: ajaxFactory('POST'), + delete: ajaxFactory('DELETE'), + put: ajaxFactory('PUT') + }; + + /***/ + }), + /* 4 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + var g; + + // This works in non-strict mode + g = function () { + return this; + }(); + + try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1, eval)("this"); + } catch (e) { + // This works if the window reference is available + if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; + } + + // g can still be undefined, but nothing to do about it... + // We return undefined, instead of nothing here, so it's + // easier to handle this case. if(!global) { ...} + + module.exports = g; + + /***/ + }), + /* 5 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + var _mobx = __webpack_require__(1); + + var _constants = __webpack_require__(0); + + var _utils = __webpack_require__(3); + + var _default = __webpack_require__(2); + + var _default2 = _interopRequireDefault(_default); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var scope = 'public_repo'; + + function extendRenderer(instance, renderer) { + instance[renderer] = function (container) { + var targetContainer = (0, _utils.getTargetContainer)(container); + var render = instance.theme[renderer] || instance.defaultTheme[renderer]; + + (0, _mobx.autorun)(function () { + var e = render(instance.state, instance); + if (targetContainer.firstChild) { + targetContainer.replaceChild(e, targetContainer.firstChild); + } else { + targetContainer.appendChild(e); + } + }); + + return targetContainer; + }; + } + + var Gitment = function () { + _createClass(Gitment, [{ + key: 'accessToken', + get: function get() { + return localStorage.getItem(_constants.LS_ACCESS_TOKEN_KEY); + }, + set: function set(token) { + localStorage.setItem(_constants.LS_ACCESS_TOKEN_KEY, token); + } + }, { + key: 'loginLink', + get: function get() { + var oauthUri = 'https://github.com/login/oauth/authorize'; + var redirect_uri = this.oauth.redirect_uri || window.location.href; + + var oauthParams = Object.assign({ + scope: scope, + redirect_uri: redirect_uri + }, this.oauth); + + return '' + oauthUri + _utils.Query.stringify(oauthParams); + } + }]); + + function Gitment() { + var _this = this; + + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, Gitment); + + this.defaultTheme = _default2.default; + this.useTheme(_default2.default); + + Object.assign(this, { + id: window.location.href, + title: window.document.title, + link: window.location.href, + desc: '', + labels: [], + theme: _default2.default, + oauth: {}, + perPage: 20, + maxCommentHeight: 250 + }, options); + + this.useTheme(this.theme); + + var user = {}; + try { + var userInfo = localStorage.getItem(_constants.LS_USER_KEY); + if (this.accessToken && userInfo) { + Object.assign(user, JSON.parse(userInfo), { + fromCache: true + }); + } + } catch (e) { + localStorage.removeItem(_constants.LS_USER_KEY); + } + + this.state = (0, _mobx.observable)({ + user: user, + error: null, + meta: {}, + comments: undefined, + reactions: [], + commentReactions: {}, + currentPage: 1 + }); + + var query = _utils.Query.parse(); + if (query.code) { + var _oauth = this.oauth, + client_id = _oauth.client_id, + client_secret = _oauth.client_secret; + + var code = query.code; + delete query.code; + var search = _utils.Query.stringify(query); + var replacedUrl = '' + window.location.origin + window.location.pathname + search + window.location.hash; + history.replaceState({}, '', replacedUrl); + + Object.assign(this, { + id: replacedUrl, + link: replacedUrl + }, options); + + this.state.user.isLoggingIn = true; + _utils.http.post('https://cors-anywhere.herokuapp.com/https://github.com/login/oauth/access_token', { + code: code, + client_id: client_id, + client_secret: client_secret + }, '').then(function (data) { + _this.accessToken = data.access_token; + _this.update(); + }).catch(function (e) { + _this.state.user.isLoggingIn = false; + alert(e); + }); + } else { + this.update(); + } + } + + _createClass(Gitment, [{ + key: 'init', + value: function init() { + var _this2 = this; + + return this.createIssue().then(function () { + return _this2.loadComments(); + }).then(function (comments) { + _this2.state.error = null; + return comments; + }); + } + }, { + key: 'useTheme', + value: function useTheme() { + var _this3 = this; + + var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + this.theme = theme; + + var renderers = Object.keys(this.theme); + renderers.forEach(function (renderer) { + return extendRenderer(_this3, renderer); + }); + } + }, { + key: 'update', + value: function update() { + var _this4 = this; + + return Promise.all([this.loadMeta(), this.loadUserInfo()]).then(function () { + return Promise.all([_this4.loadComments().then(function () { + return _this4.loadCommentReactions(); + }), _this4.loadReactions()]); + }).catch(function (e) { + return _this4.state.error = e; + }); + } + }, { + key: 'markdown', + value: function markdown(text) { + return _utils.http.post('/markdown', { + text: text, + mode: 'gfm' + }); + } + }, { + key: 'createIssue', + value: function createIssue() { + var _this5 = this; + + var id = this.id, + owner = this.owner, + repo = this.repo, + title = this.title, + link = this.link, + desc = this.desc, + labels = this.labels; + + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues', { + title: title, + labels: labels.concat(['gitment', id]), + body: link + '\n\n' + desc + }).then(function (meta) { + _this5.state.meta = meta; + return meta; + }); + } + }, { + key: 'getIssue', + value: function getIssue() { + if (this.state.meta.id) return Promise.resolve(this.state.meta); + + return this.loadMeta(); + } + }, { + key: 'post', + value: function post(body) { + var _this6 = this; + + return this.getIssue().then(function (issue) { + return _utils.http.post(issue.comments_url, { + body: body + }, ''); + }).then(function (data) { + _this6.state.meta.comments++; + var pageCount = Math.ceil(_this6.state.meta.comments / _this6.perPage); + if (_this6.state.currentPage === pageCount) { + _this6.state.comments.push(data); + } + return data; + }); + } + }, { + key: 'loadMeta', + value: function loadMeta() { + var _this7 = this; + + var id = this.id, + owner = this.owner, + repo = this.repo; + + return _utils.http.get('/repos/' + owner + '/' + repo + '/issues', { + creator: owner, + labels: id + }).then(function (issues) { + if (!issues.length) return Promise.reject(_constants.NOT_INITIALIZED_ERROR); + _this7.state.meta = issues[0]; + return issues[0]; + }); + } + }, { + key: 'loadComments', + value: function loadComments() { + var _this8 = this; + + var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.currentPage; + + return this.getIssue().then(function (issue) { + return _utils.http.get(issue.comments_url, { + page: page, + per_page: _this8.perPage + }, ''); + }).then(function (comments) { + _this8.state.comments = comments; + return comments; + }); + } + }, { + key: 'loadUserInfo', + value: function loadUserInfo() { + var _this9 = this; + + if (!this.accessToken) { + this.logout(); + return Promise.resolve({}); + } + + return _utils.http.get('/user').then(function (user) { + _this9.state.user = user; + localStorage.setItem(_constants.LS_USER_KEY, JSON.stringify(user)); + return user; + }); + } + }, { + key: 'loadReactions', + value: function loadReactions() { + var _this10 = this; + + if (!this.accessToken) { + this.state.reactions = []; + return Promise.resolve([]); + } + + return this.getIssue().then(function (issue) { + if (!issue.reactions.total_count) return []; + return _utils.http.get(issue.reactions.url, {}, ''); + }).then(function (reactions) { + _this10.state.reactions = reactions; + return reactions; + }); + } + }, { + key: 'loadCommentReactions', + value: function loadCommentReactions() { + var _this11 = this; + + if (!this.accessToken) { + this.state.commentReactions = {}; + return Promise.resolve([]); + } + + var comments = this.state.comments; + var comentReactions = {}; + + return Promise.all(comments.map(function (comment) { + if (!comment.reactions.total_count) return []; + + var owner = _this11.owner, + repo = _this11.repo; + + return _utils.http.get('/repos/' + owner + '/' + repo + '/issues/comments/' + comment.id + '/reactions', {}); + })).then(function (reactionsArray) { + comments.forEach(function (comment, index) { + comentReactions[comment.id] = reactionsArray[index]; + }); + _this11.state.commentReactions = comentReactions; + + return comentReactions; + }); + } + }, { + key: 'login', + value: function login() { + window.location.href = this.loginLink; + } + }, { + key: 'logout', + value: function logout() { + localStorage.removeItem(_constants.LS_ACCESS_TOKEN_KEY); + localStorage.removeItem(_constants.LS_USER_KEY); + this.state.user = {}; + } + }, { + key: 'goto', + value: function goto(page) { + this.state.currentPage = page; + this.state.comments = undefined; + return this.loadComments(page); + } + }, { + key: 'like', + value: function like() { + var _this12 = this; + + if (!this.accessToken) { + alert('Login to Like'); + return Promise.reject(); + } + + var owner = this.owner, + repo = this.repo; + + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues/' + this.state.meta.number + '/reactions', { + content: 'heart' + }).then(function (reaction) { + _this12.state.reactions.push(reaction); + _this12.state.meta.reactions.heart++; + }); + } + }, { + key: 'unlike', + value: function unlike() { + var _this13 = this; + + if (!this.accessToken) return Promise.reject(); + + var _state = this.state, + user = _state.user, + reactions = _state.reactions; + + var index = reactions.findIndex(function (reaction) { + return reaction.user.login === user.login; + }); + return _utils.http.delete('/reactions/' + reactions[index].id).then(function () { + reactions.splice(index, 1); + _this13.state.meta.reactions.heart--; + }); + } + }, { + key: 'likeAComment', + value: function likeAComment(commentId) { + var _this14 = this; + + if (!this.accessToken) { + alert('Login to Like'); + return Promise.reject(); + } + + var owner = this.owner, + repo = this.repo; + + var comment = this.state.comments.find(function (comment) { + return comment.id === commentId; + }); + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues/comments/' + commentId + '/reactions', { + content: 'heart' + }).then(function (reaction) { + _this14.state.commentReactions[commentId].push(reaction); + comment.reactions.heart++; + }); + } + }, { + key: 'unlikeAComment', + value: function unlikeAComment(commentId) { + if (!this.accessToken) return Promise.reject(); + + var reactions = this.state.commentReactions[commentId]; + var comment = this.state.comments.find(function (comment) { + return comment.id === commentId; + }); + var user = this.state.user; + + var index = reactions.findIndex(function (reaction) { + return reaction.user.login === user.login; + }); + + return _utils.http.delete('/reactions/' + reactions[index].id).then(function () { + reactions.splice(index, 1); + comment.reactions.heart--; + }); + } + }]); + + return Gitment; + }(); + + module.exports = Gitment; + + /***/ + }), + /* 6 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + Object.defineProperty(exports, "__esModule", { + value: true + }); + /** + * Modified from https://github.com/evil-icons/evil-icons + */ + + var close = exports.close = ''; + var github = exports.github = ''; + var heart = exports.heart = ''; + var spinner = exports.spinner = ''; + + /***/ + }) + /******/ +]); diff --git a/lib/gitment.js.bak b/lib/gitment.js.bak new file mode 100644 index 0000000..83780b8 --- /dev/null +++ b/lib/gitment.js.bak @@ -0,0 +1 @@ +var _typeof3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof="function"==typeof Symbol&&"symbol"==_typeof3(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof3(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof3(e)},_typeof2="function"==typeof Symbol&&"symbol"==_typeof(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof(e)},Gitment=function(n){var r={};function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return i.m=n,i.c=r,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=5)}([function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.LS_ACCESS_TOKEN_KEY="gitment-comments-token",t.LS_USER_KEY="gitment-user-info",t.NOT_INITIALIZED_ERROR=new Error("该文章评论未初始化")},function(hn,dn,e){(function(e){var r,h="function"==typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return void 0===e?"undefined":_typeof2(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":_typeof2(e)},n=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(dn,"__esModule",{value:!0}),dn.extras={allowStateChanges:function(e,t){var n,r=M(e);try{n=t()}finally{D(r)}return n},deepEqual:rn,getAtom:St,getDebugName:kt,getDependencyTree:function(e,t){return b(St(e,t))},getAdministration:Ot,getGlobalState:function(){return se},getObserverTree:function(e,t){return y(St(e,t))},isComputingDerivation:X,isSpyEnabled:xe,onReactionError:function(t){return se.globalReactionErrorHandlers.push(t),function(){var e=se.globalReactionErrorHandlers.indexOf(t);0<=e&&se.globalReactionErrorHandlers.splice(e,1)}},resetGlobalState:function(){se.resetId++;var e=new ae;for(var t in e)-1===oe.indexOf(t)&&(se[t]=e[t]);se.allowStateChanges=!se.strictMode},shareGlobalState:function(){var e=Dt(),t=se;if(e.__mobservableTrackingStack||e.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(e.__mobxGlobal&&e.__mobxGlobal.version!==t.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");e.__mobxGlobal?se=e.__mobxGlobal:e.__mobxGlobal=t},spyReport:Se,spyReportEnd:Ae,spyReportStart:Oe,setReactionScheduler:function(t){var n=be;be=function(e){return t(function(){return n(e)})}}},"object"===("undefined"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__?"undefined":h(__MOBX_DEVTOOLS_GLOBAL_HOOK__))&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx(hn.exports),hn.exports.default=hn.exports;var i=At(function(e,t,n,r,i){var o=r&&1===r.length?r[0]:n.name||t||"";Qt(e,t,c(o,n))},function(e){return this[e]},function(){$t(!1,Pt("m001"))},!1,!0),o=At(function(e,t,n){l(e,t,n)},function(e){return this[e]},function(){$t(!1,Pt("m001"))},!1,!1),c=function(e,t,n,r){return 1===arguments.length&&"function"==typeof e?R(e.name||"",e):2===arguments.length&&"function"==typeof t?R(e,t):1===arguments.length&&"string"==typeof e?a(e):a(t).apply(null,arguments)};function a(r){return function(e,t,n){return n&&"function"==typeof n.value?(n.value=R(r,n.value),n.enumerable=!1,n.configurable=!0,n):i(r).apply(this,arguments)}}function d(e){return"function"==typeof e&&!0===e.isMobxAction}function l(e,t,n){function r(){return P(t,n,e,arguments)}r.isMobxAction=!0,Qt(e,t,r)}function u(e,t,n){var r,i,o;o="string"==typeof e?(r=e,i=t,n):(r=e.name||"Autorun@"+Vt(),i=e,t),$t("function"==typeof i,Pt("m004")),$t(!1===d(i),Pt("m005")),o&&(i=i.bind(o));var a=new fe(r,function(){this.track(s)});function s(){i(a)}return a.schedule(),a.getDisposer()}function t(o){return At(function(e,t,n,r,i){$t(void 0!==i,Pt("m009")),$t("function"==typeof i.get,Pt("m010")),ht(ut(e,""),t,i.get,i.set,o,!1)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){this.$mobx.values[e].set(t)},!1,!1)}function s(e,t,n){if("string"==typeof t)return p.apply(null,arguments);$t("function"==typeof e,Pt("m011")),$t(arguments.length<3,Pt("m012"));var r="object"===(void 0===t?"undefined":h(t))?t:{};return r.setter="function"==typeof t?t:r.setter,new H(e,r.context,r.compareStructural||r.struct||!1,r.name||e.name||"",r.setter)}(dn.action=c).bound=function(e,t,n){if("function"!=typeof e)return o.apply(null,arguments);var r=R("",e);return r.autoBind=!0,r},dn.runInAction=function(e,t,n){var r="string"==typeof e?e:e.name||"",i="function"==typeof e?e:t,o="function"==typeof e?t:n;return $t("function"==typeof i,Pt("m002")),$t(0===i.length,Pt("m003")),$t("string"==typeof r&&0n.dependenciesState&&(t.lowestObserverState=n.dependenciesState))}}(e),r}function ee(e){for(var t=e.observing,n=t.length;n--;)ce(t[n],e);e.dependenciesState=G.NOT_TRACKING,t.length=0}function te(e){var t=ne(),n=e();return re(t),n}function ne(){var e=se.trackingDerivation;return se.trackingDerivation=null,e}function re(e){se.trackingDerivation=e}function ie(e){if(e.dependenciesState!==G.UP_TO_DATE){e.dependenciesState=G.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=G.UP_TO_DATE}}dn.untracked=te;var oe=["mobxGuid","resetId","spyListeners","strictMode","runId"],ae=function(){this.version=5,this.trackingDerivation=null,this.computationDepth=0,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!0,this.strictMode=!1,this.resetId=0,this.spyListeners=[],this.globalReactionErrorHandlers=[]},se=new ae;function ue(e){return e.observers}function ce(e,t){if(1===e.observers.length)e.observers.length=0,le(e);else{var n=e.observers,r=e.observersIndexes,i=n.pop();if(i!==t){var o=r[t.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[t.__mapid]}}function le(e){e.isPendingUnobservation||(e.isPendingUnobservation=!0,se.pendingUnobservations.push(e))}function he(){se.inBatch++}function de(){if(0==--se.inBatch){ye();for(var e=se.pendingUnobservations,t=0;t=this.length,value:tt?" (... and "+(e.length-t)+"more)":""):""}function Wt(e){return null!==e&&"object"===(void 0===e?"undefined":h(e))}function Yt(e){if(null===e||"object"!==(void 0===e?"undefined":h(e)))return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function qt(e){for(var t=e,n=1,r=arguments.length;n"+n.reactions.heart+" 人喜欢":"")+"\n ",s?(a.classList.add("liked"),a.onclick=function(){return t.unlike()}):(a.classList.remove("liked"),a.onclick=function(){return t.like()}),o.appendChild(a);var u=document.createElement("span");u.innerHTML="\n "+(n.comments?" • "+n.comments+" 条评论":"")+"\n ",o.appendChild(u);var c=document.createElement("a");return c.className="gitment-header-issue-link",console.log("meta.html_url:"+n.html_url),c.href=n.html_url,c.target="_blank",c.innerText="Issue Page",o.appendChild(c),o},renderComments:function(e,s){var t=e.meta,n=e.comments,u=e.commentReactions,r=e.currentPage,c=e.user,i=e.error,o=document.createElement("div");if(o.lang="en-US",o.className="gitment-container gitment-comments-container",i){var a=document.createElement("div");if(a.className="gitment-comments-error",i===x.NOT_INITIALIZED_ERROR&&c.login&&c.login.toLowerCase()===s.owner.toLowerCase()){var l=document.createElement("div"),h=document.createElement("button");h.className="gitment-comments-init-btn",h.onclick=function(){h.setAttribute("disabled",!0),s.init().catch(function(e){h.removeAttribute("disabled"),alert(e)})},h.innerText="初始化评论",l.appendChild(h),a.appendChild(l)}else a.innerText=i;return o.appendChild(a),o}if(void 0===n){var d=document.createElement("div");return d.innerText="评论加载中...",d.className="gitment-comments-loading",o.appendChild(d),o}if(!n.length){var p=document.createElement("div");return p.className="gitment-comments-empty",p.innerText="暂无评论,来过就留点痕迹吧",o.appendChild(p),o}var f=document.createElement("ul");if(f.className="gitment-comments-list",n.forEach(function(e){var t=new Date(e.created_at),n=new Date(e.updated_at),r=document.createElement("li");r.className="gitment-comment",r.innerHTML='\n \n \n \n
    \n
    \n \n '+e.user.login+'\n \n 评论于\n '+t.toDateString()+"\n "+(t.toString()!==n.toString()?' • 已编辑':"")+'\n
    '+_.heart+" "+(e.reactions.heart||"")+'
    \n
    \n
    '+e.body_html+"
    \n
    \n ";var i=r.querySelector(".gitment-comment-like-btn");u[e.id]&&u[e.id].find(function(e){return"heart"===e.content&&e.user.login===c.login})?(i.classList.add("liked"),i.onclick=function(){return s.unlikeAComment(e.id)}):(i.classList.remove("liked"),i.onclick=function(){return s.likeAComment(e.id)});var o=document.createElement("img"),a=r.querySelector(".gitment-comment-body");o.className="gitment-hidden",o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",o.onload=function(){a.clientHeight>s.maxCommentHeight&&(a.classList.add("gitment-comment-body-folded"),a.style.maxHeight=s.maxCommentHeight+"px",a.title="点击展开",a.onclick=function(){a.classList.remove("gitment-comment-body-folded"),a.style.maxHeight="",a.title="",a.onclick=null})},r.appendChild(o),f.appendChild(r)}),o.appendChild(f),t){var m=Math.ceil(t.comments/s.perPage);if(1\n \n ':t.isLoggingIn?'
    '+_.spinner+"
    ":'\n '+_.github+"\n ")+'\n \n
    \n
    \n \n \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n \n ",t.login&&(i.querySelector(".gitment-editor-logout-link").onclick=function(){return n.logout()});var s=i.querySelector(".gitment-editor-write-field"),u=i.querySelector(".gitment-editor-preview-field"),c=s.querySelector("textarea");c.oninput=function(){c.style.height="auto";var e=window.getComputedStyle(c,null),t=parseInt(e.height,10),n=c.clientHeight,r=c.scrollHeight;n',t.github='',t.heart='',t.spinner=''}]); \ No newline at end of file diff --git a/lib/gitment.js.bak2 b/lib/gitment.js.bak2 new file mode 100644 index 0000000..8fa3d40 --- /dev/null +++ b/lib/gitment.js.bak2 @@ -0,0 +1,4153 @@ +var Gitment = + /******/ + (function (modules) { // webpackBootstrap + /******/ // The module cache + /******/ + var installedModules = {}; + /******/ + /******/ // The require function + /******/ + function __webpack_require__(moduleId) { + /******/ + /******/ // Check if module is in cache + /******/ + if (installedModules[moduleId]) + /******/ + return installedModules[moduleId].exports; + /******/ + /******/ // Create a new module (and put it into the cache) + /******/ + var module = installedModules[moduleId] = { + /******/ + i: moduleId, + /******/ + l: false, + /******/ + exports: {} + /******/ + }; + /******/ + /******/ // Execute the module function + /******/ + modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + /******/ + /******/ // Flag the module as loaded + /******/ + module.l = true; + /******/ + /******/ // Return the exports of the module + /******/ + return module.exports; + /******/ + } + /******/ + /******/ + /******/ // expose the modules object (__webpack_modules__) + /******/ + __webpack_require__.m = modules; + /******/ + /******/ // expose the module cache + /******/ + __webpack_require__.c = installedModules; + /******/ + /******/ // identity function for calling harmony imports with the correct context + /******/ + __webpack_require__.i = function (value) { + return value; + }; + /******/ + /******/ // define getter function for harmony exports + /******/ + __webpack_require__.d = function (exports, name, getter) { + /******/ + if (!__webpack_require__.o(exports, name)) { + /******/ + Object.defineProperty(exports, name, { + /******/ + configurable: false, + /******/ + enumerable: true, + /******/ + get: getter + /******/ + }); + /******/ + } + /******/ + }; + /******/ + /******/ // getDefaultExport function for compatibility with non-harmony modules + /******/ + __webpack_require__.n = function (module) { + /******/ + var getter = module && module.__esModule ? + /******/ + function getDefault() { + return module['default']; + } : + /******/ + function getModuleExports() { + return module; + }; + /******/ + __webpack_require__.d(getter, 'a', getter); + /******/ + return getter; + /******/ + }; + /******/ + /******/ // Object.prototype.hasOwnProperty.call + /******/ + __webpack_require__.o = function (object, property) { + return Object.prototype.hasOwnProperty.call(object, property); + }; + /******/ + /******/ // __webpack_public_path__ + /******/ + __webpack_require__.p = ""; + /******/ + /******/ // Load entry module and return exports + /******/ + return __webpack_require__(__webpack_require__.s = 5); + /******/ + }) +/************************************************************************/ +/******/ +([ + /* 0 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + Object.defineProperty(exports, "__esModule", { + value: true + }); + var LS_ACCESS_TOKEN_KEY = exports.LS_ACCESS_TOKEN_KEY = 'gitment-comments-token'; + var LS_USER_KEY = exports.LS_USER_KEY = 'gitment-user-info'; + + var NOT_INITIALIZED_ERROR = exports.NOT_INITIALIZED_ERROR = new Error('该文章评论未初始化'); + + /***/ + }), + /* 1 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + /* WEBPACK VAR INJECTION */ + (function (global) { + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + var __extends = undefined && undefined.__extends || function () { + var extendStatics = Object.setPrototypeOf || { + __proto__: [] + } + instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + return function (d, b) { + extendStatics(d, b); + + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + }(); + Object.defineProperty(exports, "__esModule", { + value: true + }); + registerGlobals(); + exports.extras = { + allowStateChanges: allowStateChanges, + deepEqual: deepEqual, + getAtom: getAtom, + getDebugName: getDebugName, + getDependencyTree: getDependencyTree, + getAdministration: getAdministration, + getGlobalState: getGlobalState, + getObserverTree: getObserverTree, + isComputingDerivation: isComputingDerivation, + isSpyEnabled: isSpyEnabled, + onReactionError: onReactionError, + resetGlobalState: resetGlobalState, + shareGlobalState: shareGlobalState, + spyReport: spyReport, + spyReportEnd: spyReportEnd, + spyReportStart: spyReportStart, + setReactionScheduler: setReactionScheduler + }; + if ((typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === "undefined" ? "undefined" : _typeof(__MOBX_DEVTOOLS_GLOBAL_HOOK__)) === "object") { + __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx(module.exports); + } + module.exports.default = module.exports; + var actionFieldDecorator = createClassPropertyDecorator(function (target, key, value, args, originalDescriptor) { + var actionName = args && args.length === 1 ? args[0] : value.name || key || ""; + var wrappedAction = action(actionName, value); + addHiddenProp(target, key, wrappedAction); + }, function (key) { + return this[key]; + }, function () { + invariant(false, getMessage("m001")); + }, false, true); + var boundActionDecorator = createClassPropertyDecorator(function (target, key, value) { + defineBoundAction(target, key, value); + }, function (key) { + return this[key]; + }, function () { + invariant(false, getMessage("m001")); + }, false, false); + var action = function action(arg1, arg2, arg3, arg4) { + if (arguments.length === 1 && typeof arg1 === "function") return createAction(arg1.name || "", arg1); + if (arguments.length === 2 && typeof arg2 === "function") return createAction(arg1, arg2); + if (arguments.length === 1 && typeof arg1 === "string") return namedActionDecorator(arg1); + return namedActionDecorator(arg2).apply(null, arguments); + }; + exports.action = action; + action.bound = function boundAction(arg1, arg2, arg3) { + if (typeof arg1 === "function") { + var action_1 = createAction("", arg1); + action_1.autoBind = true; + return action_1; + } + return boundActionDecorator.apply(null, arguments); + }; + + function namedActionDecorator(name) { + return function (target, prop, descriptor) { + if (descriptor && typeof descriptor.value === "function") { + descriptor.value = createAction(name, descriptor.value); + descriptor.enumerable = false; + descriptor.configurable = true; + return descriptor; + } + return actionFieldDecorator(name).apply(this, arguments); + }; + } + + function runInAction(arg1, arg2, arg3) { + var actionName = typeof arg1 === "string" ? arg1 : arg1.name || ""; + var fn = typeof arg1 === "function" ? arg1 : arg2; + var scope = typeof arg1 === "function" ? arg2 : arg3; + invariant(typeof fn === "function", getMessage("m002")); + invariant(fn.length === 0, getMessage("m003")); + invariant(typeof actionName === "string" && actionName.length > 0, "actions should have valid names, got: '" + actionName + "'"); + return executeAction(actionName, fn, scope, undefined); + } + exports.runInAction = runInAction; + + function isAction(thing) { + return typeof thing === "function" && thing.isMobxAction === true; + } + exports.isAction = isAction; + + function defineBoundAction(target, propertyName, fn) { + var res = function res() { + return executeAction(propertyName, fn, target, arguments); + }; + res.isMobxAction = true; + addHiddenProp(target, propertyName, res); + } + + function autorun(arg1, arg2, arg3) { + var name, view, scope; + if (typeof arg1 === "string") { + name = arg1; + view = arg2; + scope = arg3; + } else { + name = arg1.name || "Autorun@" + getNextId(); + view = arg1; + scope = arg2; + } + invariant(typeof view === "function", getMessage("m004")); + invariant(isAction(view) === false, getMessage("m005")); + if (scope) view = view.bind(scope); + var reaction = new Reaction(name, function () { + this.track(reactionRunner); + }); + + function reactionRunner() { + view(reaction); + } + reaction.schedule(); + return reaction.getDisposer(); + } + exports.autorun = autorun; + + function when(arg1, arg2, arg3, arg4) { + var name, predicate, effect, scope; + if (typeof arg1 === "string") { + name = arg1; + predicate = arg2; + effect = arg3; + scope = arg4; + } else { + name = "When@" + getNextId(); + predicate = arg1; + effect = arg2; + scope = arg3; + } + var disposer = autorun(name, function (r) { + if (predicate.call(scope)) { + r.dispose(); + var prevUntracked = untrackedStart(); + effect.call(scope); + untrackedEnd(prevUntracked); + } + }); + return disposer; + } + exports.when = when; + + function autorunAsync(arg1, arg2, arg3, arg4) { + var name, func, delay, scope; + if (typeof arg1 === "string") { + name = arg1; + func = arg2; + delay = arg3; + scope = arg4; + } else { + name = arg1.name || "AutorunAsync@" + getNextId(); + func = arg1; + delay = arg2; + scope = arg3; + } + invariant(isAction(func) === false, getMessage("m006")); + if (delay === void 0) delay = 1; + if (scope) func = func.bind(scope); + var isScheduled = false; + var r = new Reaction(name, function () { + if (!isScheduled) { + isScheduled = true; + setTimeout(function () { + isScheduled = false; + if (!r.isDisposed) r.track(reactionRunner); + }, delay); + } + }); + + function reactionRunner() { + func(r); + } + r.schedule(); + return r.getDisposer(); + } + exports.autorunAsync = autorunAsync; + + function reaction(expression, effect, arg3) { + if (arguments.length > 3) { + fail(getMessage("m007")); + } + if (isModifierDescriptor(expression)) { + fail(getMessage("m008")); + } + var opts; + if ((typeof arg3 === "undefined" ? "undefined" : _typeof(arg3)) === "object") { + opts = arg3; + } else { + opts = {}; + } + opts.name = opts.name || expression.name || effect.name || "Reaction@" + getNextId(); + opts.fireImmediately = arg3 === true || opts.fireImmediately === true; + opts.delay = opts.delay || 0; + opts.compareStructural = opts.compareStructural || opts.struct || false; + effect = action(opts.name, opts.context ? effect.bind(opts.context) : effect); + if (opts.context) { + expression = expression.bind(opts.context); + } + var firstTime = true; + var isScheduled = false; + var nextValue; + var r = new Reaction(opts.name, function () { + if (firstTime || opts.delay < 1) { + reactionRunner(); + } else if (!isScheduled) { + isScheduled = true; + setTimeout(function () { + isScheduled = false; + reactionRunner(); + }, opts.delay); + } + }); + + function reactionRunner() { + if (r.isDisposed) return; + var changed = false; + r.track(function () { + var v = expression(r); + changed = valueDidChange(opts.compareStructural, nextValue, v); + nextValue = v; + }); + if (firstTime && opts.fireImmediately) effect(nextValue, r); + if (!firstTime && changed === true) effect(nextValue, r); + if (firstTime) firstTime = false; + } + r.schedule(); + return r.getDisposer(); + } + exports.reaction = reaction; + + function createComputedDecorator(compareStructural) { + return createClassPropertyDecorator(function (target, name, _, __, originalDescriptor) { + invariant(typeof originalDescriptor !== "undefined", getMessage("m009")); + invariant(typeof originalDescriptor.get === "function", getMessage("m010")); + var adm = asObservableObject(target, ""); + defineComputedProperty(adm, name, originalDescriptor.get, originalDescriptor.set, compareStructural, false); + }, function (name) { + var observable = this.$mobx.values[name]; + if (observable === undefined) return undefined; + return observable.get(); + }, function (name, value) { + this.$mobx.values[name].set(value); + }, false, false); + } + var computedDecorator = createComputedDecorator(false); + var computedStructDecorator = createComputedDecorator(true); + var computed = function computed(arg1, arg2, arg3) { + if (typeof arg2 === "string") { + return computedDecorator.apply(null, arguments); + } + invariant(typeof arg1 === "function", getMessage("m011")); + invariant(arguments.length < 3, getMessage("m012")); + var opts = (typeof arg2 === "undefined" ? "undefined" : _typeof(arg2)) === "object" ? arg2 : {}; + opts.setter = typeof arg2 === "function" ? arg2 : opts.setter; + return new ComputedValue(arg1, opts.context, opts.compareStructural || opts.struct || false, opts.name || arg1.name || "", opts.setter); + }; + exports.computed = computed; + computed.struct = computedStructDecorator; + + function createTransformer(transformer, onCleanup) { + invariant(typeof transformer === "function" && transformer.length < 2, "createTransformer expects a function that accepts one argument"); + var objectCache = {}; + var resetId = globalState.resetId; + var Transformer = function (_super) { + __extends(Transformer, _super); + + function Transformer(sourceIdentifier, sourceObject) { + var _this = _super.call(this, function () { + return transformer(sourceObject); + }, undefined, false, "Transformer-" + transformer.name + "-" + sourceIdentifier, undefined) || this; + _this.sourceIdentifier = sourceIdentifier; + _this.sourceObject = sourceObject; + return _this; + } + Transformer.prototype.onBecomeUnobserved = function () { + var lastValue = this.value; + _super.prototype.onBecomeUnobserved.call(this); + delete objectCache[this.sourceIdentifier]; + if (onCleanup) onCleanup(lastValue, this.sourceObject); + }; + return Transformer; + }(ComputedValue); + return function (object) { + if (resetId !== globalState.resetId) { + objectCache = {}; + resetId = globalState.resetId; + } + var identifier = getMemoizationId(object); + var reactiveTransformer = objectCache[identifier]; + if (reactiveTransformer) return reactiveTransformer.get(); + reactiveTransformer = objectCache[identifier] = new Transformer(identifier, object); + return reactiveTransformer.get(); + }; + } + exports.createTransformer = createTransformer; + + function getMemoizationId(object) { + if (object === null || (typeof object === "undefined" ? "undefined" : _typeof(object)) !== "object") throw new Error("[mobx] transform expected some kind of object, got: " + object); + var tid = object.$transformId; + if (tid === undefined) { + tid = getNextId(); + addHiddenProp(object, "$transformId", tid); + } + return tid; + } + + function expr(expr, scope) { + if (!isComputingDerivation()) console.warn(getMessage("m013")); + return computed(expr, { + context: scope + }).get(); + } + exports.expr = expr; + + function extendObservable(target) { + var properties = []; + for (var _i = 1; _i < arguments.length; _i++) { + properties[_i - 1] = arguments[_i]; + } + return extendObservableHelper(target, deepEnhancer, properties); + } + exports.extendObservable = extendObservable; + + function extendShallowObservable(target) { + var properties = []; + for (var _i = 1; _i < arguments.length; _i++) { + properties[_i - 1] = arguments[_i]; + } + return extendObservableHelper(target, referenceEnhancer, properties); + } + exports.extendShallowObservable = extendShallowObservable; + + function extendObservableHelper(target, defaultEnhancer, properties) { + invariant(arguments.length >= 2, getMessage("m014")); + invariant((typeof target === "undefined" ? "undefined" : _typeof(target)) === "object", getMessage("m015")); + invariant(!isObservableMap(target), getMessage("m016")); + properties.forEach(function (propSet) { + invariant((typeof propSet === "undefined" ? "undefined" : _typeof(propSet)) === "object", getMessage("m017")); + invariant(!isObservable(propSet), getMessage("m018")); + }); + var adm = asObservableObject(target); + var definedProps = {}; + for (var i = properties.length - 1; i >= 0; i--) { + var propSet = properties[i]; + for (var key in propSet) { + if (definedProps[key] !== true && hasOwnProperty(propSet, key)) { + definedProps[key] = true; + if (target === propSet && !isPropertyConfigurable(target, key)) continue; + var descriptor = Object.getOwnPropertyDescriptor(propSet, key); + defineObservablePropertyFromDescriptor(adm, key, descriptor, defaultEnhancer); + } + } + } + return target; + } + + function getDependencyTree(thing, property) { + return nodeToDependencyTree(getAtom(thing, property)); + } + + function nodeToDependencyTree(node) { + var result = { + name: node.name + }; + if (node.observing && node.observing.length > 0) result.dependencies = unique(node.observing).map(nodeToDependencyTree); + return result; + } + + function getObserverTree(thing, property) { + return nodeToObserverTree(getAtom(thing, property)); + } + + function nodeToObserverTree(node) { + var result = { + name: node.name + }; + if (hasObservers(node)) result.observers = getObservers(node).map(nodeToObserverTree); + return result; + } + + function intercept(thing, propOrHandler, handler) { + if (typeof handler === "function") return interceptProperty(thing, propOrHandler, handler); + else return interceptInterceptable(thing, propOrHandler); + } + exports.intercept = intercept; + + function interceptInterceptable(thing, handler) { + return getAdministration(thing).intercept(handler); + } + + function interceptProperty(thing, property, handler) { + return getAdministration(thing, property).intercept(handler); + } + + function isComputed(value, property) { + if (value === null || value === undefined) return false; + if (property !== undefined) { + if (isObservableObject(value) === false) return false; + var atom = getAtom(value, property); + return isComputedValue(atom); + } + return isComputedValue(value); + } + exports.isComputed = isComputed; + + function isObservable(value, property) { + if (value === null || value === undefined) return false; + if (property !== undefined) { + if (isObservableArray(value) || isObservableMap(value)) throw new Error(getMessage("m019")); + else if (isObservableObject(value)) { + var o = value.$mobx; + return o.values && !!o.values[property]; + } + return false; + } + return isObservableObject(value) || !!value.$mobx || isAtom(value) || isReaction(value) || isComputedValue(value); + } + exports.isObservable = isObservable; + var deepDecorator = createDecoratorForEnhancer(deepEnhancer); + var shallowDecorator = createDecoratorForEnhancer(shallowEnhancer); + var refDecorator = createDecoratorForEnhancer(referenceEnhancer); + var deepStructDecorator = createDecoratorForEnhancer(deepStructEnhancer); + var refStructDecorator = createDecoratorForEnhancer(refStructEnhancer); + + function createObservable(v) { + if (v === void 0) { + v = undefined; + } + if (typeof arguments[1] === "string") return deepDecorator.apply(null, arguments); + invariant(arguments.length <= 1, getMessage("m021")); + invariant(!isModifierDescriptor(v), getMessage("m020")); + if (isObservable(v)) return v; + var res = deepEnhancer(v, undefined, undefined); + if (res !== v) return res; + return observable.box(v); + } + var IObservableFactories = function () { + function IObservableFactories() {} + IObservableFactories.prototype.box = function (value, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("box"); + return new ObservableValue(value, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowBox = function (value, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowBox"); + return new ObservableValue(value, referenceEnhancer, name); + }; + IObservableFactories.prototype.array = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("array"); + return new ObservableArray(initialValues, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowArray = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowArray"); + return new ObservableArray(initialValues, referenceEnhancer, name); + }; + IObservableFactories.prototype.map = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("map"); + return new ObservableMap(initialValues, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowMap = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowMap"); + return new ObservableMap(initialValues, referenceEnhancer, name); + }; + IObservableFactories.prototype.object = function (props, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("object"); + var res = {}; + asObservableObject(res, name); + extendObservable(res, props); + return res; + }; + IObservableFactories.prototype.shallowObject = function (props, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowObject"); + var res = {}; + asObservableObject(res, name); + extendShallowObservable(res, props); + return res; + }; + IObservableFactories.prototype.ref = function () { + if (arguments.length < 2) { + return createModifierDescriptor(referenceEnhancer, arguments[0]); + } else { + return refDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.shallow = function () { + if (arguments.length < 2) { + return createModifierDescriptor(shallowEnhancer, arguments[0]); + } else { + return shallowDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.deep = function () { + if (arguments.length < 2) { + return createModifierDescriptor(deepEnhancer, arguments[0]); + } else { + return deepDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.struct = function () { + if (arguments.length < 2) { + return createModifierDescriptor(deepStructEnhancer, arguments[0]); + } else { + return deepStructDecorator.apply(null, arguments); + } + }; + return IObservableFactories; + }(); + exports.IObservableFactories = IObservableFactories; + var observable = createObservable; + exports.observable = observable; + Object.keys(IObservableFactories.prototype).forEach(function (key) { + return observable[key] = IObservableFactories.prototype[key]; + }); + observable.deep.struct = observable.struct; + observable.ref.struct = function () { + if (arguments.length < 2) { + return createModifierDescriptor(refStructEnhancer, arguments[0]); + } else { + return refStructDecorator.apply(null, arguments); + } + }; + + function incorrectlyUsedAsDecorator(methodName) { + fail("Expected one or two arguments to observable." + methodName + ". Did you accidentally try to use observable." + methodName + " as decorator?"); + } + + function createDecoratorForEnhancer(enhancer) { + invariant(!!enhancer, ":("); + return createClassPropertyDecorator(function (target, name, baseValue, _, baseDescriptor) { + assertPropertyConfigurable(target, name); + invariant(!baseDescriptor || !baseDescriptor.get, getMessage("m022")); + var adm = asObservableObject(target, undefined); + defineObservableProperty(adm, name, baseValue, enhancer); + }, function (name) { + var observable = this.$mobx.values[name]; + if (observable === undefined) return undefined; + return observable.get(); + }, function (name, value) { + setPropertyValue(this, name, value); + }, true, false); + } + + function observe(thing, propOrCb, cbOrFire, fireImmediately) { + if (typeof cbOrFire === "function") return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately); + else return observeObservable(thing, propOrCb, cbOrFire); + } + exports.observe = observe; + + function observeObservable(thing, listener, fireImmediately) { + return getAdministration(thing).observe(listener, fireImmediately); + } + + function observeObservableProperty(thing, property, listener, fireImmediately) { + return getAdministration(thing, property).observe(listener, fireImmediately); + } + + function toJS(source, detectCycles, __alreadySeen) { + if (detectCycles === void 0) { + detectCycles = true; + } + if (__alreadySeen === void 0) { + __alreadySeen = []; + } + + function cache(value) { + if (detectCycles) __alreadySeen.push([source, value]); + return value; + } + if (isObservable(source)) { + if (detectCycles && __alreadySeen === null) __alreadySeen = []; + if (detectCycles && source !== null && (typeof source === "undefined" ? "undefined" : _typeof(source)) === "object") { + for (var i = 0, l = __alreadySeen.length; i < l; i++) { + if (__alreadySeen[i][0] === source) return __alreadySeen[i][1]; + } + } + if (isObservableArray(source)) { + var res = cache([]); + var toAdd = source.map(function (value) { + return toJS(value, detectCycles, __alreadySeen); + }); + res.length = toAdd.length; + for (var i = 0, l = toAdd.length; i < l; i++) { + res[i] = toAdd[i]; + } + return res; + } + if (isObservableObject(source)) { + var res = cache({}); + for (var key in source) { + res[key] = toJS(source[key], detectCycles, __alreadySeen); + } + return res; + } + if (isObservableMap(source)) { + var res_1 = cache({}); + source.forEach(function (value, key) { + return res_1[key] = toJS(value, detectCycles, __alreadySeen); + }); + return res_1; + } + if (isObservableValue(source)) return toJS(source.get(), detectCycles, __alreadySeen); + } + return source; + } + exports.toJS = toJS; + + function transaction(action, thisArg) { + if (thisArg === void 0) { + thisArg = undefined; + } + deprecated(getMessage("m023")); + return runInTransaction.apply(undefined, arguments); + } + exports.transaction = transaction; + + function runInTransaction(action, thisArg) { + if (thisArg === void 0) { + thisArg = undefined; + } + return executeAction("", action); + } + + function log(msg) { + console.log(msg); + return msg; + } + + function whyRun(thing, prop) { + switch (arguments.length) { + case 0: + thing = globalState.trackingDerivation; + if (!thing) return log(getMessage("m024")); + break; + case 2: + thing = getAtom(thing, prop); + break; + } + thing = getAtom(thing); + if (isComputedValue(thing)) return log(thing.whyRun()); + else if (isReaction(thing)) return log(thing.whyRun()); + return fail(getMessage("m025")); + } + exports.whyRun = whyRun; + + function createAction(actionName, fn) { + invariant(typeof fn === "function", getMessage("m026")); + invariant(typeof actionName === "string" && actionName.length > 0, "actions should have valid names, got: '" + actionName + "'"); + var res = function res() { + return executeAction(actionName, fn, this, arguments); + }; + res.originalFn = fn; + res.isMobxAction = true; + return res; + } + + function executeAction(actionName, fn, scope, args) { + var runInfo = startAction(actionName, fn, scope, args); + try { + return fn.apply(scope, args); + } finally { + endAction(runInfo); + } + } + + function startAction(actionName, fn, scope, args) { + var notifySpy = isSpyEnabled() && !!actionName; + var startTime = 0; + if (notifySpy) { + startTime = Date.now(); + var l = args && args.length || 0; + var flattendArgs = new Array(l); + if (l > 0) + for (var i = 0; i < l; i++) { + flattendArgs[i] = args[i]; + } + spyReportStart({ + type: "action", + name: actionName, + fn: fn, + object: scope, + arguments: flattendArgs + }); + } + var prevDerivation = untrackedStart(); + startBatch(); + var prevAllowStateChanges = allowStateChangesStart(true); + return { + prevDerivation: prevDerivation, + prevAllowStateChanges: prevAllowStateChanges, + notifySpy: notifySpy, + startTime: startTime + }; + } + + function endAction(runInfo) { + allowStateChangesEnd(runInfo.prevAllowStateChanges); + endBatch(); + untrackedEnd(runInfo.prevDerivation); + if (runInfo.notifySpy) spyReportEnd({ + time: Date.now() - runInfo.startTime + }); + } + + function useStrict(strict) { + invariant(globalState.trackingDerivation === null, getMessage("m028")); + globalState.strictMode = strict; + globalState.allowStateChanges = !strict; + } + exports.useStrict = useStrict; + + function isStrictModeEnabled() { + return globalState.strictMode; + } + exports.isStrictModeEnabled = isStrictModeEnabled; + + function allowStateChanges(allowStateChanges, func) { + var prev = allowStateChangesStart(allowStateChanges); + var res; + try { + res = func(); + } finally { + allowStateChangesEnd(prev); + } + return res; + } + + function allowStateChangesStart(allowStateChanges) { + var prev = globalState.allowStateChanges; + globalState.allowStateChanges = allowStateChanges; + return prev; + } + + function allowStateChangesEnd(prev) { + globalState.allowStateChanges = prev; + } + var BaseAtom = function () { + function BaseAtom(name) { + if (name === void 0) { + name = "Atom@" + getNextId(); + } + this.name = name; + this.isPendingUnobservation = true; + this.observers = []; + this.observersIndexes = {}; + this.diffValue = 0; + this.lastAccessedBy = 0; + this.lowestObserverState = IDerivationState.NOT_TRACKING; + } + BaseAtom.prototype.onBecomeUnobserved = function () {}; + BaseAtom.prototype.reportObserved = function () { + reportObserved(this); + }; + BaseAtom.prototype.reportChanged = function () { + startBatch(); + propagateChanged(this); + endBatch(); + }; + BaseAtom.prototype.toString = function () { + return this.name; + }; + return BaseAtom; + }(); + exports.BaseAtom = BaseAtom; + var Atom = function (_super) { + __extends(Atom, _super); + + function Atom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) { + if (name === void 0) { + name = "Atom@" + getNextId(); + } + if (onBecomeObservedHandler === void 0) { + onBecomeObservedHandler = noop; + } + if (onBecomeUnobservedHandler === void 0) { + onBecomeUnobservedHandler = noop; + } + var _this = _super.call(this, name) || this; + _this.name = name; + _this.onBecomeObservedHandler = onBecomeObservedHandler; + _this.onBecomeUnobservedHandler = onBecomeUnobservedHandler; + _this.isPendingUnobservation = false; + _this.isBeingTracked = false; + return _this; + } + Atom.prototype.reportObserved = function () { + startBatch(); + _super.prototype.reportObserved.call(this); + if (!this.isBeingTracked) { + this.isBeingTracked = true; + this.onBecomeObservedHandler(); + } + endBatch(); + return !!globalState.trackingDerivation; + }; + Atom.prototype.onBecomeUnobserved = function () { + this.isBeingTracked = false; + this.onBecomeUnobservedHandler(); + }; + return Atom; + }(BaseAtom); + exports.Atom = Atom; + var isAtom = createInstanceofPredicate("Atom", BaseAtom); + var ComputedValue = function () { + function ComputedValue(derivation, scope, compareStructural, name, setter) { + this.derivation = derivation; + this.scope = scope; + this.compareStructural = compareStructural; + this.dependenciesState = IDerivationState.NOT_TRACKING; + this.observing = []; + this.newObserving = null; + this.isPendingUnobservation = false; + this.observers = []; + this.observersIndexes = {}; + this.diffValue = 0; + this.runId = 0; + this.lastAccessedBy = 0; + this.lowestObserverState = IDerivationState.UP_TO_DATE; + this.unboundDepsCount = 0; + this.__mapid = "#" + getNextId(); + this.value = undefined; + this.isComputing = false; + this.isRunningSetter = false; + this.name = name || "ComputedValue@" + getNextId(); + if (setter) this.setter = createAction(name + "-setter", setter); + } + ComputedValue.prototype.onBecomeStale = function () { + propagateMaybeChanged(this); + }; + ComputedValue.prototype.onBecomeUnobserved = function () { + invariant(this.dependenciesState !== IDerivationState.NOT_TRACKING, getMessage("m029")); + clearObserving(this); + this.value = undefined; + }; + ComputedValue.prototype.get = function () { + invariant(!this.isComputing, "Cycle detected in computation " + this.name, this.derivation); + if (globalState.inBatch === 0) { + startBatch(); + if (shouldCompute(this)) this.value = this.computeValue(false); + endBatch(); + } else { + reportObserved(this); + if (shouldCompute(this)) + if (this.trackAndCompute()) propagateChangeConfirmed(this); + } + var result = this.value; + if (isCaughtException(result)) throw result.cause; + return result; + }; + ComputedValue.prototype.peek = function () { + var res = this.computeValue(false); + if (isCaughtException(res)) throw res.cause; + return res; + }; + ComputedValue.prototype.set = function (value) { + if (this.setter) { + invariant(!this.isRunningSetter, "The setter of computed value '" + this.name + "' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"); + this.isRunningSetter = true; + try { + this.setter.call(this.scope, value); + } finally { + this.isRunningSetter = false; + } + } else invariant(false, "[ComputedValue '" + this.name + "'] It is not possible to assign a new value to a computed value."); + }; + ComputedValue.prototype.trackAndCompute = function () { + if (isSpyEnabled()) { + spyReport({ + object: this.scope, + type: "compute", + fn: this.derivation + }); + } + var oldValue = this.value; + var newValue = this.value = this.computeValue(true); + return isCaughtException(newValue) || valueDidChange(this.compareStructural, newValue, oldValue); + }; + ComputedValue.prototype.computeValue = function (track) { + this.isComputing = true; + globalState.computationDepth++; + var res; + if (track) { + res = trackDerivedFunction(this, this.derivation, this.scope); + } else { + try { + res = this.derivation.call(this.scope); + } catch (e) { + res = new CaughtException(e); + } + } + globalState.computationDepth--; + this.isComputing = false; + return res; + };; + ComputedValue.prototype.observe = function (listener, fireImmediately) { + var _this = this; + var firstTime = true; + var prevValue = undefined; + return autorun(function () { + var newValue = _this.get(); + if (!firstTime || fireImmediately) { + var prevU = untrackedStart(); + listener({ + type: "update", + object: _this, + newValue: newValue, + oldValue: prevValue + }); + untrackedEnd(prevU); + } + firstTime = false; + prevValue = newValue; + }); + }; + ComputedValue.prototype.toJSON = function () { + return this.get(); + }; + ComputedValue.prototype.toString = function () { + return this.name + "[" + this.derivation.toString() + "]"; + }; + ComputedValue.prototype.valueOf = function () { + return toPrimitive(this.get()); + };; + ComputedValue.prototype.whyRun = function () { + var isTracking = Boolean(globalState.trackingDerivation); + var observing = unique(this.isComputing ? this.newObserving : this.observing).map(function (dep) { + return dep.name; + }); + var observers = unique(getObservers(this).map(function (dep) { + return dep.name; + })); + return "\nWhyRun? computation '" + this.name + "':\n * Running because: " + (isTracking ? "[active] the value of this computation is needed by a reaction" : this.isComputing ? "[get] The value of this computed was requested outside a reaction" : "[idle] not running at the moment") + "\n" + (this.dependenciesState === IDerivationState.NOT_TRACKING ? getMessage("m032") : " * This computation will re-run if any of the following observables changes:\n " + joinStrings(observing) + "\n " + (this.isComputing && isTracking ? " (... or any observable accessed during the remainder of the current run)" : "") + "\n\t" + getMessage("m038") + "\n\n * If the outcome of this computation changes, the following observers will be re-run:\n " + joinStrings(observers) + "\n"); + }; + return ComputedValue; + }(); + ComputedValue.prototype[primitiveSymbol()] = ComputedValue.prototype.valueOf; + var isComputedValue = createInstanceofPredicate("ComputedValue", ComputedValue); + var IDerivationState; + (function (IDerivationState) { + IDerivationState[IDerivationState["NOT_TRACKING"] = -1] = "NOT_TRACKING"; + IDerivationState[IDerivationState["UP_TO_DATE"] = 0] = "UP_TO_DATE"; + IDerivationState[IDerivationState["POSSIBLY_STALE"] = 1] = "POSSIBLY_STALE"; + IDerivationState[IDerivationState["STALE"] = 2] = "STALE"; + })(IDerivationState || (IDerivationState = {})); + exports.IDerivationState = IDerivationState; + var CaughtException = function () { + function CaughtException(cause) { + this.cause = cause; + } + return CaughtException; + }(); + + function isCaughtException(e) { + return e instanceof CaughtException; + } + + function shouldCompute(derivation) { + switch (derivation.dependenciesState) { + case IDerivationState.UP_TO_DATE: + return false; + case IDerivationState.NOT_TRACKING: + case IDerivationState.STALE: + return true; + case IDerivationState.POSSIBLY_STALE: { + var prevUntracked = untrackedStart(); + var obs = derivation.observing, + l = obs.length; + for (var i = 0; i < l; i++) { + var obj = obs[i]; + if (isComputedValue(obj)) { + try { + obj.get(); + } catch (e) { + untrackedEnd(prevUntracked); + return true; + } + if (derivation.dependenciesState === IDerivationState.STALE) { + untrackedEnd(prevUntracked); + return true; + } + } + } + changeDependenciesStateTo0(derivation); + untrackedEnd(prevUntracked); + return false; + } + } + } + + function isComputingDerivation() { + return globalState.trackingDerivation !== null; + } + + function checkIfStateModificationsAreAllowed(atom) { + var hasObservers = atom.observers.length > 0; + if (globalState.computationDepth > 0 && hasObservers) fail(getMessage("m031") + atom.name); + if (!globalState.allowStateChanges && hasObservers) fail(getMessage(globalState.strictMode ? "m030a" : "m030b") + atom.name); + } + + function trackDerivedFunction(derivation, f, context) { + changeDependenciesStateTo0(derivation); + derivation.newObserving = new Array(derivation.observing.length + 100); + derivation.unboundDepsCount = 0; + derivation.runId = ++globalState.runId; + var prevTracking = globalState.trackingDerivation; + globalState.trackingDerivation = derivation; + var result; + try { + result = f.call(context); + } catch (e) { + result = new CaughtException(e); + } + globalState.trackingDerivation = prevTracking; + bindDependencies(derivation); + return result; + } + + function bindDependencies(derivation) { + var prevObserving = derivation.observing; + var observing = derivation.observing = derivation.newObserving; + derivation.newObserving = null; + var i0 = 0, + l = derivation.unboundDepsCount; + for (var i = 0; i < l; i++) { + var dep = observing[i]; + if (dep.diffValue === 0) { + dep.diffValue = 1; + if (i0 !== i) observing[i0] = dep; + i0++; + } + } + observing.length = i0; + l = prevObserving.length; + while (l--) { + var dep = prevObserving[l]; + if (dep.diffValue === 0) { + removeObserver(dep, derivation); + } + dep.diffValue = 0; + } + while (i0--) { + var dep = observing[i0]; + if (dep.diffValue === 1) { + dep.diffValue = 0; + addObserver(dep, derivation); + } + } + } + + function clearObserving(derivation) { + var obs = derivation.observing; + var i = obs.length; + while (i--) { + removeObserver(obs[i], derivation); + } + derivation.dependenciesState = IDerivationState.NOT_TRACKING; + obs.length = 0; + } + + function untracked(action) { + var prev = untrackedStart(); + var res = action(); + untrackedEnd(prev); + return res; + } + exports.untracked = untracked; + + function untrackedStart() { + var prev = globalState.trackingDerivation; + globalState.trackingDerivation = null; + return prev; + } + + function untrackedEnd(prev) { + globalState.trackingDerivation = prev; + } + + function changeDependenciesStateTo0(derivation) { + if (derivation.dependenciesState === IDerivationState.UP_TO_DATE) return; + derivation.dependenciesState = IDerivationState.UP_TO_DATE; + var obs = derivation.observing; + var i = obs.length; + while (i--) { + obs[i].lowestObserverState = IDerivationState.UP_TO_DATE; + } + } + var persistentKeys = ["mobxGuid", "resetId", "spyListeners", "strictMode", "runId"]; + var MobXGlobals = function () { + function MobXGlobals() { + this.version = 5; + this.trackingDerivation = null; + this.computationDepth = 0; + this.runId = 0; + this.mobxGuid = 0; + this.inBatch = 0; + this.pendingUnobservations = []; + this.pendingReactions = []; + this.isRunningReactions = false; + this.allowStateChanges = true; + this.strictMode = false; + this.resetId = 0; + this.spyListeners = []; + this.globalReactionErrorHandlers = []; + } + return MobXGlobals; + }(); + var globalState = new MobXGlobals(); + + function shareGlobalState() { + var global = getGlobal(); + var ownState = globalState; + if (global.__mobservableTrackingStack || global.__mobservableViewStack) throw new Error("[mobx] An incompatible version of mobservable is already loaded."); + if (global.__mobxGlobal && global.__mobxGlobal.version !== ownState.version) throw new Error("[mobx] An incompatible version of mobx is already loaded."); + if (global.__mobxGlobal) globalState = global.__mobxGlobal; + else global.__mobxGlobal = ownState; + } + + function getGlobalState() { + return globalState; + } + + function registerGlobals() {} + + function resetGlobalState() { + globalState.resetId++; + var defaultGlobals = new MobXGlobals(); + for (var key in defaultGlobals) { + if (persistentKeys.indexOf(key) === -1) globalState[key] = defaultGlobals[key]; + } + globalState.allowStateChanges = !globalState.strictMode; + } + + function hasObservers(observable) { + return observable.observers && observable.observers.length > 0; + } + + function getObservers(observable) { + return observable.observers; + } + + function invariantObservers(observable) { + var list = observable.observers; + var map = observable.observersIndexes; + var l = list.length; + for (var i = 0; i < l; i++) { + var id = list[i].__mapid; + if (i) { + invariant(map[id] === i, "INTERNAL ERROR maps derivation.__mapid to index in list"); + } else { + invariant(!(id in map), "INTERNAL ERROR observer on index 0 shouldnt be held in map."); + } + } + invariant(list.length === 0 || Object.keys(map).length === list.length - 1, "INTERNAL ERROR there is no junk in map"); + } + + function addObserver(observable, node) { + var l = observable.observers.length; + if (l) { + observable.observersIndexes[node.__mapid] = l; + } + observable.observers[l] = node; + if (observable.lowestObserverState > node.dependenciesState) observable.lowestObserverState = node.dependenciesState; + } + + function removeObserver(observable, node) { + if (observable.observers.length === 1) { + observable.observers.length = 0; + queueForUnobservation(observable); + } else { + var list = observable.observers; + var map_1 = observable.observersIndexes; + var filler = list.pop(); + if (filler !== node) { + var index = map_1[node.__mapid] || 0; + if (index) { + map_1[filler.__mapid] = index; + } else { + delete map_1[filler.__mapid]; + } + list[index] = filler; + } + delete map_1[node.__mapid]; + } + } + + function queueForUnobservation(observable) { + if (!observable.isPendingUnobservation) { + observable.isPendingUnobservation = true; + globalState.pendingUnobservations.push(observable); + } + } + + function startBatch() { + globalState.inBatch++; + } + + function endBatch() { + if (--globalState.inBatch === 0) { + runReactions(); + var list = globalState.pendingUnobservations; + for (var i = 0; i < list.length; i++) { + var observable_1 = list[i]; + observable_1.isPendingUnobservation = false; + if (observable_1.observers.length === 0) { + observable_1.onBecomeUnobserved(); + } + } + globalState.pendingUnobservations = []; + } + } + + function reportObserved(observable) { + var derivation = globalState.trackingDerivation; + if (derivation !== null) { + if (derivation.runId !== observable.lastAccessedBy) { + observable.lastAccessedBy = derivation.runId; + derivation.newObserving[derivation.unboundDepsCount++] = observable; + } + } else if (observable.observers.length === 0) { + queueForUnobservation(observable); + } + } + + function invariantLOS(observable, msg) { + var min = getObservers(observable).reduce(function (a, b) { + return Math.min(a, b.dependenciesState); + }, 2); + if (min >= observable.lowestObserverState) return; + throw new Error("lowestObserverState is wrong for " + msg + " because " + min + " < " + observable.lowestObserverState); + } + + function propagateChanged(observable) { + if (observable.lowestObserverState === IDerivationState.STALE) return; + observable.lowestObserverState = IDerivationState.STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.UP_TO_DATE) d.onBecomeStale(); + d.dependenciesState = IDerivationState.STALE; + } + } + + function propagateChangeConfirmed(observable) { + if (observable.lowestObserverState === IDerivationState.STALE) return; + observable.lowestObserverState = IDerivationState.STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.POSSIBLY_STALE) d.dependenciesState = IDerivationState.STALE; + else if (d.dependenciesState === IDerivationState.UP_TO_DATE) observable.lowestObserverState = IDerivationState.UP_TO_DATE; + } + } + + function propagateMaybeChanged(observable) { + if (observable.lowestObserverState !== IDerivationState.UP_TO_DATE) return; + observable.lowestObserverState = IDerivationState.POSSIBLY_STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.UP_TO_DATE) { + d.dependenciesState = IDerivationState.POSSIBLY_STALE; + d.onBecomeStale(); + } + } + } + var Reaction = function () { + function Reaction(name, onInvalidate) { + if (name === void 0) { + name = "Reaction@" + getNextId(); + } + this.name = name; + this.onInvalidate = onInvalidate; + this.observing = []; + this.newObserving = []; + this.dependenciesState = IDerivationState.NOT_TRACKING; + this.diffValue = 0; + this.runId = 0; + this.unboundDepsCount = 0; + this.__mapid = "#" + getNextId(); + this.isDisposed = false; + this._isScheduled = false; + this._isTrackPending = false; + this._isRunning = false; + } + Reaction.prototype.onBecomeStale = function () { + this.schedule(); + }; + Reaction.prototype.schedule = function () { + if (!this._isScheduled) { + this._isScheduled = true; + globalState.pendingReactions.push(this); + runReactions(); + } + }; + Reaction.prototype.isScheduled = function () { + return this._isScheduled; + }; + Reaction.prototype.runReaction = function () { + if (!this.isDisposed) { + startBatch(); + this._isScheduled = false; + if (shouldCompute(this)) { + this._isTrackPending = true; + this.onInvalidate(); + if (this._isTrackPending && isSpyEnabled()) { + spyReport({ + object: this, + type: "scheduled-reaction" + }); + } + } + endBatch(); + } + }; + Reaction.prototype.track = function (fn) { + startBatch(); + var notify = isSpyEnabled(); + var startTime; + if (notify) { + startTime = Date.now(); + spyReportStart({ + object: this, + type: "reaction", + fn: fn + }); + } + this._isRunning = true; + var result = trackDerivedFunction(this, fn, undefined); + this._isRunning = false; + this._isTrackPending = false; + if (this.isDisposed) { + clearObserving(this); + } + if (isCaughtException(result)) this.reportExceptionInDerivation(result.cause); + if (notify) { + spyReportEnd({ + time: Date.now() - startTime + }); + } + endBatch(); + }; + Reaction.prototype.reportExceptionInDerivation = function (error) { + var _this = this; + if (this.errorHandler) { + this.errorHandler(error, this); + return; + } + var message = "[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '" + this; + var messageToUser = getMessage("m037"); + console.error(message || messageToUser, error); + if (isSpyEnabled()) { + spyReport({ + type: "error", + message: message, + error: error, + object: this + }); + } + globalState.globalReactionErrorHandlers.forEach(function (f) { + return f(error, _this); + }); + }; + Reaction.prototype.dispose = function () { + if (!this.isDisposed) { + this.isDisposed = true; + if (!this._isRunning) { + startBatch(); + clearObserving(this); + endBatch(); + } + } + }; + Reaction.prototype.getDisposer = function () { + var r = this.dispose.bind(this); + r.$mobx = this; + r.onError = registerErrorHandler; + return r; + }; + Reaction.prototype.toString = function () { + return "Reaction[" + this.name + "]"; + }; + Reaction.prototype.whyRun = function () { + var observing = unique(this._isRunning ? this.newObserving : this.observing).map(function (dep) { + return dep.name; + }); + return "\nWhyRun? reaction '" + this.name + "':\n * Status: [" + (this.isDisposed ? "stopped" : this._isRunning ? "running" : this.isScheduled() ? "scheduled" : "idle") + "]\n * This reaction will re-run if any of the following observables changes:\n " + joinStrings(observing) + "\n " + (this._isRunning ? " (... or any observable accessed during the remainder of the current run)" : "") + "\n\t" + getMessage("m038") + "\n"; + }; + return Reaction; + }(); + exports.Reaction = Reaction; + + function registerErrorHandler(handler) { + invariant(this && this.$mobx && isReaction(this.$mobx), "Invalid `this`"); + invariant(!this.$mobx.errorHandler, "Only one onErrorHandler can be registered"); + this.$mobx.errorHandler = handler; + } + + function onReactionError(handler) { + globalState.globalReactionErrorHandlers.push(handler); + return function () { + var idx = globalState.globalReactionErrorHandlers.indexOf(handler); + if (idx >= 0) globalState.globalReactionErrorHandlers.splice(idx, 1); + }; + } + var MAX_REACTION_ITERATIONS = 100; + var reactionScheduler = function reactionScheduler(f) { + return f(); + }; + + function runReactions() { + if (globalState.inBatch > 0 || globalState.isRunningReactions) return; + reactionScheduler(runReactionsHelper); + } + + function runReactionsHelper() { + globalState.isRunningReactions = true; + var allReactions = globalState.pendingReactions; + var iterations = 0; + while (allReactions.length > 0) { + if (++iterations === MAX_REACTION_ITERATIONS) { + console.error("Reaction doesn't converge to a stable state after " + MAX_REACTION_ITERATIONS + " iterations." + (" Probably there is a cycle in the reactive function: " + allReactions[0])); + allReactions.splice(0); + } + var remainingReactions = allReactions.splice(0); + for (var i = 0, l = remainingReactions.length; i < l; i++) { + remainingReactions[i].runReaction(); + } + } + globalState.isRunningReactions = false; + } + var isReaction = createInstanceofPredicate("Reaction", Reaction); + + function setReactionScheduler(fn) { + var baseScheduler = reactionScheduler; + reactionScheduler = function reactionScheduler(f) { + return fn(function () { + return baseScheduler(f); + }); + }; + } + + function isSpyEnabled() { + return !!globalState.spyListeners.length; + } + + function spyReport(event) { + if (!globalState.spyListeners.length) return; + var listeners = globalState.spyListeners; + for (var i = 0, l = listeners.length; i < l; i++) { + listeners[i](event); + } + } + + function spyReportStart(event) { + var change = objectAssign({}, event, { + spyReportStart: true + }); + spyReport(change); + } + var END_EVENT = { + spyReportEnd: true + }; + + function spyReportEnd(change) { + if (change) spyReport(objectAssign({}, change, END_EVENT)); + else spyReport(END_EVENT); + } + + function spy(listener) { + globalState.spyListeners.push(listener); + return once(function () { + var idx = globalState.spyListeners.indexOf(listener); + if (idx !== -1) globalState.spyListeners.splice(idx, 1); + }); + } + exports.spy = spy; + + function hasInterceptors(interceptable) { + return interceptable.interceptors && interceptable.interceptors.length > 0; + } + + function registerInterceptor(interceptable, handler) { + var interceptors = interceptable.interceptors || (interceptable.interceptors = []); + interceptors.push(handler); + return once(function () { + var idx = interceptors.indexOf(handler); + if (idx !== -1) interceptors.splice(idx, 1); + }); + } + + function interceptChange(interceptable, change) { + var prevU = untrackedStart(); + try { + var interceptors = interceptable.interceptors; + if (interceptors) + for (var i = 0, l = interceptors.length; i < l; i++) { + change = interceptors[i](change); + invariant(!change || change.type, "Intercept handlers should return nothing or a change object"); + if (!change) break; + } + return change; + } finally { + untrackedEnd(prevU); + } + } + + function hasListeners(listenable) { + return listenable.changeListeners && listenable.changeListeners.length > 0; + } + + function registerListener(listenable, handler) { + var listeners = listenable.changeListeners || (listenable.changeListeners = []); + listeners.push(handler); + return once(function () { + var idx = listeners.indexOf(handler); + if (idx !== -1) listeners.splice(idx, 1); + }); + } + + function notifyListeners(listenable, change) { + var prevU = untrackedStart(); + var listeners = listenable.changeListeners; + if (!listeners) return; + listeners = listeners.slice(); + for (var i = 0, l = listeners.length; i < l; i++) { + listeners[i](change); + } + untrackedEnd(prevU); + } + + function asReference(value) { + deprecated("asReference is deprecated, use observable.ref instead"); + return observable.ref(value); + } + exports.asReference = asReference; + + function asStructure(value) { + deprecated("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."); + return observable.struct(value); + } + exports.asStructure = asStructure; + + function asFlat(value) { + deprecated("asFlat is deprecated, use observable.shallow instead"); + return observable.shallow(value); + } + exports.asFlat = asFlat; + + function asMap(data) { + deprecated("asMap is deprecated, use observable.map or observable.shallowMap instead"); + return observable.map(data || {}); + } + exports.asMap = asMap; + + function isModifierDescriptor(thing) { + return (typeof thing === "undefined" ? "undefined" : _typeof(thing)) === "object" && thing !== null && thing.isMobxModifierDescriptor === true; + } + exports.isModifierDescriptor = isModifierDescriptor; + + function createModifierDescriptor(enhancer, initialValue) { + invariant(!isModifierDescriptor(initialValue), "Modifiers cannot be nested"); + return { + isMobxModifierDescriptor: true, + initialValue: initialValue, + enhancer: enhancer + }; + } + + function deepEnhancer(v, _, name) { + if (isModifierDescriptor(v)) fail("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"); + if (isObservable(v)) return v; + if (Array.isArray(v)) return observable.array(v, name); + if (isPlainObject(v)) return observable.object(v, name); + if (isES6Map(v)) return observable.map(v, name); + return v; + } + + function shallowEnhancer(v, _, name) { + if (isModifierDescriptor(v)) fail("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"); + if (v === undefined || v === null) return v; + if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v)) return v; + if (Array.isArray(v)) return observable.shallowArray(v, name); + if (isPlainObject(v)) return observable.shallowObject(v, name); + if (isES6Map(v)) return observable.shallowMap(v, name); + return fail("The shallow modifier / decorator can only used in combination with arrays, objects and maps"); + } + + function referenceEnhancer(newValue) { + return newValue; + } + + function deepStructEnhancer(v, oldValue, name) { + if (deepEqual(v, oldValue)) return oldValue; + if (isObservable(v)) return v; + if (Array.isArray(v)) return new ObservableArray(v, deepStructEnhancer, name); + if (isES6Map(v)) return new ObservableMap(v, deepStructEnhancer, name); + if (isPlainObject(v)) { + var res = {}; + asObservableObject(res, name); + extendObservableHelper(res, deepStructEnhancer, [v]); + return res; + } + return v; + } + + function refStructEnhancer(v, oldValue, name) { + if (deepEqual(v, oldValue)) return oldValue; + return v; + } + var MAX_SPLICE_SIZE = 10000; + var safariPrototypeSetterInheritanceBug = function () { + var v = false; + var p = {}; + Object.defineProperty(p, "0", { + set: function set() { + v = true; + } + }); + Object.create(p)["0"] = 1; + return v === false; + }(); + var OBSERVABLE_ARRAY_BUFFER_SIZE = 0; + var StubArray = function () { + function StubArray() {} + return StubArray; + }(); + StubArray.prototype = []; + var ObservableArrayAdministration = function () { + function ObservableArrayAdministration(name, enhancer, array, owned) { + this.array = array; + this.owned = owned; + this.lastKnownLength = 0; + this.interceptors = null; + this.changeListeners = null; + this.atom = new BaseAtom(name || "ObservableArray@" + getNextId()); + this.enhancer = function (newV, oldV) { + return enhancer(newV, oldV, name + "[..]"); + }; + } + ObservableArrayAdministration.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + ObservableArrayAdministration.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately === void 0) { + fireImmediately = false; + } + if (fireImmediately) { + listener({ + object: this.array, + type: "splice", + index: 0, + added: this.values.slice(), + addedCount: this.values.length, + removed: [], + removedCount: 0 + }); + } + return registerListener(this, listener); + }; + ObservableArrayAdministration.prototype.getArrayLength = function () { + this.atom.reportObserved(); + return this.values.length; + }; + ObservableArrayAdministration.prototype.setArrayLength = function (newLength) { + if (typeof newLength !== "number" || newLength < 0) throw new Error("[mobx.array] Out of range: " + newLength); + var currentLength = this.values.length; + if (newLength === currentLength) return; + else if (newLength > currentLength) { + var newItems = new Array(newLength - currentLength); + for (var i = 0; i < newLength - currentLength; i++) { + newItems[i] = undefined; + } + this.spliceWithArray(currentLength, 0, newItems); + } else this.spliceWithArray(newLength, currentLength - newLength); + }; + ObservableArrayAdministration.prototype.updateArrayLength = function (oldLength, delta) { + if (oldLength !== this.lastKnownLength) throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?"); + this.lastKnownLength += delta; + if (delta > 0 && oldLength + delta + 1 > OBSERVABLE_ARRAY_BUFFER_SIZE) reserveArrayBuffer(oldLength + delta + 1); + }; + ObservableArrayAdministration.prototype.spliceWithArray = function (index, deleteCount, newItems) { + var _this = this; + checkIfStateModificationsAreAllowed(this.atom); + var length = this.values.length; + if (index === undefined) index = 0; + else if (index > length) index = length; + else if (index < 0) index = Math.max(0, length + index); + if (arguments.length === 1) deleteCount = length - index; + else if (deleteCount === undefined || deleteCount === null) deleteCount = 0; + else deleteCount = Math.max(0, Math.min(deleteCount, length - index)); + if (newItems === undefined) newItems = []; + if (hasInterceptors(this)) { + var change = interceptChange(this, { + object: this.array, + type: "splice", + index: index, + removedCount: deleteCount, + added: newItems + }); + if (!change) return EMPTY_ARRAY; + deleteCount = change.removedCount; + newItems = change.added; + } + newItems = newItems.map(function (v) { + return _this.enhancer(v, undefined); + }); + var lengthDelta = newItems.length - deleteCount; + this.updateArrayLength(length, lengthDelta); + var res = this.spliceItemsIntoValues(index, deleteCount, newItems); + if (deleteCount !== 0 || newItems.length !== 0) this.notifyArraySplice(index, newItems, res); + return res; + }; + ObservableArrayAdministration.prototype.spliceItemsIntoValues = function (index, deleteCount, newItems) { + if (newItems.length < MAX_SPLICE_SIZE) { + return (_a = this.values).splice.apply(_a, [index, deleteCount].concat(newItems)); + } else { + var res = this.values.slice(index, index + deleteCount); + this.values = this.values.slice(0, index).concat(newItems, this.values.slice(index + deleteCount)); + return res; + } + var _a; + }; + ObservableArrayAdministration.prototype.notifyArrayChildUpdate = function (index, newValue, oldValue) { + var notifySpy = !this.owned && isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + object: this.array, + type: "update", + index: index, + newValue: newValue, + oldValue: oldValue + } : null; + if (notifySpy) spyReportStart(change); + this.atom.reportChanged(); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + ObservableArrayAdministration.prototype.notifyArraySplice = function (index, added, removed) { + var notifySpy = !this.owned && isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + object: this.array, + type: "splice", + index: index, + removed: removed, + added: added, + removedCount: removed.length, + addedCount: added.length + } : null; + if (notifySpy) spyReportStart(change); + this.atom.reportChanged(); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + return ObservableArrayAdministration; + }(); + var ObservableArray = function (_super) { + __extends(ObservableArray, _super); + + function ObservableArray(initialValues, enhancer, name, owned) { + if (name === void 0) { + name = "ObservableArray@" + getNextId(); + } + if (owned === void 0) { + owned = false; + } + var _this = _super.call(this) || this; + var adm = new ObservableArrayAdministration(name, enhancer, _this, owned); + addHiddenFinalProp(_this, "$mobx", adm); + if (initialValues && initialValues.length) { + adm.updateArrayLength(0, initialValues.length); + adm.values = initialValues.map(function (v) { + return enhancer(v, undefined, name + "[..]"); + }); + adm.notifyArraySplice(0, adm.values.slice(), EMPTY_ARRAY); + } else { + adm.values = []; + } + if (safariPrototypeSetterInheritanceBug) { + Object.defineProperty(adm.array, "0", ENTRY_0); + } + return _this; + } + ObservableArray.prototype.intercept = function (handler) { + return this.$mobx.intercept(handler); + }; + ObservableArray.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately === void 0) { + fireImmediately = false; + } + return this.$mobx.observe(listener, fireImmediately); + }; + ObservableArray.prototype.clear = function () { + return this.splice(0); + }; + ObservableArray.prototype.concat = function () { + var arrays = []; + for (var _i = 0; _i < arguments.length; _i++) { + arrays[_i] = arguments[_i]; + } + this.$mobx.atom.reportObserved(); + return Array.prototype.concat.apply(this.peek(), arrays.map(function (a) { + return isObservableArray(a) ? a.peek() : a; + })); + }; + ObservableArray.prototype.replace = function (newItems) { + return this.$mobx.spliceWithArray(0, this.$mobx.values.length, newItems); + }; + ObservableArray.prototype.toJS = function () { + return this.slice(); + }; + ObservableArray.prototype.toJSON = function () { + return this.toJS(); + }; + ObservableArray.prototype.peek = function () { + return this.$mobx.values; + }; + ObservableArray.prototype.find = function (predicate, thisArg, fromIndex) { + if (fromIndex === void 0) { + fromIndex = 0; + } + this.$mobx.atom.reportObserved(); + var items = this.$mobx.values, + l = items.length; + for (var i = fromIndex; i < l; i++) { + if (predicate.call(thisArg, items[i], i, this)) return items[i]; + } + return undefined; + }; + ObservableArray.prototype.splice = function (index, deleteCount) { + var newItems = []; + for (var _i = 2; _i < arguments.length; _i++) { + newItems[_i - 2] = arguments[_i]; + } + switch (arguments.length) { + case 0: + return []; + case 1: + return this.$mobx.spliceWithArray(index); + case 2: + return this.$mobx.spliceWithArray(index, deleteCount); + } + return this.$mobx.spliceWithArray(index, deleteCount, newItems); + }; + ObservableArray.prototype.spliceWithArray = function (index, deleteCount, newItems) { + return this.$mobx.spliceWithArray(index, deleteCount, newItems); + }; + ObservableArray.prototype.push = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + var adm = this.$mobx; + adm.spliceWithArray(adm.values.length, 0, items); + return adm.values.length; + }; + ObservableArray.prototype.pop = function () { + return this.splice(Math.max(this.$mobx.values.length - 1, 0), 1)[0]; + }; + ObservableArray.prototype.shift = function () { + return this.splice(0, 1)[0]; + }; + ObservableArray.prototype.unshift = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + var adm = this.$mobx; + adm.spliceWithArray(0, 0, items); + return adm.values.length; + }; + ObservableArray.prototype.reverse = function () { + this.$mobx.atom.reportObserved(); + var clone = this.slice(); + return clone.reverse.apply(clone, arguments); + }; + ObservableArray.prototype.sort = function (compareFn) { + this.$mobx.atom.reportObserved(); + var clone = this.slice(); + return clone.sort.apply(clone, arguments); + }; + ObservableArray.prototype.remove = function (value) { + var idx = this.$mobx.values.indexOf(value); + if (idx > -1) { + this.splice(idx, 1); + return true; + } + return false; + }; + ObservableArray.prototype.move = function (fromIndex, toIndex) { + function checkIndex(index) { + if (index < 0) { + throw new Error("[mobx.array] Index out of bounds: " + index + " is negative"); + } + var length = this.$mobx.values.length; + if (index >= length) { + throw new Error("[mobx.array] Index out of bounds: " + index + " is not smaller than " + length); + } + } + checkIndex.call(this, fromIndex); + checkIndex.call(this, toIndex); + if (fromIndex === toIndex) { + return; + } + var oldItems = this.$mobx.values; + var newItems; + if (fromIndex < toIndex) { + newItems = oldItems.slice(0, fromIndex).concat(oldItems.slice(fromIndex + 1, toIndex + 1), [oldItems[fromIndex]], oldItems.slice(toIndex + 1)); + } else { + newItems = oldItems.slice(0, toIndex).concat([oldItems[fromIndex]], oldItems.slice(toIndex, fromIndex), oldItems.slice(fromIndex + 1)); + } + this.replace(newItems); + }; + ObservableArray.prototype.toString = function () { + this.$mobx.atom.reportObserved(); + return Array.prototype.toString.apply(this.$mobx.values, arguments); + }; + ObservableArray.prototype.toLocaleString = function () { + this.$mobx.atom.reportObserved(); + return Array.prototype.toLocaleString.apply(this.$mobx.values, arguments); + }; + return ObservableArray; + }(StubArray); + declareIterator(ObservableArray.prototype, function () { + return arrayAsIterator(this.slice()); + }); + makeNonEnumerable(ObservableArray.prototype, ["constructor", "intercept", "observe", "clear", "concat", "replace", "toJS", "toJSON", "peek", "find", "splice", "spliceWithArray", "push", "pop", "shift", "unshift", "reverse", "sort", "remove", "move", "toString", "toLocaleString"]); + Object.defineProperty(ObservableArray.prototype, "length", { + enumerable: false, + configurable: true, + get: function get() { + return this.$mobx.getArrayLength(); + }, + set: function set(newLength) { + this.$mobx.setArrayLength(newLength); + } + }); + ["every", "filter", "forEach", "indexOf", "join", "lastIndexOf", "map", "reduce", "reduceRight", "slice", "some"].forEach(function (funcName) { + var baseFunc = Array.prototype[funcName]; + invariant(typeof baseFunc === "function", "Base function not defined on Array prototype: '" + funcName + "'"); + addHiddenProp(ObservableArray.prototype, funcName, function () { + this.$mobx.atom.reportObserved(); + return baseFunc.apply(this.$mobx.values, arguments); + }); + }); + var ENTRY_0 = { + configurable: true, + enumerable: false, + set: createArraySetter(0), + get: createArrayGetter(0) + }; + + function createArrayBufferItem(index) { + var set = createArraySetter(index); + var get = createArrayGetter(index); + Object.defineProperty(ObservableArray.prototype, "" + index, { + enumerable: false, + configurable: true, + set: set, + get: get + }); + } + + function createArraySetter(index) { + return function (newValue) { + var adm = this.$mobx; + var values = adm.values; + if (index < values.length) { + checkIfStateModificationsAreAllowed(adm.atom); + var oldValue = values[index]; + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + type: "update", + object: adm.array, + index: index, + newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + newValue = adm.enhancer(newValue, oldValue); + var changed = newValue !== oldValue; + if (changed) { + values[index] = newValue; + adm.notifyArrayChildUpdate(index, newValue, oldValue); + } + } else if (index === values.length) { + adm.spliceWithArray(index, 0, [newValue]); + } else throw new Error("[mobx.array] Index out of bounds, " + index + " is larger than " + values.length); + }; + } + + function createArrayGetter(index) { + return function () { + var impl = this.$mobx; + if (impl) { + if (index < impl.values.length) { + impl.atom.reportObserved(); + return impl.values[index]; + } + console.warn("[mobx.array] Attempt to read an array index (" + index + ") that is out of bounds (" + impl.values.length + "). Please check length first. Out of bound indices will not be tracked by MobX"); + } + return undefined; + }; + } + + function reserveArrayBuffer(max) { + for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max; index++) { + createArrayBufferItem(index); + } + OBSERVABLE_ARRAY_BUFFER_SIZE = max; + } + reserveArrayBuffer(1000); + var isObservableArrayAdministration = createInstanceofPredicate("ObservableArrayAdministration", ObservableArrayAdministration); + + function isObservableArray(thing) { + return isObject(thing) && isObservableArrayAdministration(thing.$mobx); + } + exports.isObservableArray = isObservableArray; + var ObservableMapMarker = {}; + var ObservableMap = function () { + function ObservableMap(initialData, enhancer, name) { + if (enhancer === void 0) { + enhancer = deepEnhancer; + } + if (name === void 0) { + name = "ObservableMap@" + getNextId(); + } + this.enhancer = enhancer; + this.name = name; + this.$mobx = ObservableMapMarker; + this._data = {}; + this._hasMap = {}; + this._keys = new ObservableArray(undefined, referenceEnhancer, this.name + ".keys()", true); + this.interceptors = null; + this.changeListeners = null; + this.merge(initialData); + } + ObservableMap.prototype._has = function (key) { + return typeof this._data[key] !== "undefined"; + }; + ObservableMap.prototype.has = function (key) { + if (!this.isValidKey(key)) return false; + key = "" + key; + if (this._hasMap[key]) return this._hasMap[key].get(); + return this._updateHasMapEntry(key, false).get(); + }; + ObservableMap.prototype.set = function (key, value) { + this.assertValidKey(key); + key = "" + key; + var hasKey = this._has(key); + if (hasInterceptors(this)) { + var change = interceptChange(this, { + type: hasKey ? "update" : "add", + object: this, + newValue: value, + name: key + }); + if (!change) return this; + value = change.newValue; + } + if (hasKey) { + this._updateValue(key, value); + } else { + this._addValue(key, value); + } + return this; + }; + ObservableMap.prototype.delete = function (key) { + var _this = this; + this.assertValidKey(key); + key = "" + key; + if (hasInterceptors(this)) { + var change = interceptChange(this, { + type: "delete", + object: this, + name: key + }); + if (!change) return false; + } + if (this._has(key)) { + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "delete", + object: this, + oldValue: this._data[key].value, + name: key + } : null; + if (notifySpy) spyReportStart(change); + runInTransaction(function () { + _this._keys.remove(key); + _this._updateHasMapEntry(key, false); + var observable = _this._data[key]; + observable.setNewValue(undefined); + _this._data[key] = undefined; + }); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + return true; + } + return false; + }; + ObservableMap.prototype._updateHasMapEntry = function (key, value) { + var entry = this._hasMap[key]; + if (entry) { + entry.setNewValue(value); + } else { + entry = this._hasMap[key] = new ObservableValue(value, referenceEnhancer, this.name + "." + key + "?", false); + } + return entry; + }; + ObservableMap.prototype._updateValue = function (name, newValue) { + var observable = this._data[name]; + newValue = observable.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "update", + object: this, + oldValue: observable.value, + name: name, + newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + observable.setNewValue(newValue); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + } + }; + ObservableMap.prototype._addValue = function (name, newValue) { + var _this = this; + runInTransaction(function () { + var observable = _this._data[name] = new ObservableValue(newValue, _this.enhancer, _this.name + "." + name, false); + newValue = observable.value; + _this._updateHasMapEntry(name, true); + _this._keys.push(name); + }); + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "add", + object: this, + name: name, + newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + ObservableMap.prototype.get = function (key) { + key = "" + key; + if (this.has(key)) return this._data[key].get(); + return undefined; + }; + ObservableMap.prototype.keys = function () { + return arrayAsIterator(this._keys.slice()); + }; + ObservableMap.prototype.values = function () { + return arrayAsIterator(this._keys.map(this.get, this)); + }; + ObservableMap.prototype.entries = function () { + var _this = this; + return arrayAsIterator(this._keys.map(function (key) { + return [key, _this.get(key)]; + })); + }; + ObservableMap.prototype.forEach = function (callback, thisArg) { + var _this = this; + this.keys().forEach(function (key) { + return callback.call(thisArg, _this.get(key), key, _this); + }); + }; + ObservableMap.prototype.merge = function (other) { + var _this = this; + if (isObservableMap(other)) { + other = other.toJS(); + } + runInTransaction(function () { + if (isPlainObject(other)) Object.keys(other).forEach(function (key) { + return _this.set(key, other[key]); + }); + else if (Array.isArray(other)) other.forEach(function (_a) { + var key = _a[0], + value = _a[1]; + return _this.set(key, value); + }); + else if (isES6Map(other)) other.forEach(function (value, key) { + return _this.set(key, value); + }); + else if (other !== null && other !== undefined) fail("Cannot initialize map from " + other); + }); + return this; + }; + ObservableMap.prototype.clear = function () { + var _this = this; + runInTransaction(function () { + untracked(function () { + _this.keys().forEach(_this.delete, _this); + }); + }); + }; + ObservableMap.prototype.replace = function (values) { + var _this = this; + runInTransaction(function () { + _this.clear(); + _this.merge(values); + }); + return this; + }; + Object.defineProperty(ObservableMap.prototype, "size", { + get: function get() { + return this._keys.length; + }, + enumerable: true, + configurable: true + }); + ObservableMap.prototype.toJS = function () { + var _this = this; + var res = {}; + this.keys().forEach(function (key) { + return res[key] = _this.get(key); + }); + return res; + }; + ObservableMap.prototype.toJSON = function () { + return this.toJS(); + }; + ObservableMap.prototype.isValidKey = function (key) { + if (key === null || key === undefined) return false; + if (typeof key === "string" || typeof key === "number" || typeof key === "boolean") return true; + return false; + }; + ObservableMap.prototype.assertValidKey = function (key) { + if (!this.isValidKey(key)) throw new Error("[mobx.map] Invalid key: '" + key + "', only strings, numbers and booleans are accepted as key in observable maps."); + }; + ObservableMap.prototype.toString = function () { + var _this = this; + return this.name + "[{ " + this.keys().map(function (key) { + return key + ": " + ("" + _this.get(key)); + }).join(", ") + " }]"; + }; + ObservableMap.prototype.observe = function (listener, fireImmediately) { + invariant(fireImmediately !== true, getMessage("m033")); + return registerListener(this, listener); + }; + ObservableMap.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + return ObservableMap; + }(); + exports.ObservableMap = ObservableMap; + declareIterator(ObservableMap.prototype, function () { + return this.entries(); + }); + + function map(initialValues) { + deprecated("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"); + return observable.map(initialValues); + } + exports.map = map; + var isObservableMap = createInstanceofPredicate("ObservableMap", ObservableMap); + exports.isObservableMap = isObservableMap; + var ObservableObjectAdministration = function () { + function ObservableObjectAdministration(target, name) { + this.target = target; + this.name = name; + this.values = {}; + this.changeListeners = null; + this.interceptors = null; + } + ObservableObjectAdministration.prototype.observe = function (callback, fireImmediately) { + invariant(fireImmediately !== true, "`observe` doesn't support the fire immediately property for observable objects."); + return registerListener(this, callback); + }; + ObservableObjectAdministration.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + return ObservableObjectAdministration; + }(); + + function asObservableObject(target, name) { + if (isObservableObject(target)) return target.$mobx; + invariant(Object.isExtensible(target), getMessage("m035")); + if (!isPlainObject(target)) name = (target.constructor.name || "ObservableObject") + "@" + getNextId(); + if (!name) name = "ObservableObject@" + getNextId(); + var adm = new ObservableObjectAdministration(target, name); + addHiddenFinalProp(target, "$mobx", adm); + return adm; + } + + function defineObservablePropertyFromDescriptor(adm, propName, descriptor, defaultEnhancer) { + if (adm.values[propName]) { + invariant("value" in descriptor, "The property " + propName + " in " + adm.name + " is already observable, cannot redefine it as computed property"); + adm.target[propName] = descriptor.value; + return; + } + if ("value" in descriptor) { + if (isModifierDescriptor(descriptor.value)) { + var modifierDescriptor = descriptor.value; + defineObservableProperty(adm, propName, modifierDescriptor.initialValue, modifierDescriptor.enhancer); + } else if (isAction(descriptor.value) && descriptor.value.autoBind === true) { + defineBoundAction(adm.target, propName, descriptor.value.originalFn); + } else if (isComputedValue(descriptor.value)) { + defineComputedPropertyFromComputedValue(adm, propName, descriptor.value); + } else { + defineObservableProperty(adm, propName, descriptor.value, defaultEnhancer); + } + } else { + defineComputedProperty(adm, propName, descriptor.get, descriptor.set, false, true); + } + } + + function defineObservableProperty(adm, propName, newValue, enhancer) { + assertPropertyConfigurable(adm.target, propName); + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + object: adm.target, + name: propName, + type: "add", + newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + var observable = adm.values[propName] = new ObservableValue(newValue, enhancer, adm.name + "." + propName, false); + newValue = observable.value; + Object.defineProperty(adm.target, propName, generateObservablePropConfig(propName)); + notifyPropertyAddition(adm, adm.target, propName, newValue); + } + + function defineComputedProperty(adm, propName, getter, setter, compareStructural, asInstanceProperty) { + if (asInstanceProperty) assertPropertyConfigurable(adm.target, propName); + adm.values[propName] = new ComputedValue(getter, adm.target, compareStructural, adm.name + "." + propName, setter); + if (asInstanceProperty) { + Object.defineProperty(adm.target, propName, generateComputedPropConfig(propName)); + } + } + + function defineComputedPropertyFromComputedValue(adm, propName, computedValue) { + var name = adm.name + "." + propName; + computedValue.name = name; + if (!computedValue.scope) computedValue.scope = adm.target; + adm.values[propName] = computedValue; + Object.defineProperty(adm.target, propName, generateComputedPropConfig(propName)); + } + var observablePropertyConfigs = {}; + var computedPropertyConfigs = {}; + + function generateObservablePropConfig(propName) { + return observablePropertyConfigs[propName] || (observablePropertyConfigs[propName] = { + configurable: true, + enumerable: true, + get: function get() { + return this.$mobx.values[propName].get(); + }, + set: function set(v) { + setPropertyValue(this, propName, v); + } + }); + } + + function generateComputedPropConfig(propName) { + return computedPropertyConfigs[propName] || (computedPropertyConfigs[propName] = { + configurable: true, + enumerable: false, + get: function get() { + return this.$mobx.values[propName].get(); + }, + set: function set(v) { + return this.$mobx.values[propName].set(v); + } + }); + } + + function setPropertyValue(instance, name, newValue) { + var adm = instance.$mobx; + var observable = adm.values[name]; + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + type: "update", + object: instance, + name: name, + newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + newValue = observable.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notify = hasListeners(adm); + var notifySpy = isSpyEnabled(); + var change = notify || notifySpy ? { + type: "update", + object: instance, + oldValue: observable.value, + name: name, + newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + observable.setNewValue(newValue); + if (notify) notifyListeners(adm, change); + if (notifySpy) spyReportEnd(); + } + } + + function notifyPropertyAddition(adm, object, name, newValue) { + var notify = hasListeners(adm); + var notifySpy = isSpyEnabled(); + var change = notify || notifySpy ? { + type: "add", + object: object, + name: name, + newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + if (notify) notifyListeners(adm, change); + if (notifySpy) spyReportEnd(); + } + var isObservableObjectAdministration = createInstanceofPredicate("ObservableObjectAdministration", ObservableObjectAdministration); + + function isObservableObject(thing) { + if (isObject(thing)) { + runLazyInitializers(thing); + return isObservableObjectAdministration(thing.$mobx); + } + return false; + } + exports.isObservableObject = isObservableObject; + var UNCHANGED = {}; + var ObservableValue = function (_super) { + __extends(ObservableValue, _super); + + function ObservableValue(value, enhancer, name, notifySpy) { + if (name === void 0) { + name = "ObservableValue@" + getNextId(); + } + if (notifySpy === void 0) { + notifySpy = true; + } + var _this = _super.call(this, name) || this; + _this.enhancer = enhancer; + _this.hasUnreportedChange = false; + _this.value = enhancer(value, undefined, name); + if (notifySpy && isSpyEnabled()) { + spyReport({ + type: "create", + object: _this, + newValue: _this.value + }); + } + return _this; + } + ObservableValue.prototype.set = function (newValue) { + var oldValue = this.value; + newValue = this.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notifySpy = isSpyEnabled(); + if (notifySpy) { + spyReportStart({ + type: "update", + object: this, + newValue: newValue, + oldValue: oldValue + }); + } + this.setNewValue(newValue); + if (notifySpy) spyReportEnd(); + } + }; + ObservableValue.prototype.prepareNewValue = function (newValue) { + checkIfStateModificationsAreAllowed(this); + if (hasInterceptors(this)) { + var change = interceptChange(this, { + object: this, + type: "update", + newValue: newValue + }); + if (!change) return UNCHANGED; + newValue = change.newValue; + } + newValue = this.enhancer(newValue, this.value, this.name); + return this.value !== newValue ? newValue : UNCHANGED; + }; + ObservableValue.prototype.setNewValue = function (newValue) { + var oldValue = this.value; + this.value = newValue; + this.reportChanged(); + if (hasListeners(this)) { + notifyListeners(this, { + type: "update", + object: this, + newValue: newValue, + oldValue: oldValue + }); + } + }; + ObservableValue.prototype.get = function () { + this.reportObserved(); + return this.value; + }; + ObservableValue.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + ObservableValue.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately) listener({ + object: this, + type: "update", + newValue: this.value, + oldValue: undefined + }); + return registerListener(this, listener); + }; + ObservableValue.prototype.toJSON = function () { + return this.get(); + }; + ObservableValue.prototype.toString = function () { + return this.name + "[" + this.value + "]"; + }; + ObservableValue.prototype.valueOf = function () { + return toPrimitive(this.get()); + }; + return ObservableValue; + }(BaseAtom); + ObservableValue.prototype[primitiveSymbol()] = ObservableValue.prototype.valueOf; + var isObservableValue = createInstanceofPredicate("ObservableValue", ObservableValue); + exports.isBoxedObservable = isObservableValue; + + function getAtom(thing, property) { + if ((typeof thing === "undefined" ? "undefined" : _typeof(thing)) === "object" && thing !== null) { + if (isObservableArray(thing)) { + invariant(property === undefined, getMessage("m036")); + return thing.$mobx.atom; + } + if (isObservableMap(thing)) { + var anyThing = thing; + if (property === undefined) return getAtom(anyThing._keys); + var observable_2 = anyThing._data[property] || anyThing._hasMap[property]; + invariant(!!observable_2, "the entry '" + property + "' does not exist in the observable map '" + getDebugName(thing) + "'"); + return observable_2; + } + runLazyInitializers(thing); + if (isObservableObject(thing)) { + if (!property) return fail("please specify a property"); + var observable_3 = thing.$mobx.values[property]; + invariant(!!observable_3, "no observable property '" + property + "' found on the observable object '" + getDebugName(thing) + "'"); + return observable_3; + } + if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) { + return thing; + } + } else if (typeof thing === "function") { + if (isReaction(thing.$mobx)) { + return thing.$mobx; + } + } + return fail("Cannot obtain atom from " + thing); + } + + function getAdministration(thing, property) { + invariant(thing, "Expecting some object"); + if (property !== undefined) return getAdministration(getAtom(thing, property)); + if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) return thing; + if (isObservableMap(thing)) return thing; + runLazyInitializers(thing); + if (thing.$mobx) return thing.$mobx; + invariant(false, "Cannot obtain administration from " + thing); + } + + function getDebugName(thing, property) { + var named; + if (property !== undefined) named = getAtom(thing, property); + else if (isObservableObject(thing) || isObservableMap(thing)) named = getAdministration(thing); + else named = getAtom(thing); + return named.name; + } + + function createClassPropertyDecorator(onInitialize, _get, _set, enumerable, allowCustomArguments) { + function classPropertyDecorator(target, key, descriptor, customArgs, argLen) { + if (argLen === void 0) { + argLen = 0; + } + invariant(allowCustomArguments || quacksLikeADecorator(arguments), "This function is a decorator, but it wasn't invoked like a decorator"); + if (!descriptor) { + var newDescriptor = { + enumerable: enumerable, + configurable: true, + get: function get() { + if (!this.__mobxInitializedProps || this.__mobxInitializedProps[key] !== true) typescriptInitializeProperty(this, key, undefined, onInitialize, customArgs, descriptor); + return _get.call(this, key); + }, + set: function set(v) { + if (!this.__mobxInitializedProps || this.__mobxInitializedProps[key] !== true) { + typescriptInitializeProperty(this, key, v, onInitialize, customArgs, descriptor); + } else { + _set.call(this, key, v); + } + } + }; + if (arguments.length < 3 || arguments.length === 5 && argLen < 3) { + Object.defineProperty(target, key, newDescriptor); + } + return newDescriptor; + } else { + if (!hasOwnProperty(target, "__mobxLazyInitializers")) { + addHiddenProp(target, "__mobxLazyInitializers", target.__mobxLazyInitializers && target.__mobxLazyInitializers.slice() || []); + } + var value_1 = descriptor.value, + initializer_1 = descriptor.initializer; + target.__mobxLazyInitializers.push(function (instance) { + onInitialize(instance, key, initializer_1 ? initializer_1.call(instance) : value_1, customArgs, descriptor); + }); + return { + enumerable: enumerable, + configurable: true, + get: function get() { + if (this.__mobxDidRunLazyInitializers !== true) runLazyInitializers(this); + return _get.call(this, key); + }, + set: function set(v) { + if (this.__mobxDidRunLazyInitializers !== true) runLazyInitializers(this); + _set.call(this, key, v); + } + }; + } + } + if (allowCustomArguments) { + return function () { + if (quacksLikeADecorator(arguments)) return classPropertyDecorator.apply(null, arguments); + var outerArgs = arguments; + var argLen = arguments.length; + return function (target, key, descriptor) { + return classPropertyDecorator(target, key, descriptor, outerArgs, argLen); + }; + }; + } + return classPropertyDecorator; + } + + function typescriptInitializeProperty(instance, key, v, onInitialize, customArgs, baseDescriptor) { + if (!hasOwnProperty(instance, "__mobxInitializedProps")) addHiddenProp(instance, "__mobxInitializedProps", {}); + instance.__mobxInitializedProps[key] = true; + onInitialize(instance, key, v, customArgs, baseDescriptor); + } + + function runLazyInitializers(instance) { + if (instance.__mobxDidRunLazyInitializers === true) return; + if (instance.__mobxLazyInitializers) { + addHiddenProp(instance, "__mobxDidRunLazyInitializers", true); + instance.__mobxDidRunLazyInitializers && instance.__mobxLazyInitializers.forEach(function (initializer) { + return initializer(instance); + }); + } + } + + function quacksLikeADecorator(args) { + return (args.length === 2 || args.length === 3) && typeof args[1] === "string"; + } + + function iteratorSymbol() { + return typeof Symbol === "function" && Symbol.iterator || "@@iterator"; + } + var IS_ITERATING_MARKER = "__$$iterating"; + + function arrayAsIterator(array) { + invariant(array[IS_ITERATING_MARKER] !== true, "Illegal state: cannot recycle array as iterator"); + addHiddenFinalProp(array, IS_ITERATING_MARKER, true); + var idx = -1; + addHiddenFinalProp(array, "next", function next() { + idx++; + return { + done: idx >= this.length, + value: idx < this.length ? this[idx] : undefined + }; + }); + return array; + } + + function declareIterator(prototType, iteratorFactory) { + addHiddenFinalProp(prototType, iteratorSymbol(), iteratorFactory); + } + var messages = { + "m001": "It is not allowed to assign new values to @action fields", + "m002": "`runInAction` expects a function", + "m003": "`runInAction` expects a function without arguments", + "m004": "autorun expects a function", + "m005": "Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.", + "m006": "Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.", + "m007": "reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object", + "m008": "wrapping reaction expression in `asReference` is no longer supported, use options object instead", + "m009": "@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.", + "m010": "@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'", + "m011": "First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments", + "m012": "computed takes one or two arguments if used as function", + "m013": "[mobx.expr] 'expr' should only be used inside other reactive functions.", + "m014": "extendObservable expected 2 or more arguments", + "m015": "extendObservable expects an object as first argument", + "m016": "extendObservable should not be used on maps, use map.merge instead", + "m017": "all arguments of extendObservable should be objects", + "m018": "extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540", + "m019": "[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.", + "m020": "modifiers can only be used for individual object properties", + "m021": "observable expects zero or one arguments", + "m022": "@observable can not be used on getters, use @computed instead", + "m023": "Using `transaction` is deprecated, use `runInAction` or `(@)action` instead.", + "m024": "whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested its value.", + "m025": "whyRun can only be used on reactions and computed values", + "m026": "`action` can only be invoked on functions", + "m028": "It is not allowed to set `useStrict` when a derivation is running", + "m029": "INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row", + "m030a": "Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ", + "m030b": "Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ", + "m031": "Computed values are not allowed to not cause side effects by changing observables that are already being observed. Tried to modify: ", + "m032": "* This computation is suspended (not in use by any reaction) and won't run automatically.\n Didn't expect this computation to be suspended at this point?\n 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).", + "m033": "`observe` doesn't support the fire immediately property for observable maps.", + "m034": "`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead", + "m035": "Cannot make the designated object observable; it is not extensible", + "m036": "It is not possible to get index atoms from arrays", + "m037": "Hi there! I'm sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle \"(...)\" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error(\"Oops\")` instead of `throw \"Oops\"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling \"Pause on caught exception\".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn't help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n", + "m038": "Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n" + }; + + function getMessage(id) { + return messages[id]; + } + var EMPTY_ARRAY = []; + Object.freeze(EMPTY_ARRAY); + + function getGlobal() { + return global; + } + + function getNextId() { + return ++globalState.mobxGuid; + } + + function fail(message, thing) { + invariant(false, message, thing); + throw "X"; + } + + function invariant(check, message, thing) { + if (!check) throw new Error("[mobx] Invariant failed: " + message + (thing ? " in '" + thing + "'" : "")); + } + var deprecatedMessages = []; + + function deprecated(msg) { + if (deprecatedMessages.indexOf(msg) !== -1) return false; + deprecatedMessages.push(msg); + console.error("[mobx] Deprecated: " + msg); + return true; + } + + function once(func) { + var invoked = false; + return function () { + if (invoked) return; + invoked = true; + return func.apply(this, arguments); + }; + } + var noop = function noop() {}; + + function unique(list) { + var res = []; + list.forEach(function (item) { + if (res.indexOf(item) === -1) res.push(item); + }); + return res; + } + + function joinStrings(things, limit, separator) { + if (limit === void 0) { + limit = 100; + } + if (separator === void 0) { + separator = " - "; + } + if (!things) return ""; + var sliced = things.slice(0, limit); + return "" + sliced.join(separator) + (things.length > limit ? " (... and " + (things.length - limit) + "more)" : ""); + } + + function isObject(value) { + return value !== null && (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object"; + } + + function isPlainObject(value) { + if (value === null || (typeof value === "undefined" ? "undefined" : _typeof(value)) !== "object") return false; + var proto = Object.getPrototypeOf(value); + return proto === Object.prototype || proto === null; + } + + function objectAssign() { + var res = arguments[0]; + for (var i = 1, l = arguments.length; i < l; i++) { + var source = arguments[i]; + for (var key in source) { + if (hasOwnProperty(source, key)) { + res[key] = source[key]; + } + } + } + return res; + } + + function valueDidChange(compareStructural, oldValue, newValue) { + if (typeof oldValue === 'number' && isNaN(oldValue)) { + return typeof newValue !== 'number' || !isNaN(newValue); + } + return compareStructural ? !deepEqual(oldValue, newValue) : oldValue !== newValue; + } + var prototypeHasOwnProperty = Object.prototype.hasOwnProperty; + + function hasOwnProperty(object, propName) { + return prototypeHasOwnProperty.call(object, propName); + } + + function makeNonEnumerable(object, propNames) { + for (var i = 0; i < propNames.length; i++) { + addHiddenProp(object, propNames[i], object[propNames[i]]); + } + } + + function addHiddenProp(object, propName, value) { + Object.defineProperty(object, propName, { + enumerable: false, + writable: true, + configurable: true, + value: value + }); + } + + function addHiddenFinalProp(object, propName, value) { + Object.defineProperty(object, propName, { + enumerable: false, + writable: false, + configurable: true, + value: value + }); + } + + function isPropertyConfigurable(object, prop) { + var descriptor = Object.getOwnPropertyDescriptor(object, prop); + return !descriptor || descriptor.configurable !== false && descriptor.writable !== false; + } + + function assertPropertyConfigurable(object, prop) { + invariant(isPropertyConfigurable(object, prop), "Cannot make property '" + prop + "' observable, it is not configurable and writable in the target object"); + } + + function getEnumerableKeys(obj) { + var res = []; + for (var key in obj) { + res.push(key); + } + return res; + } + + function deepEqual(a, b) { + if (a === null && b === null) return true; + if (a === undefined && b === undefined) return true; + if ((typeof a === "undefined" ? "undefined" : _typeof(a)) !== "object") return a === b; + var aIsArray = isArrayLike(a); + var aIsMap = isMapLike(a); + if (aIsArray !== isArrayLike(b)) { + return false; + } else if (aIsMap !== isMapLike(b)) { + return false; + } else if (aIsArray) { + if (a.length !== b.length) return false; + for (var i = a.length - 1; i >= 0; i--) { + if (!deepEqual(a[i], b[i])) return false; + } + return true; + } else if (aIsMap) { + if (a.size !== b.size) return false; + var equals_1 = true; + a.forEach(function (value, key) { + equals_1 = equals_1 && deepEqual(b.get(key), value); + }); + return equals_1; + } else if ((typeof a === "undefined" ? "undefined" : _typeof(a)) === "object" && (typeof b === "undefined" ? "undefined" : _typeof(b)) === "object") { + if (a === null || b === null) return false; + if (isMapLike(a) && isMapLike(b)) { + if (a.size !== b.size) return false; + return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries()); + } + if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length) return false; + for (var prop in a) { + if (!(prop in b)) return false; + if (!deepEqual(a[prop], b[prop])) return false; + } + return true; + } + return false; + } + + function createInstanceofPredicate(name, clazz) { + var propName = "isMobX" + name; + clazz.prototype[propName] = true; + return function (x) { + return isObject(x) && x[propName] === true; + }; + } + + function isArrayLike(x) { + return Array.isArray(x) || isObservableArray(x); + } + exports.isArrayLike = isArrayLike; + + function isMapLike(x) { + return isES6Map(x) || isObservableMap(x); + } + + function isES6Map(thing) { + if (getGlobal().Map !== undefined && thing instanceof getGlobal().Map) return true; + return false; + } + + function primitiveSymbol() { + return typeof Symbol === "function" && Symbol.toPrimitive || "@@toPrimitive"; + } + + function toPrimitive(value) { + return value === null ? null : (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object" ? "" + value : value; + } + /* WEBPACK VAR INJECTION */ + }.call(exports, __webpack_require__(4))) + + /***/ + }), + /* 2 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; + }(); + + var _icons = __webpack_require__(6); + + var _constants = __webpack_require__(0); + + function renderHeader(_ref, instance) { + var meta = _ref.meta, + user = _ref.user, + reactions = _ref.reactions; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-header-container'; + + var likeButton = document.createElement('span'); + var likedReaction = reactions.find(function (reaction) { + return reaction.content === 'heart' && reaction.user.login === user.login; + }); + likeButton.className = 'gitment-header-like-btn'; + likeButton.innerHTML = '\n ' + _icons.heart + '\n ' + (likedReaction ? '取消喜欢' : '喜欢') + '\n ' + (meta.reactions && meta.reactions.heart ? ' \u2022 ' + meta.reactions.heart + ' 人喜欢' : '') + '\n '; + + if (likedReaction) { + likeButton.classList.add('liked'); + likeButton.onclick = function () { + return instance.unlike(); + }; + } else { + likeButton.classList.remove('liked'); + likeButton.onclick = function () { + return instance.like(); + }; + } + container.appendChild(likeButton); + + var commentsCount = document.createElement('span'); + commentsCount.innerHTML = '\n ' + (meta.comments ? ' \u2022 ' + meta.comments + ' 条评论' : '') + '\n '; + container.appendChild(commentsCount); + + var issueLink = document.createElement('a'); + issueLink.className = 'gitment-header-issue-link'; + console.log("meta.html_url:" + meta.html_url); + issueLink.href = meta.html_url; + issueLink.target = '_blank'; + issueLink.innerText = 'Issue Page'; + container.appendChild(issueLink); + + return container; + } + + function renderComments(_ref2, instance) { + var meta = _ref2.meta, + comments = _ref2.comments, + commentReactions = _ref2.commentReactions, + currentPage = _ref2.currentPage, + user = _ref2.user, + error = _ref2.error; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-comments-container'; + + if (error) { + var errorBlock = document.createElement('div'); + errorBlock.className = 'gitment-comments-error'; + + if (error === _constants.NOT_INITIALIZED_ERROR && user.login && user.login.toLowerCase() === instance.owner.toLowerCase()) { + var initHint = document.createElement('div'); + var initButton = document.createElement('button'); + initButton.className = 'gitment-comments-init-btn'; + initButton.onclick = function () { + initButton.setAttribute('disabled', true); + instance.init().catch(function (e) { + initButton.removeAttribute('disabled'); + alert(e); + }); + }; + initButton.innerText = '初始化评论'; + initHint.appendChild(initButton); + errorBlock.appendChild(initHint); + } else { + errorBlock.innerText = error; + } + container.appendChild(errorBlock); + return container; + } else if (comments === undefined) { + var loading = document.createElement('div'); + loading.innerText = '评论加载中...'; + loading.className = 'gitment-comments-loading'; + container.appendChild(loading); + return container; + } else if (!comments.length) { + var emptyBlock = document.createElement('div'); + emptyBlock.className = 'gitment-comments-empty'; + emptyBlock.innerText = '暂无评论,来过就留点痕迹吧'; + container.appendChild(emptyBlock); + return container; + } + + var commentsList = document.createElement('ul'); + commentsList.className = 'gitment-comments-list'; + + comments.forEach(function (comment) { + var createDate = new Date(comment.created_at); + var updateDate = new Date(comment.updated_at); + var commentItem = document.createElement('li'); + commentItem.className = 'gitment-comment'; + commentItem.innerHTML = '\n \n \n \n
    \n
    \n \n ' + comment.user.login + '\n \n 评论于\n ' + createDate.toDateString() + '\n ' + (createDate.toString() !== updateDate.toString() ? ' \u2022 已编辑' : '') + '\n
    ' + _icons.heart + ' ' + (comment.reactions.heart || '') + '
    \n
    \n
    ' + comment.body_html + '
    \n
    \n '; + var likeButton = commentItem.querySelector('.gitment-comment-like-btn'); + var likedReaction = commentReactions[comment.id] && commentReactions[comment.id].find(function (reaction) { + return reaction.content === 'heart' && reaction.user.login === user.login; + }); + if (likedReaction) { + likeButton.classList.add('liked'); + likeButton.onclick = function () { + return instance.unlikeAComment(comment.id); + }; + } else { + likeButton.classList.remove('liked'); + likeButton.onclick = function () { + return instance.likeAComment(comment.id); + }; + } + + // dirty + // use a blank image to trigger height calculating when element rendered + var imgTrigger = document.createElement('img'); + var markdownBody = commentItem.querySelector('.gitment-comment-body'); + imgTrigger.className = 'gitment-hidden'; + imgTrigger.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + imgTrigger.onload = function () { + if (markdownBody.clientHeight > instance.maxCommentHeight) { + markdownBody.classList.add('gitment-comment-body-folded'); + markdownBody.style.maxHeight = instance.maxCommentHeight + 'px'; + markdownBody.title = '点击展开'; + markdownBody.onclick = function () { + markdownBody.classList.remove('gitment-comment-body-folded'); + markdownBody.style.maxHeight = ''; + markdownBody.title = ''; + markdownBody.onclick = null; + }; + } + }; + commentItem.appendChild(imgTrigger); + + commentsList.appendChild(commentItem); + }); + + container.appendChild(commentsList); + + if (meta) { + var pageCount = Math.ceil(meta.comments / instance.perPage); + if (pageCount > 1) { + var pagination = document.createElement('ul'); + pagination.className = 'gitment-comments-pagination'; + + if (currentPage > 1) { + var previousButton = document.createElement('li'); + previousButton.className = 'gitment-comments-page-item'; + previousButton.innerText = 'Previous'; + previousButton.onclick = function () { + return instance.goto(currentPage - 1); + }; + pagination.appendChild(previousButton); + } + + var _loop = function _loop(i) { + var pageItem = document.createElement('li'); + pageItem.className = 'gitment-comments-page-item'; + pageItem.innerText = i; + pageItem.onclick = function () { + return instance.goto(i); + }; + if (currentPage === i) pageItem.classList.add('gitment-selected'); + pagination.appendChild(pageItem); + }; + + for (var i = 1; i <= pageCount; i++) { + _loop(i); + } + + if (currentPage < pageCount) { + var nextButton = document.createElement('li'); + nextButton.className = 'gitment-comments-page-item'; + nextButton.innerText = 'Next'; + nextButton.onclick = function () { + return instance.goto(currentPage + 1); + }; + pagination.appendChild(nextButton); + } + + container.appendChild(pagination); + } + } + + return container; + } + + function renderEditor(_ref3, instance) { + var user = _ref3.user, + error = _ref3.error; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-editor-container'; + + var shouldDisable = user.login && !error ? '' : 'disabled'; + var disabledTip = user.login ? '' : '登录即可评论'; + container.innerHTML = '\n ' + (user.login ? '\n \n ' : user.isLoggingIn ? '
    ' + _icons.spinner + '
    ' : '\n ' + _icons.github + '\n ') + '\n \n
    \n
    \n \n \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n \n '; + if (user.login) { + container.querySelector('.gitment-editor-logout-link').onclick = function () { + return instance.logout(); + }; + } + + var writeField = container.querySelector('.gitment-editor-write-field'); + var previewField = container.querySelector('.gitment-editor-preview-field'); + + var textarea = writeField.querySelector('textarea'); + textarea.oninput = function () { + textarea.style.height = 'auto'; + var style = window.getComputedStyle(textarea, null); + var height = parseInt(style.height, 10); + var clientHeight = textarea.clientHeight; + var scrollHeight = textarea.scrollHeight; + if (clientHeight < scrollHeight) { + textarea.style.height = height + scrollHeight - clientHeight + 'px'; + } + }; + + var _container$querySelec = container.querySelectorAll('.gitment-editor-tab'), + _container$querySelec2 = _slicedToArray(_container$querySelec, 2), + writeTab = _container$querySelec2[0], + previewTab = _container$querySelec2[1]; + + writeTab.onclick = function () { + writeTab.classList.add('gitment-selected'); + previewTab.classList.remove('gitment-selected'); + writeField.classList.remove('gitment-hidden'); + previewField.classList.add('gitment-hidden'); + + textarea.focus(); + }; + previewTab.onclick = function () { + previewTab.classList.add('gitment-selected'); + writeTab.classList.remove('gitment-selected'); + previewField.classList.remove('gitment-hidden'); + writeField.classList.add('gitment-hidden'); + + var preview = previewField.querySelector('.gitment-editor-preview'); + var content = textarea.value.trim(); + if (!content) { + preview.innerText = '无可预览内容'; + return; + } + + preview.innerText = '加载预览中...'; + instance.markdown(content).then(function (html) { + return preview.innerHTML = html; + }); + }; + + var submitButton = container.querySelector('.gitment-editor-submit'); + submitButton.onclick = function () { + submitButton.innerText = '评论正在上传...'; + submitButton.setAttribute('disabled', true); + instance.post(textarea.value.trim()).then(function (data) { + textarea.value = ''; + textarea.style.height = 'auto'; + submitButton.removeAttribute('disabled'); + submitButton.innerText = '发表评论'; + }).catch(function (e) { + alert(e); + submitButton.removeAttribute('disabled'); + submitButton.innerText = '发表评论'; + }); + }; + + return container; + } + + function renderFooter() { + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-footer-container'; + //container.innerHTML = '\n 由\n \n Gitment\n 强力驱动\n · 码农BTS 汉化 '; + return container; + } + + function render(state, instance) { + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-root-container'; + container.appendChild(instance.renderHeader(state, instance)); + container.appendChild(instance.renderComments(state, instance)); + container.appendChild(instance.renderEditor(state, instance)); + container.appendChild(instance.renderFooter(state, instance)); + return container; + } + + exports.default = { + render: render, + renderHeader: renderHeader, + renderComments: renderComments, + renderEditor: renderEditor, + renderFooter: renderFooter + }; + + /***/ + }), + /* 3 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.http = exports.Query = exports.isString = undefined; + + var _slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + return _arr; + } + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; + }(); + + exports.getTargetContainer = getTargetContainer; + + var _constants = __webpack_require__(0); + + var isString = exports.isString = function isString(s) { + return toString.call(s) === '[object String]'; + }; + + function getTargetContainer(container) { + var targetContainer = void 0; + if (container instanceof Element) { + targetContainer = container; + } else if (isString(container)) { + targetContainer = document.getElementById(container); + } else { + targetContainer = document.createElement('div'); + } + + return targetContainer; + } + + var Query = exports.Query = { + parse: function parse() { + var search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.search; + + if (!search) return {}; + var queryString = search[0] === '?' ? search.substring(1) : search; + var query = {}; + queryString.split('&').forEach(function (queryStr) { + var _queryStr$split = queryStr.split('='), + _queryStr$split2 = _slicedToArray(_queryStr$split, 2), + key = _queryStr$split2[0], + value = _queryStr$split2[1]; + + if (key) query[key] = value; + }); + + return query; + }, + stringify: function stringify(query) { + var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '?'; + + var queryString = Object.keys(query).map(function (key) { + return key + '=' + encodeURIComponent(query[key] || ''); + }).join('&'); + return queryString ? prefix + queryString : ''; + } + }; + + function ajaxFactory(method) { + return function (apiPath) { + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var base = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'https://api.github.com'; + + var req = new XMLHttpRequest(); + var token = localStorage.getItem(_constants.LS_ACCESS_TOKEN_KEY); + + var url = '' + base + apiPath; + var body = null; + if (method === 'GET' || method === 'DELETE') { + url += Query.stringify(data); + } + + var p = new Promise(function (resolve, reject) { + req.addEventListener('load', function () { + var contentType = req.getResponseHeader('content-type'); + var res = req.responseText; + if (!/json/.test(contentType)) { + resolve(res); + return; + } + var data = req.responseText ? JSON.parse(res) : {}; + if (data.message) { + reject(new Error(data.message)); + } else { + resolve(data); + } + }); + req.addEventListener('error', function (error) { + return reject(error); + }); + }); + req.open(method, url, true); + + req.setRequestHeader('Accept', 'application/vnd.github.squirrel-girl-preview, application/vnd.github.html+json'); + if (token) { + req.setRequestHeader('Authorization', 'token ' + token); + } + if (method !== 'GET' && method !== 'DELETE') { + body = JSON.stringify(data); + req.setRequestHeader('Content-Type', 'application/json'); + } + + req.send(body); + return p; + }; + } + + var http = exports.http = { + get: ajaxFactory('GET'), + post: ajaxFactory('POST'), + delete: ajaxFactory('DELETE'), + put: ajaxFactory('PUT') + }; + + /***/ + }), + /* 4 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + var g; + + // This works in non-strict mode + g = function () { + return this; + }(); + + try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1, eval)("this"); + } catch (e) { + // This works if the window reference is available + if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; + } + + // g can still be undefined, but nothing to do about it... + // We return undefined, instead of nothing here, so it's + // easier to handle this case. if(!global) { ...} + + module.exports = g; + + /***/ + }), + /* 5 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + var _createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + var _mobx = __webpack_require__(1); + + var _constants = __webpack_require__(0); + + var _utils = __webpack_require__(3); + + var _default = __webpack_require__(2); + + var _default2 = _interopRequireDefault(_default); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; + } + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var scope = 'public_repo'; + + function extendRenderer(instance, renderer) { + instance[renderer] = function (container) { + var targetContainer = (0, _utils.getTargetContainer)(container); + var render = instance.theme[renderer] || instance.defaultTheme[renderer]; + + (0, _mobx.autorun)(function () { + var e = render(instance.state, instance); + if (targetContainer.firstChild) { + targetContainer.replaceChild(e, targetContainer.firstChild); + } else { + targetContainer.appendChild(e); + } + }); + + return targetContainer; + }; + } + + var Gitment = function () { + _createClass(Gitment, [{ + key: 'accessToken', + get: function get() { + return localStorage.getItem(_constants.LS_ACCESS_TOKEN_KEY); + }, + set: function set(token) { + localStorage.setItem(_constants.LS_ACCESS_TOKEN_KEY, token); + } + }, { + key: 'loginLink', + get: function get() { + var oauthUri = 'https://github.com/login/oauth/authorize'; + var redirect_uri = this.oauth.redirect_uri || window.location.href; + + var oauthParams = Object.assign({ + scope: scope, + redirect_uri: redirect_uri + }, this.oauth); + + return '' + oauthUri + _utils.Query.stringify(oauthParams); + } + }]); + + function Gitment() { + var _this = this; + + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, Gitment); + + this.defaultTheme = _default2.default; + this.useTheme(_default2.default); + + Object.assign(this, { + id: window.location.href, + title: window.document.title, + link: window.location.href, + desc: '', + labels: [], + theme: _default2.default, + oauth: {}, + perPage: 20, + maxCommentHeight: 400 + }, options); + + this.useTheme(this.theme); + + var user = {}; + try { + var userInfo = localStorage.getItem(_constants.LS_USER_KEY); + if (this.accessToken && userInfo) { + Object.assign(user, JSON.parse(userInfo), { + fromCache: true + }); + } + } catch (e) { + localStorage.removeItem(_constants.LS_USER_KEY); + } + + this.state = (0, _mobx.observable)({ + user: user, + error: null, + meta: {}, + comments: undefined, + reactions: [], + commentReactions: {}, + currentPage: 1 + }); + + var query = _utils.Query.parse(); + if (query.code) { + var _oauth = this.oauth, + client_id = _oauth.client_id, + client_secret = _oauth.client_secret; + + var code = query.code; + delete query.code; + var search = _utils.Query.stringify(query); + var replacedUrl = '' + window.location.origin + window.location.pathname + search + window.location.hash; + history.replaceState({}, '', replacedUrl); + + Object.assign(this, { + id: replacedUrl, + link: replacedUrl + }, options); + + this.state.user.isLoggingIn = true; + //_utils.http.post('https://gh-oauth.imsun.net', { + //_utils.http.post('https://auth.baixiaotu.cc', { + //_utils.http.post('https://bak.smalbox.club', { + //_utils.http.post('https://cors.wenjunjiang.win', { + // https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/gitment.browser.js + //_utils.http.post('https://cors-anywhere.herokuapp.com/https://github.com/login/oauth/access_token', { + // https://www.wenjunjiang.win/js/gitment.js + _utils.http.post('https://cors.wenjunjiang.win/?remoteUrl=https://github.com/login/oauth/access_token', { + code: code, + client_id: client_id, + client_secret: client_secret + }, '').then(function (data) { + _this.accessToken = data.access_token; + _this.update(); + }).catch(function (e) { + _this.state.user.isLoggingIn = false; + alert(e); + }); + } else { + this.update(); + } + } + + _createClass(Gitment, [{ + key: 'init', + value: function init() { + var _this2 = this; + + return this.createIssue().then(function () { + return _this2.loadComments(); + }).then(function (comments) { + _this2.state.error = null; + return comments; + }); + } + }, { + key: 'useTheme', + value: function useTheme() { + var _this3 = this; + + var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + this.theme = theme; + + var renderers = Object.keys(this.theme); + renderers.forEach(function (renderer) { + return extendRenderer(_this3, renderer); + }); + } + }, { + key: 'update', + value: function update() { + var _this4 = this; + + return Promise.all([this.loadMeta(), this.loadUserInfo()]).then(function () { + return Promise.all([_this4.loadComments().then(function () { + return _this4.loadCommentReactions(); + }), _this4.loadReactions()]); + }).catch(function (e) { + return _this4.state.error = e; + }); + } + }, { + key: 'markdown', + value: function markdown(text) { + return _utils.http.post('/markdown', { + text: text, + mode: 'gfm' + }); + } + }, { + key: 'createIssue', + value: function createIssue() { + var _this5 = this; + + var id = this.id, + owner = this.owner, + repo = this.repo, + title = this.title, + link = this.link, + desc = this.desc, + labels = this.labels; + + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues', { + title: title, + labels: labels.concat(['gitment', id]), + body: link + '\n\n' + desc + }).then(function (meta) { + _this5.state.meta = meta; + return meta; + }); + } + }, { + key: 'getIssue', + value: function getIssue() { + if (this.state.meta.id) return Promise.resolve(this.state.meta); + + return this.loadMeta(); + } + }, { + key: 'post', + value: function post(body) { + var _this6 = this; + + return this.getIssue().then(function (issue) { + return _utils.http.post(issue.comments_url, { + body: body + }, ''); + }).then(function (data) { + _this6.state.meta.comments++; + var pageCount = Math.ceil(_this6.state.meta.comments / _this6.perPage); + if (_this6.state.currentPage === pageCount) { + _this6.state.comments.push(data); + } + return data; + }); + } + }, { + key: 'loadMeta', + value: function loadMeta() { + var _this7 = this; + + var id = this.id, + owner = this.owner, + repo = this.repo; + + return _utils.http.get('/repos/' + owner + '/' + repo + '/issues', { + creator: owner, + labels: id + }).then(function (issues) { + if (!issues.length) return Promise.reject(_constants.NOT_INITIALIZED_ERROR); + _this7.state.meta = issues[0]; + return issues[0]; + }); + } + }, { + key: 'loadComments', + value: function loadComments() { + var _this8 = this; + + var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.currentPage; + + return this.getIssue().then(function (issue) { + return _utils.http.get(issue.comments_url, { + page: page, + per_page: _this8.perPage + }, ''); + }).then(function (comments) { + _this8.state.comments = comments; + return comments; + }); + } + }, { + key: 'loadUserInfo', + value: function loadUserInfo() { + var _this9 = this; + + if (!this.accessToken) { + this.logout(); + return Promise.resolve({}); + } + + return _utils.http.get('/user').then(function (user) { + _this9.state.user = user; + localStorage.setItem(_constants.LS_USER_KEY, JSON.stringify(user)); + return user; + }); + } + }, { + key: 'loadReactions', + value: function loadReactions() { + var _this10 = this; + + if (!this.accessToken) { + this.state.reactions = []; + return Promise.resolve([]); + } + + return this.getIssue().then(function (issue) { + if (!issue.reactions.total_count) return []; + return _utils.http.get(issue.reactions.url, {}, ''); + }).then(function (reactions) { + _this10.state.reactions = reactions; + return reactions; + }); + } + }, { + key: 'loadCommentReactions', + value: function loadCommentReactions() { + var _this11 = this; + + if (!this.accessToken) { + this.state.commentReactions = {}; + return Promise.resolve([]); + } + + var comments = this.state.comments; + var comentReactions = {}; + + return Promise.all(comments.map(function (comment) { + if (!comment.reactions.total_count) return []; + + var owner = _this11.owner, + repo = _this11.repo; + + return _utils.http.get('/repos/' + owner + '/' + repo + '/issues/comments/' + comment.id + '/reactions', {}); + })).then(function (reactionsArray) { + comments.forEach(function (comment, index) { + comentReactions[comment.id] = reactionsArray[index]; + }); + _this11.state.commentReactions = comentReactions; + + return comentReactions; + }); + } + }, { + key: 'login', + value: function login() { + window.location.href = this.loginLink; + } + }, { + key: 'logout', + value: function logout() { + localStorage.removeItem(_constants.LS_ACCESS_TOKEN_KEY); + localStorage.removeItem(_constants.LS_USER_KEY); + this.state.user = {}; + } + }, { + key: 'goto', + value: function goto(page) { + this.state.currentPage = page; + this.state.comments = undefined; + return this.loadComments(page); + } + }, { + key: 'like', + value: function like() { + var _this12 = this; + + if (!this.accessToken) { + alert('登录即可喜欢'); + return Promise.reject(); + } + + var owner = this.owner, + repo = this.repo; + + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues/' + this.state.meta.number + '/reactions', { + content: 'heart' + }).then(function (reaction) { + _this12.state.reactions.push(reaction); + _this12.state.meta.reactions.heart++; + }); + } + }, { + key: 'unlike', + value: function unlike() { + var _this13 = this; + + if (!this.accessToken) return Promise.reject(); + + var _state = this.state, + user = _state.user, + reactions = _state.reactions; + + var index = reactions.findIndex(function (reaction) { + return reaction.user.login === user.login; + }); + return _utils.http.delete('/reactions/' + reactions[index].id).then(function () { + reactions.splice(index, 1); + _this13.state.meta.reactions.heart--; + }); + } + }, { + key: 'likeAComment', + value: function likeAComment(commentId) { + var _this14 = this; + + if (!this.accessToken) { + alert('登录即可喜欢'); + return Promise.reject(); + } + + var owner = this.owner, + repo = this.repo; + + var comment = this.state.comments.find(function (comment) { + return comment.id === commentId; + }); + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues/comments/' + commentId + '/reactions', { + content: 'heart' + }).then(function (reaction) { + _this14.state.commentReactions[commentId].push(reaction); + comment.reactions.heart++; + }); + } + }, { + key: 'unlikeAComment', + value: function unlikeAComment(commentId) { + if (!this.accessToken) return Promise.reject(); + + var reactions = this.state.commentReactions[commentId]; + var comment = this.state.comments.find(function (comment) { + return comment.id === commentId; + }); + var user = this.state.user; + + var index = reactions.findIndex(function (reaction) { + return reaction.user.login === user.login; + }); + + return _utils.http.delete('/reactions/' + reactions[index].id).then(function () { + reactions.splice(index, 1); + comment.reactions.heart--; + }); + } + }]); + + return Gitment; + }(); + + module.exports = Gitment; + + /***/ + }), + /* 6 */ + /***/ + (function (module, exports, __webpack_require__) { + + "use strict"; + + + Object.defineProperty(exports, "__esModule", { + value: true + }); + /** + * Modified from https://github.com/evil-icons/evil-icons + */ + + var close = exports.close = ''; + var github = exports.github = ''; + var heart = exports.heart = ''; + var spinner = exports.spinner = ''; + + /***/ + }) + /******/ +]); +//# sourceMappingURL=gitment.browser.js.map diff --git a/lib/jquery-2.1.4.min.js b/lib/jquery-2.1.4.min.js new file mode 100644 index 0000000..49990d6 --- /dev/null +++ b/lib/jquery-2.1.4.min.js @@ -0,0 +1,4 @@ +/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){ +return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*\s*$/g,ia={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("