next-box 2.5.5 → 2.5.6

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.
@@ -8,7 +8,9 @@ export * from './translite';
8
8
  export * from './get-global';
9
9
  export * from './is-browser';
10
10
  export * from './is-object';
11
+ export * from './is-string';
11
12
  export * from './notificate-request-error';
13
+ export * from './safe-json';
12
14
  export * from './get-config-data';
13
15
  export * from './transport-props';
14
16
  export * from './browser-navigate';
@@ -0,0 +1 @@
1
+ export declare function isString(value: any): boolean;
@@ -0,0 +1 @@
1
+ export declare function safeJson<T>(value: string, defaultValue?: T): any;
@@ -16,3 +16,6 @@ export interface TransportParams {
16
16
  port?: number;
17
17
  debug?: boolean;
18
18
  }
19
+ export interface TransportParentHandlersInterface {
20
+ updateToken?: () => Promise<any>;
21
+ }
@@ -1,11 +1,12 @@
1
1
  import { TransportEvent, TransportNavigationTarget, TransportPayload, TransportPayloadConfirm, TransportPayloadContextItem, TransportPayloadContextTab, TransportPayloadModalFilesSelect, TransportPayloadNavigate, TransportPayloadSpinner, TransportPayloadToast } from '../types/transport';
2
2
  import { EventEmitter } from '../classes/event-emitter';
3
- import { TransportParams } from './interface';
3
+ import { TransportParams, TransportParentHandlersInterface } from './interface';
4
4
  export declare enum EngineType {
5
5
  WebSocket = "websocket",
6
6
  PostMessage = "postmessage",
7
7
  Empty = ""
8
8
  }
