seatable-html-page-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +106 -0
- package/dist/index.js +1 -0
- package/es/apis/universal-app-api.js +92 -0
- package/es/iframe-adapter.js +343 -0
- package/es/index.js +1 -0
- package/es/sdk.js +143 -0
- package/lib/apis/universal-app-api.js +102 -0
- package/lib/iframe-adapter.js +356 -0
- package/lib/index.js +9 -0
- package/lib/sdk.js +154 -0
- package/package.json +47 -0
package/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<h1>SeaTable HTML Page SDK</h1>
|
|
2
|
+
|
|
3
|
+
<div>
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.org/package/seatable-html-page-sdk)
|
|
6
|
+
[](https://unpkg.com/seatable-html-page-sdk@latest/dist/index.js)
|
|
7
|
+
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
## Introduction
|
|
11
|
+
|
|
12
|
+
SeaTable HTML Page SDK is a JavaScript library designed for embedding HTML pages within SeaTable Universal Apps. It provides commonly used interfaces for data interaction and event subscription.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Install with npm or yarn:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# npm
|
|
20
|
+
$ npm install seatable-html-page-sdk --save
|
|
21
|
+
|
|
22
|
+
# yarn
|
|
23
|
+
$ yarn add seatable-html-page-sdk
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### Initialization options
|
|
29
|
+
|
|
30
|
+
#### Development mode (mock)
|
|
31
|
+
|
|
32
|
+
For local development:
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
const sdk = new HTMLPageSDK({
|
|
36
|
+
server: "https://your-seatable-server.com",
|
|
37
|
+
accessToken: "your-access-token",
|
|
38
|
+
appUuid: "your-app-uuid",
|
|
39
|
+
pageId: "your-app-page-id", // create an html page in universal app first
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
#### Production mode (iframe)
|
|
44
|
+
|
|
45
|
+
When running inside a SeaTable Universal App:
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
const sdk = new HTMLPageSDK({
|
|
49
|
+
targetOrigin: "https://your-seatable-server.com", // Optional, defaults to '*'
|
|
50
|
+
timeout: 10000, // Optional, request timeout in ms, defaults to 10000
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Basic usage
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
import { HTMLPageSDK } from "seatable-html-page-sdk";
|
|
58
|
+
|
|
59
|
+
// Initialize SDK
|
|
60
|
+
const sdk = new HTMLPageSDK(options);
|
|
61
|
+
|
|
62
|
+
// list rows
|
|
63
|
+
const rows = await sdk.listRows({
|
|
64
|
+
tableName: "TableName",
|
|
65
|
+
start: 0,
|
|
66
|
+
limit: 100,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Add a new row
|
|
70
|
+
await sdk.addRow({
|
|
71
|
+
tableName: "TableName",
|
|
72
|
+
rowData: { Name: "John", Age: 30 },
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Testing
|
|
77
|
+
|
|
78
|
+
### Run tests
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm test
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Test coverage
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm run test-cov
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Development
|
|
91
|
+
|
|
92
|
+
### Build
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm run build
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Lint
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Check code style
|
|
102
|
+
npm run eslint
|
|
103
|
+
|
|
104
|
+
# Auto-fix issues
|
|
105
|
+
npm run eslint-fix
|
|
106
|
+
```
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).HTMLPageSDK=t()}(this,(function(){"use strict";function e(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var s=t.apply(n,r);function a(t){e(s,o,i,a,u,"next",t)}function u(t){e(s,o,i,a,u,"throw",t)}a(void 0)}))}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u={exports:{}},c={exports:{}};!function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(c);var l=c.exports;!function(e){var t=l.default;function n(){e.exports=n=function(){return o},e.exports.__esModule=!0,e.exports.default=e.exports;var r,o={},i=Object.prototype,s=i.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function f(e,t,n,r){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r})}try{f({},"")}catch(r){f=function(e,t,n){return e[t]=n}}function d(e,t,n,o){var i=t&&t.prototype instanceof y?t:y,s=Object.create(i.prototype);return f(s,"_invoke",function(e,t,n){var o=1;return function(i,s){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw s;return{value:r,done:!0}}for(n.method=i,n.arg=s;;){var a=n.delegate;if(a){var u=S(a,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var c=p(e,t,n);if("normal"===c.type){if(o=n.done?4:2,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=4,n.method="throw",n.arg=c.arg)}}}(e,n,new A(o||[])),!0),s}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}o.wrap=d;var h={};function y(){}function m(){}function b(){}var g={};f(g,u,(function(){return this}));var w=Object.getPrototypeOf,v=w&&w(w(k([])));v&&v!==i&&s.call(v,u)&&(g=v);var E=b.prototype=y.prototype=Object.create(g);function O(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,n){function r(o,i,a,u){var c=p(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==t(f)&&s.call(f,"__await")?n.resolve(f.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):n.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var o;f(this,"_invoke",(function(e,t){function i(){return new n((function(n,o){r(e,t,n,o)}))}return o=o?o.then(i,i):i()}),!0)}function S(e,t){var n=t.method,o=e.i[n];if(o===r)return t.delegate=null,"throw"===n&&e.i.return&&(t.method="return",t.arg=r,S(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=p(o,e.i,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var s=i.arg;return s?s.done?(t[e.r]=s.value,t.next=e.n,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,h):s:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){this.tryEntries.push(e)}function T(e){var t=e[4]||{};t.type="normal",t.arg=r,e[4]=t}function A(e){this.tryEntries=[[-1]],e.forEach(x,this),this.reset(!0)}function k(e){if(null!=e){var n=e[u];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function t(){for(;++o<e.length;)if(s.call(e,o))return t.value=e[o],t.done=!1,t;return t.value=r,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return m.prototype=b,f(E,"constructor",b),f(b,"constructor",m),m.displayName=f(b,l,"GeneratorFunction"),o.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,f(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},o.awrap=function(e){return{__await:e}},O(R.prototype),f(R.prototype,c,(function(){return this})),o.AsyncIterator=R,o.async=function(e,t,n,r,i){void 0===i&&(i=Promise);var s=new R(d(e,t,n,r),i);return o.isGeneratorFunction(t)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},O(E),f(E,l,"Generator"),f(E,u,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),o.keys=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},o.values=k,A.prototype={constructor:A,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(T),!e)for(var t in this)"t"===t.charAt(0)&&s.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0][4];if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n){s.type="throw",s.arg=e,t.next=n}for(var o=t.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i[4],a=this.prev,u=i[1],c=i[2];if(-1===i[0])return n("end"),!1;if(!u&&!c)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=a){if(a<u)return this.method="next",this.arg=r,n(u),!0;if(a<c)return n(c),!1}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r[0]>-1&&r[0]<=this.prev&&this.prev<r[2]){var o=r;break}}o&&("break"===e||"continue"===e)&&o[0]<=t&&t<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o[2],h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[2]===e)return this.complete(n[4],n[3]),T(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n[0]===e){var r=n[4];if("throw"===r.type){var o=r.arg;T(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={i:k(e),r:t,n:n},"next"===this.method&&(this.arg=r),h}},o}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(u);var f=(0,u.exports)(),d=f;try{regeneratorRuntime=f}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=f:Function("r","regeneratorRuntime = r")(f)}var p=a(d);function h(e,t){return function(){return e.apply(t,arguments)}}const{toString:y}=Object.prototype,{getPrototypeOf:m}=Object,{iterator:b,toStringTag:g}=Symbol,w=(v=Object.create(null),e=>{const t=y.call(e);return v[t]||(v[t]=t.slice(8,-1).toLowerCase())});var v;const E=e=>(e=e.toLowerCase(),t=>w(t)===e),O=e=>t=>typeof t===e,{isArray:R}=Array,S=O("undefined");function x(e){return null!==e&&!S(e)&&null!==e.constructor&&!S(e.constructor)&&k(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const T=E("ArrayBuffer");const A=O("string"),k=O("function"),_=O("number"),j=e=>null!==e&&"object"==typeof e,P=e=>{if("object"!==w(e))return!1;const t=m(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||g in e||b in e)},N=E("Date"),U=E("File"),C=E("Blob"),L=E("FileList"),F=E("URLSearchParams"),[D,q,B,I]=["ReadableStream","Request","Response","Headers"].map(E);function M(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),R(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(x(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function K(e,t){if(x(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const H="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,z=e=>!S(e)&&e!==H;const W=(J="undefined"!=typeof Uint8Array&&m(Uint8Array),e=>J&&e instanceof J);var J;const V=E("HTMLFormElement"),G=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),X=E("RegExp"),$=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};M(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};const Y=E("AsyncFunction"),Q=(Z="function"==typeof setImmediate,ee=k(H.postMessage),Z?setImmediate:ee?(te=`axios@${Math.random()}`,ne=[],H.addEventListener("message",(({source:e,data:t})=>{e===H&&t===te&&ne.length&&ne.shift()()}),!1),e=>{ne.push(e),H.postMessage(te,"*")}):e=>setTimeout(e));var Z,ee,te,ne;const re="undefined"!=typeof queueMicrotask?queueMicrotask.bind(H):"undefined"!=typeof process&&process.nextTick||Q;var oe={isArray:R,isArrayBuffer:T,isBuffer:x,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||k(e.append)&&("formdata"===(t=w(e))||"object"===t&&k(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&T(e.buffer),t},isString:A,isNumber:_,isBoolean:e=>!0===e||!1===e,isObject:j,isPlainObject:P,isEmptyObject:e=>{if(!j(e)||x(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:D,isRequest:q,isResponse:B,isHeaders:I,isUndefined:S,isDate:N,isFile:U,isBlob:C,isRegExp:X,isFunction:k,isStream:e=>j(e)&&k(e.pipe),isURLSearchParams:F,isTypedArray:W,isFileList:L,forEach:M,merge:function e(){const{caseless:t,skipUndefined:n}=z(this)&&this||{},r={},o=(o,i)=>{const s=t&&K(r,i)||i;P(r[s])&&P(o)?r[s]=e(r[s],o):P(o)?r[s]=e({},o):R(o)?r[s]=o.slice():n&&S(o)||(r[s]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&M(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:r}={})=>(M(t,((t,r)=>{n&&k(t)?e[r]=h(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],r&&!r(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&m(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:w,kindOfTest:E,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(R(e))return e;let t=e.length;if(!_(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[b]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:V,hasOwnProperty:G,hasOwnProp:G,reduceDescriptors:$,freezeMethods:e=>{$(e,((t,n)=>{if(k(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];k(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return R(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:K,global:H,isContextDefined:z,isSpecCompliantForm:function(e){return!!(e&&k(e.append)&&"FormData"===e[g]&&e[b])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(j(e)){if(t.indexOf(e)>=0)return;if(x(e))return e;if(!("toJSON"in e)){t[r]=e;const o=R(e)?[]:{};return M(e,((e,t)=>{const i=n(e,r+1);!S(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Y,isThenable:e=>e&&(j(e)||k(e))&&k(e.then)&&k(e.catch),setImmediate:Q,asap:re,isIterable:e=>null!=e&&k(e[b])};function ie(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}oe.inherits(ie,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.status}}});const se=ie.prototype,ae={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{ae[e]={value:e}})),Object.defineProperties(ie,ae),Object.defineProperty(se,"isAxiosError",{value:!0}),ie.from=(e,t,n,r,o,i)=>{const s=Object.create(se);oe.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const a=e&&e.message?e.message:"Error",u=null==t&&e?e.code:t;return ie.call(s,a,u,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};function ue(e){return oe.isPlainObject(e)||oe.isArray(e)}function ce(e){return oe.endsWith(e,"[]")?e.slice(0,-2):e}function le(e,t,n){return e?e.concat(t).map((function(e,t){return e=ce(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const fe=oe.toFlatObject(oe,{},null,(function(e){return/^is[A-Z]/.test(e)}));function de(e,t,n){if(!oe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!oe.isUndefined(t[e])}))).metaTokens,o=n.visitor||c,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&oe.isSpecCompliantForm(t);if(!oe.isFunction(o))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(oe.isDate(e))return e.toISOString();if(oe.isBoolean(e))return e.toString();if(!a&&oe.isBlob(e))throw new ie("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(e)||oe.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(oe.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(oe.isArray(e)&&function(e){return oe.isArray(e)&&!e.some(ue)}(e)||(oe.isFileList(e)||oe.endsWith(n,"[]"))&&(a=oe.toArray(e)))return n=ce(n),a.forEach((function(e,r){!oe.isUndefined(e)&&null!==e&&t.append(!0===s?le([n],r,i):null===s?n:n+"[]",u(e))})),!1;return!!ue(e)||(t.append(le(o,n,i),u(e)),!1)}const l=[],f=Object.assign(fe,{defaultVisitor:c,convertValue:u,isVisitable:ue});if(!oe.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!oe.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),oe.forEach(n,(function(n,i){!0===(!(oe.isUndefined(n)||null===n)&&o.call(t,n,oe.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t}function pe(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function he(e,t){this._pairs=[],e&&de(e,this,t)}const ye=he.prototype;function me(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function be(e,t,n){if(!t)return e;const r=n&&n.encode||me;oe.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):oe.isURLSearchParams(t)?t.toString():new he(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}ye.append=function(e,t){this._pairs.push([e,t])},ye.toString=function(e){const t=e?function(t){return e.call(this,t,pe)}:pe;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ge=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},we={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ve={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:he,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Ee="undefined"!=typeof window&&"undefined"!=typeof document,Oe="object"==typeof navigator&&navigator||void 0,Re=Ee&&(!Oe||["ReactNative","NativeScript","NS"].indexOf(Oe.product)<0),Se="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,xe=Ee&&window.location.href||"http://localhost";var Te={...Object.freeze({__proto__:null,hasBrowserEnv:Ee,hasStandardBrowserWebWorkerEnv:Se,hasStandardBrowserEnv:Re,navigator:Oe,origin:xe}),...ve};function Ae(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&oe.isArray(r)?r.length:i,a)return oe.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&oe.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&oe.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s}if(oe.isFormData(e)&&oe.isFunction(e.entries)){const n={};return oe.forEachEntry(e,((e,r)=>{t(function(e){return oe.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ke={transitional:we,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=oe.isObject(e);o&&oe.isHTMLForm(e)&&(e=new FormData(e));if(oe.isFormData(e))return r?JSON.stringify(Ae(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e)||oe.isReadableStream(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return de(e,new Te.classes.URLSearchParams,{visitor:function(e,t,n,r){return Te.isNode&&oe.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=oe.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return de(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(oe.isString(e))try{return(t||JSON.parse)(e),oe.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ke.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(oe.isResponse(e)||oe.isReadableStream(e))return e;if(e&&oe.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw ie.from(e,ie.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Te.classes.FormData,Blob:Te.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],(e=>{ke.headers[e]={}}));var _e=ke;const je=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Pe=Symbol("internals");function Ne(e){return e&&String(e).trim().toLowerCase()}function Ue(e){return!1===e||null==e?e:oe.isArray(e)?e.map(Ue):String(e)}function Ce(e,t,n,r,o){return oe.isFunction(r)?r.call(this,t,n):(o&&(t=n),oe.isString(t)?oe.isString(r)?-1!==t.indexOf(r):oe.isRegExp(r)?r.test(t):void 0:void 0)}class Le{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Ne(t);if(!o)throw new Error("header name must be a non-empty string");const i=oe.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ue(e))}const i=(e,t)=>oe.forEach(e,((e,n)=>o(e,n,t)));if(oe.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(oe.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&je[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(oe.isObject(e)&&oe.isIterable(e)){let n,r,o={};for(const t of e){if(!oe.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?oe.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Ne(e)){const n=oe.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(oe.isFunction(t))return t.call(this,e,n);if(oe.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ne(e)){const n=oe.findKey(this,e);return!(!n||void 0===this[n]||t&&!Ce(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Ne(e)){const o=oe.findKey(n,e);!o||t&&!Ce(0,n[o],o,t)||(delete n[o],r=!0)}}return oe.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!Ce(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return oe.forEach(this,((r,o)=>{const i=oe.findKey(n,o);if(i)return t[i]=Ue(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=Ue(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return oe.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&oe.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Pe]=this[Pe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Ne(e);t[r]||(!function(e,t){const n=oe.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return oe.isArray(e)?e.forEach(r):r(e),this}}Le.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),oe.reduceDescriptors(Le.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),oe.freezeMethods(Le);var Fe=Le;function De(e,t){const n=this||_e,r=t||n,o=Fe.from(r.headers);let i=r.data;return oe.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function qe(e){return!(!e||!e.__CANCEL__)}function Be(e,t,n){ie.call(this,null==e?"canceled":e,ie.ERR_CANCELED,t,n),this.name="CanceledError"}function Ie(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ie("Request failed with status code "+n.status,[ie.ERR_BAD_REQUEST,ie.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}oe.inherits(Be,ie,{__CANCEL__:!0});const Me=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=r[s];o||(o=u),n[i]=a,r[i]=u;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),u-o<t)return;const d=c&&u-c;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout((()=>{r=null,s(n)}),i-a)))},()=>n&&s(n)]}((n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,u=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&i<=s?(s-i)/u:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),n)},Ke=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},He=e=>(...t)=>oe.asap((()=>e(...t)));var ze=Te.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Te.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Te.origin),Te.navigator&&/(msie|trident)/i.test(Te.navigator.userAgent)):()=>!0,We=Te.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];oe.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),oe.isString(r)&&s.push("path="+r),oe.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Je(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ve=e=>e instanceof Fe?{...e}:e;function Ge(e,t){t=t||{};const n={};function r(e,t,n,r){return oe.isPlainObject(e)&&oe.isPlainObject(t)?oe.merge.call({caseless:r},e,t):oe.isPlainObject(t)?oe.merge({},t):oe.isArray(t)?t.slice():t}function o(e,t,n,o){return oe.isUndefined(t)?oe.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!oe.isUndefined(t))return r(void 0,t)}function s(e,t){return oe.isUndefined(t)?oe.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(Ve(e),Ve(t),0,!0)};return oe.forEach(Object.keys({...e,...t}),(function(r){const i=u[r]||o,s=i(e[r],t[r],r);oe.isUndefined(s)&&i!==a||(n[r]=s)})),n}var Xe=e=>{const t=Ge({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=Fe.from(s),t.url=be(Je(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),oe.isFormData(n))if(Te.hasStandardBrowserEnv||Te.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(oe.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)}))}if(Te.hasStandardBrowserEnv&&(r&&oe.isFunction(r)&&(r=r(t)),r||!1!==r&&ze(t.url))){const e=o&&i&&We.read(i);e&&s.set(o,e)}return t};var $e="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Xe(e);let o=r.data;const i=Fe.from(r.headers).normalize();let s,a,u,c,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){c&&c(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let y=new XMLHttpRequest;function m(){if(!y)return;const r=Fe.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Ie((function(e){t(e),h()}),(function(e){n(e),h()}),{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(n(new ie("Request aborted",ie.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=new ie(t&&t.message?t.message:"Network Error",ie.ERR_NETWORK,e,y);r.event=t||null,n(r),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||we;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new ie(t,o.clarifyTimeoutError?ie.ETIMEDOUT:ie.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&oe.forEach(i.toJSON(),(function(e,t){y.setRequestHeader(t,e)})),oe.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),f&&"json"!==f&&(y.responseType=r.responseType),p&&([u,l]=Me(p,!0),y.addEventListener("progress",u)),d&&y.upload&&([a,c]=Me(d),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(s=t=>{y&&(n(!t||t.type?new Be(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===Te.protocols.indexOf(b)?n(new ie("Unsupported protocol "+b+":",ie.ERR_BAD_REQUEST,e)):y.send(o||null)}))};var Ye=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof ie?t:new Be(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new ie(`timeout ${t} of ms exceeded`,ie.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>oe.asap(s),a}};const Qe=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Ze=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},et=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Ze(e))yield*Qe(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:tt}=oe,nt=(({Request:e,Response:t})=>({Request:e,Response:t}))(oe.global),{ReadableStream:rt,TextEncoder:ot}=oe.global,it=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},st=e=>{e=oe.merge.call({skipUndefined:!0},nt,e);const{fetch:t,Request:n,Response:r}=e,o=t?tt(t):"function"==typeof fetch,i=tt(n),s=tt(r);if(!o)return!1;const a=o&&tt(rt),u=o&&("function"==typeof ot?(c=new ot,e=>c.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var c;const l=i&&a&&it((()=>{let e=!1;const t=new n(Te.origin,{body:new rt,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),f=s&&a&&it((()=>oe.isReadableStream(new r("").body))),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new ie(`Response type '${e}' is not supported`,ie.ERR_NOT_SUPPORT,n)})}));const p=async(e,t)=>{const r=oe.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(oe.isBlob(e))return e.size;if(oe.isSpecCompliantForm(e)){const t=new n(Te.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return oe.isArrayBufferView(e)||oe.isArrayBuffer(e)?e.byteLength:(oe.isURLSearchParams(e)&&(e+=""),oe.isString(e)?(await u(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:u,cancelToken:c,timeout:h,onDownloadProgress:y,onUploadProgress:m,responseType:b,headers:g,withCredentials:w="same-origin",fetchOptions:v}=Xe(e),E=t||fetch;b=b?(b+"").toLowerCase():"text";let O=Ye([u,c&&c.toAbortSignal()],h),R=null;const S=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let x;try{if(m&&l&&"get"!==s&&"head"!==s&&0!==(x=await p(g,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(oe.isFormData(a)&&(e=t.headers.get("content-type"))&&g.setContentType(e),t.body){const[e,n]=Ke(x,Me(He(m)));a=et(t.body,65536,e,n)}}oe.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in n.prototype,u={...v,signal:O,method:s.toUpperCase(),headers:g.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};R=i&&new n(o,u);let c=await(i?E(R,v):E(o,u));const h=f&&("stream"===b||"response"===b);if(f&&(y||h&&S)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=c[t]}));const t=oe.toFiniteNumber(c.headers.get("content-length")),[n,o]=y&&Ke(t,Me(He(y),!0))||[];c=new r(et(c.body,65536,n,(()=>{o&&o(),S&&S()})),e)}b=b||"text";let T=await d[oe.findKey(d,b)||"text"](c,e);return!h&&S&&S(),await new Promise(((t,n)=>{Ie(t,n,{data:T,headers:Fe.from(c.headers),status:c.status,statusText:c.statusText,config:e,request:R})}))}catch(t){if(S&&S(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new ie("Network Error",ie.ERR_NETWORK,e,R),{cause:t.cause||t});throw ie.from(t,t&&t.code,e,R)}}},at=new Map,ut=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,u=i.length,c=at;for(;u--;)s=i[u],a=c.get(s),void 0===a&&c.set(s,a=u?new Map:st(t)),c=a;return a};ut();const ct={http:null,xhr:$e,fetch:{get:ut}};oe.forEach(ct,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const lt=e=>`- ${e}`,ft=e=>oe.isFunction(e)||null===e||!1===e;var dt=(e,t)=>{e=oe.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!ft(r)&&(o=ct[(n=String(r)).toLowerCase()],void 0===o))throw new ie(`Unknown adapter '${n}'`);if(o&&(oe.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new ie("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(lt).join("\n"):" "+lt(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function pt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Be(null,e)}function ht(e){pt(e),e.headers=Fe.from(e.headers),e.data=De.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return dt(e.adapter||_e.adapter,e)(e).then((function(t){return pt(e),t.data=De.call(e,e.transformResponse,t),t.headers=Fe.from(t.headers),t}),(function(t){return qe(t)||(pt(e),t&&t.response&&(t.response.data=De.call(e,e.transformResponse,t.response),t.response.headers=Fe.from(t.response.headers))),Promise.reject(t)}))}const yt="1.12.2",mt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{mt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const bt={};mt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+yt+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new ie(r(o," has been removed"+(t?" in "+t:"")),ie.ERR_DEPRECATED);return t&&!bt[o]&&(bt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},mt.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var gt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ie("options must be an object",ie.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new ie("option "+i+" must be "+n,ie.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ie("Unknown option "+i,ie.ERR_BAD_OPTION)}},validators:mt};const wt=gt.validators;class vt{constructor(e){this.defaults=e||{},this.interceptors={request:new ge,response:new ge}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ge(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&>.assertOptions(n,{silentJSONParsing:wt.transitional(wt.boolean),forcedJSONParsing:wt.transitional(wt.boolean),clarifyTimeoutError:wt.transitional(wt.boolean)},!1),null!=r&&(oe.isFunction(r)?t.paramsSerializer={serialize:r}:gt.assertOptions(r,{encode:wt.function,serialize:wt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),gt.assertOptions(t,{baseUrl:wt.spelling("baseURL"),withXsrfToken:wt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&oe.merge(o.common,o[t.method]);o&&oe.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Fe.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const u=[];let c;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[ht.bind(this),void 0];for(e.unshift(...s),e.push(...u),l=e.length,c=Promise.resolve(t);f<l;)c=c.then(e[f++],e[f++]);return c}l=s.length;let d=t;for(;f<l;){const e=s[f++],t=s[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{c=ht.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=u.length;f<l;)c=c.then(u[f++],u[f++]);return c}getUri(e){return be(Je((e=Ge(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}oe.forEach(["delete","get","head","options"],(function(e){vt.prototype[e]=function(t,n){return this.request(Ge(n||{},{method:e,url:t,data:(n||{}).data}))}})),oe.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Ge(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}vt.prototype[e]=t(),vt.prototype[e+"Form"]=t(!0)}));var Et=vt;class Ot{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new Be(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Ot((function(t){e=t})),cancel:e}}}var Rt=Ot;const St={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(St).forEach((([e,t])=>{St[t]=e}));var xt=St;const Tt=function e(t){const n=new Et(t),r=h(Et.prototype.request,n);return oe.extend(r,Et.prototype,n,{allOwnKeys:!0}),oe.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Ge(t,n))},r}(_e);Tt.Axios=Et,Tt.CanceledError=Be,Tt.CancelToken=Rt,Tt.isCancel=qe,Tt.VERSION=yt,Tt.toFormData=de,Tt.AxiosError=ie,Tt.Cancel=Tt.CanceledError,Tt.all=function(e){return Promise.all(e)},Tt.spread=function(e){return function(t){return e.apply(null,t)}},Tt.isAxiosError=function(e){return oe.isObject(e)&&!0===e.isAxiosError},Tt.mergeConfig=Ge,Tt.AxiosHeaders=Fe,Tt.formToJSON=e=>Ae(oe.isHTMLForm(e)?new FormData(e):e),Tt.getAdapter=dt,Tt.HttpStatusCode=xt,Tt.default=Tt;var At=Tt,kt=function(){return s((function e(t){var r=t.server,o=t.accessToken,i=t.appUuid;n(this,e),this.server=r,this.accessToken=o,this.appUuid=i,this.init()}),[{key:"init",value:function(){this.accessToken&&this.server&&(this.server=this.server.endsWith("/")?this.server:"".concat(this.server,"/"),this.req=At.create({baseURL:this.server,headers:{Authorization:"Token "+this.accessToken}}))}},{key:"listRows",value:function(e,t,n,r){var o="".concat(this.server,"api/v2.1/universal-apps/").concat(this.appUuid,"/html-page-rows/"),i={page_id:e,table_name:t,start:n,limit:r};return this.req.get(o,{params:i})}},{key:"addRow",value:function(e,t,n,r){var o="".concat(this.server,"api/v2.1/universal-apps/").concat(this.appUuid,"/html-page-rows/"),i={page_id:e,table_name:t,row_data:n,row_links_data:r};return this.req.post(o,i)}},{key:"addRows",value:function(e,t,n,r){var o="".concat(this.server,"api/v2.1/universal-apps/").concat(this.appUuid,"/html-page-rows/batch/"),i={page_id:e,table_name:t,rows_data:n,rows_links_data:r};return this.req.post(o,i)}},{key:"updateRows",value:function(e,t,n){var r="".concat(this.server,"api/v2.1/universal-apps/").concat(this.appUuid,"/html-page-rows/"),o={page_id:e,table_name:t,rows_data:n};return this.req.put(r,o)}},{key:"deleteRows",value:function(e,t,n){var r="".concat(this.server,"api/v2.1/universal-apps/").concat(this.appUuid,"/html-page-rows/"),o={page_id:e,table_name:t,rows_ids:n};return this.req.delete(r,o)}}])}();function _t(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jt(Object(n),!0).forEach((function(t){_t(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Nt="HTML_PAGE_REQUEST",Ut="HTML_PAGE_RESPONSE",Ct="HTML_PAGE_EVENT",Lt="WINDOW_EVENT",Ft="get_server",Dt="get_access_token",qt="get_app_uuid",Bt="get_page_id",It="app",Mt="iframe",Kt=["click","dblclick","mousemove","mouseenter","mouseleave","mousedown","mouseup","contextmenu"],Ht=["keydown","keyup","keypress"],zt=["dragstart","dragover","drag","dragend","dragenter","dragleave","drop"],Wt=["mousemove","dragover"],Jt=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},Vt=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4,t="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz0123456789",n="",r=0;r<e;r++)n+=t.charAt(Math.floor(72*Math.random()));return n},Gt=function(e){var t=e.eventType,n=e.event;return Kt.includes(t)?{type:t,x:n.x,y:n.y,button:n.button,buttons:n.buttons}:Ht.includes(t)?{type:t,key:n.key,code:n.code,keyCode:n.keyCode,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,altKey:n.altKey,metaKey:n.metaKey,repeat:n.repeat}:zt.includes(t)?{type:t,x:n.x,y:n.y}:null},Xt=function(){return s((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.selfWindow=window.parent===window.self,this.targetOrigin=t.targetOrigin||"*",this.pendingRequests={},this.eventHandlers={},this.timeout=t.timeout||1e4,this.setupMessageListener()}),[{key:"generatorRequestId",value:function(){for(var e=Vt();Jt(this.pendingRequests,e);)e=Vt();return e}},{key:"setupMessageListener",value:function(){this.selfWindow||(window.addEventListener("message",this.handleMessage.bind(this)),this.setEventsListener())}},{key:"postWindowEvent",value:function(e){e&&window.parent.postMessage({type:Lt,params:{event_data:Pt(Pt({},e),{},{source:Mt})}},this.targetOrigin)}},{key:"setEventsListener",value:function(){var e=this,t=null,n=null;[].concat(Kt,Ht,zt).forEach((function(r){window.addEventListener(r,(function(o){if(o.source!==It)return Wt.includes(r)?(n=Gt({eventType:r,event:o}),void(null===t&&(t=requestAnimationFrame((function(){n&&(e.postWindowEvent(n),n=null,t=null)}))))):void e.postWindowEvent(Gt({eventType:r,event:o}))}),!0)}))}},{key:"request",value:(e=t(p.mark((function e(t,n){var r,o=this;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.selfWindow){e.next=2;break}return e.abrupt("return",new Promise((function(e){e(null)})));case 2:return r=this.generatorRequestId(),e.abrupt("return",new Promise((function(e,i){o.pendingRequests[r]={resolve:e,reject:i},window.parent.postMessage({type:Nt,requestId:r,method:t,params:n},o.targetOrigin);var s=setTimeout((function(){Jt(o.pendingRequests,r)&&(delete o.pendingRequests[r],i(new Error("Request timeout: ".concat(t))))}),o.timeout),a=o.pendingRequests[r];a&&(a.timeoutId=s)})));case 4:case"end":return e.stop()}}),e,this)}))),function(t,n){return e.apply(this,arguments)})},{key:"handleMessage",value:function(e){var t=e.data,n=t.type,r=t.requestId,o=t.data,i=t.error,s=t.eventType,a=t.payload;if(n===Ut){var u=this.pendingRequests[r];u&&(clearTimeout(u.timeoutId),delete this.pendingRequests[r],i?u.reject(new Error(i)):u.resolve(o?JSON.parse(o):null))}else if(n===Ct)this.emitEvent(s,a);else if(n===Lt){var c,l,f=o.event_data;if(!f)return;if(Ht.includes(f.type))c=new KeyboardEvent(f.type,{bubbles:!0,cancelable:!0,key:f.key,code:f.code,keyCode:f.keyCode,ctrlKey:f.ctrlKey,shiftKey:f.shiftKey,altKey:f.altKey,metaKey:f.metaKey,repeat:f.repeat,view:window}),l=document.activeElement||document.body;else if(Kt.includes(f.type)){c=new MouseEvent(f.type,{bubbles:!0,cancelable:!0,view:window,clientX:f.x,clientY:f.y,screenX:f.x,screenY:f.y,button:f.button,buttons:f.buttons}),l=document.elementFromPoint(f.x,f.y)||document.body}else if(zt.includes(f.type)){c=new DragEvent(f.type,{bubbles:!0,cancelable:!0,view:window,clientX:f.x,clientY:f.y,screenX:f.x,screenY:f.y,button:f.button,buttons:f.buttons}),l=document.elementFromPoint(f.x,f.y)||document.body}if(!l||!c)return;c.source=f.source,l.dispatchEvent(c)}}},{key:"on",value:function(e,t){var n=this;return Jt(this.eventHandlers,e)||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t),function(){return n.off(e,t)}}},{key:"off",value:function(e,t){var n=this.eventHandlers[e];if(n){var r=n.indexOf(t);-1!==r&&n.splice(r,1)}}},{key:"emitEvent",value:function(e,t){(this.eventHandlers[e]||[]).forEach((function(n){try{n(t)}catch(t){console.error("Error in event handler for ".concat(e,":"),t)}}))}},{key:"destroy",value:function(){this.pendingRequests.forEach((function(e){clearTimeout(e.timeoutId),e.reject(new Error("Adapter destroyed"))})),this.pendingRequests={},this.eventHandlers={}}}]);var e}(),$t=function(){return s((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(this,e),this.options=t||{},this.iframeAdapter=new Xt(t)}),[{key:"init",value:(e=t(p.mark((function e(){var t,n,r,o;return p.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.options.server){e.next=4;break}return e.next=3,this.iframeAdapter.request(Ft);case 3:this.options.server=e.sent;case 4:if(this.options.accessToken){e.next=8;break}return e.next=7,this.iframeAdapter.request(Dt);case 7:this.options.accessToken=e.sent;case 8:if(this.options.appUuid){e.next=12;break}return e.next=11,this.iframeAdapter.request(qt);case 11:this.options.appUuid=e.sent;case 12:if(this.options.pageId){e.next=16;break}return e.next=15,this.iframeAdapter.request(Bt);case 15:this.options.pageId=e.sent;case 16:t=this.options,n=t.server,r=t.accessToken,o=t.appUuid,this.universalAppAPI=new kt({server:n,accessToken:r,appUuid:o});case 18:case"end":return e.stop()}}),e,this)}))),function(){return e.apply(this,arguments)})},{key:"listRows",value:function(e){var t=e.tableName,n=e.start,r=e.limit;return this.universalAppAPI.listRows(this.options.pageId,t,n,r)}},{key:"addRow",value:function(e){var t=e.tableName,n=e.rowData,r=e.rowLinksData;return this.universalAppAPI.addRow(this.options.pageId,t,n,r)}},{key:"updateRow",value:function(e){var t=e.tableName,n=[{id:e.rowId,row:e.rowData}];this.batchUpdateRows({tableName:t,rowsData:n})}},{key:"deleteRow",value:function(e){var t=e.tableName,n=[e.rowId];return this.batchDeleteRows({tableName:t,rowsIds:n})}},{key:"batchAddRows",value:function(e){var t=e.tableName,n=e.rowsData,r=e.rowsLinksData;return this.universalAppAPI.addRows(this.options.pageId,t,n,r)}},{key:"batchUpdateRows",value:function(e){var t=e.tableName,n=e.rowsData;return this.universalAppAPI.updateRows(this.options.pageId,t,n)}},{key:"batchDeleteRows",value:function(e){var t=e.tableName,n=e.rowsIds;return this.universalAppAPI.deleteRows(this.options.pageId,t,n)}}]);var e}();return $t}));
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
2
|
+
import _createClass from '@babel/runtime/helpers/createClass';
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
|
|
5
|
+
var UniversalAppAPI = /*#__PURE__*/function () {
|
|
6
|
+
function UniversalAppAPI(_ref) {
|
|
7
|
+
var server = _ref.server,
|
|
8
|
+
accessToken = _ref.accessToken,
|
|
9
|
+
appUuid = _ref.appUuid;
|
|
10
|
+
_classCallCheck(this, UniversalAppAPI);
|
|
11
|
+
this.server = server;
|
|
12
|
+
this.accessToken = accessToken;
|
|
13
|
+
this.appUuid = appUuid;
|
|
14
|
+
this.init();
|
|
15
|
+
}
|
|
16
|
+
return _createClass(UniversalAppAPI, [{
|
|
17
|
+
key: "init",
|
|
18
|
+
value: function init() {
|
|
19
|
+
if (this.accessToken && this.server) {
|
|
20
|
+
this.server = this.server.endsWith('/') ? this.server : "".concat(this.server, "/");
|
|
21
|
+
this.req = axios.create({
|
|
22
|
+
baseURL: this.server,
|
|
23
|
+
headers: {
|
|
24
|
+
Authorization: 'Token ' + this.accessToken
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
key: "listRows",
|
|
31
|
+
value: function listRows(page_id, table_name, start, limit) {
|
|
32
|
+
var url = "".concat(this.server, "api/v2.1/universal-apps/").concat(this.appUuid, "/html-page-rows/");
|
|
33
|
+
var params = {
|
|
34
|
+
page_id: page_id,
|
|
35
|
+
table_name: table_name,
|
|
36
|
+
start: start,
|
|
37
|
+
limit: limit
|
|
38
|
+
};
|
|
39
|
+
return this.req.get(url, {
|
|
40
|
+
params: params
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
key: "addRow",
|
|
45
|
+
value: function addRow(page_id, table_name, row_data, row_links_data) {
|
|
46
|
+
var url = "".concat(this.server, "api/v2.1/universal-apps/").concat(this.appUuid, "/html-page-rows/");
|
|
47
|
+
var data = {
|
|
48
|
+
page_id: page_id,
|
|
49
|
+
table_name: table_name,
|
|
50
|
+
row_data: row_data,
|
|
51
|
+
row_links_data: row_links_data
|
|
52
|
+
};
|
|
53
|
+
return this.req.post(url, data);
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "addRows",
|
|
57
|
+
value: function addRows(page_id, table_name, rows_data, rows_links_data) {
|
|
58
|
+
var url = "".concat(this.server, "api/v2.1/universal-apps/").concat(this.appUuid, "/html-page-rows/batch/");
|
|
59
|
+
var data = {
|
|
60
|
+
page_id: page_id,
|
|
61
|
+
table_name: table_name,
|
|
62
|
+
rows_data: rows_data,
|
|
63
|
+
rows_links_data: rows_links_data
|
|
64
|
+
};
|
|
65
|
+
return this.req.post(url, data);
|
|
66
|
+
}
|
|
67
|
+
}, {
|
|
68
|
+
key: "updateRows",
|
|
69
|
+
value: function updateRows(page_id, table_name, rows_data) {
|
|
70
|
+
var url = "".concat(this.server, "api/v2.1/universal-apps/").concat(this.appUuid, "/html-page-rows/");
|
|
71
|
+
var data = {
|
|
72
|
+
page_id: page_id,
|
|
73
|
+
table_name: table_name,
|
|
74
|
+
rows_data: rows_data
|
|
75
|
+
};
|
|
76
|
+
return this.req.put(url, data);
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
key: "deleteRows",
|
|
80
|
+
value: function deleteRows(page_id, table_name, rows_ids) {
|
|
81
|
+
var url = "".concat(this.server, "api/v2.1/universal-apps/").concat(this.appUuid, "/html-page-rows/");
|
|
82
|
+
var data = {
|
|
83
|
+
page_id: page_id,
|
|
84
|
+
table_name: table_name,
|
|
85
|
+
rows_ids: rows_ids
|
|
86
|
+
};
|
|
87
|
+
return this.req["delete"](url, data);
|
|
88
|
+
}
|
|
89
|
+
}]);
|
|
90
|
+
}();
|
|
91
|
+
|
|
92
|
+
export { UniversalAppAPI as default };
|