master
yixian 7 years ago
commit 7db1195937

10
.gitignore vendored

@ -0,0 +1,10 @@
# Created by .ignore support plugin (hsz.mobi)
### Example user template template
### Example user template
# IntelliJ project files
.idea
*.iml
out
gen
target

@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-parent</artifactId>
<version>0.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<dependencies>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>tools</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>payment-core</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>wxpay-core</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>alipay-core</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>jd-core</artifactId>
</dependency>
<dependency>
<groupId>au.com.royalpay.payment</groupId>
<artifactId>bestpay-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>net.sourceforge.nekohtml</groupId>
<artifactId>nekohtml</artifactId>
</dependency>
<dependency>
<groupId>cn.yixblog.google.kaptcha</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3.2</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.6.0</version>
<exclusions>
<exclusion>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
</exclusion>
<exclusion>
<groupId>org.olap4j</groupId>
<artifactId>olap4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-fonts</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>com.lowagie</groupId>
<artifactId>itext</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.14</version>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>com.notnoop.apns</groupId>
<artifactId>apns</artifactId>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,91 @@
ALTER TABLE `pmt_refunds`
MODIFY COLUMN `refund_id` varchar(50) NOT NULL COMMENT '退款编号' FIRST ;
ALTER TABLE `pmt_refund_applies`
MODIFY COLUMN `id` varchar(50) NOT NULL FIRST ,
MODIFY COLUMN `refund_id` varchar(50) NOT NULL COMMENT 'refund order id' AFTER `order_id`;
ALTER TABLE `pmt_transactions`
MODIFY COLUMN `transaction_id` varchar(50) NOT NULL COMMENT '交易流水编号' FIRST ,
MODIFY COLUMN `refund_id` varchar(50) NULL DEFAULT NULL COMMENT '退款单号' AFTER `order_id`;
ALTER TABLE `log_wechat_template_msg`
MODIFY COLUMN `send_id` varchar(50) NOT NULL FIRST ,
MODIFY COLUMN `account_id` varchar(50) NOT NULL AFTER `client_id`;
ALTER TABLE `log_wechat_error`
MODIFY COLUMN `id` varchar(50) NOT NULL FIRST ;
ALTER TABLE `log_notify_error`
MODIFY COLUMN `id` varchar(50) NOT NULL FIRST ;
ALTER TABLE `log_manager_login`
MODIFY COLUMN `id` varchar(50) NOT NULL FIRST ;
ALTER TABLE `log_client_login`
MODIFY COLUMN `id` varchar(50) NOT NULL FIRST ,
MODIFY COLUMN `account_id` varchar(50) NOT NULL AFTER `client_id`;
ALTER TABLE `log_client_review`
MODIFY COLUMN `review_id` varchar(50) NOT NULL FIRST ;
ALTER TABLE `log_app_msg`
MODIFY COLUMN `send_id` varchar(50) NOT NULL FIRST ;
ALTER TABLE `sys_accounts`
MODIFY COLUMN `account_id` varchar(50) NOT NULL COMMENT '登录账户编号' FIRST ;
ALTER TABLE `sys_clients_devices`
MODIFY COLUMN `account_id` varchar(50) NULL DEFAULT NULL COMMENT '目前登录的账号' AFTER `version`;
ALTER TABLE `financial_bd_config`
MODIFY COLUMN `manager_id` varchar(50) NOT NULL FIRST ;
ALTER TABLE `sys_client_bd`
MODIFY COLUMN `bd_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL AFTER `client_id`;
ALTER TABLE `sys_managers`
MODIFY COLUMN `manager_id` varchar(50) NOT NULL COMMENT '管理员账户编号' FIRST ;
ALTER TABLE `log_manager_login`
MODIFY COLUMN `manager_id` varchar(50) NOT NULL AFTER `id`;
ALTER TABLE `financial_bd_commission_config`
MODIFY COLUMN `bd_id` varchar(50) NOT NULL DEFAULT 0 COMMENT 'bd id' AFTER `bd_name`;
ALTER TABLE `financial_bd_config`
MODIFY COLUMN `bd_group` varchar(50) NULL DEFAULT NULL COMMENT 'BD Leader manger_id' AFTER `get_prize`;
ALTER TABLE `financial_bd_prize_detail`
MODIFY COLUMN `manager_id` varchar(50) NOT NULL AFTER `client_id`;
ALTER TABLE `bd_access_log`
MODIFY COLUMN `bd_id` varchar(50) NOT NULL AFTER `date`;
ALTER TABLE `sys_clients`
MODIFY COLUMN `creator` varchar(50) NOT NULL COMMENT '创建者' AFTER `logo_thumbnail`;
ALTER TABLE `pat_goods`
MODIFY COLUMN `creator` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `is_using`;
ALTER TABLE `sys_notice`
MODIFY COLUMN `create_id` varchar(50) NOT NULL AFTER `status`,
MODIFY COLUMN `send_id` varchar(50) NULL DEFAULT NULL AFTER `create_name`;
ALTER TABLE `sys_notice_client`
MODIFY COLUMN `read_id` varchar(50) NULL DEFAULT NULL AFTER `read_time`;
ALTER TABLE `act_sign_events_sign_log`
MODIFY COLUMN `sign_user_id` varchar(50) NULL DEFAULT NULL AFTER `sign_time`;
ALTER TABLE `act_red_packets_wechat`
MODIFY COLUMN `relation_id` varchar(50) NOT NULL FIRST ,
MODIFY COLUMN `update_id` varchar(50) NULL DEFAULT NULL AFTER `create_time`;
ALTER TABLE `pat_goods`
MODIFY COLUMN `id` varchar(50) NOT NULL FIRST;
ALTER TABLE `pat_goods_sale`
MODIFY COLUMN `good_id` varchar(50) NOT NULL AFTER `client_id`;

@ -0,0 +1,42 @@
{
"name": "RoyalPay网关支付接口",
"version": "1.1.0",
"description": "RoyalPay网关支付第三方开发者对接文档",
"title": "RoyalPay网关支付接口",
"url": "https://mpay.royalpay.com.au",
"header":{
"title":"Overview",
"filename":"overview.md"
},
"order":[
"Overview",
"QRCode",
"NewQRCode",
"QRCodePay",
"JSApi",
"NewJSAPI",
"WxJSAPIPay",
"AliJSAPIPay",
"MobileH5",
"NewMobileH5Pay",
"MobileH5Pay",
"RetailPay",
"RetailMicroPay",
"RetailQRCode",
"JD_Online_Payment",
"Alipay_Online_Payment",
"SDKPayment",
"CommonApi",
"GetExchange",
"OrderStatus",
"RefundOrder",
"RefundQuery",
"ListOrder",
"ListTransaction",
"SettleLog",
"PayNotice"
],
"template":{
"forceLanguage":"zh_cn"
}
}

@ -0,0 +1,753 @@
/**
* @apiDefine API API
* API接口列表
*/
/**
* @apiDefine Sign
* @apiParam (QueryParam) {Long} time 必填UTC毫秒时间戳
* @apiParam (QueryParam) {String} nonce_str 必填随机字符串
* @apiParam (QueryParam) {String} sign 必填签名
*/
/**
* @apiDefine PathVariable Path Variable
*/
/**
* @apiDefine QueryParam Query Params
*/
/**
* @apiDefine JSON JSON字段
*/
/**
* @apiDefine ERROR_CODE 错误码
*/
/**
* @apiDefine GlobalError
* @apiError (ERROR) return_code Error Code
* @apiError (ERROR) return_msg Error Description
* @apiError (ERROR_CODE) SYSTEMERROR 系统内部异常
* @apiError (ERROR_CODE) INVALID_SHORT_ID 商户编码不合法或没有对应商户
* @apiError (ERROR_CODE) SIGN_TIMEOUT 签名超时time字段与服务器时间相差超过5分钟
* @apiError (ERROR_CODE) INVALID_SIGN 签名错误
* @apiError (ERROR_CODE) PARAM_INVALID 参数不符合要求具体细节可参考return_msg字段
* @apiError (ERROR_CODE) NOT_PERMITTED 未开通网关支付权限
* @apiError (ERROR_CODE) INVALID_CHANNEL 不合法的支付渠道名称请检查大小写
*
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/channel_exchange_rate 获取当前汇率
* @apiName GetExchange
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription
* 获取当前各渠道AUD兑CNY汇率值(1AUD=?CNY)该汇率仅做参考以实际成交汇率为准
* @apiHeader Accept application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiUse Sign
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {Double} wechat_rate 微信汇率
* @apiSuccess {Double} alipay_retail_rate 支付宝线下渠道汇率
* @apiSuccess {Double} alipay_online_rate 支付宝线上渠道汇率
*
* @apiUse GlobalError
*/
/**
* @api {PUT} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id} 创建QRCode支付单
* @apiName NewQRCode
* @apiGroup QRCode
* @apiVersion 1.0.0
* @apiDescription
* QRCode支付单适用于PC端网页/应用进行支付用户使用微信/支付宝客户端扫描下单后生成的二维码完成支付<br>
* <img src="img/QRCODE_process_ch.png"><br>
* 返回值包括二维码字符串二维码图片支付地址商户可以自行决定直接展示二维码或跳转支付页跳转支付页需要带上签名信息
* 货币类型如果是CNY注意通过汇率转换后不得低于0.01AUD否则订单可以创建成功但支付时会报金额不合法错误
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求同一商户唯一
* @apiUse Sign
* @apiParam (JSON) {String} description 必填订单标题最大长度128字符超出自动截取
* @apiParam (JSON) {int} price 必填金额单位为货币最小单位例如使用100表示AUD1.00
* @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码
* @apiParam (JSON) {String=Alipay,Wechat} channel 支付渠道大小写敏感
* @apiParam (JSON) {String} notify_url 支付通知url详见支付通知api不填则不会推送支付通知
* @apiParam (JSON) {String} operator 操作人员标识
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code SUCCESS表示创建订单成功EXISTS表示订单已存在
* @apiSuccess {String} channel 支付渠道
* @apiSuccess {String} partner_code 商户编码
* @apiSuccess {String} full_name 商户注册全名
* @apiSuccess {String} partner_name 商户名称
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID最终支付成功的订单ID可能不同
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {String} code_url 支付码字符串商户可以据此自行生产二维码
* @apiSuccess {String} qrcode_img Base64封装的二维码图片可直接作为img的src属性
* @apiSuccess {String} pay_url 跳转URL
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付
*
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/pay QRCode支付跳转页
* @apiName QRCodePay
* @apiDescription 必须先调用创建QRCode订单接口再进行跳转
* 建议在用户回调到对应页时通过后台查询订单状态接口确认订单的支付状态
* @apiVersion 1.0.0
* @apiGroup QRCode
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求已预先创建
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect 必填支付成功后跳转页面回调时会带上签名参数用于校验
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*/
/**
* @api {PUT} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id} 创建H5支付单
* @apiName NewMobileH5Pay
* @apiGroup MobileH5
* @apiVersion 1.0.0
* @apiDescription
* <b>注意微信H5支付接口必须单独申请腾讯批复后方可使用有需要的商户请联系RoyalPay客服支付宝无此限制</b><br>
* H5支付适用场景为移动端App或者手机自带浏览器进行支付用户下单后浏览器跳转至微信支付页面并自动拉起微信/支付宝客户端完成支付<br>
* 返回值包括跳转支付地址跳转支付页需要带上签名信息
* 货币类型如果是CNY注意通过汇率转换后不得低于0.01AUD否则订单可以创建成功但支付时会报金额不合法错误<br>
* <img src="img/h5_api_payment.jpg">
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求同一商户唯一
* @apiUse Sign
* @apiParam (JSON) {String} description 必填订单标题最大长度128字符超出自动截取
* @apiParam (JSON) {int} price 必填金额单位为货币最小单位例如使用100表示AUD1.00
* @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码
* @apiParam (JSON) {String=Alipay,Wechat} channel 支付渠道大小写敏感
* @apiParam (JSON) {String} notify_url 支付通知url详见支付通知api不填则不会推送支付通知
* @apiParam (JSON) {String} operator 操作人员标识
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code SUCCESS表示创建订单成功EXISTS表示订单已存在
* @apiSuccess {String} partner_code 商户编码
* @apiSuccess {String} channel 支付渠道
* @apiSuccess {String} full_name 商户注册全名
* @apiSuccess {String} partner_name 商户名称
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID最终支付成功的订单ID可能不同
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {String} pay_url 跳转URL
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付
*
*/
/**
* @api {GET} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id}/pay H5支付跳转页
* @apiName MobileH5Pay
* @apiDescription 必须先调用创建H5支付订单接口再进行跳转
* 建议在用户回调到对应页时通过后台查询订单状态接口确认订单的支付状态
* @apiVersion 1.0.0
* @apiGroup MobileH5
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求已预先创建
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect 必填支付成功后跳转页面回调时会带上签名参数用于校验
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*/
/**
* @api {PUT} /api/v1.0/jsapi_gateway/partners/{partner_code}/orders/{order_id} 创建JSAPI订单
* @apiName NewJSAPI
* @apiGroup JSApi
* @apiVersion 1.1.0
* @apiDescription
* JSAPI适用于在微信/支付宝内打开的网页进行支付如果用户从微信公众号进入支付页要求公众号已完成认证用户下单后跳转至RoyalPay订单页并拉起微信或支付宝内置收银台完成支付<br>
* <img src="img/JSAPI_process_cn.png"><br>
* 返回值包括支付地址商户应该引导用户跳转支付页跳转支付页需要带上签名信息
* 货币类型如果是CNY注意通过汇率转换后不得低于0.01AUD否则订单可以创建成功但支付时会报金额不合法错误
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求同一商户唯一
* @apiUse Sign
* @apiParam (JSON) {String} description 必填订单标题最大长度128字符超出自动截取
* @apiParam (JSON) {int} price 必填金额单位为货币最小单位例如使用100表示AUD1.00
* @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码
* @apiParam (JSON) {String=Alipay,Wechat} channel 支付渠道大小写敏感
* @apiParam (JSON) {String} notify_url 支付通知url详见支付通知api不填则不会推送支付通知
* @apiParam (JSON) {String} operator 操作人员标识
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code SUCCESS表示创建订单成功EXISTS表示订单已存在
* @apiSuccess {String} partner_code 商户编码
* @apiSuccess {String} channel 支付渠道
* @apiSuccess {String} full_name 商户注册全名
* @apiSuccess {String} partner_name 商户名称
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID最终支付成功的订单ID可能不同
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {String} pay_url 跳转URL
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付
*
*/
/**
* @api {GET} /api/v1.0/wechat_jsapi_gateway/partners/{partner_code}_order_{order_id} 微信JSAPI支付跳转页
* @apiName WxJSAPIPay
* @apiDescription 必须先调用创建JSAPI订单接口再进行跳转最终URL以下单api返回的pay_url为准
* @apiVersion 1.0.0
* @apiGroup JSApi
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求已预先创建
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect 必填支付成功后跳转页面
* @apiParam (QueryParam) {Boolean=true,false} directpay='false' 是否直接支付
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*/
/**
* @api {GET} /api/v1.0/gateway/alipay/partners/{partner_code}/orders/{order_id}/app_pay 支付宝JSAPI支付跳转页
* @apiName AliJSAPIPay
* @apiDescription 必须先调用创建JSAPI订单接口再进行跳转最终URL以下单api返回的pay_url为准
* @apiVersion 1.0.0
* @apiGroup JSApi
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求已预先创建
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect 必填支付成功后跳转页面
* @apiParam (QueryParam) {Boolean=true,false} directpay='false' 是否进入页面时立刻支付
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*/
/**
* @api {PUT} /api/v1.0/micropay/partners/{partner_code}/orders/{order_id} 创建线下支付订单
* @apiName RetailMicroPay
* @apiDescription
* 线下支付订单接口用于带有扫码设备的收银终端进行对接商户输入金额后要求客户出示支付码用扫码枪扫码后将扫码内容和金额一并提交并完成支付操作
* 线下支付订单接口现已兼容微信支付宝通道<br>
* <img src="img/Retail_cn.png">
* @apiVersion 1.0.2
* @apiGroup RetailPay
*
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号
* @apiUse Sign
* @apiParam (JSON) {String} description 必填订单标题最大长度128字符超出自动截取
* @apiParam (JSON) {int} price 必填金额单位为货币最小单位例如使用100表示AUD1.00
* @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码
* @apiParam (JSON) {String} device_id 必填设备ID
* @apiParam (JSON) {String} auth_code 必填扫描用户微信客户端得到的支付码
* @apiParam (JSON) {String} notify_url 支付通知url详见支付通知api不填则不会推送支付通知
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code
* <ul>
* <li>PAYING:等待支付</li>
* <li>CREATE_FAIL:订单创建失败</li>
* <li>CLOSED:已关闭</li>
* <li>PAY_FAIL:支付失败</li>
* <li>PAY_SUCCESS:支付成功</li>
* </ul>
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {int} total_fee 订单金额单位是货币最小面值单位
* @apiSuccess {int} real_fee 实际支付金额单位是货币最小面值单位(目前等于订单金额为卡券预留)
* @apiSuccess {String} pay_time 支付时间yyyy-MM-dd HH:mm:ssGMT+10
* @apiSuccess {String} create_time 订单创建时间最新订单为准yyyy-MM-dd HH:mm:ssGMT+10
* @apiSuccess {String} currency 币种通常为AUD
* @apiSuccess {String} channel 支付渠道 Alipay|支付宝Wechat|微信Bestpay|翼支付
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付
* @apiError (ERROR_CODE) AUTHCODEEXPIRE 二维码已过期
* @apiError (ERROR_CODE) NOTENOUGH 余额不足
* @apiError (ERROR_CODE) NOTSUPORTCARD 不支持卡类型
* @apiError (ERROR_CODE) AUTH_CODE_ERROR 二维码被重复提交
* @apiError (ERROR_CODE) AUTH_CODE_INVALID 不是微信支付二维码
*/
/**
* @api {PUT} /api/v1.0/retail_qrcode/partners/{partner_code}/orders/{order_id} 创建线下QRCode支付单
* @apiName RetailQRCode
* @apiGroup RetailPay
* @apiVersion 1.0.2
* @apiDescription
* 线下QRCode支付用于对接无扫码设备的收银终端下单后得到二维码地址自行生成二维码图片后展示在收银终端屏幕上并由用户使用对应支付客户端进行扫码支付
* 线下QRCode现已同时兼容支付宝微信和翼支付客户端进行支付<br>
* <img src="img/RetailQR_cn.png"><br>
* 货币类型如果是CNY注意通过汇率转换后不得低于0.01AUD否则订单可以创建成功但支付时会报金额不合法错误
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求同一商户唯一
* @apiUse Sign
* @apiParam (JSON) {String} description 必填订单标题最大长度128字符超出自动截取
* @apiParam (JSON) {int} price 必填金额单位为货币最小单位例如使用100表示AUD1.00
* @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码
* @apiParam (JSON) {String} device_id 必填设备ID
* @apiParam (JSON) {String} notify_url 支付通知url详见支付通知api不填则不会推送支付通知
* @apiParam (JSON) {String} operator 操作人员标识
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code SUCCESS表示创建订单成功EXISTS表示订单已存在
* @apiSuccess {String} partner_code 商户编码
* @apiSuccess {String} full_name 商户注册全名
* @apiSuccess {String} partner_name 商户名称
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID最终支付成功的订单ID可能不同
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {String} code_url 支付码字符串商户可以据此自行生产二维码
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id} 查询订单状态
* @apiName OrderStatus
* @apiGroup CommonApi
* @apiVersion 1.0.3
* @apiDescription 查询范围包括QRCode订单JSAPI订单和线下支付订单
* @apiHeader Accept application/json
*
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号
* @apiUse Sign
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code
* <ul>
* <li>PAYING:等待支付</li>
* <li>CREATE_FAIL:订单创建失败</li>
* <li>CLOSED:已关闭</li>
* <li>PAY_FAIL:支付失败</li>
* <li>PAY_SUCCESS:支付成功</li>
* <li>PARTIAL_REFUND:部分退款</li>
* <li>FULL_REFUND:全额退款</li>
* </ul>
* 如果需要可以用相同订单号再次发起支付单支付成功或支付中的无法重复发起订单
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID最终支付成功的订单ID可能不同
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {int} total_fee 订单金额单位是货币最小面值单位
* @apiSuccess {int} real_fee 实际支付金额单位是货币最小面值单位(目前等于订单金额为卡券预留)
* @apiSuccess {Double} rate 交易时使用的汇率1AUD=?CNY
* @apiSuccess {String} pay_time 支付时间yyyy-MM-dd HH:mm:ssGMT+10
* @apiSuccess {String} create_time 订单创建时间最新订单为准yyyy-MM-dd HH:mm:ssGMT+10
* @apiSuccess {String} currency 币种通常为AUD
* @apiSuccess {String} channel 支付渠道 Alipay|支付宝Wechat|微信Bestpay|翼支付
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
*
*/
/**
* @api {PUT} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/refunds/{refund_id} 申请退款
* @apiName RefundOrder
* @apiGroup CommonApi
* @apiVersion 1.0.2
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiDescription 一笔支付订单可以分多次退款退款总金额不得超过实际支付金额退款币种与支付订单一致
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号
* @apiParam (PathVariable) {String} refund_id 必填商户退款单号
* @apiUse Sign
* @apiParam (JSON) {int} fee 必填退款金额单位是货币最小单位单个订单退款单金额总和不能超过用户支付金额
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code
* <ul>
* <li>WAITING:正在提交</li>
* <li>CREATE_FAILED:提交失败</li>
* <li>SUCCESS:提交成功</li>
* <li>FAILED:退款失败</li>
* <li>FINISHED:退款成功</li>
* <li>CHANGE:退款无法到账需要人工介入</li>
* </ul>
* @apiSuccess {String} refund_id RoyalPay退款单号
* @apiSuccess {String} partner_refund_id 商户提交的退款单号
* @apiSuccess {int} amount 退款金额单位是货币最小单位
* @apiSuccess {String} currency 币种通常为AUD
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_NOT_PAID 订单未支付完成无法退款
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/refunds/{refund_id} 查询退款状态
* @apiName RefundQuery
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
*
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号
* @apiParam (PathVariable) {String} refund_id 必填商户退款单号
* @apiUse Sign
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code
* <ul>
* <li>WAITING:正在提交</li>
* <li>CREATE_FAILED:提交失败</li>
* <li>SUCCESS:提交成功</li>
* <li>FAILED:退款失败</li>
* <li>FINISHED:退款成功</li>
* <li>CHANGE:退款无法到账需要人工介入</li>
* </ul>
* @apiSuccess {String} refund_id RoyalPay退款单号
* @apiSuccess {String} partner_refund_id 商户提交的退款单号
* @apiSuccess {int} amount 退款金额单位是货币最小单位
* @apiSuccess {String} currency 币种通常为AUD
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST 订单不存在
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_NOT_PAID 订单未支付完成无法退款
* @apiError (ERROR_CODE) REFUND_NOT_EXIST 退款单不存在
* @apiError (ERROR_CODE) REFUND_MISMATCH 退款单号与支付单不匹配
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders 查看账单
* @apiName ListOrder
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiUse Sign
* @apiParam (QueryParam) {String} date 订单创建日期'yyyyMMdd'格式GMT+10不填默认查询所有订单
* @apiParam (QueryParam) {String='ALL','PAID','REFUNDED'} status='ALL'
* 订单状态
* <ul>
* <li>ALL:全部订单包括未完成订单和已关闭订单</li>
* <li>PAID:只列出支付过的订单包括存在退款订单</li>
* <li>REFUNDED:只列出存在退款订单</li>
* </ul>
* @apiParam (QueryParam) {int} page=1 页码从1开始计算
* @apiParam (QueryParam) {int} limit=10 每页条数
*
* @apiSuccess (ROOT) {String} return_code 执行结果
* @apiSuccess (ROOT) {JSON[]} data 订单列表
* @apiSuccess (ROOT) {JSON} pagination 分页信息
* @apiSuccess (ROOT) {JSON} analysis 统计信息
*
* @apiSuccess (data) {String} order_id RoyalPay订单ID
* @apiSuccess (data) {String} partner_order_id 商户订单ID
* @apiSuccess (data) {int} total_fee 订单金额单位是货币最小单位
* @apiSuccess (data) {int} real_fee 订单支付金额单位是货币最小单位
* @apiSuccess (data) {String} channel 支付渠道 Alipay|支付宝Wechat|微信Bestpay|翼支付
* @apiSuccess (data) {String} currency 币种
* @apiSuccess (data) {String} create_time 格式'yyyy-MM-dd HH:mm:ss'GMT+10订单创建时间
* @apiSuccess (data) {String} pay_time 格式'yyyy-MM-dd HH:mm:ss'GMT+10支付时间未支付订单为空
* @apiSuccess (data) {String} status
* 订单状态
* <ul>
* <li>SUBMITTING:提交中</li>
* <li>SUBMIT_FAIL:提交失败</li>
* <li>WAITING_PAYMENT:等待支付</li>
* <li>CLOSED:已关闭</li>
* <li>PAYMENT_FAIL:支付失败</li>
* <li>SUCCESS:支付成功</li>
* <li>PARTIAL_REFUND:部分退款</li>
* <li>FULL_REFUND:全额退款</li>
* </ul>
* @apiSuccess (data) {String} order_body 订单标题
* @apiSuccess (data) {String} gateway
* 订单模式
* <ul>
* <li>Retail In-Store:RoyalPay官方POS线下支付</li>
* <li>QRCODE:商户静态二维码</li>
* <li>Online API:网站QRCode API支付<li>
* <li>WeChat HTML5:JSAPI支付</li>
* <li>Retail API:线下API支付</li>
* <li>Mobile H5:H5 API支付</li>
* </ul>
* @apiSuccess (data) {String} partner_code 商户编码
* @apiSuccess (data) {String} partner_name 商户名称
* @apiSuccess (data) {String} refund_fee 当前订单退款金额货币最小单位
*
* @apiSuccess (pagination) {int} page 页码
* @apiSuccess (pagination) {int} limit 每页条数
* @apiSuccess (pagination) {int} totalCount 总条数
* @apiSuccess (pagination) {int} totalPages 总页数
*
* @apiSuccess (analysis) {int} order_count 支付成功订单数包含有退款订单
* @apiSuccess (analysis) {int} total_fee 成交订单总额货币最小单位
* @apiSuccess (analysis) {int} real_fee 支付总额货币最小单位
*
* @apiUse GlobalError
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/transactions 查看账单流水
* @apiName ListTransaction
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription 本接口将列出商户当日所有流水包括所有接口(含非网关接口)支付通道的付款RoyalPay优惠补贴退款
* 退款失败补正系统补正营销账户转入转出等不含清算信息<br>
* 注意一笔付款订单或退款订单均可能对应多条流水记录
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiUse Sign
* @apiParam (QueryParam) {String} date 必填, 账单日期'yyyyMMdd'格式GMT+10
*
* @apiSuccess (ROOT) {String} return_code 执行结果
* @apiSuccess (ROOT) {String} result_code 业务执行结果
* @apiSuccess (ROOT) {int} transaction_count 流水总条目
* @apiSuccess (ROOT) {int} order_count 付款单数
* @apiSuccess (ROOT) {int} refund_count 退款单数
* @apiSuccess (ROOT) {JSON[]} transactions 流水列表
*
* @apiSuccess (transactions) {String} transaction_time 交易时间格式yyyyMMddHHmmssGMT+10
* @apiSuccess (transactions) {String} order_id RoyalPay订单ID
* @apiSuccess (transactions) {String} partner_order_id 商户订单ID
* @apiSuccess (transactions) {String} channel_order_id 渠道方(Alipay/Bestpay/Wechat)订单号
* @apiSuccess (transactions) {String} refund_id RoyalPay退款单ID(仅退款或退款失败补正)
* @apiSuccess (transactions) {String} partner_refund_id 商户系统提交退款ID(仅退款或退款失败补正)
* @apiSuccess (transactions) {String} gateway 下单接口
* <ul>
* <li>0: RoyalPay POS机付款码(扫描客户展示的付款码)</li>
* <li>1: RoyalPay POS机聚合支付码(客户扫描POS展示的二维码)</li>
* <li>2: RoyalPay 商户静态码</li>
* <li>3: QRCode 网关</li>
* <li>4: JSAPI 网关</li>
* <li>5: 第三方POS付款码网关</li>
* <li>6: 第三方POS聚合支付码网关</li>
* <li>7: RoyalPay 商户静态码(已停用)</li>
* <li>8: H5网关</li>
* </ul>
* @apiSuccess (transactions) {String} channel 支付渠道 Alipay|支付宝Wechat|微信Bestpay|翼支付
* @apiSuccess (transactions) {String} type 流水类型
* <ul>
* <li>Credit: 入账</li>
* <li>Debit: 出账</li>
* </ul>
* @apiSuccess (transactions) {String} currency 币种
* @apiSuccess (transactions) {int} total_amount 订单总金额单位是货币最小单位
* @apiSuccess (transactions) {int} input_amount 订单输入金额单位是货币最小单位
* @apiSuccess (transactions) {int} customer_payment_amount 用户实际支付金额单位是货币最小单位
* @apiSuccess (transactions) {int} settle_amount 结算金额币种为AUD单位是货币最小单位
* @apiSuccess (transactions) {double} exchange_rate 使用汇率
* @apiSuccess (transactions) {String} remark 备注
*
* @apiUse GlobalError
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/settlements 查看清算详情
* @apiName SettleLog
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription 本接口将列出商户当日清算的所有流水包括所有接口(含非网关接口)支付通道的付款RoyalPay优惠补贴退款
* 退款失败补正系统补正营销账户转入转出等<br>
* 注意一笔付款订单或退款订单均可能对应多条流水记录
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiUse Sign
* @apiParam (QueryParam) {String} date 必填, 清算日期'yyyyMMdd'格式GMT+10
*
* @apiSuccess (ROOT) {String} return_code 执行结果
* @apiSuccess (ROOT) {String} result_code 业务执行结果
* @apiSuccess (ROOT) {String} settle_from 订单起始日期,yyyyMMdd
* @apiSuccess (ROOT) {String} settle_to 订单截止日期yyyyMMdd
* @apiSuccess (ROOT) {String} settle_days 清算周期(T+n)
* @apiSuccess (ROOT) {int} transaction_count 流水总条目
* @apiSuccess (ROOT) {int} order_count 付款单数
* @apiSuccess (ROOT) {int} refund_count 退款单数
* @apiSuccess (ROOT) {int} total_credit 入账总金额(AUD分)
* @apiSuccess (ROOT) {int} total_debit 支出总金额(AUD分)
* @apiSuccess (ROOT) {int} total_surcharge 手续费总额(AUD分)
* @apiSuccess (ROOT) {int} total_transfer 打款总额(AUD分)
* @apiSuccess (ROOT) {JSON[]} transactions 流水列表
*
* @apiSuccess (transactions) {String} transaction_time 交易时间格式yyyyMMddHHmmssGMT+10
* @apiSuccess (transactions) {String} order_id RoyalPay订单ID
* @apiSuccess (transactions) {String} partner_order_id 商户订单ID
* @apiSuccess (transactions) {String} channel_order_id 渠道方(Alipay/Bestpay/Wechat)订单号
* @apiSuccess (transactions) {String} refund_id RoyalPay退款单ID(仅退款或退款失败补正)
* @apiSuccess (transactions) {String} partner_refund_id 商户系统提交退款ID(仅退款或退款失败补正)
* @apiSuccess (transactions) {String} gateway 下单接口
* <ul>
* <li>0: RoyalPay POS机付款码(扫描客户展示的付款码)</li>
* <li>1: RoyalPay POS机聚合支付码(客户扫描POS展示的二维码)</li>
* <li>2: RoyalPay 商户静态码</li>
* <li>3: QRCode 网关</li>
* <li>4: JSAPI 网关</li>
* <li>5: 第三方POS付款码网关</li>
* <li>6: 第三方POS聚合支付码网关</li>
* <li>7: RoyalPay 商户静态码(已停用)</li>
* <li>8: H5网关</li>
* </ul>
* @apiSuccess (transactions) {String} channel 支付渠道 Alipay|支付宝Wechat|微信Bestpay|翼支付
* @apiSuccess (transactions) {String} type 流水类型
* <ul>
* <li>Credit: 入账</li>
* <li>Debit: 出账</li>
* </ul>
* @apiSuccess (transactions) {String} currency 币种
* @apiSuccess (transactions) {int} total_amount 订单总金额单位是货币最小单位
* @apiSuccess (transactions) {int} input_amount 订单输入金额单位是货币最小单位
* @apiSuccess (transactions) {int} customer_payment_amount 用户实际支付金额单位是货币最小单位
* @apiSuccess (transactions) {int} settle_amount 结算金额单位是AUD分
* @apiSuccess (transactions) {String} surcharge_rate 手续费费率(x%)
* @apiSuccess (transactions) {int} surcharge 手续费金额单位是AUD分
* @apiSuccess (transactions) {int} transfer_amount 打款金额单位是AUD分
* @apiSuccess (transactions) {double} exchange_rate 使用汇率
* @apiSuccess (transactions) {String} remark 备注
*
* @apiUse GlobalError
*/
/**
* @api {POST} /notify_url 付款通知
* @apiName PayNotice
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription
* 若订单创建时提供了notify_url系统会在用户支付成功后向这个地址主动发送支付成功状态推送请求方式为POST
* 与服务器API不同推送校验参数会包含在json内商户系统应该验证校验参数确定来源正确后再进行后续操作
* 商户系统收到请求后应按要求返回参数若RoyalPay未收到合法参数视为商户未接收成功推送动作最多会重试3次商户系统应当能够处理收到的重复请求
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (JSON) {long} time UTC时间戳
* @apiParam (JSON) {String} nonce_str 随机字符串
* @apiParam (JSON) {String} sign 签名
* @apiParam (JSON) {String} partner_order_id 商户订单ID
* @apiParam (JSON) {String} order_id RoyalPay订单ID
* @apiParam (JSON) {int} total_fee 订单金额单位是最小货币单位
* @apiParam (JSON) {int} real_fee 支付金额单位是最小货币单位
* @apiParam (JSON) {Double} rate 交易时使用的汇率1AUD=?CNY
* @apiParam (JSON) {String} currency 币种AUD
* @apiParam (JSON) {String} channel 支付渠道 Alipay|支付宝Wechat|微信Bestpay|翼支付
* @apiParam (JSON) {String} create_time 订单创建时间格式为'yyyy-MM-dd HH:mm:ss'GMT+10
* @apiParam (JSON) {String} pay_time 订单支付时间格式为'yyyy-MM-dd HH:mm:ss'GMT+10
*
* @apiSuccess {String} return_code SUCCESS
*/
/**
* @api {PUT} /api/v1.0/jd_gateway/partners/{partner_code}/orders/{order_id} 创建京东Web订单
* @apiName JDAPI
* @apiDescription
* 用于PC端京东支付创建订单后跳转到返回的pay_url需附加签名参数和redirect参数随后进入京东支付页面完成支付
* 该接口仅现仅支持京东支付<br>
* <img src="img/jd_cn.png">
* @apiVersion 1.0.0
* @apiGroup JD_Online_Payment
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求同一商户唯一
* @apiUse Sign
* @apiParam (JSON) {String} description 必填订单标题最大长度128字符超出自动截取
* @apiParam (JSON) {String} user_id 必填商户平台用户的唯一账号
* @apiParam (JSON) {String} mobile 必填商户平台用户的手机号
* @apiParam (JSON) {int} price 必填金额单位为货币最小单位例如使用100表示AUD1.00
* @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码
* @apiParam (JSON) {String} notify_url 支付通知url详见支付通知api不填则不会推送支付通知
* @apiParam (JSON) {String} operator 操作人员标识
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code SUCCESS表示创建订单成功EXISTS表示订单已存在
* @apiSuccess {String} partner_code 商户编码
* @apiSuccess {String} full_name 商户注册全名
* @apiSuccess {String} partner_name 商户名称
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID最终支付成功的订单ID可能不同
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {String} pay_url 跳转URL
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付
*
*/
/**
* @api {PUT} /api/v1.0/alipay/partners/{partner_code}/orders/{order_id} 创建支付宝Web订单
* @apiName AlipayOnline
* @apiDescription
* 用于PC端支付宝支付创建订单后跳转到返回的pay_url需附加签名参数和redirect参数随后进入支付宝支付页面完成支付
* 该接口仅现仅支持支付宝<br>
* <img src="img/alipayOnline_cn.png">
* @apiVersion 1.0.0
* @apiGroup Alipay_Online_Payment
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求同一商户唯一
* @apiUse Sign
* @apiParam (JSON) {String} description 必填订单标题最大长度128字符超出自动截取
* @apiParam (JSON) {int} price 必填金额单位为货币最小单位例如使用100表示AUD1.00
* @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码
* @apiParam (JSON) {String} notify_url 支付通知url详见支付通知api不填则不会推送支付通知
* @apiParam (JSON) {String} operator 操作人员标识
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code SUCCESS表示创建订单成功EXISTS表示订单已存在
* @apiSuccess {String} partner_code 商户编码
* @apiSuccess {String} full_name 商户注册全名
* @apiSuccess {String} partner_name 商户名称
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID最终支付成功的订单ID可能不同
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {String} pay_url 跳转URL
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付
*
*/
/**
* @api {PUT} /api/v1.0/alipay/partners/{partner_code}/app_orders/{order_id} 创建支付宝SDK订单
* @apiName AlipaySDK
* @apiDescription
* 用于移动端APP调用支付宝SDK支付调用API创建订单得到支付宝SDK调用参数将参数传递给SDK拉起支付宝支付并由支付宝客户端直接返回支付结果
* <b>强烈建议获得支付结果后再调用RoyalPay订单查询API确认完成支付后再进行后续流程避免因超时自动撤单导致资金损失</b><br>
* <img src="img/sdk_api_payment.jpg"><br>
* 关于客户端和支付宝整合的更多信息: <a href="https://global.alipay.com/service/app_split_cn/6">支付宝SDK文档</a><br>
* <a href="resources/api/alipaySdk-20160825.jar">SDK for Android</a><br>
* <a href="resources/api/AlipaySDKForiOS.zip">SDK for iOS</a>
*
* @apiVersion 1.0.0
* @apiGroup SDKPayment
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code 必填商户编码由4位大写字母或数字构成
* @apiParam (PathVariable) {String} order_id 必填商户支付订单号要求同一商户唯一
* @apiUse Sign
* @apiParam (JSON) {String} description 必填订单标题最大长度128字符超出自动截取
* @apiParam (JSON) {int} price 必填金额单位为货币最小单位例如使用100表示AUD1.00
* @apiParam (JSON) {String=AUD,CNY} currency=AUD 币种代码
* @apiParam (JSON) {String} notify_url 支付通知url详见支付通知api不填则不会推送支付通知
* @apiParam (JSON) {String} operator 操作人员标识
* @apiParam (JSON) {String=android,iphone,ipad} system 客户端操作系统类型可选参数
* @apiParam (JSON) {String} version 客户端版本号可选参数
*
* @apiSuccess {String} return_code 执行结果
* @apiSuccess {String} result_code SUCCESS表示创建订单成功EXISTS表示订单已存在
* @apiSuccess {String} partner_code 商户编码
* @apiSuccess {String} full_name 商户注册全名
* @apiSuccess {String} partner_name 商户名称
* @apiSuccess {String} order_id RoyalPay订单ID同时也是微信订单ID最终支付成功的订单ID可能不同
* @apiSuccess {String} partner_order_id 商户订单ID
* @apiSuccess {String} sdk_params 调用SDK的参数字符串
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH 订单号与商户不匹配
* @apiError (ERROR_CODE) ORDER_PAID 订单已支付
*
*/
function apis() {
}

@ -0,0 +1,102 @@
# Overview
## 域名
#### 生产环境
[https://mpay.royalpay.com.au/](https://mpay.royalpay.com.au/)
#### 沙箱
[https://sandbox.royalpay.com.au/](https://sandbox.royalpay.com.au/)
沙箱测试参数和生产环境不同请联系RoyalPay客服帮助配置沙箱环境参数。
## 请求方式和参数格式
支付单和退款单提交均为PUT方式订单查询均为GET方式包含Request Entity的请求参数格式为json
除跳转页面外所有的Accept均为application/json所有的PUT/POST请求Content-Type为application/json
系统使用UTF-8字符集
参数分为三种Path Variable/Query Param/JSON entity
+ PathVariable:包含在URI内的参数
+ Query Param:在URI末尾?后的key=value形式的参数
+ JSON entity:只在PUT/POST请求中使用
所有返回JSON的API成功访问返回状态值均为200不论执行结果。JSON固定包含字段return_code若值为SUCCESS则表示执行成功
其他值表示执行失败此时可查询错误码了解对应的错误类型此时还会携带return_msg字段作为错误描述信息
## 多语言支持
系统错误提示支持中文、英文两种语言默认根据Request Header中的Accept-Language值自动选择如需调整亦可以添加locale cookie进行指定。
## 选择接入API
<img src="img/RoyalPay_Gateway_choose_cn.jpg">
## 支付宝渠道区分
支付宝根据调用接口不同分为线上和线下两个渠道,两个渠道分别使用不同的汇率和手续费费率,为避免混淆在此区分:
+ 线上渠道包含H5 Mobile、Web支付以及APP SDK(未上线)三种支付方式
+ 线下渠道包含JSAPI、QR Code、Retail Pay 3种支付方式
相似接口区别
- JSAPI和H5 MobileJSAPI只能在支付宝客户端内访问的页面调起支付H5可以在移动设备任意浏览器或App的WebView调起支付
- Web支付和QR Code: Web支付会跳转到支付宝官方收银台用户可以选择登陆账号或用客户端扫码完成支付QR Code方式商户可以自行展示创建的二维码也可以跳转到RoyalPay展示的收银台页面显示二维码用户只能用支付宝客户端扫码完成支付。
## 签名算法
每次请求都必须加入签名信息作为请求校验。校验参数全部以Query Param参数的方式附加在URL后面顺序不分先后。
签名过程:
1. 连接生成签名的原始字符串需要4个参数使用&连接,无需转码
> valid_string=partner_code&time&nonce_str&credential_code
参数说明:
- partner_code:商户编码由4位大写字母或数字构成
- time:UTC毫秒时间戳取当前UTC时间的毫秒数时间戳Long类型5分钟内有效
- nonce_str:随机字符串无长度限制请使用URL安全字符避开&,=等符号请注意HTTP URL的最大长度限制建议长度在10到30位
- credential_code:系统为商户分配的开发校验码,请妥善保管,不要在公开场合泄露
2. 使用SHA256进行签名并转为Hex小写字符串
> sign=hex(sha256(valid_string)).toLowerCase()
3. 在请求中把签名使用的time,nonce_str和生成的sign一同作为Query Param参数发送
> 案例
>
> valid_string=RPAY&1468691301081&aaf2a94c8c2d56d5b43a1a3d9d811102&pQ5Jc9eoTcsxqPY5uQ3p2WmvSy0zEYeP
> sign=64712672795f94fa3bfb2e88ac09cb75d09bcf8a3c3dcaa529d8290dd6587060
> 测试地址:<a href="https://mpay.royalpay.com.au/sign_test.html" target="_blank">https://mpay.royalpay.com.au/sign_test.html</a>
## 币种代码
由于微信端限制原因RoyalPay只接受人民币和澳元两个币种的支付订单
- AUD:澳元
- CNY:人民币
## 业务规则
- QRCode支付是在网页上展示二维码用户使用微信扫一扫扫码后直接进入微信支付页面适用于商城类web网站
- JSAPI支付是在微信浏览器内直接跳转到RoyalPay让用户选择支付订单页面只能在微信客户端打开适用于微店
- 创建订单时需要提供订单号,同一个订单允许重复提交,系统会自动根据订单状态判断是否创建新订单并关闭旧订单。因此商户端应该同一个订单只用一个单号,避免重复付款;
- 由于存在自动创建新订单机制创建订单后返回的RoyalPay单号不代表最终支付的单号
- QRCode支付订单创建后会直接返回QRCode和pay_url商户可以自行选择展示支付二维码或跳转至RoyalPay支付页
- JSAPI支付订单创建后会返回pay_url商户应该跳转到这个地址让用户完成支付
- 跳转pay_url时必须加上签名信息
- 每次请求都应该生成新的签名;
- 订单成功支付后会调用订单中提供的notify_url详情可以查看API定义若创建订单时未提供商户需要在创建订单后轮询订单状态接口直到订单被支付或过期
- 订单支付有效期为5分钟超时可以用相同的订单号重新发起请求建议重新发起请求的时机为用户再次打开支付页的时候
- 使用跳转支付页前应该先调用后台服务输入金额等参数创建订单后再跳转;
- 创建订单、创建退款接口都允许同订单号重复调用,但是具体参数以初次请求的参数为准;
- 所有和金额相关的数字均以货币最小面值为单位以AUD为例100表示AUD 1.00。
## 案例
<a href="https://example.royalpay.com.au/api/payment/order" target="_blank">https://example.royalpay.com.au/api/payment/order</a>
<img src="/static/images/demo_qrcode.gif" style="width:300px">
## 示例代码
- PHP: [https://mpay.royalpay.com.au/static/phpdemo.zip](https://mpay.royalpay.com.au/static/phpdemo.zip)
- Java: [https://mpay.royalpay.com.au/static/javademo.zip](https://mpay.royalpay.com.au/static/javademo.zip)

@ -0,0 +1,42 @@
{
"name": "RoyalPay Gateway Payment API",
"version": "1.1.0",
"description": "RoyalPay Gateway Payment API for Third-Party Developers",
"title": "RoyalPay Gateway Payment API",
"url": "https://mpay.royalpay.com.au",
"header":{
"title":"Overview",
"filename":"overview.md"
},
"order":[
"Overview",
"QRCode",
"NewQRCode",
"QRCodePay",
"JSApi",
"NewJSAPI",
"WxJSAPIPay",
"AliJSAPIPay",
"MobileH5",
"NewMobileH5Pay",
"MobileH5Pay",
"RetailPay",
"RetailMicroPay",
"RetailQRCode",
"JD_Online_Payment",
"Alipay_Online_Payment",
"SDKPayment",
"CommonApi",
"GetExchange",
"OrderStatus",
"RefundOrder",
"RefundQuery",
"ListOrder",
"ListTransaction",
"SettleLog",
"PayNotice"
],
"template":{
"forceLanguage":"en"
}
}

@ -0,0 +1,771 @@
/**
* @apiDefine API API
* API List
*/
/**
* @apiDefine Sign
* @apiParam (QueryParam) {Long} time Required, UTC timestamp in milliseconds
* @apiParam (QueryParam) {String} nonce_str Required, Random string
* @apiParam (QueryParam) {String} sign Required, Sign
*/
/**
* @apiDefine PathVariable Path Variable
*/
/**
* @apiDefine QueryParam Query Params
*/
/**
* @apiDefine JSON JSON keys
*/
/**
* @apiDefine ERROR_CODE Error Code
*/
/**
* @apiDefine GlobalError
* @apiError (ERROR) return_code Error Code
* @apiError (ERROR) return_msg Error Description
* @apiError (ERROR_CODE) SYSTEMERROR Exception inside system
* @apiError (ERROR_CODE) INVALID_SHORT_ID Partner code is invalid or there is no partner associated with this code
* @apiError (ERROR_CODE) SIGN_TIMEOUT Sign expired, the difference between time and the server time is more than 5 minutes
* @apiError (ERROR_CODE) INVALID_SIGN Invalid sign
* @apiError (ERROR_CODE) PARAM_INVALID Parameters are invalid. See return_msg for more details.
* @apiError (ERROR_CODE) NOT_PERMITTED Gateway payment permission has not been enabled for this partner
* @apiError (ERROR_CODE) INVALID_CHANNEL Channel name is not available, check the Capitalize
*
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/exchange_rate Get Current Exchange Rate
* @apiName GetExchange
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription
* Get current exchange rate from AUD to CNY provided by WeChat and Alipay(AUD 1=CNY ?). This exchange rate shown is for reference only, please refer to the real time exchange rate when processing the actual transaction.
* @apiHeader Accept application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner Code
* @apiUse Sign
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {Double} wechat_rate Exchange rate for WeChat
* @apiSuccess {Double} alipay_retail_rate Exchange rate for Alipay Retail Trade
* @apiSuccess {Double} alipay_online_rate Exchange rate for Alipay Online Trade
*
* @apiUse GlobalError
*/
/**
* @api {PUT} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id} Create QR Code Payment
* @apiName NewQRCode
* @apiGroup QRCode
* @apiVersion 1.0.0
* @apiDescription
* QR Code Payment is used for webpage/application on PC. Customers use WeChat or Alipay app to scan QR Code generated when creating order and finish the payment.<br>
* <img src="img/QRCODE_process_en.png"><br>
* Return value contains QR Code string, QR Ccode image and payment page address. Partners can decide how to finish the payment.
* If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD,
* otherwise user will get Invalid Amount Error from WeChat when making the payment.
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner Code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. Shall be unique for the same partner. If repeated, order will be recognized as an existing order.
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Description of an order.
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String=Alipay,Wechat} channel Payment channel, case sensitive
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} channel Payment channel
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one.
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} code_url QR Code string. Partners can create the payment QR Code according to this value.
* @apiSuccess {String} qrcode_img QR Code image formatted in Base64. Can be used as the src attribute on img element
* @apiSuccess {String} pay_url Payment page in RoyalPay
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner.
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/pay QR Code Payment Page in RoyalPay
* @apiName QRCodePay
* @apiDescription
* This page mush be called after payment order has been created.
* When jumping back to redirection URL, it is recommended to call the order query API to make sure the payment has succeeded.
* @apiVersion 1.0.0
* @apiGroup QRCode
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. It shall have already been created
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect Required, Redirect url when payment succeeded. Contain sign parameters for validation.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/
/**
* @api {PUT} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id} Create H5 Payment
* @apiName NewMobileH5Pay
* @apiGroup MobileH5
* @apiVersion 1.0.0
* @apiDescription
* <b>WarningH5 Payment socket requires application separately and requires agreement from Tencent. Merchants who needs this socket please contact RoyalPay first.
* Alipay has no limit at the moment.</b><br>
* H5 Payment is used for payment in Webpage or App on mobile outside WeChat or Alipay App. The browser would redirect to a webpage from WeChat or Alipay and call the App to finish the payment.<br>
* Return value contains a payment page. Partners shall guide users to redirect to this page. Sign params are required.
* If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD,
* otherwise user will get Invalid Amount Error from WeChat when making the payment.<br>
* <img src="img/h5_api_payment.jpg">
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD currency
* @apiParam (JSON) {String=Alipay,Wechat} channel Payment channel, case sensitive
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} channel Payment channel
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id.
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {GET} /api/v1.0/h5_payment/partners/{partner_code}/orders/{order_id}/pay H5 Payment Page
* @apiName MobileH5Pay
* @apiDescription This page mush be called after payment order has been created.
* When jumping back to redirection URL, it is recommended to call the order query API to make sure the payment has succeeded.
* @apiVersion 1.0.0
* @apiGroup MobileH5
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. It shall have already been created
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect Required, Redirect url when payment succeeded. Contain sign parameters for validation.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/
/**
* @api {PUT} /api/v1.0/wechat_jsapi_gateway/partners/{partner_code}/orders/{order_id} Create JSAPI Payment Order
* @apiName NewJSAPI
* @apiGroup JSApi
* @apiVersion 1.1.0
* @apiDescription
* JSAPI Payment is used to pay in webpage which was opened in WeChat or Alipay App. If customers enter this page from WeChat Official Account, this Official Account is required to be authorized.
* Customers will jump to RoyalPay order page and call WeChat or Alipay Payment Board to finish payment.<br>
* <img src="img/JSAPI_process_en.png"><br>
* Return value contains a payment page. Partners shall guide users to redirect to the page. Sign params is required when redirect happens.
* If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD,
* otherwise user will get Invalid Amount Error from WeChat when making the payment.
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD currency
* @apiParam (JSON) {String=Alipay,Wechat} channel Payment channel, case sensitive
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} channel Payment Channel
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay. Can only be accessed through WeChat
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {GET} /api/v1.0/wechat_jsapi_gateway/partners/{partner_code}_order_{order_id} WeChat JSAPI Payment Page in RoyalPay
* @apiName WxJSAPIPay
* @apiDescription This page must be called after Payment Order has been created. Actural url shall be according to pay_url param from order creation
* @apiVersion 1.0.0
* @apiGroup JSApi
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. Must have already been created
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect Required, Redirect url when the payment succeeded
* @apiParam (QueryParam) {Boolean=true,false} directpay='false' whether open direct pay mode.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/
/**
* @api {GET} /api/v1.0/gateway/alipay/partners/{partner_code}/orders/{order_id}/app_pay Alipay JSAPI Payment Page in RoyalPay
* @apiName AliJSAPIPay
* @apiDescription This page must be called after Payment Order has been created. Actural url shall be according to pay_url param from order creation
* @apiVersion 1.0.0
* @apiGroup JSApi
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. Must have already been created
* @apiUse Sign
* @apiParam (QueryParam) {String} redirect Required, Redirect url when the payment succeeded
* @apiParam (QueryParam) {Boolean=true,false} directpay='false' whether open direct pay mode.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*/
/**
* @api {PUT} /api/v1.0/micropay/partners/{partner_code}/orders/{order_id} Create Retail Passive Payment Order
* @apiName RetailMicroPay
* @apiDescription
* Retail Passive Payment is used for cashier terminals which can scan BarCode or QRCode.
* Shop staff input the payment amount and ask customers for their payment code, then system send price and payment code to server and finish the payment.
* Retail Passive Payment now support both Alipay and WeChat<br>
* <img src="img/Retail_en.png">
* @apiVersion 1.0.2
* @apiGroup RetailPay
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD currency
* @apiParam (JSON) {String} device_id Required, ID of the device which sends the request
* @apiParam (JSON) {String} auth_code Required, The Payment QR Code scanned from customer's WeChat Wallet.
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code Order status
* <ul>
* <li>PAYING:Waiting for payment</li>
* <li>CREATE_FAIL:Fail to create order</li>
* <li>CLOSED:Order closed</li>
* <li>PAY_FAIL:Payment failed</li>
* <li>PAY_SUCCESS:Payment succeeded</li>
* </ul>
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id.
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {int} total_fee Order amount, which uses the base unit of current currency
* @apiSuccess {int} real_fee Actual paid amount.(The same as total fee at the moment. After coupon feature is finished, this may be different.)
* @apiSuccess {String} pay_time Time when order is paid(yyyy-MM-dd HH:mm:ss, UTC+10)
* @apiSuccess {String} create_time Time when order is created(according to the latest order)(yyyy-MM-dd HH:mm:ss, UTC+10)
* @apiSuccess {String} currency Currency. Default value is AUD.
* @apiSuccess {String} channel Currency. Channel. Alipay,Wechat,Bestpay.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order ID does not belongs to current partner.
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
* @apiError (ERROR_CODE) AUTHCODEEXPIRE QR Code expired
* @apiError (ERROR_CODE) NOTENOUGH The customer does not have enough balance to finish the payment
* @apiError (ERROR_CODE) NOTSUPORTCARD Card type is not supported
* @apiError (ERROR_CODE) AUTH_CODE_ERROR Payment QR Code has been used twice
* @apiError (ERROR_CODE) AUTH_CODE_INVALID The submitted QR Code is not a WeChat Payment QR Code
*/
/**
* @api {PUT} /api/v1.0/retail_qrcode/partners/{partner_code}/orders/{order_id} Create Retail Active Payment Order
* @apiName RetailQRCode
* @apiGroup RetailPay
* @apiVersion 1.0.2
* @apiDescription
* Retail Active Payment is used for cashier terminals which cannot scan Barcode or QRCode.
* Get the Code url after create the order, convert this url to a QRCode and ask customers use their app to scan this QRCode then finish the payment.
* Retail Active Payment now support Alipay, WeChat and Bestpay<br>
* <img src="img/RetailQR_en.png"><br>
* If the currency is CNY, equivalent AUD amount shall never less than 0.01AUD,
* otherwise user will get Invalid Amount Error from WeChat when making the payment.
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner Code
* @apiParam (PathVariable) {String} order_id Required, Partner order id. Shall be unique for the same partner. If repeated, order will be recognized as an existed order.
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Description of order.
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String} device_id Required, ID of the device which sends the request.
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} code_url QR Code string. Partners can create the payment QR Code according to this value.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner.
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id} Query Order Status
* @apiName OrderStatus
* @apiGroup CommonApi
* @apiVersion 1.0.1
* @apiDescription Including QR Code orders, JSAPI orders and Retail orders
* @apiHeader Accept application/json
*
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code
* <ul>
* <li>PAYING: Waiting for payment</li>
* <li>CREATE_FAIL: Fail to create order</li>
* <li>CLOSED: Order closed</li>
* <li>PAY_FAIL: Payment failed</li>
* <li>PAY_SUCCESS: Payment succeeded</li>
* <li>PARTIAL_REFUND: Partial refunded</li>
* <li>Full_REFUND: Full refunded</li>
* </ul>
* Use the same order id to call create order API can renew the order. PAYING, PAY_SUCCESS orders cannot be renewed.
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {int} total_fee Order amount, which uses the base unit of current currency
* @apiSuccess {int} real_fee Actual paid amount.(Equal to total fee at the moment. After coupon feature is finished, this value may be different. )
* @apiSuccess {Double} rate Exchange Rate used while trading. 1AUD=?CNY
* @apiSuccess {String} pay_time Time when order is paid(yyyy-MM-dd HH:mm:ss, UTC+10)
* @apiSuccess {String} create_time Time when order is created(according to the latest order)(yyyy-MM-dd HH:mm:ss, UTC+10)
* @apiSuccess {String} currency Currency. Default value is AUD.
* @apiSuccess {String} channel Channel. Alipay,Wechat,Bestpay.
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
*
*/
/**
* @api {PUT} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/refunds/{refund_id} Apply for Refund
* @apiName RefundOrder
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiDescription
* One payment order can create more than one refund orders. Total amount of all refund orders must be less than or equal to the actual paid amount and the currency of refund order is the same as the payment order.
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner payment order id
* @apiParam (PathVariable) {String} refund_id Required, Partner refund order id
* @apiUse Sign
* @apiParam (JSON) {int} fee Required, Refund amount. Use base unit of the currency. Total amount of all refund orders must be less than actual paid amount.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code
* <ul>
* <li>WAITING: Order is being submitted to WeChat</li>
* <li>CREATE_FAILED: Fail to submit to WeChat</li>
* <li>SUCCESS: Submission succeeded</li>
* <li>FAILED: Refund failed</li>
* <li>FINISHED: Refund success(funds has already been returned to user's account)</li>
* <li>CHANGE: Refund can not return to user's account. Manual operation is required</li>
* </ul>
* @apiSuccess {String} refund_id RoyalPay Refund id
* @apiSuccess {String} partner_refund_id Partner refund id
* @apiSuccess {int} amount Refund amount
* @apiSuccess {String} currency Refund currency
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Payment order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Payment order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_NOT_PAID Payment order is not paid
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders/{order_id}/refunds/{refund_id} Query Refund Order Status
* @apiName RefundQuery
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
*
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner payment order id
* @apiParam (PathVariable) {String} refund_id Required, Partner refund order id
* @apiUse Sign
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code
* <ul>
* <li>WAITING: Order is being submitted to WeChat</li>
* <li>CREATE_FAILED: Fail to submit to WeChat</li>
* <li>SUCCESS: Submission succeeded</li>
* <li>FAILED: Refund failed</li>
* <li>FINISHED: Refund succeeded(funds have already been returned to user's account)</li>
* <li>CHANGE: Refund can not return to user's account. Manual operation is required</li>
* </ul>
* @apiSuccess {String} refund_id RoyalPay Refund id
* @apiSuccess {String} partner_refund_id Partner refund id
* @apiSuccess {int} amount refund Amount
* @apiSuccess {String} currency Refund currency
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_NOT_EXIST Payment order does not exist
* @apiError (ERROR_CODE) ORDER_MISMATCH Payment order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_NOT_PAID Payment order is not paid
* @apiError (ERROR_CODE) REFUND_NOT_EXIST Refund order does not exist
* @apiError (ERROR_CODE) REFUND_MISMATCH Refund order is not belong to this payment order
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/orders Check Orders
* @apiName ListOrder
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription
* Get a list of orders. This api may change in the future.
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiUse Sign
* @apiParam (QueryParam) {String} date Payment order creation date,which is formatted in 'yyyyMMdd' ,UTC+10. Query all orders if not provided
* @apiParam (QueryParam) {String='ALL','PAID','REFUNDED'} status='ALL'
* Order status
* <ul>
* <li>ALL: All orders, including orders not paid and closed</li>
* <li>PAID: Only paid orders. including orders which have refunds.</li>
* <li>REFUNDED: Only orders which have refunds</li>
* </ul>
* @apiParam (QueryParam) {int} page=1 Page number. start with 1
* @apiParam (QueryParam) {int} limit=10 Rows per page
*
* @apiSuccess (ROOT) {String} return_code Execution result
* @apiSuccess (ROOT) {JSON[]} data Orders list
* @apiSuccess (ROOT) {JSON} pagination Pagination information
* @apiSuccess (ROOT) {JSON} analysis Payment analysis
*
* @apiSuccess (data) {String} order_id RoyalPay Order ID
* @apiSuccess (data) {String} partner_order_id Partner Order ID
* @apiSuccess (data) {int} total_fee Order amount
* @apiSuccess (data) {int} real_fee Actual paid amount
* @apiSuccess (data) {String} payment via channel: Alipay, Bestpay, Wechat
* @apiSuccess (data) {String} currency Currency
* @apiSuccess (data) {String} create_time Time when order is created, which is formatted in 'yyyy-MM-dd HH:mm:ss', UTC+10
* @apiSuccess (data) {String} pay_time Time when order is paid, which is formatted in 'yyyy-MM-dd HH:mm:ss', UTC+10. will be null if not paid
* @apiSuccess (data) {String} status
* order status
* <ul>
* <li>SUBMITTING: Submitting to wechat</li>
* <li>SUBMIT_FAIL: Submission failed</li>
* <li>WAITING_PAYMENT: Submission succeeded and wait for payment</li>
* <li>CLOSED: Order closed</li>
* <li>PAYMENT_FAIL: Payment failed</li>
* <li>SUCCESS: Payment succeeded</li>
* <li>PARTIAL_REFUND: Partial Refunded</li>
* <li>FULL_REFUND: Full Refunded</li>
* </ul>
* @apiSuccess (data) {String} order_body Order description
* @apiSuccess (data) {String} gateway
* <ul>
* <li>Retail In-Store: Paid from official EFTPos or App</li>
* <li>QRCODE: Paid from merchant static QR Code</li>
* <li>Online API: Paid from QR Code API<li>
* <li>WeChat HTML5: Paid from JSAPI</li>
* <li>Retail API: Paid from Retail API</li>
* <li>Mobile H5: Paid from H5 Api</li>
* </ul>
* @apiSuccess (data) {String} partner_code Partner code
* @apiSuccess (data) {String} partner_name Partner name
* @apiSuccess (data) {String} refund_fee Total refund amount of this order
*
* @apiSuccess (pagination) {int} page Page number,start with 1
* @apiSuccess (pagination) {int} limit Rows per page
* @apiSuccess (pagination) {int} totalCount Total rows
* @apiSuccess (pagination) {int} totalPages Total pages
*
* @apiSuccess (analysis) {int} order_count Order count of successful payment (including orders which have refunds)
* @apiSuccess (analysis) {int} total_fee Total amount
* @apiSuccess (analysis) {int} real_fee Actual paid amount
*
* @apiUse GlobalError
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/transactions Query Daily Transactions
* @apiName ListTransaction
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription This Api will list all transactions for current merchant in the day,
* containing all payment methods(include no gateway methods) and all payment channels such as
* payment, RoyalPay discount cashback, refunds, credit for failure refunds, system pay back,
* cashback account income/outcome, etc. Settlement transactions will not be contained.<br>
* <b>Notice: A payment order or refund order can contains several transaction records</b>
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiUse Sign
* @apiParam (QueryParam) {String} date Required, Transaction date. Format as 'yyyyMMdd'GMT+10
*
* @apiSuccess (ROOT) {String} return_code Execution result,SUCCESS
* @apiSuccess (ROOT) {String} result_code Process result
* @apiSuccess (ROOT) {int} transaction_count transaction record count
* @apiSuccess (ROOT) {int} order_count payment order count
* @apiSuccess (ROOT) {int} refund_count refund order count
* @apiSuccess (ROOT) {JSON[]} transactions transaction list
*
* @apiSuccess (transactions) {String} transaction_time Trade time, format as yyyyMMddHHmmssGMT+10
* @apiSuccess (transactions) {String} order_id RoyalPay Order ID
* @apiSuccess (transactions) {String} partner_order_id Partner Order ID
* @apiSuccess (transactions) {String} channel_order_id Order ID in payment channel (Alipay/Bestpay/Wechat)
* @apiSuccess (transactions) {String} refund_id RoyalPay Refund ID (Only in refunds or refunds failure cashback)
* @apiSuccess (transactions) {String} partner_refund_id Partner refund ID (Only in refunds or refunds failure cashback)
* @apiSuccess (transactions) {String} gateway Payment method
* <ul>
* <li>0: RoyalPay EftPOS Payment Code (Scan Payment Code displaying in customer's device)</li>
* <li>1: RoyalPay EftPOS Order Code (Customer scan QR Code displaying on POS screen)</li>
* <li>2: RoyalPay Static Merchant QRCode</li>
* <li>3: QRCode Gateway</li>
* <li>4: JSAPI Gateway</li>
* <li>5: Gateway for third-party EftPOS Payment Code</li>
* <li>6: Gateway for third-party EftPOS Order Code</li>
* <li>7: RoyalPay Static Merchant QRCode(deprecated)</li>
* <li>8: H5 Payment Gateway</li>
* </ul>
* @apiSuccess (transactions) {String} channel Payment Channel (Alipay, Wechat, Bestpay)
* @apiSuccess (transactions) {String} type Trade Direction
* <ul>
* <li>Credit: Income</li>
* <li>Debit: Outcome</li>
* </ul>
* @apiSuccess (transactions) {String} currency currency(AUD/CNY)
* @apiSuccess (transactions) {int} total_amount Total payment amount, which uses the base unit of order currency
* @apiSuccess (transactions) {int} input_amount Order input amount, which uses the base unit of order currency
* @apiSuccess (transactions) {int} settle_amount Settle amount, AUD cents
* @apiSuccess (transactions) {double} exchange_rate Using exchange rate
* @apiSuccess (transactions) {String} remark Remark
*
* @apiUse GlobalError
*/
/**
* @api {GET} /api/v1.0/gateway/partners/{partner_code}/transactions Query Settlement Details
* @apiName SettleLog
* @apiGroup CommonApi
* @apiVersion 1.0.0
* @apiDescription This Api will list all transactions with the settlement this day,
* containing all payment methods(include no gateway methods) and all payment channels such as
* payment, RoyalPay discount cashback, refunds, credit for failure refunds, system pay back,
* cashback account income/outcome, etc.<br>
* <b>Notice: A payment order or refund order can contains several transaction records</b>
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiUse Sign
* @apiParam (QueryParam) {String} date Required, Transaction date. Format as 'yyyyMMdd'GMT+10
*
* @apiSuccess (ROOT) {String} return_code Execution result,SUCCESS
* @apiSuccess (ROOT) {String} result_code Process result
* @apiSuccess (ROOT) {String} settle_from Transaction date from,yyyyMMdd
* @apiSuccess (ROOT) {String} settle_to Transaction date to, yyyyMMdd
* @apiSuccess (ROOT) {String} settle_days Settle delay(T+n)
* @apiSuccess (ROOT) {int} transaction_count transaction record count
* @apiSuccess (ROOT) {int} order_count payment order count
* @apiSuccess (ROOT) {int} refund_count refund order count
* @apiSuccess (ROOT) {int} total_credit Total credit amount (AUD cent)
* @apiSuccess (ROOT) {int} total_debit Total debit amount (AUD cent)
* @apiSuccess (ROOT) {int} total_surcharge Total surcharge amount(AUD cent)
* @apiSuccess (ROOT) {int} total_transfer Total amount sending to merchant's bank account(AUD cent)
* @apiSuccess (ROOT) {JSON[]} transactions transaction list
*
* @apiSuccess (transactions) {String} transaction_time Trade time, format as yyyyMMddHHmmssGMT+10
* @apiSuccess (transactions) {String} order_id RoyalPay Order ID
* @apiSuccess (transactions) {String} partner_order_id Partner Order ID
* @apiSuccess (transactions) {String} channel_order_id Order ID in payment channel (Alipay/Bestpay/Wechat)
* @apiSuccess (transactions) {String} refund_id RoyalPay Refund ID (Only in refunds or refunds failure cashback)
* @apiSuccess (transactions) {String} partner_refund_id Partner refund ID (Only in refunds or refunds failure cashback)
* @apiSuccess (transactions) {String} gateway Payment method
* <ul>
* <li>0: RoyalPay EftPOS Payment Code (Scan Payment Code displaying in customer's device)</li>
* <li>1: RoyalPay EftPOS Order Code (Customer scan QR Code displaying on POS screen)</li>
* <li>2: RoyalPay Static Merchant QRCode</li>
* <li>3: QRCode Gateway</li>
* <li>4: JSAPI Gateway</li>
* <li>5: Gateway for third-party EftPOS Payment Code</li>
* <li>6: Gateway for third-party EftPOS Order Code</li>
* <li>7: RoyalPay Static Merchant QRCode(deprecated)</li>
* <li>8: H5 Payment Gateway</li>
* </ul>
* @apiSuccess (transactions) {String} channel Payment Channel (Alipay, Wechat, Bestpay)
* @apiSuccess (transactions) {String} type Trade Direction
* <ul>
* <li>Credit: Income</li>
* <li>Debit: Outcome</li>
* </ul>
* @apiSuccess (transactions) {String} currency currency(AUD/CNY)
* @apiSuccess (transactions) {int} total_amount Total payment amount, which uses the base unit of order currency
* @apiSuccess (transactions) {int} input_amount Order input amount, which uses the base unit of order currency
* @apiSuccess (transactions) {int} settle_amount Amount to make settlement, AUD cents
* @apiSuccess (transactions) {String} surcharge_rate Rate of surcharge (x%)
* @apiSuccess (transactions) {int} surcharge Surcharge amount, AUD cents
* @apiSuccess (transactions) {int} transfer_amount Amount send to merchant's bank account, AUD cents
* @apiSuccess (transactions) {double} exchange_rate Using exchange rate
* @apiSuccess (transactions) {String} remark Remark
*
* @apiUse GlobalError
*/
/**
* @api {POST} /notify_url Payment Success Notice
* @apiName PayNotice
* @apiGroup API
* @apiVersion 1.0.0
* @apiDescription
* If notify_url is provided when order is created. System will post request to this url when the payment succeeds. Request method is POST.
* Different from Server APIs, sign parameters will be included in json entity. Partner system shall valid them to prevent fake requests.
* Partner system shall response with correct parameters. If RoyalPay did not receive valid response, system will regard as receiving failed and retry the notification.
* System will retry up to3 times. Partner system shall be able to handle the repeated requests.
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (JSON) {long} time UTC timestamp in millis
* @apiParam (JSON) {String} nonce_str Random string
* @apiParam (JSON) {String} sign Sign
* @apiParam (JSON) {String} partner_order_id Partner order id
* @apiParam (JSON) {String} order_id RoyalPay order id
* @apiParam (JSON) {int} total_fee Order amount
* @apiParam (JSON) {int} real_fee Actual paid amount
* @apiParam (JSON) {Double} rate Exchange Rate used while trading. 1AUD=?CNY
* @apiParam (JSON) {String} currency Currency,AUD
* @apiParam (JSON) {String} channel Payment Channel AlipayWechatBestpay
* @apiParam (JSON) {String} create_time Time when order is created, which is formatted in 'yyyy-MM-dd HH:mm:ss', UTC+10
* @apiParam (JSON) {String} pay_time Time when order is paid, which is formatted in 'yyyy-MM-dd HH:mm:ss', UTC+10.
*
* @apiSuccess {String} return_code SUCCESS
*/
/**
* @api {PUT} /api/v1.0/jd_gateway/partners/{partner_code}/orders/{order_id} Create JD Payment Order
* @apiName JDPAY
* @apiDescription
* Use for JD Payment in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param.
* Then enter JD Pay page to finish payment.<br>
* JD Channel Only.<br>
* <img src="img/jd_en.png">
* @apiVersion 1.0.0
* @apiGroup JD_Online_Payment
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {String} user_id RequiredOnly account number of the user on the merchant platform
* @apiParam (JSON) {String} mobile RequiredMobile phone
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency (cent).
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay. Can only be accessed through WeChat
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {PUT} /api/v1.0/alipay/partners/{partner_code}/orders/{order_id} Create Alipay Online Order
* @apiName AlipayOnline
* @apiDescription
* Use for Alipay Payment in PC Website. After create order, jump to the pay_url returned and attach sign params and redirect param.
* Then enter Alipay page to finish payment.<br>
* Alipay Channel Only.<br>
* <img src="img/alipayOnline_en.png">
* @apiVersion 1.0.0
* @apiGroup Alipay_Online_Payment
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} pay_url Payment page in RoyalPay. Can only be accessed through WeChat
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
/**
* @api {PUT} /api/v1.0/alipay/partners/{partner_code}/app_orders/{order_id} 创建支付宝SDK订单
* @apiName AlipaySDK
* @apiDescription
* Used for mobile Apps calling Alipay payment with Alipay SDK. Call this api to create order and get param string for SDK calling. Call SDK api with the param to start payment and get payment result from Alipay app
* <b>It is strongly advised to request RoyalPay order query Api to confirm that the order has been paid in order to cancelling order by system at the same time.</b><br>
* <img src="img/sdk_api_payment.jpg"><br>
* More information for integration with Alipay: <a href="https://global.alipay.com/service/app_split/6">Alipay SDK Document</a><br>
* <a href="resources/api/alipaySdk-20160825.jar">SDK for Android</a><br>
* <a href="resources/api/AlipaySDKForiOS.zip">SDK for iOS</a>
* @apiVersion 1.0.0
* @apiGroup SDKPayment
* @apiHeader Accept application/json
* @apiHeader Content-Type application/json
* @apiParam (PathVariable) {String} partner_code Required, Partner code
* @apiParam (PathVariable) {String} order_id Required, Partner order id
* @apiUse Sign
* @apiParam (JSON) {String} description Required, Order description
* @apiParam (JSON) {int} price Required, Price of the order. Use the base unit of the currency.
* @apiParam (JSON) {String=AUD,CNY} currency=AUD Currency
* @apiParam (JSON) {String} notify_url System will call the notify url if provided when the payment succeeds
* @apiParam (JSON) {String} operator Note for the operator who created this order.
* @apiParam (JSON) {String=android,iphone,ipad} system os type of client app, optional
* @apiParam (JSON) {String} version client app version, optional
*
* @apiSuccess {String} return_code Execution result
* @apiSuccess {String} result_code SUCCESS means order created successfully, EXISTS means order has already existed.
* @apiSuccess {String} partner_code Partner code
* @apiSuccess {String} full_name Partner's full company name when registered
* @apiSuccess {String} partner_name Partner's name
* @apiSuccess {String} order_id Order id in RoyalPay, which is also WeChat order id. The final order id which is paid may be different from this one
* @apiSuccess {String} partner_order_id Partner order id
* @apiSuccess {String} sdk_params param string for calling SDK
*
* @apiUse GlobalError
* @apiError (ERROR_CODE) ORDER_MISMATCH Order is not belong to this partner
* @apiError (ERROR_CODE) ORDER_PAID Order has already been paid
*
*/
function apis() {
}

@ -0,0 +1,103 @@
# Overview
## Domain
#### Production Environment
[https://mpay.royalpay.com.au/](https://mpay.royalpay.com.au/)
#### Sandbox Environment
[https://sandbox.royalpay.com.au/](https://sandbox.royalpay.com.au/)
Sandbox has different sign parameters. Contact us to configure it for you.
## Request And Parameters
Request for payment or refund shall use PUT method. Request for querying order
shall use GET method. All requests including Request Entity are in JSON format.
Accept in the request header shall be set to application/json for all requests except redirect pages.
Content-Type in the request header shall be set to application/json for all PUT/POST requests.
System charset is UTF-8.
There are 3 groups of parameters: Path Variable, Query Param, JSON Entity
+ Path Variable: included in the path as patterns
+ Query Param: parameters after the URI '?' symbol and formatted like key=value
+ JSON Entity: only used in PUT/POST requests
Our API server will return 200 in JSON if the request has successfully reached the server, which does not indicate the success or failure of the actual operation. All responses in JSON format will include a return_code field which contains the operation result. The value SUCCESS indicates that the operation was successful while other values shows the type of error that happened. Response will also contain a return_msg field for detailed error message.
## Multi-Language
System error message supports Simplified Chinese and English. The system by default will automatically choose the language according to the Accept-Language value in request header. Cookie "locale" value (zh-CN or en-US) will affect the result language.
## Which Gateway Api is for me?
<img src="img/RoyalPay_Gateway_choose_en.jpg">
## Alipay Channels
According to different Api used, Alipay channel was distributed to Retail channel and Online channel. Two channels has different exchange rate and surcharge rate.
+ Online Channel: Including H5 Mobile, Online Payment and APP SDK(coming soon)
+ Retail Channel: Including JSAPI, QR Code Api, Retail Pay
Difference
- JSAPI and H5 Mobile: JSAPI can only be called in the web page opened in Alipay Client. H5 Mobile can call the payment panel in any browser or webview in App in the mobile device.
- Online Payment and QR Code: Online payment will jump to Alipay Official payment page. Customers can scan QR Code displayed in the page or sign in their account directly to finish payment. QR Code can provide a QR Code. Merchants can display this QR Code in their web page or jump to RoyalPay to display the QR Code. Customers can only scan the QR Code with their Alipay Client to finish payment.
## Sign Algorithm
Sign messages are required in each request for validation. Sign parameters are all attached to URL as query params, and the order is irrelevant.
Sign Program
1. Connect 4 parameters with '&' symbol into an original valid string. Escape value is not required.
> valid_string=partner_code&time&nonce_str&credential_code
Parameters
- partner_code: Code for partner, including four uppercase letters or numbers.
- time: UTC timestamp in milliseconds. Take current timestamp of UTC. Data type is Long. The difference between time and RoyalPay server time should be less than 5 minutes.
- nonce_str: Random string. No limit for length. URL-Safe characters are required. The proposed length is 10-30 characters.
- credential_code: Partner credential code for development provided by RoyalPay system. Keep it safe and never disclose it to the public. If compromised, contact us to change it.
2. Sign the valid string with SHA256 and turn to lowercase Hex string
> sign=hex(sha256(valid_string)).toLowerCase()
3. Include the time,nonce_str and sign into Query Param when calling api.
> Example
>
> valid_string=RPAY&1468691301081&aaf2a94c8c2d56d5b43a1a3d9d811102&pQ5Jc9eoTcsxqPY5uQ3p2WmvSy0zEYeP
> sign=64712672795f94fa3bfb2e88ac09cb75d09bcf8a3c3dcaa529d8290dd6587060
> Test Page<a href="https://mpay.royalpay.com.au/sign_test.html" target="_blank">https://mpay.royalpay.com.au/sign_test.html</a>
## Currency Codes
RoyalPay can only accept the following currencies at the moment. Please note that the settlement currency will always be Australian Dollar.
- AUD
- CNY
## Business Roles
- QR Code Payment displays a QR code image in a web page. Customers will scan the code via their WeChat and complete the payment in the linked web page. It is suitable for online shopping websites.
- JSAPI Payment redirects customers to a web page in WeChat. This page can only be opened within WeChat app and it is suitable for payment from micro-shops on WeChat platform.
- Retail passive payment(Scan Payment Code in customers WeChat Wallet) and active payment(Generate Payment QR Code for customers to scan) are used in retail environment such as payment terminals and pos machines.
- Order ID is required when creating an order. The same order id can be sent again. The system will decide to renew an order or close the old order according to the order status. System will recognise the same order id to avoid duplicated payments from customers.
- As orders can be resubmitted, Order ID returned by our server might not represent the last Order ID paid.
- QR Code order creation will return QR Code and pay_url. Merchants may decide whether to display the QR code on their website or to redirect customer to the payment page available at pay_url.
- JSAPI order creation will return pay_url. Merchants shall redirect customer to the payment page available at pay_url, and complete the payment.
- When redirecting to pay_url, sign information is required.
- Each request shall use new timestamp, nonce_str and sign.
- Our system will notify the caller after an order is paid successfully if notify_url was provided when creating an order. Otherwise, Merchants shall call the order query method repeatedly until order is paid or closed.
- Each unpaid order will be valid for 5 minutes. Expired order can be renewed with same the order id. It is suggested to trigger the event when user open the payment page again.
- Always redirect to RoyalPays payment page after calling the order creation method.
- Same order id is allowed in both creating new payment order and creating refund order but order details shall refer back to the initial request details.
- Price is specified in the base unit of the given currency. Using currency AUD as an example, 105 means 105 cents or $1.05.
## Demo
<a href="https://example.royalpay.com.au/api/payment/order" target="_blank">https://example.royalpay.com.au/api/payment/order</a>
<img src="/static/images/demo_qrcode.gif" style="width:300px">
## Demo Codes
- PHP: [https://mpay.royalpay.com.au/static/phpdemo.zip](https://mpay.royalpay.com.au/static/phpdemo.zip)
- Java: [https://mpay.royalpay.com.au/static/javademo.zip](https://mpay.royalpay.com.au/static/javademo.zip)

@ -0,0 +1,532 @@
/* ------------------------------------------------------------------------------------------
* Content
* ------------------------------------------------------------------------------------------ */
body {
min-width: 980px;
max-width: 1280px;
}
body, p, a, div, th, td {
font-family: "Source Sans Pro", sans-serif;
font-weight: 400;
font-size: 16px;
}
td.code {
font-size: 14px;
font-family: "Source Code Pro", monospace;
font-style: normal;
font-weight: 400;
}
#content {
padding-top: 16px;
z-Index: -1;
margin-left: 270px;
}
p {
color: #808080;
}
h1 {
font-family: "Source Sans Pro Semibold", sans-serif;
font-weight: normal;
font-size: 44px;
line-height: 50px;
margin: 0 0 10px 0;
padding: 0;
}
h2 {
font-family: "Source Sans Pro", sans-serif;
font-weight: normal;
font-size: 24px;
line-height: 40px;
margin: 0 0 20px 0;
padding: 0;
}
section {
border-top: 1px solid #ebebeb;
padding: 30px 0;
}
section h1 {
font-family: "Source Sans Pro", sans-serif;
font-weight: 700;
font-size: 32px;
line-height: 40px;
padding-bottom: 14px;
margin: 0 0 20px 0;
padding: 0;
}
article {
padding: 14px 0 30px 0;
}
article h1 {
font-family: "Source Sans Pro Bold", sans-serif;
font-weight: 600;
font-size: 24px;
line-height: 26px;
}
article h2 {
font-family: "Source Sans Pro", sans-serif;
font-weight: 600;
font-size: 18px;
line-height: 24px;
margin: 0 0 10px 0;
}
article h3 {
font-family: "Source Sans Pro", sans-serif;
font-weight: 600;
font-size: 16px;
line-height: 18px;
margin: 0 0 10px 0;
}
article h4 {
font-family: "Source Sans Pro", sans-serif;
font-weight: 600;
font-size: 14px;
line-height: 16px;
margin: 0 0 8px 0;
}
table {
border-collapse: collapse;
width: 100%;
margin: 0 0 20px 0;
}
th {
background-color: #f5f5f5;
text-align: left;
font-family: "Source Sans Pro", sans-serif;
font-weight: 700;
padding: 4px 8px;
border: #e0e0e0 1px solid;
}
td {
vertical-align: top;
padding: 2px 8px;
border: #e0e0e0 1px solid;
}
#generator .content {
color: #b0b0b0;
border-top: 1px solid #ebebeb;
padding: 10px 0;
}
.label-optional {
float: right;
}
.open-left {
right: 0;
left: auto;
}
/* ------------------------------------------------------------------------------------------
* apidoc - intro
* ------------------------------------------------------------------------------------------ */
#apidoc .apidoc {
border-top: 1px solid #ebebeb;
padding: 30px 0;
}
#apidoc h1 {
font-family: "Source Sans Pro", sans-serif;
font-weight: 700;
font-size: 32px;
line-height: 40px;
padding-bottom: 14px;
margin: 0 0 20px 0;
padding: 0;
}
#apidoc h2 {
font-family: "Source Sans Pro Bold", sans-serif;
font-weight: 600;
font-size: 22px;
line-height: 26px;
padding-top: 14px;
}
/* ------------------------------------------------------------------------------------------
* pre / code
* ------------------------------------------------------------------------------------------ */
pre {
background-color: #292b36;
color: #ffffff;
padding: 10px;
border-radius: 6px;
position: relative;
margin: 10px 0 20px 0;
}
code.language-text {
word-wrap: break-word;
}
pre.language-json {
overflow: auto;
}
pre.language-html {
margin: 40px 0 20px 0;
}
pre.language-html:before {
content: attr(data-type);
position: absolute;
top: -30px;
left: 0;
font-family: "Source Sans Pro", sans-serif;
font-weight: 600;
font-size: 15px;
display: inline-block;
padding: 2px 5px;
border-radius: 6px;
text-transform: uppercase;
background-color: #3387CC;
color: #ffffff;
}
pre.language-html[data-type="get"]:before {
background-color: green;
}
pre.language-html[data-type="put"]:before {
background-color: #e5c500;
}
pre.language-html[data-type="post"]:before {
background-color: #4070ec;
}
pre.language-html[data-type="delete"]:before {
background-color: #ed0039;
}
pre.language-api .str {
color: #ffffff;
}
pre.language-api .pln,
pre.language-api .pun {
color: #65B042;
}
pre code {
display: block;
font-size: 14px;
font-family: "Source Code Pro", monospace;
font-style: normal;
font-weight: 400;
word-wrap: normal;
white-space: pre;
}
pre code.sample-request-response-json {
white-space: pre-wrap;
max-height: 500px;
overflow: auto;
}
/* ------------------------------------------------------------------------------------------
* Sidenav
* ------------------------------------------------------------------------------------------ */
.sidenav {
width: 228px;
margin: 0;
padding: 20px;
position: fixed;
top: 0;
left: 0;
bottom: 0;
overflow-x: hidden;
overflow-y: auto;
background-color: #f5f5f5;
z-index: 10;
}
.sidenav > li > a {
display: block;
width: 192px;
margin: 0;
padding: 2px 11px;
border: 0;
border-left: transparent 4px solid;
border-right: transparent 4px solid;
font-family: "Source Sans Pro", sans-serif;
font-weight: 400;
font-size: 14px;
}
.sidenav > li.nav-header > a {
padding: 5px 15px;
border: 1px solid #e5e5e5;
width: 190px;
font-family: "Source Sans Pro", sans-serif;
font-weight: 700;
font-size: 16px;
background-color: #ffffff;
}
.sidenav > li.nav-header.active > a {
background-color: #0088cc;
}
.sidenav > .active > a {
position: relative;
z-index: 2;
}
.sidenav > li > a:hover {
background-color: #ffffff;
}
.sidenav > li.has-modifications a {
border-right: #60d060 4px solid;
}
.sidenav > li.is-new a {
border-left: #e5e5e5 4px solid;
}
/* ------------------------------------------------------------------------------------------
* Compare
* ------------------------------------------------------------------------------------------ */
ins {
background: #60d060;
text-decoration: none;
color: #000000;
}
del {
background: #f05050;
color: #000000;
}
.label-ins {
background-color: #60d060;
}
.label-del {
background-color: #f05050;
text-decoration: line-through;
}
pre.ins {
background-color: #60d060;
}
pre.del {
background-color: #f05050;
text-decoration: line-through;
}
table.ins th,
table.ins td {
background-color: #60d060;
}
table.del th,
table.del td {
background-color: #f05050;
text-decoration: line-through;
}
tr.ins td {
background-color: #60d060;
}
tr.del td {
background-color: #f05050;
text-decoration: line-through;
}
/* ------------------------------------------------------------------------------------------
* Spinner
* ------------------------------------------------------------------------------------------ */
#loader {
position: absolute;
width: 100%;
}
#loader p {
padding-top: 80px;
margin-left: -4px;
}
.spinner {
margin: 200px auto;
width: 60px;
height: 60px;
position: relative;
}
.container1 > div, .container2 > div, .container3 > div {
width: 14px;
height: 14px;
background-color: #0088cc;
border-radius: 100%;
position: absolute;
-webkit-animation: bouncedelay 1.2s infinite ease-in-out;
animation: bouncedelay 1.2s infinite ease-in-out;
/* Prevent first frame from flickering when animation starts */
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.spinner .spinner-container {
position: absolute;
width: 100%;
height: 100%;
}
.container2 {
-webkit-transform: rotateZ(45deg);
transform: rotateZ(45deg);
}
.container3 {
-webkit-transform: rotateZ(90deg);
transform: rotateZ(90deg);
}
.circle1 { top: 0; left: 0; }
.circle2 { top: 0; right: 0; }
.circle3 { right: 0; bottom: 0; }
.circle4 { left: 0; bottom: 0; }
.container2 .circle1 {
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.container3 .circle1 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
.container1 .circle2 {
-webkit-animation-delay: -0.9s;
animation-delay: -0.9s;
}
.container2 .circle2 {
-webkit-animation-delay: -0.8s;
animation-delay: -0.8s;
}
.container3 .circle2 {
-webkit-animation-delay: -0.7s;
animation-delay: -0.7s;
}
.container1 .circle3 {
-webkit-animation-delay: -0.6s;
animation-delay: -0.6s;
}
.container2 .circle3 {
-webkit-animation-delay: -0.5s;
animation-delay: -0.5s;
}
.container3 .circle3 {
-webkit-animation-delay: -0.4s;
animation-delay: -0.4s;
}
.container1 .circle4 {
-webkit-animation-delay: -0.3s;
animation-delay: -0.3s;
}
.container2 .circle4 {
-webkit-animation-delay: -0.2s;
animation-delay: -0.2s;
}
.container3 .circle4 {
-webkit-animation-delay: -0.1s;
animation-delay: -0.1s;
}
@-webkit-keyframes bouncedelay {
0%, 80%, 100% { -webkit-transform: scale(0.0) }
40% { -webkit-transform: scale(1.0) }
}
@keyframes bouncedelay {
0%, 80%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
} 40% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
}
/* ------------------------------------------------------------------------------------------
* Tabs
* ------------------------------------------------------------------------------------------ */
ul.nav-tabs {
margin: 0;
}
/* ------------------------------------------------------------------------------------------
* Print
* ------------------------------------------------------------------------------------------ */
@media print {
#sidenav,
#version,
#versions,
section .version,
section .versions {
display: none;
}
#content {
margin-left: 0;
}
a {
text-decoration: none;
color: inherit;
}
a:after {
content: " [" attr(href) "] ";
}
p {
color: #000000
}
pre {
background-color: #ffffff;
color: #000000;
padding: 10px;
border: #808080 1px solid;
border-radius: 6px;
position: relative;
margin: 10px 0 20px 0;
}
} /* /@media print */

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

@ -0,0 +1,672 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>RoyalPay网关支付接口</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="vendor/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="vendor/prettify.css" rel="stylesheet" media="screen">
<link href="css/style.css" rel="stylesheet" media="screen, print">
<link href="img/favicon.ico" rel="icon" type="image/x-icon">
<script src="vendor/polyfill.js"></script>
</head>
<body>
<script id="template-sidenav" type="text/x-handlebars-template">
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
{{#each nav}}
{{#if title}}
{{#if isHeader}}
{{#if isFixed}}
<li class="nav-fixed nav-header" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
{{else}}
<li class="nav-header" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
{{/if}}
{{else}}
<li {{#if hidden}}class="hide" {{/if}}data-group="{{group}}" data-name="{{name}}" data-version="{{version}}">
<a href="#api-{{group}}-{{name}}">{{title}}</a>
</li>
{{/if}}
{{/if}}
{{/each}}
</ul>
</nav>
</script>
<script id="template-project" type="text/x-handlebars-template">
<div class="text-center" style="margin-bottom: 15px">
<img src="img/logo_new.jpg">
</div>
<div class="pull-left">
<h1>{{name}}</h1>
{{#if description}}<h2>{{{nl2br description}}}</h2>{{/if}}
</div>
{{#if template.withCompare}}
<div class="pull-right">
<div class="btn-group">
<button id="version" class="btn btn-large dropdown-toggle" data-toggle="dropdown">
<strong>{{version}}</strong> <span class="caret"></span>
</button>
<ul id="versions" class="dropdown-menu open-left">
<li><a id="compareAllWithPredecessor" href="#">{{__ "Compare all with predecessor"}}</a></li>
<li class="divider"></li>
<li class="disabled"><a href="#">{{__ "show up to version:"}}</a></li>
{{#each versions}}
<li class="version"><a href="#">{{this}}</a></li>
{{/each}}
</ul>
</div>
</div>
{{/if}}
<div class="clearfix"></div>
</script>
<script id="template-header" type="text/x-handlebars-template">
{{#if content}}
<div id="api-_">{{{content}}}</div>
{{/if}}
</script>
<script id="template-footer" type="text/x-handlebars-template">
{{#if content}}
<div id="api-_footer">{{{content}}}</div>
{{/if}}
</script>
<script id="template-generator" type="text/x-handlebars-template">
{{#if template.withGenerator}}
{{#if generator}}
<div class="content">
{{__ "Generated with"}} <a href="{{{generator.url}}}">{{{generator.name}}}</a> {{{generator.version}}} - {{{generator.time}}}
</div>
{{/if}}
{{/if}}
</script>
<script id="template-sections" type="text/x-handlebars-template">
<section id="api-{{group}}">
<h1>{{underscoreToSpace title}}</h1>
{{#if description}}
<p>{{{nl2br description}}}</p>
{{/if}}
{{#each articles}}
<div id="api-{{group}}-{{name}}">
{{{article}}}
</div>
{{/each}}
</section>
</script>
<script id="template-article" type="text/x-handlebars-template">
<article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}">
<div class="pull-left">
<h1>{{article.groupTitle}}{{#if article.title}} - {{article.title}}{{/if}}</h1>
</div>
{{#if template.withCompare}}
<div class="pull-right">
<div class="btn-group">
<button class="version btn dropdown-toggle" data-toggle="dropdown">
<strong>{{article.version}}</strong> <span class="caret"></span>
</button>
<ul class="versions dropdown-menu open-left">
<li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
{{#each versions}}
<li class="version"><a href="#">{{this}}</a></li>
{{/each}}
</ul>
</div>
</div>
{{/if}}
<div class="clearfix"></div>
{{#if article.description}}
<p>{{{nl2br article.description}}}</p>
{{/if}}
{{#if_not_notice article.url}}
<pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{article.url}}</code></pre>
{{/if_not_notice}}
{{#if article.permission}}
<p>
{{__ "Permission:"}}
{{#each article.permission}}
{{name}}
{{#if title}}
&nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br description}}" title="" data-original-title="{{title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
{{#unless @last}}, {{/unless}}
{{/if}}
{{/each}}
</p>
{{/if}}
{{#if_gt article.examples.length compare=0}}
<ul class="nav nav-tabs nav-tabs-examples">
{{#each article.examples}}
<li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
<a href="#examples-{{../id}}-{{@index}}">{{title}}</a>
</li>
{{/each}}
</ul>
<div class="tab-content">
{{#each article.examples}}
<div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="examples-{{../id}}-{{@index}}">
<pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{content}}</code></pre>
</div>
{{/each}}
</div>
{{/if_gt}}
{{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}}
{{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
{{subTemplate "article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}}
{{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
{{subTemplate "article-sample-request" article=article id=id}}
</article>
</script>
<script id="template-article-param-block" type="text/x-handlebars-template">
{{#if params}}
{{#each params.fields}}
<h2>{{__ @key}}</h2>
<table>
<thead>
<tr>
<th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
{{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
<th style="width: {{#if ../../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
</tr>
</thead>
<tbody>
{{#each this}}
<tr>
<td class="code">{{{splitFill field "." "&nbsp;&nbsp;"}}}{{#if optional}} <span class="label label-optional">{{__ "optional"}}</span>{{/if}}</td>
{{#if ../../_hasType}}
<td>
{{{type}}}
</td>
{{/if}}
<td>
{{{nl2br description}}}
{{#if defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{defaultValue}}}</code></p>{{/if}}
{{#if size}}<p class="type-size">{{__ "Size range:"}} <code>{{{size}}}</code></p>{{/if}}
{{#if allowedValues}}<p class="type-size">{{__ "Allowed values:"}}
{{#each allowedValues}}
<code>{{{this}}}</code>{{#unless @last}}, {{/unless}}
{{/each}}
</p>
{{/if}}
</td>
</tr>
{{/each}}
</tbody>
</table>
{{/each}}
{{#if_gt params.examples.length compare=0}}
<ul class="nav nav-tabs nav-tabs-examples">
{{#each params.examples}}
<li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
<a href="#{{../section}}-examples-{{../id}}-{{@index}}">{{title}}</a>
</li>
{{/each}}
</ul>
<div class="tab-content">
{{#each params.examples}}
<div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="{{../section}}-examples-{{../id}}-{{@index}}">
<pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{{reformat content type}}}</code></pre>
</div>
{{/each}}
</div>
{{/if_gt}}
{{/if}}
</script>
<script id="template-article-sample-request" type="text/x-handlebars-template">
{{#if article.sampleRequest}}
<h2>{{__ "Send a Sample Request"}}</h2>
<form class="form-horizontal">
<fieldset>
<div class="control-group">
<div class="controls">
<div class="input-prepend">>
<span class="add-on">{{__ "url"}}</span>
<input type="text" class="input-xxlarge sample-request-url" value="{{article.sampleRequest.0.url}}" />
</div>
</div>
</div>
{{#if article.header}}
{{#if article.header.fields}}
<h3>{{__ "Headers"}}</h3>
{{#each article.header.fields}}
<h4><input type="radio" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch"{{#if_eq @index compare=0}} checked{{/if_eq}}> {{@key}}</h4>
<div class="{{../id}}-sample-request-header-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
{{#each this}}
<div class="control-group">
<label class="control-label" for="sample-request-header-field-{{field}}">{{field}}</label>
<div class="controls">
<div class="input-append">>
<input type="text" placeholder="{{field}}" class="input-xxlarge sample-request-header" data-sample-request-header-name="{{field}}" data-sample-request-header-group="sample-request-header-{{@../index}}">
<span class="add-on">{{{type}}}</span>
</div>
</div>
</div>
{{/each}}
</div>
{{/each}}
{{/if}}
{{/if}}
{{#if article.parameter}}
{{#if article.parameter.fields}}
<h3>{{__ "Parameters"}}</h3>
{{#each article.parameter.fields}}
<h4><input type="radio" data-sample-request-param-group-id="sample-request-param-{{@index}}" name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch"{{#if_eq @index compare=0}} checked{{/if_eq}}> {{@key}}</h4>
<div class="{{../id}}-sample-request-param-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
{{#each this}}
<div class="control-group">
<label class="control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
<div class="controls">
<div class="input-append">>
<input type="text" placeholder="{{field}}" class="input-xxlarge sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}">
<span class="add-on">{{{type}}}</span>
</div>
</div>
</div>
{{/each}}
</div>
{{/each}}
{{/if}}
{{/if}}
<div class="control-group">
<div class="controls">
<button class="btn btn-default sample-request-send" data-sample-request-type="{{article.type}}">{{__ "Send"}}</button>
</div>
</div>
<div class="sample-request-response" style="display: none;">
<h3>
{{__ "Response"}}
<button class="btn btn-small btn-default pull-right sample-request-clear">X</button>
</h3>
<pre class="prettyprint language-json" data-type="json"><code class="sample-request-response-json"></code></pre>
</div>
</fieldset>
</form>
{{/if}}
</script>
<script id="template-compare-article" type="text/x-handlebars-template">
<article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}" data-compare-version="{{compare.version}}">
<div class="pull-left">
<h1>{{underscoreToSpace article.group}} - {{{showDiff article.title compare.title}}}</h1>
</div>
<div class="pull-right">
<div class="btn-group">
<button class="btn btn-success" disabled>
<strong>{{article.version}}</strong> {{__ "compared to"}}
</button>
<button class="version btn btn-danger dropdown-toggle" data-toggle="dropdown">
<strong>{{compare.version}}</strong> <span class="caret"></span>
</button>
<ul class="versions dropdown-menu open-left">
<li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
<li class="divider"></li>
{{#each versions}}
<li class="version"><a href="#">{{this}}</a></li>
{{/each}}
</ul>
</div>
</div>
<div class="clearfix"></div>
{{#if article.description}}
<p>{{{showDiff article.description compare.description "nl2br"}}}</p>
{{else}}
{{#if compare.description}}
<p>{{{showDiff "" compare.description "nl2br"}}}</p>
{{/if}}
{{/if}}
<pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{{showDiff article.url compare.url}}}</code></pre>
{{subTemplate "article-compare-permission" article=article compare=compare}}
<ul class="nav nav-tabs nav-tabs-examples">
{{#each_compare_title article.examples compare.examples}}
{{#if typeSame}}
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
</li>
{{/if}}
{{#if typeIns}}
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
</li>
{{/if}}
{{#if typeDel}}
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
</li>
{{/if}}
{{/each_compare_title}}
</ul>
<div class="tab-content">
{{#each_compare_title article.examples compare.examples}}
{{#if typeSame}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
</div>
{{/if}}
{{#if typeIns}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
</div>
{{/if}}
{{#if typeDel}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
</div>
{{/if}}
{{/each_compare_title}}
</div>
{{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
{{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields section="success"}}
{{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
{{subTemplate "article-sample-request" article=article id=id}}
</article>
</script>
<script id="template-article-compare-permission" type="text/x-handlebars-template">
{{#each_compare_list_field article.permission compare.permission field="name"}}
{{#if source}}
{{#if typeSame}}
{{source.name}}
{{#if source.title}}
&nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br source.description}}" title="" data-original-title="{{source.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
{{#unless _last}}, {{/unless}}
{{/if}}
{{/if}}
{{#if typeIns}}
<ins>{{source.name}}</ins>
{{#if source.title}}
&nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br source.description}}" title="" data-original-title="{{source.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
{{#unless _last}}, {{/unless}}
{{/if}}
{{/if}}
{{#if typeDel}}
<del>{{source.name}}</del>
{{#if source.title}}
&nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br source.description}}" title="" data-original-title="{{source.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
{{#unless _last}}, {{/unless}}
{{/if}}
{{/if}}
{{else}}
{{#if typeSame}}
{{compare.name}}
{{#if compare.title}}
&nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br compare.description}}" title="" data-original-title="{{compare.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
{{#unless _last}}, {{/unless}}
{{/if}}
{{/if}}
{{#if typeIns}}
<ins>{{compare.name}}</ins>
{{#if compare.title}}
&nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br compare.description}}" title="" data-original-title="{{compare.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
{{#unless _last}}, {{/unless}}
{{/if}}
{{/if}}
{{#if typeDel}}
<del>{{compare.name}}</del>
{{#if compare.title}}
&nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br compare.description}}" title="" data-original-title="{{compare.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
{{#unless _last}}, {{/unless}}
{{/if}}
{{/if}}
{{/if}}
{{/each_compare_list_field}}
</script>
<script id="template-article-compare-param-block" type="text/x-handlebars-template">
{{#if source}}
{{#each_compare_keys source.fields compare.fields}}
{{#if typeSame}}
<h2>{{__ source.key}}</h2>
<table>
<thead>
<tr>
<th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
{{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
<th style="width: {{#if ../../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
</tr>
</thead>
{{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../../_hasType}}
</table>
{{/if}}
{{#if typeIns}}
<h2><ins>{{__ source.key}}</ins></h2>
<table class="ins">
<thead>
<tr>
<th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
{{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
<th style="width: {{#if ../../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
</tr>
</thead>
{{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../../_hasType}}
</table>
{{/if}}
{{#if typeDel}}
<h2><del>{{__ compare.key}}</del></h2>
<table class="del">
<thead>
<tr>
<th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
{{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
<th style="width: {{#if ../../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
</tr>
</thead>
{{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../../_hasType}}
</table>
{{/if}}
{{/each_compare_keys}}
<ul class="nav nav-tabs nav-tabs-examples">
{{#each_compare_title source.examples compare.examples}}
{{#if typeSame}}
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
</li>
{{/if}}
{{#if typeIns}}
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
</li>
{{/if}}
{{#if typeDel}}
<li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
<a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
</li>
{{/if}}
{{/each_compare_title}}
</ul>
<div class="tab-content">
{{#each_compare_title source.examples compare.examples}}
{{#if typeSame}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
</div>
{{/if}}
{{#if typeIns}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
</div>
{{/if}}
{{#if typeDel}}
<div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
<pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
</div>
{{/if}}
{{/each_compare_title}}
</div>
{{/if}}
</script>
<script id="template-article-compare-param-block-body" type="text/x-handlebars-template">
<tbody>
{{#each_compare_field source compare}}
{{#if typeSame}}
<tr>
<td class="code">
{{{splitFill source.field "." "&nbsp;&nbsp;"}}}
{{#if source.optional}}
{{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span>
{{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span>
{{/if}}
{{else}}
{{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
{{/if}}
</td>
{{#if source.type}}
{{#if compare.type}}
<td>{{{showDiff source.type compare.type}}}</td>
{{else}}
<td>{{{source.type}}}</td>
{{/if}}
{{else}}
{{#if compare.type}}
<td>{{{compare.type}}}</td>
{{else}}
{{#if ../../../../_hasType}}<td></td>{{/if}}
{{/if}}
{{/if}}
<td>
{{{showDiff source.description compare.description "nl2br"}}}
{{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{showDiff source.defaultValue compare.defaultValue}}}</code><p>{{/if}}
</td>
</tr>
{{/if}}
{{#if typeIns}}
<tr class="ins">
<td class="code">
{{{splitFill source.field "." "&nbsp;&nbsp;"}}}
{{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}}
</td>
{{#if source.type}}
<td>{{{source.type}}}</td>
{{else}}
{{{typRowTd}}}
{{/if}}
<td>
{{{nl2br source.description}}}
{{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{source.defaultValue}}}</code><p>{{/if}}
</td>
</tr>
{{/if}}
{{#if typeDel}}
<tr class="del">
<td class="code">
{{{splitFill compare.field "." "&nbsp;&nbsp;"}}}
{{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
</td>
{{#if compare.type}}
<td>{{{compare.type}}}</td>
{{else}}
{{{typRowTd}}}
{{/if}}
<td>
{{{nl2br compare.description}}}
{{#if compare.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{compare.defaultValue}}}</code><p>{{/if}}
</td>
</tr>
{{/if}}
{{/each_compare_field}}
</tbody>
</script>
<div class="container-fluid">
<div class="row-fluid">
<div id="sidenav" class="span2"></div>
<div id="content">
<div class="row">
<div class="col-sm-12">
<div class="pull-right">
<a href="../cn/">中文</a>|<a href="../en/">English</a>
</div>
</div>
</div>
<div id="project"></div>
<div id="header"></div>
<div id="sections"></div>
<div id="footer"></div>
<div id="generator"></div>
</div>
</div>
</div>
<div id="loader">
<div class="spinner">
<div class="spinner-container container1">
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
</div>
<div class="spinner-container container2">
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
</div>
<div class="spinner-container container3">
<div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
</div>
<p>Loading...</p>
</div>
</div>
<script data-main="main.js" src="vendor/require.min.js"></script>
</body>
</html>

@ -0,0 +1,25 @@
define({
ca: {
'Allowed values:' : 'Valors permesos:',
'Compare all with predecessor': 'Comparar tot amb versió anterior',
'compare changes to:' : 'comparar canvis amb:',
'compared to' : 'comparat amb',
'Default value:' : 'Valor per defecte:',
'Description' : 'Descripció',
'Field' : 'Camp',
'General' : 'General',
'Generated with' : 'Generat amb',
'Name' : 'Nom',
'No response values.' : 'Sense valors en la resposta.',
'optional' : 'opcional',
'Parameter' : 'Paràmetre',
'Permission:' : 'Permisos:',
'Response' : 'Resposta',
'Send' : 'Enviar',
'Send a Sample Request' : 'Enviar una petició d\'exemple',
'show up to version:' : 'mostrar versió:',
'Size range:' : 'Tamany de rang:',
'Type' : 'Tipus',
'url' : 'url'
}
});

@ -0,0 +1,25 @@
define({
de: {
'Allowed values:' : 'Erlaubte Werte:',
'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern',
'compare changes to:' : 'vergleiche Änderungen mit:',
'compared to' : 'verglichen mit',
'Default value:' : 'Standardwert:',
'Description' : 'Beschreibung',
'Field' : 'Feld',
'General' : 'Allgemein',
'Generated with' : 'Erstellt mit',
'Name' : 'Name',
'No response values.' : 'Keine Rückgabewerte.',
'optional' : 'optional',
'Parameter' : 'Parameter',
'Permission:' : 'Berechtigung:',
'Response' : 'Antwort',
'Send' : 'Senden',
'Send a Sample Request' : 'Eine Beispielanfrage senden',
'show up to version:' : 'zeige bis zur Version:',
'Size range:' : 'Größenbereich:',
'Type' : 'Typ',
'url' : 'url'
}
});

@ -0,0 +1,25 @@
define({
es: {
'Allowed values:' : 'Valores permitidos:',
'Compare all with predecessor': 'Comparar todo con versión anterior',
'compare changes to:' : 'comparar cambios con:',
'compared to' : 'comparado con',
'Default value:' : 'Valor por defecto:',
'Description' : 'Descripción',
'Field' : 'Campo',
'General' : 'General',
'Generated with' : 'Generado con',
'Name' : 'Nombre',
'No response values.' : 'Sin valores en la respuesta.',
'optional' : 'opcional',
'Parameter' : 'Parámetro',
'Permission:' : 'Permisos:',
'Response' : 'Respuesta',
'Send' : 'Enviar',
'Send a Sample Request' : 'Enviar una petición de ejemplo',
'show up to version:' : 'mostrar a versión:',
'Size range:' : 'Tamaño de rango:',
'Type' : 'Tipo',
'url' : 'url'
}
});

@ -0,0 +1,25 @@
define({
fr: {
'Allowed values:' : 'Valeurs autorisées :',
'Compare all with predecessor': 'Tout comparer avec ...',
'compare changes to:' : 'comparer les changements à :',
'compared to' : 'comparer à',
'Default value:' : 'Valeur par défaut :',
'Description' : 'Description',
'Field' : 'Champ',
'General' : 'Général',
'Generated with' : 'Généré avec',
'Name' : 'Nom',
'No response values.' : 'Aucune valeur de réponse.',
'optional' : 'optionnel',
'Parameter' : 'Paramètre',
'Permission:' : 'Permission :',
'Response' : 'Réponse',
'Send' : 'Envoyer',
'Send a Sample Request' : 'Envoyer une requête représentative',
'show up to version:' : 'Montrer à partir de la version :',
'Size range:' : 'Ordre de grandeur :',
'Type' : 'Type',
'url' : 'url'
}
});

@ -0,0 +1,25 @@
define({
it: {
'Allowed values:' : 'Valori permessi:',
'Compare all with predecessor': 'Confronta tutto con versioni precedenti',
'compare changes to:' : 'confronta modifiche con:',
'compared to' : 'confrontato con',
'Default value:' : 'Valore predefinito:',
'Description' : 'Descrizione',
'Field' : 'Campo',
'General' : 'Generale',
'Generated with' : 'Creato con',
'Name' : 'Nome',
'No response values.' : 'Nessnu valore di risposta.',
'optional' : 'opzionale',
'Parameter' : 'Parametro',
'Permission:' : 'Permessi:',
'Response' : 'Risposta',
'Send' : 'Invia',
'Send a Sample Request' : 'Invia una richiesta di esempio',
'show up to version:' : 'visualizza la versione:',
'Size range:' : 'Intervallo dimensione:',
'Type' : 'Tipo',
'url' : 'url'
}
});

@ -0,0 +1,47 @@
define([
'./locales/ca.js',
'./locales/de.js',
'./locales/es.js',
'./locales/fr.js',
'./locales/it.js',
'./locales/nl.js',
'./locales/pl.js',
'./locales/pt_br.js',
'./locales/ru.js',
'./locales/zh.js',
'./locales/zh_cn.js'
], function() {
var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_');
var language = langId.substr(0, 2);
var locales = {};
for (index in arguments) {
for (property in arguments[index])
locales[property] = arguments[index][property];
}
if ( ! locales['en'])
locales['en'] = {};
if ( ! locales[langId] && ! locales[language])
language = 'en';
var locale = (locales[langId] ? locales[langId] : locales[language]);
function __(text) {
var index = locale[text];
if (index === undefined)
return text;
return index;
};
function setLanguage(language) {
locale = locales[language];
}
return {
__ : __,
locales : locales,
locale : locale,
setLanguage: setLanguage
};
});

@ -0,0 +1,25 @@
define({
nl: {
'Allowed values:' : 'Toegestane waarden:',
'Compare all with predecessor': 'Vergelijk alle met voorgaande versie',
'compare changes to:' : 'vergelijk veranderingen met:',
'compared to' : 'vergelijk met',
'Default value:' : 'Standaard waarde:',
'Description' : 'Omschrijving',
'Field' : 'Veld',
'General' : 'Algemeen',
'Generated with' : 'Gegenereerd met',
'Name' : 'Naam',
'No response values.' : 'Geen response waardes.',
'optional' : 'optioneel',
'Parameter' : 'Parameter',
'Permission:' : 'Permissie:',
'Response' : 'Antwoorden',
'Send' : 'Sturen',
'Send a Sample Request' : 'Stuur een sample aanvragen',
'show up to version:' : 'toon tot en met versie:',
'Size range:' : 'Maatbereik:',
'Type' : 'Type',
'url' : 'url'
}
});

@ -0,0 +1,25 @@
define({
pl: {
'Allowed values:' : 'Dozwolone wartości:',
'Compare all with predecessor': 'Porównaj z poprzednimi wersjami',
'compare changes to:' : 'porównaj zmiany do:',
'compared to' : 'porównaj do:',
'Default value:' : 'Wartość domyślna:',
'Description' : 'Opis',
'Field' : 'Pole',
'General' : 'Generalnie',
'Generated with' : 'Wygenerowano z',
'Name' : 'Nazwa',
'No response values.' : 'Brak odpowiedzi.',
'optional' : 'opcjonalny',
'Parameter' : 'Parametr',
'Permission:' : 'Uprawnienia:',
'Response' : 'Odpowiedź',
'Send' : 'Wyślij',
'Send a Sample Request' : 'Wyślij przykładowe żądanie',
'show up to version:' : 'pokaż do wersji:',
'Size range:' : 'Zakres rozmiaru:',
'Type' : 'Typ',
'url' : 'url'
}
});

@ -0,0 +1,25 @@
define({
'pt_br': {
'Allowed values:' : 'Valores permitidos:',
'Compare all with predecessor': 'Compare todos com antecessores',
'compare changes to:' : 'comparar alterações com:',
'compared to' : 'comparado com',
'Default value:' : 'Valor padrão:',
'Description' : 'Descrição',
'Field' : 'Campo',
'General' : 'Geral',
'Generated with' : 'Gerado com',
'Name' : 'Nome',
'No response values.' : 'Sem valores de resposta.',
'optional' : 'opcional',
'Parameter' : 'Parâmetro',
'Permission:' : 'Permissão:',
'Response' : 'Resposta',
'Send' : 'Enviar',
'Send a Sample Request' : 'Enviar um Exemplo de Pedido',
'show up to version:' : 'aparecer para a versão:',
'Size range:' : 'Faixa de tamanho:',
'Type' : 'Tipo',
'url' : 'url'
}
});

@ -0,0 +1,25 @@
define({
ru: {
'Allowed values:' : 'Допустимые значения:',
'Compare all with predecessor': 'Сравнить с предыдущей версией',
'compare changes to:' : 'сравнить с:',
'compared to' : 'в сравнении с',
'Default value:' : 'По умолчанию:',
'Description' : 'Описание',
'Field' : 'Название',
'General' : 'Общая информация',
'Generated with' : 'Сгенерировано с помощью',
'Name' : 'Название',
'No response values.' : 'Нет значений для ответа.',
'optional' : 'необязательный',
'Parameter' : 'Параметр',
'Permission:' : 'Разрешено:',
'Response' : 'Ответ',
'Send' : 'Отправить',
'Send a Sample Request' : 'Отправить тестовый запрос',
'show up to version:' : 'показать версию:',
'Size range:' : 'Ограничения:',
'Type' : 'Тип',
'url' : 'URL'
}
});

@ -0,0 +1,25 @@
define({
zh: {
'Allowed values:' : '允許值:',
'Compare all with predecessor': '預先比較所有',
'compare changes to:' : '比較變更:',
'compared to' : '對比',
'Default value:' : '默認值:',
'Description' : '描述',
'Field' : '字段',
'General' : '概括',
'Generated with' : '生成工具',
'Name' : '名稱',
'No response values.' : '無對應資料.',
'optional' : '選項',
'Parameter' : '參數',
'Permission:' : '允許:',
'Response' : '回應',
'Send' : '發送',
'Send a Sample Request' : '發送試用需求',
'show up to version:' : '顯示到版本:',
'Size range:' : '尺寸範圍:',
'Type' : '類型',
'url' : '網址'
}
});

@ -0,0 +1,25 @@
define({
'zh_cn': {
'Allowed values:' : '允许值:',
'Compare all with predecessor': '与所有较早的比较',
'compare changes to:' : '将当前版本与指定版本比较:',
'compared to' : '相比于',
'Default value:' : '默认值:',
'Description' : '描述',
'Field' : '字段',
'General' : '概要',
'Generated with' : '基于',
'Name' : '名称',
'No response values.' : '无返回值.',
'optional' : '可选',
'Parameter' : '参数',
'Permission:' : '权限:',
'Response' : '返回',
'Send' : '发送',
'Send a Sample Request' : '发送示例请求',
'show up to version:' : '显示到指定版本:',
'Size range:' : '取值范围:',
'Type' : '类型',
'url' : '网址'
}
});

@ -0,0 +1,746 @@
require.config({
paths: {
bootstrap: 'vendor/bootstrap.min',
diffMatchPatch: './vendor/diff_match_patch.min',
handlebars: 'vendor/handlebars.min',
handlebarsExtended: './utils/handlebars_helper',
jquery: 'vendor/jquery.min',
locales: './locales/locale',
lodash: './vendor/lodash.min',
pathToRegexp: './vendor/path-to-regexp/index',
prettify: './vendor/prettify/prettify',
semver: './vendor/semver.min',
utilsSampleRequest: './utils/send_sample_request',
webfontloader: 'vendor/webfontloader'
},
shim: {
bootstrap: {
deps: ['jquery']
},
diffMatchPatch: {
exports: 'diff_match_patch'
},
handlebars: {
exports: 'Handlebars'
},
handlebarsExtended: {
deps: ['jquery', 'handlebars'],
exports: 'Handlebars'
},
prettify: {
exports: 'prettyPrint'
}
},
urlArgs: 'v=' + (new Date()).getTime(),
waitSeconds: 15
});
require([
'jquery',
'lodash',
'locales',
'handlebarsExtended',
'./api_project.js',
'./api_data.js',
'prettify',
'utilsSampleRequest',
'semver',
'webfontloader',
'bootstrap',
'pathToRegexp'
], function($, _, locale, Handlebars, apiProject, apiData, prettyPrint, sampleRequest, semver, WebFont) {
// load google web fonts
// loadGoogleFontCss();
var api = apiData.api;
//
// Templates
//
var templateHeader = Handlebars.compile( $('#template-header').html() );
var templateFooter = Handlebars.compile( $('#template-footer').html() );
var templateArticle = Handlebars.compile( $('#template-article').html() );
var templateCompareArticle = Handlebars.compile( $('#template-compare-article').html() );
var templateGenerator = Handlebars.compile( $('#template-generator').html() );
var templateProject = Handlebars.compile( $('#template-project').html() );
var templateSections = Handlebars.compile( $('#template-sections').html() );
var templateSidenav = Handlebars.compile( $('#template-sidenav').html() );
//
// apiProject defaults
//
if ( ! apiProject.template)
apiProject.template = {};
if (apiProject.template.withCompare == null)
apiProject.template.withCompare = true;
if (apiProject.template.withGenerator == null)
apiProject.template.withGenerator = true;
if (apiProject.template.forceLanguage)
locale.setLanguage(apiProject.template.forceLanguage);
// Setup jQuery Ajax
$.ajaxSetup(apiProject.template.jQueryAjaxSetup);
//
// Data transform
//
// grouped by group
var apiByGroup = _.groupBy(api, function(entry) {
return entry.group;
});
// grouped by group and name
var apiByGroupAndName = {};
$.each(apiByGroup, function(index, entries) {
apiByGroupAndName[index] = _.groupBy(entries, function(entry) {
return entry.name;
});
});
//
// sort api within a group by title ASC and custom order
//
var newList = [];
var umlauts = { 'ä': 'ae', 'ü': 'ue', 'ö': 'oe', 'ß': 'ss' }; // TODO: remove in version 1.0
$.each (apiByGroupAndName, function(index, groupEntries) {
// get titles from the first entry of group[].name[] (name has versioning)
var titles = [];
$.each (groupEntries, function(titleName, entries) {
var title = entries[0].title;
if(title !== undefined) {
title.toLowerCase().replace(/[äöüß]/g, function($0) { return umlauts[$0]; });
titles.push(title + '#~#' + titleName); // '#~#' keep reference to titleName after sorting
}
});
// sort by name ASC
titles.sort();
// custom order
if (apiProject.order)
titles = sortByOrder(titles, apiProject.order, '#~#');
// add single elements to the new list
titles.forEach(function(name) {
var values = name.split('#~#');
var key = values[1];
groupEntries[key].forEach(function(entry) {
newList.push(entry);
});
});
});
// api overwrite with ordered list
api = newList;
//
// Group- and Versionlists
//
var apiGroups = {};
var apiGroupTitles = {};
var apiVersions = {};
apiVersions[apiProject.version] = 1;
$.each(api, function(index, entry) {
apiGroups[entry.group] = 1;
apiGroupTitles[entry.group] = entry.groupTitle || entry.group;
apiVersions[entry.version] = 1;
});
// sort groups
apiGroups = Object.keys(apiGroups);
apiGroups.sort();
// custom order
if (apiProject.order)
apiGroups = sortByOrder(apiGroups, apiProject.order);
// sort versions DESC
apiVersions = Object.keys(apiVersions);
apiVersions.sort(semver.compare);
apiVersions.reverse();
//
// create Navigationlist
//
var nav = [];
apiGroups.forEach(function(group) {
// Mainmenu entry
nav.push({
group: group,
isHeader: true,
title: apiGroupTitles[group]
});
// Submenu
var oldName = '';
api.forEach(function(entry) {
if (entry.group === group) {
if (oldName !== entry.name) {
nav.push({
title: entry.title,
group: group,
name: entry.name,
type: entry.type,
version: entry.version
});
} else {
nav.push({
title: entry.title,
group: group,
hidden: true,
name: entry.name,
type: entry.type,
version: entry.version
});
}
oldName = entry.name;
}
});
});
// Mainmenu Header entry
if (apiProject.header) {
nav.unshift({
group: '_',
isHeader: true,
title: (apiProject.header.title == null) ? locale.__('General') : apiProject.header.title,
isFixed: true
});
}
// Mainmenu Footer entry
if (apiProject.footer && apiProject.footer.title != null) {
nav.push({
group: '_footer',
isHeader: true,
title: apiProject.footer.title,
isFixed: true
});
}
// render pagetitle
var title = apiProject.title ? apiProject.title : 'apiDoc: ' + apiProject.name + ' - ' + apiProject.version;
$(document).attr('title', title);
// remove loader
$('#loader').remove();
// render sidenav
var fields = {
nav: nav
};
$('#sidenav').append( templateSidenav(fields) );
// render Generator
$('#generator').append( templateGenerator(apiProject) );
// render Project
_.extend(apiProject, { versions: apiVersions});
$('#project').append( templateProject(apiProject) );
// render apiDoc, header/footer documentation
if (apiProject.header)
$('#header').append( templateHeader(apiProject.header) );
if (apiProject.footer)
$('#footer').append( templateFooter(apiProject.footer) );
//
// Render Sections and Articles
//
var articleVersions = {};
var content = '';
apiGroups.forEach(function(groupEntry) {
var articles = [];
var oldName = '';
var fields = {};
var title = groupEntry;
var description = '';
articleVersions[groupEntry] = {};
// render all articles of a group
api.forEach(function(entry) {
if(groupEntry === entry.group) {
if (oldName !== entry.name) {
// determine versions
api.forEach(function(versionEntry) {
if (groupEntry === versionEntry.group && entry.name === versionEntry.name) {
if ( ! articleVersions[entry.group].hasOwnProperty(entry.name) ) {
articleVersions[entry.group][entry.name] = [];
}
articleVersions[entry.group][entry.name].push(versionEntry.version);
}
});
fields = {
article: entry,
versions: articleVersions[entry.group][entry.name]
};
} else {
fields = {
article: entry,
hidden: true,
versions: articleVersions[entry.group][entry.name]
};
}
// add prefix URL for endpoint
if (apiProject.url)
fields.article.url = apiProject.url + fields.article.url;
addArticleSettings(fields, entry);
if (entry.groupTitle)
title = entry.groupTitle;
// TODO: make groupDescription compareable with older versions (not important for the moment)
if (entry.groupDescription)
description = entry.groupDescription;
articles.push({
article: templateArticle(fields),
group: entry.group,
name: entry.name
});
oldName = entry.name;
}
});
// render Section with Articles
var fields = {
group: groupEntry,
title: title,
description: description,
articles: articles
};
content += templateSections(fields);
});
$('#sections').append( content );
// Bootstrap Scrollspy
$(this).scrollspy({ target: '#scrollingNav', offset: 18 });
// Content-Scroll on Navigation click.
$('.sidenav').find('a').on('click', function(e) {
e.preventDefault();
var id = $(this).attr('href');
if ($(id).length > 0)
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 400);
window.location.hash = $(this).attr('href');
});
// Quickjump on Pageload to hash position.
if(window.location.hash) {
var id = window.location.hash;
if ($(id).length > 0)
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) }, 0);
}
/**
* Check if Parameter (sub) List has a type Field.
* Example: @apiSuccess varname1 No type.
* @apiSuccess {String} varname2 With type.
*
* @param {Object} fields
*/
function _hasTypeInFields(fields) {
var result = false;
$.each(fields, function(name) {
if (_.any(fields[name], function(item) { return item.type; }) )
result = true;
});
return result;
}
/**
* On Template changes, recall plugins.
*/
function initDynamic() {
// bootstrap popover
$('a[data-toggle=popover]')
.popover()
.click(function(e) {
e.preventDefault();
})
;
var version = $('#version strong').html();
$('#sidenav li').removeClass('is-new');
if (apiProject.template.withCompare) {
$('#sidenav li[data-version=\'' + version + '\']').each(function(){
var group = $(this).data('group');
var name = $(this).data('name');
var length = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').length;
var index = $('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\']').index($(this));
if (length === 1 || index === (length - 1))
$(this).addClass('is-new');
});
}
// tabs
$('.nav-tabs-examples a').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
$('.nav-tabs-examples').find('a:first').tab('show');
// sample request switch
$('.sample-request-switch').click(function (e) {
var name = '.' + $(this).attr('name') + '-fields';
$(name).addClass('hide');
$(this).parent().next(name).removeClass('hide');
});
// call scrollspy refresh method
$(window).scrollspy('refresh');
// init modules
sampleRequest.initDynamic();
}
initDynamic();
// Pre- / Code-Format
prettyPrint();
//
// HTML-Template specific jQuery-Functions
//
// Change Main Version
$('#versions li.version a').on('click', function(e) {
e.preventDefault();
var selectedVersion = $(this).html();
$('#version strong').html(selectedVersion);
// hide all
$('article').addClass('hide');
$('#sidenav li:not(.nav-fixed)').addClass('hide');
// show 1st equal or lower Version of each entry
$('article[data-version]').each(function(index) {
var group = $(this).data('group');
var name = $(this).data('name');
var version = $(this).data('version');
if (version <= selectedVersion) {
if ($('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible').length === 0) {
// enable Article
$('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide');
// enable Navigation
$('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide');
$('#sidenav li.nav-header[data-group=\'' + group + '\']').removeClass('hide');
}
}
});
// show 1st equal or lower Version of each entry
$('article[data-version]').each(function(index) {
var group = $(this).data('group');
$('section#api-' + group).removeClass('hide');
if ($('section#api-' + group + ' article:visible').length === 0) {
$('section#api-' + group).addClass('hide');
} else {
$('section#api-' + group).removeClass('hide');
}
});
initDynamic();
return;
});
// compare all article with their predecessor
$('#compareAllWithPredecessor').on('click', changeAllVersionCompareTo);
// change version of an article
$('article .versions li.version a').on('click', changeVersionCompareTo);
// compare url-parameter
$.urlParam = function(name) {
var results = new RegExp('[\\?&amp;]' + name + '=([^&amp;#]*)').exec(window.location.href);
return (results && results[1]) ? results[1] : null;
};
if ($.urlParam('compare')) {
// URL Paramter ?compare=1 is set
$('#compareAllWithPredecessor').trigger('click');
if (window.location.hash) {
var id = window.location.hash;
$('html,body').animate({ scrollTop: parseInt($(id).offset().top) - 18 }, 0);
}
}
/**
* Change version of an article to compare it to an other version.
*/
function changeVersionCompareTo(e) {
e.preventDefault();
var $root = $(this).parents('article');
var selectedVersion = $(this).html();
var $button = $root.find('.version');
var currentVersion = $button.find('strong').html();
$button.find('strong').html(selectedVersion);
var group = $root.data('group');
var name = $root.data('name');
var version = $root.data('version');
var compareVersion = $root.data('compare-version');
if (compareVersion === selectedVersion)
return;
if ( ! compareVersion && version == selectedVersion)
return;
if (compareVersion && articleVersions[group][name][0] === selectedVersion || version === selectedVersion) {
// the version of the entry is set to the highest version (reset)
resetArticle(group, name, version);
} else {
var $compareToArticle = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + selectedVersion + '\']');
var sourceEntry = {};
var compareEntry = {};
$.each(apiByGroupAndName[group][name], function(index, entry) {
if (entry.version === version)
sourceEntry = entry;
if (entry.version === selectedVersion)
compareEntry = entry;
});
var fields = {
article: sourceEntry,
compare: compareEntry,
versions: articleVersions[group][name]
};
// add unique id
// TODO: replace all group-name-version in template with id.
fields.article.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version;
fields.article.id = fields.article.id.replace(/\./g, '_');
fields.compare.id = fields.compare.group + '-' + fields.compare.name + '-' + fields.compare.version;
fields.compare.id = fields.compare.id.replace(/\./g, '_');
var entry = sourceEntry;
if (entry.parameter && entry.parameter.fields)
fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields);
if (entry.error && entry.error.fields)
fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields);
if (entry.success && entry.success.fields)
fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields);
if (entry.info && entry.info.fields)
fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields);
var entry = compareEntry;
if (fields._hasTypeInParameterFields !== true && entry.parameter && entry.parameter.fields)
fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields);
if (fields._hasTypeInErrorFields !== true && entry.error && entry.error.fields)
fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields);
if (fields._hasTypeInSuccessFields !== true && entry.success && entry.success.fields)
fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields);
if (fields._hasTypeInInfoFields !== true && entry.info && entry.info.fields)
fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields);
var content = templateCompareArticle(fields);
$root.after(content);
var $content = $root.next();
// Event on.click re-assign
$content.find('.versions li.version a').on('click', changeVersionCompareTo);
// select navigation
$('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + currentVersion + '\']').addClass('has-modifications');
$root.remove();
// TODO: on change main version or select the highest version re-render
}
initDynamic();
}
/**
* Compare all currently selected Versions with their predecessor.
*/
function changeAllVersionCompareTo(e) {
e.preventDefault();
$('article:visible .versions').each(function(){
var $root = $(this).parents('article');
var currentVersion = $root.data('version');
var $foundElement = null;
$(this).find('li.version a').each(function() {
var selectVersion = $(this).html();
if (selectVersion < currentVersion && ! $foundElement)
$foundElement = $(this);
});
if($foundElement)
$foundElement.trigger('click');
});
initDynamic();
}
/**
* Sort the fields.
*/
function sortFields(fields_object) {
$.each(fields_object, function (key, fields) {
var reversed = fields.slice().reverse()
var max_dot_count = Math.max.apply(null, reversed.map(function (item) {
return item.field.split(".").length - 1;
}))
for (var dot_count = 1; dot_count <= max_dot_count; dot_count++) {
reversed.forEach(function (item, index) {
var parts = item.field.split(".");
if (parts.length - 1 == dot_count) {
var fields_names = fields.map(function (item) { return item.field; });
if (parts.slice(1).length >= 1) {
var prefix = parts.slice(0, parts.length - 1).join(".");
var prefix_index = fields_names.indexOf(prefix);
if (prefix_index > -1) {
fields.splice(fields_names.indexOf(item.field), 1);
fields.splice(prefix_index + 1, 0, item);
}
}
}
});
}
});
}
/**
* Add article settings.
*/
function addArticleSettings(fields, entry) {
// add unique id
// TODO: replace all group-name-version in template with id.
fields.id = fields.article.group + '-' + fields.article.name + '-' + fields.article.version;
fields.id = fields.id.replace(/\./g, '_');
if (entry.header && entry.header.fields) {
sortFields(entry.header.fields);
fields._hasTypeInHeaderFields = _hasTypeInFields(entry.header.fields);
}
if (entry.parameter && entry.parameter.fields) {
sortFields(entry.parameter.fields);
fields._hasTypeInParameterFields = _hasTypeInFields(entry.parameter.fields);
}
if (entry.error && entry.error.fields) {
sortFields(entry.error.fields);
fields._hasTypeInErrorFields = _hasTypeInFields(entry.error.fields);
}
if (entry.success && entry.success.fields) {
sortFields(entry.success.fields);
fields._hasTypeInSuccessFields = _hasTypeInFields(entry.success.fields);
}
if (entry.info && entry.info.fields) {
sortFields(entry.info.fields);
fields._hasTypeInInfoFields = _hasTypeInFields(entry.info.fields);
}
// add template settings
fields.template = apiProject.template;
}
/**
* Render Article.
*/
function renderArticle(group, name, version) {
var entry = {};
$.each(apiByGroupAndName[group][name], function(index, currentEntry) {
if (currentEntry.version === version)
entry = currentEntry;
});
var fields = {
article: entry,
versions: articleVersions[group][name]
};
addArticleSettings(fields, entry);
return templateArticle(fields);
}
/**
* Render original Article and remove the current visible Article.
*/
function resetArticle(group, name, version) {
var $root = $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible');
var content = renderArticle(group, name, version);
$root.after(content);
var $content = $root.next();
// Event on.click muss neu zugewiesen werden (sollte eigentlich mit on automatisch funktionieren... sollte)
$content.find('.versions li.version a').on('click', changeVersionCompareTo);
$('#sidenav li[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('has-modifications');
$root.remove();
return;
}
/**
* Load google fonts.
*/
function loadGoogleFontCss() {
WebFont.load({
active: function() {
// Update scrollspy
$(window).scrollspy('refresh')
},
google: {
families: ['Source Code Pro', 'Source Sans Pro:n4,n6,n7']
}
});
}
/**
* Return ordered entries by custom order and append not defined entries to the end.
* @param {String[]} elements
* @param {String[]} order
* @param {String} splitBy
* @return {String[]} Custom ordered list.
*/
function sortByOrder(elements, order, splitBy) {
var results = [];
order.forEach (function(name) {
if (splitBy)
elements.forEach (function(element) {
var parts = element.split(splitBy);
var key = parts[1]; // reference keep for sorting
if (key == name)
results.push(element);
});
else
elements.forEach (function(key) {
if (key == name)
results.push(name);
});
});
// Append all other entries that ar not defined in order
elements.forEach(function(element) {
if (results.indexOf(element) === -1)
results.push(element);
});
return results;
}
});

@ -0,0 +1,346 @@
define([
'locales',
'handlebars',
'diffMatchPatch'
], function(locale, Handlebars, DiffMatchPatch) {
/**
* start/stop timer for simple performance check.
*/
var timer;
Handlebars.registerHelper('startTimer', function(text) {
timer = new Date();
return '';
});
Handlebars.registerHelper('stopTimer', function(text) {
console.log(new Date() - timer);
return '';
});
/**
* Return localized Text.
* @param string text
*/
Handlebars.registerHelper('__', function(text) {
return locale.__(text);
});
/**
* Console log.
* @param mixed obj
*/
Handlebars.registerHelper('cl', function(obj) {
console.log(obj);
return '';
});
/**
* Replace underscore with space.
* @param string text
*/
Handlebars.registerHelper('underscoreToSpace', function(text) {
return text.replace(/(_+)/g, ' ');
});
/**
*
*/
Handlebars.registerHelper('assign', function(name) {
if(arguments.length > 0) {
var type = typeof(arguments[1]);
var arg = null;
if(type === 'string' || type === 'number' || type === 'boolean') arg = arguments[1];
Handlebars.registerHelper(name, function() { return arg; });
}
return '';
});
/**
*
*/
Handlebars.registerHelper('nl2br', function(text) {
return _handlebarsNewlineToBreak(text);
});
/**
*
*/
Handlebars.registerHelper('if_eq', function(context, options) {
var compare = context;
// Get length if context is an object
if (context instanceof Object && ! (options.hash.compare instanceof Object))
compare = Object.keys(context).length;
if (compare === options.hash.compare)
return options.fn(this);
return options.inverse(this);
});
Handlebars.registerHelper('if_not_notice',function (context, options) {
if(context.indexOf('notify_url')<0){
return options.fn(this);
}
});
/**
*
*/
Handlebars.registerHelper('if_gt', function(context, options) {
var compare = context;
// Get length if context is an object
if (context instanceof Object && ! (options.hash.compare instanceof Object))
compare = Object.keys(context).length;
if(compare > options.hash.compare)
return options.fn(this);
return options.inverse(this);
});
/**
*
*/
var templateCache = {};
Handlebars.registerHelper('subTemplate', function(name, sourceContext) {
if ( ! templateCache[name])
templateCache[name] = Handlebars.compile($('#template-' + name).html());
var template = templateCache[name];
var templateContext = $.extend({}, this, sourceContext.hash);
return new Handlebars.SafeString( template(templateContext) );
});
/**
*
*/
Handlebars.registerHelper('toLowerCase', function(value) {
return (value && typeof value === 'string') ? value.toLowerCase() : '';
});
/**
*
*/
Handlebars.registerHelper('splitFill', function(value, splitChar, fillChar) {
var splits = value.split(splitChar);
return new Array(splits.length).join(fillChar) + splits[splits.length - 1];
});
/**
* Convert Newline to HTML-Break (nl2br).
*
* @param {String} text
* @returns {String}
*/
function _handlebarsNewlineToBreak(text) {
return ('' + text).replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '<br>' + '$2');
}
/**
*
*/
Handlebars.registerHelper('each_compare_list_field', function(source, compare, options) {
var fieldName = options.hash.field;
var newSource = [];
if (source) {
source.forEach(function(entry) {
var values = entry;
values['key'] = entry[fieldName];
newSource.push(values);
});
}
var newCompare = [];
if (compare) {
compare.forEach(function(entry) {
var values = entry;
values['key'] = entry[fieldName];
newCompare.push(values);
});
}
return _handlebarsEachCompared('key', newSource, newCompare, options);
});
/**
*
*/
Handlebars.registerHelper('each_compare_keys', function(source, compare, options) {
var newSource = [];
if (source) {
var sourceFields = Object.keys(source);
sourceFields.forEach(function(name) {
var values = {};
values['value'] = source[name];
values['key'] = name;
newSource.push(values);
});
}
var newCompare = [];
if (compare) {
var compareFields = Object.keys(compare);
compareFields.forEach(function(name) {
var values = {};
values['value'] = compare[name];
values['key'] = name;
newCompare.push(values);
});
}
return _handlebarsEachCompared('key', newSource, newCompare, options);
});
/**
*
*/
Handlebars.registerHelper('each_compare_field', function(source, compare, options) {
return _handlebarsEachCompared('field', source, compare, options);
});
/**
*
*/
Handlebars.registerHelper('each_compare_title', function(source, compare, options) {
return _handlebarsEachCompared('title', source, compare, options);
});
/**
*
*/
Handlebars.registerHelper('reformat', function(source, type){
if (type == 'json')
try {
return JSON.stringify(JSON.parse(source.trim()),null, " ");
} catch(e) {
}
return source
});
/**
*
*/
Handlebars.registerHelper('showDiff', function(source, compare, options) {
var ds = '';
if(source === compare) {
ds = source;
} else {
if( ! source)
return compare;
if( ! compare)
return source;
var d = diffMatchPatch.diff_main(compare, source);
diffMatchPatch.diff_cleanupSemantic(d);
ds = diffMatchPatch.diff_prettyHtml(d);
ds = ds.replace(/&para;/gm, '');
}
if(options === 'nl2br')
ds = _handlebarsNewlineToBreak(ds);
return ds;
});
/**
*
*/
function _handlebarsEachCompared(fieldname, source, compare, options)
{
var dataList = [];
var index = 0;
if(source) {
source.forEach(function(sourceEntry) {
var found = false;
if (compare) {
compare.forEach(function(compareEntry) {
if(sourceEntry[fieldname] === compareEntry[fieldname]) {
var data = {
typeSame: true,
source: sourceEntry,
compare: compareEntry,
index: index
};
dataList.push(data);
found = true;
index++;
}
});
}
if ( ! found) {
var data = {
typeIns: true,
source: sourceEntry,
index: index
};
dataList.push(data);
index++;
}
});
}
if (compare) {
compare.forEach(function(compareEntry) {
var found = false;
if (source) {
source.forEach(function(sourceEntry) {
if(sourceEntry[fieldname] === compareEntry[fieldname])
found = true;
});
}
if ( ! found) {
var data = {
typeDel: true,
compare: compareEntry,
index: index
};
dataList.push(data);
index++;
}
});
}
var ret = '';
var length = dataList.length;
for (var index in dataList) {
if(index == (length - 1))
dataList[index]['_last'] = true;
ret = ret + options.fn(dataList[index]);
}
return ret;
}
var diffMatchPatch = new DiffMatchPatch();
/**
* Overwrite Colors
*/
DiffMatchPatch.prototype.diff_prettyHtml = function(diffs) {
var html = [];
var pattern_amp = /&/g;
var pattern_lt = /</g;
var pattern_gt = />/g;
var pattern_para = /\n/g;
for (var x = 0; x < diffs.length; x++) {
var op = diffs[x][0]; // Operation (insert, delete, equal)
var data = diffs[x][1]; // Text of change.
var text = data.replace(pattern_amp, '&amp;').replace(pattern_lt, '&lt;')
.replace(pattern_gt, '&gt;').replace(pattern_para, '&para;<br>');
switch (op) {
case DIFF_INSERT:
html[x] = '<ins>' + text + '</ins>';
break;
case DIFF_DELETE:
html[x] = '<del>' + text + '</del>';
break;
case DIFF_EQUAL:
html[x] = '<span>' + text + '</span>';
break;
}
}
return html.join('');
};
// Exports
return Handlebars;
});

@ -0,0 +1,181 @@
define([
'jquery'
], function($) {
var initDynamic = function() {
// Button send
$(".sample-request-send").off("click");
$(".sample-request-send").on("click", function(e) {
e.preventDefault();
var $root = $(this).parents("article");
var group = $root.data("group");
var name = $root.data("name");
var version = $root.data("version");
sendSampleRequest(group, name, version, $(this).data("sample-request-type"));
});
// Button clear
$(".sample-request-clear").off("click");
$(".sample-request-clear").on("click", function(e) {
e.preventDefault();
var $root = $(this).parents("article");
var group = $root.data("group");
var name = $root.data("name");
var version = $root.data("version");
clearSampleRequest(group, name, version);
});
}; // initDynamic
function sendSampleRequest(group, name, version, type)
{
var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]');
// Optional header
var header = {};
$root.find(".sample-request-header:checked").each(function(i, element) {
var group = $(element).data("sample-request-header-group-id");
$root.find("[data-sample-request-header-group=\"" + group + "\"]").each(function(i, element) {
var key = $(element).data("sample-request-header-name");
var value = element.value;
if ( ! element.optional && element.defaultValue !== '') {
value = element.defaultValue;
}
header[key] = value;
});
});
// create JSON dictionary of parameters
var param = {};
var paramType = {};
$root.find(".sample-request-param:checked").each(function(i, element) {
var group = $(element).data("sample-request-param-group-id");
$root.find("[data-sample-request-param-group=\"" + group + "\"]").each(function(i, element) {
var key = $(element).data("sample-request-param-name");
var value = element.value;
if ( ! element.optional && element.defaultValue !== '') {
value = element.defaultValue;
}
param[key] = value;
paramType[key] = $(element).next().text();
});
});
// grab user-inputted URL
var url = $root.find(".sample-request-url").val();
// Insert url parameter
var pattern = pathToRegexp(url, null);
var matches = pattern.exec(url);
for (var i = 1; i < matches.length; i++) {
var key = matches[i].substr(1);
if (param[key] !== undefined) {
url = url.replace(matches[i], encodeURIComponent(param[key]));
// remove URL parameters from list
delete param[key];
}
} // for
$root.find(".sample-request-response").fadeTo(250, 1);
$root.find(".sample-request-response-json").html("Loading...");
refreshScrollSpy();
_.each( param, function( val, key ) {
var t = paramType[ key ].toLowerCase();
if ( t === 'object' || t === 'array' ) {
try {
param[ key ] = JSON.parse( val );
} catch (e) {
}
}
});
// send AJAX request, catch success or error callback
var ajaxRequest = {
url : url,
headers : header,
data : param,
type : type.toUpperCase(),
success : displaySuccess,
error : displayError
};
$.ajax(ajaxRequest);
function displaySuccess(data, status, jqXHR) {
var jsonResponse;
try {
jsonResponse = JSON.parse(jqXHR.responseText);
jsonResponse = JSON.stringify(jsonResponse, null, 4);
} catch (e) {
jsonResponse = data;
}
$root.find(".sample-request-response-json").html(jsonResponse);
refreshScrollSpy();
};
function displayError(jqXHR, textStatus, error) {
var message = "Error " + jqXHR.status + ": " + error;
var jsonResponse;
try {
jsonResponse = JSON.parse(jqXHR.responseText);
jsonResponse = JSON.stringify(jsonResponse, null, 4);
} catch (e) {
jsonResponse = escape(jqXHR.responseText);
}
if (jsonResponse)
message += "<br>" + jsonResponse;
// flicker on previous error to make clear that there is a new response
if($root.find(".sample-request-response").is(":visible"))
$root.find(".sample-request-response").fadeTo(1, 0.1);
$root.find(".sample-request-response").fadeTo(250, 1);
$root.find(".sample-request-response-json").html(message);
refreshScrollSpy();
};
}
function clearSampleRequest(group, name, version)
{
var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]');
// hide sample response
$root.find(".sample-request-response-json").html("");
$root.find(".sample-request-response").hide();
// reset value of parameters
$root.find(".sample-request-param").each(function(i, element) {
element.value = "";
});
// restore default URL
var $urlElement = $root.find(".sample-request-url");
$urlElement.val($urlElement.prop("defaultValue"));
refreshScrollSpy();
}
function refreshScrollSpy()
{
$('[data-spy="scroll"]').each(function () {
$(this).scrollspy("refresh");
});
}
function escapeHtml(str) {
var div = document.createElement("div");
div.appendChild(document.createTextNode(str));
return div.innerHTML;
}
/**
* Exports.
*/
return {
initDynamic: initDynamic
};
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,49 @@
(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32}
diff_match_patch.prototype.diff_main=function(a,b,c,d){"undefined"==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a,
b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a};
diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100<a.length&&100<b.length?this.diff_lineMode_(a,b,
d):this.diff_bisect_(a,b,d)};
diff_match_patch.prototype.diff_lineMode_=function(a,b,c){var d=this.diff_linesToChars_(a,b);a=d.chars1;b=d.chars2;d=d.lineArray;a=this.diff_main(a,b,!1,c);this.diff_charsToLines_(a,d);this.diff_cleanupSemantic(a);a.push([0,""]);for(var e=d=b=0,f="",g="";b<a.length;){switch(a[b][0]){case 1:e++;g+=a[b][1];break;case -1:d++;f+=a[b][1];break;case 0:if(1<=d&&1<=e){a.splice(b-d-e,d+e);b=b-d-e;d=this.diff_main(f,g,!1,c);for(e=d.length-1;0<=e;e--)a.splice(b,0,d[e]);b+=d.length}d=e=0;g=f=""}b++}a.pop();return a};
diff_match_patch.prototype.diff_bisect_=function(a,b,c){for(var d=a.length,e=b.length,f=Math.ceil((d+e)/2),g=f,h=2*f,j=Array(h),i=Array(h),k=0;k<h;k++)j[k]=-1,i[k]=-1;j[g+1]=0;i[g+1]=0;for(var k=d-e,q=0!=k%2,r=0,t=0,p=0,w=0,v=0;v<f&&!((new Date).getTime()>c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]<j[l+1]?j[l+1]:j[l-1]+1;for(var s=m-n;m<d&&s<e&&a.charAt(m)==b.charAt(s);)m++,s++;j[l]=m;if(m>d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l<h&&-1!=i[l])){var u=d-i[l];if(m>=
u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]<i[l+1]?i[l+1]:i[l-1]+1;for(m=u-n;u<d&&m<e&&a.charAt(d-u-1)==b.charAt(e-m-1);)u++,m++;i[l]=u;if(u>d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l<h&&-1!=j[l])&&(m=j[l],s=g+m-l,u=d-u,m>=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]};
diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)};
diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;f<a.length-1;){f=a.indexOf("\n",c);-1==f&&(f=a.length-1);var r=a.substring(c,f+1),c=f+1;(e.hasOwnProperty?e.hasOwnProperty(r):void 0!==e[r])?b+=String.fromCharCode(e[r]):(b+=String.fromCharCode(g),e[r]=g,d[g++]=r)}return b}var d=[],e={};d[0]="";var f=c(a),g=c(b);return{chars1:f,chars2:g,lineArray:d}};
diff_match_patch.prototype.diff_charsToLines_=function(a,b){for(var c=0;c<a.length;c++){for(var d=a[c][1],e=[],f=0;f<d.length;f++)e[f]=b[d.charCodeAt(f)];a[c][1]=e.join("")}};diff_match_patch.prototype.diff_commonPrefix=function(a,b){if(!a||!b||a.charAt(0)!=b.charAt(0))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(f,e)==b.substring(f,e)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
diff_match_patch.prototype.diff_commonSuffix=function(a,b){if(!a||!b||a.charAt(a.length-1)!=b.charAt(b.length-1))return 0;for(var c=0,d=Math.min(a.length,b.length),e=d,f=0;c<e;)a.substring(a.length-e,a.length-f)==b.substring(b.length-e,b.length-f)?f=c=e:d=e,e=Math.floor((d-c)/2+c);return e};
diff_match_patch.prototype.diff_commonOverlap_=function(a,b){var c=a.length,d=b.length;if(0==c||0==d)return 0;c>d?a=a.substring(c-d):c<d&&(b=b.substring(0,c));c=Math.min(c,d);if(a==b)return c;for(var d=0,e=1;;){var f=a.substring(c-e),f=b.indexOf(f);if(-1==f)return d;e+=f;if(0==f||a.substring(c-e)==b.substring(0,e))d=e,e++}};
diff_match_patch.prototype.diff_halfMatch_=function(a,b){function c(a,b,c){for(var d=a.substring(c,c+Math.floor(a.length/4)),e=-1,g="",h,j,n,l;-1!=(e=b.indexOf(d,e+1));){var m=f.diff_commonPrefix(a.substring(c),b.substring(e)),s=f.diff_commonSuffix(a.substring(0,c),b.substring(0,e));g.length<s+m&&(g=b.substring(e-s,e)+b.substring(e,e+m),h=a.substring(0,c-s),j=a.substring(c+m),n=b.substring(0,e-s),l=b.substring(e+m))}return 2*g.length>=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null;
var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.length<d.length)return null;var f=this,g=c(d,e,Math.ceil(d.length/4)),d=c(d,e,Math.ceil(d.length/2)),h;if(!g&&!d)return null;h=d?g?g[4].length>d[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]};
diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f<a.length;)0==a[f][0]?(c[d++]=f,g=j,h=i,i=j=0,e=a[f][1]):(1==a[f][0]?j+=a[f][1].length:i+=a[f][1].length,e&&(e.length<=Math.max(g,h)&&e.length<=Math.max(j,i))&&(a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,d--,f=0<d?c[d-1]:-1,i=j=h=g=0,e=null,b=!0)),f++;b&&this.diff_cleanupMerge(a);this.diff_cleanupSemanticLossless(a);for(f=1;f<a.length;){if(-1==a[f-1][0]&&1==a[f][0]){b=a[f-1][1];c=a[f][1];
d=this.diff_commonOverlap_(b,c);e=this.diff_commonOverlap_(c,b);if(d>=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}};
diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_);
return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c<a.length-1;){if(0==a[c-1][0]&&0==a[c+1][0]){var d=a[c-1][1],e=a[c][1],f=a[c+1][1],g=this.diff_commonSuffix(d,e);if(g)var h=e.substring(e.length-g),d=d.substring(0,d.length-g),e=h+e.substring(0,e.length-g),f=h+f;for(var g=d,h=e,j=f,i=b(d,e)+b(e,f);e.charAt(0)===f.charAt(0);){var d=d+e.charAt(0),e=e.substring(1)+f.charAt(0),f=f.substring(1),k=b(d,e)+b(e,f);k>=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]=
h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/;
diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;f<a.length;){if(0==a[f][0])a[f][1].length<this.Diff_EditCost&&(j||i)?(c[d++]=f,g=j,h=i,e=a[f][1]):(d=0,e=null),j=i=!1;else if(-1==a[f][0]?i=!0:j=!0,e&&(g&&h&&j&&i||e.length<this.Diff_EditCost/2&&3==g+h+j+i))a.splice(c[d-1],0,[-1,e]),a[c[d-1]+1][0]=1,d--,e=null,g&&h?(j=i=!0,d=0):(d--,f=0<d?c[d-1]:-1,j=i=!1),b=!0;f++}b&&this.diff_cleanupMerge(a)};
diff_match_patch.prototype.diff_cleanupMerge=function(a){a.push([0,""]);for(var b=0,c=0,d=0,e="",f="",g;b<a.length;)switch(a[b][0]){case 1:d++;f+=a[b][1];b++;break;case -1:c++;e+=a[b][1];b++;break;case 0:1<c+d?(0!==c&&0!==d&&(g=this.diff_commonPrefix(f,e),0!==g&&(0<b-c-d&&0==a[b-c-d-1][0]?a[b-c-d-1][1]+=f.substring(0,g):(a.splice(0,0,[0,f.substring(0,g)]),b++),f=f.substring(g),e=e.substring(g)),g=this.diff_commonSuffix(f,e),0!==g&&(a[b][1]=f.substring(f.length-g)+a[b][1],f=f.substring(0,f.length-
g),e=e.substring(0,e.length-g))),0===c?a.splice(b-d,c+d,[1,f]):0===d?a.splice(b-c,c+d,[-1,e]):a.splice(b-c-d,c+d,[-1,e],[1,f]),b=b-c-d+(c?1:0)+(d?1:0)+1):0!==b&&0==a[b-1][0]?(a[b-1][1]+=a[b][1],a.splice(b,1)):b++,c=d=0,f=e=""}""===a[a.length-1][1]&&a.pop();c=!1;for(b=1;b<a.length-1;)0==a[b-1][0]&&0==a[b+1][0]&&(a[b][1].substring(a[b][1].length-a[b-1][1].length)==a[b-1][1]?(a[b][1]=a[b-1][1]+a[b][1].substring(0,a[b][1].length-a[b-1][1].length),a[b+1][1]=a[b-1][1]+a[b+1][1],a.splice(b-1,1),c=!0):a[b][1].substring(0,
a[b+1][1].length)==a[b+1][1]&&(a[b-1][1]+=a[b+1][1],a[b][1]=a[b][1].substring(a[b+1][1].length)+a[b+1][1],a.splice(b+1,1),c=!0)),b++;c&&this.diff_cleanupMerge(a)};diff_match_patch.prototype.diff_xIndex=function(a,b){var c=0,d=0,e=0,f=0,g;for(g=0;g<a.length;g++){1!==a[g][0]&&(c+=a[g][1].length);-1!==a[g][0]&&(d+=a[g][1].length);if(c>b)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)};
diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=/</g,e=/>/g,f=/\n/g,g=0;g<a.length;g++){var h=a[g][0],j=a[g][1],j=j.replace(c,"&amp;").replace(d,"&lt;").replace(e,"&gt;").replace(f,"&para;<br>");switch(h){case 1:b[g]='<ins style="background:#e6ffe6;">'+j+"</ins>";break;case -1:b[g]='<del style="background:#ffe6e6;">'+j+"</del>";break;case 0:b[g]="<span>"+j+"</span>"}}return b.join("")};
diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;c<a.length;c++)1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_text2=function(a){for(var b=[],c=0;c<a.length;c++)-1!==a[c][0]&&(b[c]=a[c][1]);return b.join("")};diff_match_patch.prototype.diff_levenshtein=function(a){for(var b=0,c=0,d=0,e=0;e<a.length;e++){var f=a[e][0],g=a[e][1];switch(f){case 1:c+=g.length;break;case -1:d+=g.length;break;case 0:b+=Math.max(c,d),d=c=0}}return b+=Math.max(c,d)};
diff_match_patch.prototype.diff_toDelta=function(a){for(var b=[],c=0;c<a.length;c++)switch(a[c][0]){case 1:b[c]="+"+encodeURI(a[c][1]);break;case -1:b[c]="-"+a[c][1].length;break;case 0:b[c]="="+a[c][1].length}return b.join("\t").replace(/%20/g," ")};
diff_match_patch.prototype.diff_fromDelta=function(a,b){for(var c=[],d=0,e=0,f=b.split(/\t/g),g=0;g<f.length;g++){var h=f[g].substring(1);switch(f[g].charAt(0)){case "+":try{c[d++]=[1,decodeURI(h)]}catch(j){throw Error("Illegal escape in diff_fromDelta: "+h);}break;case "-":case "=":var i=parseInt(h,10);if(isNaN(i)||0>i)throw Error("Invalid number in diff_fromDelta: "+h);h=a.substring(e,e+=i);"="==f[g].charAt(0)?c[d++]=[0,h]:c[d++]=[-1,h];break;default:if(f[g])throw Error("Invalid diff operation in diff_fromDelta: "+
f[g]);}}if(e!=a.length)throw Error("Delta length ("+e+") does not equal source text length ("+a.length+").");return c};diff_match_patch.prototype.match_main=function(a,b,c){if(null==a||null==b||null==c)throw Error("Null input. (match_main)");c=Math.max(0,Math.min(c,a.length));return a==b?0:a.length?a.substring(c,c+b.length)==b?c:this.match_bitap_(a,b,c):-1};
diff_match_patch.prototype.match_bitap_=function(a,b,c){function d(a,d){var e=a/b.length,g=Math.abs(c-d);return!f.Match_Distance?g?1:e:e+g/f.Match_Distance}if(b.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<<b.length-1,h=-1,i,k,q=b.length+a.length,r,t=0;t<b.length;t++){i=0;for(k=q;i<k;)d(t,c+
k)<=g?i=k:q=k,k=Math.floor((q-i)/2+i);q=k;i=Math.max(1,c-k+1);var p=Math.min(c+k,a.length)+b.length;k=Array(p+2);for(k[p+1]=(1<<t)-1;p>=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h};
diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c<a.length;c++)b[a.charAt(c)]=0;for(c=0;c<a.length;c++)b[a.charAt(c)]|=1<<a.length-c-1;return b};
diff_match_patch.prototype.patch_addContext_=function(a,b){if(0!=b.length){for(var c=b.substring(a.start2,a.start2+a.length1),d=0;b.indexOf(c)!=b.lastIndexOf(c)&&c.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)d+=this.Patch_Margin,c=b.substring(a.start2-d,a.start2+a.length1+d);d+=this.Patch_Margin;(c=b.substring(a.start2-d,a.start2))&&a.diffs.unshift([0,c]);(d=b.substring(a.start2+a.length1,a.start2+a.length1+d))&&a.diffs.push([0,d]);a.start1-=c.length;a.start2-=c.length;a.length1+=
c.length+d.length;a.length2+=c.length+d.length}};
diff_match_patch.prototype.patch_make=function(a,b,c){var d;if("string"==typeof a&&"string"==typeof b&&"undefined"==typeof c)d=a,b=this.diff_main(d,b,!0),2<b.length&&(this.diff_cleanupSemantic(b),this.diff_cleanupEfficiency(b));else if(a&&"object"==typeof a&&"undefined"==typeof b&&"undefined"==typeof c)b=a,d=this.diff_text1(b);else if("string"==typeof a&&b&&"object"==typeof b&&"undefined"==typeof c)d=a;else if("string"==typeof a&&"string"==typeof b&&c&&"object"==typeof c)d=a,b=c;else throw Error("Unknown call format to patch_make.");
if(0===b.length)return[];c=[];a=new diff_match_patch.patch_obj;for(var e=0,f=0,g=0,h=d,j=0;j<b.length;j++){var i=b[j][0],k=b[j][1];!e&&0!==i&&(a.start1=f,a.start2=g);switch(i){case 1:a.diffs[e++]=b[j];a.length2+=k.length;d=d.substring(0,g)+k+d.substring(g);break;case -1:a.length1+=k.length;a.diffs[e++]=b[j];d=d.substring(0,g)+d.substring(g+k.length);break;case 0:k.length<=2*this.Patch_Margin&&e&&b.length!=j+1?(a.diffs[e++]=b[j],a.length1+=k.length,a.length2+=k.length):k.length>=2*this.Patch_Margin&&
e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;c<a.length;c++){var d=a[c],e=new diff_match_patch.patch_obj;e.diffs=[];for(var f=0;f<d.diffs.length;f++)e.diffs[f]=d.diffs[f].slice();e.start1=d.start1;e.start2=d.start2;e.length1=d.length1;e.length2=d.length2;b[c]=e}return b};
diff_match_patch.prototype.patch_apply=function(a,b){if(0==a.length)return[b,[]];a=this.patch_deepCopy(a);var c=this.patch_addPadding(a);b=c+b+c;this.patch_splitMax(a);for(var d=0,e=[],f=0;f<a.length;f++){var g=a[f].start2+d,h=this.diff_text1(a[f].diffs),j,i=-1;if(h.length>this.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g);
if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;i<a[f].diffs.length;i++){var q=a[f].diffs[i];0!==q[0]&&(k=this.diff_xIndex(g,h));1===q[0]?b=b.substring(0,
j+k)+q[1]+b.substring(j+k):-1===q[0]&&(b=b.substring(0,j+k)+b.substring(j+this.diff_xIndex(g,h+q[1].length)));-1!==q[0]&&(h+=q[1].length)}}}b=b.substring(c.length,b.length-c.length);return[b,e]};
diff_match_patch.prototype.patch_addPadding=function(a){for(var b=this.Patch_Margin,c="",d=1;d<=b;d++)c+=String.fromCharCode(d);for(d=0;d<a.length;d++)a[d].start1+=b,a[d].start2+=b;var d=a[0],e=d.diffs;if(0==e.length||0!=e[0][0])e.unshift([0,c]),d.start1-=b,d.start2-=b,d.length1+=b,d.length2+=b;else if(b>e[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0,
c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c};
diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c<a.length;c++)if(!(a[c].length1<=b)){var d=a[c];a.splice(c--,1);for(var e=d.start1,f=d.start2,g="";0!==d.diffs.length;){var h=new diff_match_patch.patch_obj,j=!0;h.start1=e-g.length;h.start2=f-g.length;""!==g&&(h.length1=h.length2=g.length,h.diffs.push([0,g]));for(;0!==d.diffs.length&&h.length1<b-this.Patch_Margin;){var g=d.diffs[0][0],i=d.diffs[0][1];1===g?(h.length2+=i.length,f+=i.length,h.diffs.push(d.diffs.shift()),
j=!1):-1===g&&1==h.diffs.length&&0==h.diffs[0][0]&&i.length>2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&&
(h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c<a.length;c++)b[c]=a[c];return b.join("")};
diff_match_patch.prototype.patch_fromText=function(a){var b=[];if(!a)return b;a=a.split("\n");for(var c=0,d=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;c<a.length;){var e=a[c].match(d);if(!e)throw Error("Invalid patch string: "+a[c]);var f=new diff_match_patch.patch_obj;b.push(f);f.start1=parseInt(e[1],10);""===e[2]?(f.start1--,f.length1=1):"0"==e[2]?f.length1=0:(f.start1--,f.length1=parseInt(e[2],10));f.start2=parseInt(e[3],10);""===e[4]?(f.start2--,f.length2=1):"0"==e[4]?f.length2=0:(f.start2--,f.length2=
parseInt(e[4],10));for(c++;c<a.length;){e=a[c].charAt(0);try{var g=decodeURI(a[c].substring(1))}catch(h){throw Error("Illegal escape in patch_fromText: "+g);}if("-"==e)f.diffs.push([-1,g]);else if("+"==e)f.diffs.push([1,g]);else if(" "==e)f.diffs.push([0,g]);else if("@"==e)break;else if(""!==e)throw Error('Invalid patch mode "'+e+'" in: '+g);c++}}return b};diff_match_patch.patch_obj=function(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0};
diff_match_patch.patch_obj.prototype.toString=function(){var a,b;a=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1;b=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;a=["@@ -"+a+" +"+b+" @@\n"];var c;for(b=0;b<this.diffs.length;b++){switch(this.diffs[b][0]){case 1:c="+";break;case -1:c="-";break;case 0:c=" "}a[b+1]=c+encodeURI(this.diffs[b][1])+"\n"}return a.join("").replace(/%20/g," ")};
this.diff_match_patch=diff_match_patch;this.DIFF_DELETE=-1;this.DIFF_INSERT=1;this.DIFF_EQUAL=0;})()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,61 @@
/**
* @license
* Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
* Build: `lodash -o ./dist/lodash.compat.js`
*/
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true
}}function r(n){return n.charCodeAt(0)}function u(n,t){for(var e=n.m,r=t.m,u=-1,o=e.length;++u<o;){var a=e[u],i=r[u];if(a!==i){if(a>i||typeof a=="undefined")return 1;if(a<i||typeof i=="undefined")return-1}}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return false;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Y[n]
}function i(){return v.pop()||[]}function l(){return y.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(n){n.length=0,v.length<w&&v.push(n)}function p(n){var t=n.l;t&&p(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,y.length<w&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];
return u}function g(e){function v(n){return n&&typeof n=="object"&&!qe(n)&&we.call(n,"__wrapped__")?n:new y(n)}function y(n,t){this.__chain__=!!t,this.__wrapped__=n}function w(n){function t(){if(r){var n=s(r);je.apply(n,arguments)}if(this instanceof t){var o=nt(e.prototype),n=e.apply(o,n||arguments);return xt(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return ze(t,n),t}function Y(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!xt(n))return n;var a=he.call(n);if(!V[a]||!Le.nodeClass&&f(n))return n;
var l=Te[a];switch(a){case L:case z:return new l(+n);case W:case M:return new l(n);case J:return o=l(n.source,S.exec(n)),o.lastIndex=n.lastIndex,o}if(a=qe(n),t){var p=!r;r||(r=i()),u||(u=i());for(var g=r.length;g--;)if(r[g]==n)return u[g];o=a?l(n.length):{}}else o=a?s(n):Ye({},n);return a&&(we.call(n,"index")&&(o.index=n.index),we.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?Xe:tr)(n,function(n,a){o[a]=Y(n,t,e,r,u)}),p&&(c(r),c(u)),o):o}function nt(n){return xt(n)?Se(n):{}}function tt(n,t,e){if(typeof n!="function")return Ht;
if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(Le.funcNames&&(r=!n.name),r=r||!Le.funcDecomp,!r)){var u=be.call(n);Le.funcNames||(r=!A.test(u)),r||(r=B.test(u),ze(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Mt(n,t)}function et(n){function t(){var n=l?a:this;
if(u){var h=s(u);je.apply(h,arguments)}return(o||c)&&(h||(h=s(arguments)),o&&je.apply(h,o),c&&h.length<i)?(r|=16,et([e,p?r:-4&r,h,null,a,i])):(h||(h=arguments),f&&(e=n[g]),this instanceof t?(n=nt(e.prototype),h=e.apply(n,h),xt(h)?h:n):e.apply(n,h))}var e=n[0],r=n[1],u=n[2],o=n[3],a=n[4],i=n[5],l=1&r,f=2&r,c=4&r,p=8&r,g=e;return ze(t,n),t}function rt(e,r){var u=-1,a=ht(),i=e?e.length:0,l=i>=_&&a===n,f=[];if(l){var c=o(r);c?(a=t,r=c):l=false}for(;++u<i;)c=e[u],0>a(r,c)&&f.push(c);return l&&p(r),f}function ot(n,t,e,r){r=(r||0)-1;
for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(qe(a)||dt(a))){t||(a=ot(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o}function at(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&X[typeof n]||t&&X[typeof t]))return false;if(null==n||null==t)return n===t;var l=he.call(n),p=he.call(t);if(l==T&&(l=G),p==T&&(p=G),l!=p)return false;switch(l){case L:case z:return+n==+t;
case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case J:case M:return n==ie(t)}if(p=l==$,!p){var s=we.call(n,"__wrapped__"),g=we.call(t,"__wrapped__");if(s||g)return at(s?n.__wrapped__:n,g?t.__wrapped__:t,e,r,u,o);if(l!=G||!Le.nodeClass&&(f(n)||f(t)))return false;if(l=!Le.argsObject&&dt(n)?oe:n.constructor,s=!Le.argsObject&&dt(t)?oe:t.constructor,l!=s&&!(jt(l)&&l instanceof l&&jt(s)&&s instanceof s)&&"constructor"in n&&"constructor"in t)return false}for(l=!u,u||(u=i()),o||(o=i()),s=u.length;s--;)if(u[s]==n)return o[s]==t;
var h=0,a=true;if(u.push(n),o.push(t),p){if(s=n.length,h=t.length,(a=h==s)||r)for(;h--;)if(p=s,g=t[h],r)for(;p--&&!(a=at(n[p],g,e,r,u,o)););else if(!(a=at(n[h],g,e,r,u,o)))break}else nr(t,function(t,i,l){return we.call(l,i)?(h++,a=we.call(n,i)&&at(n[i],t,e,r,u,o)):void 0}),a&&!r&&nr(n,function(n,t,e){return we.call(e,t)?a=-1<--h:void 0});return u.pop(),o.pop(),l&&(c(u),c(o)),a}function it(n,t,e,r,u){(qe(t)?Dt:tr)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=qe(t))||er(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];
break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?qe(f)?f:[]:er(f)?f:{}),r.push(t),u.push(f),c||it(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);n[o]=f})}function lt(n,t){return n+de(Fe()*(t-n+1))}function ft(e,r,u){var a=-1,l=ht(),f=e?e.length:0,s=[],g=!r&&f>=_&&l===n,h=u||g?i():s;for(g&&(h=o(h),l=t);++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function ct(n){return function(t,e,r){var u={};
if(e=v.createCallback(e,r,3),qe(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else Xe(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function pt(n,t,e,r,u,o){var a=1&t,i=4&t,l=16&t,f=32&t;if(!(2&t||jt(n)))throw new le;l&&!e.length&&(t&=-17,l=e=false),f&&!r.length&&(t&=-33,f=r=false);var c=n&&n.__bindData__;return c&&true!==c?(c=s(c),c[2]&&(c[2]=s(c[2])),c[3]&&(c[3]=s(c[3])),!a||1&c[1]||(c[4]=u),!a&&1&c[1]&&(t|=8),!i||4&c[1]||(c[5]=o),l&&je.apply(c[2]||(c[2]=[]),e),f&&Ee.apply(c[3]||(c[3]=[]),r),c[1]|=t,pt.apply(null,c)):(1==t||17===t?w:et)([n,t,e,r,u,o])
}function st(){Q.h=F,Q.b=Q.c=Q.g=Q.i="",Q.e="t",Q.j=true;for(var n,t=0;n=arguments[t];t++)for(var e in n)Q[e]=n[e];t=Q.a,Q.d=/^[^,]+/.exec(t)[0],n=ee,t="return function("+t+"){",e=Q;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",Le.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):Le.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),Le.enumPrototypes&&(r+="var G=typeof t=='function';"),Le.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");
var u=[];if(Le.enumPrototypes&&u.push('!(G&&n=="prototype")'),Le.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}";else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",Le.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}";
r+="}"}return(e.b||Le.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,q,ce,we,d,dt,qe,kt,Q.f,pe,X,$e,M,se,he)}function gt(n){return Ve[n]}function ht(){var t=(t=v.indexOf)===zt?n:t;return t}function vt(n){return typeof n=="function"&&ve.test(n)}function yt(n){var t,e;return!n||he.call(n)!=G||(t=n.constructor,jt(t)&&!(t instanceof t))||!Le.argsClass&&dt(n)||!Le.nodeClass&&f(n)?false:Le.ownLast?(nr(n,function(n,t,r){return e=we.call(r,t),false}),false!==e):(nr(n,function(n,t){e=t
}),typeof e=="undefined"||we.call(n,e))}function mt(n){return He[n]}function dt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&he.call(n)==T||false}function bt(n,t,e){var r=We(n),u=r.length;for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function _t(n){var t=[];return nr(n,function(n,e){jt(n)&&t.push(e)}),t.sort()}function wt(n){for(var t=-1,e=We(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function jt(n){return typeof n=="function"}function xt(n){return!(!n||!X[typeof n])
}function Ct(n){return typeof n=="number"||n&&typeof n=="object"&&he.call(n)==W||false}function kt(n){return typeof n=="string"||n&&typeof n=="object"&&he.call(n)==M||false}function Et(n){for(var t=-1,e=We(n),r=e.length,u=Zt(r);++t<r;)u[t]=n[e[t]];return u}function Ot(n,t,e){var r=-1,u=ht(),o=n?n.length:0,a=false;return e=(0>e?Be(0,o+e):e)||0,qe(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(kt(n)?n.indexOf(t,e):u(n,t,e)):Xe(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function St(n,t,e){var r=true;if(t=v.createCallback(t,e,3),qe(n)){e=-1;
for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Xe(n,function(n,e,u){return r=!!t(n,e,u)});return r}function At(n,t,e){var r=[];if(t=v.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else Xe(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function It(n,t,e){if(t=v.createCallback(t,e,3),!qe(n)){var r;return Xe(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function Dt(n,t,e){if(t&&typeof e=="undefined"&&qe(n)){e=-1;
for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else Xe(n,t,e);return n}function Nt(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),qe(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=We(n),u=o.length;else Le.unindexedChars&&kt(n)&&(r=n.split(""));Xe(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function Bt(n,t,e){var r=-1,u=n?n.length:0,o=Zt(typeof u=="number"?u:0);if(t=v.createCallback(t,e,3),qe(n))for(;++r<u;)o[r]=t(n[r],r,n);else Xe(n,function(n,e,u){o[++r]=t(n,e,u)
});return o}function Pt(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=null==t&&kt(n)?r:v.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Rt(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),qe(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Xe(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e}function Ft(n,t,e,r){var u=3>arguments.length;
return t=v.createCallback(t,r,4),Nt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Tt(n){var t=-1,e=n?n.length:0,r=Zt(typeof e=="number"?e:0);return Dt(n,function(n){var e=lt(0,++t);r[t]=r[e],r[e]=n}),r}function $t(n,t,e){var r;if(t=v.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Xe(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Lt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=v.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++
}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Pe(Be(0,r),u))}function zt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Be(0,u+r):r||0}else if(r)return r=Kt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=v.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Be(0,t);return s(n,r)}function Kt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?v.createCallback(e,r,1):Ht,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;
return u}function Wt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=v.createCallback(e,r,3)),ft(n,t,e)}function Gt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Pt(ar(n,"length")):0,r=Zt(0>e?0:e);++t<e;)r[t]=ar(n,t);return r}function Jt(n,t){var e=-1,r=n?n.length:0,u={};for(t||!r||qe(n[0])||(t=[]);++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Mt(n,t){return 2<arguments.length?pt(n,17,s(arguments,2),null,t):pt(n,1,null,null,t)
}function Vt(n,t,e){var r,u,o,a,i,l,f,c=0,p=false,s=true;if(!jt(n))throw new le;if(t=Be(0,t)||0,true===e)var g=true,s=false;else xt(e)&&(g=e.leading,p="maxWait"in e&&(Be(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);var v=function(){var e=t-(ir()-a);0<e?l=Ce(v,e):(u&&me(u),e=f,u=l=f=h,e&&(c=ir(),o=n.apply(i,r),l||u||(r=i=null)))},y=function(){l&&me(l),u=l=f=h,(s||p!==t)&&(c=ir(),o=n.apply(i,r),l||u||(r=i=null))};return function(){if(r=arguments,a=ir(),i=this,f=s&&(l||!g),false===p)var e=g&&!l;else{u||g||(c=a);
var h=p-(a-c),m=0>=h;m?(u&&(u=me(u)),c=a,o=n.apply(i,r)):u||(u=Ce(y,h))}return m&&l?l=me(l):l||t===p||(l=Ce(v,t)),e&&(m=true,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Ht(n){return n}function Ut(n,t,e){var r=true,u=t&&_t(t);t&&(e||u.length)||(null==e&&(e=t),o=y,t=n,n=v,u=_t(t)),false===e?r=false:xt(e)&&"chain"in e&&(r=e.chain);var o=n,a=jt(o);Dt(u,function(e){var u=n[e]=t[e];a&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,a=[e];if(je.apply(a,arguments),a=u.apply(n,a),r||t){if(e===a&&xt(a))return this;
a=new o(a),a.__chain__=t}return a})})}function Qt(){}function Xt(n){return function(t){return t[n]}}function Yt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,R)):Z;var Zt=e.Array,ne=e.Boolean,te=e.Date,ee=e.Function,re=e.Math,ue=e.Number,oe=e.Object,ae=e.RegExp,ie=e.String,le=e.TypeError,fe=[],ce=e.Error.prototype,pe=oe.prototype,se=ie.prototype,ge=e._,he=pe.toString,ve=ae("^"+ie(he).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ye=re.ceil,me=e.clearTimeout,de=re.floor,be=ee.prototype.toString,_e=vt(_e=oe.getPrototypeOf)&&_e,we=pe.hasOwnProperty,je=fe.push,xe=pe.propertyIsEnumerable,Ce=e.setTimeout,ke=fe.splice,Ee=fe.unshift,Oe=function(){try{var n={},t=vt(t=oe.defineProperty)&&t,e=t(n,n,n)&&t
}catch(r){}return e}(),Se=vt(Se=oe.create)&&Se,Ae=vt(Ae=Zt.isArray)&&Ae,Ie=e.isFinite,De=e.isNaN,Ne=vt(Ne=oe.keys)&&Ne,Be=re.max,Pe=re.min,Re=e.parseInt,Fe=re.random,Te={};Te[$]=Zt,Te[L]=ne,Te[z]=te,Te[K]=ee,Te[G]=oe,Te[W]=ue,Te[J]=ae,Te[M]=ie;var $e={};$e[$]=$e[z]=$e[W]={constructor:true,toLocaleString:true,toString:true,valueOf:true},$e[L]=$e[M]={constructor:true,toString:true,valueOf:true},$e[q]=$e[K]=$e[J]={constructor:true,toString:true},$e[G]={constructor:true},function(){for(var n=F.length;n--;){var t,e=F[n];
for(t in $e)we.call($e,t)&&!we.call($e[t],e)&&($e[t][e]=false)}}(),y.prototype=v.prototype;var Le=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);Le.argsClass=he.call(arguments)==T,Le.argsObject=arguments.constructor==oe&&!(arguments instanceof Zt),Le.enumErrorProps=xe.call(ce,"message")||xe.call(ce,"name"),Le.enumPrototypes=xe.call(n,"prototype"),Le.funcDecomp=!vt(e.WinRTError)&&B.test(g),Le.funcNames=typeof ee.name=="string",Le.nonEnumArgs=0!=u,Le.nonEnumShadows=!/valueOf/.test(r),Le.ownLast="x"!=r[0],Le.spliceObjects=(fe.splice.call(t,0,1),!t[0]),Le.unindexedChars="xx"!="x"[0]+oe("x")[0];
try{Le.nodeClass=!(he.call(document)==G&&!({toString:0}+""))}catch(o){Le.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:v}},Se||(nt=function(){function n(){}return function(t){if(xt(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var ze=Oe?function(n,t){U.value=t,Oe(n,"__bindData__",U)}:Qt;Le.argsClass||(dt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&we.call(n,"callee")&&!xe.call(n,"callee")||false
});var qe=Ae||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&he.call(n)==$||false},Ke=st({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),We=Ne?function(n){return xt(n)?Le.enumPrototypes&&typeof n=="function"||Le.nonEnumArgs&&n.length&&dt(n)?Ke(n):Ne(n):[]}:Ke,Ge={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:We,g:"if(e(t[n],n,g)===false)return E"},Je={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:We,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Me={i:"if(!B[typeof t])return E;"+Ge.i,b:false},Ve={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},He=wt(Ve),Ue=ae("("+We(He).join("|")+")","g"),Qe=ae("["+We(Ve).join("")+"]","g"),Xe=st(Ge),Ye=st(Je,{i:Je.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),Ze=st(Je),nr=st(Ge,Me,{j:false}),tr=st(Ge,Me);
jt(/x/)&&(jt=function(n){return typeof n=="function"&&he.call(n)==K});var er=_e?function(n){if(!n||he.call(n)!=G||!Le.argsClass&&dt(n))return false;var t=n.valueOf,e=vt(t)&&(e=_e(t))&&_e(e);return e?n==e||_e(n)==e:yt(n)}:yt,rr=ct(function(n,t,e){we.call(n,e)?n[e]++:n[e]=1}),ur=ct(function(n,t,e){(we.call(n,e)?n[e]:n[e]=[]).push(t)}),or=ct(function(n,t,e){n[e]=t}),ar=Bt,ir=vt(ir=te.now)&&ir||function(){return(new te).getTime()},lr=8==Re(j+"08")?Re:function(n,t){return Re(kt(n)?n.replace(D,""):n,t||0)};
return v.after=function(n,t){if(!jt(t))throw new le;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=Ye,v.at=function(n){var t=arguments,e=-1,r=ot(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Zt(t);for(Le.unindexedChars&&kt(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},v.bind=Mt,v.bindAll=function(n){for(var t=1<arguments.length?ot(arguments,true,false,1):_t(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=pt(n[u],1,null,null,n)}return n},v.bindKey=function(n,t){return 2<arguments.length?pt(t,19,s(arguments,2),null,n):pt(t,3,null,null,n)
},v.chain=function(n){return n=new y(n),n.__chain__=true,n},v.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},v.compose=function(){for(var n=arguments,t=n.length;t--;)if(!jt(n[t]))throw new le;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},v.constant=function(n){return function(){return n}},v.countBy=rr,v.create=function(n,t){var e=nt(n);return t?Ye(e,t):e},v.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return tt(n,t,e);
if("object"!=r)return Xt(n);var u=We(n),o=u[0],a=n[o];return 1!=u.length||a!==a||xt(a)?function(t){for(var e=u.length,r=false;e--&&(r=at(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},v.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,pt(n,4,null,null,null,t)},v.debounce=Vt,v.defaults=Ze,v.defer=function(n){if(!jt(n))throw new le;var t=s(arguments,1);return Ce(function(){n.apply(h,t)},1)},v.delay=function(n,t){if(!jt(n))throw new le;var e=s(arguments,2);
return Ce(function(){n.apply(h,e)},t)},v.difference=function(n){return rt(n,ot(arguments,true,true,1))},v.filter=At,v.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Bt(n,e,r)),ot(n,t)},v.forEach=Dt,v.forEachRight=Nt,v.forIn=nr,v.forInRight=function(n,t,e){var r=[];nr(n,function(n,t){r.push(t,n)});var u=r.length;for(t=tt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},v.forOwn=tr,v.forOwnRight=bt,v.functions=_t,v.groupBy=ur,v.indexBy=or,v.initial=function(n,t,e){var r=0,u=n?n.length:0;
if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Pe(Be(0,u-r),u))},v.intersection=function(){for(var e=[],r=-1,u=arguments.length,a=i(),l=ht(),f=l===n,s=i();++r<u;){var g=arguments[r];(qe(g)||dt(g))&&(e.push(g),a.push(f&&g.length>=_&&o(r?e[r]:s)))}var f=e[0],h=-1,v=f?f.length:0,y=[];n:for(;++h<v;){var m=a[0],g=f[h];if(0>(m?t(m,g):l(s,g))){for(r=u,(m||s).push(g);--r;)if(m=a[r],0>(m?t(m,g):l(e[r],g)))continue n;y.push(g)
}}for(;u--;)(m=a[u])&&p(m);return c(a),c(s),y},v.invert=wt,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Zt(typeof o=="number"?o:0);return Dt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=We,v.map=Bt,v.mapValues=function(n,t,e){var r={};return t=v.createCallback(t,e,3),tr(n,function(n,e,u){r[e]=t(n,e,u)}),r},v.max=Pt,v.memoize=function(n,t){if(!jt(n))throw new le;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];return we.call(r,u)?r[u]:r[u]=n.apply(this,arguments)
};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!xt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=tt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=s(arguments,1,e),u=-1,o=i(),a=i();++u<e;)it(n,t[u],r,o,a);return c(o),c(a),n},v.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=null==t&&kt(n)?r:v.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)
});return o},v.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];nr(n,function(n,t){u.push(t)});for(var u=rt(u,ot(arguments,true,false,1)),o=-1,a=u.length;++o<a;){var i=u[o];r[i]=n[i]}}else t=v.createCallback(t,e,3),nr(n,function(n,e,u){t(n,e,u)||(r[e]=n)});return r},v.once=function(n){var t,e;if(!jt(n))throw new le;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)}},v.pairs=function(n){for(var t=-1,e=We(n),r=e.length,u=Zt(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u
},v.partial=function(n){return pt(n,16,s(arguments,1))},v.partialRight=function(n){return pt(n,32,null,s(arguments,1))},v.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=ot(arguments,true,false,1),a=xt(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=v.createCallback(t,e,3),nr(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},v.pluck=ar,v.property=Xt,v.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(ke.call(n,o--,1),u--);
return n},v.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Be(0,ye((t-n)/(e||1)));for(var u=Zt(t);++r<t;)u[r]=n,n+=e;return u},v.reject=function(n,t,e){return t=v.createCallback(t,e,3),At(n,function(n,e,r){return!t(n,e,r)})},v.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=v.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),ke.call(n,r--,1),u--);return o},v.rest=qt,v.shuffle=Tt,v.sortBy=function(n,t,e){var r=-1,o=qe(t),a=n?n.length:0,f=Zt(typeof a=="number"?a:0);
for(o||(t=v.createCallback(t,e,3)),Dt(n,function(n,e,u){var a=f[++r]=l();o?a.m=Bt(t,function(t){return n[t]}):(a.m=i())[0]=t(n,e,u),a.n=r,a.o=n}),a=f.length,f.sort(u);a--;)n=f[a],f[a]=n.o,o||c(n.m),p(n);return f},v.tap=function(n,t){return t(n),n},v.throttle=function(n,t,e){var r=true,u=true;if(!jt(n))throw new le;return false===e?r=false:xt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),H.leading=r,H.maxWait=t,H.trailing=u,Vt(n,t,H)},v.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Zt(n);
for(t=tt(t,e,1);++r<n;)u[r]=t(r);return u},v.toArray=function(n){return n&&typeof n.length=="number"?Le.unindexedChars&&kt(n)?n.split(""):s(n):Et(n)},v.transform=function(n,t,e,r){var u=qe(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=nt(o&&o.prototype)}return t&&(t=v.createCallback(t,r,4),(u?Xe:tr)(n,function(n,r,u){return t(e,n,r,u)})),e},v.union=function(){return ft(ot(arguments,true,true))},v.uniq=Wt,v.values=Et,v.where=At,v.without=function(n){return rt(n,s(arguments,1))},v.wrap=function(n,t){return pt(t,16,[n])
},v.xor=function(){for(var n=-1,t=arguments.length;++n<t;){var e=arguments[n];if(qe(e)||dt(e))var r=r?ft(rt(r,e).concat(rt(e,r))):e}return r||[]},v.zip=Gt,v.zipObject=Jt,v.collect=Bt,v.drop=qt,v.each=Dt,v.eachRight=Nt,v.extend=Ye,v.methods=_t,v.object=Jt,v.select=At,v.tail=qt,v.unique=Wt,v.unzip=Gt,Ut(v),v.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),Y(n,t,typeof e=="function"&&tt(e,r,1))},v.cloneDeep=function(n,t,e){return Y(n,true,typeof t=="function"&&tt(t,e,1))},v.contains=Ot,v.escape=function(n){return null==n?"":ie(n).replace(Qe,gt)
},v.every=St,v.find=It,v.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=v.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},v.findKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),tr(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.findLast=function(n,t,e){var r;return t=v.createCallback(t,e,3),Nt(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r},v.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=v.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;
return-1},v.findLastKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),bt(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.has=function(n,t){return n?we.call(n,t):false},v.identity=Ht,v.indexOf=zt,v.isArguments=dt,v.isArray=qe,v.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&he.call(n)==L||false},v.isDate=function(n){return n&&typeof n=="object"&&he.call(n)==z||false},v.isElement=function(n){return n&&1===n.nodeType||false},v.isEmpty=function(n){var t=true;if(!n)return t;var e=he.call(n),r=n.length;
return e==$||e==M||(Le.argsClass?e==T:dt(n))||e==G&&typeof r=="number"&&jt(n.splice)?!r:(tr(n,function(){return t=false}),t)},v.isEqual=function(n,t,e,r){return at(n,t,typeof e=="function"&&tt(e,r,2))},v.isFinite=function(n){return Ie(n)&&!De(parseFloat(n))},v.isFunction=jt,v.isNaN=function(n){return Ct(n)&&n!=+n},v.isNull=function(n){return null===n},v.isNumber=Ct,v.isObject=xt,v.isPlainObject=er,v.isRegExp=function(n){return n&&X[typeof n]&&he.call(n)==J||false},v.isString=kt,v.isUndefined=function(n){return typeof n=="undefined"
},v.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Be(0,r+e):Pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Ut,v.noConflict=function(){return e._=ge,this},v.noop=Qt,v.now=ir,v.parseInt=lr,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Fe(),Pe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):lt(n,t)},v.reduce=Rt,v.reduceRight=Ft,v.result=function(n,t){if(n){var e=n[t];
return jt(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:We(n).length},v.some=$t,v.sortedIndex=Kt,v.template=function(n,t,e){var r=v.templateSettings;n=ie(n||""),e=Ze({},e,r);var u,o=Ze({},e.imports,r.imports),r=We(o),o=Et(o),i=0,l=e.interpolate||N,f="__p+='",l=ae((e.escape||N).source+"|"+l.source+"|"+(l===I?O:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(P,a),e&&(f+="'+__e("+e+")+'"),l&&(u=true,f+="';"+l+";\n__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t
}),f+="';",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(x,""):f).replace(C,"$1").replace(E,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=ee(r,"return "+f).apply(h,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},v.unescape=function(n){return null==n?"":ie(n).replace(Ue,mt)},v.uniqueId=function(n){var t=++m;return ie(null==n?"":n)+t
},v.all=St,v.any=$t,v.detect=It,v.findWhere=It,v.foldl=Rt,v.foldr=Ft,v.include=Ot,v.inject=Rt,Ut(function(){var n={};return tr(v,function(t,e){v.prototype[e]||(n[e]=t)}),n}(),false),v.first=Lt,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Be(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=Et(n):Le.unindexedChars&&kt(n)&&(n=n.split("")),null==t||e?n?n[lt(0,n.length-1)]:h:(n=Tt(n),n.length=Pe(Be(0,t),n.length),n)
},v.take=Lt,v.head=Lt,tr(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.4.1",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return ie(this.__wrapped__)},v.prototype.value=Yt,v.prototype.valueOf=Yt,Xe(["join","pop","shift"],function(n){var t=fe[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
return n?new y(e,n):e}}),Xe(["push","reverse","sort","unshift"],function(n){var t=fe[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xe(["concat","slice","splice"],function(n){var t=fe[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Le.spliceObjects||Xe(["pop","shift","splice"],function(n){var t=fe[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new y(u,n):u
}}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,A=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,D=RegExp("^["+j+"]*0+(?=.$)"),N=/($^)/,B=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setTimeout".split(" "),F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),T="[object Arguments]",$="[object Array]",L="[object Boolean]",z="[object Date]",q="[object Error]",K="[object Function]",W="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",V={};
V[K]=false,V[T]=V[$]=V[L]=V[z]=V[W]=V[G]=V[J]=V[M]=true;var H={leading:false,maxWait:0,trailing:false},U={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global;
!rt||rt.global!==rt&&rt.window!==rt||(Z=rt);var ut=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Z._=ut, define(function(){return ut})):nt&&tt?et?(tt.exports=ut)._=ut:nt._=ut:Z._=ut}).call(this);

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

@ -0,0 +1,204 @@
var isArray = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
};
/**
* Expose `pathToRegexp`.
*/
// module.exports = pathToRegexp
/**
* The main path matching regexp utility.
*
* @type {RegExp}
*/
var PATH_REGEXP = new RegExp([
// Match escaped characters that would otherwise appear in future matches.
// This allows the user to escape special characters that won't transform.
'(\\\\.)',
// Match Express-style parameters and un-named parameters with a prefix
// and optional suffixes. Matches appear as:
//
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?"]
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined]
'([\\/.])?(?:\\:(\\w+)(?:\\(((?:\\\\.|[^)])*)\\))?|\\(((?:\\\\.|[^)])*)\\))([+*?])?',
// Match regexp special characters that are always escaped.
'([.+*?=^!:${}()[\\]|\\/])'
].join('|'), 'g');
/**
* Escape the capturing group by escaping special characters and meaning.
*
* @param {String} group
* @return {String}
*/
function escapeGroup (group) {
return group.replace(/([=!:$\/()])/g, '\\$1');
}
/**
* Attach the keys as a property of the regexp.
*
* @param {RegExp} re
* @param {Array} keys
* @return {RegExp}
*/
function attachKeys (re, keys) {
re.keys = keys;
return re;
}
/**
* Get the flags for a regexp from the options.
*
* @param {Object} options
* @return {String}
*/
function flags (options) {
return options.sensitive ? '' : 'i';
}
/**
* Pull out keys from a regexp.
*
* @param {RegExp} path
* @param {Array} keys
* @return {RegExp}
*/
function regexpToRegexp (path, keys) {
// Use a negative lookahead to match only capturing groups.
var groups = path.source.match(/\((?!\?)/g);
if (groups) {
for (var i = 0; i < groups.length; i++) {
keys.push({
name: i,
delimiter: null,
optional: false,
repeat: false
});
}
}
return attachKeys(path, keys);
}
/**
* Transform an array into a regexp.
*
* @param {Array} path
* @param {Array} keys
* @param {Object} options
* @return {RegExp}
*/
function arrayToRegexp (path, keys, options) {
var parts = [];
for (var i = 0; i < path.length; i++) {
parts.push(pathToRegexp(path[i], keys, options).source);
}
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
return attachKeys(regexp, keys);
}
/**
* Replace the specific tags with regexp strings.
*
* @param {String} path
* @param {Array} keys
* @return {String}
*/
function replacePath (path, keys) {
var index = 0;
function replace (_, escaped, prefix, key, capture, group, suffix, escape) {
if (escaped) {
return escaped;
}
if (escape) {
return '\\' + escape;
}
var repeat = suffix === '+' || suffix === '*';
var optional = suffix === '?' || suffix === '*';
keys.push({
name: key || index++,
delimiter: prefix || '/',
optional: optional,
repeat: repeat
});
prefix = prefix ? ('\\' + prefix) : '';
capture = escapeGroup(capture || group || '[^' + (prefix || '\\/') + ']+?');
if (repeat) {
capture = capture + '(?:' + prefix + capture + ')*';
}
if (optional) {
return '(?:' + prefix + '(' + capture + '))?';
}
// Basic parameter support.
return prefix + '(' + capture + ')';
}
return path.replace(PATH_REGEXP, replace);
}
/**
* Normalize the given path string, returning a regular expression.
*
* An empty array can be passed in for the keys, which will hold the
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
*
* @param {(String|RegExp|Array)} path
* @param {Array} [keys]
* @param {Object} [options]
* @return {RegExp}
*/
function pathToRegexp (path, keys, options) {
keys = keys || [];
if (!isArray(keys)) {
options = keys;
keys = [];
} else if (!options) {
options = {};
}
if (path instanceof RegExp) {
return regexpToRegexp(path, keys, options);
}
if (isArray(path)) {
return arrayToRegexp(path, keys, options);
}
var strict = options.strict;
var end = options.end !== false;
var route = replacePath(path, keys);
var endsWithSlash = path.charAt(path.length - 1) === '/';
// In non-strict mode we allow a slash at the end of match. If the path to
// match already ends with a slash, we remove it for consistency. The slash
// is valid at the end of a path match, not in the middle. This is important
// in non-ending mode, where "/test/" shouldn't match "/test//route".
if (!strict) {
route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?';
}
if (end) {
route += '$';
} else {
// In non-ending mode, we need the capturing groups to match as much as
// possible by using a positive lookahead to the end or next path segment.
route += strict && endsWithSlash ? '' : '(?=\\/|$)';
}
return attachKeys(new RegExp('^' + route, flags(options)), keys);
}

@ -0,0 +1,100 @@
// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys
if (!Object.keys) {
Object.keys = (function () {
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
],
dontEnumsLength = dontEnums.length;
return function (obj) {
if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) {
throw new TypeError('Object.keys called on non-object');
}
var result = [], prop, i;
for (prop in obj) {
if (hasOwnProperty.call(obj, prop)) {
result.push(prop);
}
}
if (hasDontEnumBug) {
for (i = 0; i < dontEnumsLength; i++) {
if (hasOwnProperty.call(obj, dontEnums[i])) {
result.push(dontEnums[i]);
}
}
}
return result;
};
}());
}
//Production steps of ECMA-262, Edition 5, 15.4.4.18
//Reference: http://es5.github.com/#x15.4.4.18
if (!Array.prototype.forEach) {
Array.prototype.forEach = function (callback, thisArg) {
var T, k;
if (this == null) {
throw new TypeError(" this is null or not defined");
}
// 1. Let O be the result of calling ToObject passing the |this| value as the argument.
var O = Object(this);
// 2. Let lenValue be the result of calling the Get internal method of O with the argument "length".
// 3. Let len be ToUint32(lenValue).
var len = O.length >>> 0;
// 4. If IsCallable(callback) is false, throw a TypeError exception.
// See: http://es5.github.com/#x9.11
if (typeof callback !== "function") {
throw new TypeError(callback + " is not a function");
}
// 5. If thisArg was supplied, let T be thisArg; else let T be undefined.
if (arguments.length > 1) {
T = thisArg;
}
// 6. Let k be 0
k = 0;
// 7. Repeat, while k < len
while (k < len) {
var kValue;
// a. Let Pk be ToString(k).
// This is implicit for LHS operands of the in operator
// b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.
// This step can be combined with c
// c. If kPresent is true, then
if (k in O) {
// i. Let kValue be the result of calling the Get internal method of O with argument Pk.
kValue = O[k];
// ii. Call the Call internal method of callback with T as the this value and
// argument list containing kValue, k, and O.
callback.call(T, kValue, k, O);
}
// d. Increase k by 1.
k++;
}
// 8. return undefined
};
}

@ -0,0 +1,101 @@
/* Pretty printing styles. Used with prettify.js. */
/* Vim sunburst theme by David Leibovic */
pre .str {
color: #65B042;
}
/* string - green */
pre .kwd {
color: #E28964;
}
/* keyword - dark pink */
pre .com {
color: #AEAEAE;
font-style: italic;
}
/* comment - gray */
pre .typ {
color: #89bdff;
}
/* type - light blue */
pre .lit {
color: #3387CC;
}
/* literal - blue */
pre .pun {
color: #fff;
}
/* punctuation - white */
pre .pln {
color: #fff;
}
/* plaintext - white */
pre .tag {
color: #89bdff;
}
/* html/xml tag - light blue */
pre .atn {
color: #bdb76b;
}
/* html/xml attribute name - khaki */
pre .atv {
color: #65B042;
}
/* html/xml attribute value - green */
pre .dec {
color: #3387CC;
}
/* decimal - blue */
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0;
color: #AEAEAE;
}
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 {
list-style-type: none;
}
/* Alternate shading for lines */
@media print {
pre .str {
color: #060;
}
pre .kwd {
color: #006;
font-weight: bold;
}
pre .com {
color: #600;
font-style: italic;
}
pre .typ {
color: #404;
font-weight: bold;
}
pre .lit {
color: #044;
}
pre .pun {
color: #440;
}
pre .pln {
color: #000;
}
pre .tag {
color: #006;
font-weight: bold;
}
pre .atn {
color: #404;
}
pre .atv {
color: #060;
}
}

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\n\r]*/,null,"#"],["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/,
null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[ES]?BANK=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[!-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["apollo","agc","aea"]);

@ -0,0 +1,3 @@
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["str",/^"(?:[^\n\r"\\]|\\.)*(?:"|$)/,a,'"'],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^REM[^\n\r]*/,a],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,a],["pln",/^[a-z][^\W_]?(?:\$|%)?/i,a],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/i,a,"0123456789"],["pun",
/^.[^\s\w"$%.]*/,a]]),["basic","cbm"]);

@ -0,0 +1,18 @@
/*
Copyright (C) 2011 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[([{]+/,a,"([{"],["clo",/^[)\]}]+/,a,")]}"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/,a],
["typ",/^:[\dA-Za-z-]+/]]),["clj"]);

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\u000c"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]+)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],
["com",/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}\b/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);

@ -0,0 +1,3 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!.*/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/.*/],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i],
["typ",/^\b(?:bool|double|dynamic|int|num|object|string|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?'''[\S\s]*?[^\\]'''/],["str",/^r?"""[\S\s]*?[^\\]"""/],["str",/^r?'('|[^\n\f\r]*?[^\\]')/],["str",/^r?"("|[^\n\f\r]*?[^\\]")/],["pln",/^[$_a-z]\w*/i],["pun",/^[!%&*+/:<-?^|~-]/],["lit",/^\b0x[\da-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit",/^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(),.;[\]{}]/]]),
["dart"]);

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["lit",/^[a-z]\w*/],["lit",/^'(?:[^\n\f\r'\\]|\\[^&])+'?/,null,"'"],["lit",/^\?[^\t\n ({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/],
["kwd",/^-[_a-z]+/],["typ",/^[A-Z_]\w*/],["pun",/^[,.;]/]]),["erlang","erl"]);

@ -0,0 +1 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]);

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t-\r ]+/,null,"\t\n\u000b\u000c\r "],["str",/^"(?:[^\n\f\r"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^\n\f\r'\\]|\\[^&])'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:--+[^\n\f\r]*|{-(?:[^-]|-+[^}-])*-})/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^\d'A-Za-z]|$)/,
null],["pln",/^(?:[A-Z][\w']*\.)*[A-Za-z][\w']*/],["pun",/^[^\d\t-\r "'A-Za-z]+/]]),["hs"]);

@ -0,0 +1,3 @@
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/,a],
["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","lsp","scm","ss","rkt"]);

@ -0,0 +1 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^!?"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["com",/^;[^\n\r]*/,null,";"]],[["pln",/^[!%@](?:[$\-.A-Z_a-z][\w$\-.]*|\d+)/],["kwd",/^[^\W\d]\w*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[Xx][\dA-Fa-f]+)/],["pun",/^[(-*,:<->[\]{}]|\.\.\.$/]]),["llvm","ll"]);

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["str",/^\[(=*)\[[\S\s]*?(?:]\1]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],
["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]);

File diff suppressed because one or more lines are too long

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xa0]+(?:[$_a-z][\w']*|``[^\t\n\r`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])(?:'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\(\*[\S\s]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/],
["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^(?:[_a-z][\w']*[!#?]?|``[^\t\n\r`]*(?:``|$))/i],["pun",/^[^\w\t\n\r "'\xa0]+/]]),["fs","ml"]);

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"]|\\.)*"/,null,'"']],[["com",/^;[^\n\r]*/,null,";"],["dec",/^\$(?:d|device|ec|ecode|es|estack|et|etrap|h|horolog|i|io|j|job|k|key|p|principal|q|quit|st|stack|s|storage|sy|system|t|test|tl|tlevel|tr|trestart|x|y|z[a-z]*|a|ascii|c|char|d|data|e|extract|f|find|fn|fnumber|g|get|j|justify|l|length|na|name|o|order|p|piece|ql|qlength|qs|qsubscript|q|query|r|random|re|reverse|s|select|st|stack|t|text|tr|translate|nan)\b/i,
null],["kwd",/^(?:[^$]b|break|c|close|d|do|e|else|f|for|g|goto|h|halt|h|hang|i|if|j|job|k|kill|l|lock|m|merge|n|new|o|open|q|quit|r|read|s|set|tc|tcommit|tre|trestart|tro|trollback|ts|tstart|u|use|v|view|w|write|x|xecute)\b/i,null],["lit",/^[+-]?(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?/i],["pln",/^[a-z][^\W_]*/i],["pun",/^[^\w\t\n\r"$%;^\xa0]|_/]]),["mumps"]);

@ -0,0 +1,4 @@
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:'(?:[^\n\r'\\]|\\.)*'|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,a,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,a,"#"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["str",/^@"(?:[^"]|"")*(?:"|$)/,a],["str",/^<#[^#>]*(?:#>|$)/,a],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,a],["com",/^\/\/[^\n\r]*/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/,
a],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/,
a],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,a],["lit",/^@[$_a-z][\w$@]*/i,a],["typ",/^@[A-Z]+[a-z][\w$@]*/,a],["pln",/^'?[$_a-z][\w$@]*/i,a],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,a,"0123456789"],["pun",/^.[^\s\w"-$'./@`]*/,a]]),["n","nemerle"]);

@ -0,0 +1,3 @@
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["str",/^'(?:[^\n\r'\\]|\\.)*(?:'|$)/,a,"'"],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^\(\*[\S\s]*?(?:\*\)|$)|^{[\S\s]*?(?:}|$)/,a],["kwd",/^(?:absolute|and|array|asm|assembler|begin|case|const|constructor|destructor|div|do|downto|else|end|external|for|forward|function|goto|if|implementation|in|inline|interface|interrupt|label|mod|not|object|of|or|packed|procedure|program|record|repeat|set|shl|shr|then|to|type|unit|until|uses|var|virtual|while|with|xor)\b/i,a],
["lit",/^(?:true|false|self|nil)/i,a],["pln",/^[a-z][^\W_]*/i,a],["lit",/^(?:\$[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)/i,a,"0123456789"],["pun",/^.[^\s\w$'./@]*/,a]]),["pascal"]);

@ -0,0 +1 @@
PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]);

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["str",/^'(?:[^'\\]|\\[\S\s])*(?:'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![\w.])/],["lit",/^0[Xx][\dA-Fa-f]+([Pp]\d+)?[Li]?/],["lit",/^[+-]?(\d+(\.\d+)?|\.\d+)([Ee][+-]?\d+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|\d+))(?![\w.])/],
["pun",/^(?:<<?-|->>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|[!*+/^]|%.*?%|[$=@~]|:{1,3}|[(),;?[\]{}])/],["pln",/^(?:[A-Za-z]+[\w.]*|\.[^\W\d][\w.]*)(?![\w.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]);

@ -0,0 +1 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[@-Za-z]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[()[\]{}]+/]]),["Rd","rd"]);

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^"(?:""(?:""?(?!")|[^"\\]|\\.)*"{0,3}|(?:[^\n\r"\\]|\\.)*"?)/,null,'"'],["lit",/^`(?:[^\n\r\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&(--:-@[-^{-~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\n\r'\\]|\\(?:'|[^\n\r']+))'/],["lit",/^'[$A-Z_a-z][\w$]*(?![\w$'])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/],
["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:0(?:[0-7]+|x[\da-f]+)l?|(?:0|[1-9]\d*)(?:(?:\.\d+)?(?:e[+-]?\d+)?f?|l?)|\\.\d+(?:e[+-]?\d+)?f?)/i],["typ",/^[$_]*[A-Z][\d$A-Z_]*[a-z][\w$]*/],["pln",/^[$A-Z_a-z][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]);

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\n\r]*|\/\*[\S\s]*?(?:\*\/|$))/],["kwd",/^(?:add|all|alter|and|any|apply|as|asc|authorization|backup|begin|between|break|browse|bulk|by|cascade|case|check|checkpoint|close|clustered|coalesce|collate|column|commit|compute|connect|constraint|contains|containstable|continue|convert|create|cross|current|current_date|current_time|current_timestamp|current_user|cursor|database|dbcc|deallocate|declare|default|delete|deny|desc|disk|distinct|distributed|double|drop|dummy|dump|else|end|errlvl|escape|except|exec|execute|exists|exit|fetch|file|fillfactor|following|for|foreign|freetext|freetexttable|from|full|function|goto|grant|group|having|holdlock|identity|identitycol|identity_insert|if|in|index|inner|insert|intersect|into|is|join|key|kill|left|like|lineno|load|match|matched|merge|natural|national|nocheck|nonclustered|nocycle|not|null|nullif|of|off|offsets|on|open|opendatasource|openquery|openrowset|openxml|option|or|order|outer|over|partition|percent|pivot|plan|preceding|precision|primary|print|proc|procedure|public|raiserror|read|readtext|reconfigure|references|replication|restore|restrict|return|revoke|right|rollback|rowcount|rowguidcol|rows?|rule|save|schema|select|session_user|set|setuser|shutdown|some|start|statistics|system_user|table|textsize|then|to|top|tran|transaction|trigger|truncate|tsequal|unbounded|union|unique|unpivot|update|updatetext|use|user|using|values|varying|view|waitfor|when|where|while|with|within|writetext|xml)(?=[^\w-]|$)/i,
null],["lit",/^[+-]?(?:0x[\da-f]+|(?:\.\d+|\d+(?:\.\d*)?)(?:e[+-]?\d+)?)/i],["pln",/^[_a-z][\w-]*/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'+\xa0-]*/]]),["sql"]);

@ -0,0 +1,3 @@
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["opn",/^{+/,a,"{"],["clo",/^}+/,a,"}"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,a],["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",
/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["tcl"]);

@ -0,0 +1 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]);

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})(?:["\u201c\u201d]c|$)|["\u201c\u201d](?:[^"\u201c\u201d]|["\u201c\u201d]{2})*(?:["\u201c\u201d]|$))/i,null,'"\u201c\u201d'],["com",/^['\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\n\r_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:addhandler|addressof|alias|and|andalso|ansi|as|assembly|auto|boolean|byref|byte|byval|call|case|catch|cbool|cbyte|cchar|cdate|cdbl|cdec|char|cint|class|clng|cobj|const|cshort|csng|cstr|ctype|date|decimal|declare|default|delegate|dim|directcast|do|double|each|else|elseif|end|endif|enum|erase|error|event|exit|finally|for|friend|function|get|gettype|gosub|goto|handles|if|implements|imports|in|inherits|integer|interface|is|let|lib|like|long|loop|me|mod|module|mustinherit|mustoverride|mybase|myclass|namespace|new|next|not|notinheritable|notoverridable|object|on|option|optional|or|orelse|overloads|overridable|overrides|paramarray|preserve|private|property|protected|public|raiseevent|readonly|redim|removehandler|resume|return|select|set|shadows|shared|short|single|static|step|stop|string|structure|sub|synclock|then|throw|to|try|typeof|unicode|until|variant|wend|when|while|with|withevents|writeonly|xor|endif|gosub|let|variant|wend)\b/i,
null],["com",/^rem\b.*/i],["lit",/^(?:true\b|false\b|nothing\b|\d+(?:e[+-]?\d+[dfr]?|[dfilrs])?|(?:&h[\da-f]+|&o[0-7]+)[ils]?|\d*\.\d+(?:e[+-]?\d+)?[dfr]?|#\s+(?:\d+[/-]\d+[/-]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:am|pm))?)?|\d+:\d+(?::\d+)?(\s*(?:am|pm))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[!#%&@]+])?|\[(?:[a-z]|_\w)\w*])/i],["pun",/^[^\w\t\n\r "'[\]\xa0\u2018\u2019\u201c\u201d\u2028\u2029]+/],["pun",/^(?:\[|])/]]),["vb","vbs"]);

@ -0,0 +1,3 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[box]?"(?:[^"]|"")*"|'.')/i],["com",/^--[^\n\r]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i,
null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^'(?:active|ascending|base|delayed|driving|driving_value|event|high|image|instance_name|last_active|last_event|last_value|left|leftof|length|low|path_name|pos|pred|quiet|range|reverse_range|right|rightof|simple_name|stable|succ|transaction|val|value)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w.\\]+#(?:[+-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:e[+-]?\d+(?:_\d+)*)?)/i],
["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r "'\xa0][^\w\t\n\r "'\xa0-]*/]]),["vhdl","vhd"]);

