frappe-react-sdk 1.3.6 → 1.3.7
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,5 +1,5 @@
|
|
|
1
|
-
(function(A,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],d):(A=typeof globalThis<"u"?globalThis:A||self,d(A["Frappe React"]={},A.React))})(this,function(A,d){"use strict";var ja=Object.defineProperty;var Ma=(A,d,Ue)=>d in A?ja(A,d,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):A[d]=Ue;var ke=(A,d,Ue)=>(Ma(A,typeof d!="symbol"?d+"":d,Ue),Ue);const De=(n=>n&&typeof n=="object"&&"default"in n?n:{default:n})(d);var N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Wt={},Xe={},Qe={},ue=N&&N.__assign||function(){return ue=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},ue.apply(this,arguments)},pt=N&&N.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function u(h){try{a(r.next(h))}catch(f){o(f)}}function l(h){try{a(r.throw(h))}catch(f){o(f)}}function a(h){h.done?i(h.value):s(h.value).then(u,l)}a((r=r.apply(n,e||[])).next())})},vt=N&&N.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(h){return l([a,h])}}function l(a){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,s&&(i=a[0]&2?s.return:a[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;switch(s=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,s=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1],i=a;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(a);break}i[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(n,t)}catch(h){a=[6,h],s=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.FrappeCall=void 0;var Ps=function(){function n(e,t,r,s,i){this.appURL=e,this.axios=t,this.useToken=r!=null?r:!1,this.token=s,this.tokenType=i}return n.prototype.get=function(e,t){return pt(this,void 0,void 0,function(){return vt(this,function(r){return[2,this.axios.get("/api/method/".concat(e),{params:t}).then(function(s){return s.data}).catch(function(s){var i,o;throw ue(ue({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(i=s.response.data.message)!==null&&i!==void 0?i:"There was an error.",exception:(o=s.response.data.exception)!==null&&o!==void 0?o:""})})]})})},n.prototype.post=function(e,t){return pt(this,void 0,void 0,function(){return vt(this,function(r){return[2,this.axios.post("/api/method/".concat(e),ue({},t)).then(function(s){return s.data}).catch(function(s){var i,o;throw ue(ue({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(i=s.response.data.message)!==null&&i!==void 0?i:"There was an error.",exception:(o=s.response.data.exception)!==null&&o!==void 0?o:""})})]})})},n.prototype.put=function(e,t){return pt(this,void 0,void 0,function(){return vt(this,function(r){return[2,this.axios.put("/api/method/".concat(e),ue({},t)).then(function(s){return s.data}).catch(function(s){var i,o;throw ue(ue({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(i=s.response.data.message)!==null&&i!==void 0?i:"There was an error.",exception:(o=s.response.data.exception)!==null&&o!==void 0?o:""})})]})})},n.prototype.delete=function(e,t){return pt(this,void 0,void 0,function(){return vt(this,function(r){return[2,this.axios.delete("/api/method/".concat(e),{params:t}).then(function(s){return s.data}).catch(function(s){var i,o;throw ue(ue({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(i=s.response.data.message)!==null&&i!==void 0?i:"There was an error.",exception:(o=s.response.data.exception)!==null&&o!==void 0?o:""})})]})})},n}();Qe.FrappeCall=Ps;var Ze={},J=N&&N.__assign||function(){return J=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},J.apply(this,arguments)},Le=N&&N.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function u(h){try{a(r.next(h))}catch(f){o(f)}}function l(h){try{a(r.throw(h))}catch(f){o(f)}}function a(h){h.done?i(h.value):s(h.value).then(u,l)}a((r=r.apply(n,e||[])).next())})},Ne=N&&N.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(h){return l([a,h])}}function l(a){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,s&&(i=a[0]&2?s.return:a[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;switch(s=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,s=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1],i=a;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(a);break}i[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(n,t)}catch(h){a=[6,h],s=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.FrappeDB=void 0;var Bs=function(){function n(e,t,r,s,i){this.appURL=e,this.axios=t,this.useToken=r!=null?r:!1,this.token=s,this.tokenType=i}return n.prototype.getDoc=function(e,t){return t===void 0&&(t=""),Le(this,void 0,void 0,function(){return Ne(this,function(r){return[2,this.axios.get("/api/resource/".concat(e,"/").concat(t)).then(function(s){return s.data.data}).catch(function(s){var i,o;throw J(J({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:"There was an error while fetching the document.",exception:(o=(i=s.response.data.exception)!==null&&i!==void 0?i:s.response.data.exc_type)!==null&&o!==void 0?o:""})})]})})},n.prototype.getDocList=function(e,t){var r;return Le(this,void 0,void 0,function(){var s,i,o,u,l,a,h,f,v,y,w;return Ne(this,function(E){return s={},t&&(i=t.fields,o=t.filters,u=t.orFilters,l=t.orderBy,a=t.limit,h=t.limit_start,f=t.groupBy,v=t.asDict,y=v===void 0?!0:v,w=l?"".concat(String(l==null?void 0:l.field)," ").concat((r=l==null?void 0:l.order)!==null&&r!==void 0?r:"asc"):"",s={fields:i?JSON.stringify(i):void 0,filters:o?JSON.stringify(o):void 0,or_filters:u?JSON.stringify(u):void 0,order_by:w,group_by:f,limit:a,limit_start:h,as_dict:y}),[2,this.axios.get("/api/resource/".concat(e),{params:s}).then(function(O){return O.data.data}).catch(function(O){var b,T;throw J(J({},O.response.data),{httpStatus:O.response.status,httpStatusText:O.response.statusText,message:"There was an error while fetching the documents.",exception:(T=(b=O.response.data.exception)!==null&&b!==void 0?b:O.response.data.exc_type)!==null&&T!==void 0?T:""})})]})})},n.prototype.createDoc=function(e,t){return Le(this,void 0,void 0,function(){return Ne(this,function(r){return[2,this.axios.post("/api/resource/".concat(e),J({},t)).then(function(s){return s.data.data}).catch(function(s){var i,o,u;throw J(J({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(i=s.response.data.message)!==null&&i!==void 0?i:"There was an error while creating the document.",exception:(u=(o=s.response.data.exception)!==null&&o!==void 0?o:s.response.data.exc_type)!==null&&u!==void 0?u:""})})]})})},n.prototype.updateDoc=function(e,t,r){return Le(this,void 0,void 0,function(){return Ne(this,function(s){return[2,this.axios.put("/api/resource/".concat(e,"/").concat(t),J({},r)).then(function(i){return i.data.data}).catch(function(i){var o,u,l;throw J(J({},i.response.data),{httpStatus:i.response.status,httpStatusText:i.response.statusText,message:(o=i.response.data.message)!==null&&o!==void 0?o:"There was an error while updating the document.",exception:(l=(u=i.response.data.exception)!==null&&u!==void 0?u:i.response.data.exc_type)!==null&&l!==void 0?l:""})})]})})},n.prototype.deleteDoc=function(e,t){return Le(this,void 0,void 0,function(){return Ne(this,function(r){return[2,this.axios.delete("/api/resource/".concat(e,"/").concat(t)).then(function(s){return s.data}).catch(function(s){var i,o;throw J(J({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:"There was an error while deleting the document.",exception:(o=(i=s.response.data.exception)!==null&&i!==void 0?i:s.response.data.exc_type)!==null&&o!==void 0?o:""})})]})})},n.prototype.getCount=function(e,t,r,s){return r===void 0&&(r=!1),s===void 0&&(s=!1),Le(this,void 0,void 0,function(){var i;return Ne(this,function(o){return i={doctype:e,filters:[]},r&&(i.cache=r),s&&(i.debug=s),t&&(i.filters=t?JSON.stringify(t):void 0),[2,this.axios.get("/api/method/frappe.client.get_count",{params:i}).then(function(u){return u.data.message}).catch(function(u){var l,a;throw J(J({},u.response.data),{httpStatus:u.response.status,httpStatusText:u.response.statusText,message:"There was an error while getting the count.",exception:(a=(l=u.response.data.exception)!==null&&l!==void 0?l:u.response.data.exc_type)!==null&&a!==void 0?a:""})})]})})},n.prototype.getLastDoc=function(e,t){return Le(this,void 0,void 0,function(){var r,s;return Ne(this,function(i){switch(i.label){case 0:return r={orderBy:{field:"creation",order:"desc"}},t&&(r=J(J({},r),t)),[4,this.getDocList(e,J(J({},r),{limit:1,fields:["name"]}))];case 1:return s=i.sent(),s.length>0?[2,this.getDoc(e,s[0].name)]:[2,{}]}})})},n}();Ze.FrappeDB=Bs;var $e={},yt=N&&N.__assign||function(){return yt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},yt.apply(this,arguments)},Us=N&&N.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function u(h){try{a(r.next(h))}catch(f){o(f)}}function l(h){try{a(r.throw(h))}catch(f){o(f)}}function a(h){h.done?i(h.value):s(h.value).then(u,l)}a((r=r.apply(n,e||[])).next())})},Is=N&&N.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(h){return l([a,h])}}function l(a){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,s&&(i=a[0]&2?s.return:a[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;switch(s=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,s=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1],i=a;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(a);break}i[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(n,t)}catch(h){a=[6,h],s=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty($e,"__esModule",{value:!0}),$e.FrappeFileUpload=void 0;var Vs=function(){function n(e,t,r,s,i){this.appURL=e,this.axios=t,this.useToken=r!=null?r:!1,this.token=s,this.tokenType=i}return n.prototype.uploadFile=function(e,t,r){return Us(this,void 0,void 0,function(){var s,i,o,u,l,a,h;return Is(this,function(f){return s=new FormData,e&&s.append("file",e,e.name),i=t.isPrivate,o=t.folder,u=t.file_url,l=t.doctype,a=t.docname,h=t.fieldname,i&&s.append("is_private","1"),o&&s.append("folder",o),u&&s.append("file_url",u),l&&a&&(s.append("doctype",l),s.append("docname",a),h&&s.append("fieldname",h)),[2,this.axios.post("/api/method/upload_file",s,{onUploadProgress:function(v){r&&r(v.loaded,v.total)}}).catch(function(v){var y,w;throw yt(yt({},v.response.data),{httpStatus:v.response.status,httpStatusText:v.response.statusText,message:(y=v.response.data.message)!==null&&y!==void 0?y:"There was an error while uploading the file.",exception:(w=v.response.data.exception)!==null&&w!==void 0?w:""})})]})})},n}();$e.FrappeFileUpload=Vs;var Ie={},Kn={exports:{}},Ht={exports:{}},Gn=function(e,t){return function(){for(var s=new Array(arguments.length),i=0;i<s.length;i++)s[i]=arguments[i];return e.apply(t,s)}},js=Gn,Ce=Object.prototype.toString;function Jt(n){return Array.isArray(n)}function Yt(n){return typeof n>"u"}function Ms(n){return n!==null&&!Yt(n)&&n.constructor!==null&&!Yt(n.constructor)&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function Xn(n){return Ce.call(n)==="[object ArrayBuffer]"}function qs(n){return Ce.call(n)==="[object FormData]"}function Ws(n){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&Xn(n.buffer),e}function Hs(n){return typeof n=="string"}function Js(n){return typeof n=="number"}function Qn(n){return n!==null&&typeof n=="object"}function mt(n){if(Ce.call(n)!=="[object Object]")return!1;var e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}function Ys(n){return Ce.call(n)==="[object Date]"}function zs(n){return Ce.call(n)==="[object File]"}function Ks(n){return Ce.call(n)==="[object Blob]"}function Zn(n){return Ce.call(n)==="[object Function]"}function Gs(n){return Qn(n)&&Zn(n.pipe)}function Xs(n){return Ce.call(n)==="[object URLSearchParams]"}function Qs(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function Zs(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function zt(n,e){if(!(n===null||typeof n>"u"))if(typeof n!="object"&&(n=[n]),Jt(n))for(var t=0,r=n.length;t<r;t++)e.call(null,n[t],t,n);else for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.call(null,n[s],s,n)}function Kt(){var n={};function e(s,i){mt(n[i])&&mt(s)?n[i]=Kt(n[i],s):mt(s)?n[i]=Kt({},s):Jt(s)?n[i]=s.slice():n[i]=s}for(var t=0,r=arguments.length;t<r;t++)zt(arguments[t],e);return n}function $s(n,e,t){return zt(e,function(s,i){t&&typeof s=="function"?n[i]=js(s,t):n[i]=s}),n}function ei(n){return n.charCodeAt(0)===65279&&(n=n.slice(1)),n}var se={isArray:Jt,isArrayBuffer:Xn,isBuffer:Ms,isFormData:qs,isArrayBufferView:Ws,isString:Hs,isNumber:Js,isObject:Qn,isPlainObject:mt,isUndefined:Yt,isDate:Ys,isFile:zs,isBlob:Ks,isFunction:Zn,isStream:Gs,isURLSearchParams:Xs,isStandardBrowserEnv:Zs,forEach:zt,merge:Kt,extend:$s,trim:Qs,stripBOM:ei},Ve=se;function $n(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var er=function(e,t,r){if(!t)return e;var s;if(r)s=r(t);else if(Ve.isURLSearchParams(t))s=t.toString();else{var i=[];Ve.forEach(t,function(l,a){l===null||typeof l>"u"||(Ve.isArray(l)?a=a+"[]":l=[l],Ve.forEach(l,function(f){Ve.isDate(f)?f=f.toISOString():Ve.isObject(f)&&(f=JSON.stringify(f)),i.push($n(a)+"="+$n(f))}))}),s=i.join("&")}if(s){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e},ti=se;function gt(){this.handlers=[]}gt.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1},gt.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},gt.prototype.forEach=function(e){ti.forEach(this.handlers,function(r){r!==null&&e(r)})};var ni=gt,ri=se,si=function(e,t){ri.forEach(e,function(s,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=s,delete e[i])})},tr=function(e,t,r,s,i){return e.config=t,r&&(e.code=r),e.request=s,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},nr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Gt,rr;function sr(){if(rr)return Gt;rr=1;var n=tr;return Gt=function(t,r,s,i,o){var u=new Error(t);return n(u,r,s,i,o)},Gt}var Xt,ir;function ii(){if(ir)return Xt;ir=1;var n=sr();return Xt=function(t,r,s){var i=s.config.validateStatus;!s.status||!i||i(s.status)?t(s):r(n("Request failed with status code "+s.status,s.config,null,s.request,s))},Xt}var Qt,or;function oi(){if(or)return Qt;or=1;var n=se;return Qt=n.isStandardBrowserEnv()?function(){return{write:function(r,s,i,o,u,l){var a=[];a.push(r+"="+encodeURIComponent(s)),n.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(u)&&a.push("domain="+u),l===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(r){var s=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Qt}var Zt,ar;function ai(){return ar||(ar=1,Zt=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}),Zt}var $t,ur;function ui(){return ur||(ur=1,$t=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),$t}var en,cr;function ci(){if(cr)return en;cr=1;var n=ai(),e=ui();return en=function(r,s){return r&&!n(s)?e(r,s):s},en}var tn,lr;function li(){if(lr)return tn;lr=1;var n=se,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return tn=function(r){var s={},i,o,u;return r&&n.forEach(r.split(`
|
|
2
|
-
`),function(a){if(u=a.indexOf(":"),i=n.trim(a.substr(0,u)).toLowerCase(),o=n.trim(a.substr(u+1)),i){if(s[i]&&e.indexOf(i)>=0)return;i==="set-cookie"?s[i]=(s[i]?s[i]:[]).concat([o]):s[i]=s[i]?s[i]+", "+o:o}}),s},tn}var nn,fr;function fi(){if(fr)return nn;fr=1;var n=se;return nn=n.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),s;function i(o){var u=o;return t&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=i(window.location.href),function(u){var l=n.isString(u)?i(u):u;return l.protocol===s.protocol&&l.host===s.host}}():function(){return function(){return!0}}(),nn}var rn,hr;function bt(){if(hr)return rn;hr=1;function n(e){this.message=e}return n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,rn=n,rn}var sn,dr;function pr(){if(dr)return sn;dr=1;var n=se,e=ii(),t=oi(),r=er,s=ci(),i=li(),o=fi(),u=sr(),l=nr,a=bt();return sn=function(f){return new Promise(function(y,w){var E=f.data,O=f.headers,b=f.responseType,T;function F(){f.cancelToken&&f.cancelToken.unsubscribe(T),f.signal&&f.signal.removeEventListener("abort",T)}n.isFormData(E)&&delete O["Content-Type"];var g=new XMLHttpRequest;if(f.auth){var W=f.auth.username||"",C=f.auth.password?unescape(encodeURIComponent(f.auth.password)):"";O.Authorization="Basic "+btoa(W+":"+C)}var M=s(f.baseURL,f.url);g.open(f.method.toUpperCase(),r(M,f.params,f.paramsSerializer),!0),g.timeout=f.timeout;function L(){if(!!g){var P="getAllResponseHeaders"in g?i(g.getAllResponseHeaders()):null,ee=!b||b==="text"||b==="json"?g.responseText:g.response,te={data:ee,status:g.status,statusText:g.statusText,headers:P,config:f,request:g};e(function(U){y(U),F()},function(U){w(U),F()},te),g=null}}if("onloadend"in g?g.onloadend=L:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(L)},g.onabort=function(){!g||(w(u("Request aborted",f,"ECONNABORTED",g)),g=null)},g.onerror=function(){w(u("Network Error",f,null,g)),g=null},g.ontimeout=function(){var ee=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded",te=f.transitional||l;f.timeoutErrorMessage&&(ee=f.timeoutErrorMessage),w(u(ee,f,te.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",g)),g=null},n.isStandardBrowserEnv()){var q=(f.withCredentials||o(M))&&f.xsrfCookieName?t.read(f.xsrfCookieName):void 0;q&&(O[f.xsrfHeaderName]=q)}"setRequestHeader"in g&&n.forEach(O,function(ee,te){typeof E>"u"&&te.toLowerCase()==="content-type"?delete O[te]:g.setRequestHeader(te,ee)}),n.isUndefined(f.withCredentials)||(g.withCredentials=!!f.withCredentials),b&&b!=="json"&&(g.responseType=f.responseType),typeof f.onDownloadProgress=="function"&&g.addEventListener("progress",f.onDownloadProgress),typeof f.onUploadProgress=="function"&&g.upload&&g.upload.addEventListener("progress",f.onUploadProgress),(f.cancelToken||f.signal)&&(T=function(P){!g||(w(!P||P&&P.type?new a("canceled"):P),g.abort(),g=null)},f.cancelToken&&f.cancelToken.subscribe(T),f.signal&&(f.signal.aborted?T():f.signal.addEventListener("abort",T))),E||(E=null),g.send(E)})},sn}var Z=se,vr=si,hi=tr,di=nr,pi={"Content-Type":"application/x-www-form-urlencoded"};function yr(n,e){!Z.isUndefined(n)&&Z.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}function vi(){var n;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(n=pr()),n}function yi(n,e,t){if(Z.isString(n))try{return(e||JSON.parse)(n),Z.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(n)}var _t={transitional:di,adapter:vi(),transformRequest:[function(e,t){return vr(t,"Accept"),vr(t,"Content-Type"),Z.isFormData(e)||Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)?e:Z.isArrayBufferView(e)?e.buffer:Z.isURLSearchParams(e)?(yr(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Z.isObject(e)||t&&t["Content-Type"]==="application/json"?(yr(t,"application/json"),yi(e)):e}],transformResponse:[function(e){var t=this.transitional||_t.transitional,r=t&&t.silentJSONParsing,s=t&&t.forcedJSONParsing,i=!r&&this.responseType==="json";if(i||s&&Z.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(i)throw o.name==="SyntaxError"?hi(o,this,"E_JSON_PARSE"):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Z.forEach(["delete","get","head"],function(e){_t.headers[e]={}}),Z.forEach(["post","put","patch"],function(e){_t.headers[e]=Z.merge(pi)});var on=_t,mi=se,gi=on,bi=function(e,t,r){var s=this||gi;return mi.forEach(r,function(o){e=o.call(s,e,t)}),e},an,mr;function gr(){return mr||(mr=1,an=function(e){return!!(e&&e.__CANCEL__)}),an}var br=se,un=bi,_i=gr(),wi=on,Ei=bt();function cn(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ei("canceled")}var Si=function(e){cn(e),e.headers=e.headers||{},e.data=un.call(e,e.data,e.headers,e.transformRequest),e.headers=br.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),br.forEach(["delete","get","head","post","put","patch","common"],function(s){delete e.headers[s]});var t=e.adapter||wi.adapter;return t(e).then(function(s){return cn(e),s.data=un.call(e,s.data,s.headers,e.transformResponse),s},function(s){return _i(s)||(cn(e),s&&s.response&&(s.response.data=un.call(e,s.response.data,s.response.headers,e.transformResponse))),Promise.reject(s)})},ae=se,_r=function(e,t){t=t||{};var r={};function s(h,f){return ae.isPlainObject(h)&&ae.isPlainObject(f)?ae.merge(h,f):ae.isPlainObject(f)?ae.merge({},f):ae.isArray(f)?f.slice():f}function i(h){if(ae.isUndefined(t[h])){if(!ae.isUndefined(e[h]))return s(void 0,e[h])}else return s(e[h],t[h])}function o(h){if(!ae.isUndefined(t[h]))return s(void 0,t[h])}function u(h){if(ae.isUndefined(t[h])){if(!ae.isUndefined(e[h]))return s(void 0,e[h])}else return s(void 0,t[h])}function l(h){if(h in t)return s(e[h],t[h]);if(h in e)return s(void 0,e[h])}var a={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l};return ae.forEach(Object.keys(e).concat(Object.keys(t)),function(f){var v=a[f]||i,y=v(f);ae.isUndefined(y)&&v!==l||(r[f]=y)}),r},ln,wr;function Er(){return wr||(wr=1,ln={version:"0.26.1"}),ln}var Ri=Er().version,fn={};["object","boolean","number","function","string","symbol"].forEach(function(n,e){fn[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});var Sr={};fn.transitional=function(e,t,r){function s(i,o){return"[Axios v"+Ri+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return function(i,o,u){if(e===!1)throw new Error(s(o," has been removed"+(t?" in "+t:"")));return t&&!Sr[o]&&(Sr[o]=!0,console.warn(s(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,u):!0}};function Ti(n,e,t){if(typeof n!="object")throw new TypeError("options must be an object");for(var r=Object.keys(n),s=r.length;s-- >0;){var i=r[s],o=e[i];if(o){var u=n[i],l=u===void 0||o(u,i,n);if(l!==!0)throw new TypeError("option "+i+" must be "+l);continue}if(t!==!0)throw Error("Unknown option "+i)}}var Ci={assertOptions:Ti,validators:fn},Rr=se,Oi=er,Tr=ni,Cr=Si,wt=_r,Or=Ci,je=Or.validators;function et(n){this.defaults=n,this.interceptors={request:new Tr,response:new Tr}}et.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=wt(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;r!==void 0&&Or.assertOptions(r,{silentJSONParsing:je.transitional(je.boolean),forcedJSONParsing:je.transitional(je.boolean),clarifyTimeoutError:je.transitional(je.boolean)},!1);var s=[],i=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(t)===!1||(i=i&&y.synchronous,s.unshift(y.fulfilled,y.rejected))});var o=[];this.interceptors.response.forEach(function(y){o.push(y.fulfilled,y.rejected)});var u;if(!i){var l=[Cr,void 0];for(Array.prototype.unshift.apply(l,s),l=l.concat(o),u=Promise.resolve(t);l.length;)u=u.then(l.shift(),l.shift());return u}for(var a=t;s.length;){var h=s.shift(),f=s.shift();try{a=h(a)}catch(v){f(v);break}}try{u=Cr(a)}catch(v){return Promise.reject(v)}for(;o.length;)u=u.then(o.shift(),o.shift());return u},et.prototype.getUri=function(e){return e=wt(this.defaults,e),Oi(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Rr.forEach(["delete","get","head","options"],function(e){et.prototype[e]=function(t,r){return this.request(wt(r||{},{method:e,url:t,data:(r||{}).data}))}}),Rr.forEach(["post","put","patch"],function(e){et.prototype[e]=function(t,r,s){return this.request(wt(s||{},{method:e,url:t,data:r}))}});var xi=et,hn,xr;function Ai(){if(xr)return hn;xr=1;var n=bt();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(o){r=o});var s=this;this.promise.then(function(i){if(!!s._listeners){var o,u=s._listeners.length;for(o=0;o<u;o++)s._listeners[o](i);s._listeners=null}}),this.promise.then=function(i){var o,u=new Promise(function(l){s.subscribe(l),o=l}).then(i);return u.cancel=function(){s.unsubscribe(o)},u},t(function(o){s.reason||(s.reason=new n(o),r(s.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]},e.prototype.unsubscribe=function(r){if(!!this._listeners){var s=this._listeners.indexOf(r);s!==-1&&this._listeners.splice(s,1)}},e.source=function(){var r,s=new e(function(o){r=o});return{token:s,cancel:r}},hn=e,hn}var dn,Ar;function ki(){return Ar||(Ar=1,dn=function(e){return function(r){return e.apply(null,r)}}),dn}var pn,kr;function Di(){if(kr)return pn;kr=1;var n=se;return pn=function(t){return n.isObject(t)&&t.isAxiosError===!0},pn}var Dr=se,Li=Gn,Et=xi,Ni=_r,Fi=on;function Lr(n){var e=new Et(n),t=Li(Et.prototype.request,e);return Dr.extend(t,Et.prototype,e),Dr.extend(t,e),t.create=function(s){return Lr(Ni(n,s))},t}var pe=Lr(Fi);pe.Axios=Et,pe.Cancel=bt(),pe.CancelToken=Ai(),pe.isCancel=gr(),pe.VERSION=Er().version,pe.all=function(e){return Promise.all(e)},pe.spread=ki(),pe.isAxiosError=Di(),Ht.exports=pe,Ht.exports.default=pe,function(n){n.exports=Ht.exports}(Kn),Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.getRequestHeaders=Ie.getAxiosClient=void 0;var Pi=Kn.exports;function Bi(n,e,t,r){return Pi.default.create({baseURL:n,headers:Nr(e,r,t),withCredentials:!0})}Ie.getAxiosClient=Bi;function Nr(n,e,t){n===void 0&&(n=!1);var r={Accept:"application/json","Content-Type":"application/json; charset=utf-8"};return n&&e&&t&&(r.Authorization="".concat(e," ").concat(t())),typeof window<"u"&&typeof document<"u"&&(window.location&&(r["X-Frappe-Site-Name"]=window.location.hostname),window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(r["X-Frappe-CSRF-Token"]=window.csrf_token)),r}Ie.getRequestHeaders=Nr;var Fr;function Ui(){if(Fr)return Xe;Fr=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.FrappeApp=void 0;var n=Br(),e=Qe,t=Ze,r=$e,s=Ie,i=function(){function o(u,l,a){var h,f;this.url=u,this.name=a!=null?a:"FrappeApp",this.useToken=(h=l==null?void 0:l.useToken)!==null&&h!==void 0?h:!1,this.token=l==null?void 0:l.token,this.tokenType=(f=l==null?void 0:l.type)!==null&&f!==void 0?f:"Bearer",this.axios=(0,s.getAxiosClient)(this.url,this.useToken,this.token,this.tokenType)}return o.prototype.auth=function(){return new n.FrappeAuth(this.url,this.axios,this.useToken,this.token,this.tokenType)},o.prototype.db=function(){return new t.FrappeDB(this.url,this.axios,this.useToken,this.token,this.tokenType)},o.prototype.file=function(){return new r.FrappeFileUpload(this.url,this.axios,this.useToken,this.token,this.tokenType)},o.prototype.call=function(){return new e.FrappeCall(this.url,this.axios,this.useToken,this.token,this.tokenType)},o}();return Xe.FrappeApp=i,Xe}var St={},ve=N&&N.__assign||function(){return ve=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},ve.apply(this,arguments)},Rt=N&&N.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function u(h){try{a(r.next(h))}catch(f){o(f)}}function l(h){try{a(r.throw(h))}catch(f){o(f)}}function a(h){h.done?i(h.value):s(h.value).then(u,l)}a((r=r.apply(n,e||[])).next())})},Tt=N&&N.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(h){return l([a,h])}}function l(a){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,s&&(i=a[0]&2?s.return:a[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;switch(s=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,s=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1],i=a;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(a);break}i[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(n,t)}catch(h){a=[6,h],s=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(St,"__esModule",{value:!0}),St.FrappeAuth=void 0;var Ii=function(){function n(e,t,r,s,i){this.appURL=e,this.axios=t,this.useToken=r!=null?r:!1,this.token=s,this.tokenType=i}return n.prototype.loginWithUsernamePassword=function(e){return Rt(this,void 0,void 0,function(){var t,r,s;return Tt(this,function(i){return t=e.username,r=e.password,s=e.device,[2,this.axios.post("/api/method/login",{usr:t,pwd:r,device:s}).then(function(o){return o.data}).catch(function(o){var u,l;throw ve(ve({},o.response.data),{httpStatus:o.response.status,httpStatusText:o.response.statusText,message:(u=o.response.data.message)!==null&&u!==void 0?u:"There was an error while logging in",exception:(l=o.response.data.exception)!==null&&l!==void 0?l:""})})]})})},n.prototype.getLoggedInUser=function(){return Rt(this,void 0,void 0,function(){return Tt(this,function(e){return[2,this.axios.get("/api/method/frappe.auth.get_logged_user").then(function(t){return t.data.message}).catch(function(t){var r;throw ve(ve({},t.response.data),{httpStatus:t.response.status,httpStatusText:t.response.statusText,message:"There was an error while fetching the logged in user",exception:(r=t.response.data.exception)!==null&&r!==void 0?r:""})})]})})},n.prototype.logout=function(){return Rt(this,void 0,void 0,function(){return Tt(this,function(e){return[2,this.axios.post("/api/method/logout",{}).then(function(){}).catch(function(t){var r,s;throw ve(ve({},t.response.data),{httpStatus:t.response.status,httpStatusText:t.response.statusText,message:(r=t.response.data.message)!==null&&r!==void 0?r:"There was an error while logging out",exception:(s=t.response.data.exception)!==null&&s!==void 0?s:""})})]})})},n.prototype.forgetPassword=function(e){return Rt(this,void 0,void 0,function(){return Tt(this,function(t){return[2,this.axios.post("/",{cmd:"frappe.core.doctype.user.user.reset_password",user:e}).then(function(){}).catch(function(r){var s,i;throw ve(ve({},r.response.data),{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error sending password reset email.",exception:(i=r.response.data.exception)!==null&&i!==void 0?i:""})})]})})},n}();St.FrappeAuth=Ii;var Pr;function Br(){return Pr||(Pr=1,function(n){var e=N&&N.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var u=Object.getOwnPropertyDescriptor(s,i);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,u)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),t=N&&N.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&e(s,r,i)};Object.defineProperty(n,"__esModule",{value:!0}),t(Ui(),n),t(St,n),t(Ze,n),t($e,n),t(Qe,n)}(Wt)),Wt}var Vi=Br(),Ur={exports:{}},vn={};/**
|
|
1
|
+
(function(O,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],d):(O=typeof globalThis<"u"?globalThis:O||self,d(O["Frappe React"]={},O.React))})(this,function(O,d){"use strict";var ja=Object.defineProperty;var Ma=(O,d,Ue)=>d in O?ja(O,d,{enumerable:!0,configurable:!0,writable:!0,value:Ue}):O[d]=Ue;var ke=(O,d,Ue)=>(Ma(O,typeof d!="symbol"?d+"":d,Ue),Ue);const De=(n=>n&&typeof n=="object"&&"default"in n?n:{default:n})(d);var N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Wt={},Qe={},Ze={},ue=N&&N.__assign||function(){return ue=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},ue.apply(this,arguments)},pt=N&&N.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function u(h){try{a(r.next(h))}catch(f){o(f)}}function l(h){try{a(r.throw(h))}catch(f){o(f)}}function a(h){h.done?i(h.value):s(h.value).then(u,l)}a((r=r.apply(n,e||[])).next())})},vt=N&&N.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(h){return l([a,h])}}function l(a){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,s&&(i=a[0]&2?s.return:a[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;switch(s=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,s=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1],i=a;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(a);break}i[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(n,t)}catch(h){a=[6,h],s=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.FrappeCall=void 0;var Bs=function(){function n(e,t,r,s,i){this.appURL=e,this.axios=t,this.useToken=r!=null?r:!1,this.token=s,this.tokenType=i}return n.prototype.get=function(e,t){return pt(this,void 0,void 0,function(){return vt(this,function(r){return[2,this.axios.get("/api/method/".concat(e),{params:t}).then(function(s){return s.data}).catch(function(s){var i,o;throw ue(ue({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(i=s.response.data.message)!==null&&i!==void 0?i:"There was an error.",exception:(o=s.response.data.exception)!==null&&o!==void 0?o:""})})]})})},n.prototype.post=function(e,t){return pt(this,void 0,void 0,function(){return vt(this,function(r){return[2,this.axios.post("/api/method/".concat(e),ue({},t)).then(function(s){return s.data}).catch(function(s){var i,o;throw ue(ue({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(i=s.response.data.message)!==null&&i!==void 0?i:"There was an error.",exception:(o=s.response.data.exception)!==null&&o!==void 0?o:""})})]})})},n.prototype.put=function(e,t){return pt(this,void 0,void 0,function(){return vt(this,function(r){return[2,this.axios.put("/api/method/".concat(e),ue({},t)).then(function(s){return s.data}).catch(function(s){var i,o;throw ue(ue({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(i=s.response.data.message)!==null&&i!==void 0?i:"There was an error.",exception:(o=s.response.data.exception)!==null&&o!==void 0?o:""})})]})})},n.prototype.delete=function(e,t){return pt(this,void 0,void 0,function(){return vt(this,function(r){return[2,this.axios.delete("/api/method/".concat(e),{params:t}).then(function(s){return s.data}).catch(function(s){var i,o;throw ue(ue({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(i=s.response.data.message)!==null&&i!==void 0?i:"There was an error.",exception:(o=s.response.data.exception)!==null&&o!==void 0?o:""})})]})})},n}();Ze.FrappeCall=Bs;var $e={},J=N&&N.__assign||function(){return J=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},J.apply(this,arguments)},Le=N&&N.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function u(h){try{a(r.next(h))}catch(f){o(f)}}function l(h){try{a(r.throw(h))}catch(f){o(f)}}function a(h){h.done?i(h.value):s(h.value).then(u,l)}a((r=r.apply(n,e||[])).next())})},Ne=N&&N.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(h){return l([a,h])}}function l(a){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,s&&(i=a[0]&2?s.return:a[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;switch(s=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,s=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1],i=a;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(a);break}i[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(n,t)}catch(h){a=[6,h],s=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty($e,"__esModule",{value:!0}),$e.FrappeDB=void 0;var Us=function(){function n(e,t,r,s,i){this.appURL=e,this.axios=t,this.useToken=r!=null?r:!1,this.token=s,this.tokenType=i}return n.prototype.getDoc=function(e,t){return t===void 0&&(t=""),Le(this,void 0,void 0,function(){return Ne(this,function(r){return[2,this.axios.get("/api/resource/".concat(e,"/").concat(t)).then(function(s){return s.data.data}).catch(function(s){var i,o;throw J(J({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:"There was an error while fetching the document.",exception:(o=(i=s.response.data.exception)!==null&&i!==void 0?i:s.response.data.exc_type)!==null&&o!==void 0?o:""})})]})})},n.prototype.getDocList=function(e,t){var r;return Le(this,void 0,void 0,function(){var s,i,o,u,l,a,h,f,v,y,w;return Ne(this,function(E){return s={},t&&(i=t.fields,o=t.filters,u=t.orFilters,l=t.orderBy,a=t.limit,h=t.limit_start,f=t.groupBy,v=t.asDict,y=v===void 0?!0:v,w=l?"".concat(String(l==null?void 0:l.field)," ").concat((r=l==null?void 0:l.order)!==null&&r!==void 0?r:"asc"):"",s={fields:i?JSON.stringify(i):void 0,filters:o?JSON.stringify(o):void 0,or_filters:u?JSON.stringify(u):void 0,order_by:w,group_by:f,limit:a,limit_start:h,as_dict:y}),[2,this.axios.get("/api/resource/".concat(e),{params:s}).then(function(x){return x.data.data}).catch(function(x){var b,T;throw J(J({},x.response.data),{httpStatus:x.response.status,httpStatusText:x.response.statusText,message:"There was an error while fetching the documents.",exception:(T=(b=x.response.data.exception)!==null&&b!==void 0?b:x.response.data.exc_type)!==null&&T!==void 0?T:""})})]})})},n.prototype.createDoc=function(e,t){return Le(this,void 0,void 0,function(){return Ne(this,function(r){return[2,this.axios.post("/api/resource/".concat(e),J({},t)).then(function(s){return s.data.data}).catch(function(s){var i,o,u;throw J(J({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(i=s.response.data.message)!==null&&i!==void 0?i:"There was an error while creating the document.",exception:(u=(o=s.response.data.exception)!==null&&o!==void 0?o:s.response.data.exc_type)!==null&&u!==void 0?u:""})})]})})},n.prototype.updateDoc=function(e,t,r){return Le(this,void 0,void 0,function(){return Ne(this,function(s){return[2,this.axios.put("/api/resource/".concat(e,"/").concat(t),J({},r)).then(function(i){return i.data.data}).catch(function(i){var o,u,l;throw J(J({},i.response.data),{httpStatus:i.response.status,httpStatusText:i.response.statusText,message:(o=i.response.data.message)!==null&&o!==void 0?o:"There was an error while updating the document.",exception:(l=(u=i.response.data.exception)!==null&&u!==void 0?u:i.response.data.exc_type)!==null&&l!==void 0?l:""})})]})})},n.prototype.deleteDoc=function(e,t){return Le(this,void 0,void 0,function(){return Ne(this,function(r){return[2,this.axios.delete("/api/resource/".concat(e,"/").concat(t)).then(function(s){return s.data}).catch(function(s){var i,o;throw J(J({},s.response.data),{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:"There was an error while deleting the document.",exception:(o=(i=s.response.data.exception)!==null&&i!==void 0?i:s.response.data.exc_type)!==null&&o!==void 0?o:""})})]})})},n.prototype.getCount=function(e,t,r,s){return r===void 0&&(r=!1),s===void 0&&(s=!1),Le(this,void 0,void 0,function(){var i;return Ne(this,function(o){return i={doctype:e,filters:[]},r&&(i.cache=r),s&&(i.debug=s),t&&(i.filters=t?JSON.stringify(t):void 0),[2,this.axios.get("/api/method/frappe.client.get_count",{params:i}).then(function(u){return u.data.message}).catch(function(u){var l,a;throw J(J({},u.response.data),{httpStatus:u.response.status,httpStatusText:u.response.statusText,message:"There was an error while getting the count.",exception:(a=(l=u.response.data.exception)!==null&&l!==void 0?l:u.response.data.exc_type)!==null&&a!==void 0?a:""})})]})})},n.prototype.getLastDoc=function(e,t){return Le(this,void 0,void 0,function(){var r,s;return Ne(this,function(i){switch(i.label){case 0:return r={orderBy:{field:"creation",order:"desc"}},t&&(r=J(J({},r),t)),[4,this.getDocList(e,J(J({},r),{limit:1,fields:["name"]}))];case 1:return s=i.sent(),s.length>0?[2,this.getDoc(e,s[0].name)]:[2,{}]}})})},n}();$e.FrappeDB=Us;var et={},yt=N&&N.__assign||function(){return yt=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},yt.apply(this,arguments)},Is=N&&N.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function u(h){try{a(r.next(h))}catch(f){o(f)}}function l(h){try{a(r.throw(h))}catch(f){o(f)}}function a(h){h.done?i(h.value):s(h.value).then(u,l)}a((r=r.apply(n,e||[])).next())})},Vs=N&&N.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(h){return l([a,h])}}function l(a){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,s&&(i=a[0]&2?s.return:a[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;switch(s=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,s=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1],i=a;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(a);break}i[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(n,t)}catch(h){a=[6,h],s=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(et,"__esModule",{value:!0}),et.FrappeFileUpload=void 0;var js=function(){function n(e,t,r,s,i){this.appURL=e,this.axios=t,this.useToken=r!=null?r:!1,this.token=s,this.tokenType=i}return n.prototype.uploadFile=function(e,t,r){return Is(this,void 0,void 0,function(){var s,i,o,u,l,a,h;return Vs(this,function(f){return s=new FormData,e&&s.append("file",e,e.name),i=t.isPrivate,o=t.folder,u=t.file_url,l=t.doctype,a=t.docname,h=t.fieldname,i&&s.append("is_private","1"),o&&s.append("folder",o),u&&s.append("file_url",u),l&&a&&(s.append("doctype",l),s.append("docname",a),h&&s.append("fieldname",h)),[2,this.axios.post("/api/method/upload_file",s,{onUploadProgress:function(v){r&&r(v.loaded,v.total)}}).catch(function(v){var y,w;throw yt(yt({},v.response.data),{httpStatus:v.response.status,httpStatusText:v.response.statusText,message:(y=v.response.data.message)!==null&&y!==void 0?y:"There was an error while uploading the file.",exception:(w=v.response.data.exception)!==null&&w!==void 0?w:""})})]})})},n}();et.FrappeFileUpload=js;var Ie={},Kn={exports:{}},Ht={exports:{}},Gn=function(e,t){return function(){for(var s=new Array(arguments.length),i=0;i<s.length;i++)s[i]=arguments[i];return e.apply(t,s)}},Ms=Gn,Ce=Object.prototype.toString;function Jt(n){return Array.isArray(n)}function Yt(n){return typeof n>"u"}function qs(n){return n!==null&&!Yt(n)&&n.constructor!==null&&!Yt(n.constructor)&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function Xn(n){return Ce.call(n)==="[object ArrayBuffer]"}function Ws(n){return Ce.call(n)==="[object FormData]"}function Hs(n){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&Xn(n.buffer),e}function Js(n){return typeof n=="string"}function Ys(n){return typeof n=="number"}function Qn(n){return n!==null&&typeof n=="object"}function mt(n){if(Ce.call(n)!=="[object Object]")return!1;var e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}function zs(n){return Ce.call(n)==="[object Date]"}function Ks(n){return Ce.call(n)==="[object File]"}function Gs(n){return Ce.call(n)==="[object Blob]"}function Zn(n){return Ce.call(n)==="[object Function]"}function Xs(n){return Qn(n)&&Zn(n.pipe)}function Qs(n){return Ce.call(n)==="[object URLSearchParams]"}function Zs(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function $s(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function zt(n,e){if(!(n===null||typeof n>"u"))if(typeof n!="object"&&(n=[n]),Jt(n))for(var t=0,r=n.length;t<r;t++)e.call(null,n[t],t,n);else for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&e.call(null,n[s],s,n)}function Kt(){var n={};function e(s,i){mt(n[i])&&mt(s)?n[i]=Kt(n[i],s):mt(s)?n[i]=Kt({},s):Jt(s)?n[i]=s.slice():n[i]=s}for(var t=0,r=arguments.length;t<r;t++)zt(arguments[t],e);return n}function ei(n,e,t){return zt(e,function(s,i){t&&typeof s=="function"?n[i]=Ms(s,t):n[i]=s}),n}function ti(n){return n.charCodeAt(0)===65279&&(n=n.slice(1)),n}var se={isArray:Jt,isArrayBuffer:Xn,isBuffer:qs,isFormData:Ws,isArrayBufferView:Hs,isString:Js,isNumber:Ys,isObject:Qn,isPlainObject:mt,isUndefined:Yt,isDate:zs,isFile:Ks,isBlob:Gs,isFunction:Zn,isStream:Xs,isURLSearchParams:Qs,isStandardBrowserEnv:$s,forEach:zt,merge:Kt,extend:ei,trim:Zs,stripBOM:ti},Ve=se;function $n(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var er=function(e,t,r){if(!t)return e;var s;if(r)s=r(t);else if(Ve.isURLSearchParams(t))s=t.toString();else{var i=[];Ve.forEach(t,function(l,a){l===null||typeof l>"u"||(Ve.isArray(l)?a=a+"[]":l=[l],Ve.forEach(l,function(f){Ve.isDate(f)?f=f.toISOString():Ve.isObject(f)&&(f=JSON.stringify(f)),i.push($n(a)+"="+$n(f))}))}),s=i.join("&")}if(s){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e},ni=se;function gt(){this.handlers=[]}gt.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1},gt.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},gt.prototype.forEach=function(e){ni.forEach(this.handlers,function(r){r!==null&&e(r)})};var ri=gt,si=se,ii=function(e,t){si.forEach(e,function(s,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=s,delete e[i])})},tr=function(e,t,r,s,i){return e.config=t,r&&(e.code=r),e.request=s,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e},nr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Gt,rr;function sr(){if(rr)return Gt;rr=1;var n=tr;return Gt=function(t,r,s,i,o){var u=new Error(t);return n(u,r,s,i,o)},Gt}var Xt,ir;function oi(){if(ir)return Xt;ir=1;var n=sr();return Xt=function(t,r,s){var i=s.config.validateStatus;!s.status||!i||i(s.status)?t(s):r(n("Request failed with status code "+s.status,s.config,null,s.request,s))},Xt}var Qt,or;function ai(){if(or)return Qt;or=1;var n=se;return Qt=n.isStandardBrowserEnv()?function(){return{write:function(r,s,i,o,u,l){var a=[];a.push(r+"="+encodeURIComponent(s)),n.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(u)&&a.push("domain="+u),l===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(r){var s=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Qt}var Zt,ar;function ui(){return ar||(ar=1,Zt=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}),Zt}var $t,ur;function ci(){return ur||(ur=1,$t=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),$t}var en,cr;function li(){if(cr)return en;cr=1;var n=ui(),e=ci();return en=function(r,s){return r&&!n(s)?e(r,s):s},en}var tn,lr;function fi(){if(lr)return tn;lr=1;var n=se,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return tn=function(r){var s={},i,o,u;return r&&n.forEach(r.split(`
|
|
2
|
+
`),function(a){if(u=a.indexOf(":"),i=n.trim(a.substr(0,u)).toLowerCase(),o=n.trim(a.substr(u+1)),i){if(s[i]&&e.indexOf(i)>=0)return;i==="set-cookie"?s[i]=(s[i]?s[i]:[]).concat([o]):s[i]=s[i]?s[i]+", "+o:o}}),s},tn}var nn,fr;function hi(){if(fr)return nn;fr=1;var n=se;return nn=n.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),s;function i(o){var u=o;return t&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return s=i(window.location.href),function(u){var l=n.isString(u)?i(u):u;return l.protocol===s.protocol&&l.host===s.host}}():function(){return function(){return!0}}(),nn}var rn,hr;function bt(){if(hr)return rn;hr=1;function n(e){this.message=e}return n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,rn=n,rn}var sn,dr;function pr(){if(dr)return sn;dr=1;var n=se,e=oi(),t=ai(),r=er,s=li(),i=fi(),o=hi(),u=sr(),l=nr,a=bt();return sn=function(f){return new Promise(function(y,w){var E=f.data,x=f.headers,b=f.responseType,T;function F(){f.cancelToken&&f.cancelToken.unsubscribe(T),f.signal&&f.signal.removeEventListener("abort",T)}n.isFormData(E)&&delete x["Content-Type"];var g=new XMLHttpRequest;if(f.auth){var W=f.auth.username||"",C=f.auth.password?unescape(encodeURIComponent(f.auth.password)):"";x.Authorization="Basic "+btoa(W+":"+C)}var M=s(f.baseURL,f.url);g.open(f.method.toUpperCase(),r(M,f.params,f.paramsSerializer),!0),g.timeout=f.timeout;function L(){if(!!g){var P="getAllResponseHeaders"in g?i(g.getAllResponseHeaders()):null,ee=!b||b==="text"||b==="json"?g.responseText:g.response,te={data:ee,status:g.status,statusText:g.statusText,headers:P,config:f,request:g};e(function(U){y(U),F()},function(U){w(U),F()},te),g=null}}if("onloadend"in g?g.onloadend=L:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(L)},g.onabort=function(){!g||(w(u("Request aborted",f,"ECONNABORTED",g)),g=null)},g.onerror=function(){w(u("Network Error",f,null,g)),g=null},g.ontimeout=function(){var ee=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded",te=f.transitional||l;f.timeoutErrorMessage&&(ee=f.timeoutErrorMessage),w(u(ee,f,te.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",g)),g=null},n.isStandardBrowserEnv()){var q=(f.withCredentials||o(M))&&f.xsrfCookieName?t.read(f.xsrfCookieName):void 0;q&&(x[f.xsrfHeaderName]=q)}"setRequestHeader"in g&&n.forEach(x,function(ee,te){typeof E>"u"&&te.toLowerCase()==="content-type"?delete x[te]:g.setRequestHeader(te,ee)}),n.isUndefined(f.withCredentials)||(g.withCredentials=!!f.withCredentials),b&&b!=="json"&&(g.responseType=f.responseType),typeof f.onDownloadProgress=="function"&&g.addEventListener("progress",f.onDownloadProgress),typeof f.onUploadProgress=="function"&&g.upload&&g.upload.addEventListener("progress",f.onUploadProgress),(f.cancelToken||f.signal)&&(T=function(P){!g||(w(!P||P&&P.type?new a("canceled"):P),g.abort(),g=null)},f.cancelToken&&f.cancelToken.subscribe(T),f.signal&&(f.signal.aborted?T():f.signal.addEventListener("abort",T))),E||(E=null),g.send(E)})},sn}var Z=se,vr=ii,di=tr,pi=nr,vi={"Content-Type":"application/x-www-form-urlencoded"};function yr(n,e){!Z.isUndefined(n)&&Z.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}function yi(){var n;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(n=pr()),n}function mi(n,e,t){if(Z.isString(n))try{return(e||JSON.parse)(n),Z.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(t||JSON.stringify)(n)}var _t={transitional:pi,adapter:yi(),transformRequest:[function(e,t){return vr(t,"Accept"),vr(t,"Content-Type"),Z.isFormData(e)||Z.isArrayBuffer(e)||Z.isBuffer(e)||Z.isStream(e)||Z.isFile(e)||Z.isBlob(e)?e:Z.isArrayBufferView(e)?e.buffer:Z.isURLSearchParams(e)?(yr(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Z.isObject(e)||t&&t["Content-Type"]==="application/json"?(yr(t,"application/json"),mi(e)):e}],transformResponse:[function(e){var t=this.transitional||_t.transitional,r=t&&t.silentJSONParsing,s=t&&t.forcedJSONParsing,i=!r&&this.responseType==="json";if(i||s&&Z.isString(e)&&e.length)try{return JSON.parse(e)}catch(o){if(i)throw o.name==="SyntaxError"?di(o,this,"E_JSON_PARSE"):o}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Z.forEach(["delete","get","head"],function(e){_t.headers[e]={}}),Z.forEach(["post","put","patch"],function(e){_t.headers[e]=Z.merge(vi)});var on=_t,gi=se,bi=on,_i=function(e,t,r){var s=this||bi;return gi.forEach(r,function(o){e=o.call(s,e,t)}),e},an,mr;function gr(){return mr||(mr=1,an=function(e){return!!(e&&e.__CANCEL__)}),an}var br=se,un=_i,wi=gr(),Ei=on,Si=bt();function cn(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Si("canceled")}var Ri=function(e){cn(e),e.headers=e.headers||{},e.data=un.call(e,e.data,e.headers,e.transformRequest),e.headers=br.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),br.forEach(["delete","get","head","post","put","patch","common"],function(s){delete e.headers[s]});var t=e.adapter||Ei.adapter;return t(e).then(function(s){return cn(e),s.data=un.call(e,s.data,s.headers,e.transformResponse),s},function(s){return wi(s)||(cn(e),s&&s.response&&(s.response.data=un.call(e,s.response.data,s.response.headers,e.transformResponse))),Promise.reject(s)})},ae=se,_r=function(e,t){t=t||{};var r={};function s(h,f){return ae.isPlainObject(h)&&ae.isPlainObject(f)?ae.merge(h,f):ae.isPlainObject(f)?ae.merge({},f):ae.isArray(f)?f.slice():f}function i(h){if(ae.isUndefined(t[h])){if(!ae.isUndefined(e[h]))return s(void 0,e[h])}else return s(e[h],t[h])}function o(h){if(!ae.isUndefined(t[h]))return s(void 0,t[h])}function u(h){if(ae.isUndefined(t[h])){if(!ae.isUndefined(e[h]))return s(void 0,e[h])}else return s(void 0,t[h])}function l(h){if(h in t)return s(e[h],t[h]);if(h in e)return s(void 0,e[h])}var a={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:l};return ae.forEach(Object.keys(e).concat(Object.keys(t)),function(f){var v=a[f]||i,y=v(f);ae.isUndefined(y)&&v!==l||(r[f]=y)}),r},ln,wr;function Er(){return wr||(wr=1,ln={version:"0.26.1"}),ln}var Ti=Er().version,fn={};["object","boolean","number","function","string","symbol"].forEach(function(n,e){fn[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});var Sr={};fn.transitional=function(e,t,r){function s(i,o){return"[Axios v"+Ti+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return function(i,o,u){if(e===!1)throw new Error(s(o," has been removed"+(t?" in "+t:"")));return t&&!Sr[o]&&(Sr[o]=!0,console.warn(s(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,u):!0}};function Ci(n,e,t){if(typeof n!="object")throw new TypeError("options must be an object");for(var r=Object.keys(n),s=r.length;s-- >0;){var i=r[s],o=e[i];if(o){var u=n[i],l=u===void 0||o(u,i,n);if(l!==!0)throw new TypeError("option "+i+" must be "+l);continue}if(t!==!0)throw Error("Unknown option "+i)}}var Oi={assertOptions:Ci,validators:fn},Rr=se,xi=er,Tr=ri,Cr=Ri,wt=_r,Or=Oi,je=Or.validators;function tt(n){this.defaults=n,this.interceptors={request:new Tr,response:new Tr}}tt.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=wt(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;r!==void 0&&Or.assertOptions(r,{silentJSONParsing:je.transitional(je.boolean),forcedJSONParsing:je.transitional(je.boolean),clarifyTimeoutError:je.transitional(je.boolean)},!1);var s=[],i=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(t)===!1||(i=i&&y.synchronous,s.unshift(y.fulfilled,y.rejected))});var o=[];this.interceptors.response.forEach(function(y){o.push(y.fulfilled,y.rejected)});var u;if(!i){var l=[Cr,void 0];for(Array.prototype.unshift.apply(l,s),l=l.concat(o),u=Promise.resolve(t);l.length;)u=u.then(l.shift(),l.shift());return u}for(var a=t;s.length;){var h=s.shift(),f=s.shift();try{a=h(a)}catch(v){f(v);break}}try{u=Cr(a)}catch(v){return Promise.reject(v)}for(;o.length;)u=u.then(o.shift(),o.shift());return u},tt.prototype.getUri=function(e){return e=wt(this.defaults,e),xi(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Rr.forEach(["delete","get","head","options"],function(e){tt.prototype[e]=function(t,r){return this.request(wt(r||{},{method:e,url:t,data:(r||{}).data}))}}),Rr.forEach(["post","put","patch"],function(e){tt.prototype[e]=function(t,r,s){return this.request(wt(s||{},{method:e,url:t,data:r}))}});var Ai=tt,hn,xr;function ki(){if(xr)return hn;xr=1;var n=bt();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(o){r=o});var s=this;this.promise.then(function(i){if(!!s._listeners){var o,u=s._listeners.length;for(o=0;o<u;o++)s._listeners[o](i);s._listeners=null}}),this.promise.then=function(i){var o,u=new Promise(function(l){s.subscribe(l),o=l}).then(i);return u.cancel=function(){s.unsubscribe(o)},u},t(function(o){s.reason||(s.reason=new n(o),r(s.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]},e.prototype.unsubscribe=function(r){if(!!this._listeners){var s=this._listeners.indexOf(r);s!==-1&&this._listeners.splice(s,1)}},e.source=function(){var r,s=new e(function(o){r=o});return{token:s,cancel:r}},hn=e,hn}var dn,Ar;function Di(){return Ar||(Ar=1,dn=function(e){return function(r){return e.apply(null,r)}}),dn}var pn,kr;function Li(){if(kr)return pn;kr=1;var n=se;return pn=function(t){return n.isObject(t)&&t.isAxiosError===!0},pn}var Dr=se,Ni=Gn,Et=Ai,Fi=_r,Pi=on;function Lr(n){var e=new Et(n),t=Ni(Et.prototype.request,e);return Dr.extend(t,Et.prototype,e),Dr.extend(t,e),t.create=function(s){return Lr(Fi(n,s))},t}var pe=Lr(Pi);pe.Axios=Et,pe.Cancel=bt(),pe.CancelToken=ki(),pe.isCancel=gr(),pe.VERSION=Er().version,pe.all=function(e){return Promise.all(e)},pe.spread=Di(),pe.isAxiosError=Li(),Ht.exports=pe,Ht.exports.default=pe,function(n){n.exports=Ht.exports}(Kn),Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.getRequestHeaders=Ie.getAxiosClient=void 0;var Bi=Kn.exports;function Ui(n,e,t,r){return Bi.default.create({baseURL:n,headers:Nr(e,r,t),withCredentials:!0})}Ie.getAxiosClient=Ui;function Nr(n,e,t){n===void 0&&(n=!1);var r={Accept:"application/json","Content-Type":"application/json; charset=utf-8"};return n&&e&&t&&(r.Authorization="".concat(e," ").concat(t())),typeof window<"u"&&typeof document<"u"&&(window.location&&(r["X-Frappe-Site-Name"]=window.location.hostname),window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(r["X-Frappe-CSRF-Token"]=window.csrf_token)),r}Ie.getRequestHeaders=Nr;var Fr;function Ii(){if(Fr)return Qe;Fr=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.FrappeApp=void 0;var n=Br(),e=Ze,t=$e,r=et,s=Ie,i=function(){function o(u,l,a){var h,f;this.url=u,this.name=a!=null?a:"FrappeApp",this.useToken=(h=l==null?void 0:l.useToken)!==null&&h!==void 0?h:!1,this.token=l==null?void 0:l.token,this.tokenType=(f=l==null?void 0:l.type)!==null&&f!==void 0?f:"Bearer",this.axios=(0,s.getAxiosClient)(this.url,this.useToken,this.token,this.tokenType)}return o.prototype.auth=function(){return new n.FrappeAuth(this.url,this.axios,this.useToken,this.token,this.tokenType)},o.prototype.db=function(){return new t.FrappeDB(this.url,this.axios,this.useToken,this.token,this.tokenType)},o.prototype.file=function(){return new r.FrappeFileUpload(this.url,this.axios,this.useToken,this.token,this.tokenType)},o.prototype.call=function(){return new e.FrappeCall(this.url,this.axios,this.useToken,this.token,this.tokenType)},o}();return Qe.FrappeApp=i,Qe}var St={},ve=N&&N.__assign||function(){return ve=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},ve.apply(this,arguments)},Rt=N&&N.__awaiter||function(n,e,t,r){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function u(h){try{a(r.next(h))}catch(f){o(f)}}function l(h){try{a(r.throw(h))}catch(f){o(f)}}function a(h){h.done?i(h.value):s(h.value).then(u,l)}a((r=r.apply(n,e||[])).next())})},Tt=N&&N.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,s,i,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(h){return l([a,h])}}function l(a){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,s&&(i=a[0]&2?s.return:a[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;switch(s=0,i&&(a=[a[0]&2,i.value]),a[0]){case 0:case 1:i=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,s=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1],i=a;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(a);break}i[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(n,t)}catch(h){a=[6,h],s=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(St,"__esModule",{value:!0}),St.FrappeAuth=void 0;var Vi=function(){function n(e,t,r,s,i){this.appURL=e,this.axios=t,this.useToken=r!=null?r:!1,this.token=s,this.tokenType=i}return n.prototype.loginWithUsernamePassword=function(e){return Rt(this,void 0,void 0,function(){var t,r,s;return Tt(this,function(i){return t=e.username,r=e.password,s=e.device,[2,this.axios.post("/api/method/login",{usr:t,pwd:r,device:s}).then(function(o){return o.data}).catch(function(o){var u,l;throw ve(ve({},o.response.data),{httpStatus:o.response.status,httpStatusText:o.response.statusText,message:(u=o.response.data.message)!==null&&u!==void 0?u:"There was an error while logging in",exception:(l=o.response.data.exception)!==null&&l!==void 0?l:""})})]})})},n.prototype.getLoggedInUser=function(){return Rt(this,void 0,void 0,function(){return Tt(this,function(e){return[2,this.axios.get("/api/method/frappe.auth.get_logged_user").then(function(t){return t.data.message}).catch(function(t){var r;throw ve(ve({},t.response.data),{httpStatus:t.response.status,httpStatusText:t.response.statusText,message:"There was an error while fetching the logged in user",exception:(r=t.response.data.exception)!==null&&r!==void 0?r:""})})]})})},n.prototype.logout=function(){return Rt(this,void 0,void 0,function(){return Tt(this,function(e){return[2,this.axios.post("/api/method/logout",{}).then(function(){}).catch(function(t){var r,s;throw ve(ve({},t.response.data),{httpStatus:t.response.status,httpStatusText:t.response.statusText,message:(r=t.response.data.message)!==null&&r!==void 0?r:"There was an error while logging out",exception:(s=t.response.data.exception)!==null&&s!==void 0?s:""})})]})})},n.prototype.forgetPassword=function(e){return Rt(this,void 0,void 0,function(){return Tt(this,function(t){return[2,this.axios.post("/",{cmd:"frappe.core.doctype.user.user.reset_password",user:e}).then(function(){}).catch(function(r){var s,i;throw ve(ve({},r.response.data),{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error sending password reset email.",exception:(i=r.response.data.exception)!==null&&i!==void 0?i:""})})]})})},n}();St.FrappeAuth=Vi;var Pr;function Br(){return Pr||(Pr=1,function(n){var e=N&&N.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var u=Object.getOwnPropertyDescriptor(s,i);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,u)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),t=N&&N.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&e(s,r,i)};Object.defineProperty(n,"__esModule",{value:!0}),t(Ii(),n),t(St,n),t($e,n),t(et,n),t(Ze,n)}(Wt)),Wt}var ji=Br(),Ur={exports:{}},vn={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* use-sync-external-store-shim.production.min.js
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Ir;function
|
|
10
|
+
*/var Ir;function Mi(){if(Ir)return vn;Ir=1;var n=De.default;function e(f,v){return f===v&&(f!==0||1/f===1/v)||f!==f&&v!==v}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,s=n.useEffect,i=n.useLayoutEffect,o=n.useDebugValue;function u(f,v){var y=v(),w=r({inst:{value:y,getSnapshot:v}}),E=w[0].inst,x=w[1];return i(function(){E.value=y,E.getSnapshot=v,l(E)&&x({inst:E})},[f,y,v]),s(function(){return l(E)&&x({inst:E}),f(function(){l(E)&&x({inst:E})})},[f]),o(y),y}function l(f){var v=f.getSnapshot;f=f.value;try{var y=v();return!t(f,y)}catch{return!0}}function a(f,v){return v()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a:u;return vn.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:h,vn}var yn={};/**
|
|
11
11
|
* @license React
|
|
12
12
|
* use-sync-external-store-shim.development.js
|
|
13
13
|
*
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Vr;function Mi(){return Vr||(Vr=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=De.default,e=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(F){{for(var g=arguments.length,W=new Array(g>1?g-1:0),C=1;C<g;C++)W[C-1]=arguments[C];r("error",F,W)}}function r(F,g,W){{var C=e.ReactDebugCurrentFrame,M=C.getStackAddendum();M!==""&&(g+="%s",W=W.concat([M]));var L=W.map(function(q){return String(q)});L.unshift("Warning: "+g),Function.prototype.apply.call(console[F],console,L)}}function s(F,g){return F===g&&(F!==0||1/F===1/g)||F!==F&&g!==g}var i=typeof Object.is=="function"?Object.is:s,o=n.useState,u=n.useEffect,l=n.useLayoutEffect,a=n.useDebugValue,h=!1,f=!1;function v(F,g,W){h||n.startTransition!==void 0&&(h=!0,t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var C=g();if(!f){var M=g();i(C,M)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var L=o({inst:{value:C,getSnapshot:g}}),q=L[0].inst,P=L[1];return l(function(){q.value=C,q.getSnapshot=g,y(q)&&P({inst:q})},[F,C,g]),u(function(){y(q)&&P({inst:q});var ee=function(){y(q)&&P({inst:q})};return F(ee)},[F]),a(C),C}function y(F){var g=F.getSnapshot,W=F.value;try{var C=g();return!i(W,C)}catch{return!0}}function w(F,g,W){return g()}var E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",O=!E,b=O?w:v,T=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:b;yn.useSyncExternalStore=T,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),yn}(function(n){process.env.NODE_ENV==="production"?n.exports=ji():n.exports=Mi()})(Ur);const Oe=()=>{},ie=Oe(),mn=Object,k=n=>n===ie,be=n=>typeof n=="function",xe=(n,e)=>({...n,...e}),qi=n=>be(n.then),Ct=new WeakMap;let Wi=0;const tt=n=>{const e=typeof n,t=n&&n.constructor,r=t==Date;let s,i;if(mn(n)===n&&!r&&t!=RegExp){if(s=Ct.get(n),s)return s;if(s=++Wi+"~",Ct.set(n,s),t==Array){for(s="@",i=0;i<n.length;i++)s+=tt(n[i])+",";Ct.set(n,s)}if(t==mn){s="#";const o=mn.keys(n).sort();for(;!k(i=o.pop());)k(n[i])||(s+=i+":"+tt(n[i])+",");Ct.set(n,s)}}else s=r?n.toJSON():e=="symbol"?n.toString():e=="string"?JSON.stringify(n):""+n;return s},_e=new WeakMap,gn={},Ot={},bn="undefined",xt=typeof window!=bn,_n=typeof document!=bn,Hi=()=>xt&&typeof window.requestAnimationFrame!=bn,jr=(n,e)=>{const t=_e.get(n);return[()=>!k(e)&&n.get(e)||gn,r=>{if(!k(e)){const s=n.get(e);e in Ot||(Ot[e]=s),t[5](e,xe(s,r),s||gn)}},t[6],()=>!k(e)&&e in Ot?Ot[e]:!k(e)&&n.get(e)||gn]};let wn=!0;const Ji=()=>wn,[En,Sn]=xt&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Oe,Oe],Yi=()=>{const n=_n&&document.visibilityState;return k(n)||n!=="hidden"},zi=n=>(_n&&document.addEventListener("visibilitychange",n),En("focus",n),()=>{_n&&document.removeEventListener("visibilitychange",n),Sn("focus",n)}),Ki=n=>{const e=()=>{wn=!0,n()},t=()=>{wn=!1};return En("online",e),En("offline",t),()=>{Sn("online",e),Sn("offline",t)}},Gi={isOnline:Ji,isVisible:Yi},Xi={initFocus:zi,initReconnect:Ki},Mr=!De.default.useId,nt=!xt||"Deno"in window,Qi=n=>Hi()?window.requestAnimationFrame(n):setTimeout(n,1),Rn=nt?d.useEffect:d.useLayoutEffect,Tn=typeof navigator<"u"&&navigator.connection,qr=!nt&&Tn&&(["slow-2g","2g"].includes(Tn.effectiveType)||Tn.saveData),Cn=n=>{if(be(n))try{n=n()}catch{n=""}const e=n;return n=typeof n=="string"?n:(Array.isArray(n)?n.length:n)?tt(n):"",[n,e]};let Zi=0;const On=()=>++Zi,Wr=0,Hr=1,Jr=2;var rt={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:Wr,MUTATE_EVENT:Jr,RECONNECT_EVENT:Hr};async function Yr(...n){const[e,t,r,s]=n,i=xe({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let o=i.populateCache;const u=i.rollbackOnError;let l=i.optimisticData;const a=i.revalidate!==!1,h=y=>typeof u=="function"?u(y):u!==!1,f=i.throwOnError;if(be(t)){const y=t,w=[],E=e.keys();for(const O of E)!/^\$(inf|sub)\$/.test(O)&&y(e.get(O)._k)&&w.push(O);return Promise.all(w.map(v))}return v(t);async function v(y){const[w]=Cn(y);if(!w)return;const[E,O]=jr(e,w),[b,T,F,g]=_e.get(e),W=()=>{const U=b[w];return a&&(delete F[w],delete g[w],U&&U[0])?U[0](Jr).then(()=>E().data):E().data};if(n.length<3)return W();let C=r,M;const L=On();T[w]=[L,0];const q=!k(l),P=E(),ee=P.data,te=P._c,X=k(te)?ee:te;if(q&&(l=be(l)?l(X,ee):l,O({data:l,_c:X})),be(C))try{C=C(X)}catch(U){M=U}if(C&&qi(C))if(C=await C.catch(U=>{M=U}),L!==T[w][0]){if(M)throw M;return C}else M&&q&&h(M)&&(o=!0,O({data:X,_c:ie}));if(o&&!M)if(be(o)){const U=o(C,X);O({data:U,error:ie,_c:ie})}else O({data:C,error:ie,_c:ie});if(T[w][1]=On(),Promise.resolve(W()).then(()=>{O({_c:ie})}),M){if(f)throw M;return}return C}}const zr=(n,e)=>{for(const t in n)n[t][0]&&n[t][0](e)},$i=(n,e)=>{if(!_e.has(n)){const t=xe(Xi,e),r={},s=Yr.bind(ie,n);let i=Oe;const o={},u=(h,f)=>{const v=o[h]||[];return o[h]=v,v.push(f),()=>v.splice(v.indexOf(f),1)},l=(h,f,v)=>{n.set(h,f);const y=o[h];if(y)for(const w of y)w(f,v)},a=()=>{if(!_e.has(n)&&(_e.set(n,[r,{},{},{},s,l,u]),!nt)){const h=t.initFocus(setTimeout.bind(ie,zr.bind(ie,r,Wr))),f=t.initReconnect(setTimeout.bind(ie,zr.bind(ie,r,Hr)));i=()=>{h&&h(),f&&f(),_e.delete(n)}}};return a(),[n,s,a,i]}return[n,_e.get(n)[4]]},eo=(n,e,t,r,s)=>{const i=t.errorRetryCount,o=s.retryCount,u=~~((Math.random()+.5)*(1<<(o<8?o:8)))*t.errorRetryInterval;!k(i)&&o>i||setTimeout(r,u,s)},to=(n,e)=>tt(n)==tt(e),[Kr,no]=$i(new Map),ro=xe({onLoadingSlow:Oe,onSuccess:Oe,onError:Oe,onErrorRetry:eo,onDiscarded:Oe,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:qr?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:qr?5e3:3e3,compare:to,isPaused:()=>!1,cache:Kr,mutate:no,fallback:{}},Gi),so=(n,e)=>{const t=xe(n,e);if(e){const{use:r,fallback:s}=n,{use:i,fallback:o}=e;r&&i&&(t.use=r.concat(i)),s&&o&&(t.fallback=xe(s,o))}return t},io=d.createContext({}),oo="$inf$",Gr=xt&&window.__SWR_DEVTOOLS_USE__,ao=Gr?window.__SWR_DEVTOOLS_USE__:[],uo=()=>{Gr&&(window.__SWR_DEVTOOLS_REACT__=De.default)},co=n=>be(n[1])?[n[0],n[1],n[2]||{}]:[n[0],null,(n[1]===null?n[2]:n[1])||{}],lo=()=>xe(ro,d.useContext(io)),fo=n=>(e,t,r)=>n(e,t&&((...i)=>{const[o]=Cn(e),[,,,u]=_e.get(Kr);if(o.startsWith(oo))return t(...i);const l=u[o];return k(l)?t(...i):(delete u[o],l)}),r),ho=ao.concat(fo),po=n=>function(...t){const r=lo(),[s,i,o]=co(t),u=so(r,o);let l=n;const{use:a}=u,h=(a||[]).concat(ho);for(let f=h.length;f--;)l=h[f](l);return l(s,i||u.fetcher||null,u)},vo=(n,e,t)=>{const r=e[n]||(e[n]=[]);return r.push(t),()=>{const s=r.indexOf(t);s>=0&&(r[s]=r[r.length-1],r.pop())}};uo();const Xr=De.default.use||(n=>{if(n.status==="pending")throw n;if(n.status==="fulfilled")return n.value;throw n.status==="rejected"?n.reason:(n.status="pending",n.then(e=>{n.status="fulfilled",n.value=e},e=>{n.status="rejected",n.reason=e}),n)}),xn={dedupe:!0},st=po((n,e,t)=>{const{cache:r,compare:s,suspense:i,fallbackData:o,revalidateOnMount:u,revalidateIfStale:l,refreshInterval:a,refreshWhenHidden:h,refreshWhenOffline:f,keepPreviousData:v}=t,[y,w,E,O]=_e.get(r),[b,T]=Cn(n),F=d.useRef(!1),g=d.useRef(!1),W=d.useRef(b),C=d.useRef(e),M=d.useRef(t),L=()=>M.current,q=()=>L().isVisible()&&L().isOnline(),[P,ee,te,X]=jr(r,b),U=d.useRef({}).current,Fe=k(o)?t.fallback[b]:o,ct=(B,I)=>{for(const Q in U){const j=Q;if(j==="data"){if(!s(B[j],I[j])&&(!k(B[j])||!s(qe,I[j])))return!1}else if(I[j]!==B[j])return!1}return!0},lt=d.useMemo(()=>{const B=(()=>!b||!e?!1:k(u)?L().isPaused()||i?!1:k(l)?!0:l:u)(),I=K=>{const de=xe(K);return delete de._k,B?{isValidating:!0,isLoading:!0,...de}:de},Q=P(),j=X(),ne=I(Q),Re=Q===j?ne:I(j);let z=ne;return[()=>{const K=I(P());return ct(K,z)?(z.data=K.data,z.isLoading=K.isLoading,z.isValidating=K.isValidating,z.error=K.error,z):(z=K,K)},()=>Re]},[r,b]),we=Ur.exports.useSyncExternalStore(d.useCallback(B=>te(b,(I,Q)=>{ct(Q,I)||B()}),[r,b]),lt[0],lt[1]),ft=!F.current,It=y[b]&&y[b].length>0,Ee=we.data,Se=k(Ee)?Fe:Ee,Pe=we.error,Vt=d.useRef(Se),qe=v?k(Ee)?Vt.current:Ee:Se,We=(()=>It&&!k(Pe)?!1:ft&&!k(u)?u:L().isPaused()?!1:i?k(Se)?!1:l:k(Se)||l)(),He=!!(b&&e&&ft&&We),Je=k(we.isValidating)?He:we.isValidating,ht=k(we.isLoading)?He:we.isLoading,ge=d.useCallback(async B=>{const I=C.current;if(!b||!I||g.current||L().isPaused())return!1;let Q,j,ne=!0;const Re=B||{},z=!E[b]||!Re.dedupe,K=()=>Mr?!g.current&&b===W.current&&F.current:b===W.current,de={isValidating:!1,isLoading:!1},Mt=()=>{ee(de)},Ye=()=>{const oe=E[b];oe&&oe[1]===j&&delete E[b]},qt={isValidating:!0};k(P().data)&&(qt.isLoading=!0);try{if(z&&(ee(qt),t.loadingTimeout&&k(P().data)&&setTimeout(()=>{ne&&K()&&L().onLoadingSlow(b,t)},t.loadingTimeout),E[b]=[I(T),On()]),[Q,j]=E[b],Q=await Q,z&&setTimeout(Ye,t.dedupingInterval),!E[b]||E[b][1]!==j)return z&&K()&&L().onDiscarded(b),!1;de.error=ie;const oe=w[b];if(!k(oe)&&(j<=oe[0]||j<=oe[1]||oe[1]===0))return Mt(),z&&K()&&L().onDiscarded(b),!1;const le=P().data;de.data=s(le,Q)?le:Q,z&&K()&&L().onSuccess(Q,b,t)}catch(oe){Ye();const le=L(),{shouldRetryOnError:ze}=le;le.isPaused()||(de.error=oe,z&&K()&&(le.onError(oe,b,le),(ze===!0||be(ze)&&ze(oe))&&q()&&le.onErrorRetry(oe,b,le,Be=>{const dt=y[b];dt&&dt[0]&&dt[0](rt.ERROR_REVALIDATE_EVENT,Be)},{retryCount:(Re.retryCount||0)+1,dedupe:!0})))}return ne=!1,Mt(),!0},[b,r]),jt=d.useCallback((...B)=>Yr(r,W.current,...B),[]);if(Rn(()=>{C.current=e,M.current=t,k(Ee)||(Vt.current=Ee)}),Rn(()=>{if(!b)return;const B=ge.bind(ie,xn);let I=0;const j=vo(b,y,(ne,Re={})=>{if(ne==rt.FOCUS_EVENT){const z=Date.now();L().revalidateOnFocus&&z>I&&q()&&(I=z+L().focusThrottleInterval,B())}else if(ne==rt.RECONNECT_EVENT)L().revalidateOnReconnect&&q()&&B();else{if(ne==rt.MUTATE_EVENT)return ge();if(ne==rt.ERROR_REVALIDATE_EVENT)return ge(Re)}});return g.current=!1,W.current=b,F.current=!0,ee({_k:T}),We&&(k(Se)||nt?B():Qi(B)),()=>{g.current=!0,j()}},[b]),Rn(()=>{let B;function I(){const j=be(a)?a(P().data):a;j&&B!==-1&&(B=setTimeout(Q,j))}function Q(){!P().error&&(h||L().isVisible())&&(f||L().isOnline())?ge(xn).then(I):I()}return I(),()=>{B&&(clearTimeout(B),B=-1)}},[a,h,f,b]),d.useDebugValue(qe),i&&k(Se)&&b){if(!Mr&&nt)throw new Error("Fallback data is required when using suspense in SSR.");C.current=e,M.current=t,g.current=!1;const B=O[b];if(!k(B)){const I=jt(B);Xr(I)}if(k(Pe)){const I=ge(xn);k(qe)||(I.status="fulfilled",I.value=!0),Xr(I)}else throw Pe}return{mutate:jt,get data(){return U.data=!0,qe},get error(){return U.error=!0,Pe},get isValidating(){return U.isValidating=!0,Je},get isLoading(){return U.isLoading=!0,ht}}}),ye=Object.create(null);ye.open="0",ye.close="1",ye.ping="2",ye.pong="3",ye.message="4",ye.upgrade="5",ye.noop="6";const At=Object.create(null);Object.keys(ye).forEach(n=>{At[ye[n]]=n});const An={type:"error",data:"parser error"},Qr=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Zr=typeof ArrayBuffer=="function",$r=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,kn=({type:n,data:e},t,r)=>Qr&&e instanceof Blob?t?r(e):es(e,r):Zr&&(e instanceof ArrayBuffer||$r(e))?t?r(e):es(new Blob([e]),r):r(ye[n]+(e||"")),es=(n,e)=>{const t=new FileReader;return t.onload=function(){const r=t.result.split(",")[1];e("b"+(r||""))},t.readAsDataURL(n)};function ts(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Dn;function yo(n,e){if(Qr&&n.data instanceof Blob)return n.data.arrayBuffer().then(ts).then(e);if(Zr&&(n.data instanceof ArrayBuffer||$r(n.data)))return e(ts(n.data));kn(n,!1,t=>{Dn||(Dn=new TextEncoder),e(Dn.encode(t))})}const ns="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",it=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<ns.length;n++)it[ns.charCodeAt(n)]=n;const mo=n=>{let e=n.length*.75,t=n.length,r,s=0,i,o,u,l;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const a=new ArrayBuffer(e),h=new Uint8Array(a);for(r=0;r<t;r+=4)i=it[n.charCodeAt(r)],o=it[n.charCodeAt(r+1)],u=it[n.charCodeAt(r+2)],l=it[n.charCodeAt(r+3)],h[s++]=i<<2|o>>4,h[s++]=(o&15)<<4|u>>2,h[s++]=(u&3)<<6|l&63;return a},go=typeof ArrayBuffer=="function",Ln=(n,e)=>{if(typeof n!="string")return{type:"message",data:rs(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:bo(n.substring(1),e)}:At[t]?n.length>1?{type:At[t],data:n.substring(1)}:{type:At[t]}:An},bo=(n,e)=>{if(go){const t=mo(n);return rs(t,e)}else return{base64:!0,data:n}},rs=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},ss=String.fromCharCode(30),_o=(n,e)=>{const t=n.length,r=new Array(t);let s=0;n.forEach((i,o)=>{kn(i,!1,u=>{r[o]=u,++s===t&&e(r.join(ss))})})},wo=(n,e)=>{const t=n.split(ss),r=[];for(let s=0;s<t.length;s++){const i=Ln(t[s],e);if(r.push(i),i.type==="error")break}return r};function Eo(){return new TransformStream({transform(n,e){yo(n,t=>{const r=t.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const i=new DataView(s.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{s=new Uint8Array(9);const i=new DataView(s.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}n.data&&typeof n.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(t)})}})}let Nn;function kt(n){return n.reduce((e,t)=>e+t.length,0)}function Dt(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let r=0;for(let s=0;s<e;s++)t[s]=n[0][r++],r===n[0].length&&(n.shift(),r=0);return n.length&&r<n[0].length&&(n[0]=n[0].slice(r)),t}function So(n,e){Nn||(Nn=new TextDecoder);const t=[];let r=0,s=-1,i=!1;return new TransformStream({transform(o,u){for(t.push(o);;){if(r===0){if(kt(t)<1)break;const l=Dt(t,1);i=(l[0]&128)===128,s=l[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(kt(t)<2)break;const l=Dt(t,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(kt(t)<8)break;const l=Dt(t,8),a=new DataView(l.buffer,l.byteOffset,l.length),h=a.getUint32(0);if(h>Math.pow(2,53-32)-1){u.enqueue(An);break}s=h*Math.pow(2,32)+a.getUint32(4),r=3}else{if(kt(t)<s)break;const l=Dt(t,s);u.enqueue(Ln(i?l:Nn.decode(l),e)),r=0}if(s===0||s>n){u.enqueue(An);break}}}})}const is=4;function Y(n){if(n)return Ro(n)}function Ro(n){for(var e in Y.prototype)n[e]=Y.prototype[e];return n}Y.prototype.on=Y.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this},Y.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this},Y.prototype.off=Y.prototype.removeListener=Y.prototype.removeAllListeners=Y.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var r,s=0;s<t.length;s++)if(r=t[s],r===e||r.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this},Y.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(t){t=t.slice(0);for(var r=0,s=t.length;r<s;++r)t[r].apply(this,e)}return this},Y.prototype.emitReserved=Y.prototype.emit,Y.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]},Y.prototype.hasListeners=function(n){return!!this.listeners(n).length};const ce=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function os(n,...e){return e.reduce((t,r)=>(n.hasOwnProperty(r)&&(t[r]=n[r]),t),{})}const To=ce.setTimeout,Co=ce.clearTimeout;function Lt(n,e){e.useNativeTimers?(n.setTimeoutFn=To.bind(ce),n.clearTimeoutFn=Co.bind(ce)):(n.setTimeoutFn=ce.setTimeout.bind(ce),n.clearTimeoutFn=ce.clearTimeout.bind(ce))}const Oo=1.33;function xo(n){return typeof n=="string"?Ao(n):Math.ceil((n.byteLength||n.size)*Oo)}function Ao(n){let e=0,t=0;for(let r=0,s=n.length;r<s;r++)e=n.charCodeAt(r),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(r++,t+=4);return t}function ko(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function Do(n){let e={},t=n.split("&");for(let r=0,s=t.length;r<s;r++){let i=t[r].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}class Lo extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class Fn extends Y{constructor(e){super(),this.writable=!1,Lt(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,r){return super.emitReserved("error",new Lo(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Ln(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=ko(e);return t.length?"?"+t:""}}const as="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Pn=64,No={};let us=0,Nt=0,cs;function ls(n){let e="";do e=as[n%Pn]+e,n=Math.floor(n/Pn);while(n>0);return e}function fs(){const n=ls(+new Date);return n!==cs?(us=0,cs=n):n+"."+ls(us++)}for(;Nt<Pn;Nt++)No[as[Nt]]=Nt;let hs=!1;try{hs=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Fo=hs;function ds(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Fo))return new XMLHttpRequest}catch{}if(!e)try{return new ce[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function Ha(){}function Po(){}const Bo=function(){return new ds({xdomain:!1}).responseType!=null}();class Uo extends Fn{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let s=location.port;s||(s=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}const t=e&&e.forceBase64;this.supportsBinary=Bo&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||t()})),this.writable||(r++,this.once("drain",function(){--r||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};wo(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,_o(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=fs()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new me(this.uri(),e)}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(s,i)=>{this.onError("xhr post error",s,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,r)=>{this.onError("xhr poll error",t,r)}),this.pollXhr=e}}class me extends Y{constructor(e,t){super(),Lt(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=t.data!==void 0?t.data:null,this.create()}create(){var e;const t=os(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const r=this.xhr=new ds(t);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this.opts.extraHeaders[s])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this.opts.cookieJar)===null||s===void 0||s.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(this.index=me.requestsCount++,me.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Po,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete me.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(me.requestsCount=0,me.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ps);else if(typeof addEventListener=="function"){const n="onpagehide"in ce?"pagehide":"unload";addEventListener(n,ps,!1)}}function ps(){for(let n in me.requests)me.requests.hasOwnProperty(n)&&me.requests[n].abort()}const Bn=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),Ft=ce.WebSocket||ce.MozWebSocket,vs=!0,Io="arraybuffer",ys=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vo extends Fn{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,r=ys?{}:os(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=vs&&!ys?t?new Ft(e,t):new Ft(e):new Ft(e,t,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],s=t===e.length-1;kn(r,this.supportsBinary,i=>{const o={};try{vs&&this.ws.send(i)}catch{}s&&Bn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=fs()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!Ft}}class jo extends Fn{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const t=So(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(t).getReader(),s=Eo();s.readable.pipeTo(e.writable),this.writer=s.writable.getWriter();const i=()=>{r.read().then(({done:u,value:l})=>{u||(this.onPacket(l),i())}).catch(u=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],s=t===e.length-1;this.writer.write(r).then(()=>{s&&Bn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const Mo={websocket:Vo,webtransport:jo,polling:Uo},qo=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wo=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Un(n){const e=n,t=n.indexOf("["),r=n.indexOf("]");t!=-1&&r!=-1&&(n=n.substring(0,t)+n.substring(t,r).replace(/:/g,";")+n.substring(r,n.length));let s=qo.exec(n||""),i={},o=14;for(;o--;)i[Wo[o]]=s[o]||"";return t!=-1&&r!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Ho(i,i.path),i.queryKey=Jo(i,i.query),i}function Ho(n,e){const t=/\/{2,9}/g,r=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Jo(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,i){s&&(t[s]=i)}),t}class Ae extends Y{constructor(e,t={}){super(),this.binaryType=Io,this.writeBuffer=[],e&&typeof e=="object"&&(t=e,e=null),e?(e=Un(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Un(t.host).host),Lt(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Do(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=is,t.transport=e,this.id&&(t.sid=this.id);const r=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new Mo[e](r)}open(){let e;if(this.opts.rememberUpgrade&&Ae.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),r=!1;Ae.priorWebsocketSuccess=!1;const s=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Ae.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const v=new Error("probe error");v.transport=t.name,this.emitReserved("upgradeError",v)}}))};function i(){r||(r=!0,h(),t.close(),t=null)}const o=f=>{const v=new Error("probe error: "+f);v.transport=t.name,i(),this.emitReserved("upgradeError",v)};function u(){o("transport closed")}function l(){o("socket closed")}function a(f){t&&f.name!==t.name&&i()}const h=()=>{t.removeListener("open",s),t.removeListener("error",o),t.removeListener("close",u),this.off("close",l),this.off("upgrading",a)};t.once("open",s),t.once("error",o),t.once("close",u),this.once("close",l),this.once("upgrading",a),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onOpen(){if(this.readyState="open",Ae.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(t+=xo(s)),r>0&&t>this.maxPayload)return this.writeBuffer.slice(0,r);t+=2}return this.writeBuffer}write(e,t,r){return this.sendPacket("message",e,t,r),this}send(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r,s){if(typeof t=="function"&&(s=t,t=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:e,data:t,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){Ae.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let r=0;const s=e.length;for(;r<s;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}Ae.protocol=is;function Yo(n,e="",t){let r=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),r=Un(n)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+e,r.href=r.protocol+"://"+i+(t&&t.port===r.port?"":":"+r.port),r}const zo=typeof ArrayBuffer=="function",Ko=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,ms=Object.prototype.toString,Go=typeof Blob=="function"||typeof Blob<"u"&&ms.call(Blob)==="[object BlobConstructor]",Xo=typeof File=="function"||typeof File<"u"&&ms.call(File)==="[object FileConstructor]";function In(n){return zo&&(n instanceof ArrayBuffer||Ko(n))||Go&&n instanceof Blob||Xo&&n instanceof File}function Pt(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;t++)if(Pt(n[t]))return!0;return!1}if(In(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Pt(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&Pt(n[t]))return!0;return!1}function Qo(n){const e=[],t=n.data,r=n;return r.data=Vn(t,e),r.attachments=e.length,{packet:r,buffers:e}}function Vn(n,e){if(!n)return n;if(In(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let r=0;r<n.length;r++)t[r]=Vn(n[r],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=Vn(n[r],e));return t}return n}function Zo(n,e){return n.data=jn(n.data,e),delete n.attachments,n}function jn(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=jn(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=jn(n[t],e));return n}const $o=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ea=5;var R;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(R||(R={}));class ta{constructor(e){this.replacer=e}encode(e){return(e.type===R.EVENT||e.type===R.ACK)&&Pt(e)?this.encodeAsBinary({type:e.type===R.EVENT?R.BINARY_EVENT:R.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===R.BINARY_EVENT||e.type===R.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Qo(e),r=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(r),s}}function gs(n){return Object.prototype.toString.call(n)==="[object Object]"}class Mn extends Y{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const r=t.type===R.BINARY_EVENT;r||t.type===R.BINARY_ACK?(t.type=r?R.EVENT:R.ACK,this.reconstructor=new na(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(In(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const r={type:Number(e.charAt(0))};if(R[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===R.BINARY_EVENT||r.type===R.BINARY_ACK){const i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(e.charAt(t+1)==="/"){const i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););r.nsp=e.substring(i,t)}else r.nsp="/";const s=e.charAt(t+1);if(s!==""&&Number(s)==s){const i=t+1;for(;++t;){const o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}r.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){const i=this.tryParse(e.substr(t));if(Mn.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case R.CONNECT:return gs(t);case R.DISCONNECT:return t===void 0;case R.CONNECT_ERROR:return typeof t=="string"||gs(t);case R.EVENT:case R.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&$o.indexOf(t[0])===-1);case R.ACK:case R.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class na{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=Zo(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ra=Object.freeze(Object.defineProperty({__proto__:null,protocol:ea,get PacketType(){return R},Encoder:ta,Decoder:Mn},Symbol.toStringTag,{value:"Module"}));function he(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const sa=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class bs extends Y{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[he(e,"open",this.onopen.bind(this)),he(e,"packet",this.onpacket.bind(this)),he(e,"error",this.onerror.bind(this)),he(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(sa.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const r={type:R.EVENT,data:t};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const o=this.ids++,u=t.pop();this._registerAckCallback(o,u),r.id=o}const s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!s||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,t){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[e]=t;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},s);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(i),t.apply(this,[null,...o])}}emitWithAck(e,...t){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((s,i)=>{t.push((o,u)=>r?o?i(o):s(u):s(o)),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...i)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(s)):(this._queue.shift(),t&&t(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:R.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case R.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case R.EVENT:case R.BINARY_EVENT:this.onevent(e);break;case R.ACK:case R.BINARY_ACK:this.onack(e);break;case R.DISCONNECT:this.ondisconnect();break;case R.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...s){r||(r=!0,t.packet({type:R.ACK,id:e,data:s}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:R.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}}function Me(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}Me.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0},Me.prototype.reset=function(){this.attempts=0},Me.prototype.setMin=function(n){this.ms=n},Me.prototype.setMax=function(n){this.max=n},Me.prototype.setJitter=function(n){this.jitter=n};class qn extends Y{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Lt(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((r=t.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Me({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const s=t.parser||ra;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Ae(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=he(t,"open",function(){r.onopen(),e&&e()}),i=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),e?e(u):this.maybeReconnectOnOpen()},o=he(t,"error",i);if(this._timeout!==!1){const u=this._timeout,l=this.setTimeoutFn(()=>{s(),i(new Error("timeout")),t.close()},u);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(he(e,"ping",this.onping.bind(this)),he(e,"data",this.ondata.bind(this)),he(e,"error",this.onerror.bind(this)),he(e,"close",this.onclose.bind(this)),he(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){Bn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new bs(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const r of t)if(this.nsps[r].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ot={};function Bt(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=Yo(n,e.path||"/socket.io"),r=t.source,s=t.id,i=t.path,o=ot[s]&&i in ot[s].nsps,u=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return u?l=new qn(r,e):(ot[s]||(ot[s]=new qn(r,e)),l=ot[s]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(Bt,{Manager:qn,Socket:bs,io:Bt,connect:Bt});class ia{constructor(e,t,r,s){ke(this,"socket_port");ke(this,"host");ke(this,"port");ke(this,"protocol");ke(this,"url");ke(this,"site_name");ke(this,"socket");var i,o;if(this.socket_port=r!=null?r:"9000",this.host=(i=window.location)==null?void 0:i.hostname,this.port=(o=window.location)!=null&&o.port?`:${this.socket_port}`:"",this.protocol=this.port?"http":"https",e){let u=new URL(e);u.port="",r?(u.port=r,this.url=u.toString()):this.url=u.toString()}else this.url=`${this.protocol}://${this.host}${this.port}/`;t&&(this.url=`${this.url}${t}`),this.site_name=t,this.socket=Bt(`${this.url}`,{withCredentials:!0,secure:this.protocol==="https",extraHeaders:s&&s.useToken===!0?{Authorization:`${s.type} ${s.token}`}:{}})}}var _s={exports:{}},at={};/**
|
|
18
|
+
*/var Vr;function qi(){return Vr||(Vr=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n=De.default,e=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(F){{for(var g=arguments.length,W=new Array(g>1?g-1:0),C=1;C<g;C++)W[C-1]=arguments[C];r("error",F,W)}}function r(F,g,W){{var C=e.ReactDebugCurrentFrame,M=C.getStackAddendum();M!==""&&(g+="%s",W=W.concat([M]));var L=W.map(function(q){return String(q)});L.unshift("Warning: "+g),Function.prototype.apply.call(console[F],console,L)}}function s(F,g){return F===g&&(F!==0||1/F===1/g)||F!==F&&g!==g}var i=typeof Object.is=="function"?Object.is:s,o=n.useState,u=n.useEffect,l=n.useLayoutEffect,a=n.useDebugValue,h=!1,f=!1;function v(F,g,W){h||n.startTransition!==void 0&&(h=!0,t("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var C=g();if(!f){var M=g();i(C,M)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var L=o({inst:{value:C,getSnapshot:g}}),q=L[0].inst,P=L[1];return l(function(){q.value=C,q.getSnapshot=g,y(q)&&P({inst:q})},[F,C,g]),u(function(){y(q)&&P({inst:q});var ee=function(){y(q)&&P({inst:q})};return F(ee)},[F]),a(C),C}function y(F){var g=F.getSnapshot,W=F.value;try{var C=g();return!i(W,C)}catch{return!0}}function w(F,g,W){return g()}var E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!E,b=x?w:v,T=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:b;yn.useSyncExternalStore=T,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),yn}(function(n){process.env.NODE_ENV==="production"?n.exports=Mi():n.exports=qi()})(Ur);const Oe=()=>{},ie=Oe(),mn=Object,k=n=>n===ie,be=n=>typeof n=="function",xe=(n,e)=>({...n,...e}),Wi=n=>be(n.then),Ct=new WeakMap;let Hi=0;const nt=n=>{const e=typeof n,t=n&&n.constructor,r=t==Date;let s,i;if(mn(n)===n&&!r&&t!=RegExp){if(s=Ct.get(n),s)return s;if(s=++Hi+"~",Ct.set(n,s),t==Array){for(s="@",i=0;i<n.length;i++)s+=nt(n[i])+",";Ct.set(n,s)}if(t==mn){s="#";const o=mn.keys(n).sort();for(;!k(i=o.pop());)k(n[i])||(s+=i+":"+nt(n[i])+",");Ct.set(n,s)}}else s=r?n.toJSON():e=="symbol"?n.toString():e=="string"?JSON.stringify(n):""+n;return s},_e=new WeakMap,gn={},Ot={},bn="undefined",xt=typeof window!=bn,_n=typeof document!=bn,Ji=()=>xt&&typeof window.requestAnimationFrame!=bn,jr=(n,e)=>{const t=_e.get(n);return[()=>!k(e)&&n.get(e)||gn,r=>{if(!k(e)){const s=n.get(e);e in Ot||(Ot[e]=s),t[5](e,xe(s,r),s||gn)}},t[6],()=>!k(e)&&e in Ot?Ot[e]:!k(e)&&n.get(e)||gn]};let wn=!0;const Yi=()=>wn,[En,Sn]=xt&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Oe,Oe],zi=()=>{const n=_n&&document.visibilityState;return k(n)||n!=="hidden"},Ki=n=>(_n&&document.addEventListener("visibilitychange",n),En("focus",n),()=>{_n&&document.removeEventListener("visibilitychange",n),Sn("focus",n)}),Gi=n=>{const e=()=>{wn=!0,n()},t=()=>{wn=!1};return En("online",e),En("offline",t),()=>{Sn("online",e),Sn("offline",t)}},Xi={isOnline:Yi,isVisible:zi},Qi={initFocus:Ki,initReconnect:Gi},Mr=!De.default.useId,rt=!xt||"Deno"in window,Zi=n=>Ji()?window.requestAnimationFrame(n):setTimeout(n,1),Rn=rt?d.useEffect:d.useLayoutEffect,Tn=typeof navigator<"u"&&navigator.connection,qr=!rt&&Tn&&(["slow-2g","2g"].includes(Tn.effectiveType)||Tn.saveData),Cn=n=>{if(be(n))try{n=n()}catch{n=""}const e=n;return n=typeof n=="string"?n:(Array.isArray(n)?n.length:n)?nt(n):"",[n,e]};let $i=0;const On=()=>++$i,Wr=0,Hr=1,Jr=2;var st={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:Wr,MUTATE_EVENT:Jr,RECONNECT_EVENT:Hr};async function Yr(...n){const[e,t,r,s]=n,i=xe({populateCache:!0,throwOnError:!0},typeof s=="boolean"?{revalidate:s}:s||{});let o=i.populateCache;const u=i.rollbackOnError;let l=i.optimisticData;const a=i.revalidate!==!1,h=y=>typeof u=="function"?u(y):u!==!1,f=i.throwOnError;if(be(t)){const y=t,w=[],E=e.keys();for(const x of E)!/^\$(inf|sub)\$/.test(x)&&y(e.get(x)._k)&&w.push(x);return Promise.all(w.map(v))}return v(t);async function v(y){const[w]=Cn(y);if(!w)return;const[E,x]=jr(e,w),[b,T,F,g]=_e.get(e),W=()=>{const U=b[w];return a&&(delete F[w],delete g[w],U&&U[0])?U[0](Jr).then(()=>E().data):E().data};if(n.length<3)return W();let C=r,M;const L=On();T[w]=[L,0];const q=!k(l),P=E(),ee=P.data,te=P._c,X=k(te)?ee:te;if(q&&(l=be(l)?l(X,ee):l,x({data:l,_c:X})),be(C))try{C=C(X)}catch(U){M=U}if(C&&Wi(C))if(C=await C.catch(U=>{M=U}),L!==T[w][0]){if(M)throw M;return C}else M&&q&&h(M)&&(o=!0,x({data:X,_c:ie}));if(o&&!M)if(be(o)){const U=o(C,X);x({data:U,error:ie,_c:ie})}else x({data:C,error:ie,_c:ie});if(T[w][1]=On(),Promise.resolve(W()).then(()=>{x({_c:ie})}),M){if(f)throw M;return}return C}}const zr=(n,e)=>{for(const t in n)n[t][0]&&n[t][0](e)},eo=(n,e)=>{if(!_e.has(n)){const t=xe(Qi,e),r={},s=Yr.bind(ie,n);let i=Oe;const o={},u=(h,f)=>{const v=o[h]||[];return o[h]=v,v.push(f),()=>v.splice(v.indexOf(f),1)},l=(h,f,v)=>{n.set(h,f);const y=o[h];if(y)for(const w of y)w(f,v)},a=()=>{if(!_e.has(n)&&(_e.set(n,[r,{},{},{},s,l,u]),!rt)){const h=t.initFocus(setTimeout.bind(ie,zr.bind(ie,r,Wr))),f=t.initReconnect(setTimeout.bind(ie,zr.bind(ie,r,Hr)));i=()=>{h&&h(),f&&f(),_e.delete(n)}}};return a(),[n,s,a,i]}return[n,_e.get(n)[4]]},to=(n,e,t,r,s)=>{const i=t.errorRetryCount,o=s.retryCount,u=~~((Math.random()+.5)*(1<<(o<8?o:8)))*t.errorRetryInterval;!k(i)&&o>i||setTimeout(r,u,s)},no=(n,e)=>nt(n)==nt(e),[Kr,ro]=eo(new Map),so=xe({onLoadingSlow:Oe,onSuccess:Oe,onError:Oe,onErrorRetry:to,onDiscarded:Oe,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:qr?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:qr?5e3:3e3,compare:no,isPaused:()=>!1,cache:Kr,mutate:ro,fallback:{}},Xi),io=(n,e)=>{const t=xe(n,e);if(e){const{use:r,fallback:s}=n,{use:i,fallback:o}=e;r&&i&&(t.use=r.concat(i)),s&&o&&(t.fallback=xe(s,o))}return t},oo=d.createContext({}),ao="$inf$",Gr=xt&&window.__SWR_DEVTOOLS_USE__,uo=Gr?window.__SWR_DEVTOOLS_USE__:[],co=()=>{Gr&&(window.__SWR_DEVTOOLS_REACT__=De.default)},lo=n=>be(n[1])?[n[0],n[1],n[2]||{}]:[n[0],null,(n[1]===null?n[2]:n[1])||{}],Xr=()=>xe(so,d.useContext(oo)),fo=n=>(e,t,r)=>n(e,t&&((...i)=>{const[o]=Cn(e),[,,,u]=_e.get(Kr);if(o.startsWith(ao))return t(...i);const l=u[o];return k(l)?t(...i):(delete u[o],l)}),r),ho=uo.concat(fo),po=n=>function(...t){const r=Xr(),[s,i,o]=lo(t),u=io(r,o);let l=n;const{use:a}=u,h=(a||[]).concat(ho);for(let f=h.length;f--;)l=h[f](l);return l(s,i||u.fetcher||null,u)},vo=(n,e,t)=>{const r=e[n]||(e[n]=[]);return r.push(t),()=>{const s=r.indexOf(t);s>=0&&(r[s]=r[r.length-1],r.pop())}};co();const Qr=De.default.use||(n=>{if(n.status==="pending")throw n;if(n.status==="fulfilled")return n.value;throw n.status==="rejected"?n.reason:(n.status="pending",n.then(e=>{n.status="fulfilled",n.value=e},e=>{n.status="rejected",n.reason=e}),n)}),xn={dedupe:!0},Me=po((n,e,t)=>{const{cache:r,compare:s,suspense:i,fallbackData:o,revalidateOnMount:u,revalidateIfStale:l,refreshInterval:a,refreshWhenHidden:h,refreshWhenOffline:f,keepPreviousData:v}=t,[y,w,E,x]=_e.get(r),[b,T]=Cn(n),F=d.useRef(!1),g=d.useRef(!1),W=d.useRef(b),C=d.useRef(e),M=d.useRef(t),L=()=>M.current,q=()=>L().isVisible()&&L().isOnline(),[P,ee,te,X]=jr(r,b),U=d.useRef({}).current,Fe=k(o)?t.fallback[b]:o,ct=(B,I)=>{for(const Q in U){const j=Q;if(j==="data"){if(!s(B[j],I[j])&&(!k(B[j])||!s(We,I[j])))return!1}else if(I[j]!==B[j])return!1}return!0},lt=d.useMemo(()=>{const B=(()=>!b||!e?!1:k(u)?L().isPaused()||i?!1:k(l)?!0:l:u)(),I=K=>{const de=xe(K);return delete de._k,B?{isValidating:!0,isLoading:!0,...de}:de},Q=P(),j=X(),ne=I(Q),Re=Q===j?ne:I(j);let z=ne;return[()=>{const K=I(P());return ct(K,z)?(z.data=K.data,z.isLoading=K.isLoading,z.isValidating=K.isValidating,z.error=K.error,z):(z=K,K)},()=>Re]},[r,b]),we=Ur.exports.useSyncExternalStore(d.useCallback(B=>te(b,(I,Q)=>{ct(Q,I)||B()}),[r,b]),lt[0],lt[1]),ft=!F.current,It=y[b]&&y[b].length>0,Ee=we.data,Se=k(Ee)?Fe:Ee,Pe=we.error,Vt=d.useRef(Se),We=v?k(Ee)?Vt.current:Ee:Se,He=(()=>It&&!k(Pe)?!1:ft&&!k(u)?u:L().isPaused()?!1:i?k(Se)?!1:l:k(Se)||l)(),Je=!!(b&&e&&ft&&He),Ye=k(we.isValidating)?Je:we.isValidating,ht=k(we.isLoading)?Je:we.isLoading,ge=d.useCallback(async B=>{const I=C.current;if(!b||!I||g.current||L().isPaused())return!1;let Q,j,ne=!0;const Re=B||{},z=!E[b]||!Re.dedupe,K=()=>Mr?!g.current&&b===W.current&&F.current:b===W.current,de={isValidating:!1,isLoading:!1},Mt=()=>{ee(de)},ze=()=>{const oe=E[b];oe&&oe[1]===j&&delete E[b]},qt={isValidating:!0};k(P().data)&&(qt.isLoading=!0);try{if(z&&(ee(qt),t.loadingTimeout&&k(P().data)&&setTimeout(()=>{ne&&K()&&L().onLoadingSlow(b,t)},t.loadingTimeout),E[b]=[I(T),On()]),[Q,j]=E[b],Q=await Q,z&&setTimeout(ze,t.dedupingInterval),!E[b]||E[b][1]!==j)return z&&K()&&L().onDiscarded(b),!1;de.error=ie;const oe=w[b];if(!k(oe)&&(j<=oe[0]||j<=oe[1]||oe[1]===0))return Mt(),z&&K()&&L().onDiscarded(b),!1;const le=P().data;de.data=s(le,Q)?le:Q,z&&K()&&L().onSuccess(Q,b,t)}catch(oe){ze();const le=L(),{shouldRetryOnError:Ke}=le;le.isPaused()||(de.error=oe,z&&K()&&(le.onError(oe,b,le),(Ke===!0||be(Ke)&&Ke(oe))&&q()&&le.onErrorRetry(oe,b,le,Be=>{const dt=y[b];dt&&dt[0]&&dt[0](st.ERROR_REVALIDATE_EVENT,Be)},{retryCount:(Re.retryCount||0)+1,dedupe:!0})))}return ne=!1,Mt(),!0},[b,r]),jt=d.useCallback((...B)=>Yr(r,W.current,...B),[]);if(Rn(()=>{C.current=e,M.current=t,k(Ee)||(Vt.current=Ee)}),Rn(()=>{if(!b)return;const B=ge.bind(ie,xn);let I=0;const j=vo(b,y,(ne,Re={})=>{if(ne==st.FOCUS_EVENT){const z=Date.now();L().revalidateOnFocus&&z>I&&q()&&(I=z+L().focusThrottleInterval,B())}else if(ne==st.RECONNECT_EVENT)L().revalidateOnReconnect&&q()&&B();else{if(ne==st.MUTATE_EVENT)return ge();if(ne==st.ERROR_REVALIDATE_EVENT)return ge(Re)}});return g.current=!1,W.current=b,F.current=!0,ee({_k:T}),He&&(k(Se)||rt?B():Zi(B)),()=>{g.current=!0,j()}},[b]),Rn(()=>{let B;function I(){const j=be(a)?a(P().data):a;j&&B!==-1&&(B=setTimeout(Q,j))}function Q(){!P().error&&(h||L().isVisible())&&(f||L().isOnline())?ge(xn).then(I):I()}return I(),()=>{B&&(clearTimeout(B),B=-1)}},[a,h,f,b]),d.useDebugValue(We),i&&k(Se)&&b){if(!Mr&&rt)throw new Error("Fallback data is required when using suspense in SSR.");C.current=e,M.current=t,g.current=!1;const B=x[b];if(!k(B)){const I=jt(B);Qr(I)}if(k(Pe)){const I=ge(xn);k(We)||(I.status="fulfilled",I.value=!0),Qr(I)}else throw Pe}return{mutate:jt,get data(){return U.data=!0,We},get error(){return U.error=!0,Pe},get isValidating(){return U.isValidating=!0,Ye},get isLoading(){return U.isLoading=!0,ht}}}),ye=Object.create(null);ye.open="0",ye.close="1",ye.ping="2",ye.pong="3",ye.message="4",ye.upgrade="5",ye.noop="6";const At=Object.create(null);Object.keys(ye).forEach(n=>{At[ye[n]]=n});const An={type:"error",data:"parser error"},Zr=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",$r=typeof ArrayBuffer=="function",es=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,kn=({type:n,data:e},t,r)=>Zr&&e instanceof Blob?t?r(e):ts(e,r):$r&&(e instanceof ArrayBuffer||es(e))?t?r(e):ts(new Blob([e]),r):r(ye[n]+(e||"")),ts=(n,e)=>{const t=new FileReader;return t.onload=function(){const r=t.result.split(",")[1];e("b"+(r||""))},t.readAsDataURL(n)};function ns(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let Dn;function yo(n,e){if(Zr&&n.data instanceof Blob)return n.data.arrayBuffer().then(ns).then(e);if($r&&(n.data instanceof ArrayBuffer||es(n.data)))return e(ns(n.data));kn(n,!1,t=>{Dn||(Dn=new TextEncoder),e(Dn.encode(t))})}const rs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",it=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n<rs.length;n++)it[rs.charCodeAt(n)]=n;const mo=n=>{let e=n.length*.75,t=n.length,r,s=0,i,o,u,l;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const a=new ArrayBuffer(e),h=new Uint8Array(a);for(r=0;r<t;r+=4)i=it[n.charCodeAt(r)],o=it[n.charCodeAt(r+1)],u=it[n.charCodeAt(r+2)],l=it[n.charCodeAt(r+3)],h[s++]=i<<2|o>>4,h[s++]=(o&15)<<4|u>>2,h[s++]=(u&3)<<6|l&63;return a},go=typeof ArrayBuffer=="function",Ln=(n,e)=>{if(typeof n!="string")return{type:"message",data:ss(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:bo(n.substring(1),e)}:At[t]?n.length>1?{type:At[t],data:n.substring(1)}:{type:At[t]}:An},bo=(n,e)=>{if(go){const t=mo(n);return ss(t,e)}else return{base64:!0,data:n}},ss=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},is=String.fromCharCode(30),_o=(n,e)=>{const t=n.length,r=new Array(t);let s=0;n.forEach((i,o)=>{kn(i,!1,u=>{r[o]=u,++s===t&&e(r.join(is))})})},wo=(n,e)=>{const t=n.split(is),r=[];for(let s=0;s<t.length;s++){const i=Ln(t[s],e);if(r.push(i),i.type==="error")break}return r};function Eo(){return new TransformStream({transform(n,e){yo(n,t=>{const r=t.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const i=new DataView(s.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{s=new Uint8Array(9);const i=new DataView(s.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}n.data&&typeof n.data!="string"&&(s[0]|=128),e.enqueue(s),e.enqueue(t)})}})}let Nn;function kt(n){return n.reduce((e,t)=>e+t.length,0)}function Dt(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let r=0;for(let s=0;s<e;s++)t[s]=n[0][r++],r===n[0].length&&(n.shift(),r=0);return n.length&&r<n[0].length&&(n[0]=n[0].slice(r)),t}function So(n,e){Nn||(Nn=new TextDecoder);const t=[];let r=0,s=-1,i=!1;return new TransformStream({transform(o,u){for(t.push(o);;){if(r===0){if(kt(t)<1)break;const l=Dt(t,1);i=(l[0]&128)===128,s=l[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(kt(t)<2)break;const l=Dt(t,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(kt(t)<8)break;const l=Dt(t,8),a=new DataView(l.buffer,l.byteOffset,l.length),h=a.getUint32(0);if(h>Math.pow(2,53-32)-1){u.enqueue(An);break}s=h*Math.pow(2,32)+a.getUint32(4),r=3}else{if(kt(t)<s)break;const l=Dt(t,s);u.enqueue(Ln(i?l:Nn.decode(l),e)),r=0}if(s===0||s>n){u.enqueue(An);break}}}})}const os=4;function Y(n){if(n)return Ro(n)}function Ro(n){for(var e in Y.prototype)n[e]=Y.prototype[e];return n}Y.prototype.on=Y.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this},Y.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this},Y.prototype.off=Y.prototype.removeListener=Y.prototype.removeAllListeners=Y.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var r,s=0;s<t.length;s++)if(r=t[s],r===e||r.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this},Y.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(t){t=t.slice(0);for(var r=0,s=t.length;r<s;++r)t[r].apply(this,e)}return this},Y.prototype.emitReserved=Y.prototype.emit,Y.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]},Y.prototype.hasListeners=function(n){return!!this.listeners(n).length};const ce=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function as(n,...e){return e.reduce((t,r)=>(n.hasOwnProperty(r)&&(t[r]=n[r]),t),{})}const To=ce.setTimeout,Co=ce.clearTimeout;function Lt(n,e){e.useNativeTimers?(n.setTimeoutFn=To.bind(ce),n.clearTimeoutFn=Co.bind(ce)):(n.setTimeoutFn=ce.setTimeout.bind(ce),n.clearTimeoutFn=ce.clearTimeout.bind(ce))}const Oo=1.33;function xo(n){return typeof n=="string"?Ao(n):Math.ceil((n.byteLength||n.size)*Oo)}function Ao(n){let e=0,t=0;for(let r=0,s=n.length;r<s;r++)e=n.charCodeAt(r),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(r++,t+=4);return t}function ko(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function Do(n){let e={},t=n.split("&");for(let r=0,s=t.length;r<s;r++){let i=t[r].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}class Lo extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class Fn extends Y{constructor(e){super(),this.writable=!1,Lt(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,r){return super.emitReserved("error",new Lo(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=Ln(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const t=ko(e);return t.length?"?"+t:""}}const us="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Pn=64,No={};let cs=0,Nt=0,ls;function fs(n){let e="";do e=us[n%Pn]+e,n=Math.floor(n/Pn);while(n>0);return e}function hs(){const n=fs(+new Date);return n!==ls?(cs=0,ls=n):n+"."+fs(cs++)}for(;Nt<Pn;Nt++)No[us[Nt]]=Nt;let ds=!1;try{ds=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Fo=ds;function ps(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Fo))return new XMLHttpRequest}catch{}if(!e)try{return new ce[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function Ha(){}function Po(){}const Bo=function(){return new ps({xdomain:!1}).responseType!=null}();class Uo extends Fn{constructor(e){if(super(e),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let s=location.port;s||(s=r?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}const t=e&&e.forceBase64;this.supportsBinary=Bo&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||t()})),this.writable||(r++,this.once("drain",function(){--r||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};wo(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,_o(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=hs()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new me(this.uri(),e)}doWrite(e,t){const r=this.request({method:"POST",data:e});r.on("success",t),r.on("error",(s,i)=>{this.onError("xhr post error",s,i)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,r)=>{this.onError("xhr poll error",t,r)}),this.pollXhr=e}}class me extends Y{constructor(e,t){super(),Lt(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=t.data!==void 0?t.data:null,this.create()}create(){var e;const t=as(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const r=this.xhr=new ps(t);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this.opts.extraHeaders[s])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this.opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this.opts.cookieJar)===null||s===void 0||s.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(s){this.setTimeoutFn(()=>{this.onError(s)},0);return}typeof document<"u"&&(this.index=me.requestsCount++,me.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=Po,e)try{this.xhr.abort()}catch{}typeof document<"u"&&delete me.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(me.requestsCount=0,me.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",vs);else if(typeof addEventListener=="function"){const n="onpagehide"in ce?"pagehide":"unload";addEventListener(n,vs,!1)}}function vs(){for(let n in me.requests)me.requests.hasOwnProperty(n)&&me.requests[n].abort()}const Bn=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0))(),Ft=ce.WebSocket||ce.MozWebSocket,ys=!0,Io="arraybuffer",ms=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Vo extends Fn{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,r=ms?{}:as(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=ys&&!ms?t?new Ft(e,t):new Ft(e):new Ft(e,t,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],s=t===e.length-1;kn(r,this.supportsBinary,i=>{const o={};try{ys&&this.ws.send(i)}catch{}s&&Bn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=hs()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!Ft}}class jo extends Fn{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(e=>{const t=So(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(t).getReader(),s=Eo();s.readable.pipeTo(e.writable),this.writer=s.writable.getWriter();const i=()=>{r.read().then(({done:u,value:l})=>{u||(this.onPacket(l),i())}).catch(u=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const r=e[t],s=t===e.length-1;this.writer.write(r).then(()=>{s&&Bn(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this.transport)===null||e===void 0||e.close()}}const Mo={websocket:Vo,webtransport:jo,polling:Uo},qo=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Wo=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Un(n){const e=n,t=n.indexOf("["),r=n.indexOf("]");t!=-1&&r!=-1&&(n=n.substring(0,t)+n.substring(t,r).replace(/:/g,";")+n.substring(r,n.length));let s=qo.exec(n||""),i={},o=14;for(;o--;)i[Wo[o]]=s[o]||"";return t!=-1&&r!=-1&&(i.source=e,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=Ho(i,i.path),i.queryKey=Jo(i,i.query),i}function Ho(n,e){const t=/\/{2,9}/g,r=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function Jo(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,i){s&&(t[s]=i)}),t}class Ae extends Y{constructor(e,t={}){super(),this.binaryType=Io,this.writeBuffer=[],e&&typeof e=="object"&&(t=e,e=null),e?(e=Un(e),t.hostname=e.host,t.secure=e.protocol==="https"||e.protocol==="wss",t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=Un(t.host).host),Lt(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Do(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=os,t.transport=e,this.id&&(t.sid=this.id);const r=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new Mo[e](r)}open(){let e;if(this.opts.rememberUpgrade&&Ae.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",t=>this.onClose("transport close",t))}probe(e){let t=this.createTransport(e),r=!1;Ae.priorWebsocketSuccess=!1;const s=()=>{r||(t.send([{type:"ping",data:"probe"}]),t.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Ae.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const v=new Error("probe error");v.transport=t.name,this.emitReserved("upgradeError",v)}}))};function i(){r||(r=!0,h(),t.close(),t=null)}const o=f=>{const v=new Error("probe error: "+f);v.transport=t.name,i(),this.emitReserved("upgradeError",v)};function u(){o("transport closed")}function l(){o("socket closed")}function a(f){t&&f.name!==t.name&&i()}const h=()=>{t.removeListener("open",s),t.removeListener("error",o),t.removeListener("close",u),this.off("close",l),this.off("upgrading",a)};t.once("open",s),t.once("error",o),t.once("close",u),this.once("close",l),this.once("upgrading",a),this.upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||t.open()},200):t.open()}onOpen(){if(this.readyState="open",Ae.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(t+=xo(s)),r>0&&t>this.maxPayload)return this.writeBuffer.slice(0,r);t+=2}return this.writeBuffer}write(e,t,r){return this.sendPacket("message",e,t,r),this}send(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r,s){if(typeof t=="function"&&(s=t,t=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:e,data:t,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),s&&this.once("flush",s),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){Ae.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let r=0;const s=e.length;for(;r<s;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}}Ae.protocol=os;function Yo(n,e="",t){let r=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),r=Un(n)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+e,r.href=r.protocol+"://"+i+(t&&t.port===r.port?"":":"+r.port),r}const zo=typeof ArrayBuffer=="function",Ko=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,gs=Object.prototype.toString,Go=typeof Blob=="function"||typeof Blob<"u"&&gs.call(Blob)==="[object BlobConstructor]",Xo=typeof File=="function"||typeof File<"u"&&gs.call(File)==="[object FileConstructor]";function In(n){return zo&&(n instanceof ArrayBuffer||Ko(n))||Go&&n instanceof Blob||Xo&&n instanceof File}function Pt(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,r=n.length;t<r;t++)if(Pt(n[t]))return!0;return!1}if(In(n))return!0;if(n.toJSON&&typeof n.toJSON=="function"&&arguments.length===1)return Pt(n.toJSON(),!0);for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&Pt(n[t]))return!0;return!1}function Qo(n){const e=[],t=n.data,r=n;return r.data=Vn(t,e),r.attachments=e.length,{packet:r,buffers:e}}function Vn(n,e){if(!n)return n;if(In(n)){const t={_placeholder:!0,num:e.length};return e.push(n),t}else if(Array.isArray(n)){const t=new Array(n.length);for(let r=0;r<n.length;r++)t[r]=Vn(n[r],e);return t}else if(typeof n=="object"&&!(n instanceof Date)){const t={};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=Vn(n[r],e));return t}return n}function Zo(n,e){return n.data=jn(n.data,e),delete n.attachments,n}function jn(n,e){if(!n)return n;if(n&&n._placeholder===!0){if(typeof n.num=="number"&&n.num>=0&&n.num<e.length)return e[n.num];throw new Error("illegal attachments")}else if(Array.isArray(n))for(let t=0;t<n.length;t++)n[t]=jn(n[t],e);else if(typeof n=="object")for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(n[t]=jn(n[t],e));return n}const $o=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ea=5;var R;(function(n){n[n.CONNECT=0]="CONNECT",n[n.DISCONNECT=1]="DISCONNECT",n[n.EVENT=2]="EVENT",n[n.ACK=3]="ACK",n[n.CONNECT_ERROR=4]="CONNECT_ERROR",n[n.BINARY_EVENT=5]="BINARY_EVENT",n[n.BINARY_ACK=6]="BINARY_ACK"})(R||(R={}));class ta{constructor(e){this.replacer=e}encode(e){return(e.type===R.EVENT||e.type===R.ACK)&&Pt(e)?this.encodeAsBinary({type:e.type===R.EVENT?R.BINARY_EVENT:R.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===R.BINARY_EVENT||e.type===R.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=Qo(e),r=this.encodeAsString(t.packet),s=t.buffers;return s.unshift(r),s}}function bs(n){return Object.prototype.toString.call(n)==="[object Object]"}class Mn extends Y{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const r=t.type===R.BINARY_EVENT;r||t.type===R.BINARY_ACK?(t.type=r?R.EVENT:R.ACK,this.reconstructor=new na(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(In(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0;const r={type:Number(e.charAt(0))};if(R[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===R.BINARY_EVENT||r.type===R.BINARY_ACK){const i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);const o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(e.charAt(t+1)==="/"){const i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););r.nsp=e.substring(i,t)}else r.nsp="/";const s=e.charAt(t+1);if(s!==""&&Number(s)==s){const i=t+1;for(;++t;){const o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}r.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){const i=this.tryParse(e.substr(t));if(Mn.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case R.CONNECT:return bs(t);case R.DISCONNECT:return t===void 0;case R.CONNECT_ERROR:return typeof t=="string"||bs(t);case R.EVENT:case R.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&$o.indexOf(t[0])===-1);case R.ACK:case R.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class na{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const t=Zo(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const ra=Object.freeze(Object.defineProperty({__proto__:null,protocol:ea,get PacketType(){return R},Encoder:ta,Decoder:Mn},Symbol.toStringTag,{value:"Module"}));function he(n,e,t){return n.on(e,t),function(){n.off(e,t)}}const sa=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class _s extends Y{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[he(e,"open",this.onopen.bind(this)),he(e,"packet",this.onpacket.bind(this)),he(e,"error",this.onerror.bind(this)),he(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(sa.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const r={type:R.EVENT,data:t};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){const o=this.ids++,u=t.pop();this._registerAckCallback(o,u),r.id=o}const s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!s||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,t){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[e]=t;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);t.call(this,new Error("operation has timed out"))},s);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(i),t.apply(this,[null,...o])}}emitWithAck(e,...t){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((s,i)=>{t.push((o,u)=>r?o?i(o):s(u):s(o)),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((s,...i)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(s)):(this._queue.shift(),t&&t(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:R.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case R.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case R.EVENT:case R.BINARY_EVENT:this.onevent(e);break;case R.ACK:case R.BINARY_ACK:this.onack(e);break;case R.DISCONNECT:this.ondisconnect();break;case R.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const r of t)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...s){r||(r=!0,t.packet({type:R.ACK,id:e,data:s}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:R.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const r of t)r.apply(this,e.data)}}}function qe(n){n=n||{},this.ms=n.min||100,this.max=n.max||1e4,this.factor=n.factor||2,this.jitter=n.jitter>0&&n.jitter<=1?n.jitter:0,this.attempts=0}qe.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0},qe.prototype.reset=function(){this.attempts=0},qe.prototype.setMin=function(n){this.ms=n},qe.prototype.setMax=function(n){this.max=n},qe.prototype.setJitter=function(n){this.jitter=n};class qn extends Y{constructor(e,t){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,Lt(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((r=t.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new qe({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const s=t.parser||ra;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Ae(this.uri,this.opts);const t=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=he(t,"open",function(){r.onopen(),e&&e()}),i=u=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",u),e?e(u):this.maybeReconnectOnOpen()},o=he(t,"error",i);if(this._timeout!==!1){const u=this._timeout,l=this.setTimeoutFn(()=>{s(),i(new Error("timeout")),t.close()},u);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(he(e,"ping",this.onping.bind(this)),he(e,"data",this.ondata.bind(this)),he(e,"error",this.onerror.bind(this)),he(e,"close",this.onclose.bind(this)),he(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){Bn(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new _s(this,e,t),this.nsps[e]=r),r}_destroy(e){const t=Object.keys(this.nsps);for(const r of t)if(this.nsps[r].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(s=>{s?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",s)):e.onreconnect()}))},t);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const ot={};function Bt(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=Yo(n,e.path||"/socket.io"),r=t.source,s=t.id,i=t.path,o=ot[s]&&i in ot[s].nsps,u=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return u?l=new qn(r,e):(ot[s]||(ot[s]=new qn(r,e)),l=ot[s]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(Bt,{Manager:qn,Socket:_s,io:Bt,connect:Bt});class ia{constructor(e,t,r,s){ke(this,"socket_port");ke(this,"host");ke(this,"port");ke(this,"protocol");ke(this,"url");ke(this,"site_name");ke(this,"socket");var i,o;if(this.socket_port=r!=null?r:"9000",this.host=(i=window.location)==null?void 0:i.hostname,this.port=(o=window.location)!=null&&o.port?`:${this.socket_port}`:"",this.protocol=this.port?"http":"https",e){let u=new URL(e);u.port="",r?(u.port=r,this.url=u.toString()):this.url=u.toString()}else this.url=`${this.protocol}://${this.host}${this.port}/`;t&&(this.url=`${this.url}${t}`),this.site_name=t,this.socket=Bt(`${this.url}`,{withCredentials:!0,secure:this.protocol==="https",extraHeaders:s&&s.useToken===!0?{Authorization:`${s.type} ${s.token}`}:{}})}}var ws={exports:{}},at={};/**
|
|
19
19
|
* @license React
|
|
20
20
|
* react-jsx-runtime.production.min.js
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the MIT license found in the
|
|
25
25
|
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var
|
|
26
|
+
*/var Es;function oa(){if(Es)return at;Es=1;var n=De.default,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(u,l,a){var h,f={},v=null,y=null;a!==void 0&&(v=""+a),l.key!==void 0&&(v=""+l.key),l.ref!==void 0&&(y=l.ref);for(h in l)r.call(l,h)&&!i.hasOwnProperty(h)&&(f[h]=l[h]);if(u&&u.defaultProps)for(h in l=u.defaultProps,l)f[h]===void 0&&(f[h]=l[h]);return{$$typeof:e,type:u,key:v,ref:y,props:f,_owner:s.current}}return at.Fragment=t,at.jsx=o,at.jsxs=o,at}var ut={};/**
|
|
27
27
|
* @license React
|
|
28
28
|
* react-jsx-runtime.development.js
|
|
29
29
|
*
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the MIT license found in the
|
|
33
33
|
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var
|
|
35
|
-
`+
|
|
34
|
+
*/var Ss;function aa(){return Ss||(Ss=1,process.env.NODE_ENV!=="production"&&function(){var n=De.default,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),a=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),w=Symbol.iterator,E="@@iterator";function x(c){if(c===null||typeof c!="object")return null;var p=w&&c[w]||c[E];return typeof p=="function"?p:null}var b=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function T(c){{for(var p=arguments.length,m=new Array(p>1?p-1:0),_=1;_<p;_++)m[_-1]=arguments[_];F("error",c,m)}}function F(c,p,m){{var _=b.ReactDebugCurrentFrame,D=_.getStackAddendum();D!==""&&(p+="%s",m=m.concat([D]));var V=m.map(function(A){return String(A)});V.unshift("Warning: "+p),Function.prototype.apply.call(console[c],console,V)}}var g=!1,W=!1,C=!1,M=!1,L=!1,q;q=Symbol.for("react.module.reference");function P(c){return!!(typeof c=="string"||typeof c=="function"||c===r||c===i||L||c===s||c===a||c===h||M||c===y||g||W||C||typeof c=="object"&&c!==null&&(c.$$typeof===v||c.$$typeof===f||c.$$typeof===o||c.$$typeof===u||c.$$typeof===l||c.$$typeof===q||c.getModuleId!==void 0))}function ee(c,p,m){var _=c.displayName;if(_)return _;var D=p.displayName||p.name||"";return D!==""?m+"("+D+")":m}function te(c){return c.displayName||"Context"}function X(c){if(c==null)return null;if(typeof c.tag=="number"&&T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case r:return"Fragment";case t:return"Portal";case i:return"Profiler";case s:return"StrictMode";case a:return"Suspense";case h:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case u:var p=c;return te(p)+".Consumer";case o:var m=c;return te(m._context)+".Provider";case l:return ee(c,c.render,"ForwardRef");case f:var _=c.displayName||null;return _!==null?_:X(c.type)||"Memo";case v:{var D=c,V=D._payload,A=D._init;try{return X(A(V))}catch{return null}}}return null}var U=Object.assign,Fe=0,ct,lt,we,ft,It,Ee,Se;function Pe(){}Pe.__reactDisabledLog=!0;function Vt(){{if(Fe===0){ct=console.log,lt=console.info,we=console.warn,ft=console.error,It=console.group,Ee=console.groupCollapsed,Se=console.groupEnd;var c={configurable:!0,enumerable:!0,value:Pe,writable:!0};Object.defineProperties(console,{info:c,log:c,warn:c,error:c,group:c,groupCollapsed:c,groupEnd:c})}Fe++}}function We(){{if(Fe--,Fe===0){var c={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},c,{value:ct}),info:U({},c,{value:lt}),warn:U({},c,{value:we}),error:U({},c,{value:ft}),group:U({},c,{value:It}),groupCollapsed:U({},c,{value:Ee}),groupEnd:U({},c,{value:Se})})}Fe<0&&T("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var He=b.ReactCurrentDispatcher,Je;function Ye(c,p,m){{if(Je===void 0)try{throw Error()}catch(D){var _=D.stack.trim().match(/\n( *(at )?)/);Je=_&&_[1]||""}return`
|
|
35
|
+
`+Je+c}}var ht=!1,ge;{var jt=typeof WeakMap=="function"?WeakMap:Map;ge=new jt}function B(c,p){if(!c||ht)return"";{var m=ge.get(c);if(m!==void 0)return m}var _;ht=!0;var D=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var V;V=He.current,He.current=null,Vt();try{if(p){var A=function(){throw Error()};if(Object.defineProperty(A.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(A,[])}catch(Te){_=Te}Reflect.construct(c,[],A)}else{try{A.call()}catch(Te){_=Te}c.call(A.prototype)}}else{try{throw Error()}catch(Te){_=Te}c()}}catch(Te){if(Te&&_&&typeof Te.stack=="string"){for(var S=Te.stack.split(`
|
|
36
36
|
`),re=_.stack.split(`
|
|
37
37
|
`),H=S.length-1,G=re.length-1;H>=1&&G>=0&&S[H]!==re[G];)G--;for(;H>=1&&G>=0;H--,G--)if(S[H]!==re[G]){if(H!==1||G!==1)do if(H--,G--,G<0||S[H]!==re[G]){var fe=`
|
|
38
|
-
`+S[H].replace(" at new "," at ");return c.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",c.displayName)),typeof c=="function"&&ge.set(c,fe),fe}while(H>=1&&G>=0);break}}}finally{ht=!1,
|
|
38
|
+
`+S[H].replace(" at new "," at ");return c.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",c.displayName)),typeof c=="function"&&ge.set(c,fe),fe}while(H>=1&&G>=0);break}}}finally{ht=!1,He.current=V,We(),Error.prepareStackTrace=D}var Xe=c?c.displayName||c.name:"",Ps=Xe?Ye(Xe):"";return typeof c=="function"&&ge.set(c,Ps),Ps}function I(c,p,m){return B(c,!1)}function Q(c){var p=c.prototype;return!!(p&&p.isReactComponent)}function j(c,p,m){if(c==null)return"";if(typeof c=="function")return B(c,Q(c));if(typeof c=="string")return Ye(c);switch(c){case a:return Ye("Suspense");case h:return Ye("SuspenseList")}if(typeof c=="object")switch(c.$$typeof){case l:return I(c.render);case f:return j(c.type,p,m);case v:{var _=c,D=_._payload,V=_._init;try{return j(V(D),p,m)}catch{}}}return""}var ne=Object.prototype.hasOwnProperty,Re={},z=b.ReactDebugCurrentFrame;function K(c){if(c){var p=c._owner,m=j(c.type,c._source,p?p.type:null);z.setExtraStackFrame(m)}else z.setExtraStackFrame(null)}function de(c,p,m,_,D){{var V=Function.call.bind(ne);for(var A in c)if(V(c,A)){var S=void 0;try{if(typeof c[A]!="function"){var re=Error((_||"React class")+": "+m+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw re.name="Invariant Violation",re}S=c[A](p,A,_,m,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(H){S=H}S&&!(S instanceof Error)&&(K(D),T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",_||"React class",m,A,typeof S),K(null)),S instanceof Error&&!(S.message in Re)&&(Re[S.message]=!0,K(D),T("Failed %s type: %s",m,S.message),K(null))}}}var Mt=Array.isArray;function ze(c){return Mt(c)}function qt(c){{var p=typeof Symbol=="function"&&Symbol.toStringTag,m=p&&c[Symbol.toStringTag]||c.constructor.name||"Object";return m}}function oe(c){try{return le(c),!1}catch{return!0}}function le(c){return""+c}function Ke(c){if(oe(c))return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qt(c)),le(c)}var Be=b.ReactCurrentOwner,dt={key:!0,ref:!0,__self:!0,__source:!0},Os,xs,Hn;Hn={};function Ta(c){if(ne.call(c,"ref")){var p=Object.getOwnPropertyDescriptor(c,"ref").get;if(p&&p.isReactWarning)return!1}return c.ref!==void 0}function Ca(c){if(ne.call(c,"key")){var p=Object.getOwnPropertyDescriptor(c,"key").get;if(p&&p.isReactWarning)return!1}return c.key!==void 0}function Oa(c,p){if(typeof c.ref=="string"&&Be.current&&p&&Be.current.stateNode!==p){var m=X(Be.current.type);Hn[m]||(T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',X(Be.current.type),c.ref),Hn[m]=!0)}}function xa(c,p){{var m=function(){Os||(Os=!0,T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",p))};m.isReactWarning=!0,Object.defineProperty(c,"key",{get:m,configurable:!0})}}function Aa(c,p){{var m=function(){xs||(xs=!0,T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",p))};m.isReactWarning=!0,Object.defineProperty(c,"ref",{get:m,configurable:!0})}}var ka=function(c,p,m,_,D,V,A){var S={$$typeof:e,type:c,key:p,ref:m,props:A,_owner:V};return S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(S,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty(S,"_source",{configurable:!1,enumerable:!1,writable:!1,value:D}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S};function Da(c,p,m,_,D){{var V,A={},S=null,re=null;m!==void 0&&(Ke(m),S=""+m),Ca(p)&&(Ke(p.key),S=""+p.key),Ta(p)&&(re=p.ref,Oa(p,D));for(V in p)ne.call(p,V)&&!dt.hasOwnProperty(V)&&(A[V]=p[V]);if(c&&c.defaultProps){var H=c.defaultProps;for(V in H)A[V]===void 0&&(A[V]=H[V])}if(S||re){var G=typeof c=="function"?c.displayName||c.name||"Unknown":c;S&&xa(A,G),re&&Aa(A,G)}return ka(c,S,re,D,_,Be.current,A)}}var Jn=b.ReactCurrentOwner,As=b.ReactDebugCurrentFrame;function Ge(c){if(c){var p=c._owner,m=j(c.type,c._source,p?p.type:null);As.setExtraStackFrame(m)}else As.setExtraStackFrame(null)}var Yn;Yn=!1;function zn(c){return typeof c=="object"&&c!==null&&c.$$typeof===e}function ks(){{if(Jn.current){var c=X(Jn.current.type);if(c)return`
|
|
39
39
|
|
|
40
40
|
Check the render method of \``+c+"`."}return""}}function La(c){{if(c!==void 0){var p=c.fileName.replace(/^.*[\\\/]/,""),m=c.lineNumber;return`
|
|
41
41
|
|
|
42
|
-
Check your code at `+p+":"+m+"."}return""}}var
|
|
42
|
+
Check your code at `+p+":"+m+"."}return""}}var Ds={};function Na(c){{var p=ks();if(!p){var m=typeof c=="string"?c:c.displayName||c.name;m&&(p=`
|
|
43
43
|
|
|
44
|
-
Check the top-level render call using <`+m+">.")}return p}}function Ds(c,p){{if(!c._store||c._store.validated||c.key!=null)return;c._store.validated=!0;var m=Na(p);if(ks[m])return;ks[m]=!0;var _="";c&&c._owner&&c._owner!==Jn.current&&(_=" It was passed a child from "+X(c._owner.type)+"."),Ke(c),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,_),Ke(null)}}function Ls(c,p){{if(typeof c!="object")return;if(Ye(c))for(var m=0;m<c.length;m++){var _=c[m];zn(_)&&Ds(_,p)}else if(zn(c))c._store&&(c._store.validated=!0);else if(c){var D=O(c);if(typeof D=="function"&&D!==c.entries)for(var V=D.call(c),x;!(x=V.next()).done;)zn(x.value)&&Ds(x.value,p)}}}function Fa(c){{var p=c.type;if(p==null||typeof p=="string")return;var m;if(typeof p=="function")m=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===l||p.$$typeof===f))m=p.propTypes;else return;if(m){var _=X(p);de(m,c.props,"prop",_,c)}else if(p.PropTypes!==void 0&&!Yn){Yn=!0;var D=X(p);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",D||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pa(c){{for(var p=Object.keys(c.props),m=0;m<p.length;m++){var _=p[m];if(_!=="children"&&_!=="key"){Ke(c),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),Ke(null);break}}c.ref!==null&&(Ke(c),T("Invalid attribute `ref` supplied to `React.Fragment`."),Ke(null))}}function Ns(c,p,m,_,D,V){{var x=P(c);if(!x){var S="";(c===void 0||typeof c=="object"&&c!==null&&Object.keys(c).length===0)&&(S+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var re=La(D);re?S+=re:S+=As();var H;c===null?H="null":Ye(c)?H="array":c!==void 0&&c.$$typeof===e?(H="<"+(X(c.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):H=typeof c,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",H,S)}var G=Da(c,p,m,D,V);if(G==null)return G;if(x){var fe=p.children;if(fe!==void 0)if(_)if(Ye(fe)){for(var Ge=0;Ge<fe.length;Ge++)Ls(fe[Ge],c);Object.freeze&&Object.freeze(fe)}else T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ls(fe,c)}return c===r?Pa(G):Fa(G),G}}function Ba(c,p,m){return Ns(c,p,m,!0)}function Ua(c,p,m){return Ns(c,p,m,!1)}var Ia=Ua,Va=Ba;ut.Fragment=r,ut.jsx=Ia,ut.jsxs=Va}()),ut}(function(n){process.env.NODE_ENV==="production"?n.exports=oa():n.exports=aa()})(_s);const ua=_s.exports.jsx,$=d.createContext(null),ca=({url:n="",tokenParams:e,socketPort:t,siteName:r,enableSocket:s=!0,children:i})=>{const o=d.useMemo(()=>{const u=new Vi.FrappeApp(n,e);return{url:n,tokenParams:e,app:u,auth:u.auth(),db:u.db(),call:u.call(),file:u.file(),socket:s?new ia(n,r,t,e).socket:void 0,enableSocket:s,socketPort:t}},[n,e,t,s]);return ua($.Provider,{value:o,children:i})},la=n=>{const{url:e,auth:t,tokenParams:r}=d.useContext($),[s,i]=d.useState(),o=d.useCallback(()=>{const w=document.cookie.split(";").find(E=>E.trim().startsWith("user_id="));if(w){const E=w.split("=")[1];i(E&&E!=="Guest"?E:null)}else i(null)},[]);d.useEffect(()=>{r&&r.useToken?i(null):o()},[]);const{data:u,error:l,isLoading:a,isValidating:h,mutate:f}=st(()=>r&&r.useToken||s?`${e}/api/method/frappe.auth.get_logged_user`:null,()=>t.getLoggedInUser(),{onError:()=>{i(null)},shouldRetryOnError:!1,revalidateOnFocus:!1,...n}),v=d.useCallback(async(w,E)=>t.loginWithUsernamePassword({username:w,password:E}).then(O=>{o()}),[]),y=d.useCallback(async()=>t.logout().then(()=>f(null)).then(()=>i(null)),[]);return{isLoading:s===void 0||a,currentUser:u,isValidating:h,error:l,login:v,logout:y,updateCurrentUser:f,getUserCookie:o}},Wn=(n,e,t)=>{let r=`${e}/api/resource/`;return t?r+=`${n}/${t}`:r+=`${n}`,r},fa=(n,e,t,r)=>{const{url:s,db:i}=d.useContext($);return{...st(t===void 0?Wn(n,s,e):t,()=>i.getDoc(n,e),r)}},Ss=n=>{var t,r,s;let e="";if(n!=null&&n.fields&&(e+="fields="+JSON.stringify(n==null?void 0:n.fields)+"&"),n!=null&&n.filters&&(e+="filters="+JSON.stringify(n==null?void 0:n.filters)+"&"),n!=null&&n.orFilters&&(e+="or_filters="+JSON.stringify(n==null?void 0:n.orFilters)+"&"),n!=null&&n.limit_start&&(e+="limit_start="+JSON.stringify(n==null?void 0:n.limit_start)+"&"),n!=null&&n.limit&&(e+="limit="+JSON.stringify(n==null?void 0:n.limit)+"&"),n!=null&&n.groupBy&&(e+="group_by="+String(n.groupBy)+"&"),n!=null&&n.orderBy){const i=`${String((t=n.orderBy)==null?void 0:t.field)} ${(s=(r=n.orderBy)==null?void 0:r.order)!=null?s:"asc"}`;e+="order_by="+i+"&"}return n!=null&&n.asDict&&(e+="as_dict="+n.asDict),e},ha=(n,e,t,r)=>{const{url:s,db:i}=d.useContext($);return{...st(t===void 0?`${Wn(n,s)}?${Ss(e)}`:t,()=>i.getDocList(n,e),r)}},da=()=>{const{db:n}=d.useContext($),[e,t]=d.useState(!1),[r,s]=d.useState(null),[i,o]=d.useState(!1),u=d.useCallback(()=>{t(!1),s(null),o(!1)},[]);return{createDoc:d.useCallback(async(a,h)=>(s(null),o(!1),t(!0),n.createDoc(a,h).then(f=>(t(!1),o(!0),f)).catch(f=>{throw t(!1),o(!1),s(f),f})),[]),loading:e,error:r,isCompleted:i,reset:u}},pa=()=>{const{db:n}=d.useContext($),[e,t]=d.useState(!1),[r,s]=d.useState(null),[i,o]=d.useState(!1),u=d.useCallback(()=>{t(!1),s(null),o(!1)},[]);return{updateDoc:d.useCallback(async(a,h,f)=>(s(null),o(!1),t(!0),n.updateDoc(a,h,f).then(v=>(t(!1),o(!0),v)).catch(v=>{throw t(!1),o(!1),s(v),v})),[]),loading:e,error:r,reset:u,isCompleted:i}},va=()=>{const{db:n}=d.useContext($),[e,t]=d.useState(!1),[r,s]=d.useState(null),[i,o]=d.useState(!1),u=d.useCallback(()=>{t(!1),s(null),o(!1)},[]);return{deleteDoc:d.useCallback(async(a,h)=>(s(null),o(!1),t(!0),n.deleteDoc(a,h).then(f=>(t(!1),o(!0),f)).catch(f=>{throw t(!1),o(!1),s(f),f})),[]),loading:e,error:r,reset:u,isCompleted:i}};function Rs(n){const e=[];for(let t in n)e.push(encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e.join("&")}const ya=(n,e,t=!1,r=!1,s,i)=>{const{url:o,db:u}=d.useContext($);return{...st(s===void 0?(()=>{const h=Rs(t?{doctype:n,filters:e!=null?e:[],cache:t,debug:r}:{doctype:n,filters:e!=null?e:[],debug:r});return`${o}/api/method/frappe.client.get_count?${h}`})():s,()=>u.getCount(n,e,t,r),i)}},Ts=(n,e,t,r)=>{const{call:s}=d.useContext($),i=Rs(e!=null?e:{}),o=`${n}?${i}`;return{...st(t===void 0?o:t,()=>s.get(n,e),r)}},ma=n=>{const{call:e}=d.useContext($),[t,r]=d.useState(null),[s,i]=d.useState(!1),[o,u]=d.useState(null),[l,a]=d.useState(!1),h=d.useCallback(()=>{r(null),i(!1),u(null),a(!1)},[]);return{call:d.useCallback(async v=>(u(null),a(!1),i(!0),r(null),e.post(n,v).then(y=>(r(y),i(!1),a(!0),y)).catch(y=>{throw i(!1),a(!1),u(y),y})),[]),result:t,loading:s,error:o,reset:h,isCompleted:l}},ga=n=>{const{call:e}=d.useContext($),[t,r]=d.useState(null),[s,i]=d.useState(!1),[o,u]=d.useState(null),[l,a]=d.useState(!1),h=d.useCallback(()=>{r(null),i(!1),u(null),a(!1)},[]);return{call:d.useCallback(async v=>(u(null),a(!1),i(!0),r(null),e.put(n,v).then(y=>(r(y),i(!1),a(!0),y)).catch(y=>{throw i(!1),a(!1),u(y),y})),[]),result:t,loading:s,error:o,reset:h,isCompleted:l}},ba=n=>{const{call:e}=d.useContext($),[t,r]=d.useState(null),[s,i]=d.useState(!1),[o,u]=d.useState(null),[l,a]=d.useState(!1),h=d.useCallback(()=>{r(null),i(!1),u(null),a(!1)},[]);return{call:d.useCallback(async v=>(u(null),a(!1),i(!0),r(null),e.delete(n,v).then(y=>(r(y),i(!1),a(!0),y)).catch(y=>{throw i(!1),a(!1),u(y),y})),[]),result:t,loading:s,error:o,reset:h,isCompleted:l}},_a=()=>{const{file:n}=d.useContext($),[e,t]=d.useState(0),[r,s]=d.useState(!1),[i,o]=d.useState(null),[u,l]=d.useState(!1),a=d.useCallback(async(f,v)=>(h(),s(!0),n.uploadFile(f,v,(y,w)=>t(Math.round(y/w*100))).then(y=>(l(!0),t(100),s(!1),y.data.message)).catch(y=>{throw console.error(y),o(y),s(!1),y})),[]),h=d.useCallback(()=>{t(0),s(!1),o(null),l(!1)},[]);return{upload:a,progress:e,loading:r,isCompleted:u,error:i,reset:h}},wa=(n,e,t=[],r=20,s=250)=>{const i=Ea(e,s);return Ts("frappe.desk.search.search_link",{doctype:n,page_length:r,txt:i,filters:JSON.stringify(t!=null?t:[])})},Ea=(n,e)=>{const[t,r]=d.useState(n);return d.useEffect(()=>{const s=setTimeout(()=>{r(n)},e);return()=>{clearTimeout(s)}},[n,e]),t},Ut=(n,e)=>{const{socket:t}=d.useContext($);d.useEffect(()=>{t===void 0&&console.warn("Socket is not enabled. Please enable socket in FrappeProvider.");let r=t==null?void 0:t.on(n,e);return()=>{r==null||r.off(n)}},[n,e])},Sa=(n,e,t,r=!0)=>{const{socket:s}=d.useContext($),[i,o]=d.useState([]);d.useEffect(()=>(s===void 0&&console.warn("Socket is not enabled. Please enable socket in FrappeProvider."),s==null||s.emit("doc_subscribe",n,e),r&&(s==null||s.emit("doc_open",n,e)),()=>{s==null||s.emit("doc_unsubscribe",n,e),r&&(s==null||s.emit("doc_close",n,e))}),[n,e,r]),Ut("doc_update",t);const u=d.useCallback(()=>{s==null||s.emit("doc_open",n,e)},[n,e]),l=d.useCallback(()=>{s==null||s.emit("doc_close",n,e)},[n,e]),a=d.useCallback(h=>{h.doctype===n&&h.docname===e&&o(h.users)},[n,e]);return Ut("doc_viewers",a),{viewers:i,emitDocOpen:u,emitDocClose:l}},Ra=(n,e)=>{const{socket:t}=d.useContext($);d.useEffect(()=>(t===void 0&&console.warn("Socket is not enabled. Please enable socket in FrappeProvider."),t==null||t.emit("doctype_subscribe",n),()=>{t==null||t.emit("doctype_unsubscribe",n)}),[n]),Ut("list_update",e)};A.FrappeContext=$,A.FrappeProvider=ca,A.getDocListQueryString=Ss,A.getRequestURL=Wn,A.useFrappeAuth=la,A.useFrappeCreateDoc=da,A.useFrappeDeleteCall=ba,A.useFrappeDeleteDoc=va,A.useFrappeDocTypeEventListener=Ra,A.useFrappeDocumentEventListener=Sa,A.useFrappeEventListener=Ut,A.useFrappeFileUpload=_a,A.useFrappeGetCall=Ts,A.useFrappeGetDoc=fa,A.useFrappeGetDocCount=ya,A.useFrappeGetDocList=ha,A.useFrappePostCall=ma,A.useFrappePutCall=ga,A.useFrappeUpdateDoc=pa,A.useSearch=wa,Object.defineProperties(A,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
44
|
+
Check the top-level render call using <`+m+">.")}return p}}function Ls(c,p){{if(!c._store||c._store.validated||c.key!=null)return;c._store.validated=!0;var m=Na(p);if(Ds[m])return;Ds[m]=!0;var _="";c&&c._owner&&c._owner!==Jn.current&&(_=" It was passed a child from "+X(c._owner.type)+"."),Ge(c),T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,_),Ge(null)}}function Ns(c,p){{if(typeof c!="object")return;if(ze(c))for(var m=0;m<c.length;m++){var _=c[m];zn(_)&&Ls(_,p)}else if(zn(c))c._store&&(c._store.validated=!0);else if(c){var D=x(c);if(typeof D=="function"&&D!==c.entries)for(var V=D.call(c),A;!(A=V.next()).done;)zn(A.value)&&Ls(A.value,p)}}}function Fa(c){{var p=c.type;if(p==null||typeof p=="string")return;var m;if(typeof p=="function")m=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===l||p.$$typeof===f))m=p.propTypes;else return;if(m){var _=X(p);de(m,c.props,"prop",_,c)}else if(p.PropTypes!==void 0&&!Yn){Yn=!0;var D=X(p);T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",D||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pa(c){{for(var p=Object.keys(c.props),m=0;m<p.length;m++){var _=p[m];if(_!=="children"&&_!=="key"){Ge(c),T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),Ge(null);break}}c.ref!==null&&(Ge(c),T("Invalid attribute `ref` supplied to `React.Fragment`."),Ge(null))}}function Fs(c,p,m,_,D,V){{var A=P(c);if(!A){var S="";(c===void 0||typeof c=="object"&&c!==null&&Object.keys(c).length===0)&&(S+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var re=La(D);re?S+=re:S+=ks();var H;c===null?H="null":ze(c)?H="array":c!==void 0&&c.$$typeof===e?(H="<"+(X(c.type)||"Unknown")+" />",S=" Did you accidentally export a JSX literal instead of a component?"):H=typeof c,T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",H,S)}var G=Da(c,p,m,D,V);if(G==null)return G;if(A){var fe=p.children;if(fe!==void 0)if(_)if(ze(fe)){for(var Xe=0;Xe<fe.length;Xe++)Ns(fe[Xe],c);Object.freeze&&Object.freeze(fe)}else T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ns(fe,c)}return c===r?Pa(G):Fa(G),G}}function Ba(c,p,m){return Fs(c,p,m,!0)}function Ua(c,p,m){return Fs(c,p,m,!1)}var Ia=Ua,Va=Ba;ut.Fragment=r,ut.jsx=Ia,ut.jsxs=Va}()),ut}(function(n){process.env.NODE_ENV==="production"?n.exports=oa():n.exports=aa()})(ws);const ua=ws.exports.jsx,$=d.createContext(null),ca=({url:n="",tokenParams:e,socketPort:t,siteName:r,enableSocket:s=!0,children:i})=>{const o=d.useMemo(()=>{const u=new ji.FrappeApp(n,e);return{url:n,tokenParams:e,app:u,auth:u.auth(),db:u.db(),call:u.call(),file:u.file(),socket:s?new ia(n,r,t,e).socket:void 0,enableSocket:s,socketPort:t}},[n,e,t,s]);return ua($.Provider,{value:o,children:i})},la=n=>{const{url:e,auth:t,tokenParams:r}=d.useContext($),[s,i]=d.useState(),o=d.useCallback(()=>{const w=document.cookie.split(";").find(E=>E.trim().startsWith("user_id="));if(w){const E=w.split("=")[1];i(E&&E!=="Guest"?E:null)}else i(null)},[]);d.useEffect(()=>{r&&r.useToken?i(null):o()},[]);const{data:u,error:l,isLoading:a,isValidating:h,mutate:f}=Me(()=>r&&r.useToken||s?`${e}/api/method/frappe.auth.get_logged_user`:null,()=>t.getLoggedInUser(),{onError:()=>{i(null)},shouldRetryOnError:!1,revalidateOnFocus:!1,...n}),v=d.useCallback(async(w,E)=>t.loginWithUsernamePassword({username:w,password:E}).then(x=>{o()}),[]),y=d.useCallback(async()=>t.logout().then(()=>f(null)).then(()=>i(null)),[]);return{isLoading:s===void 0||a,currentUser:u,isValidating:h,error:l,login:v,logout:y,updateCurrentUser:f,getUserCookie:o}},Wn=(n,e,t)=>{let r=`${e}/api/resource/`;return t?r+=`${n}/${t}`:r+=`${n}`,r},fa=(n,e,t,r)=>{const{url:s,db:i}=d.useContext($);return{...Me(t===void 0?Wn(n,s,e):t,()=>i.getDoc(n,e),r)}},Rs=n=>{var t,r,s;let e="";if(n!=null&&n.fields&&(e+="fields="+JSON.stringify(n==null?void 0:n.fields)+"&"),n!=null&&n.filters&&(e+="filters="+JSON.stringify(n==null?void 0:n.filters)+"&"),n!=null&&n.orFilters&&(e+="or_filters="+JSON.stringify(n==null?void 0:n.orFilters)+"&"),n!=null&&n.limit_start&&(e+="limit_start="+JSON.stringify(n==null?void 0:n.limit_start)+"&"),n!=null&&n.limit&&(e+="limit="+JSON.stringify(n==null?void 0:n.limit)+"&"),n!=null&&n.groupBy&&(e+="group_by="+String(n.groupBy)+"&"),n!=null&&n.orderBy){const i=`${String((t=n.orderBy)==null?void 0:t.field)} ${(s=(r=n.orderBy)==null?void 0:r.order)!=null?s:"asc"}`;e+="order_by="+i+"&"}return n!=null&&n.asDict&&(e+="as_dict="+n.asDict),e},ha=(n,e,t,r)=>{const{url:s,db:i}=d.useContext($);return{...Me(t===void 0?`${Wn(n,s)}?${Rs(e)}`:t,()=>i.getDocList(n,e),r)}},da=()=>{const{db:n}=d.useContext($),[e,t]=d.useState(!1),[r,s]=d.useState(null),[i,o]=d.useState(!1),u=d.useCallback(()=>{t(!1),s(null),o(!1)},[]);return{createDoc:d.useCallback(async(a,h)=>(s(null),o(!1),t(!0),n.createDoc(a,h).then(f=>(t(!1),o(!0),f)).catch(f=>{throw t(!1),o(!1),s(f),f})),[]),loading:e,error:r,isCompleted:i,reset:u}},pa=()=>{const{db:n}=d.useContext($),[e,t]=d.useState(!1),[r,s]=d.useState(null),[i,o]=d.useState(!1),u=d.useCallback(()=>{t(!1),s(null),o(!1)},[]);return{updateDoc:d.useCallback(async(a,h,f)=>(s(null),o(!1),t(!0),n.updateDoc(a,h,f).then(v=>(t(!1),o(!0),v)).catch(v=>{throw t(!1),o(!1),s(v),v})),[]),loading:e,error:r,reset:u,isCompleted:i}},va=()=>{const{db:n}=d.useContext($),[e,t]=d.useState(!1),[r,s]=d.useState(null),[i,o]=d.useState(!1),u=d.useCallback(()=>{t(!1),s(null),o(!1)},[]);return{deleteDoc:d.useCallback(async(a,h)=>(s(null),o(!1),t(!0),n.deleteDoc(a,h).then(f=>(t(!1),o(!0),f)).catch(f=>{throw t(!1),o(!1),s(f),f})),[]),loading:e,error:r,reset:u,isCompleted:i}};function Ts(n){const e=[];for(let t in n)e.push(encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e.join("&")}const ya=(n,e,t=!1,r=!1,s,i)=>{const{url:o,db:u}=d.useContext($);return{...Me(s===void 0?(()=>{const h=Ts(t?{doctype:n,filters:e!=null?e:[],cache:t,debug:r}:{doctype:n,filters:e!=null?e:[],debug:r});return`${o}/api/method/frappe.client.get_count?${h}`})():s,()=>u.getCount(n,e,t,r),i)}},Cs=(n,e,t,r)=>{const{call:s}=d.useContext($),i=Ts(e!=null?e:{}),o=`${n}?${i}`;return{...Me(t===void 0?o:t,()=>s.get(n,e),r)}},ma=n=>{const{call:e}=d.useContext($),[t,r]=d.useState(null),[s,i]=d.useState(!1),[o,u]=d.useState(null),[l,a]=d.useState(!1),h=d.useCallback(()=>{r(null),i(!1),u(null),a(!1)},[]);return{call:d.useCallback(async v=>(u(null),a(!1),i(!0),r(null),e.post(n,v).then(y=>(r(y),i(!1),a(!0),y)).catch(y=>{throw i(!1),a(!1),u(y),y})),[]),result:t,loading:s,error:o,reset:h,isCompleted:l}},ga=n=>{const{call:e}=d.useContext($),[t,r]=d.useState(null),[s,i]=d.useState(!1),[o,u]=d.useState(null),[l,a]=d.useState(!1),h=d.useCallback(()=>{r(null),i(!1),u(null),a(!1)},[]);return{call:d.useCallback(async v=>(u(null),a(!1),i(!0),r(null),e.put(n,v).then(y=>(r(y),i(!1),a(!0),y)).catch(y=>{throw i(!1),a(!1),u(y),y})),[]),result:t,loading:s,error:o,reset:h,isCompleted:l}},ba=n=>{const{call:e}=d.useContext($),[t,r]=d.useState(null),[s,i]=d.useState(!1),[o,u]=d.useState(null),[l,a]=d.useState(!1),h=d.useCallback(()=>{r(null),i(!1),u(null),a(!1)},[]);return{call:d.useCallback(async v=>(u(null),a(!1),i(!0),r(null),e.delete(n,v).then(y=>(r(y),i(!1),a(!0),y)).catch(y=>{throw i(!1),a(!1),u(y),y})),[]),result:t,loading:s,error:o,reset:h,isCompleted:l}},_a=()=>{const{file:n}=d.useContext($),[e,t]=d.useState(0),[r,s]=d.useState(!1),[i,o]=d.useState(null),[u,l]=d.useState(!1),a=d.useCallback(async(f,v)=>(h(),s(!0),n.uploadFile(f,v,(y,w)=>t(Math.round(y/w*100))).then(y=>(l(!0),t(100),s(!1),y.data.message)).catch(y=>{throw console.error(y),o(y),s(!1),y})),[]),h=d.useCallback(()=>{t(0),s(!1),o(null),l(!1)},[]);return{upload:a,progress:e,loading:r,isCompleted:u,error:i,reset:h}},wa=(n,e,t=[],r=20,s=250)=>{const i=Ea(e,s);return Cs("frappe.desk.search.search_link",{doctype:n,page_length:r,txt:i,filters:JSON.stringify(t!=null?t:[])})},Ea=(n,e)=>{const[t,r]=d.useState(n);return d.useEffect(()=>{const s=setTimeout(()=>{r(n)},e);return()=>{clearTimeout(s)}},[n,e]),t},Ut=(n,e)=>{const{socket:t}=d.useContext($);d.useEffect(()=>{t===void 0&&console.warn("Socket is not enabled. Please enable socket in FrappeProvider.");let r=t==null?void 0:t.on(n,e);return()=>{r==null||r.off(n)}},[n,e])},Sa=(n,e,t,r=!0)=>{const{socket:s}=d.useContext($),[i,o]=d.useState([]);d.useEffect(()=>(s===void 0&&console.warn("Socket is not enabled. Please enable socket in FrappeProvider."),s==null||s.emit("doc_subscribe",n,e),r&&(s==null||s.emit("doc_open",n,e)),()=>{s==null||s.emit("doc_unsubscribe",n,e),r&&(s==null||s.emit("doc_close",n,e))}),[n,e,r]),Ut("doc_update",t);const u=d.useCallback(()=>{s==null||s.emit("doc_open",n,e)},[n,e]),l=d.useCallback(()=>{s==null||s.emit("doc_close",n,e)},[n,e]),a=d.useCallback(h=>{h.doctype===n&&h.docname===e&&o(h.users)},[n,e]);return Ut("doc_viewers",a),{viewers:i,emitDocOpen:u,emitDocClose:l}},Ra=(n,e)=>{const{socket:t}=d.useContext($);d.useEffect(()=>(t===void 0&&console.warn("Socket is not enabled. Please enable socket in FrappeProvider."),t==null||t.emit("doctype_subscribe",n),()=>{t==null||t.emit("doctype_unsubscribe",n)}),[n]),Ut("list_update",e)};O.FrappeContext=$,O.FrappeProvider=ca,O.getDocListQueryString=Rs,O.getRequestURL=Wn,O.useFrappeAuth=la,O.useFrappeCreateDoc=da,O.useFrappeDeleteCall=ba,O.useFrappeDeleteDoc=va,O.useFrappeDocTypeEventListener=Ra,O.useFrappeDocumentEventListener=Sa,O.useFrappeEventListener=Ut,O.useFrappeFileUpload=_a,O.useFrappeGetCall=Cs,O.useFrappeGetDoc=fa,O.useFrappeGetDocCount=ya,O.useFrappeGetDocList=ha,O.useFrappePostCall=ma,O.useFrappePutCall=ga,O.useFrappeUpdateDoc=pa,O.useSWR=Me,O.useSWRConfig=Xr,O.useSearch=wa,Object.defineProperties(O,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ import { FrappeDB } from "frappe-js-sdk/lib/db";
|
|
|
4
4
|
import { FrappeFileUpload } from "frappe-js-sdk/lib/file";
|
|
5
5
|
import { Error } from 'frappe-js-sdk/lib/frappe_app/types';
|
|
6
6
|
import { Filter, FrappeDoc, GetDocListArgs } from 'frappe-js-sdk/lib/db/types';
|
|
7
|
-
import { Key, SWRConfiguration, SWRResponse } from 'swr';
|
|
7
|
+
import useSWR, { Key, SWRConfiguration, SWRResponse, useSWRConfig } from 'swr';
|
|
8
8
|
import { FileArgs } from 'frappe-js-sdk/lib/file/types';
|
|
9
9
|
import { Socket } from "socket.io-client";
|
|
10
10
|
export type { SWRConfiguration, SWRResponse, Key };
|
|
11
|
+
export { useSWR, useSWRConfig };
|
|
11
12
|
export type { FrappeDoc, GetDocListArgs, Filter, FileArgs, Error as FrappeError };
|
|
12
13
|
export interface FrappeConfig {
|
|
13
14
|
/** The URL of your Frappe server */
|