next-box 2.0.27 → 2.0.34

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.
@@ -1 +1 @@
1
- export declare function pathJoin(...args: string[]): string;
1
+ export declare function pathJoin(...args: string[]): any;
@@ -3,7 +3,7 @@ export declare enum StorageRoot {
3
3
  my = "my",
4
4
  fca = "fca",
5
5
  divide = "divide",
6
- publick = "share",
6
+ share = "share",
7
7
  favorite = "favorite"
8
8
  }
9
9
  export interface StorageElement {
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,(()=>(()=>{"use strict";var e={181:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(481),t),r(n(861),t)},481:function(e,t,n){var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(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 n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.StaticApi=void 0;var a=n(892),s=n(392),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.upload=function(e,t,n){void 0===n&&(n="");var o=new FormData;return o.set("file",e),(0,s.sendRequest)(this.makeApiPath(n,t),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:o}).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=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.makeApiPath.apply(this,i(["static/files"],t,!1))},t}(a.Api);t.StaticApi=p},861:function(e,t,n){var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(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 n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.StorageApi=void 0;var a=n(307),s=n(892),p=n(566),c=n(392),u=n(299),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.info=function(e){return(0,c.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,n){return(0,c.sendRequest)(this.makeApiPath("/element"),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:JSON.stringify({name:e,path:this.relativePath(t),type:n,divide_id:this.state.api.query.divide_id||null})}).then(this.responseJSON)},t.prototype.delete=function(e,t){return(0,c.sendRequest)(this.makeApiPath("/element")+this.makeSearchParams({path:e,hard:t}),{method:"DELETE",headers:this.makeHeaders()})},t.prototype.download=function(e){return(0,c.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,c.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 n=new FormData;return n.set("path",this.relativePath(e)),n.set("file",t),(0,c.sendRequest)(this.makeApiPath("/files"),{method:"POST",body:n,headers:this.makeHeaders()}).then(this.responseJSON)},t.prototype.uploadNet=function(e,t,n){return void 0===n&&(n=!1),(0,c.sendRequest)(this.makeApiPath("/files/net"),{method:"POST",headers:this.makeHeaders({"Content-Type":"application/json"}),body:JSON.stringify({url:t,overwrite:n,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=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o="storage";return"fca"===this.state.storage.root&&(o="disk/".concat(this.state.storage.rootID)),e.prototype.makeApiPath.apply(this,i([o],t,!1))},Object.defineProperty(t.prototype,"metaName",{get:function(){return"."+(0,u.translite)((0,p.getLang)(this.state.extenstion.name))},enumerable:!1,configurable:!0}),t}(s.Api);t.StorageApi=l},892:function(e,t,n){var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},o.apply(this,arguments)},r=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Api=void 0;var i=n(462),a=n(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=o(o({},this.state.api.query),e),"?"+new URLSearchParams(e)},e.prototype.makeHeaders=function(e){return o(o({},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,r([this.state.api.prefix],e,!1))),this.state.api.host)},e}();t.Api=s},970:function(e,t){var n=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter=void 0;var o=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 n;this._handlers.has(e)||this._handlers.set(e,new Set),null===(n=this._handlers.get(e))||void 0===n||n.add(t)},e.prototype.off=function(e,t){var n;null===(n=this._handlers.get(e))||void 0===n||n.delete(t)},e.prototype.emit=function(e){for(var t,o=[],r=1;r<arguments.length;r++)o[r-1]=arguments[r];null===(t=this._handlers.get(e))||void 0===t||t.forEach((function(e){e&&e.apply(void 0,o)})),this._globalHandlers.forEach((function(t){t.apply(void 0,n([e],o,!1))}))},e}();t.EventEmitter=o},534:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(892),t),r(n(970),t)},755:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.defaultState=void 0;var o=n(796);t.defaultState=function(){return{extenstion:{id:0,name:{},type:o.ExtensionType.File},api:{host:window.location.origin,prefix:"/api/v1",headers:{},query:{}},debug:!0,view:o.ViewState.view,brouserURL:"",storage:{root:o.StorageRoot.my,rootID:0,path:"",info:{base:"",dir:"",ext:"",name:"",root:""}}}}},223:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dirname=void 0;var o=n(307);t.dirname=function(e){if(0===(e=(0,o.pathJoin)("/",e)).length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"//":e.slice(0,r)}},572:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.fileInfo=void 0;var o=n(307);t.fileInfo=function(e){var t={root:"",dir:"",base:"",ext:"",name:""};if(0===(e=(0,o.pathJoin)("/",e)).length)return t;var n,r=e.charCodeAt(0),i=47===r;i?(t.root="/",n=1):n=0;for(var a=-1,s=0,p=-1,c=!0,u=e.length-1,l=0;u>=n;--u)if(47!==(r=e.charCodeAt(u)))-1===p&&(c=!1,p=u+1),46===r?-1===a?a=u:1!==l&&(l=1):-1!==a&&(l=-1);else if(!c){s=u+1;break}return-1===a||-1===p||0===l||1===l&&a===p-1&&a===s+1?-1!==p&&(t.base=t.name=0===s&&i?e.slice(1,p):e.slice(s,p)):(0===s&&i?(t.name=e.slice(1,a),t.base=e.slice(1,p)):(t.name=e.slice(s,a),t.base=e.slice(s,p)),t.ext=e.slice(a,p)),s>0?t.dir=e.slice(0,s-1):i&&(t.dir="/"),t}},424:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getGlobal=void 0;var o=n(837);t.getGlobal=function(){return(0,o.isBrowser)()?window:n.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 n=Object.keys(e).pop();return n&&e[n]?e[n]:""}},462:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(223),t),r(n(572),t),r(n(566),t),r(n(719),t),r(n(307),t),r(n(392),t),r(n(299),t),r(n(424),t),r(n(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)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.pathJoin=void 0,t.pathJoin=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=[],o=0,r=e.length;o<r;o++)n=n.concat(e[o].split("/"));var i=[];for(o=0,r=n.length;o<r;o++){var a=n[o];a&&"."!==a&&(".."===a?i.pop():i.push(a))}return""===n[0]&&i.unshift(""),i.join("/")||(i.length?"/":".")}},392:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sendRequest=void 0;var o=n(831),r=n(512);t.sendRequest=function(e,t){return fetch(e,t).then((function(e){return parent!==window&&([401].includes(e.status)&&(parent.location.href="/auth"),(400===e.status||e.status>401)&&o.Transport.send(r.TransportEvent.ExtRequestError,e)),e}))}},299:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.translite=void 0;var n={а:"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:n[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,n){var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(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 n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.NextBox=void 0;var i=n(970),a=n(755),s=n(831),p=n(512),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.init=function(e){var t=this,n=function(e){return t.state=e};if(!s.Transport.engineType){var o=(0,a.defaultState)();n(o),e&&e(o)}s.Transport.on(p.TransportEvent.AppReady,(function(t){n(t),e&&e(t)})),s.Transport.on(p.TransportEvent.AppReload,(function(){window.location.reload()})),s.Transport.on(p.TransportEvent.AppChangeState,n),s.Transport.send(p.TransportEvent.ExtInit)},t}(i.EventEmitter);t.NextBox=c},185:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransportEmpty=void 0;var n=function(){function e(){}return e.prototype.send=function(e,t){},e.prototype.subscribe=function(e){},e}();t.TransportEmpty=n},176:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(595),t),r(n(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 n=function(){function e(){}return e.prototype.send=function(e,t){if(parent!==window){var n=new URL(window.location!=window.parent.location?document.referrer:document.location.href);parent.postMessage({event:e,payload:t},n.origin)}},e.prototype.subscribe=function(e){window.addEventListener("message",(function(t){var n=t.data.event,o=t.data.payload;e(n,o)}))},e}();t.TransportPostMessage=n},831:function(e,t,n){var o,r=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(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 n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Transport=t.NBTransport=t.EngineType=void 0;var i,a=n(512),s=n(970),p=n(521),c=n(424),u=n(742),l=n(185),d=n(858);!function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(i=t.EngineType||(t.EngineType={}));var f=function(e){function n(t){var n=e.call(this)||this;n.engineType=i.Empty,n.debug=!1;var o=(0,d.transportProps)();return n.engineType=t||o.engine||i.Empty,n.engine=new l.TransportEmpty,n.engineType===i.PostMessage&&(n.engine=new p.TransportPostMessage),n.engineType===i.WebSocket&&(n.engine=new u.TransportWebsocket),n}return r(n,e),n.prototype.send=function(e,t){this.engine.send(e,t)},n.prototype.subscribe=function(){var e=this;this.engine.subscribe((function(t,n){t&&(e.debug&&console.log("frame.message",t,n),e.emit(t,n))}))},n.prototype.changeContent=function(e){t.Transport.send(a.TransportEvent.ExtChangeContent,e)},n.prototype.navigate=function(e,n){t.Transport.send(a.TransportEvent.ExtNavigateTo,{path:e,queryParams:n})},n.prototype.close=function(){t.Transport.send(a.TransportEvent.ExtClose)},n.prototype.openModalFilesSelect=function(e){t.Transport.send(a.TransportEvent.ExtOpenModalFilesSelect,e)},n}(s.EventEmitter);t.NBTransport=f;var h=(0,c.getGlobal)();h._nb_transport instanceof f||(h._nb_transport=new f,h._nb_transport.subscribe()),t.Transport=h._nb_transport},742:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransportWebsocket=void 0;var o=n(858),r=Symbol("transport-socket"),i=function(){function e(){window[r]||this.init()}return e.prototype.init=function(){var e=(0,o.transportProps)(),t=e.host||"localhost",n=e.port||8999;window[r]=new WebSocket("ws://".concat(t,":").concat(n)),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=this;window[r].readyState?window[r].send(JSON.stringify({event:e,payload:t})):setTimeout((function(){n.send(e,t)}),100)},e.prototype.subscribe=function(e){window[r].onmessage=function(t){try{var n=JSON.parse(t.data),o=n.event,r=n.payload;e(o,r)}catch(e){}}},e}();t.TransportWebsocket=i},85:(e,t)=>{var n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.ExtensionFileMode=t.ExtensionType=void 0,(o=t.ExtensionType||(t.ExtensionType={})).App="app",o.File="file",o.WorkDir="work_dir",(n=t.ExtensionFileMode||(t.ExtensionFileMode={})).Read="read",n.Write="write",n.ReadAndWrite="read_and_write"},745:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},796:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(85),t),r(n(492),t),r(n(517),t),r(n(512),t),r(n(745),t),r(n(548),t)},492:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ViewState=void 0,(n=t.ViewState||(t.ViewState={})).view="view",n.edit="edit"},517:(e,t)=>{var n,o,r;Object.defineProperty(t,"__esModule",{value:!0}),t.StorageElementContentType=t.StorageElementType=t.StorageRoot=void 0,(r=t.StorageRoot||(t.StorageRoot={})).my="my",r.fca="fca",r.divide="divide",r.publick="share",r.favorite="favorite",(o=t.StorageElementType||(t.StorageElementType={})).Dir="dir",o.File="file",o.WorkDir="work_dir",(n=t.StorageElementContentType||(t.StorageElementContentType={})).Any="any",n.Dir="dir",n.Code="code",n.Image="image",n.Audio="audio",n.Video="video",n.Text="text",n.Doc="doc",n.Xls="xls",n.Ppt="ppt"},512:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),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.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"},548:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SystemUserRole=void 0,(n=t.SystemUserRole||(t.SystemUserRole={})).ADMIN="admin",n.USER="user"},607:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(495),t),r(n(796),t),r(n(176),t),r(n(462),t),r(n(534),t),r(n(181),t)}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(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,(()=>(()=>{"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,l=-1,u=0;u<=p;++u){if(u===p){if(c>p){if(47===r.charCodeAt(s+u))return r.slice(s+u+1);if(0===u)return r.slice(s+u)}else a>p&&(47===e.charCodeAt(o+u)?l=u:0===u&&(l=0));break}var f=e.charCodeAt(o+u);if(f!==r.charCodeAt(s+u))break;47===f&&(l=u)}var d="";for(u=o+l+1;u<=i;++u)u!==i&&47!==e.charCodeAt(u)||(0===d.length?d+="..":d+="/..");return d.length>0?d+r.slice(s+l):(s+=l,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,l=e.length-1,u=0;l>=n;--l)if(47!==(o=e.charCodeAt(l)))-1===c&&(p=!1,c=l+1),46===o?-1===a?a=l:1!==u&&(u=1):-1!==a&&(u=-1);else if(!p){s=l+1;break}return-1===a||-1===c||0===u||1===u&&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),l=r(299),u=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.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,l.translite)((0,c.getLang)(this.state.extenstion.name))},enumerable:!1,configurable:!0}),t}(s.Api);t.StorageApi=u},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,l=!0,u=e.length-1,f=0;u>=r;--u)if(47!==(i=e.charCodeAt(u)))-1===p&&(l=!1,p=u+1),46===i?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!l){c=u+1;break}return-1===s||-1===p||0===f||1===f&&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&&([401].includes(e.status)&&(parent.location.href="/auth"),(400===e.status||e.status>401)&&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),l=r(742),u=r(185),f=r(858);!function(e){e.WebSocket="websocket",e.PostMessage="postmessage",e.Empty=""}(i=t.EngineType||(t.EngineType={}));var d=function(e){function r(t){var r=e.call(this)||this;r.engineType=i.Empty,r.debug=!1;var n=(0,f.transportProps)();return r.engineType=t||n.engine||i.Empty,r.engine=new u.TransportEmpty,r.engineType===i.PostMessage&&(r.engine=new c.TransportPostMessage),r.engineType===i.WebSocket&&(r.engine=new l.TransportWebsocket),r}return o(r,e),r.prototype.send=function(e,t){this.engine.send(e,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}(s.EventEmitter);t.NBTransport=d;var h=(0,p.getGlobal)();h._nb_transport instanceof d||(h._nb_transport=new d,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)})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-box",
3
- "version": "2.0.27",
3
+ "version": "2.0.34",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -12,5 +12,8 @@
12
12
  "setupFiles": [
13
13
  "./setupJest.js"
14
14
  ]
15
+ },
16
+ "dependencies": {
17
+ "path-browserify": "^1.0.1"
15
18
  }
16
19
  }