9
+ export declare const TransportParentHandlers: TransportParentHandlersInterface;
9
10
  export declare class NBTransport extends EventEmitter {
10
11
  private engine;
11
12
  private _params?;
package/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["next-box"]=t():e["next-box"]=t()}(globalThis,(()=>(()=>{var e={11:e=>{var t;globalThis,t=()=>(()=>{"use strict";var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",o=0,i=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(i===s-1||1===a);else if(i!==s-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),i=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),o=s-i-1;i=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var e,n="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a;i>=0?a=arguments[i]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(n=a+"/"+n,o=47===a.charCodeAt(0))}return n=r(n,!o),o?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&o&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var o=arguments[r];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,a=i-o,s=1;s<r.length&&47===r.charCodeAt(s);++s);for(var c=r.length-s,p=a<c?a:c,u=-1,l=0;l<=p;++l){if(l===p){if(c>p){if(47===r.charCodeAt(s+l))return r.slice(s+l+1);if(0===l)return r.slice(s+l)}else a>p&&(47===e.charCodeAt(o+l)?u=l:0===l&&(u=0));break}var d=e.charCodeAt(o+l);if(d!==r.charCodeAt(s+l))break;47===d&&(u=l)}var f="";for(l=o+u+1;l<=i;++l)l!==i&&47!==e.charCodeAt(l)||(0===f.length?f+="..":f+="/..");return f.length>0?f+r.slice(s+u):(s+=u,47===r.charCodeAt(s)&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,o=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(r=e.charCodeAt(a))){if(!i){o=a;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,o=0,i=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var s=r.length-1,c=-1;for(n=e.length-1;n>=0;--n){var p=e.charCodeAt(n);if(47===p){if(!a){o=n+1;break}}else-1===c&&(a=!1,c=n+1),s>=0&&(p===r.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){o=n+1;break}}else-1===i&&(a=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var r=-1,n=0,o=-1,i=!0,a=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===o&&(i=!1,o=s+1),46===c?-1===r?r=s:1!==a&&(a=1):-1!==r&&(a=-1);else if(!i){n=s+1;break}}return-1===r||-1===o||0===a||1===a&&r===o-1&&r===n+1?"":e.slice(r,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,o=e.charCodeAt(0),i=47===o;i?(r.root="/",n=1):n=0;for(var a=-1,s=0,c=-1,p=!0,u=e.length-1,l=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(p=!1,c=u+1),46===o?-1===a?a=u:1!==l&&(l=1):-1!==a&&(l=-1);else if(!p){s=u+1;break}return-1===a||-1===c||0===l||1===l&&a===c-1&&a===s+1?-1!==c&&(r.base=r.name=0===s&&i?e.slice(1,c):e.slice(s,c)):(0===s&&i?(r.name=e.slice(1,a),r.base=e.slice(1,c)):(r.name=e.slice(s,a),r.base=e.slice(s,c)),r.ext=e.slice(a,c)),s>0?r.dir=e.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},181:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(481),t),o(r(861),t)},481:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.StaticApi=void 0;var a=r(892),s=r(392),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.upload=function(e,t,r){void 0===r&&(r="");var n=new FormData;return n.set("file",e),(0,s.sendRequest)(this.makeApiPath(r,t),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:n}).then((function(e){return e.json()}))},t.prototype.get=function(e){return(0,s.sendRequest)(this.makeApiPath(e),{method:"GET"})},t.prototype.delete=function(e){return(0,s.sendRequest)(this.makeApiPath(e),{method:"DELETE"}).catch((function(e){return e}))},t.prototype.makeApiPath=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.makeApiPath.apply(this,i(["static/files"],t,!1))},t}(a.Api);t.StaticApi=c},861:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageApi=void 0;var a=r(307),s=r(892),c=r(566),p=r(392),u=r(299),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.info=function(e){return(0,p.sendRequest)(this.makeApiPath("/element")+this.makeSearchParams({path:e}),{headers:this.makeHeaders(),method:"GET",cache:"no-cache"}).then(this.responseJSON)},t.prototype.create=function(e,t,r){return(0,p.sendRequest)(this.makeApiPath("/element"),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:JSON.stringify({name:e,path:this.relativePath(t),type:r,divide_id:this.state.api.query.divide_id||null})}).then(this.responseJSON)},t.prototype.delete=function(e,t){return(0,p.sendRequest)(this.makeApiPath("/element")+this.makeSearchParams({path:e,hard:t}),{method:"DELETE",headers:this.makeHeaders()})},t.prototype.makeDownloadPath=function(e){return this.makeApiPath("/files")+this.makeSearchParams({path:this.relativePath(e,this.state.storage.path),t:Date.now()})},t.prototype.download=function(e){return(0,p.sendRequest)(this.makeApiPath("/files")+this.makeSearchParams({path:this.relativePath(e,this.state.storage.path),t:Date.now()}),{headers:this.makeHeaders(),method:"GET",cache:"no-cache"})},t.prototype.replace=function(e,t){return(0,p.sendRequest)(this.makeApiPath("/files")+this.makeSearchParams({path:this.relativePath(t,this.state.storage.path)}),{cache:"no-cache",method:"PUT",body:e,headers:this.makeHeaders()}).then(this.responseJSON)},t.prototype.upload=function(e,t){var r=new FormData;return r.set("path",this.relativePath(e)),r.set("file",t),(0,p.sendRequest)(this.makeApiPath("/files"),{method:"POST",body:r,headers:this.makeHeaders()}).then(this.responseJSON)},t.prototype.uploadNet=function(e,t,r){return void 0===r&&(r=!1),(0,p.sendRequest)(this.makeApiPath("/files/net"),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:JSON.stringify({url:t,overwrite:r,path:this.relativePath(e)})}).then(this.responseJSON)},t.prototype.createMeta=function(e,t){return this.create(e||this.metaName,t||"","file")},t.prototype.readMeta=function(e){return this.download(e||this.metaName)},t.prototype.saveMeta=function(e,t){return this.replace(e,t||this.metaName)},t.prototype.relativePath=function(e,t){return!e&&t?t||"":(0,a.pathJoin)(this.state.storage.info.dir||"",e||"")},t.prototype.makeApiPath=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n="storage";return"fca"===this.state.storage.root&&(n="disk/".concat(this.state.storage.rootID)),e.prototype.makeApiPath.apply(this,i([n],t,!1))},Object.defineProperty(t.prototype,"metaName",{get:function(){return"."+(0,u.translite)((0,c.getLang)(this.state.extenstion.name))},enumerable:!1,configurable:!0}),t}(s.Api);t.StorageApi=l},892:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Api=void 0;var i=r(462),a=r(755),s=function(){function e(e){void 0===e&&(e=(0,a.defaultState)()),this.changeState(e)}return e.prototype.changeState=function(e){this.state=e},e.prototype.makeSearchParams=function(e){return e=n(n({},this.state.api.query),e),"?"+new URLSearchParams(e)},e.prototype.makeHeaders=function(e){return n(n({},e),this.state.api.headers)},e.prototype.responseJSON=function(e){return e.status>=200&&e.status<400?e.json():Promise.resolve({error:"Parse error"})},e.prototype.makeApiPath=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new URL(decodeURI(i.pathJoin.apply(void 0,o([this.state.api.prefix],e,!1))),this.state.api.host)},e}();t.Api=s},970:function(e,t){var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter=void 0;var n=function(){function e(){this._handlers=new Map,this._globalHandlers=new Set}return e.prototype.listen=function(e){this._globalHandlers.add(e)},e.prototype.on=function(e,t){var r;this._handlers.has(e)||this._handlers.set(e,new Set),null===(r=this._handlers.get(e))||void 0===r||r.add(t)},e.prototype.off=function(e,t){var r;null===(r=this._handlers.get(e))||void 0===r||r.delete(t)},e.prototype.emit=function(e){for(var t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];null===(t=this._handlers.get(e))||void 0===t||t.forEach((function(e){e&&e.apply(void 0,n)})),this._globalHandlers.forEach((function(t){t.apply(void 0,r([e],n,!1))}))},e}();t.EventEmitter=n},534:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(892),t),o(r(970),t)},755:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0;var n=r(796);t.defaultState=function(){return{extenstion:{id:0,name:{},type:n.ExtensionType.File},api:{host:window.location.origin,prefix:"/api/v1",headers:{},query:{}},debug:!0,view:n.ViewState.view,brouserURL:"",storage:{root:n.StorageRoot.my,rootID:0,path:"",info:{base:"",dir:"",ext:"",name:"",root:""}}}}},223:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dirname=void 0;var n=r(470).sep,o=r(307);t.dirname=function(e){if(0===(e=(0,o.pathJoin)(n,e)).length)return".";for(var t=e.charCodeAt(0),r=47===t,i=-1,a=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!a){i=s;break}}else a=!1;return-1===i?r?n:".":r&&1===i?n+n:e.slice(0,i)}},572:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fileInfo=void 0;var n=r(470).sep,o=r(307);t.fileInfo=function(e){var t={root:"",dir:"",base:"",ext:"",name:""};if(0===(e=(0,o.pathJoin)(n,e)).length)return t;var r,i=e.charCodeAt(0),a=47===i;a?(t.root=n,r=1):r=0;for(var s=-1,c=0,p=-1,u=!0,l=e.length-1,d=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===p&&(u=!1,p=l+1),46===i?-1===s?s=l:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){c=l+1;break}return-1===s||-1===p||0===d||1===d&&s===p-1&&s===c+1?-1!==p&&(t.base=t.name=0===c&&a?e.slice(1,p):e.slice(c,p)):(0===c&&a?(t.name=e.slice(1,s),t.base=e.slice(1,p)):(t.name=e.slice(c,s),t.base=e.slice(c,p)),t.ext=e.slice(s,p)),c>0?t.dir=e.slice(0,c-1):a&&(t.dir=n),t}},424:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobal=void 0;var n=r(837);t.getGlobal=function(){return(0,n.isBrowser)()?window:r.g}},566:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getLang=void 0,t.getLang=function(e,t){if(void 0===t&&(t="ru"),e[t])return e[t];var r=Object.keys(e).pop();return r&&e[r]?e[r]:""}},462:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(223),t),o(r(572),t),o(r(566),t),o(r(719),t),o(r(307),t),o(r(392),t),o(r(299),t),o(r(424),t),o(r(837),t)},837:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0,t.isBrowser=function(){return"undefined"!=typeof window}},719:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parentURL=void 0,t.parentURL=function(){return new URL(window.location!=window.parent.location?document.referrer:document.location.href)}},307:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.pathJoin=void 0;var n=r(470).sep;t.pathJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=[],o=0,i=e.length;o<i;o++)r=r.concat(e[o].split(n));var a=[];for(o=0,i=r.length;o<i;o++){var s=r[o];s&&"."!==s&&(".."===s?a.pop():a.push(s))}return""===r[0]&&a.unshift(""),a.join(n)||(a.length?n:".")}},392:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sendRequest=void 0;var n=r(831),o=r(512);t.sendRequest=function(e,t){return fetch(e,t).then((function(e){return parent!==window&&e.status>=400&&n.Transport.send(o.TransportEvent.ExtRequestError,e),e}))}},299:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.translite=void 0;var r={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"cz",ш:"sh",щ:"scz",ы:"y",ь:"",э:"e",ю:"u",я:"ja"," ":"-"};t.translite=function(e){return(e=(e=(e=(e=(e=e.toLocaleLowerCase()).trim()).replace(/ -/gi,"-")).replace(/- /gi,"-")).replace(/\s{2,}/gi," ")).split("").map((function(e){return/[a-z0-9]/i.test(e)?e:r[e]||""})).join("")}},858:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.transportProps=void 0,t.transportProps=function(){try{return JSON.parse(window.name||"")}catch(e){return{}}}},495:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.NextBox=void 0;var i=r(970),a=r(755),s=r(831),c=r(512),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.init=function(e){var t=this,r=function(e){return t.state=e};if(!s.Transport.engineType){var n=(0,a.defaultState)();r(n),e&&e(n)}s.Transport.on(c.TransportEvent.AppReady,(function(t){r(t),e&&e(t)})),s.Transport.on(c.TransportEvent.AppReload,(function(){window.location.reload()})),s.Transport.on(c.TransportEvent.AppChangeState,r),s.Transport.send(c.TransportEvent.ExtInit)},t}(i.EventEmitter);t.NextBox=p},185:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransportEmpty=void 0;var r=function(){function e(){}return e.prototype.send=function(e,t){},e.prototype.subscribe=function(e){},e}();t.TransportEmpty=r},176:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(595),t),o(r(831),t)},595:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},521:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransportPostMessage=void 0;var r=function(){function e(){}return e.prototype.send=function(e,t){if(parent!==window){var r=new URL(window.location!=window.parent.location?document.referrer:document.location.href);parent.postMessage({event:e,payload:t},r.origin)}},e.prototype.subscribe=function(e){window.addEventListener("message",(function(t){var r=t.data.event,n=t.data.payload;e(r,n)}))},e}();t.TransportPostMessage=r},831:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=t.NBTransport=t.EngineType=void 0;var i,a=r(512),s=r(970),c=r(521),p=r(424),u=r(742),l=r(185),d=r(858);!function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(i=t.EngineType||(t.EngineType={}));var f=function(e){function r(t){var r=e.call(this)||this;r.engineType=i.Empty,r.debug=!1;var n=(0,d.transportProps)();return r.engineType=t||n.engine||i.Empty,r.engine=new l.TransportEmpty,r.engineType===i.PostMessage&&(r.engine=new c.TransportPostMessage),r.engineType===i.WebSocket&&(r.engine=new u.TransportWebsocket),r}return o(r,e),r.prototype.send=function(e,t){this.engine.send(e,JSON.stringify(t||{}))},r.prototype.subscribe=function(){var e=this;this.engine.subscribe((function(t,r){t&&(e.debug&&console.log("frame.message",t,r),e.emit(t,r))}))},r.prototype.changeContent=function(e){t.Transport.send(a.TransportEvent.ExtChangeContent,e)},r.prototype.navigate=function(e,r){t.Transport.send(a.TransportEvent.ExtNavigateTo,{path:e,queryParams:r})},r.prototype.close=function(){t.Transport.send(a.TransportEvent.ExtClose)},r.prototype.openModalFilesSelect=function(e){t.Transport.send(a.TransportEvent.ExtOpenModalFilesSelect,e)},r.prototype.openModalConfirm=function(e){t.Transport.send(a.TransportEvent.ExtShowConfirm,e)},r}(s.EventEmitter);t.NBTransport=f;var h=(0,p.getGlobal)();h._nb_transport instanceof f||(h._nb_transport=new f,h._nb_transport.subscribe()),t.Transport=h._nb_transport},742:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransportWebsocket=void 0;var n=r(858),o=Symbol("transport-socket"),i=function(){function e(){window[o]||this.init()}return e.prototype.init=function(){var e=(0,n.transportProps)(),t=e.host||"localhost",r=e.port||8999;window[o]=new WebSocket("ws://".concat(t,":").concat(r)),window[o].onopen=function(){},window[o].onclose=function(e){e.wasClean?console.log("Соединение закрыто"):console.log("Обрыв соединения"),console.log("Код: "+e.code+" причина: "+e.reason)},window[o].onerror=function(e){console.log("Ошибка подключения ws: "+e.message)}},e.prototype.send=function(e,t){var r=this;window[o].readyState?window[o].send(JSON.stringify({event:e,payload:t})):setTimeout((function(){r.send(e,t)}),100)},e.prototype.subscribe=function(e){window[o].onmessage=function(t){try{var r=JSON.parse(t.data),n=r.event,o=r.payload;e(n,o)}catch(e){}}},e}();t.TransportWebsocket=i},85:(e,t)=>{var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionFileMode=t.ExtensionType=void 0,(n=t.ExtensionType||(t.ExtensionType={})).App="app",n.File="file",n.WorkDir="work_dir",(r=t.ExtensionFileMode||(t.ExtensionFileMode={})).Read="read",r.Write="write",r.ReadAndWrite="read_and_write"},745:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},796:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(85),t),o(r(492),t),o(r(517),t),o(r(512),t),o(r(745),t),o(r(548),t)},492:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ViewState=void 0,(r=t.ViewState||(t.ViewState={})).view="view",r.edit="edit"},517:(e,t)=>{var r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.StorageElementContentType=t.StorageElementType=t.StorageRoot=void 0,(o=t.StorageRoot||(t.StorageRoot={})).my="my",o.fca="fca",o.divide="divide",o.share="share",o.favorite="favorite",(n=t.StorageElementType||(t.StorageElementType={})).Dir="dir",n.File="file",n.WorkDir="work_dir",(r=t.StorageElementContentType||(t.StorageElementContentType={})).Any="any",r.Dir="dir",r.Code="code",r.Image="image",r.Audio="audio",r.Video="video",r.Text="text",r.Doc="doc",r.Xls="xls",r.Ppt="ppt"},512:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TransportEvent=void 0,(r=t.TransportEvent||(t.TransportEvent={})).ExtInit="ext-init",r.ExtChangeContent="ext-change-content",r.ExtOpenModalFilesSelect="ext-open-modal-files-select",r.ExtShowConfirm="ext-show-confirm",r.ExtNavigateTo="ext-navigate-to",r.ExtRequestError="ext-request-error",r.ExtClose="ext-close",r.AppReload="ext-reload",r.AppReady="app-ready",r.AppChangeState="app-change-state",r.AppSaveAndClose="app-save-and-close",r.AppFilesSelected="app-files-selected",r.AppConfirmAccept="app-confirm-accept",r.AppConfirmReject="app-confirm-reject"},548:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SystemUserRole=void 0,(r=t.SystemUserRole||(t.SystemUserRole={})).ADMIN="admin",r.USER="user"},607:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(495),t),o(r(796),t),o(r(176),t),o(r(462),t),o(r(534),t),o(r(181),t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(607)})(),e.exports=t()},470:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",o=0,i=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(i===s-1||1===a);else if(i!==s-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),i=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),o=s-i-1;i=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var e,n="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a;i>=0?a=arguments[i]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(n=a+"/"+n,o=47===a.charCodeAt(0))}return n=r(n,!o),o?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&o&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var o=arguments[r];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,a=i-o,s=1;s<r.length&&47===r.charCodeAt(s);++s);for(var c=r.length-s,p=a<c?a:c,u=-1,l=0;l<=p;++l){if(l===p){if(c>p){if(47===r.charCodeAt(s+l))return r.slice(s+l+1);if(0===l)return r.slice(s+l)}else a>p&&(47===e.charCodeAt(o+l)?u=l:0===l&&(u=0));break}var d=e.charCodeAt(o+l);if(d!==r.charCodeAt(s+l))break;47===d&&(u=l)}var f="";for(l=o+u+1;l<=i;++l)l!==i&&47!==e.charCodeAt(l)||(0===f.length?f+="..":f+="/..");return f.length>0?f+r.slice(s+u):(s+=u,47===r.charCodeAt(s)&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,o=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(r=e.charCodeAt(a))){if(!i){o=a;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,o=0,i=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var s=r.length-1,c=-1;for(n=e.length-1;n>=0;--n){var p=e.charCodeAt(n);if(47===p){if(!a){o=n+1;break}}else-1===c&&(a=!1,c=n+1),s>=0&&(p===r.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){o=n+1;break}}else-1===i&&(a=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var r=-1,n=0,o=-1,i=!0,a=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===o&&(i=!1,o=s+1),46===c?-1===r?r=s:1!==a&&(a=1):-1!==r&&(a=-1);else if(!i){n=s+1;break}}return-1===r||-1===o||0===a||1===a&&r===o-1&&r===n+1?"":e.slice(r,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,o=e.charCodeAt(0),i=47===o;i?(r.root="/",n=1):n=0;for(var a=-1,s=0,c=-1,p=!0,u=e.length-1,l=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(p=!1,c=u+1),46===o?-1===a?a=u:1!==l&&(l=1):-1!==a&&(l=-1);else if(!p){s=u+1;break}return-1===a||-1===c||0===l||1===l&&a===c-1&&a===s+1?-1!==c&&(r.base=r.name=0===s&&i?e.slice(1,c):e.slice(s,c)):(0===s&&i?(r.name=e.slice(1,a),r.base=e.slice(1,c)):(r.name=e.slice(s,a),r.base=e.slice(s,c)),r.ext=e.slice(a,c)),s>0?r.dir=e.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},181:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(513),t),o(r(481),t),o(r(861),t),o(r(453),t)},481:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.StaticApi=void 0;var a=r(892),s=r(392),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.upload=function(e,t,r){void 0===r&&(r="");var n=new FormData;return n.set("file",e,t),(0,s.sendRequest)(this.makeApiPath(r),{method:"POST",body:n}).then((function(e){return e.json()}))},t.prototype.get=function(e){return(0,s.sendRequest)(this.makeApiPath(e),{method:"GET"})},t.prototype.delete=function(e){return(0,s.sendRequest)(this.makeApiPath(e),{method:"DELETE"}).catch((function(e){return e}))},t.prototype.makeApiPath=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.makeApiPath.apply(this,i(["static/files"],t,!1))},t}(a.Api);t.StaticApi=c},861:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageApi=void 0;var s=r(307),c=r(892),p=r(566),u=r(392),l=r(299),d=r(796),f=r(831),h=new Map,v=function(e,t){return function(r){return f.Transport.send(e,t),r}},y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.list=function(e){return e.path&&(e.path=this.relativePath(e.path)),this.rest.get("/storage",e)},t.prototype.info=function(e){return this.rest.get("/storage/element",{path:e})},t.prototype.create=function(e,t,r,n){var o=i(i({is_work_dir:this.state.extenstion.type===d.ExtensionType.WorkDir},n),{name:e,path:this.relativePath(t),type:r,divide_id:this.state.api.query.divide_id||null});return(0,u.sendRequest)(this.makeApiPath("/element"),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:JSON.stringify(o)}).then(this.responseJSON)},t.prototype.delete=function(e,t){return(0,u.sendRequest)(this.makeApiPath("/element")+this.makeSearchParams({path:e,hard:t}),{method:"DELETE",headers:this.makeHeaders()})},t.prototype.makeDownloadPath=function(e,t){var r=i({},t),n={path:e,with_preview:!1};return r.cache||(n.t=Date.now()),r.imagePreview&&(n.with_preview=!0),this.makeApiPath("/files")+this.makeSearchParams(n)},t.prototype.makeImagePreview=function(e,t){return this.makeDownloadPath(e,i(i({},t),{imagePreview:!0}))},t.prototype.download=function(e){return(0,u.sendRequest2)("GET",this.makeApiPath("/files")+this.makeSearchParams({path:this.relativePath(e,this.state.storage.path),t:Date.now()}),{headers:this.makeHeaders(),cache:"no-cache"})},t.prototype.replace=function(e,t){var r=t||this.state.storage.path;return f.Transport.send(d.TransportEvent.ExtSavedStart,r),(0,u.sendRequest2)("PUT",this.makeApiPath("/files")+this.makeSearchParams({path:this.relativePath(t,this.state.storage.path)}),{cache:"no-cache",body:e,headers:this.makeHeaders()}).then(v(d.TransportEvent.ExtSavedEnd,r)).catch(v(d.TransportEvent.ExtSavedError,r))},t.prototype.liveReplace=function(e,t,r){var n=this,o=[this.state.storage.root,this.state.storage.rootID,this.relativePath(t,this.state.storage.path)].join("-"),i=h.get(o);i||(i={status:d.RequestStatus.Done,requests:[]},h.set(o,i)),i.requests.push({path:t,body:e});var a=function(){if(i&&i.status!==d.RequestStatus.Wait){var e=i.requests.pop();i.requests=[],e?(i.status=d.RequestStatus.Wait,n.replace(e.body,e.path).then((function(e){return i.status=d.RequestStatus.Done,a(),e})).catch((function(e){return i.status=d.RequestStatus.Reject,a(),e}))):r&&r()}};a()},t.prototype.upload=function(e,t){var r=new FormData;return r.set("path",this.relativePath(e)),r.set("file",t),f.Transport.send(d.TransportEvent.ExtSavedStart,e),(0,u.sendRequest)(this.makeApiPath("/files"),{method:"POST",body:r,headers:this.makeHeaders()}).then(v(d.TransportEvent.ExtSavedEnd,e)).catch(v(d.TransportEvent.ExtSavedError,e)).then(this.responseJSON,this.responseJSON)},t.prototype.uploadNet=function(e,t,r){return void 0===r&&(r=!1),f.Transport.send(d.TransportEvent.ExtSavedStart,e),(0,u.sendRequest)(this.makeApiPath("/files/net"),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:JSON.stringify({url:t,overwrite:r,path:this.relativePath(e)})}).then(v(d.TransportEvent.ExtSavedEnd,e)).catch(v(d.TransportEvent.ExtSavedError,e)).then(this.responseJSON)},t.prototype.createMeta=function(e,t,r){return this.create(e||this.metaName,t||"","file",r)},t.prototype.readMeta=function(e){return this.download(e||this.metaName)},t.prototype.saveMeta=function(e,t){return this.replace(e,t||this.metaName)},t.prototype.relativePath=function(e,t){return!e&&t?t||"":(0,s.pathJoin)(this.state.storage.info.dir||"",e||"")},t.prototype.makeApiPath=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n="storage";return"fca"===this.state.storage.root&&(n="disk/".concat(this.state.storage.rootID)),e.prototype.makeApiPath.apply(this,a([n],t,!1))},Object.defineProperty(t.prototype,"metaName",{get:function(){return"."+(0,l.translite)((0,p.getLang)(this.state.extenstion.name))},enumerable:!1,configurable:!0}),t}(c.Api);t.StorageApi=y},513:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.OrderDirection=void 0,(r=t.OrderDirection||(t.OrderDirection={})).DEFAULT="",r.ASC="asc",r.DESC="desc"},453:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.UserApi=void 0;var i=r(892),a="/users",s="/users/me",c="".concat(s,"/avatars"),p="".concat(s,"/sessions"),u="".concat(s,"/tokens"),l="".concat(a,"/change-password"),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.logout=function(){return this.rest.get("/logout")},t.prototype.get=function(e){return this.rest.get("".concat(a,"/").concat(e))},t.prototype.list=function(e){return this.rest.get(a,e)},t.prototype.restore=function(e){return this.rest.post("".concat(a,"/").concat(e,"/restore"))},t.prototype.delete=function(e,t){return this.rest.delete("".concat(a,"/").concat(e),t)},t.prototype.update=function(e){return this.rest.put(a+"/".concat(e.id),e)},t.prototype.create=function(e){return this.rest.post(a,e)},t.prototype.createToken=function(e){return this.rest.post(u,e)},t.prototype.listToken=function(e){return this.rest.get(u,e)},t.prototype.deleteToken=function(e){return this.rest.delete("".concat(u,"/").concat(e))},t.prototype.changePassword=function(e){return this.rest.post(l,e)},t.prototype.me=function(){return this.rest.get(s)},t.prototype.meUploadAvatar=function(e,t){var r=new FormData;return r.append("file",e,t),this.rest.post(c,r)},t.prototype.meDeleteAvatar=function(){return this.rest.delete(c)},t.prototype.meListSession=function(e){return this.rest.get(p,e)},t.prototype.meDeleteSession=function(e){var t=p;return e&&(t+="/".concat(e)),this.rest.delete(t)},t}(i.Api);t.UserApi=d},892:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Api=void 0;var i=r(462),a=r(755),s=function(){function e(e){void 0===e&&(e=(0,a.defaultState)());var t=this;this.rest={get:function(e,r){return(0,i.sendRequest2)("GET",e,{prefix:t.state.api.prefix,host:t.state.api.host,headers:t.state.api.headers,params:n(n({},t.state.api.query),r),cache:"no-cache"})},post:function(e,r){return(0,i.sendRequest2)("POST",e,{prefix:t.state.api.prefix,host:t.state.api.host,headers:t.state.api.headers,params:n({},t.state.api.query),body:r})},put:function(e,r){return(0,i.sendRequest2)("PUT",e,{prefix:t.state.api.prefix,host:t.state.api.host,headers:t.state.api.headers,params:n({},t.state.api.query),cache:"no-cache",body:r})},delete:function(e,r){return(0,i.sendRequest2)("PUT",e,{prefix:t.state.api.prefix,host:t.state.api.host,headers:t.state.api.headers,params:n(n({},t.state.api.query),r)})}},this.changeState(e)}return e.prototype.changeState=function(e){this.state=e},e.prototype.makeSearchParams=function(e){return e?(e=n(n({},this.state.api.query),e),"?"+new URLSearchParams(e)):""},e.prototype.makeHeaders=function(e){return n(n({},e),this.state.api.headers)},e.prototype.responseJSON=function(e){return e.status>=200&&e.status<400?e.json():Promise.resolve({error:"Parse error"})},e.prototype.makeApiPath=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new URL(decodeURI(i.pathJoin.apply(void 0,o([this.state.api.prefix],e,!1))),this.state.api.host)},e}();t.Api=s},970:function(e,t){"use strict";var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter=void 0;var n=function(){function e(){this._handlers=new Map,this._globalHandlers=new Set}return e.prototype.listen=function(e){this._globalHandlers.add(e)},e.prototype.on=function(e,t){var r;this._handlers.has(e)||this._handlers.set(e,new Set),null===(r=this._handlers.get(e))||void 0===r||r.add(t)},e.prototype.off=function(e,t){var r;null===(r=this._handlers.get(e))||void 0===r||r.delete(t)},e.prototype.emit=function(e){for(var t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];null===(t=this._handlers.get(e))||void 0===t||t.forEach((function(e){e&&e.apply(void 0,n)})),this._globalHandlers.forEach((function(t){t.apply(void 0,r([e],n,!1))}))},e}();t.EventEmitter=n},864:function(e,t,r){"use strict";var n,o,i,a=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.FileEngine=void 0;var s=r(181),c=r(462),p=r(755),u=r(892),l=Symbol("VERSION"),d=Symbol("CONFIG"),f=Symbol("API"),h=Symbol("UPGRADE"),v=function(e){function t(t,r,n){void 0===n&&(n=(0,p.defaultState)());var a=e.call(this,n)||this;return a[o]=0,a[i]=new Map,a[l]=t,a[d]=r,a[f]=new s.StorageApi,a[f].changeState(n),a}return a(t,e),Object.defineProperty(t.prototype,"name",{get:function(){var e;return(null===(e=this[d])||void 0===e?void 0:e.name)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){var e;return(null===(e=this[d])||void 0===e?void 0:e.path)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullName",{get:function(){return(0,c.pathJoin)(this.path,this.name)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this[l]},enumerable:!1,configurable:!0}),t.prototype.changeState=function(t){var r;e.prototype.changeState.call(this,t),null===(r=this[f])||void 0===r||r.changeState(t)},t.prototype.migration=function(e,t){if(this[h].has(e))throw"Upgrader migration version ".concat(e," exist");this[h].set(e,t)},t.prototype.info=function(){return this[f].info(this.fullName)},t.prototype.download=function(){var e=this;return this[f].download().then((function(t){var r={},n=0;return(0,c.isObject)(t)&&(r=t.body||t||{},n=t.version||-1),e.runMigrate(n,r)}))},t.prototype.create=function(e,t){var r=this;return this[f].create(this.name,this.path,"file",t).then((function(){return r.replace(e)}))},t.prototype.delete=function(e){return this[f].delete(this.fullName,e)},t.prototype.replace=function(e){return this[f].replace({version:this.version,body:e})},t.prototype.liveReplace=function(e,t){return this[f].liveReplace({version:this.version,body:e})},t.prototype.runMigrate=function(e,t){var r=this,n=Array.from(this[h].keys()).sort(),o=n[n.length-1]||0;return new Promise((function(i,a){var s=t;e<o&&n.forEach((function(t){if(t>e){var n=r[h].get(t);n&&(s=n(s))}})),i(s)}))},t}(u.Api);t.FileEngine=v,o=l,i=h},534:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(892),t),o(r(864),t),o(r(970),t)},455:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(844),t)},844:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.defineNbFrameComponent=void 0;var a=r(534),s=r(462),c=r(176),p=r(796),u=Symbol("ROOT"),l=Symbol("FRAME"),d=Symbol("TRANSPORT"),f=Symbol("EVENT_EMITTER");t.defineNbFrameComponent=function(){return customElements.define("nb-frame",h)};var h=function(e){function t(){var t=e.call(this)||this;return t.apiPrefix="/api/v1",t.origin=window.location.origin,t.version=1,t.view=p.ViewState.view,t.debug=!1,t.uuid=window.crypto.randomUUID(),t[r]=new a.EventEmitter,t}var r;return o(t,e),t.prototype.connectedCallback=function(){this[u]=this.attachShadow({mode:"open"})},t.prototype.disconnectedCallback=function(){var e;null===(e=this[d])||void 0===e||e.destroy()},t.prototype.send=function(e,t){var r;null===(r=this[d])||void 0===r||r.send(e,t)},t.prototype.listen=function(e){this[f].listen(e)},t.prototype.off=function(e,t){this[f].off(e,t)},t.prototype.on=function(e,t){this[f].on(e,t)},t.prototype.makeByModel=function(e,t){var r=e.type,n=e.file,o=e.work_dir,i=e.app,a=e.devlocal,s=e.path,c="";return r===p.ExtensionType.File&&(c=n.index),r===p.ExtensionType.WorkDir&&(c=o.index),r===p.ExtensionType.App&&(c=i.menu.index),c=a?c:"".concat(this.apiPrefix,"/extensions/static/").concat(s,"/").concat(c),this.make(c,t)},t.prototype.make=function(e,t){var r,n,o=this;t=this.mergeParams(t);var i=document.createElement("iframe");i.setAttribute("allowfullscreen",""),i.name=JSON.stringify(t),i.src=e;var a=this.resetTransport(t);return this[l]=i,this[u]&&(this[u].innerHTML=""),null===(r=this[u])||void 0===r||r.appendChild(this.frameStyle),null===(n=this[u])||void 0===n||n.appendChild(this[l]),a.listen((function(e,t,r){r&&r!==o.uuid||o[f].emit(e,t)})),a},t.prototype.openElement=function(e,t,r,n){var o=(0,s.fileInfo)(e.path||"");t.type===p.ExtensionType.WorkDir&&(o.dir=(0,s.pathJoin)(o.dir,o.base),o.base="",o.name="");var i={},a={};e.root===p.StorageRoot.divide&&(i.divide_id=Number(e.rootId),o.dir=(0,s.pathJoin)("/",e.path||""),e.divideDir||(o.dir="/")),e.root===p.StorageRoot.fca&&(i.disk_id=Number(e.rootId)),e.root===p.StorageRoot.share&&(i.share_token=e.share_token,a.Authorization="Sharing ".concat(e.share_token),e.share_password&&(i.share_pass=e.share_password),a.SharePass=e.share_password);var c={debug:!!this.debug,view:this.view,extenstion:{id:(null==t?void 0:t.id)||0,name:(null==t?void 0:t.name)||{ru:""},type:(null==t?void 0:t.type)||p.ExtensionType.File},api:{host:this.origin,prefix:this.apiPrefix,headers:a,query:i},user:r,storage:{info:o,root:e.root,rootID:e.rootId,path:e.path},initialNavigation:n,setting:t.settings};this.send(p.TransportEvent.AppChangeState,c)},t.prototype.mergeParams=function(e){return i({version:1,engine:c.EngineType.PostMessage,uuid:this.uuid},e)},t.prototype.resetTransport=function(e){var t;null===(t=this[d])||void 0===t||t.destroy();var r=new c.NBTransport(e);return this[d]=r,r.subscribe(),r},Object.defineProperty(t.prototype,"frameStyle",{get:function(){var e=document.createElement("style");return e.textContent="\n iframe {\n display: block;\n width: inherit;\n height: inherit;\n border: none;\n background: none;\n }\n ",e},enumerable:!1,configurable:!0}),r=f,t.observedAttributes=["apiPrefix","origin","version","view","debug","uuid","navigationState","user"],t}(HTMLElement)},615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserNavigate=void 0;var n=r(424),o=r(837);t.browserNavigate=function(e){if((0,o.isBrowser)()){var t=(0,n.getGlobal)(),r=e.path,i=e.queryParams,a=new URL(r||"",window.origin),s=i||{};Object.keys(s).forEach((function(e){var t=s[e];t&&a.searchParams.append(e,t.toString())})),t.history.pushState({},"",a.toString())}}},755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0;var n=r(796);t.defaultState=function(){return{extenstion:{id:0,name:{},type:n.ExtensionType.File},api:{host:window.location.origin,prefix:"/api/v1",headers:{},query:{}},debug:!0,view:n.ViewState.view,storage:{root:n.StorageRoot.my,rootID:0,path:"",info:{base:"",dir:"",ext:"",name:"",root:""}}}}},223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dirname=void 0;var n=r(470).sep,o=r(307);t.dirname=function(e){if(0===(e=(0,o.pathJoin)(n,e)).length)return".";for(var t=e.charCodeAt(0),r=47===t,i=-1,a=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!a){i=s;break}}else a=!1;return-1===i?r?n:".":r&&1===i?n+n:e.slice(0,i)}},572:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileInfo=void 0;var n=r(470).sep,o=r(307);t.fileInfo=function(e){var t={root:"",dir:"",base:"",ext:"",name:""};if(0===(e=(0,o.pathJoin)(n,e)).length)return t;var r,i=e.charCodeAt(0),a=47===i;a?(t.root=n,r=1):r=0;for(var s=-1,c=0,p=-1,u=!0,l=e.length-1,d=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===p&&(u=!1,p=l+1),46===i?-1===s?s=l:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){c=l+1;break}return-1===s||-1===p||0===d||1===d&&s===p-1&&s===c+1?-1!==p&&(t.base=t.name=0===c&&a?e.slice(1,p):e.slice(c,p)):(0===c&&a?(t.name=e.slice(1,s),t.base=e.slice(1,p)):(t.name=e.slice(c,s),t.base=e.slice(c,p)),t.ext=e.slice(s,p)),c>0?t.dir=e.slice(0,c-1):a&&(t.dir=n),t}},395:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigData=void 0;var n=r(796);t.getConfigData=function(e){var t,r,o,i,a={name:e.name,type:e.type,icon:e.icon,pictogram:"",index:""};switch(e.type){case n.ExtensionType.File:a.index=(null===(t=e.file)||void 0===t?void 0:t.index)||"";break;case n.ExtensionType.WorkDir:a.index=(null===(r=e.work_dir)||void 0===r?void 0:r.index)||"";break;case n.ExtensionType.App:a.index=(null===(o=e.app)||void 0===o?void 0:o.menu.index)||"",a.pictogram=(null===(i=e.app)||void 0===i?void 0:i.menu.icon)||""}return a}},424:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobal=void 0;var n=r(837);t.getGlobal=function(){return(0,n.isBrowser)()?window:r.g}},566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLang=void 0,t.getLang=function(e,t){if(void 0===t&&(t="ru"),e[t])return e[t];var r=Object.keys(e).pop();return r&&e[r]?e[r]:""}},462:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(223),t),o(r(572),t),o(r(566),t),o(r(719),t),o(r(307),t),o(r(392),t),o(r(299),t),o(r(424),t),o(r(837),t),o(r(8),t),o(r(538),t),o(r(395),t),o(r(858),t),o(r(615),t)},837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0,t.isBrowser=function(){return"undefined"!=typeof window}},8:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=void 0,t.isObject=function(e){return null!=e&&"Object"===e.constructor.name}},538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notificateRequestError=void 0;var n=r(11);t.notificateRequestError=function(e,t){n.Transport.send(n.TransportEvent.ExtRequestError,{status:e,message:t})}},719:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parentURL=void 0,t.parentURL=function(){return new URL(window.location!=window.parent.location?document.referrer:document.location.href)}},307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathJoin=void 0;var n=r(470).sep;t.pathJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=[],o=0,i=e.length;o<i;o++)r=r.concat(e[o].split(n));var a=[];for(o=0,i=r.length;o<i;o++){var s=r[o];s&&"."!==s&&(".."===s?a.pop():a.push(s))}return""===r[0]&&a.unshift(""),a.join(n)||(a.length?n:".")}},392:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.sendRequest2=t.sendRequest=void 0;var o=r(538),i=r(307);t.sendRequest=function(e,t){return fetch(e,t).then((function(e){return e.status>=400&&(0,o.notificateRequestError)(e.status,""),e})).catch((function(e){throw e.status>=400&&(0,o.notificateRequestError)(e.status,e.message),e}))},t.sendRequest2=function(e,t,r){var o,c=n({},r.headers);return r.params&&(t+="?"+a(r.params)),r.body instanceof FormData?o=r.body:(c["Content-Type"]="application/json",o=JSON.stringify(r.body)),r.prefix&&(t=(0,i.pathJoin)(r.prefix,t)),fetch(new URL(decodeURI(t),r.host),{method:e,cache:r.cache,headers:c,body:o}).then((function(e){var t=e.headers.get("content-type");return(null==t?void 0:t.indexOf("/json"))?e.json():(null==t?void 0:t.indexOf("/text"))?e.text():e})).catch((function(e){throw s(e.status,e.message),e}))};var a=function(e){var t=new URLSearchParams;return Object.keys(e).forEach((function(r){Array.isArray(e[r])?e[r].forEach((function(e){t.append(r,e)})):t.append(r,e[r])})),t},s=function(e,t){e>=400&&(0,o.notificateRequestError)(e,t)}},299:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translite=void 0;var r={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"cz",ш:"sh",щ:"scz",ы:"y",ь:"",э:"e",ю:"u",я:"ja"," ":"-"};t.translite=function(e){return(e=(e=(e=(e=(e=e.toLocaleLowerCase()).trim()).replace(/ -/gi,"-")).replace(/- /gi,"-")).replace(/\s{2,}/gi," ")).split("").map((function(e){return/[a-z0-9]/i.test(e)?e:r[e]||""})).join("")}},858:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.transportProps=void 0;var o=(0,r(424).getGlobal)();t.transportProps=function(){return n(n({},o._nb_global_props),i())};var i=function(){try{return JSON.parse(window.name||"")}catch(e){return{}}}},495:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.NextBox=void 0;var i=r(970),a=r(462),s=r(755),c=r(831),p=r(512),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.init=function(e){var t=this,r=function(e){return t.state=e};if(!c.Transport.engineType){var n=(0,s.defaultState)();r(n),e&&e(n)}c.Transport.on(p.TransportEvent.AppReady,(function(t){r(t),e&&e(t)})),c.Transport.on(p.TransportEvent.AppReload,(function(){window.location.reload()})),c.Transport.on(p.TransportEvent.AppChangeState,r),c.Transport.send(p.TransportEvent.ExtInit)},t.prototype.prepareNavigate=function(){var e,t=null===(e=this.state)||void 0===e?void 0:e.initialNavigation;(null==t?void 0:t.target)&&[p.TransportNavigationTarget.Cache,p.TransportNavigationTarget.Self].includes(t.target)&&(0,a.browserNavigate)(t)},t}(i.EventEmitter);t.NextBox=u},708:()=>{"use strict";!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.polyfillWrapFlushCallback){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}()},626:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(708)},185:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportEmpty=void 0;var r=function(){function e(){}return e.prototype.send=function(e,t){},e.prototype.subscribe=function(e){},e.prototype.destroy=function(){},e}();t.TransportEmpty=r},176:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(595),t),o(r(831),t)},595:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},521:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportPostMessage=void 0;var n=r(462),o=function(){function e(e){var t=this;this.listenHandler=function(e){var r=e.data.event,n=e.data.uuid,o=e.data.payload;try{o=JSON.parse(e.data.payload)}catch(e){}t.handler&&t.handler(r,o,n)},this._parems=e}return Object.defineProperty(e.prototype,"parent",{get:function(){var e,t;return(null===(e=this._parems)||void 0===e?void 0:e.parent)?null===(t=this._parems)||void 0===t?void 0:t.parent:(0,n.isBrowser)()?parent:null},enumerable:!1,configurable:!0}),e.prototype.send=function(e,t){var r,n;null===(r=this.parent)||void 0===r||r.postMessage({event:e,uuid:null===(n=this._parems)||void 0===n?void 0:n.uuid,payload:function(){try{return JSON.stringify(t)}catch(e){return t}}()},document.location.origin)},e.prototype.subscribe=function(e){var t;this.handler=e,null===(t=this.parent)||void 0===t||t.addEventListener("message",this.listenHandler)},e.prototype.destroy=function(){var e;null===(e=this.parent)||void 0===e||e.removeEventListener("message",this.listenHandler)},e}();t.TransportPostMessage=o},831:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=t.NBTransport=t.EngineType=void 0;var a,s=r(512),c=r(970),p=r(521),u=r(424),l=r(742),d=r(185),f=r(858),h=r(462);!function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(a=t.EngineType||(t.EngineType={}));var v=(0,f.transportProps)(),y=(0,u.getGlobal)(),g=function(e){function r(t){var r=e.call(this)||this;return r.engineType=a.Empty,r._params=i(i({},t),v),r.engineType=r._params.engine||a.Empty,r.engine=new d.TransportEmpty,r.engineType===a.PostMessage&&(r.engine=new p.TransportPostMessage(r._params)),r.engineType===a.WebSocket&&(r.engine=new l.TransportWebsocket(r._params)),r}return o(r,e),r.prototype.send=function(e,t){var r;(null===(r=this._params)||void 0===r?void 0:r.debug)&&console.log("transport.send",this._params,e,t),this.engine.send(e,t)},r.prototype.subscribe=function(){var e=this;this.engine.subscribe((function(t,r,n){var o,i,a;t&&(((null===(o=e._params)||void 0===o?void 0:o.version)||0)>0&&n!==(null===(i=e._params)||void 0===i?void 0:i.uuid)||((null===(a=e._params)||void 0===a?void 0:a.debug)&&console.log("transport.message",e._params,n,t,r),e.emit(t,r,n)))}))},r.prototype.destroy=function(){this.engine.destroy()},r.prototype.changeContent=function(e){t.Transport.send(s.TransportEvent.ExtChangeContent,e)},r.prototype.navigate=function(e,r,n){void 0===n&&(n=s.TransportNavigationTarget.Cache);var o={path:e,queryParams:r,target:n};t.Transport.send(s.TransportEvent.ExtNavigateTo,o),n===s.TransportNavigationTarget.Self&&(0,h.browserNavigate)(o)},r.prototype.close=function(){t.Transport.send(s.TransportEvent.ExtClose)},r.prototype.openModalFilesSelect=function(e){t.Transport.send(s.TransportEvent.ExtOpenModalFilesSelect,e)},r.prototype.openModalConfirm=function(e){t.Transport.send(s.TransportEvent.ExtShowConfirm,e)},r.prototype.toast=function(e){t.Transport.send(s.TransportEvent.ExtToast,e)},r.prototype.setSpinnerStatus=function(e){t.Transport.send(s.TransportEvent.ExtSpinner,e)},r.prototype.setContext=function(e){t.Transport.send(s.TransportEvent.ExtContext,e)},r.prototype.setTabs=function(e){t.Transport.send(s.TransportEvent.ExtTabs,e)},r}(c.EventEmitter);t.NBTransport=g,y._nb_transport instanceof g||(y._nb_transport=new g({engine:a.PostMessage}),y._nb_transport.subscribe()),t.Transport=y._nb_transport},742:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportWebsocket=void 0;var r=Symbol("transport-socket"),n=function(){function e(e){this._params=e,window[r]||this.init(e)}return e.prototype.init=function(e){var t=(null==e?void 0:e.host)||"localhost",n=(null==e?void 0:e.port)||8999,o=(null==e?void 0:e.path)||"";window[r]=new WebSocket("ws://".concat(t,":").concat(n).concat(o)),window[r].onopen=function(){},window[r].onclose=function(e){e.wasClean?console.log("Соединение закрыто"):console.log("Обрыв соединения"),console.log("Код: "+e.code+" причина: "+e.reason)},window[r].onerror=function(e){console.log("Ошибка подключения ws: "+e.message)}},e.prototype.send=function(e,t){var n,o=this;window[r]&&(window[r].readyState?window[r].send(JSON.stringify({event:e,payload:t,uuid:null===(n=this._params)||void 0===n?void 0:n.uuid})):setTimeout((function(){o.send(e,t)}),100))},e.prototype.subscribe=function(e){window[r]&&(window[r].onmessage=function(t){try{var r=JSON.parse(t.data),n=r.event,o=r.payload,i=r.uuid;e(n,o,i)}catch(e){}})},e.prototype.destroy=function(){window[r]&&(window[r].close(),window[r]=null)},e}();t.TransportWebsocket=n},85:(e,t)=>{"use strict";var r,n,o,i;Object.defineProperty(t,"__esModule",{value:!0}),t.RequestStatus=t.PermissionType=t.ExtensionFileMode=t.ExtensionType=void 0,(i=t.ExtensionType||(t.ExtensionType={})).App="app",i.File="file",i.WorkDir="work_dir",(o=t.ExtensionFileMode||(t.ExtensionFileMode={})).Read="read",o.Write="write",o.ReadAndWrite="read_and_write",(n=t.PermissionType||(t.PermissionType={})).CLOSE="",n.READ="r",n.WRITE="rw",(r=t.RequestStatus||(t.RequestStatus={}))[r.Wait=0]="Wait",r[r.Done=1]="Done",r[r.Reject=2]="Reject"},745:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},796:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(85),t),o(r(492),t),o(r(517),t),o(r(512),t),o(r(745),t),o(r(548),t),o(r(143),t),o(r(738),t)},143:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SettingControlType=void 0,(r=t.SettingControlType||(t.SettingControlType={})).Text="text",r.String="string",r.Number="number",r.CheckBox="checkbox",r.Select="select",r.RadioList="radio_list",r.ConnectionChoose="connection_choose",r.MultiConnectionChoose="multi_connection_choose"},492:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ViewState=void 0,(r=t.ViewState||(t.ViewState={})).view="view",r.edit="edit"},517:(e,t)=>{"use strict";var r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.StorageElementContentType=t.StorageElementType=t.StorageRoot=void 0,(o=t.StorageRoot||(t.StorageRoot={})).my="my",o.fca="fca",o.divide="divide",o.share="share",o.favorite="favorite",(n=t.StorageElementType||(t.StorageElementType={})).Dir="dir",n.File="file",n.WorkDir="work_dir",(r=t.StorageElementContentType||(t.StorageElementContentType={})).Any="any",r.Dir="dir",r.Code="code",r.Image="image",r.Audio="audio",r.Video="video",r.Text="text",r.Doc="doc",r.Xls="xls",r.Ppt="ppt"},512:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.TransportNavigationTarget=t.TransportEvent=void 0,(n=t.TransportEvent||(t.TransportEvent={})).ExtInit="ext-init",n.ExtChangeContent="ext-change-content",n.ExtOpenModalFilesSelect="ext-open-modal-files-select",n.ExtShowConfirm="ext-show-confirm",n.ExtNavigateTo="ext-navigate-to",n.ExtRequestError="ext-request-error",n.ExtToast="ext-toast",n.ExtSpinner="ext-spinner",n.ExtContext="ext-context",n.ExtTabs="ext-tabs",n.ExtSavedStart="ext-saved-start",n.ExtSavedEnd="ext-saved-end",n.ExtSavedError="ext-saved-error",n.ExtClose="ext-close",n.AppReload="ext-reload",n.AppReady="app-ready",n.AppChangeState="app-change-state",n.AppSaveAndClose="app-save-and-close",n.AppFilesSelected="app-files-selected",n.AppConfirmAccept="app-confirm-accept",n.AppConfirmReject="app-confirm-reject",n.AppContextAction="app-context-action",n.AppTabAction="app-tab-action",(r=t.TransportNavigationTarget||(t.TransportNavigationTarget={})).Parent="_parent",r.Self="_self",r.Cache="_cache"},548:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.UserStatus=void 0,(r=t.UserStatus||(t.UserStatus={})).Registering="registering",r.Activated="activated",r.Blocked="blocked",r.BlockedByLicense="blocked_by_license"},607:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(626),o(r(495),t),o(r(796),t),o(r(176),t),o(r(462),t),o(r(534),t),o(r(181),t),o(r(455),t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(607)})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["next-box"]=t():e["next-box"]=t()}(globalThis,(()=>(()=>{var e={11:e=>{var t;globalThis,t=()=>(()=>{"use strict";var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",o=0,i=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(i===s-1||1===a);else if(i!==s-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),i=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),o=s-i-1;i=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var e,n="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a;i>=0?a=arguments[i]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(n=a+"/"+n,o=47===a.charCodeAt(0))}return n=r(n,!o),o?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&o&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var o=arguments[r];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,a=i-o,s=1;s<r.length&&47===r.charCodeAt(s);++s);for(var c=r.length-s,p=a<c?a:c,u=-1,l=0;l<=p;++l){if(l===p){if(c>p){if(47===r.charCodeAt(s+l))return r.slice(s+l+1);if(0===l)return r.slice(s+l)}else a>p&&(47===e.charCodeAt(o+l)?u=l:0===l&&(u=0));break}var d=e.charCodeAt(o+l);if(d!==r.charCodeAt(s+l))break;47===d&&(u=l)}var f="";for(l=o+u+1;l<=i;++l)l!==i&&47!==e.charCodeAt(l)||(0===f.length?f+="..":f+="/..");return f.length>0?f+r.slice(s+u):(s+=u,47===r.charCodeAt(s)&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,o=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(r=e.charCodeAt(a))){if(!i){o=a;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,o=0,i=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var s=r.length-1,c=-1;for(n=e.length-1;n>=0;--n){var p=e.charCodeAt(n);if(47===p){if(!a){o=n+1;break}}else-1===c&&(a=!1,c=n+1),s>=0&&(p===r.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){o=n+1;break}}else-1===i&&(a=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var r=-1,n=0,o=-1,i=!0,a=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===o&&(i=!1,o=s+1),46===c?-1===r?r=s:1!==a&&(a=1):-1!==r&&(a=-1);else if(!i){n=s+1;break}}return-1===r||-1===o||0===a||1===a&&r===o-1&&r===n+1?"":e.slice(r,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,o=e.charCodeAt(0),i=47===o;i?(r.root="/",n=1):n=0;for(var a=-1,s=0,c=-1,p=!0,u=e.length-1,l=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(p=!1,c=u+1),46===o?-1===a?a=u:1!==l&&(l=1):-1!==a&&(l=-1);else if(!p){s=u+1;break}return-1===a||-1===c||0===l||1===l&&a===c-1&&a===s+1?-1!==c&&(r.base=r.name=0===s&&i?e.slice(1,c):e.slice(s,c)):(0===s&&i?(r.name=e.slice(1,a),r.base=e.slice(1,c)):(r.name=e.slice(s,a),r.base=e.slice(s,c)),r.ext=e.slice(a,c)),s>0?r.dir=e.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},181:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(481),t),o(r(861),t)},481:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.StaticApi=void 0;var a=r(892),s=r(392),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.upload=function(e,t,r){void 0===r&&(r="");var n=new FormData;return n.set("file",e),(0,s.sendRequest)(this.makeApiPath(r,t),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:n}).then((function(e){return e.json()}))},t.prototype.get=function(e){return(0,s.sendRequest)(this.makeApiPath(e),{method:"GET"})},t.prototype.delete=function(e){return(0,s.sendRequest)(this.makeApiPath(e),{method:"DELETE"}).catch((function(e){return e}))},t.prototype.makeApiPath=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.makeApiPath.apply(this,i(["static/files"],t,!1))},t}(a.Api);t.StaticApi=c},861:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageApi=void 0;var a=r(307),s=r(892),c=r(566),p=r(392),u=r(299),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.info=function(e){return(0,p.sendRequest)(this.makeApiPath("/element")+this.makeSearchParams({path:e}),{headers:this.makeHeaders(),method:"GET",cache:"no-cache"}).then(this.responseJSON)},t.prototype.create=function(e,t,r){return(0,p.sendRequest)(this.makeApiPath("/element"),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:JSON.stringify({name:e,path:this.relativePath(t),type:r,divide_id:this.state.api.query.divide_id||null})}).then(this.responseJSON)},t.prototype.delete=function(e,t){return(0,p.sendRequest)(this.makeApiPath("/element")+this.makeSearchParams({path:e,hard:t}),{method:"DELETE",headers:this.makeHeaders()})},t.prototype.makeDownloadPath=function(e){return this.makeApiPath("/files")+this.makeSearchParams({path:this.relativePath(e,this.state.storage.path),t:Date.now()})},t.prototype.download=function(e){return(0,p.sendRequest)(this.makeApiPath("/files")+this.makeSearchParams({path:this.relativePath(e,this.state.storage.path),t:Date.now()}),{headers:this.makeHeaders(),method:"GET",cache:"no-cache"})},t.prototype.replace=function(e,t){return(0,p.sendRequest)(this.makeApiPath("/files")+this.makeSearchParams({path:this.relativePath(t,this.state.storage.path)}),{cache:"no-cache",method:"PUT",body:e,headers:this.makeHeaders()}).then(this.responseJSON)},t.prototype.upload=function(e,t){var r=new FormData;return r.set("path",this.relativePath(e)),r.set("file",t),(0,p.sendRequest)(this.makeApiPath("/files"),{method:"POST",body:r,headers:this.makeHeaders()}).then(this.responseJSON)},t.prototype.uploadNet=function(e,t,r){return void 0===r&&(r=!1),(0,p.sendRequest)(this.makeApiPath("/files/net"),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:JSON.stringify({url:t,overwrite:r,path:this.relativePath(e)})}).then(this.responseJSON)},t.prototype.createMeta=function(e,t){return this.create(e||this.metaName,t||"","file")},t.prototype.readMeta=function(e){return this.download(e||this.metaName)},t.prototype.saveMeta=function(e,t){return this.replace(e,t||this.metaName)},t.prototype.relativePath=function(e,t){return!e&&t?t||"":(0,a.pathJoin)(this.state.storage.info.dir||"",e||"")},t.prototype.makeApiPath=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n="storage";return"fca"===this.state.storage.root&&(n="disk/".concat(this.state.storage.rootID)),e.prototype.makeApiPath.apply(this,i([n],t,!1))},Object.defineProperty(t.prototype,"metaName",{get:function(){return"."+(0,u.translite)((0,c.getLang)(this.state.extenstion.name))},enumerable:!1,configurable:!0}),t}(s.Api);t.StorageApi=l},892:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Api=void 0;var i=r(462),a=r(755),s=function(){function e(e){void 0===e&&(e=(0,a.defaultState)()),this.changeState(e)}return e.prototype.changeState=function(e){this.state=e},e.prototype.makeSearchParams=function(e){return e=n(n({},this.state.api.query),e),"?"+new URLSearchParams(e)},e.prototype.makeHeaders=function(e){return n(n({},e),this.state.api.headers)},e.prototype.responseJSON=function(e){return e.status>=200&&e.status<400?e.json():Promise.resolve({error:"Parse error"})},e.prototype.makeApiPath=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new URL(decodeURI(i.pathJoin.apply(void 0,o([this.state.api.prefix],e,!1))),this.state.api.host)},e}();t.Api=s},970:function(e,t){var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter=void 0;var n=function(){function e(){this._handlers=new Map,this._globalHandlers=new Set}return e.prototype.listen=function(e){this._globalHandlers.add(e)},e.prototype.on=function(e,t){var r;this._handlers.has(e)||this._handlers.set(e,new Set),null===(r=this._handlers.get(e))||void 0===r||r.add(t)},e.prototype.off=function(e,t){var r;null===(r=this._handlers.get(e))||void 0===r||r.delete(t)},e.prototype.emit=function(e){for(var t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];null===(t=this._handlers.get(e))||void 0===t||t.forEach((function(e){e&&e.apply(void 0,n)})),this._globalHandlers.forEach((function(t){t.apply(void 0,r([e],n,!1))}))},e}();t.EventEmitter=n},534:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(892),t),o(r(970),t)},755:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0;var n=r(796);t.defaultState=function(){return{extenstion:{id:0,name:{},type:n.ExtensionType.File},api:{host:window.location.origin,prefix:"/api/v1",headers:{},query:{}},debug:!0,view:n.ViewState.view,brouserURL:"",storage:{root:n.StorageRoot.my,rootID:0,path:"",info:{base:"",dir:"",ext:"",name:"",root:""}}}}},223:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dirname=void 0;var n=r(470).sep,o=r(307);t.dirname=function(e){if(0===(e=(0,o.pathJoin)(n,e)).length)return".";for(var t=e.charCodeAt(0),r=47===t,i=-1,a=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!a){i=s;break}}else a=!1;return-1===i?r?n:".":r&&1===i?n+n:e.slice(0,i)}},572:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fileInfo=void 0;var n=r(470).sep,o=r(307);t.fileInfo=function(e){var t={root:"",dir:"",base:"",ext:"",name:""};if(0===(e=(0,o.pathJoin)(n,e)).length)return t;var r,i=e.charCodeAt(0),a=47===i;a?(t.root=n,r=1):r=0;for(var s=-1,c=0,p=-1,u=!0,l=e.length-1,d=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===p&&(u=!1,p=l+1),46===i?-1===s?s=l:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){c=l+1;break}return-1===s||-1===p||0===d||1===d&&s===p-1&&s===c+1?-1!==p&&(t.base=t.name=0===c&&a?e.slice(1,p):e.slice(c,p)):(0===c&&a?(t.name=e.slice(1,s),t.base=e.slice(1,p)):(t.name=e.slice(c,s),t.base=e.slice(c,p)),t.ext=e.slice(s,p)),c>0?t.dir=e.slice(0,c-1):a&&(t.dir=n),t}},424:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobal=void 0;var n=r(837);t.getGlobal=function(){return(0,n.isBrowser)()?window:r.g}},566:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getLang=void 0,t.getLang=function(e,t){if(void 0===t&&(t="ru"),e[t])return e[t];var r=Object.keys(e).pop();return r&&e[r]?e[r]:""}},462:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(223),t),o(r(572),t),o(r(566),t),o(r(719),t),o(r(307),t),o(r(392),t),o(r(299),t),o(r(424),t),o(r(837),t)},837:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0,t.isBrowser=function(){return"undefined"!=typeof window}},719:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parentURL=void 0,t.parentURL=function(){return new URL(window.location!=window.parent.location?document.referrer:document.location.href)}},307:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.pathJoin=void 0;var n=r(470).sep;t.pathJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=[],o=0,i=e.length;o<i;o++)r=r.concat(e[o].split(n));var a=[];for(o=0,i=r.length;o<i;o++){var s=r[o];s&&"."!==s&&(".."===s?a.pop():a.push(s))}return""===r[0]&&a.unshift(""),a.join(n)||(a.length?n:".")}},392:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sendRequest=void 0;var n=r(831),o=r(512);t.sendRequest=function(e,t){return fetch(e,t).then((function(e){return parent!==window&&e.status>=400&&n.Transport.send(o.TransportEvent.ExtRequestError,e),e}))}},299:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.translite=void 0;var r={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"cz",ш:"sh",щ:"scz",ы:"y",ь:"",э:"e",ю:"u",я:"ja"," ":"-"};t.translite=function(e){return(e=(e=(e=(e=(e=e.toLocaleLowerCase()).trim()).replace(/ -/gi,"-")).replace(/- /gi,"-")).replace(/\s{2,}/gi," ")).split("").map((function(e){return/[a-z0-9]/i.test(e)?e:r[e]||""})).join("")}},858:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.transportProps=void 0,t.transportProps=function(){try{return JSON.parse(window.name||"")}catch(e){return{}}}},495:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.NextBox=void 0;var i=r(970),a=r(755),s=r(831),c=r(512),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.init=function(e){var t=this,r=function(e){return t.state=e};if(!s.Transport.engineType){var n=(0,a.defaultState)();r(n),e&&e(n)}s.Transport.on(c.TransportEvent.AppReady,(function(t){r(t),e&&e(t)})),s.Transport.on(c.TransportEvent.AppReload,(function(){window.location.reload()})),s.Transport.on(c.TransportEvent.AppChangeState,r),s.Transport.send(c.TransportEvent.ExtInit)},t}(i.EventEmitter);t.NextBox=p},185:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransportEmpty=void 0;var r=function(){function e(){}return e.prototype.send=function(e,t){},e.prototype.subscribe=function(e){},e}();t.TransportEmpty=r},176:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(595),t),o(r(831),t)},595:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},521:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransportPostMessage=void 0;var r=function(){function e(){}return e.prototype.send=function(e,t){if(parent!==window){var r=new URL(window.location!=window.parent.location?document.referrer:document.location.href);parent.postMessage({event:e,payload:t},r.origin)}},e.prototype.subscribe=function(e){window.addEventListener("message",(function(t){var r=t.data.event,n=t.data.payload;e(r,n)}))},e}();t.TransportPostMessage=r},831:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=t.NBTransport=t.EngineType=void 0;var i,a=r(512),s=r(970),c=r(521),p=r(424),u=r(742),l=r(185),d=r(858);!function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(i=t.EngineType||(t.EngineType={}));var f=function(e){function r(t){var r=e.call(this)||this;r.engineType=i.Empty,r.debug=!1;var n=(0,d.transportProps)();return r.engineType=t||n.engine||i.Empty,r.engine=new l.TransportEmpty,r.engineType===i.PostMessage&&(r.engine=new c.TransportPostMessage),r.engineType===i.WebSocket&&(r.engine=new u.TransportWebsocket),r}return o(r,e),r.prototype.send=function(e,t){this.engine.send(e,JSON.stringify(t||{}))},r.prototype.subscribe=function(){var e=this;this.engine.subscribe((function(t,r){t&&(e.debug&&console.log("frame.message",t,r),e.emit(t,r))}))},r.prototype.changeContent=function(e){t.Transport.send(a.TransportEvent.ExtChangeContent,e)},r.prototype.navigate=function(e,r){t.Transport.send(a.TransportEvent.ExtNavigateTo,{path:e,queryParams:r})},r.prototype.close=function(){t.Transport.send(a.TransportEvent.ExtClose)},r.prototype.openModalFilesSelect=function(e){t.Transport.send(a.TransportEvent.ExtOpenModalFilesSelect,e)},r.prototype.openModalConfirm=function(e){t.Transport.send(a.TransportEvent.ExtShowConfirm,e)},r}(s.EventEmitter);t.NBTransport=f;var h=(0,p.getGlobal)();h._nb_transport instanceof f||(h._nb_transport=new f,h._nb_transport.subscribe()),t.Transport=h._nb_transport},742:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransportWebsocket=void 0;var n=r(858),o=Symbol("transport-socket"),i=function(){function e(){window[o]||this.init()}return e.prototype.init=function(){var e=(0,n.transportProps)(),t=e.host||"localhost",r=e.port||8999;window[o]=new WebSocket("ws://".concat(t,":").concat(r)),window[o].onopen=function(){},window[o].onclose=function(e){e.wasClean?console.log("Соединение закрыто"):console.log("Обрыв соединения"),console.log("Код: "+e.code+" причина: "+e.reason)},window[o].onerror=function(e){console.log("Ошибка подключения ws: "+e.message)}},e.prototype.send=function(e,t){var r=this;window[o].readyState?window[o].send(JSON.stringify({event:e,payload:t})):setTimeout((function(){r.send(e,t)}),100)},e.prototype.subscribe=function(e){window[o].onmessage=function(t){try{var r=JSON.parse(t.data),n=r.event,o=r.payload;e(n,o)}catch(e){}}},e}();t.TransportWebsocket=i},85:(e,t)=>{var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionFileMode=t.ExtensionType=void 0,(n=t.ExtensionType||(t.ExtensionType={})).App="app",n.File="file",n.WorkDir="work_dir",(r=t.ExtensionFileMode||(t.ExtensionFileMode={})).Read="read",r.Write="write",r.ReadAndWrite="read_and_write"},745:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},796:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(85),t),o(r(492),t),o(r(517),t),o(r(512),t),o(r(745),t),o(r(548),t)},492:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ViewState=void 0,(r=t.ViewState||(t.ViewState={})).view="view",r.edit="edit"},517:(e,t)=>{var r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.StorageElementContentType=t.StorageElementType=t.StorageRoot=void 0,(o=t.StorageRoot||(t.StorageRoot={})).my="my",o.fca="fca",o.divide="divide",o.share="share",o.favorite="favorite",(n=t.StorageElementType||(t.StorageElementType={})).Dir="dir",n.File="file",n.WorkDir="work_dir",(r=t.StorageElementContentType||(t.StorageElementContentType={})).Any="any",r.Dir="dir",r.Code="code",r.Image="image",r.Audio="audio",r.Video="video",r.Text="text",r.Doc="doc",r.Xls="xls",r.Ppt="ppt"},512:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TransportEvent=void 0,(r=t.TransportEvent||(t.TransportEvent={})).ExtInit="ext-init",r.ExtChangeContent="ext-change-content",r.ExtOpenModalFilesSelect="ext-open-modal-files-select",r.ExtShowConfirm="ext-show-confirm",r.ExtNavigateTo="ext-navigate-to",r.ExtRequestError="ext-request-error",r.ExtClose="ext-close",r.AppReload="ext-reload",r.AppReady="app-ready",r.AppChangeState="app-change-state",r.AppSaveAndClose="app-save-and-close",r.AppFilesSelected="app-files-selected",r.AppConfirmAccept="app-confirm-accept",r.AppConfirmReject="app-confirm-reject"},548:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SystemUserRole=void 0,(r=t.SystemUserRole||(t.SystemUserRole={})).ADMIN="admin",r.USER="user"},607:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(495),t),o(r(796),t),o(r(176),t),o(r(462),t),o(r(534),t),o(r(181),t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(607)})(),e.exports=t()},470:e=>{"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",o=0,i=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(i===s-1||1===a);else if(i!==s-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",o=0):o=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),i=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),o=s-i-1;i=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n}var n={resolve:function(){for(var e,n="",o=!1,i=arguments.length-1;i>=-1&&!o;i--){var a;i>=0?a=arguments[i]:(void 0===e&&(e=process.cwd()),a=e),t(a),0!==a.length&&(n=a+"/"+n,o=47===a.charCodeAt(0))}return n=r(n,!o),o?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&o&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var o=arguments[r];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r)return"";if((e=n.resolve(e))===(r=n.resolve(r)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,a=i-o,s=1;s<r.length&&47===r.charCodeAt(s);++s);for(var c=r.length-s,p=a<c?a:c,u=-1,l=0;l<=p;++l){if(l===p){if(c>p){if(47===r.charCodeAt(s+l))return r.slice(s+l+1);if(0===l)return r.slice(s+l)}else a>p&&(47===e.charCodeAt(o+l)?u=l:0===l&&(u=0));break}var d=e.charCodeAt(o+l);if(d!==r.charCodeAt(s+l))break;47===d&&(u=l)}var f="";for(l=o+u+1;l<=i;++l)l!==i&&47!==e.charCodeAt(l)||(0===f.length?f+="..":f+="/..");return f.length>0?f+r.slice(s+u):(s+=u,47===r.charCodeAt(s)&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,o=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(r=e.charCodeAt(a))){if(!i){o=a;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,o=0,i=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var s=r.length-1,c=-1;for(n=e.length-1;n>=0;--n){var p=e.charCodeAt(n);if(47===p){if(!a){o=n+1;break}}else-1===c&&(a=!1,c=n+1),s>=0&&(p===r.charCodeAt(s)?-1==--s&&(i=n):(s=-1,i=c))}return o===i?i=c:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){o=n+1;break}}else-1===i&&(a=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var r=-1,n=0,o=-1,i=!0,a=0,s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47!==c)-1===o&&(i=!1,o=s+1),46===c?-1===r?r=s:1!==a&&(a=1):-1!==r&&(a=-1);else if(!i){n=s+1;break}}return-1===r||-1===o||0===a||1===a&&r===o-1&&r===n+1?"":e.slice(r,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,o=e.charCodeAt(0),i=47===o;i?(r.root="/",n=1):n=0;for(var a=-1,s=0,c=-1,p=!0,u=e.length-1,l=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===c&&(p=!1,c=u+1),46===o?-1===a?a=u:1!==l&&(l=1):-1!==a&&(l=-1);else if(!p){s=u+1;break}return-1===a||-1===c||0===l||1===l&&a===c-1&&a===s+1?-1!==c&&(r.base=r.name=0===s&&i?e.slice(1,c):e.slice(s,c)):(0===s&&i?(r.name=e.slice(1,a),r.base=e.slice(1,c)):(r.name=e.slice(s,a),r.base=e.slice(s,c)),r.ext=e.slice(a,c)),s>0?r.dir=e.slice(0,s-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n},181:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(513),t),o(r(481),t),o(r(861),t),o(r(453),t)},481:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.StaticApi=void 0;var a=r(892),s=r(392),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.upload=function(e,t,r){void 0===r&&(r="");var n=new FormData;return n.set("file",e,t),(0,s.sendRequest)(this.makeApiPath(r),{method:"POST",body:n}).then((function(e){return e.json()}))},t.prototype.get=function(e){return(0,s.sendRequest)(this.makeApiPath(e),{method:"GET"})},t.prototype.delete=function(e){return(0,s.sendRequest)(this.makeApiPath(e),{method:"DELETE"}).catch((function(e){return e}))},t.prototype.makeApiPath=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.prototype.makeApiPath.apply(this,i(["static/files"],t,!1))},t}(a.Api);t.StaticApi=c},861:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageApi=void 0;var s=r(307),c=r(892),p=r(566),u=r(392),l=r(299),d=r(796),f=r(831),h=new Map,v=function(e,t){return function(r){return f.Transport.send(e,t),r}},y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.list=function(e){return e.path&&(e.path=this.relativePath(e.path)),this.rest.get("/storage",e)},t.prototype.info=function(e){return this.rest.get("/storage/element",{path:e})},t.prototype.create=function(e,t,r,n){var o=i(i({is_work_dir:this.state.extenstion.type===d.ExtensionType.WorkDir},n),{name:e,path:this.relativePath(t),type:r,divide_id:this.state.api.query.divide_id||null});return(0,u.sendRequest)(this.makeApiPath("/element"),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:JSON.stringify(o)}).then(this.responseJSON)},t.prototype.delete=function(e,t){return(0,u.sendRequest)(this.makeApiPath("/element")+this.makeSearchParams({path:e,hard:t}),{method:"DELETE",headers:this.makeHeaders()})},t.prototype.makeDownloadPath=function(e,t){var r=i({},t),n={path:e,with_preview:!1};return r.cache||(n.t=Date.now()),r.imagePreview&&(n.with_preview=!0),this.makeApiPath("/files")+this.makeSearchParams(n)},t.prototype.makeImagePreview=function(e,t){return this.makeDownloadPath(e,i(i({},t),{imagePreview:!0}))},t.prototype.download=function(e){return(0,u.sendRequest2)("GET",this.makeApiPath("/files")+this.makeSearchParams({path:this.relativePath(e,this.state.storage.path),t:Date.now()}),{headers:this.makeHeaders(),cache:"no-cache"})},t.prototype.replace=function(e,t){var r=t||this.state.storage.path;return f.Transport.send(d.TransportEvent.ExtSavedStart,r),(0,u.sendRequest2)("PUT",this.makeApiPath("/files")+this.makeSearchParams({path:this.relativePath(t,this.state.storage.path)}),{cache:"no-cache",body:e,headers:this.makeHeaders()}).then(v(d.TransportEvent.ExtSavedEnd,r)).catch(v(d.TransportEvent.ExtSavedError,r))},t.prototype.liveReplace=function(e,t,r){var n=this,o=[this.state.storage.root,this.state.storage.rootID,this.relativePath(t,this.state.storage.path)].join("-"),i=h.get(o);i||(i={status:d.RequestStatus.Done,requests:[]},h.set(o,i)),i.requests.push({path:t,body:e});var a=function(){if(i&&i.status!==d.RequestStatus.Wait){var e=i.requests.pop();i.requests=[],e?(i.status=d.RequestStatus.Wait,n.replace(e.body,e.path).then((function(e){return i.status=d.RequestStatus.Done,a(),e})).catch((function(e){return i.status=d.RequestStatus.Reject,a(),e}))):r&&r()}};a()},t.prototype.upload=function(e,t){var r=new FormData;return r.set("path",this.relativePath(e)),r.set("file",t),f.Transport.send(d.TransportEvent.ExtSavedStart,e),(0,u.sendRequest)(this.makeApiPath("/files"),{method:"POST",body:r,headers:this.makeHeaders()}).then(v(d.TransportEvent.ExtSavedEnd,e)).catch(v(d.TransportEvent.ExtSavedError,e)).then(this.responseJSON,this.responseJSON)},t.prototype.uploadNet=function(e,t,r){return void 0===r&&(r=!1),f.Transport.send(d.TransportEvent.ExtSavedStart,e),(0,u.sendRequest)(this.makeApiPath("/files/net"),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:JSON.stringify({url:t,overwrite:r,path:this.relativePath(e)})}).then(v(d.TransportEvent.ExtSavedEnd,e)).catch(v(d.TransportEvent.ExtSavedError,e)).then(this.responseJSON)},t.prototype.createMeta=function(e,t,r){return this.create(e||this.metaName,t||"","file",r)},t.prototype.readMeta=function(e){return this.download(e||this.metaName)},t.prototype.saveMeta=function(e,t){return this.replace(e,t||this.metaName)},t.prototype.relativePath=function(e,t){return!e&&t?t||"":(0,s.pathJoin)(this.state.storage.info.dir||"",e||"")},t.prototype.makeApiPath=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n="storage";return"fca"===this.state.storage.root&&(n="disk/".concat(this.state.storage.rootID)),e.prototype.makeApiPath.apply(this,a([n],t,!1))},Object.defineProperty(t.prototype,"metaName",{get:function(){return"."+(0,l.translite)((0,p.getLang)(this.state.extenstion.name))},enumerable:!1,configurable:!0}),t}(c.Api);t.StorageApi=y},513:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.OrderDirection=void 0,(r=t.OrderDirection||(t.OrderDirection={})).DEFAULT="",r.ASC="asc",r.DESC="desc"},453:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.UserApi=void 0;var i=r(892),a="/users",s="/users/me",c="".concat(s,"/avatars"),p="".concat(s,"/sessions"),u="".concat(s,"/tokens"),l="".concat(a,"/change-password"),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.logout=function(){return this.rest.get("/logout")},t.prototype.get=function(e){return this.rest.get("".concat(a,"/").concat(e))},t.prototype.list=function(e){return this.rest.get(a,e)},t.prototype.restore=function(e){return this.rest.post("".concat(a,"/").concat(e,"/restore"))},t.prototype.delete=function(e,t){return this.rest.delete("".concat(a,"/").concat(e),t)},t.prototype.update=function(e){return this.rest.put(a+"/".concat(e.id),e)},t.prototype.create=function(e){return this.rest.post(a,e)},t.prototype.createToken=function(e){return this.rest.post(u,e)},t.prototype.listToken=function(e){return this.rest.get(u,e)},t.prototype.deleteToken=function(e){return this.rest.delete("".concat(u,"/").concat(e))},t.prototype.changePassword=function(e){return this.rest.post(l,e)},t.prototype.me=function(){return this.rest.get(s)},t.prototype.meUploadAvatar=function(e,t){var r=new FormData;return r.append("file",e,t),this.rest.post(c,r)},t.prototype.meDeleteAvatar=function(){return this.rest.delete(c)},t.prototype.meListSession=function(e){return this.rest.get(p,e)},t.prototype.meDeleteSession=function(e){var t=p;return e&&(t+="/".concat(e)),this.rest.delete(t)},t}(i.Api);t.UserApi=d},892:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Api=void 0;var i=r(462),a=r(755),s=function(){function e(e){void 0===e&&(e=(0,a.defaultState)());var t=this;this.rest={get:function(e,r){return(0,i.sendRequest2)("GET",e,{prefix:t.state.api.prefix,host:t.state.api.host,headers:t.state.api.headers,params:n(n({},t.state.api.query),r),cache:"no-cache"})},post:function(e,r){return(0,i.sendRequest2)("POST",e,{prefix:t.state.api.prefix,host:t.state.api.host,headers:t.state.api.headers,params:n({},t.state.api.query),body:r})},put:function(e,r){return(0,i.sendRequest2)("PUT",e,{prefix:t.state.api.prefix,host:t.state.api.host,headers:t.state.api.headers,params:n({},t.state.api.query),cache:"no-cache",body:r})},delete:function(e,r){return(0,i.sendRequest2)("PUT",e,{prefix:t.state.api.prefix,host:t.state.api.host,headers:t.state.api.headers,params:n(n({},t.state.api.query),r)})}},this.changeState(e)}return e.prototype.changeState=function(e){this.state=e},e.prototype.makeSearchParams=function(e){return e?(e=n(n({},this.state.api.query),e),"?"+new URLSearchParams(e)):""},e.prototype.makeHeaders=function(e){return n(n({},e),this.state.api.headers)},e.prototype.responseJSON=function(e){return e.status>=200&&e.status<400?e.json():Promise.resolve({error:"Parse error"})},e.prototype.makeApiPath=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new URL(decodeURI(i.pathJoin.apply(void 0,o([this.state.api.prefix],e,!1))),this.state.api.host)},e}();t.Api=s},970:function(e,t){"use strict";var r=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter=void 0;var n=function(){function e(){this._handlers=new Map,this._globalHandlers=new Set}return e.prototype.listen=function(e){this._globalHandlers.add(e)},e.prototype.on=function(e,t){var r;this._handlers.has(e)||this._handlers.set(e,new Set),null===(r=this._handlers.get(e))||void 0===r||r.add(t)},e.prototype.off=function(e,t){var r;null===(r=this._handlers.get(e))||void 0===r||r.delete(t)},e.prototype.emit=function(e){for(var t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];null===(t=this._handlers.get(e))||void 0===t||t.forEach((function(e){e&&e.apply(void 0,n)})),this._globalHandlers.forEach((function(t){t.apply(void 0,r([e],n,!1))}))},e}();t.EventEmitter=n},864:function(e,t,r){"use strict";var n,o,i,a=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.FileEngine=void 0;var s=r(181),c=r(462),p=r(755),u=r(892),l=Symbol("VERSION"),d=Symbol("CONFIG"),f=Symbol("API"),h=Symbol("UPGRADE"),v=function(e){function t(t,r,n){void 0===n&&(n=(0,p.defaultState)());var a=e.call(this,n)||this;return a[o]=0,a[i]=new Map,a[l]=t,a[d]=r,a[f]=new s.StorageApi,a[f].changeState(n),a}return a(t,e),Object.defineProperty(t.prototype,"name",{get:function(){var e;return(null===(e=this[d])||void 0===e?void 0:e.name)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){var e;return(null===(e=this[d])||void 0===e?void 0:e.path)||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullName",{get:function(){return(0,c.pathJoin)(this.path,this.name)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"version",{get:function(){return this[l]},enumerable:!1,configurable:!0}),t.prototype.changeState=function(t){var r;e.prototype.changeState.call(this,t),null===(r=this[f])||void 0===r||r.changeState(t)},t.prototype.migration=function(e,t){if(this[h].has(e))throw"Upgrader migration version ".concat(e," exist");this[h].set(e,t)},t.prototype.info=function(){return this[f].info(this.fullName)},t.prototype.download=function(){var e=this;return this[f].download().then((function(t){var r={},n=0;return(0,c.isObject)(t)&&(r=t.body||t||{},n=t.version||-1),e.runMigrate(n,r)}))},t.prototype.create=function(e,t){var r=this;return this[f].create(this.name,this.path,"file",t).then((function(){return r.replace(e)}))},t.prototype.delete=function(e){return this[f].delete(this.fullName,e)},t.prototype.replace=function(e){return this[f].replace({version:this.version,body:e})},t.prototype.liveReplace=function(e,t){return this[f].liveReplace({version:this.version,body:e})},t.prototype.runMigrate=function(e,t){var r=this,n=Array.from(this[h].keys()).sort(),o=n[n.length-1]||0;return new Promise((function(i,a){var s=t;e<o&&n.forEach((function(t){if(t>e){var n=r[h].get(t);n&&(s=n(s))}})),i(s)}))},t}(u.Api);t.FileEngine=v,o=l,i=h},534:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(892),t),o(r(864),t),o(r(970),t)},455:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(844),t)},844:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.defineNbFrameComponent=void 0;var a=r(534),s=r(462),c=r(176),p=r(796),u=Symbol("ROOT"),l=Symbol("FRAME"),d=Symbol("TRANSPORT"),f=Symbol("EVENT_EMITTER");t.defineNbFrameComponent=function(){return customElements.define("nb-frame",h)};var h=function(e){function t(){var t=e.call(this)||this;return t.apiPrefix="/api/v1",t.origin=window.location.origin,t.version=1,t.view=p.ViewState.view,t.debug=!1,t.uuid=window.crypto.randomUUID(),t[r]=new a.EventEmitter,t}var r;return o(t,e),t.prototype.connectedCallback=function(){this[u]=this.attachShadow({mode:"open"})},t.prototype.disconnectedCallback=function(){var e;null===(e=this[d])||void 0===e||e.destroy()},t.prototype.send=function(e,t){var r;null===(r=this[d])||void 0===r||r.send(e,t)},t.prototype.listen=function(e){this[f].listen(e)},t.prototype.off=function(e,t){this[f].off(e,t)},t.prototype.on=function(e,t){this[f].on(e,t)},t.prototype.makeByModel=function(e,t){var r=e.type,n=e.file,o=e.work_dir,i=e.app,a=e.devlocal,s=e.path,c="";return r===p.ExtensionType.File&&(c=n.index),r===p.ExtensionType.WorkDir&&(c=o.index),r===p.ExtensionType.App&&(c=i.menu.index),c=a?c:"".concat(this.apiPrefix,"/extensions/static/").concat(s,"/").concat(c),this.make(c,t)},t.prototype.make=function(e,t){var r,n,o=this;t=this.mergeParams(t);var i=document.createElement("iframe");i.setAttribute("allowfullscreen",""),i.name=JSON.stringify(t),i.src=e;var a=this.resetTransport(t);return this[l]=i,this[u]&&(this[u].innerHTML=""),null===(r=this[u])||void 0===r||r.appendChild(this.frameStyle),null===(n=this[u])||void 0===n||n.appendChild(this[l]),a.listen((function(e,t,r){r&&r!==o.uuid||o[f].emit(e,t)})),a},t.prototype.openElement=function(e,t,r,n){var o=(0,s.fileInfo)(e.path||"");t.type===p.ExtensionType.WorkDir&&(o.dir=(0,s.pathJoin)(o.dir,o.base),o.base="",o.name="");var i={},a={};e.root===p.StorageRoot.divide&&(i.divide_id=Number(e.rootId),o.dir=(0,s.pathJoin)("/",e.path||""),e.divideDir||(o.dir="/")),e.root===p.StorageRoot.fca&&(i.disk_id=Number(e.rootId)),e.root===p.StorageRoot.share&&(i.share_token=e.share_token,a.Authorization="Sharing ".concat(e.share_token),e.share_password&&(i.share_pass=e.share_password),a.SharePass=e.share_password);var c={debug:!!this.debug,view:this.view,extenstion:{id:(null==t?void 0:t.id)||0,name:(null==t?void 0:t.name)||{ru:""},type:(null==t?void 0:t.type)||p.ExtensionType.File},api:{host:this.origin,prefix:this.apiPrefix,headers:a,query:i},user:r,storage:{info:o,root:e.root,rootID:e.rootId,path:e.path},initialNavigation:n,setting:t.settings};this.send(p.TransportEvent.AppReady,c)},t.prototype.mergeParams=function(e){return i({version:1,engine:c.EngineType.PostMessage,uuid:this.uuid},e)},t.prototype.resetTransport=function(e){var t;null===(t=this[d])||void 0===t||t.destroy();var r=new c.NBTransport(e);return this[d]=r,r.subscribe(),r},Object.defineProperty(t.prototype,"frameStyle",{get:function(){var e=document.createElement("style");return e.textContent="\n iframe {\n display: block;\n width: inherit;\n height: inherit;\n border: none;\n background: none;\n }\n ",e},enumerable:!1,configurable:!0}),r=f,t.observedAttributes=["apiPrefix","origin","version","view","debug","uuid","navigationState","user"],t}(HTMLElement)},615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserNavigate=void 0;var n=r(424),o=r(837);t.browserNavigate=function(e){if((0,o.isBrowser)()){var t=(0,n.getGlobal)(),r=e.path,i=e.queryParams,a=new URL(r||"",window.origin),s=i||{};Object.keys(s).forEach((function(e){var t=s[e];t&&a.searchParams.append(e,t.toString())})),t.history.pushState({},"",a.toString())}}},755:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0;var n=r(796);t.defaultState=function(){return{extenstion:{id:0,name:{},type:n.ExtensionType.File},api:{host:window.location.origin,prefix:"/api/v1",headers:{},query:{}},debug:!0,view:n.ViewState.view,storage:{root:n.StorageRoot.my,rootID:0,path:"",info:{base:"",dir:"",ext:"",name:"",root:""}}}}},223:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dirname=void 0;var n=r(470).sep,o=r(307);t.dirname=function(e){if(0===(e=(0,o.pathJoin)(n,e)).length)return".";for(var t=e.charCodeAt(0),r=47===t,i=-1,a=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!a){i=s;break}}else a=!1;return-1===i?r?n:".":r&&1===i?n+n:e.slice(0,i)}},572:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fileInfo=void 0;var n=r(470).sep,o=r(307);t.fileInfo=function(e){var t={root:"",dir:"",base:"",ext:"",name:""};if(0===(e=(0,o.pathJoin)(n,e)).length)return t;var r,i=e.charCodeAt(0),a=47===i;a?(t.root=n,r=1):r=0;for(var s=-1,c=0,p=-1,u=!0,l=e.length-1,d=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===p&&(u=!1,p=l+1),46===i?-1===s?s=l:1!==d&&(d=1):-1!==s&&(d=-1);else if(!u){c=l+1;break}return-1===s||-1===p||0===d||1===d&&s===p-1&&s===c+1?-1!==p&&(t.base=t.name=0===c&&a?e.slice(1,p):e.slice(c,p)):(0===c&&a?(t.name=e.slice(1,s),t.base=e.slice(1,p)):(t.name=e.slice(c,s),t.base=e.slice(c,p)),t.ext=e.slice(s,p)),c>0?t.dir=e.slice(0,c-1):a&&(t.dir=n),t}},395:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getConfigData=void 0;var n=r(796);t.getConfigData=function(e){var t,r,o,i,a={name:e.name,type:e.type,icon:e.icon,pictogram:"",index:""};switch(e.type){case n.ExtensionType.File:a.index=(null===(t=e.file)||void 0===t?void 0:t.index)||"";break;case n.ExtensionType.WorkDir:a.index=(null===(r=e.work_dir)||void 0===r?void 0:r.index)||"";break;case n.ExtensionType.App:a.index=(null===(o=e.app)||void 0===o?void 0:o.menu.index)||"",a.pictogram=(null===(i=e.app)||void 0===i?void 0:i.menu.icon)||""}return a}},424:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobal=void 0;var n=r(837);t.getGlobal=function(){return(0,n.isBrowser)()?window:r.g}},566:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getLang=void 0,t.getLang=function(e,t){if(void 0===t&&(t="ru"),e[t])return e[t];var r=Object.keys(e).pop();return r&&e[r]?e[r]:""}},462:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(223),t),o(r(572),t),o(r(566),t),o(r(719),t),o(r(307),t),o(r(392),t),o(r(299),t),o(r(424),t),o(r(837),t),o(r(8),t),o(r(867),t),o(r(538),t),o(r(742),t),o(r(395),t),o(r(858),t),o(r(615),t)},837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=void 0,t.isBrowser=function(){return"undefined"!=typeof window}},8:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=void 0,t.isObject=function(e){return null!=e&&"Object"===e.constructor.name}},867:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isString=void 0,t.isString=function(e){return"[object String]"===Object.prototype.toString.call(e)}},538:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notificateRequestError=void 0;var n=r(11);t.notificateRequestError=function(e,t){n.Transport.send(n.TransportEvent.ExtRequestError,{status:e,message:t})}},719:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parentURL=void 0,t.parentURL=function(){return new URL(window.location!=window.parent.location?document.referrer:document.location.href)}},307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pathJoin=void 0;var n=r(470).sep;t.pathJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=[],o=0,i=e.length;o<i;o++)r=r.concat(e[o].split(n));var a=[];for(o=0,i=r.length;o<i;o++){var s=r[o];s&&"."!==s&&(".."===s?a.pop():a.push(s))}return""===r[0]&&a.unshift(""),a.join(n)||(a.length?n:".")}},742:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeJson=void 0,t.safeJson=function(e,t){try{return JSON.parse(e)}catch(e){return t}}},392:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.sendRequest2=t.sendRequest=void 0;var o=r(538),i=r(307),a=function(){return window.parent._nb_handlers.updateToken&&window.parent._nb_handlers.updateToken(),Promise.resolve()};t.sendRequest=function(e,t){return a().then((function(){return fetch(e,t)})).then((function(e){return e.status>=400&&(0,o.notificateRequestError)(e.status,""),e})).catch((function(e){throw e.status>=400&&(0,o.notificateRequestError)(e.status,e.message),e}))},t.sendRequest2=function(e,t,r){var o,p=n({},r.headers);r.params&&(t+="?"+s(r.params)),r.body instanceof FormData?o=r.body:(p["Content-Type"]="application/json",o=JSON.stringify(r.body)),r.prefix&&(t=(0,i.pathJoin)(r.prefix,t));var u={method:e,cache:r.cache,headers:p,body:o};return a().then((function(){return fetch(new URL(decodeURI(t),r.host),u)})).then((function(e){var t=e.headers.get("content-type");return(null==t?void 0:t.indexOf("/json"))?e.json():(null==t?void 0:t.indexOf("/text"))?e.text():e})).catch((function(e){throw c(e.status,e.message),e}))};var s=function(e){var t=new URLSearchParams;return Object.keys(e).forEach((function(r){Array.isArray(e[r])?e[r].forEach((function(e){t.append(r,e)})):t.append(r,e[r])})),t},c=function(e,t){e>=400&&(0,o.notificateRequestError)(e,t)}},299:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.translite=void 0;var r={а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",ё:"e",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",р:"r",с:"s",т:"t",у:"u",ф:"f",х:"h",ц:"c",ч:"cz",ш:"sh",щ:"scz",ы:"y",ь:"",э:"e",ю:"u",я:"ja"," ":"-"};t.translite=function(e){return(e=(e=(e=(e=(e=e.toLocaleLowerCase()).trim()).replace(/ -/gi,"-")).replace(/- /gi,"-")).replace(/\s{2,}/gi," ")).split("").map((function(e){return/[a-z0-9]/i.test(e)?e:r[e]||""})).join("")}},858:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.transportProps=void 0;var o=(0,r(424).getGlobal)();t.transportProps=function(){return n(n({},o._nb_global_props),i())};var i=function(){try{return JSON.parse(window.name||"")}catch(e){return{}}}},495:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.NextBox=void 0;var i=r(970),a=r(462),s=r(755),c=r(831),p=r(512),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.init=function(e){var t=this,r=function(e){return t.state=e};if(!c.Transport.engineType){var n=(0,s.defaultState)();r(n),e&&e(n)}c.Transport.on(p.TransportEvent.AppReady,(function(t){r(t),e&&e(t)})),c.Transport.on(p.TransportEvent.AppReload,(function(){window.location.reload()})),c.Transport.on(p.TransportEvent.AppChangeState,r),c.Transport.send(p.TransportEvent.ExtInit)},t.prototype.prepareNavigate=function(){var e,t=null===(e=this.state)||void 0===e?void 0:e.initialNavigation;(null==t?void 0:t.target)&&[p.TransportNavigationTarget.Cache,p.TransportNavigationTarget.Self].includes(t.target)&&(0,a.browserNavigate)(t)},t}(i.EventEmitter);t.NextBox=u},708:()=>{"use strict";!function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.polyfillWrapFlushCallback){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}()},626:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(708)},185:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportEmpty=void 0;var r=function(){function e(){}return e.prototype.send=function(e,t){},e.prototype.subscribe=function(e){},e.prototype.destroy=function(){},e}();t.TransportEmpty=r},176:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(595),t),o(r(831),t)},595:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},521:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportPostMessage=void 0;var n=r(462),o=function(){function e(e){var t=this;this.listenHandler=function(e){var r=e.data.event,n=e.data.uuid,o=e.data.payload;try{o=JSON.parse(e.data.payload)}catch(e){}t.handler&&t.handler(r,o,n)},this._parems=e}return Object.defineProperty(e.prototype,"parent",{get:function(){var e,t;return(null===(e=this._parems)||void 0===e?void 0:e.parent)?null===(t=this._parems)||void 0===t?void 0:t.parent:(0,n.isBrowser)()?parent:null},enumerable:!1,configurable:!0}),e.prototype.send=function(e,t){var r,n;null===(r=this.parent)||void 0===r||r.postMessage({event:e,uuid:null===(n=this._parems)||void 0===n?void 0:n.uuid,payload:function(){try{return JSON.stringify(t)}catch(e){return t}}()},document.location.origin)},e.prototype.subscribe=function(e){var t;this.handler=e,null===(t=this.parent)||void 0===t||t.addEventListener("message",this.listenHandler)},e.prototype.destroy=function(){var e;null===(e=this.parent)||void 0===e||e.removeEventListener("message",this.listenHandler)},e}();t.TransportPostMessage=o},831:function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=t.NBTransport=t.TransportParentHandlers=t.EngineType=void 0;var a,s=r(512),c=r(970),p=r(521),u=r(424),l=r(7),d=r(185),f=r(858),h=r(462);!function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(a=t.EngineType||(t.EngineType={}));var v=(0,f.transportProps)(),y=(0,u.getGlobal)();t.TransportParentHandlers={},y._nb_handlers=t.TransportParentHandlers;var g=function(e){function r(t){var r=e.call(this)||this;return r.engineType=a.Empty,r._params=i(i({},t),v),r.engineType=r._params.engine||a.Empty,r.engine=new d.TransportEmpty,r.engineType===a.PostMessage&&(r.engine=new p.TransportPostMessage(r._params)),r.engineType===a.WebSocket&&(r.engine=new l.TransportWebsocket(r._params)),r}return o(r,e),r.prototype.send=function(e,t){var r;(null===(r=this._params)||void 0===r?void 0:r.debug)&&console.log("transport.send",this._params,e,t),this.engine.send(e,t)},r.prototype.subscribe=function(){var e=this;this.engine.subscribe((function(t,r,n){var o,i,a;t&&(((null===(o=e._params)||void 0===o?void 0:o.version)||0)>0&&n!==(null===(i=e._params)||void 0===i?void 0:i.uuid)||((null===(a=e._params)||void 0===a?void 0:a.debug)&&console.log("transport.message",e._params,n,t,r),e.emit(t,r,n)))}))},r.prototype.destroy=function(){this.engine.destroy()},r.prototype.changeContent=function(e){t.Transport.send(s.TransportEvent.ExtChangeContent,e)},r.prototype.navigate=function(e,r,n){void 0===n&&(n=s.TransportNavigationTarget.Cache);var o={path:e,queryParams:r,target:n};t.Transport.send(s.TransportEvent.ExtNavigateTo,o),n===s.TransportNavigationTarget.Self&&(0,h.browserNavigate)(o)},r.prototype.close=function(){t.Transport.send(s.TransportEvent.ExtClose)},r.prototype.openModalFilesSelect=function(e){t.Transport.send(s.TransportEvent.ExtOpenModalFilesSelect,e)},r.prototype.openModalConfirm=function(e){t.Transport.send(s.TransportEvent.ExtShowConfirm,e)},r.prototype.toast=function(e){t.Transport.send(s.TransportEvent.ExtToast,e)},r.prototype.setSpinnerStatus=function(e){t.Transport.send(s.TransportEvent.ExtSpinner,e)},r.prototype.setContext=function(e){t.Transport.send(s.TransportEvent.ExtContext,e)},r.prototype.setTabs=function(e){t.Transport.send(s.TransportEvent.ExtTabs,e)},r}(c.EventEmitter);t.NBTransport=g,y._nb_transport instanceof g||(y._nb_transport=new g({engine:a.PostMessage}),y._nb_transport.subscribe()),t.Transport=y._nb_transport},7:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TransportWebsocket=void 0;var r=Symbol("transport-socket"),n=function(){function e(e){this._params=e,window[r]||this.init(e)}return e.prototype.init=function(e){var t=(null==e?void 0:e.host)||"localhost",n=(null==e?void 0:e.port)||8999,o=(null==e?void 0:e.path)||"";window[r]=new WebSocket("ws://".concat(t,":").concat(n).concat(o)),window[r].onopen=function(){},window[r].onclose=function(e){e.wasClean?console.log("Соединение закрыто"):console.log("Обрыв соединения"),console.log("Код: "+e.code+" причина: "+e.reason)},window[r].onerror=function(e){console.log("Ошибка подключения ws: "+e.message)}},e.prototype.send=function(e,t){var n,o=this;window[r]&&(window[r].readyState?window[r].send(JSON.stringify({event:e,payload:t,uuid:null===(n=this._params)||void 0===n?void 0:n.uuid})):setTimeout((function(){o.send(e,t)}),100))},e.prototype.subscribe=function(e){window[r]&&(window[r].onmessage=function(t){try{var r=JSON.parse(t.data),n=r.event,o=r.payload,i=r.uuid;e(n,o,i)}catch(e){}})},e.prototype.destroy=function(){window[r]&&(window[r].close(),window[r]=null)},e}();t.TransportWebsocket=n},85:(e,t)=>{"use strict";var r,n,o,i;Object.defineProperty(t,"__esModule",{value:!0}),t.RequestStatus=t.PermissionType=t.ExtensionFileMode=t.ExtensionType=void 0,(i=t.ExtensionType||(t.ExtensionType={})).App="app",i.File="file",i.WorkDir="work_dir",(o=t.ExtensionFileMode||(t.ExtensionFileMode={})).Read="read",o.Write="write",o.ReadAndWrite="read_and_write",(n=t.PermissionType||(t.PermissionType={})).CLOSE="",n.READ="r",n.WRITE="rw",(r=t.RequestStatus||(t.RequestStatus={}))[r.Wait=0]="Wait",r[r.Done=1]="Done",r[r.Reject=2]="Reject"},745:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},796:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(85),t),o(r(492),t),o(r(517),t),o(r(512),t),o(r(745),t),o(r(548),t),o(r(143),t),o(r(738),t)},143:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SettingControlType=void 0,(r=t.SettingControlType||(t.SettingControlType={})).Text="text",r.String="string",r.Number="number",r.CheckBox="checkbox",r.Select="select",r.RadioList="radio_list",r.ConnectionChoose="connection_choose",r.MultiConnectionChoose="multi_connection_choose"},492:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ViewState=void 0,(r=t.ViewState||(t.ViewState={})).view="view",r.edit="edit"},517:(e,t)=>{"use strict";var r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.StorageElementContentType=t.StorageElementType=t.StorageRoot=void 0,(o=t.StorageRoot||(t.StorageRoot={})).my="my",o.fca="fca",o.divide="divide",o.share="share",o.favorite="favorite",(n=t.StorageElementType||(t.StorageElementType={})).Dir="dir",n.File="file",n.WorkDir="work_dir",(r=t.StorageElementContentType||(t.StorageElementContentType={})).Any="any",r.Dir="dir",r.Code="code",r.Image="image",r.Audio="audio",r.Video="video",r.Text="text",r.Doc="doc",r.Xls="xls",r.Ppt="ppt"},512:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.TransportNavigationTarget=t.TransportEvent=void 0,(n=t.TransportEvent||(t.TransportEvent={})).ExtInit="ext-init",n.ExtChangeContent="ext-change-content",n.ExtOpenModalFilesSelect="ext-open-modal-files-select",n.ExtShowConfirm="ext-show-confirm",n.ExtNavigateTo="ext-navigate-to",n.ExtRequestError="ext-request-error",n.ExtToast="ext-toast",n.ExtSpinner="ext-spinner",n.ExtContext="ext-context",n.ExtTabs="ext-tabs",n.ExtSavedStart="ext-saved-start",n.ExtSavedEnd="ext-saved-end",n.ExtSavedError="ext-saved-error",n.ExtClose="ext-close",n.AppReload="ext-reload",n.AppReady="app-ready",n.AppChangeState="app-change-state",n.AppSaveAndClose="app-save-and-close",n.AppFilesSelected="app-files-selected",n.AppConfirmAccept="app-confirm-accept",n.AppConfirmReject="app-confirm-reject",n.AppContextAction="app-context-action",n.AppTabAction="app-tab-action",(r=t.TransportNavigationTarget||(t.TransportNavigationTarget={})).Parent="_parent",r.Self="_self",r.Cache="_cache"},548:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.UserStatus=void 0,(r=t.UserStatus||(t.UserStatus={})).Registering="registering",r.Activated="activated",r.Blocked="blocked",r.BlockedByLicense="blocked_by_license"},607:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(626),o(r(495),t),o(r(796),t),o(r(176),t),o(r(462),t),o(r(534),t),o(r(181),t),o(r(455),t)}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(607)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-box",
3
- "version": "2.5.5",
3
+ "version": "2.5.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",