@ -0,0 +1,2 @@
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]);
PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]);

File diff suppressed because one or more lines are too long

@ -0,0 +1,2 @@
var a=null;
PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]);

@ -0,0 +1 @@
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

@ -0,0 +1,30 @@
!function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
(function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a=
b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a<f;++a){var h=b[a];if(/\\[bdsw]/i.test(h))c.push(h);else{var h=d(h),l;a+2<f&&"-"===b[a+1]?(l=d(b[a+2]),a+=2):l=h;e.push([h,l]);l<65||h>122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;a<e.length;++a)h=e[a],h[0]<=f[1]+1?f[1]=Math.max(f[1],h[1]):b.push(f=h);for(a=0;a<b.length;++a)h=b[a],c.push(g(h[0])),
h[1]>h[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f<c;++f){var l=a[f];l==="("?++h:"\\"===l.charAt(0)&&(l=+l.substring(1))&&(l<=h?d[l]=-1:a[f]=g(l))}for(f=1;f<d.length;++f)-1===d[f]&&(d[f]=++x);for(h=f=0;f<c;++f)l=a[f],l==="("?(++h,d[h]||(a[f]="(?:")):"\\"===l.charAt(0)&&(l=+l.substring(1))&&l<=h&&
(a[f]="\\"+d[l]);for(f=0;f<c;++f)"^"===a[f]&&"^"!==a[f+1]&&(a[f]="");if(e.ignoreCase&&m)for(f=0;f<c;++f)l=a[f],e=l.charAt(0),l.length>=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k<c;++k){var i=a[k];if(i.ignoreCase)j=!0;else if(/[a-z]/i.test(i.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){m=!0;j=!1;break}}for(var r={b:8,t:9,n:10,v:11,
f:12,r:13},n=[],k=0,c=a.length;k<c;++k){i=a[k];if(i.global||i.multiline)throw Error(""+i);n.push("(?:"+s(i)+")")}return RegExp(n.join("|"),j?"gi":"g")}function T(a,d){function g(a){var c=a.nodeType;if(c==1){if(!b.test(a.className)){for(c=a.firstChild;c;c=c.nextSibling)g(c);c=a.nodeName.toLowerCase();if("br"===c||"li"===c)s[j]="\n",m[j<<1]=x++,m[j++<<1|1]=a}}else if(c==3||c==4)c=a.nodeValue,c.length&&(c=d?c.replace(/\r\n?/g,"\n"):c.replace(/[\t\n\r ]+/g," "),s[j]=c,m[j<<1]=x,x+=c.length,m[j++<<1|1]=
a)}var b=/(?:^|\s)nocode(?:\s|$)/,s=[],x=0,m=[],j=0;g(a);return{a:s.join("").replace(/\n$/,""),d:m}}function H(a,d,g,b){d&&(a={a:d,e:a},g(a),b.push.apply(b,a.g))}function U(a){for(var d=void 0,g=a.firstChild;g;g=g.nextSibling)var b=g.nodeType,d=b===1?d?a:g:b===3?V.test(g.nodeValue)?a:d:d;return d===a?void 0:d}function C(a,d){function g(a){for(var j=a.e,k=[j,"pln"],c=0,i=a.a.match(s)||[],r={},n=0,e=i.length;n<e;++n){var z=i[n],w=r[z],t=void 0,f;if(typeof w==="string")f=!1;else{var h=b[z.charAt(0)];
if(h)t=z.match(h[1]),w=h[0];else{for(f=0;f<x;++f)if(h=d[f],t=z.match(h[1])){w=h[0];break}t||(w="pln")}if((f=w.length>=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c<i;++c){var r=
g[c],n=r[3];if(n)for(var e=n.length;--e>=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com",
/^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+
s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,
q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d=
c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i<c.length;++i)b(c[i]);d===(d|0)&&c[0].setAttribute("value",d);var r=j.createElement("ol");
r.className="linenums";for(var d=Math.max(0,d-1|0)||0,i=0,n=c.length;i<n;++i)k=c[i],k.className="L"+(i+d)%10,k.firstChild||k.appendChild(j.createTextNode("\u00a0")),r.appendChild(k);a.appendChild(r)}function p(a,d){for(var g=d.length;--g>=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*</.test(d)?"default-markup":"default-code";return F[a]}function K(a){var d=a.h;try{var g=T(a.c,a.i),b=g.a;
a.a=b;a.d=g.d;a.e=0;I(d,b)(a);var s=/\bMSIE\s(\d+)/.exec(navigator.userAgent),s=s&&+s[1]<=8,d=/\n/g,x=a.a,m=x.length,g=0,j=a.d,k=j.length,b=0,c=a.g,i=c.length,r=0;c[i]=m;var n,e;for(e=n=0;e<i;)c[e]!==c[e+2]?(c[n++]=c[e++],c[n++]=c[e++]):e+=2;i=n;for(e=n=0;e<i;){for(var p=c[e],w=c[e+1],t=e+2;t+2<=i&&c[t+1]===w;)t+=2;c[n++]=p;c[n++]=w;e=t}c.length=n;var f=a.c,h;if(f)h=f.style.display,f.style.display="none";try{for(;b<k;){var l=j[b+2]||m,B=c[r+2]||m,t=Math.min(l,B),A=j[b+1],G;if(A.nodeType!==1&&(G=x.substring(g,
t))){s&&(G=G.replace(d,"\r"));A.nodeValue=G;var L=A.ownerDocument,o=L.createElement("span");o.className=c[r+1];var v=A.parentNode;v.replaceChild(o,A);o.appendChild(A);g<l&&(j[b+1]=A=L.createTextNode(x.substring(t,l)),v.insertBefore(A,o.nextSibling))}g=t;g>=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],
O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[y,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
Q=[y,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,
V=/\S/,X=v({keywords:[M,O,E,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",
/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],
["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}),
["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q,
hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]);
p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="<pre>"+a+"</pre>";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1});
return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i<p.length&&c.now()<b;i++){for(var d=p[i],j=h,k=d;k=k.previousSibling;){var m=k.nodeType,o=(m===7||m===8)&&k.nodeValue;if(o?!/^\??prettify\b/.test(o):m!==3||/\S/.test(k.nodeValue))break;if(o){j={};o.replace(/\b(\w+)=([\w%+\-.:]+)/g,function(a,b,c){j[b]=c});break}}k=d.className;if((j!==h||e.test(k))&&!v.test(k)){m=!1;for(o=d.parentNode;o;o=o.parentNode)if(f.test(o.tagName)&&
o.className&&e.test(o.className)){m=!0;break}if(!m){d.className+=" prettyprinted";m=j.lang;if(!m){var m=k.match(n),y;if(!m&&(y=U(d))&&t.test(y.tagName))m=y.className.match(n);m&&(m=m[1])}if(w.test(d.tagName))o=1;else var o=d.currentStyle,u=s.defaultView,o=(o=o?o.whiteSpace:u&&u.getComputedStyle?u.getComputedStyle(d,q).getPropertyValue("white-space"):0)&&"pre"===o.substring(0,3);u=j.linenums;if(!(u=u==="true"||+u))u=(u=k.match(/\blinenums\b(?::(\d+))?/))?u[1]&&u[1].length?+u[1]:!0:!1;u&&J(d,u,o);r=
{h:m,c:d,j:u,i:o};K(r)}}}i<p.length?setTimeout(g,250):"function"===typeof a&&a()}for(var b=d||document.body,s=b.ownerDocument||document,b=[b.getElementsByTagName("pre"),b.getElementsByTagName("code"),b.getElementsByTagName("xmp")],p=[],m=0;m<b.length;++m)for(var j=0,k=b[m].length;j<k;++j)p.push(b[m][j]);var b=q,c=Date;c.now||(c={now:function(){return+new Date}});var i=0,r,n=/\blang(?:uage)?-([\w.]+)(?!\S)/,e=/\bprettyprint\b/,v=/\bprettyprinted\b/,w=/pre|xmp/i,t=/^code$/i,f=/^(?:pre|code|xmp)$/i,
h={};g()}};typeof define==="function"&&define.amd&&define("google-code-prettify",[],function(){return Y})})();}()

@ -0,0 +1,34 @@
!function(){var r=null;
(function(){function X(e){function j(){try{J.doScroll("left")}catch(e){P(j,50);return}w("poll")}function w(j){if(!(j.type=="readystatechange"&&x.readyState!="complete")&&((j.type=="load"?n:x)[z](i+j.type,w,!1),!m&&(m=!0)))e.call(n,j.type||j)}var Y=x.addEventListener,m=!1,C=!0,t=Y?"addEventListener":"attachEvent",z=Y?"removeEventListener":"detachEvent",i=Y?"":"on";if(x.readyState=="complete")e.call(n,"lazy");else{if(x.createEventObject&&J.doScroll){try{C=!n.frameElement}catch(A){}C&&j()}x[t](i+"DOMContentLoaded",
w,!1);x[t](i+"readystatechange",w,!1);n[t](i+"load",w,!1)}}function Q(){S&&X(function(){var e=K.length;$(e?function(){for(var j=0;j<e;++j)(function(e){P(function(){n.exports[K[e]].apply(n,arguments)},0)})(j)}:void 0)})}for(var n=window,P=n.setTimeout,x=document,J=x.documentElement,L=x.head||x.getElementsByTagName("head")[0]||J,z="",A=x.scripts,m=A.length;--m>=0;){var M=A[m],T=M.src.match(/^[^#?]*\/run_prettify\.js(\?[^#]*)?(?:#.*)?$/);if(T){z=T[1]||"";M.parentNode.removeChild(M);break}}var S=!0,D=
[],N=[],K=[];z.replace(/[&?]([^&=]+)=([^&]+)/g,function(e,j,w){w=decodeURIComponent(w);j=decodeURIComponent(j);j=="autorun"?S=!/^[0fn]/i.test(w):j=="lang"?D.push(w):j=="skin"?N.push(w):j=="callback"&&K.push(w)});m=0;for(z=D.length;m<z;++m)(function(){var e=x.createElement("script");e.onload=e.onerror=e.onreadystatechange=function(){if(e&&(!e.readyState||/loaded|complete/.test(e.readyState)))e.onerror=e.onload=e.onreadystatechange=r,--R,R||P(Q,0),e.parentNode&&e.parentNode.removeChild(e),e=r};e.type=
"text/javascript";e.src="https://google-code-prettify.googlecode.com/svn/loader/lang-"+encodeURIComponent(D[m])+".js";L.insertBefore(e,L.firstChild)})(D[m]);for(var R=D.length,A=[],m=0,z=N.length;m<z;++m)A.push("https://google-code-prettify.googlecode.com/svn/loader/skins/"+encodeURIComponent(N[m])+".css");A.push("https://google-code-prettify.googlecode.com/svn/loader/prettify.css");(function(e){function j(m){if(m!==w){var n=x.createElement("link");n.rel="stylesheet";n.type="text/css";if(m+1<w)n.error=
n.onerror=function(){j(m+1)};n.href=e[m];L.appendChild(n)}}var w=e.length;j(0)})(A);var $=function(){window.PR_SHOULD_USE_CONTINUATION=!0;var e;(function(){function j(a){function d(f){var b=f.charCodeAt(0);if(b!==92)return b;var a=f.charAt(1);return(b=i[a])?b:"0"<=a&&a<="7"?parseInt(f.substring(1),8):a==="u"||a==="x"?parseInt(f.substring(2),16):f.charCodeAt(1)}function h(f){if(f<32)return(f<16?"\\x0":"\\x")+f.toString(16);f=String.fromCharCode(f);return f==="\\"||f==="-"||f==="]"||f==="^"?"\\"+f:
f}function b(f){var b=f.substring(1,f.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),f=[],a=b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,g=b.length;a<g;++a){var k=b[a];if(/\\[bdsw]/i.test(k))c.push(k);else{var k=d(k),o;a+2<g&&"-"===b[a+1]?(o=d(b[a+2]),a+=2):o=k;f.push([k,o]);o<65||k>122||(o<65||k>90||f.push([Math.max(65,k)|32,Math.min(o,90)|32]),o<97||k>122||f.push([Math.max(97,k)&-33,Math.min(o,122)&-33]))}}f.sort(function(f,a){return f[0]-
a[0]||a[1]-f[1]});b=[];g=[];for(a=0;a<f.length;++a)k=f[a],k[0]<=g[1]+1?g[1]=Math.max(g[1],k[1]):b.push(g=k);for(a=0;a<b.length;++a)k=b[a],c.push(h(k[0])),k[1]>k[0]&&(k[1]+1>k[0]&&c.push("-"),c.push(h(k[1])));c.push("]");return c.join("")}function e(f){for(var a=f.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],g=0,k=0;g<c;++g){var o=a[g];o==="("?++k:"\\"===o.charAt(0)&&(o=+o.substring(1))&&(o<=k?d[o]=-1:a[g]=h(o))}for(g=
1;g<d.length;++g)-1===d[g]&&(d[g]=++j);for(k=g=0;g<c;++g)o=a[g],o==="("?(++k,d[k]||(a[g]="(?:")):"\\"===o.charAt(0)&&(o=+o.substring(1))&&o<=k&&(a[g]="\\"+d[o]);for(g=0;g<c;++g)"^"===a[g]&&"^"!==a[g+1]&&(a[g]="");if(f.ignoreCase&&F)for(g=0;g<c;++g)o=a[g],f=o.charAt(0),o.length>=2&&f==="["?a[g]=b(o):f!=="\\"&&(a[g]=o.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var j=0,F=!1,l=!1,I=0,c=a.length;I<c;++I){var p=a[I];if(p.ignoreCase)l=
!0;else if(/[a-z]/i.test(p.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){F=!0;l=!1;break}}for(var i={b:8,t:9,n:10,v:11,f:12,r:13},q=[],I=0,c=a.length;I<c;++I){p=a[I];if(p.global||p.multiline)throw Error(""+p);q.push("(?:"+e(p)+")")}return RegExp(q.join("|"),l?"gi":"g")}function m(a,d){function h(a){var c=a.nodeType;if(c==1){if(!b.test(a.className)){for(c=a.firstChild;c;c=c.nextSibling)h(c);c=a.nodeName.toLowerCase();if("br"===c||"li"===c)e[l]="\n",F[l<<1]=j++,F[l++<<1|1]=a}}else if(c==
3||c==4)c=a.nodeValue,c.length&&(c=d?c.replace(/\r\n?/g,"\n"):c.replace(/[\t\n\r ]+/g," "),e[l]=c,F[l<<1]=j,j+=c.length,F[l++<<1|1]=a)}var b=/(?:^|\s)nocode(?:\s|$)/,e=[],j=0,F=[],l=0;h(a);return{a:e.join("").replace(/\n$/,""),d:F}}function n(a,d,h,b){d&&(a={a:d,e:a},h(a),b.push.apply(b,a.g))}function x(a){for(var d=void 0,h=a.firstChild;h;h=h.nextSibling)var b=h.nodeType,d=b===1?d?a:h:b===3?S.test(h.nodeValue)?a:d:d;return d===a?void 0:d}function C(a,d){function h(a){for(var l=a.e,j=[l,"pln"],c=
0,p=a.a.match(e)||[],m={},q=0,f=p.length;q<f;++q){var B=p[q],y=m[B],u=void 0,g;if(typeof y==="string")g=!1;else{var k=b[B.charAt(0)];if(k)u=B.match(k[1]),y=k[0];else{for(g=0;g<i;++g)if(k=d[g],u=B.match(k[1])){y=k[0];break}u||(y="pln")}if((g=y.length>=5&&"lang-"===y.substring(0,5))&&!(u&&typeof u[1]==="string"))g=!1,y="src";g||(m[B]=y)}k=c;c+=B.length;if(g){g=u[1];var o=B.indexOf(g),H=o+g.length;u[2]&&(H=B.length-u[2].length,o=H-g.length);y=y.substring(5);n(l+k,B.substring(0,o),h,j);n(l+k+o,g,A(y,
g),j);n(l+k+H,B.substring(H),h,j)}else j.push(l+k,y)}a.g=j}var b={},e;(function(){for(var h=a.concat(d),l=[],i={},c=0,p=h.length;c<p;++c){var m=h[c],q=m[3];if(q)for(var f=q.length;--f>=0;)b[q.charAt(f)]=m;m=m[1];q=""+m;i.hasOwnProperty(q)||(l.push(m),i[q]=r)}l.push(/[\S\s]/);e=j(l)})();var i=d.length;return h}function t(a){var d=[],h=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,
r,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,r,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,r,"\"'"]);a.verbatimStrings&&h.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,r]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,r,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,
r,"#"]),h.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,r])):d.push(["com",/^#[^\n\r]*/,r,"#"]));a.cStyleComments&&(h.push(["com",/^\/\/[^\n\r]*/,r]),h.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,r]));if(b=a.regexLiterals){var e=(b=b>1?"":"\n\r")?".":"[\\S\\s]";h.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+
("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+e+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+e+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&h.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&h.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),r]);d.push(["pln",/^\s+/,r," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");h.push(["lit",/^@[$_a-z][\w$@]*/i,r],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,r],["pln",/^[$_a-z][\w$@]*/i,r],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,
r,"0123456789"],["pln",/^\\[\S\s]?/,r],["pun",RegExp(b),r]);return C(d,h)}function z(a,d,h){function b(a){var c=a.nodeType;if(c==1&&!j.test(a.className))if("br"===a.nodeName)e(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&h){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(l.createTextNode(d),a.nextSibling),e(a),c||a.parentNode.removeChild(a)}}
function e(a){function b(a,c){var d=c?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),h=a.nextSibling;f.appendChild(d);for(var e=h;e;e=h)h=e.nextSibling,f.appendChild(e)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var j=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,l=a.ownerDocument,i=l.createElement("li");a.firstChild;)i.appendChild(a.firstChild);for(var c=[i],p=0;p<c.length;++p)b(c[p]);d===(d|0)&&c[0].setAttribute("value",
d);var n=l.createElement("ol");n.className="linenums";for(var d=Math.max(0,d-1|0)||0,p=0,q=c.length;p<q;++p)i=c[p],i.className="L"+(p+d)%10,i.firstChild||i.appendChild(l.createTextNode("\u00a0")),n.appendChild(i);a.appendChild(n)}function i(a,d){for(var h=d.length;--h>=0;){var b=d[h];U.hasOwnProperty(b)?V.console&&console.warn("cannot override language handler %s",b):U[b]=a}}function A(a,d){if(!a||!U.hasOwnProperty(a))a=/^\s*</.test(d)?"default-markup":"default-code";return U[a]}function D(a){var d=
a.h;try{var h=m(a.c,a.i),b=h.a;a.a=b;a.d=h.d;a.e=0;A(d,b)(a);var e=/\bMSIE\s(\d+)/.exec(navigator.userAgent),e=e&&+e[1]<=8,d=/\n/g,i=a.a,j=i.length,h=0,l=a.d,n=l.length,b=0,c=a.g,p=c.length,t=0;c[p]=j;var q,f;for(f=q=0;f<p;)c[f]!==c[f+2]?(c[q++]=c[f++],c[q++]=c[f++]):f+=2;p=q;for(f=q=0;f<p;){for(var x=c[f],y=c[f+1],u=f+2;u+2<=p&&c[u+1]===y;)u+=2;c[q++]=x;c[q++]=y;f=u}c.length=q;var g=a.c,k;if(g)k=g.style.display,g.style.display="none";try{for(;b<n;){var o=l[b+2]||j,H=c[t+2]||j,u=Math.min(o,H),E=l[b+
1],W;if(E.nodeType!==1&&(W=i.substring(h,u))){e&&(W=W.replace(d,"\r"));E.nodeValue=W;var Z=E.ownerDocument,s=Z.createElement("span");s.className=c[t+1];var z=E.parentNode;z.replaceChild(s,E);s.appendChild(E);h<o&&(l[b+1]=E=Z.createTextNode(i.substring(u,o)),z.insertBefore(E,s.nextSibling))}h=u;h>=o&&(b+=2);h>=H&&(t+=2)}}finally{if(g)g.style.display=k}}catch(v){V.console&&console.log(v&&v.stack||v)}}var V=window,G=["break,continue,do,else,for,if,return,while"],O=[[G,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],J=[O,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],K=[O,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],
L=[K,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],O=[O,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],M=[G,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
N=[G,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],R=[G,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],G=[G,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],Q=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,
S=/\S/,T=t({keywords:[J,L,O,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",M,N,G],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),U={};i(T,["default-code"]);i(C([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",
/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);i(C([["pln",/^\s+/,r," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,r,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],
["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);i(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);i(t({keywords:J,hashComments:!0,cStyleComments:!0,types:Q}),["c","cc","cpp","cxx","cyc","m"]);i(t({keywords:"null,true,false"}),["json"]);i(t({keywords:L,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:Q}),
["cs"]);i(t({keywords:K,cStyleComments:!0}),["java"]);i(t({keywords:G,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);i(t({keywords:M,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);i(t({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);i(t({keywords:N,
hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);i(t({keywords:O,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);i(t({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);i(t({keywords:R,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]);
i(C([],[["str",/^[\S\s]+/]]),["regex"]);var X=V.PR={createSimpleLexer:C,registerLangHandler:i,sourceDecorator:t,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:function(a,d,e){var b=document.createElement("div");b.innerHTML="<pre>"+a+"</pre>";b=b.firstChild;e&&z(b,e,!0);D({h:d,j:e,c:b,i:1});return b.innerHTML},
prettyPrint:e=e=function(a,d){function e(){for(var b=V.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;p<j.length&&c.now()<b;p++){for(var d=j[p],m=k,l=d;l=l.previousSibling;){var n=l.nodeType,s=(n===7||n===8)&&l.nodeValue;if(s?!/^\??prettify\b/.test(s):n!==3||/\S/.test(l.nodeValue))break;if(s){m={};s.replace(/\b(\w+)=([\w%+\-.:]+)/g,function(a,b,c){m[b]=c});break}}l=d.className;if((m!==k||f.test(l))&&!w.test(l)){n=!1;for(s=d.parentNode;s;s=s.parentNode)if(g.test(s.tagName)&&s.className&&f.test(s.className)){n=
!0;break}if(!n){d.className+=" prettyprinted";n=m.lang;if(!n){var n=l.match(q),A;if(!n&&(A=x(d))&&u.test(A.tagName))n=A.className.match(q);n&&(n=n[1])}if(y.test(d.tagName))s=1;else var s=d.currentStyle,v=i.defaultView,s=(s=s?s.whiteSpace:v&&v.getComputedStyle?v.getComputedStyle(d,r).getPropertyValue("white-space"):0)&&"pre"===s.substring(0,3);v=m.linenums;if(!(v=v==="true"||+v))v=(v=l.match(/\blinenums\b(?::(\d+))?/))?v[1]&&v[1].length?+v[1]:!0:!1;v&&z(d,v,s);t={h:n,c:d,j:v,i:s};D(t)}}}p<j.length?
P(e,250):"function"===typeof a&&a()}for(var b=d||document.body,i=b.ownerDocument||document,b=[b.getElementsByTagName("pre"),b.getElementsByTagName("code"),b.getElementsByTagName("xmp")],j=[],m=0;m<b.length;++m)for(var l=0,n=b[m].length;l<n;++l)j.push(b[m][l]);var b=r,c=Date;c.now||(c={now:function(){return+new Date}});var p=0,t,q=/\blang(?:uage)?-([\w.]+)(?!\S)/,f=/\bprettyprint\b/,w=/\bprettyprinted\b/,y=/pre|xmp/i,u=/^code$/i,g=/^(?:pre|code|xmp)$/i,k={};e()}};typeof define==="function"&&define.amd&&
define("google-code-prettify",[],function(){return X})})();return e}();R||P(Q,0)})();}()

@ -0,0 +1,36 @@
/*
RequireJS 2.1.15 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
Available via the MIT or new BSD license.
see: http://github.com/jrburke/requirejs for details
*/
var requirejs,require,define;
(function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function T(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function t(b,c){return fa.call(b,c)}function m(b,c){return t(b,c)&&b[c]}function B(b,c){for(var d in b)if(t(b,d)&&c(b[d],d))break}function U(b,c,d,e){c&&B(c,function(c,g){if(d||!t(b,g))e&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
RegExp)?(b[g]||(b[g]={}),U(b[g],c,d,e)):b[g]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function ca(b){throw b;}function da(b){if(!b)return b;var c=ba;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,e){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=e;d&&(c.originalError=d);return c}function ga(b){function c(a,k,b){var f,l,c,d,e,g,i,p,k=k&&k.split("/"),h=j.map,n=h&&h["*"];if(a){a=a.split("/");l=a.length-1;j.nodeIdCompat&&
Q.test(a[l])&&(a[l]=a[l].replace(Q,""));"."===a[0].charAt(0)&&k&&(l=k.slice(0,k.length-1),a=l.concat(a));l=a;for(c=0;c<l.length;c++)if(d=l[c],"."===d)l.splice(c,1),c-=1;else if(".."===d&&!(0===c||1==c&&".."===l[2]||".."===l[c-1])&&0<c)l.splice(c-1,2),c-=2;a=a.join("/")}if(b&&h&&(k||n)){l=a.split("/");c=l.length;a:for(;0<c;c-=1){e=l.slice(0,c).join("/");if(k)for(d=k.length;0<d;d-=1)if(b=m(h,k.slice(0,d).join("/")))if(b=m(b,e)){f=b;g=c;break a}!i&&(n&&m(n,e))&&(i=m(n,e),p=c)}!f&&i&&(f=i,g=p);f&&(l.splice(0,
g,f),a=l.join("/"))}return(f=m(j.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(k){if(k.getAttribute("data-requiremodule")===a&&k.getAttribute("data-requirecontext")===i.contextName)return k.parentNode.removeChild(k),!0})}function e(a){var k=m(j.paths,a);if(k&&H(k)&&1<k.length)return k.shift(),i.require.undef(a),i.makeRequire(null,{skipMap:!0})([a]),!0}function n(a){var k,c=a?a.indexOf("!"):-1;-1<c&&(k=a.substring(0,c),a=a.substring(c+1,a.length));return[k,a]}function p(a,
k,b,f){var l,d,e=null,g=k?k.name:null,j=a,p=!0,h="";a||(p=!1,a="_@r"+(K+=1));a=n(a);e=a[0];a=a[1];e&&(e=c(e,g,f),d=m(r,e));a&&(e?h=d&&d.normalize?d.normalize(a,function(a){return c(a,g,f)}):-1===a.indexOf("!")?c(a,g,f):a:(h=c(a,g,f),a=n(h),e=a[0],h=a[1],b=!0,l=i.nameToUrl(h)));b=e&&!d&&!b?"_unnormalized"+(O+=1):"";return{prefix:e,name:h,parentMap:k,unnormalized:!!b,url:l,originalName:j,isDefine:p,id:(e?e+"!"+h:h)+b}}function s(a){var k=a.id,b=m(h,k);b||(b=h[k]=new i.Module(a));return b}function q(a,
k,b){var f=a.id,c=m(h,f);if(t(r,f)&&(!c||c.defineEmitComplete))"defined"===k&&b(r[f]);else if(c=s(a),c.error&&"error"===k)b(c.error);else c.on(k,b)}function w(a,b){var c=a.requireModules,f=!1;if(b)b(a);else if(v(c,function(b){if(b=m(h,b))b.error=a,b.events.error&&(f=!0,b.emit("error",a))}),!f)g.onError(a)}function x(){R.length&&(ha.apply(A,[A.length,0].concat(R)),R=[])}function y(a){delete h[a];delete V[a]}function F(a,b,c){var f=a.map.id;a.error?a.emit("error",a.error):(b[f]=!0,v(a.depMaps,function(f,
d){var e=f.id,g=m(h,e);g&&(!a.depMatched[d]&&!c[e])&&(m(b,e)?(a.defineDep(d,r[e]),a.check()):F(g,b,c))}),c[f]=!0)}function D(){var a,b,c=(a=1E3*j.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],l=[],g=!1,h=!0;if(!W){W=!0;B(V,function(a){var i=a.map,j=i.id;if(a.enabled&&(i.isDefine||l.push(a),!a.error))if(!a.inited&&c)e(j)?g=b=!0:(f.push(j),d(j));else if(!a.inited&&(a.fetched&&i.isDefine)&&(g=!0,!i.prefix))return h=!1});if(c&&f.length)return a=C("timeout","Load timeout for modules: "+f,null,
f),a.contextName=i.contextName,w(a);h&&v(l,function(a){F(a,{},{})});if((!c||b)&&g)if((z||ea)&&!X)X=setTimeout(function(){X=0;D()},50);W=!1}}function E(a){t(r,a[0])||s(p(a[0],null,!0)).init(a[1],a[2])}function I(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!Y?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;(!a.detachEvent||Y)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function J(){var a;
for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var W,Z,i,L,X,j={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},h={},V={},$={},A=[],r={},S={},aa={},K=1,O=1;L={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?r[a.map.id]=a.exports:a.exports=r[a.map.id]={}},module:function(a){return a.module?
a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m(j.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};Z=function(a){this.events=m($,a.id)||{};this.map=a;this.shim=m(j.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Z.prototype={init:function(a,b,c,f){f=f||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=
c;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
this.map.url;S[a]||(S[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var f=this.exports,l=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{f=i.execCb(c,l,b,f)}catch(d){a=d}else f=i.execCb(c,l,b,f);this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports:this.usingExports&&
(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,g.onResourceLoad))g.onResourceLoad(i,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
this.map,b=a.id,d=p(a.prefix);this.depMaps.push(d);q(d,"defined",u(this,function(f){var l,d;d=m(aa,this.map.id);var e=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,n=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(e=f.normalize(e,function(a){return c(a,P,!0)})||""),f=p(a.prefix+"!"+e,this.map.parentMap),q(f,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=m(h,f.id)){this.depMaps.push(f);
if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=i.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(h,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,e=p(d),P=M;c&&(f=c);P&&(M=!1);s(e);t(j.config,b)&&(j.config[d]=j.config[b]);try{g.exec(f)}catch(h){return w(C("fromtexteval",
"fromText eval for "+b+" failed: "+h,h,[b]))}P&&(M=!0);this.depMaps.push(e);i.completeLoad(d);n([d],l)}),f.load(a.name,n,l,j))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=p(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",u(this,function(a){this.defineDep(b,
a);this.check()}));this.errback&&q(a,"error",u(this,this.errback))}c=a.id;f=h[c];!t(L,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,u(this,function(a){var b=m(h,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:j,contextName:b,registry:h,defined:r,urlFetched:S,defQueue:A,Module:Z,makeModuleMap:p,
nextTick:g.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(j[b]||(j[b]={}),U(j[b],a,!0,!0)):j[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(aa[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);b[c]=a}),j.shim=b);a.packages&&v(a.packages,function(a){var b,
a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(j.paths[b]=a.location);j.pkgs[b]=a.name+"/"+(a.main||"main").replace(ia,"").replace(Q,"")});B(h,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=p(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,e){function j(c,d,m){var n,q;e.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=
!0);if("string"===typeof c){if(G(d))return w(C("requireargs","Invalid require call"),m);if(a&&t(L,c))return L[c](h[a.id]);if(g.get)return g.get(i,c,a,j);n=p(c,a,!1,!0);n=n.id;return!t(r,n)?w(C("notloaded",'Module name "'+n+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[n]}J();i.nextTick(function(){J();q=s(p(null,a));q.skipMap=e.skipMap;q.init(c,d,m,{enabled:!0});D()});return j}e=e||{};U(j,{isBrowser:z,toUrl:function(b){var d,e=b.lastIndexOf("."),k=b.split("/")[0];if(-1!==
e&&(!("."===k||".."===k)||1<e))d=b.substring(e,b.length),b=b.substring(0,e);return i.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return t(r,p(b,a,!1,!0).id)},specified:function(b){b=p(b,a,!1,!0).id;return t(r,b)||t(h,b)}});a||(j.undef=function(b){x();var c=p(b,a,!0),e=m(h,b);d(b);delete r[b];delete S[c.url];delete $[b];T(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&($[b]=e.events),y(b))});return j},enable:function(a){m(h,a.id)&&s(a).enable()},completeLoad:function(a){var b,
c,d=m(j.shim,a)||{},g=d.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=m(h,a);if(!b&&!t(r,a)&&c&&!c.inited){if(j.enforceDefine&&(!g||!da(g)))return e(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,d.deps||[],d.exportsFn])}D()},nameToUrl:function(a,b,c){var d,e,h;(d=m(j.pkgs,a))&&(a=d);if(d=m(aa,a))return i.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=j.paths;a=a.split("/");for(e=a.length;0<e;e-=1)if(h=a.slice(0,
e).join("/"),h=m(d,h)){H(h)&&(h=h[0]);a.splice(0,e,h);break}d=a.join("/");d+=b||(/^data\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+d}return j.urlArgs?d+((-1===d.indexOf("?")?"?":"&")+j.urlArgs):d},load:function(a,b){g.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ja.test((a.currentTarget||a.srcElement).readyState))N=null,a=I(a),i.completeLoad(a.id)},onScriptError:function(a){var b=I(a);if(!e(b.id))return w(C("scripterror",
"Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var g,x,y,D,I,E,N,J,s,O,ka=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,la=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Q=/\.js$/,ia=/^\.\//;x=Object.prototype;var K=x.toString,fa=x.hasOwnProperty,ha=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),ea=!z&&"undefined"!==typeof importScripts,ja=z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,
Y="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},q={},R=[],M=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;q=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(q=require,require=void 0);g=requirejs=function(b,c,d,e){var n,p="_";!H(b)&&"string"!==typeof b&&(n=b,H(c)?(b=c,c=d,d=e):b=[]);n&&n.context&&(p=n.context);(e=m(F,p))||(e=F[p]=g.s.newContext(p));n&&e.configure(n);return e.require(b,c,d)};g.config=function(b){return g(b)};
g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.1.15";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=z;x=g.s={contexts:F,newContext:ga};g({});v(["toUrl","undef","defined","specified"],function(b){g[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y=x.head=D.parentNode;g.onError=ca;g.createNode=function(b){var c=
b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var e=b&&b.config||{};if(z)return e=g.createNode(e,c,d),e.setAttribute("data-requirecontext",b.contextName),e.setAttribute("data-requiremodule",c),e.attachEvent&&!(e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code"))&&!Y?(M=!0,e.attachEvent("onreadystatechange",b.onScriptLoad)):
(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)),e.src=d,J=e,D?y.insertBefore(e,D):y.appendChild(e),J=null,e;if(ea)try{importScripts(d),b.completeLoad(c)}catch(m){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,m,[c]))}};z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return s=I,q.baseUrl||(E=s.split("/"),s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=
O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ka,"").replace(la,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return N=b}),e=N;e&&(b||
(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}(g?g.defQueue:R).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(q)}})(this);

File diff suppressed because one or more lines are too long

@ -0,0 +1,17 @@
/* Web Font Loader v1.6.24 - (c) Adobe Systems, Google. License: Apache 2.0 */
(function(){function aa(a,b,d){return a.call.apply(a.bind,arguments)}function ba(a,b,d){if(!a)throw Error();if(2<arguments.length){var c=Array.prototype.slice.call(arguments,2);return function(){var d=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(d,c);return a.apply(b,d)}}return function(){return a.apply(b,arguments)}}function p(a,b,d){p=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?aa:ba;return p.apply(null,arguments)}var q=Date.now||function(){return+new Date};function ca(a,b){this.a=a;this.m=b||a;this.c=this.m.document}var da=!!window.FontFace;function t(a,b,d,c){b=a.c.createElement(b);if(d)for(var e in d)d.hasOwnProperty(e)&&("style"==e?b.style.cssText=d[e]:b.setAttribute(e,d[e]));c&&b.appendChild(a.c.createTextNode(c));return b}function u(a,b,d){a=a.c.getElementsByTagName(b)[0];a||(a=document.documentElement);a.insertBefore(d,a.lastChild)}function v(a){a.parentNode&&a.parentNode.removeChild(a)}
function w(a,b,d){b=b||[];d=d||[];for(var c=a.className.split(/\s+/),e=0;e<b.length;e+=1){for(var f=!1,g=0;g<c.length;g+=1)if(b[e]===c[g]){f=!0;break}f||c.push(b[e])}b=[];for(e=0;e<c.length;e+=1){f=!1;for(g=0;g<d.length;g+=1)if(c[e]===d[g]){f=!0;break}f||b.push(c[e])}a.className=b.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function y(a,b){for(var d=a.className.split(/\s+/),c=0,e=d.length;c<e;c++)if(d[c]==b)return!0;return!1}
function z(a){if("string"===typeof a.f)return a.f;var b=a.m.location.protocol;"about:"==b&&(b=a.a.location.protocol);return"https:"==b?"https:":"http:"}function ea(a){return a.m.location.hostname||a.a.location.hostname}
function A(a,b,d){function c(){k&&e&&f&&(k(g),k=null)}b=t(a,"link",{rel:"stylesheet",href:b,media:"all"});var e=!1,f=!0,g=null,k=d||null;da?(b.onload=function(){e=!0;c()},b.onerror=function(){e=!0;g=Error("Stylesheet failed to load");c()}):setTimeout(function(){e=!0;c()},0);u(a,"head",b)}
function B(a,b,d,c){var e=a.c.getElementsByTagName("head")[0];if(e){var f=t(a,"script",{src:b}),g=!1;f.onload=f.onreadystatechange=function(){g||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(g=!0,d&&d(null),f.onload=f.onreadystatechange=null,"HEAD"==f.parentNode.tagName&&e.removeChild(f))};e.appendChild(f);setTimeout(function(){g||(g=!0,d&&d(Error("Script load timeout")))},c||5E3);return f}return null};function C(){this.a=0;this.c=null}function D(a){a.a++;return function(){a.a--;E(a)}}function F(a,b){a.c=b;E(a)}function E(a){0==a.a&&a.c&&(a.c(),a.c=null)};function G(a){this.a=a||"-"}G.prototype.c=function(a){for(var b=[],d=0;d<arguments.length;d++)b.push(arguments[d].replace(/[\W_]+/g,"").toLowerCase());return b.join(this.a)};function H(a,b){this.c=a;this.f=4;this.a="n";var d=(b||"n4").match(/^([nio])([1-9])$/i);d&&(this.a=d[1],this.f=parseInt(d[2],10))}function fa(a){return I(a)+" "+(a.f+"00")+" 300px "+J(a.c)}function J(a){var b=[];a=a.split(/,\s*/);for(var d=0;d<a.length;d++){var c=a[d].replace(/['"]/g,"");-1!=c.indexOf(" ")||/^\d/.test(c)?b.push("'"+c+"'"):b.push(c)}return b.join(",")}function K(a){return a.a+a.f}function I(a){var b="normal";"o"===a.a?b="oblique":"i"===a.a&&(b="italic");return b}
function ga(a){var b=4,d="n",c=null;a&&((c=a.match(/(normal|oblique|italic)/i))&&c[1]&&(d=c[1].substr(0,1).toLowerCase()),(c=a.match(/([1-9]00|normal|bold)/i))&&c[1]&&(/bold/i.test(c[1])?b=7:/[1-9]00/.test(c[1])&&(b=parseInt(c[1].substr(0,1),10))));return d+b};function ha(a,b){this.c=a;this.f=a.m.document.documentElement;this.h=b;this.a=new G("-");this.j=!1!==b.events;this.g=!1!==b.classes}function ia(a){a.g&&w(a.f,[a.a.c("wf","loading")]);L(a,"loading")}function M(a){if(a.g){var b=y(a.f,a.a.c("wf","active")),d=[],c=[a.a.c("wf","loading")];b||d.push(a.a.c("wf","inactive"));w(a.f,d,c)}L(a,"inactive")}function L(a,b,d){if(a.j&&a.h[b])if(d)a.h[b](d.c,K(d));else a.h[b]()};function ja(){this.c={}}function ka(a,b,d){var c=[],e;for(e in b)if(b.hasOwnProperty(e)){var f=a.c[e];f&&c.push(f(b[e],d))}return c};function N(a,b){this.c=a;this.f=b;this.a=t(this.c,"span",{"aria-hidden":"true"},this.f)}function O(a){u(a.c,"body",a.a)}function P(a){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+J(a.c)+";"+("font-style:"+I(a)+";font-weight:"+(a.f+"00")+";")};function Q(a,b,d,c,e,f){this.g=a;this.j=b;this.a=c;this.c=d;this.f=e||3E3;this.h=f||void 0}Q.prototype.start=function(){var a=this.c.m.document,b=this,d=q(),c=new Promise(function(c,e){function k(){q()-d>=b.f?e():a.fonts.load(fa(b.a),b.h).then(function(a){1<=a.length?c():setTimeout(k,25)},function(){e()})}k()}),e=new Promise(function(a,c){setTimeout(c,b.f)});Promise.race([e,c]).then(function(){b.g(b.a)},function(){b.j(b.a)})};function R(a,b,d,c,e,f,g){this.v=a;this.B=b;this.c=d;this.a=c;this.s=g||"BESbswy";this.f={};this.w=e||3E3;this.u=f||null;this.o=this.j=this.h=this.g=null;this.g=new N(this.c,this.s);this.h=new N(this.c,this.s);this.j=new N(this.c,this.s);this.o=new N(this.c,this.s);a=new H(this.a.c+",serif",K(this.a));a=P(a);this.g.a.style.cssText=a;a=new H(this.a.c+",sans-serif",K(this.a));a=P(a);this.h.a.style.cssText=a;a=new H("serif",K(this.a));a=P(a);this.j.a.style.cssText=a;a=new H("sans-serif",K(this.a));a=
P(a);this.o.a.style.cssText=a;O(this.g);O(this.h);O(this.j);O(this.o)}var S={D:"serif",C:"sans-serif"},T=null;function U(){if(null===T){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);T=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return T}R.prototype.start=function(){this.f.serif=this.j.a.offsetWidth;this.f["sans-serif"]=this.o.a.offsetWidth;this.A=q();la(this)};
function ma(a,b,d){for(var c in S)if(S.hasOwnProperty(c)&&b===a.f[S[c]]&&d===a.f[S[c]])return!0;return!1}function la(a){var b=a.g.a.offsetWidth,d=a.h.a.offsetWidth,c;(c=b===a.f.serif&&d===a.f["sans-serif"])||(c=U()&&ma(a,b,d));c?q()-a.A>=a.w?U()&&ma(a,b,d)&&(null===a.u||a.u.hasOwnProperty(a.a.c))?V(a,a.v):V(a,a.B):na(a):V(a,a.v)}function na(a){setTimeout(p(function(){la(this)},a),50)}function V(a,b){setTimeout(p(function(){v(this.g.a);v(this.h.a);v(this.j.a);v(this.o.a);b(this.a)},a),0)};function W(a,b,d){this.c=a;this.a=b;this.f=0;this.o=this.j=!1;this.s=d}var X=null;W.prototype.g=function(a){var b=this.a;b.g&&w(b.f,[b.a.c("wf",a.c,K(a).toString(),"active")],[b.a.c("wf",a.c,K(a).toString(),"loading"),b.a.c("wf",a.c,K(a).toString(),"inactive")]);L(b,"fontactive",a);this.o=!0;oa(this)};
W.prototype.h=function(a){var b=this.a;if(b.g){var d=y(b.f,b.a.c("wf",a.c,K(a).toString(),"active")),c=[],e=[b.a.c("wf",a.c,K(a).toString(),"loading")];d||c.push(b.a.c("wf",a.c,K(a).toString(),"inactive"));w(b.f,c,e)}L(b,"fontinactive",a);oa(this)};function oa(a){0==--a.f&&a.j&&(a.o?(a=a.a,a.g&&w(a.f,[a.a.c("wf","active")],[a.a.c("wf","loading"),a.a.c("wf","inactive")]),L(a,"active")):M(a.a))};function pa(a){this.j=a;this.a=new ja;this.h=0;this.f=this.g=!0}pa.prototype.load=function(a){this.c=new ca(this.j,a.context||this.j);this.g=!1!==a.events;this.f=!1!==a.classes;qa(this,new ha(this.c,a),a)};
function ra(a,b,d,c,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e||null,k=c||null||{};if(0===d.length&&f)M(b.a);else{b.f+=d.length;f&&(b.j=f);var h,m=[];for(h=0;h<d.length;h++){var l=d[h],n=k[l.c],r=b.a,x=l;r.g&&w(r.f,[r.a.c("wf",x.c,K(x).toString(),"loading")]);L(r,"fontloading",x);r=null;null===X&&(X=window.FontFace?(x=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent))?42<parseInt(x[1],10):!0:!1);X?r=new Q(p(b.g,b),p(b.h,b),b.c,l,b.s,n):r=new R(p(b.g,b),p(b.h,b),b.c,l,b.s,a,
n);m.push(r)}for(h=0;h<m.length;h++)m[h].start()}},0)}function qa(a,b,d){var c=[],e=d.timeout;ia(b);var c=ka(a.a,d,a.c),f=new W(a.c,b,e);a.h=c.length;b=0;for(d=c.length;b<d;b++)c[b].load(function(b,c,d){ra(a,f,b,c,d)})};function sa(a,b){this.c=a;this.a=b}function ta(a,b,d){var c=z(a.c);a=(a.a.api||"fast.fonts.net/jsapi").replace(/^.*http(s?):(\/\/)?/,"");return c+"//"+a+"/"+b+".js"+(d?"?v="+d:"")}
sa.prototype.load=function(a){function b(){if(e["__mti_fntLst"+d]){var c=e["__mti_fntLst"+d](),g=[],k;if(c)for(var h=0;h<c.length;h++){var m=c[h].fontfamily;void 0!=c[h].fontStyle&&void 0!=c[h].fontWeight?(k=c[h].fontStyle+c[h].fontWeight,g.push(new H(m,k))):g.push(new H(m))}a(g)}else setTimeout(function(){b()},50)}var d=this.a.projectId,c=this.a.version;if(d){var e=this.c.m;B(this.c,ta(this,d,c),function(c){c?a([]):b()}).id="__MonotypeAPIScript__"+d}else a([])};function ua(a,b){this.c=a;this.a=b}ua.prototype.load=function(a){var b,d,c=this.a.urls||[],e=this.a.families||[],f=this.a.testStrings||{},g=new C;b=0;for(d=c.length;b<d;b++)A(this.c,c[b],D(g));var k=[];b=0;for(d=e.length;b<d;b++)if(c=e[b].split(":"),c[1])for(var h=c[1].split(","),m=0;m<h.length;m+=1)k.push(new H(c[0],h[m]));else k.push(new H(c[0]));F(g,function(){a(k,f)})};function va(a,b,d){a?this.c=a:this.c=b+wa;this.a=[];this.f=[];this.g=d||""}var wa="//fonts.googleapis.com/css";function xa(a,b){for(var d=b.length,c=0;c<d;c++){var e=b[c].split(":");3==e.length&&a.f.push(e.pop());var f="";2==e.length&&""!=e[1]&&(f=":");a.a.push(e.join(f))}}
function ya(a){if(0==a.a.length)throw Error("No fonts to load!");if(-1!=a.c.indexOf("kit="))return a.c;for(var b=a.a.length,d=[],c=0;c<b;c++)d.push(a.a[c].replace(/ /g,"+"));b=a.c+"?family="+d.join("%7C");0<a.f.length&&(b+="&subset="+a.f.join(","));0<a.g.length&&(b+="&text="+encodeURIComponent(a.g));return b};function za(a){this.f=a;this.a=[];this.c={}}
var Aa={latin:"BESbswy",cyrillic:"\u0439\u044f\u0416",greek:"\u03b1\u03b2\u03a3",khmer:"\u1780\u1781\u1782",Hanuman:"\u1780\u1781\u1782"},Ba={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},Ca={i:"i",italic:"i",n:"n",normal:"n"},Da=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/;
function Ea(a){for(var b=a.f.length,d=0;d<b;d++){var c=a.f[d].split(":"),e=c[0].replace(/\+/g," "),f=["n4"];if(2<=c.length){var g;var k=c[1];g=[];if(k)for(var k=k.split(","),h=k.length,m=0;m<h;m++){var l;l=k[m];if(l.match(/^[\w-]+$/)){var n=Da.exec(l.toLowerCase());if(null==n)l="";else{l=n[2];l=null==l||""==l?"n":Ca[l];n=n[1];if(null==n||""==n)n="4";else var r=Ba[n],n=r?r:isNaN(n)?"4":n.substr(0,1);l=[l,n].join("")}}else l="";l&&g.push(l)}0<g.length&&(f=g);3==c.length&&(c=c[2],g=[],c=c?c.split(","):
g,0<c.length&&(c=Aa[c[0]])&&(a.c[e]=c))}a.c[e]||(c=Aa[e])&&(a.c[e]=c);for(c=0;c<f.length;c+=1)a.a.push(new H(e,f[c]))}};function Fa(a,b){this.c=a;this.a=b}var Ga={Arimo:!0,Cousine:!0,Tinos:!0};Fa.prototype.load=function(a){var b=new C,d=this.c,c=new va(this.a.api,z(d),this.a.text),e=this.a.families;xa(c,e);var f=new za(e);Ea(f);A(d,ya(c),D(b));F(b,function(){a(f.a,f.c,Ga)})};function Ha(a,b){this.c=a;this.a=b}Ha.prototype.load=function(a){var b=this.a.id,d=this.c.m;b?B(this.c,(this.a.api||"https://use.typekit.net")+"/"+b+".js",function(b){if(b)a([]);else if(d.Typekit&&d.Typekit.config&&d.Typekit.config.fn){b=d.Typekit.config.fn;for(var e=[],f=0;f<b.length;f+=2)for(var g=b[f],k=b[f+1],h=0;h<k.length;h++)e.push(new H(g,k[h]));try{d.Typekit.load({events:!1,classes:!1,async:!0})}catch(m){}a(e)}},2E3):a([])};function Ia(a,b){this.c=a;this.f=b;this.a=[]}Ia.prototype.load=function(a){var b=this.f.id,d=this.c.m,c=this;b?(d.__webfontfontdeckmodule__||(d.__webfontfontdeckmodule__={}),d.__webfontfontdeckmodule__[b]=function(b,d){for(var g=0,k=d.fonts.length;g<k;++g){var h=d.fonts[g];c.a.push(new H(h.name,ga("font-weight:"+h.weight+";font-style:"+h.style)))}a(c.a)},B(this.c,z(this.c)+(this.f.api||"//f.fontdeck.com/s/css/js/")+ea(this.c)+"/"+b+".js",function(b){b&&a([])})):a([])};var Y=new pa(window);Y.a.c.custom=function(a,b){return new ua(b,a)};Y.a.c.fontdeck=function(a,b){return new Ia(b,a)};Y.a.c.monotype=function(a,b){return new sa(b,a)};Y.a.c.typekit=function(a,b){return new Ha(b,a)};Y.a.c.google=function(a,b){return new Fa(b,a)};var Z={load:p(Y.load,Y)};"function"===typeof define&&define.amd?define(function(){return Z}):"undefined"!==typeof module&&module.exports?module.exports=Z:(window.WebFont=Z,window.WebFontConfig&&Y.load(window.WebFontConfig));}());

@ -0,0 +1,71 @@
package au.com.royalpay.payment.manage;
import com.google.code.kaptcha.Producer;
import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;
import com.maxmind.geoip.LookupService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.core.io.Resource;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@SpringBootApplication(scanBasePackages = {"au.com.royalpay.payment", "cn.yixblog"})
@EnableScheduling
@EnableCaching
public class PaymentManageApplication {
public static void main(String[] args) {
SpringApplication.run(PaymentManageApplication.class, args);
}
@Bean
public ScheduledExecutorService scheduledExecutorService(@Value("${app.tasks.pool-size:50}") int poolSize) {
return Executors.newScheduledThreadPool(poolSize);
}
@Bean
public LookupService lookupService(@Value("${app.geo.dat-file:''}") String datFile, @Value("classpath:data/geo/GeoLiteCity.dat") Resource geoCityFile) throws IOException {
try {
if (StringUtils.isNotEmpty(datFile) && new File(datFile).exists()) {
return new LookupService(datFile);
}
}catch (IOException e){
e.printStackTrace();
}
return new LookupService(geoCityFile.getFile());
}
@Bean
public Producer producer() {
Properties properties = new Properties();
properties.setProperty("kaptcha.border", "yes");
properties.setProperty("kaptcha.border.color", "240,96,16");
// properties.setProperty("kaptcha.textproducer.font.color","green");
properties.setProperty("kaptcha.image.width", "80");
properties.setProperty("kaptcha.image.height", "35");
properties.setProperty("kaptcha.textproducer.font.size", "24");
properties.setProperty("kaptcha.textproducer.font.names", "Arial");
properties.setProperty("kaptcha.session.key", "code");
properties.setProperty("kaptcha.textproducer.char.length", "4");
properties.setProperty("kaptcha.noise.impl", "com.google.code.kaptcha.impl.NoNoise");
properties.setProperty("kaptcha.obscurificator.impl", "com.google.code.kaptcha.impl.ShadowGimpy");
Config config = new Config(properties);
DefaultKaptcha producer = new DefaultKaptcha();
producer.setConfig(config);
return producer;
}
}

@ -0,0 +1,40 @@
package au.com.royalpay.payment.manage;
import au.com.royalpay.payment.manage.permission.manager.ManagerUserInterceptor;
import au.com.royalpay.payment.tools.permission.RequestInfoInterceptor;
import au.com.royalpay.payment.tools.permission.alipay.AlipayUserInterceptor;
import au.com.royalpay.payment.tools.permission.wechat.WechatUserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import javax.annotation.Resource;
/**
* Created by yixian on 2016-06-24.
*/
@Configuration
public class WebConfiguration extends WebMvcConfigurerAdapter {
@Resource
private RequestInfoInterceptor requestInfoInterceptor;
@Resource
private ManagerUserInterceptor managerUserInterceptor;
@Resource
private WechatUserInterceptor wechatUserInterceptor;
@Resource
private AlipayUserInterceptor alipayUserInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(requestInfoInterceptor);
registry.addInterceptor(managerUserInterceptor);
registry.addInterceptor(wechatUserInterceptor);
registry.addInterceptor(alipayUserInterceptor);
super.addInterceptors(registry);
}
}

@ -0,0 +1,27 @@
package au.com.royalpay.payment.manage;
import au.com.royalpay.payment.tools.websocket.FastJsonSockJsMessageCodec;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
/**
* Created by yixian on 2016-07-01.
*/
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.enableSimpleBroker("/app");
registry.setApplicationDestinationPrefixes("/application");
}
@Override
public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
stompEndpointRegistry.addEndpoint("/register").setAllowedOrigins("*").withSockJS().setMessageCodec(new FastJsonSockJsMessageCodec());
}
}

@ -0,0 +1,112 @@
package au.com.royalpay.payment.manage.activities.diet.beans;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
/**
* Created by yixian on 2017-03-26.
*/
public class MerchantInfo {
private String address;
@JSONField(name = "work_time")
private String worktime;
private String desc;
@JSONField(name = "shop_img")
private String shopImg;
@JSONField(name = "img_id")
private String imgId;
private String city;
@JSONField(name = "pay_url")
private String payUrl;
@JSONField(name = "display_name")
private String displayName;
private String tel;
public JSONObject toJSON() {
return (JSONObject) JSONObject.toJSON(this);
}
public JSONObject mergeJson(JSONObject attend) {
attend.put("address", getAddress());
attend.put("work_time", getWorktime());
attend.put("desc", getDesc());
attend.put("shop_img", getShopImg());
attend.put("city", getCity());
attend.put("pay_url", getPayUrl());
attend.put("display_name", getDisplayName());
attend.put("tel", getTel());
return attend;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getWorktime() {
return worktime;
}
public void setWorktime(String worktime) {
this.worktime = worktime;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getShopImg() {
return shopImg;
}
public void setShopImg(String shopImg) {
this.shopImg = shopImg;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getPayUrl() {
return payUrl;
}
public void setPayUrl(String payUrl) {
this.payUrl = payUrl;
}
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel;
}
public String getImgId() {
return imgId;
}
public void setImgId(String imgId) {
this.imgId = imgId;
}
}

@ -0,0 +1,25 @@
package au.com.royalpay.payment.manage.activities.diet.core;
import au.com.royalpay.payment.manage.activities.diet.beans.MerchantInfo;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
/**
* Created by yixian on 2017-03-21.
*/
public interface OneDollarDayActivity {
JSONObject findMerchant(String city, String clientMoniker);
JSONObject listMerchants(String city, String name, int page, int limit);
void updateMerchant(String clientMoniker, MerchantInfo merchantInfo);
JSONObject listMerchantsDetail();
List<JSONObject> listMerchantsAnalysis(String city);
List<JSONObject> getTransactionAnalysis(JSONObject params);
List<JSONObject> getSubsidyInDays(JSONObject params);
}

@ -0,0 +1,301 @@
package au.com.royalpay.payment.manage.activities.diet.core.impls;
import au.com.royalpay.payment.channels.wechat.runtime.MpPaymentApi;
import au.com.royalpay.payment.core.TransactionService;
import au.com.royalpay.payment.core.beans.PaymentQueryResult;
import au.com.royalpay.payment.core.beans.PreOrderRequest;
import au.com.royalpay.payment.core.beans.coupon.CashCouponInfo;
import au.com.royalpay.payment.core.beans.coupon.CouponInfo;
import au.com.royalpay.payment.core.events.PaymentFinishedEvent;
import au.com.royalpay.payment.core.events.RefundSendEvent;
import au.com.royalpay.payment.core.processors.PaymentProcessor;
import au.com.royalpay.payment.manage.activities.diet.beans.MerchantInfo;
import au.com.royalpay.payment.manage.activities.diet.core.OneDollarDayActivity;
import au.com.royalpay.payment.manage.mappers.act.ActDietAttendMapper;
import au.com.royalpay.payment.manage.mappers.act.ActDietOrderMapper;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.tools.CommonConsts;
import au.com.royalpay.payment.tools.connections.attachment.core.AttachmentClient;
import au.com.royalpay.payment.tools.env.SysConfigManager;
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateUtils;
import org.joda.time.DateTime;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
import javax.annotation.Resource;
/**
* Created by yixian on 2017-03-21.
*/
@Service
public class OneDollarDayActivitySupportImpl implements OneDollarDayActivity, PaymentProcessor {
private static final String processorId = "one_dollar_diet";
private static final BigDecimal MIN_PAY = BigDecimal.valueOf(9.99);
private static final BigDecimal DISCOUNT_AMOUNT = BigDecimal.ONE;
@Resource
private ActDietAttendMapper actDietAttendMapper;
@Resource
private ActDietOrderMapper actDietOrderMapper;
@Resource
private TransactionService transactionService;
@Resource
private MpPaymentApi mpPaymentApi;
@Resource
private OrderMapper orderMapper;
@Resource
private SysConfigManager sysConfigManager;
@Resource
private ClientManager clientManager;
@Resource
private AttachmentClient attachmentClient;
@Override
public String processorId() {
return processorId;
}
@Override
public void handleBeforeOrderSending(PreOrderRequest paymentInfo, JSONObject order) {
if (!checkWeekEnabled()) {
return;
}
int clientId = paymentInfo.getClientId();
if (isClientActive(clientId)) {
String orderId = paymentInfo.getOrderId();
JSONObject dietOrderInfo = new JSONObject();
dietOrderInfo.put("order_id", orderId);
dietOrderInfo.put("client_id", paymentInfo.getClientId());
String currency = paymentInfo.getCurrency();
dietOrderInfo.put("order_currency", currency);
BigDecimal totalFee = paymentInfo.getTotalFee();
BigDecimal payAmount = totalFee.divide(CommonConsts.HUNDRED, 2, BigDecimal.ROUND_DOWN);
BigDecimal payLocalCurrency = paymentInfo.getDisplayAmount().divide(CommonConsts.HUNDRED, 2, BigDecimal.ROUND_DOWN);
if (!"AUD".equals(currency)) {
BigDecimal exchange = mpPaymentApi.queryExchangeRateDecimal(clientId);
payLocalCurrency = payLocalCurrency.divide(exchange, 2, BigDecimal.ROUND_DOWN);
}
if (payLocalCurrency.compareTo(MIN_PAY) <= 0) {
return;
}
BigDecimal discount;
dietOrderInfo.put("order_amount", totalFee.divide(CommonConsts.HUNDRED, 2, BigDecimal.ROUND_DOWN));
if (!"AUD".equals(currency)) {
BigDecimal exchange = mpPaymentApi.queryExchangeRateDecimal(clientId);
discount = DISCOUNT_AMOUNT.multiply(exchange).setScale(2, BigDecimal.ROUND_DOWN);
} else {
discount = DISCOUNT_AMOUNT;
}
if (discount.compareTo(totalFee) > 0) {
return;
}
BigDecimal discountOrigin = paymentInfo.getDiscount();
paymentInfo.setDiscount(discountOrigin.add(discount));
JSONObject updateOrder = new JSONObject();
BigDecimal customerPay = payAmount.subtract(discount).setScale(2, BigDecimal.ROUND_DOWN);
updateOrder.put("customer_payment_amount", customerPay);
updateOrder.put("coupon_payment_amount", discount);
updateOrder.put("order_id", orderId);
orderMapper.update(updateOrder);
dietOrderInfo.put("pay_amount", customerPay);
dietOrderInfo.put("append_amount", DISCOUNT_AMOUNT);
dietOrderInfo.put("append_currency", "AUD");
dietOrderInfo.put("create_time", new Date());
actDietOrderMapper.save(dietOrderInfo);
}
}
private boolean isClientActive(int clientId) {
Date today = new Date();
today = DateUtils.truncate(today, Calendar.DATE);
JSONObject clientAttend = actDietAttendMapper.findClientAttend(clientId + "");
return clientAttend != null && !clientAttend.getDate("active_time").after(today);
}
private boolean checkWeekEnabled() {
int weekDay = sysConfigManager.getSysConfig().getIntValue("activity_one_dollar_diet_weekday");
return new DateTime().getDayOfWeek() == weekDay;
}
@Override
public void handleAfterOrderPaid(PaymentFinishedEvent finishedEvent) {
JSONObject order = finishedEvent.getOrder();
String orderId = order.getString("order_id");
JSONObject dietOrderInfo = actDietOrderMapper.findOrder(orderId);
if (dietOrderInfo == null || dietOrderInfo.getString("transaction_id") != null) {
return;
}
JSONObject log = new JSONObject();
log.put("system_transaction_id", orderId);
log.put("client_id", order.getIntValue("client_id"));
log.put("order_id", order.getString("order_id"));
BigDecimal amount = dietOrderInfo.getBigDecimal("append_amount");
String currency = dietOrderInfo.getString("append_currency");
log.put("transaction_currency", currency);
log.put("transaction_amount", amount);
log.put("org_id", order.getIntValue("org_id"));
log.put("exchange_rate", finishedEvent.getExchangeRate());
log.put("clearing_currency", currency);
log.put("clearing_amount", amount);
log.put("system_generate", 1);
log.put("channel", "Wechat");
log.put("transaction_type", "Credit");
PaymentQueryResult paymentQueryResult = finishedEvent.getPaymentQueryResult();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss");
format.setTimeZone(TimeZone.getTimeZone("Asia/Shanghai"));
log.put("transaction_time", format.format(paymentQueryResult.getPayTime()));
log.put("clearing_status", 0);
log.put("remark", "Activity: Day Of One Dollar");
transactionService.saveTransaction(log);
String transactionId = log.getString("transaction_id");
actDietOrderMapper.setTransactionId(orderId, transactionId, log.getDate("transaction_time"));
}
@Override
public void registerCoupon(JSONObject client, String customerOpenId, String channel, List<CouponInfo> coupons) {
if (!checkWeekEnabled()) {
return;
}
if (!isClientActive(client.getIntValue("client_id"))) {
return;
}
if (!"Wechat".equals(channel)) {
return;
}
CouponInfo coupon = new CashCouponInfo("one_dollar_day", "餐饮商户特惠日立减优惠", processorId(), "每周二微信支付买单立减一澳币(满10澳币)", MIN_PAY, DISCOUNT_AMOUNT, true);
coupons.add(coupon);
}
@Override
public void handleAfterRefund(RefundSendEvent event) {
JSONObject refund = event.getRefundOrder();
String orderId = refund.getString("order_id");
JSONObject dietOrderInfo = actDietOrderMapper.findOrder(orderId);
if (dietOrderInfo == null) {
return;
}
if (dietOrderInfo.getString("refund_transaction") != null) {
return;
}
JSONObject log = new JSONObject();
log.put("system_transaction_id", orderId);
int clientId = refund.getIntValue("client_id");
log.put("client_id", clientId);
log.put("order_id", orderId);
log.put("refund_id", refund.getString("refund_id"));
BigDecimal amount = dietOrderInfo.getBigDecimal("append_amount");
String currency = dietOrderInfo.getString("order_currency");
log.put("transaction_currency", currency);
log.put("transaction_amount", amount);
log.put("org_id", refund.getIntValue("org_id"));
log.put("exchange_rate", mpPaymentApi.queryExchangeRateDecimal(clientId));
log.put("clearing_currency", currency);
log.put("clearing_amount", amount);
log.put("system_generate", 1);
log.put("channel", "Wechat");
log.put("transaction_type", "Debit");
log.put("transaction_time", new Date());
log.put("clearing_status", 0);
log.put("remark", "Activity Refund: Day Of One Dollar");
transactionService.saveTransaction(log);
actDietOrderMapper.updateRefund(orderId, log.getString("transaction_id"), log.getDate("transaction_time"));
}
@Override
public String registerBanner(JSONObject client, String channel) {
return null;
}
@Override
public JSONObject findMerchant(String city, String clientMoniker) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new NotFoundException("Merchant Not Found");
}
JSONObject attendInfo = actDietAttendMapper.findClientAttend(client.getString("client_id"));
attendInfo.put("client_moniker", clientMoniker);
attendInfo.put("short_name", client.getString("short_name"));
if (!city.equals(attendInfo.getString("city"))) {
throw new NotFoundException("Merchant Not Found");
}
fillPayUrl(attendInfo);
return attendInfo;
}
@Override
public JSONObject listMerchants(String city, String name, int page, int limit) {
PageList<JSONObject> merchants = actDietAttendMapper.listMerchants(city, name, new PageBounds(page, limit, Order.formString("active_time.asc")));
return PageListUtils.buildPageListResult(merchants);
}
private void fillPayUrl(JSONObject merchant) {
if (StringUtils.isEmpty(merchant.getString("pay_url"))) {
merchant.put("pay_url", "/api/payment/v1.0/wechat_jsapi_payment/partners/" + merchant.getString("client_moniker") + "_ext_customerrate");
}
}
@Override
public void updateMerchant(String clientMoniker, MerchantInfo merchantInfo) {
JSONObject client = clientManager.getClientInfoByMoniker(clientMoniker);
if (client == null) {
throw new NotFoundException("Client Not Found");
}
if (merchantInfo.getImgId() != null) {
JSONObject thumbnail = attachmentClient.getThumbnail(merchantInfo.getImgId(), 400);
merchantInfo.setShopImg(thumbnail.getString("url"));
}
JSONObject attend = actDietAttendMapper.findClientAttend(client.getString("client_id"));
if (attend == null) {
attend = merchantInfo.toJSON();
attend.put("client_id", client.getString("client_id"));
attend.put("active_time", new Date());
actDietAttendMapper.save(attend);
} else {
attend = merchantInfo.mergeJson(attend);
actDietAttendMapper.update(attend);
}
}
@Override
public JSONObject listMerchantsDetail() {
PageList<JSONObject> merchants = actDietAttendMapper.listMerchantsDetail(new PageBounds(Order.formString("active_time.asc")));
return PageListUtils.buildPageListResult(merchants);
}
@Override
public List<JSONObject> listMerchantsAnalysis(String city) {
return actDietAttendMapper.listMerchantsAnalysis(city);
}
@Override
public List<JSONObject> getTransactionAnalysis(JSONObject params) {
return actDietAttendMapper.listTransactionAnalysis(params);
}
@Override
public List<JSONObject> getSubsidyInDays(JSONObject params) {
return actDietOrderMapper.getAppendAmountInDays(params);
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save