frappe-react-sdk 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2722,46 +2722,47 @@ const Oi = Rr.exports.jsx, re = Xn(null), Li = ({
2722
2722
  }, Pi = (e) => {
2723
2723
  const {
2724
2724
  url: a,
2725
- auth: t
2726
- } = ne(re), [i, n] = A(), r = M(() => {
2727
- const h = document.cookie.split(";").find((b) => b.trim().startsWith("user_id="));
2728
- if (h) {
2729
- const b = h.split("=")[1];
2730
- n(b && b !== "Guest" ? b : null);
2725
+ auth: t,
2726
+ tokenParams: i
2727
+ } = ne(re), [n, r] = A(), o = M(() => {
2728
+ const b = document.cookie.split(";").find((_) => _.trim().startsWith("user_id="));
2729
+ if (b) {
2730
+ const _ = b.split("=")[1];
2731
+ r(_ && _ !== "Guest" ? _ : null);
2731
2732
  } else
2732
- n(null);
2733
+ r(null);
2733
2734
  }, []);
2734
2735
  Xt(() => {
2735
- r();
2736
+ i && i.useToken ? r(null) : o();
2736
2737
  }, []);
2737
2738
  const {
2738
- data: o,
2739
- error: c,
2740
- isLoading: d,
2741
- isValidating: u,
2742
- mutate: f
2743
- } = Qe(i ? `${a}/api/method/frappe.auth.get_logged_user` : null, () => t.getLoggedInUser(), {
2739
+ data: c,
2740
+ error: d,
2741
+ isLoading: u,
2742
+ isValidating: f,
2743
+ mutate: l
2744
+ } = Qe(() => i && i.useToken || n ? `${a}/api/method/frappe.auth.get_logged_user` : null, () => t.getLoggedInUser(), {
2744
2745
  onError: () => {
2745
- n(null);
2746
+ r(null);
2746
2747
  },
2747
2748
  shouldRetryOnError: !1,
2748
2749
  revalidateOnFocus: !1,
2749
2750
  ...e
2750
- }), l = M(async (h, b) => t.loginWithUsernamePassword({
2751
- username: h,
2752
- password: b
2753
- }).then((_) => {
2754
- r();
2755
- }), []), m = M(async () => t.logout().then(() => f(null)).then(() => n(null)), []);
2751
+ }), m = M(async (b, _) => t.loginWithUsernamePassword({
2752
+ username: b,
2753
+ password: _
2754
+ }).then((x) => {
2755
+ o();
2756
+ }), []), h = M(async () => t.logout().then(() => l(null)).then(() => r(null)), []);
2756
2757
  return {
2757
- isLoading: i === void 0 || d,
2758
- currentUser: o,
2759
- isValidating: u,
2760
- error: c,
2761
- login: l,
2762
- logout: m,
2763
- updateCurrentUser: f,
2764
- getUserCookie: r
2758
+ isLoading: n === void 0 || u,
2759
+ currentUser: c,
2760
+ isValidating: f,
2761
+ error: d,
2762
+ login: m,
2763
+ logout: h,
2764
+ updateCurrentUser: l,
2765
+ getUserCookie: o
2765
2766
  };
2766
2767
  }, Ui = (e, a, t, i) => {
2767
2768
  const {
@@ -1,5 +1,5 @@
1
- (function(j,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(j=typeof globalThis<"u"?globalThis:j||self,h(j["Frappe React"]={},j.React))})(this,function(j,h){"use strict";const Ce=(e=>e&&typeof e=="object"&&"default"in e?e:{default:e})(h);var L=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ft={},Pe={},ke={},Qe=L&&L.__assign||function(){return Qe=Object.assign||function(e){for(var a,t=1,o=arguments.length;t<o;t++){a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Qe.apply(this,arguments)},Ze=L&&L.__awaiter||function(e,a,t,o){function n(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function c(f){try{u(o.next(f))}catch(l){s(l)}}function d(f){try{u(o.throw(f))}catch(l){s(l)}}function u(f){f.done?r(f.value):n(f.value).then(c,d)}u((o=o.apply(e,a||[])).next())})},$e=L&&L.__generator||function(e,a){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return d([u,f])}}function d(u){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,n&&(r=u[0]&2?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){t.label=u[1];break}if(u[0]===6&&t.label<r[1]){t.label=r[1],r=u;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(u);break}r[2]&&t.ops.pop(),t.trys.pop();continue}u=a.call(e,t)}catch(f){u=[6,f],n=0}finally{o=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(ke,"__esModule",{value:!0}),ke.FrappeCall=void 0;var gr=function(){function e(a,t,o,n,r){this.appURL=a,this.axios=t,this.useToken=o!=null?o:!1,this.token=n,this.tokenType=r}return e.prototype.get=function(a,t){return Ze(this,void 0,void 0,function(){return $e(this,function(o){return[2,this.axios.get("/api/method/".concat(a),{params:t}).then(function(n){return n.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:(r=n.response.data.message)!==null&&r!==void 0?r:"There was an error.",exception:(s=n.response.data.exception)!==null&&s!==void 0?s:""}})]})})},e.prototype.post=function(a,t){return Ze(this,void 0,void 0,function(){return $e(this,function(o){return[2,this.axios.post("/api/method/".concat(a),Qe({},t)).then(function(n){return n.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:(r=n.response.data.message)!==null&&r!==void 0?r:"There was an error.",exception:(s=n.response.data.exception)!==null&&s!==void 0?s:""}})]})})},e.prototype.put=function(a,t){return Ze(this,void 0,void 0,function(){return $e(this,function(o){return[2,this.axios.put("/api/method/".concat(a),Qe({},t)).then(function(n){return n.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:(r=n.response.data.message)!==null&&r!==void 0?r:"There was an error.",exception:(s=n.response.data.exception)!==null&&s!==void 0?s:""}})]})})},e.prototype.delete=function(a,t){return Ze(this,void 0,void 0,function(){return $e(this,function(o){return[2,this.axios.delete("/api/method/".concat(a),{params:t}).then(function(n){return n.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:(r=n.response.data.message)!==null&&r!==void 0?r:"There was an error.",exception:(s=n.response.data.exception)!==null&&s!==void 0?s:""}})]})})},e}();ke.FrappeCall=gr;var Ue={},ve=L&&L.__assign||function(){return ve=Object.assign||function(e){for(var a,t=1,o=arguments.length;t<o;t++){a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},ve.apply(this,arguments)},we=L&&L.__awaiter||function(e,a,t,o){function n(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function c(f){try{u(o.next(f))}catch(l){s(l)}}function d(f){try{u(o.throw(f))}catch(l){s(l)}}function u(f){f.done?r(f.value):n(f.value).then(c,d)}u((o=o.apply(e,a||[])).next())})},Ee=L&&L.__generator||function(e,a){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return d([u,f])}}function d(u){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,n&&(r=u[0]&2?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){t.label=u[1];break}if(u[0]===6&&t.label<r[1]){t.label=r[1],r=u;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(u);break}r[2]&&t.ops.pop(),t.trys.pop();continue}u=a.call(e,t)}catch(f){u=[6,f],n=0}finally{o=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.FrappeDB=void 0;var Rr=function(){function e(a,t,o,n,r){this.appURL=a,this.axios=t,this.useToken=o!=null?o:!1,this.token=n,this.tokenType=r}return e.prototype.getDoc=function(a,t){return we(this,void 0,void 0,function(){return Ee(this,function(o){return[2,this.axios.get("/api/resource/".concat(a,"/").concat(t)).then(function(n){return n.data.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:"There was an error while fetching the document.",exception:(s=(r=n.response.data.exception)!==null&&r!==void 0?r:n.response.data.exc_type)!==null&&s!==void 0?s:""}})]})})},e.prototype.getDocList=function(a,t){var o;return we(this,void 0,void 0,function(){var n,r,s,c,d,u,f,l,y,v,w;return Ee(this,function(b){return n={},t&&(r=t.fields,s=t.filters,c=t.orFilters,d=t.orderBy,u=t.limit,f=t.limit_start,l=t.groupBy,y=t.asDict,v=y===void 0?!0:y,w=d?"".concat(d==null?void 0:d.field," ").concat((o=d==null?void 0:d.order)!==null&&o!==void 0?o:"asc"):"",n={fields:r?JSON.stringify(r):void 0,filters:s?JSON.stringify(s):void 0,or_filters:c?JSON.stringify(c):void 0,order_by:w,group_by:l,limit:u,limit_start:f,as_dict:v}),[2,this.axios.get("/api/resource/".concat(a),{params:n}).then(function(x){return x.data.data}).catch(function(x){var D,g;throw{httpStatus:x.response.status,httpStatusText:x.response.statusText,message:"There was an error while fetching the documents.",exception:(g=(D=x.response.data.exception)!==null&&D!==void 0?D:x.response.data.exc_type)!==null&&g!==void 0?g:""}})]})})},e.prototype.createDoc=function(a,t){return we(this,void 0,void 0,function(){return Ee(this,function(o){return[2,this.axios.post("/api/resource/".concat(a),ve({},t)).then(function(n){return n.data.data}).catch(function(n){var r,s,c;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:(r=n.response.data.message)!==null&&r!==void 0?r:"There was an error while creating the document.",exception:(c=(s=n.response.data.exception)!==null&&s!==void 0?s:n.response.data.exc_type)!==null&&c!==void 0?c:""}})]})})},e.prototype.updateDoc=function(a,t,o){return we(this,void 0,void 0,function(){return Ee(this,function(n){return[2,this.axios.put("/api/resource/".concat(a,"/").concat(t),ve({},o)).then(function(r){return r.data.data}).catch(function(r){var s,c,d;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error while updating the document.",exception:(d=(c=r.response.data.exception)!==null&&c!==void 0?c:r.response.data.exc_type)!==null&&d!==void 0?d:""}})]})})},e.prototype.deleteDoc=function(a,t){return we(this,void 0,void 0,function(){return Ee(this,function(o){return[2,this.axios.delete("/api/resource/".concat(a,"/").concat(t)).then(function(n){return n.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:"There was an error while deleting the document.",exception:(s=(r=n.response.data.exception)!==null&&r!==void 0?r:n.response.data.exc_type)!==null&&s!==void 0?s:""}})]})})},e.prototype.getCount=function(a,t,o,n){return o===void 0&&(o=!1),n===void 0&&(n=!1),we(this,void 0,void 0,function(){var r;return Ee(this,function(s){return r={doctype:a,filters:[]},o&&(r.cache=o),n&&(r.debug=n),t&&(r.filters=t?JSON.stringify(t):void 0),[2,this.axios.get("/api/method/frappe.client.get_count",{params:r}).then(function(c){return c.data.message}).catch(function(c){var d,u;throw{httpStatus:c.response.status,httpStatusText:c.response.statusText,message:"There was an error while getting the count.",exception:(u=(d=c.response.data.exception)!==null&&d!==void 0?d:c.response.data.exc_type)!==null&&u!==void 0?u:""}})]})})},e.prototype.getLastDoc=function(a,t){return we(this,void 0,void 0,function(){var o,n;return Ee(this,function(r){switch(r.label){case 0:return o={orderBy:{field:"creation",order:"desc"}},t&&(o=ve(ve({},o),t)),[4,this.getDocList(a,ve(ve({},o),{limit:1}))];case 1:return n=r.sent(),n.length>0?[2,this.getDoc(a,n[0].name)]:[2,{}]}})})},e}();Ue.FrappeDB=Rr;var Ne={},Cr=L&&L.__awaiter||function(e,a,t,o){function n(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function c(f){try{u(o.next(f))}catch(l){s(l)}}function d(f){try{u(o.throw(f))}catch(l){s(l)}}function u(f){f.done?r(f.value):n(f.value).then(c,d)}u((o=o.apply(e,a||[])).next())})},xr=L&&L.__generator||function(e,a){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return d([u,f])}}function d(u){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,n&&(r=u[0]&2?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){t.label=u[1];break}if(u[0]===6&&t.label<r[1]){t.label=r[1],r=u;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(u);break}r[2]&&t.ops.pop(),t.trys.pop();continue}u=a.call(e,t)}catch(f){u=[6,f],n=0}finally{o=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.FrappeFileUpload=void 0;var Tr=function(){function e(a,t,o,n,r){this.appURL=a,this.axios=t,this.useToken=o!=null?o:!1,this.token=n,this.tokenType=r}return e.prototype.uploadFile=function(a,t,o){return Cr(this,void 0,void 0,function(){var n,r,s,c,d,u,f;return xr(this,function(l){return n=new FormData,a&&n.append("file",a,a.name),r=t.isPrivate,s=t.folder,c=t.file_url,d=t.doctype,u=t.docname,f=t.fieldname,r&&n.append("is_private","1"),s&&n.append("folder",s),c&&n.append("file_url",c),d&&u&&(n.append("doctype",d),n.append("docname",u),f&&n.append("fieldname",f)),[2,this.axios.post("/api/method/upload_file",n,{onUploadProgress:function(y){o&&o(y.loaded,y.total)}}).catch(function(y){var v,w;throw{httpStatus:y.response.status,httpStatusText:y.response.statusText,message:(v=y.response.data.message)!==null&&v!==void 0?v:"There was an error while uploading the file.",exception:(w=y.response.data.exception)!==null&&w!==void 0?w:""}})]})})},e}();Ne.FrappeFileUpload=Tr;var xe={},nn={exports:{}},dt={exports:{}},rn=function(a,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return a.apply(t,n)}},Or=rn,me=Object.prototype.toString;function pt(e){return Array.isArray(e)}function ht(e){return typeof e>"u"}function Dr(e){return e!==null&&!ht(e)&&e.constructor!==null&&!ht(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function an(e){return me.call(e)==="[object ArrayBuffer]"}function Ar(e){return me.call(e)==="[object FormData]"}function Fr(e){var a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(e):a=e&&e.buffer&&an(e.buffer),a}function Lr(e){return typeof e=="string"}function Pr(e){return typeof e=="number"}function on(e){return e!==null&&typeof e=="object"}function et(e){if(me.call(e)!=="[object Object]")return!1;var a=Object.getPrototypeOf(e);return a===null||a===Object.prototype}function kr(e){return me.call(e)==="[object Date]"}function Ur(e){return me.call(e)==="[object File]"}function Nr(e){return me.call(e)==="[object Blob]"}function sn(e){return me.call(e)==="[object Function]"}function jr(e){return on(e)&&sn(e.pipe)}function Ir(e){return me.call(e)==="[object URLSearchParams]"}function Br(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Vr(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function vt(e,a){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),pt(e))for(var t=0,o=e.length;t<o;t++)a.call(null,e[t],t,e);else for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&a.call(null,e[n],n,e)}function mt(){var e={};function a(n,r){et(e[r])&&et(n)?e[r]=mt(e[r],n):et(n)?e[r]=mt({},n):pt(n)?e[r]=n.slice():e[r]=n}for(var t=0,o=arguments.length;t<o;t++)vt(arguments[t],a);return e}function Mr(e,a,t){return vt(a,function(n,r){t&&typeof n=="function"?e[r]=Or(n,t):e[r]=n}),e}function Wr(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var $={isArray:pt,isArrayBuffer:an,isBuffer:Dr,isFormData:Ar,isArrayBufferView:Fr,isString:Lr,isNumber:Pr,isObject:on,isPlainObject:et,isUndefined:ht,isDate:kr,isFile:Ur,isBlob:Nr,isFunction:sn,isStream:jr,isURLSearchParams:Ir,isStandardBrowserEnv:Vr,forEach:vt,merge:mt,extend:Mr,trim:Br,stripBOM:Wr},Te=$;function un(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var cn=function(a,t,o){if(!t)return a;var n;if(o)n=o(t);else if(Te.isURLSearchParams(t))n=t.toString();else{var r=[];Te.forEach(t,function(d,u){d===null||typeof d>"u"||(Te.isArray(d)?u=u+"[]":d=[d],Te.forEach(d,function(l){Te.isDate(l)?l=l.toISOString():Te.isObject(l)&&(l=JSON.stringify(l)),r.push(un(u)+"="+un(l))}))}),n=r.join("&")}if(n){var s=a.indexOf("#");s!==-1&&(a=a.slice(0,s)),a+=(a.indexOf("?")===-1?"?":"&")+n}return a},Hr=$;function tt(){this.handlers=[]}tt.prototype.use=function(a,t,o){return this.handlers.push({fulfilled:a,rejected:t,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1},tt.prototype.eject=function(a){this.handlers[a]&&(this.handlers[a]=null)},tt.prototype.forEach=function(a){Hr.forEach(this.handlers,function(o){o!==null&&a(o)})};var Jr=tt,Gr=$,Yr=function(a,t){Gr.forEach(a,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(a[t]=n,delete a[r])})},ln=function(a,t,o,n,r){return a.config=t,o&&(a.code=o),a.request=n,a.response=r,a.isAxiosError=!0,a.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}},a},fn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},yt,dn;function pn(){if(dn)return yt;dn=1;var e=ln;return yt=function(t,o,n,r,s){var c=new Error(t);return e(c,o,n,r,s)},yt}var _t,hn;function qr(){if(hn)return _t;hn=1;var e=pn();return _t=function(t,o,n){var r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):o(e("Request failed with status code "+n.status,n.config,null,n.request,n))},_t}var bt,vn;function zr(){if(vn)return bt;vn=1;var e=$;return bt=e.isStandardBrowserEnv()?function(){return{write:function(o,n,r,s,c,d){var u=[];u.push(o+"="+encodeURIComponent(n)),e.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),e.isString(s)&&u.push("path="+s),e.isString(c)&&u.push("domain="+c),d===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(o){var n=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(o){this.write(o,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),bt}var wt,mn;function Kr(){return mn||(mn=1,wt=function(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}),wt}var Et,yn;function Xr(){return yn||(yn=1,Et=function(a,t){return t?a.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):a}),Et}var St,_n;function Qr(){if(_n)return St;_n=1;var e=Kr(),a=Xr();return St=function(o,n){return o&&!e(n)?a(o,n):n},St}var gt,bn;function Zr(){if(bn)return gt;bn=1;var e=$,a=["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 gt=function(o){var n={},r,s,c;return o&&e.forEach(o.split(`
2
- `),function(u){if(c=u.indexOf(":"),r=e.trim(u.substr(0,c)).toLowerCase(),s=e.trim(u.substr(c+1)),r){if(n[r]&&a.indexOf(r)>=0)return;r==="set-cookie"?n[r]=(n[r]?n[r]:[]).concat([s]):n[r]=n[r]?n[r]+", "+s:s}}),n},gt}var Rt,wn;function $r(){if(wn)return Rt;wn=1;var e=$;return Rt=e.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a"),n;function r(s){var c=s;return t&&(o.setAttribute("href",c),c=o.href),o.setAttribute("href",c),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:o.pathname.charAt(0)==="/"?o.pathname:"/"+o.pathname}}return n=r(window.location.href),function(c){var d=e.isString(c)?r(c):c;return d.protocol===n.protocol&&d.host===n.host}}():function(){return function(){return!0}}(),Rt}var Ct,En;function nt(){if(En)return Ct;En=1;function e(a){this.message=a}return e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,Ct=e,Ct}var xt,Sn;function gn(){if(Sn)return xt;Sn=1;var e=$,a=qr(),t=zr(),o=cn,n=Qr(),r=Zr(),s=$r(),c=pn(),d=fn,u=nt();return xt=function(l){return new Promise(function(v,w){var b=l.data,x=l.headers,D=l.responseType,g;function O(){l.cancelToken&&l.cancelToken.unsubscribe(g),l.signal&&l.signal.removeEventListener("abort",g)}e.isFormData(b)&&delete x["Content-Type"];var _=new XMLHttpRequest;if(l.auth){var B=l.auth.username||"",E=l.auth.password?unescape(encodeURIComponent(l.auth.password)):"";x.Authorization="Basic "+btoa(B+":"+E)}var P=n(l.baseURL,l.url);_.open(l.method.toUpperCase(),o(P,l.params,l.paramsSerializer),!0),_.timeout=l.timeout;function J(){if(!!_){var I="getAllResponseHeaders"in _?r(_.getAllResponseHeaders()):null,q=!D||D==="text"||D==="json"?_.responseText:_.response,Q={data:q,status:_.status,statusText:_.statusText,headers:I,config:l,request:_};a(function(K){v(K),O()},function(K){w(K),O()},Q),_=null}}if("onloadend"in _?_.onloadend=J:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(J)},_.onabort=function(){!_||(w(c("Request aborted",l,"ECONNABORTED",_)),_=null)},_.onerror=function(){w(c("Network Error",l,null,_)),_=null},_.ontimeout=function(){var q=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",Q=l.transitional||d;l.timeoutErrorMessage&&(q=l.timeoutErrorMessage),w(c(q,l,Q.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",_)),_=null},e.isStandardBrowserEnv()){var N=(l.withCredentials||s(P))&&l.xsrfCookieName?t.read(l.xsrfCookieName):void 0;N&&(x[l.xsrfHeaderName]=N)}"setRequestHeader"in _&&e.forEach(x,function(q,Q){typeof b>"u"&&Q.toLowerCase()==="content-type"?delete x[Q]:_.setRequestHeader(Q,q)}),e.isUndefined(l.withCredentials)||(_.withCredentials=!!l.withCredentials),D&&D!=="json"&&(_.responseType=l.responseType),typeof l.onDownloadProgress=="function"&&_.addEventListener("progress",l.onDownloadProgress),typeof l.onUploadProgress=="function"&&_.upload&&_.upload.addEventListener("progress",l.onUploadProgress),(l.cancelToken||l.signal)&&(g=function(I){!_||(w(!I||I&&I.type?new u("canceled"):I),_.abort(),_=null)},l.cancelToken&&l.cancelToken.subscribe(g),l.signal&&(l.signal.aborted?g():l.signal.addEventListener("abort",g))),b||(b=null),_.send(b)})},xt}var z=$,Rn=Yr,ea=ln,ta=fn,na={"Content-Type":"application/x-www-form-urlencoded"};function Cn(e,a){!z.isUndefined(e)&&z.isUndefined(e["Content-Type"])&&(e["Content-Type"]=a)}function ra(){var e;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(e=gn()),e}function aa(e,a,t){if(z.isString(e))try{return(a||JSON.parse)(e),z.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(t||JSON.stringify)(e)}var rt={transitional:ta,adapter:ra(),transformRequest:[function(a,t){return Rn(t,"Accept"),Rn(t,"Content-Type"),z.isFormData(a)||z.isArrayBuffer(a)||z.isBuffer(a)||z.isStream(a)||z.isFile(a)||z.isBlob(a)?a:z.isArrayBufferView(a)?a.buffer:z.isURLSearchParams(a)?(Cn(t,"application/x-www-form-urlencoded;charset=utf-8"),a.toString()):z.isObject(a)||t&&t["Content-Type"]==="application/json"?(Cn(t,"application/json"),aa(a)):a}],transformResponse:[function(a){var t=this.transitional||rt.transitional,o=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,r=!o&&this.responseType==="json";if(r||n&&z.isString(a)&&a.length)try{return JSON.parse(a)}catch(s){if(r)throw s.name==="SyntaxError"?ea(s,this,"E_JSON_PARSE"):s}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};z.forEach(["delete","get","head"],function(a){rt.headers[a]={}}),z.forEach(["post","put","patch"],function(a){rt.headers[a]=z.merge(na)});var Tt=rt,oa=$,sa=Tt,ia=function(a,t,o){var n=this||sa;return oa.forEach(o,function(s){a=s.call(n,a,t)}),a},Ot,xn;function Tn(){return xn||(xn=1,Ot=function(a){return!!(a&&a.__CANCEL__)}),Ot}var On=$,Dt=ia,ua=Tn(),ca=Tt,la=nt();function At(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new la("canceled")}var fa=function(a){At(a),a.headers=a.headers||{},a.data=Dt.call(a,a.data,a.headers,a.transformRequest),a.headers=On.merge(a.headers.common||{},a.headers[a.method]||{},a.headers),On.forEach(["delete","get","head","post","put","patch","common"],function(n){delete a.headers[n]});var t=a.adapter||ca.adapter;return t(a).then(function(n){return At(a),n.data=Dt.call(a,n.data,n.headers,a.transformResponse),n},function(n){return ua(n)||(At(a),n&&n.response&&(n.response.data=Dt.call(a,n.response.data,n.response.headers,a.transformResponse))),Promise.reject(n)})},ne=$,Dn=function(a,t){t=t||{};var o={};function n(f,l){return ne.isPlainObject(f)&&ne.isPlainObject(l)?ne.merge(f,l):ne.isPlainObject(l)?ne.merge({},l):ne.isArray(l)?l.slice():l}function r(f){if(ne.isUndefined(t[f])){if(!ne.isUndefined(a[f]))return n(void 0,a[f])}else return n(a[f],t[f])}function s(f){if(!ne.isUndefined(t[f]))return n(void 0,t[f])}function c(f){if(ne.isUndefined(t[f])){if(!ne.isUndefined(a[f]))return n(void 0,a[f])}else return n(void 0,t[f])}function d(f){if(f in t)return n(a[f],t[f]);if(f in a)return n(void 0,a[f])}var u={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d};return ne.forEach(Object.keys(a).concat(Object.keys(t)),function(l){var y=u[l]||r,v=y(l);ne.isUndefined(v)&&y!==d||(o[l]=v)}),o},Ft,An;function Fn(){return An||(An=1,Ft={version:"0.26.1"}),Ft}var da=Fn().version,Lt={};["object","boolean","number","function","string","symbol"].forEach(function(e,a){Lt[e]=function(o){return typeof o===e||"a"+(a<1?"n ":" ")+e}});var Ln={};Lt.transitional=function(a,t,o){function n(r,s){return"[Axios v"+da+"] Transitional option '"+r+"'"+s+(o?". "+o:"")}return function(r,s,c){if(a===!1)throw new Error(n(s," has been removed"+(t?" in "+t:"")));return t&&!Ln[s]&&(Ln[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),a?a(r,s,c):!0}};function pa(e,a,t){if(typeof e!="object")throw new TypeError("options must be an object");for(var o=Object.keys(e),n=o.length;n-- >0;){var r=o[n],s=a[r];if(s){var c=e[r],d=c===void 0||s(c,r,e);if(d!==!0)throw new TypeError("option "+r+" must be "+d);continue}if(t!==!0)throw Error("Unknown option "+r)}}var ha={assertOptions:pa,validators:Lt},Pn=$,va=cn,kn=Jr,Un=fa,at=Dn,Nn=ha,Oe=Nn.validators;function je(e){this.defaults=e,this.interceptors={request:new kn,response:new kn}}je.prototype.request=function(a,t){typeof a=="string"?(t=t||{},t.url=a):t=a||{},t=at(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var o=t.transitional;o!==void 0&&Nn.assertOptions(o,{silentJSONParsing:Oe.transitional(Oe.boolean),forcedJSONParsing:Oe.transitional(Oe.boolean),clarifyTimeoutError:Oe.transitional(Oe.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(t)===!1||(r=r&&v.synchronous,n.unshift(v.fulfilled,v.rejected))});var s=[];this.interceptors.response.forEach(function(v){s.push(v.fulfilled,v.rejected)});var c;if(!r){var d=[Un,void 0];for(Array.prototype.unshift.apply(d,n),d=d.concat(s),c=Promise.resolve(t);d.length;)c=c.then(d.shift(),d.shift());return c}for(var u=t;n.length;){var f=n.shift(),l=n.shift();try{u=f(u)}catch(y){l(y);break}}try{c=Un(u)}catch(y){return Promise.reject(y)}for(;s.length;)c=c.then(s.shift(),s.shift());return c},je.prototype.getUri=function(a){return a=at(this.defaults,a),va(a.url,a.params,a.paramsSerializer).replace(/^\?/,"")},Pn.forEach(["delete","get","head","options"],function(a){je.prototype[a]=function(t,o){return this.request(at(o||{},{method:a,url:t,data:(o||{}).data}))}}),Pn.forEach(["post","put","patch"],function(a){je.prototype[a]=function(t,o,n){return this.request(at(n||{},{method:a,url:t,data:o}))}});var ma=je,Pt,jn;function ya(){if(jn)return Pt;jn=1;var e=nt();function a(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var o;this.promise=new Promise(function(s){o=s});var n=this;this.promise.then(function(r){if(!!n._listeners){var s,c=n._listeners.length;for(s=0;s<c;s++)n._listeners[s](r);n._listeners=null}}),this.promise.then=function(r){var s,c=new Promise(function(d){n.subscribe(d),s=d}).then(r);return c.cancel=function(){n.unsubscribe(s)},c},t(function(s){n.reason||(n.reason=new e(s),o(n.reason))})}return a.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},a.prototype.subscribe=function(o){if(this.reason){o(this.reason);return}this._listeners?this._listeners.push(o):this._listeners=[o]},a.prototype.unsubscribe=function(o){if(!!this._listeners){var n=this._listeners.indexOf(o);n!==-1&&this._listeners.splice(n,1)}},a.source=function(){var o,n=new a(function(s){o=s});return{token:n,cancel:o}},Pt=a,Pt}var kt,In;function _a(){return In||(In=1,kt=function(a){return function(o){return a.apply(null,o)}}),kt}var Ut,Bn;function ba(){if(Bn)return Ut;Bn=1;var e=$;return Ut=function(t){return e.isObject(t)&&t.isAxiosError===!0},Ut}var Vn=$,wa=rn,ot=ma,Ea=Dn,Sa=Tt;function Mn(e){var a=new ot(e),t=wa(ot.prototype.request,a);return Vn.extend(t,ot.prototype,a),Vn.extend(t,a),t.create=function(n){return Mn(Ea(e,n))},t}var se=Mn(Sa);se.Axios=ot,se.Cancel=nt(),se.CancelToken=ya(),se.isCancel=Tn(),se.VERSION=Fn().version,se.all=function(a){return Promise.all(a)},se.spread=_a(),se.isAxiosError=ba(),dt.exports=se,dt.exports.default=se,function(e){e.exports=dt.exports}(nn),Object.defineProperty(xe,"__esModule",{value:!0}),xe.getRequestHeaders=xe.getAxiosClient=void 0;var ga=nn.exports;function Ra(e,a,t,o){return ga.default.create({baseURL:e,headers:Wn(a,o,t),withCredentials:!0})}xe.getAxiosClient=Ra;function Wn(e,a,t){e===void 0&&(e=!1);var o={Accept:"application/json","Content-Type":"application/json; charset=utf-8"};return e&&a&&t&&(o.Authorization="".concat(a," ").concat(t())),typeof window<"u"&&(o["X-Frappe-Site-Name"]=window.location.hostname,window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(o["X-Frappe-CSRF-Token"]=window.csrf_token)),o}xe.getRequestHeaders=Wn;var Hn;function Ca(){if(Hn)return Pe;Hn=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.FrappeApp=void 0;var e=Gn(),a=ke,t=Ue,o=Ne,n=xe,r=function(){function s(c,d,u){var f,l;this.url=c,this.name=u!=null?u:"FrappeApp",this.useToken=(f=d==null?void 0:d.useToken)!==null&&f!==void 0?f:!1,this.token=d==null?void 0:d.token,this.tokenType=(l=d==null?void 0:d.type)!==null&&l!==void 0?l:"Bearer",this.axios=(0,n.getAxiosClient)(this.url,this.useToken,this.token,this.tokenType)}return s.prototype.auth=function(){return new e.FrappeAuth(this.url,this.axios,this.useToken,this.token,this.tokenType)},s.prototype.db=function(){return new t.FrappeDB(this.url,this.axios,this.useToken,this.token,this.tokenType)},s.prototype.file=function(){return new o.FrappeFileUpload(this.url,this.axios,this.useToken,this.token,this.tokenType)},s.prototype.call=function(){return new a.FrappeCall(this.url,this.axios,this.useToken,this.token,this.tokenType)},s}();return Pe.FrappeApp=r,Pe}var st={},it=L&&L.__awaiter||function(e,a,t,o){function n(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function c(f){try{u(o.next(f))}catch(l){s(l)}}function d(f){try{u(o.throw(f))}catch(l){s(l)}}function u(f){f.done?r(f.value):n(f.value).then(c,d)}u((o=o.apply(e,a||[])).next())})},ut=L&&L.__generator||function(e,a){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return d([u,f])}}function d(u){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,n&&(r=u[0]&2?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){t.label=u[1];break}if(u[0]===6&&t.label<r[1]){t.label=r[1],r=u;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(u);break}r[2]&&t.ops.pop(),t.trys.pop();continue}u=a.call(e,t)}catch(f){u=[6,f],n=0}finally{o=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(st,"__esModule",{value:!0}),st.FrappeAuth=void 0;var xa=function(){function e(a,t,o,n,r){this.appURL=a,this.axios=t,this.useToken=o!=null?o:!1,this.token=n,this.tokenType=r}return e.prototype.loginWithUsernamePassword=function(a){return it(this,void 0,void 0,function(){var t,o,n;return ut(this,function(r){return t=a.username,o=a.password,n=a.device,[2,this.axios.post("/api/method/login",{usr:t,pwd:o,device:n}).then(function(s){return s.data}).catch(function(s){var c,d;throw{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(c=s.response.data.message)!==null&&c!==void 0?c:"There was an error while logging in",exception:(d=s.response.data.exception)!==null&&d!==void 0?d:""}})]})})},e.prototype.getLoggedInUser=function(){return it(this,void 0,void 0,function(){return ut(this,function(a){return[2,this.axios.get("/api/method/frappe.auth.get_logged_user").then(function(t){return t.data.message}).catch(function(t){var o;throw{httpStatus:t.response.status,httpStatusText:t.response.statusText,message:"There was an error while fetching the logged in user",exception:(o=t.response.data.exception)!==null&&o!==void 0?o:""}})]})})},e.prototype.logout=function(){return it(this,void 0,void 0,function(){return ut(this,function(a){return[2,this.axios.post("/api/method/logout",{}).then(function(){}).catch(function(t){var o,n;throw{httpStatus:t.response.status,httpStatusText:t.response.statusText,message:(o=t.response.data.message)!==null&&o!==void 0?o:"There was an error while logging out",exception:(n=t.response.data.exception)!==null&&n!==void 0?n:""}})]})})},e.prototype.forgetPassword=function(a){return it(this,void 0,void 0,function(){return ut(this,function(t){return[2,this.axios.post("/",{cmd:"frappe.core.doctype.user.user.reset_password",user:a}).then(function(){}).catch(function(o){var n,r;throw{httpStatus:o.response.status,httpStatusText:o.response.statusText,message:(n=o.response.data.message)!==null&&n!==void 0?n:"There was an error sending password reset email.",exception:(r=o.response.data.exception)!==null&&r!==void 0?r:""}})]})})},e}();st.FrappeAuth=xa;var Jn;function Gn(){return Jn||(Jn=1,function(e){var a=L&&L.__createBinding||(Object.create?function(o,n,r,s){s===void 0&&(s=r);var c=Object.getOwnPropertyDescriptor(n,r);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(o,s,c)}:function(o,n,r,s){s===void 0&&(s=r),o[s]=n[r]}),t=L&&L.__exportStar||function(o,n){for(var r in o)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&a(n,o,r)};Object.defineProperty(e,"__esModule",{value:!0}),t(Ca(),e),t(st,e),t(Ue,e),t(Ne,e),t(ke,e)}(ft)),ft}var Ta=Gn(),Yn={exports:{}},Nt={};/**
1
+ (function(j,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(j=typeof globalThis<"u"?globalThis:j||self,h(j["Frappe React"]={},j.React))})(this,function(j,h){"use strict";const Ce=(e=>e&&typeof e=="object"&&"default"in e?e:{default:e})(h);var L=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ft={},ke={},Pe={},Qe=L&&L.__assign||function(){return Qe=Object.assign||function(e){for(var a,t=1,o=arguments.length;t<o;t++){a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},Qe.apply(this,arguments)},Ze=L&&L.__awaiter||function(e,a,t,o){function n(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function c(f){try{u(o.next(f))}catch(l){s(l)}}function d(f){try{u(o.throw(f))}catch(l){s(l)}}function u(f){f.done?r(f.value):n(f.value).then(c,d)}u((o=o.apply(e,a||[])).next())})},$e=L&&L.__generator||function(e,a){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return d([u,f])}}function d(u){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,n&&(r=u[0]&2?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){t.label=u[1];break}if(u[0]===6&&t.label<r[1]){t.label=r[1],r=u;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(u);break}r[2]&&t.ops.pop(),t.trys.pop();continue}u=a.call(e,t)}catch(f){u=[6,f],n=0}finally{o=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.FrappeCall=void 0;var gr=function(){function e(a,t,o,n,r){this.appURL=a,this.axios=t,this.useToken=o!=null?o:!1,this.token=n,this.tokenType=r}return e.prototype.get=function(a,t){return Ze(this,void 0,void 0,function(){return $e(this,function(o){return[2,this.axios.get("/api/method/".concat(a),{params:t}).then(function(n){return n.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:(r=n.response.data.message)!==null&&r!==void 0?r:"There was an error.",exception:(s=n.response.data.exception)!==null&&s!==void 0?s:""}})]})})},e.prototype.post=function(a,t){return Ze(this,void 0,void 0,function(){return $e(this,function(o){return[2,this.axios.post("/api/method/".concat(a),Qe({},t)).then(function(n){return n.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:(r=n.response.data.message)!==null&&r!==void 0?r:"There was an error.",exception:(s=n.response.data.exception)!==null&&s!==void 0?s:""}})]})})},e.prototype.put=function(a,t){return Ze(this,void 0,void 0,function(){return $e(this,function(o){return[2,this.axios.put("/api/method/".concat(a),Qe({},t)).then(function(n){return n.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:(r=n.response.data.message)!==null&&r!==void 0?r:"There was an error.",exception:(s=n.response.data.exception)!==null&&s!==void 0?s:""}})]})})},e.prototype.delete=function(a,t){return Ze(this,void 0,void 0,function(){return $e(this,function(o){return[2,this.axios.delete("/api/method/".concat(a),{params:t}).then(function(n){return n.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:(r=n.response.data.message)!==null&&r!==void 0?r:"There was an error.",exception:(s=n.response.data.exception)!==null&&s!==void 0?s:""}})]})})},e}();Pe.FrappeCall=gr;var Ue={},ve=L&&L.__assign||function(){return ve=Object.assign||function(e){for(var a,t=1,o=arguments.length;t<o;t++){a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},ve.apply(this,arguments)},we=L&&L.__awaiter||function(e,a,t,o){function n(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function c(f){try{u(o.next(f))}catch(l){s(l)}}function d(f){try{u(o.throw(f))}catch(l){s(l)}}function u(f){f.done?r(f.value):n(f.value).then(c,d)}u((o=o.apply(e,a||[])).next())})},Ee=L&&L.__generator||function(e,a){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return d([u,f])}}function d(u){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,n&&(r=u[0]&2?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){t.label=u[1];break}if(u[0]===6&&t.label<r[1]){t.label=r[1],r=u;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(u);break}r[2]&&t.ops.pop(),t.trys.pop();continue}u=a.call(e,t)}catch(f){u=[6,f],n=0}finally{o=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.FrappeDB=void 0;var Rr=function(){function e(a,t,o,n,r){this.appURL=a,this.axios=t,this.useToken=o!=null?o:!1,this.token=n,this.tokenType=r}return e.prototype.getDoc=function(a,t){return we(this,void 0,void 0,function(){return Ee(this,function(o){return[2,this.axios.get("/api/resource/".concat(a,"/").concat(t)).then(function(n){return n.data.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:"There was an error while fetching the document.",exception:(s=(r=n.response.data.exception)!==null&&r!==void 0?r:n.response.data.exc_type)!==null&&s!==void 0?s:""}})]})})},e.prototype.getDocList=function(a,t){var o;return we(this,void 0,void 0,function(){var n,r,s,c,d,u,f,l,y,v,w;return Ee(this,function(b){return n={},t&&(r=t.fields,s=t.filters,c=t.orFilters,d=t.orderBy,u=t.limit,f=t.limit_start,l=t.groupBy,y=t.asDict,v=y===void 0?!0:y,w=d?"".concat(d==null?void 0:d.field," ").concat((o=d==null?void 0:d.order)!==null&&o!==void 0?o:"asc"):"",n={fields:r?JSON.stringify(r):void 0,filters:s?JSON.stringify(s):void 0,or_filters:c?JSON.stringify(c):void 0,order_by:w,group_by:l,limit:u,limit_start:f,as_dict:v}),[2,this.axios.get("/api/resource/".concat(a),{params:n}).then(function(T){return T.data.data}).catch(function(T){var D,g;throw{httpStatus:T.response.status,httpStatusText:T.response.statusText,message:"There was an error while fetching the documents.",exception:(g=(D=T.response.data.exception)!==null&&D!==void 0?D:T.response.data.exc_type)!==null&&g!==void 0?g:""}})]})})},e.prototype.createDoc=function(a,t){return we(this,void 0,void 0,function(){return Ee(this,function(o){return[2,this.axios.post("/api/resource/".concat(a),ve({},t)).then(function(n){return n.data.data}).catch(function(n){var r,s,c;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:(r=n.response.data.message)!==null&&r!==void 0?r:"There was an error while creating the document.",exception:(c=(s=n.response.data.exception)!==null&&s!==void 0?s:n.response.data.exc_type)!==null&&c!==void 0?c:""}})]})})},e.prototype.updateDoc=function(a,t,o){return we(this,void 0,void 0,function(){return Ee(this,function(n){return[2,this.axios.put("/api/resource/".concat(a,"/").concat(t),ve({},o)).then(function(r){return r.data.data}).catch(function(r){var s,c,d;throw{httpStatus:r.response.status,httpStatusText:r.response.statusText,message:(s=r.response.data.message)!==null&&s!==void 0?s:"There was an error while updating the document.",exception:(d=(c=r.response.data.exception)!==null&&c!==void 0?c:r.response.data.exc_type)!==null&&d!==void 0?d:""}})]})})},e.prototype.deleteDoc=function(a,t){return we(this,void 0,void 0,function(){return Ee(this,function(o){return[2,this.axios.delete("/api/resource/".concat(a,"/").concat(t)).then(function(n){return n.data}).catch(function(n){var r,s;throw{httpStatus:n.response.status,httpStatusText:n.response.statusText,message:"There was an error while deleting the document.",exception:(s=(r=n.response.data.exception)!==null&&r!==void 0?r:n.response.data.exc_type)!==null&&s!==void 0?s:""}})]})})},e.prototype.getCount=function(a,t,o,n){return o===void 0&&(o=!1),n===void 0&&(n=!1),we(this,void 0,void 0,function(){var r;return Ee(this,function(s){return r={doctype:a,filters:[]},o&&(r.cache=o),n&&(r.debug=n),t&&(r.filters=t?JSON.stringify(t):void 0),[2,this.axios.get("/api/method/frappe.client.get_count",{params:r}).then(function(c){return c.data.message}).catch(function(c){var d,u;throw{httpStatus:c.response.status,httpStatusText:c.response.statusText,message:"There was an error while getting the count.",exception:(u=(d=c.response.data.exception)!==null&&d!==void 0?d:c.response.data.exc_type)!==null&&u!==void 0?u:""}})]})})},e.prototype.getLastDoc=function(a,t){return we(this,void 0,void 0,function(){var o,n;return Ee(this,function(r){switch(r.label){case 0:return o={orderBy:{field:"creation",order:"desc"}},t&&(o=ve(ve({},o),t)),[4,this.getDocList(a,ve(ve({},o),{limit:1}))];case 1:return n=r.sent(),n.length>0?[2,this.getDoc(a,n[0].name)]:[2,{}]}})})},e}();Ue.FrappeDB=Rr;var Ne={},Cr=L&&L.__awaiter||function(e,a,t,o){function n(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function c(f){try{u(o.next(f))}catch(l){s(l)}}function d(f){try{u(o.throw(f))}catch(l){s(l)}}function u(f){f.done?r(f.value):n(f.value).then(c,d)}u((o=o.apply(e,a||[])).next())})},Tr=L&&L.__generator||function(e,a){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return d([u,f])}}function d(u){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,n&&(r=u[0]&2?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){t.label=u[1];break}if(u[0]===6&&t.label<r[1]){t.label=r[1],r=u;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(u);break}r[2]&&t.ops.pop(),t.trys.pop();continue}u=a.call(e,t)}catch(f){u=[6,f],n=0}finally{o=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.FrappeFileUpload=void 0;var xr=function(){function e(a,t,o,n,r){this.appURL=a,this.axios=t,this.useToken=o!=null?o:!1,this.token=n,this.tokenType=r}return e.prototype.uploadFile=function(a,t,o){return Cr(this,void 0,void 0,function(){var n,r,s,c,d,u,f;return Tr(this,function(l){return n=new FormData,a&&n.append("file",a,a.name),r=t.isPrivate,s=t.folder,c=t.file_url,d=t.doctype,u=t.docname,f=t.fieldname,r&&n.append("is_private","1"),s&&n.append("folder",s),c&&n.append("file_url",c),d&&u&&(n.append("doctype",d),n.append("docname",u),f&&n.append("fieldname",f)),[2,this.axios.post("/api/method/upload_file",n,{onUploadProgress:function(y){o&&o(y.loaded,y.total)}}).catch(function(y){var v,w;throw{httpStatus:y.response.status,httpStatusText:y.response.statusText,message:(v=y.response.data.message)!==null&&v!==void 0?v:"There was an error while uploading the file.",exception:(w=y.response.data.exception)!==null&&w!==void 0?w:""}})]})})},e}();Ne.FrappeFileUpload=xr;var Te={},nn={exports:{}},dt={exports:{}},rn=function(a,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return a.apply(t,n)}},Or=rn,me=Object.prototype.toString;function pt(e){return Array.isArray(e)}function ht(e){return typeof e>"u"}function Dr(e){return e!==null&&!ht(e)&&e.constructor!==null&&!ht(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function an(e){return me.call(e)==="[object ArrayBuffer]"}function Ar(e){return me.call(e)==="[object FormData]"}function Fr(e){var a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(e):a=e&&e.buffer&&an(e.buffer),a}function Lr(e){return typeof e=="string"}function kr(e){return typeof e=="number"}function on(e){return e!==null&&typeof e=="object"}function et(e){if(me.call(e)!=="[object Object]")return!1;var a=Object.getPrototypeOf(e);return a===null||a===Object.prototype}function Pr(e){return me.call(e)==="[object Date]"}function Ur(e){return me.call(e)==="[object File]"}function Nr(e){return me.call(e)==="[object Blob]"}function sn(e){return me.call(e)==="[object Function]"}function jr(e){return on(e)&&sn(e.pipe)}function Ir(e){return me.call(e)==="[object URLSearchParams]"}function Br(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Vr(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function vt(e,a){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),pt(e))for(var t=0,o=e.length;t<o;t++)a.call(null,e[t],t,e);else for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&a.call(null,e[n],n,e)}function mt(){var e={};function a(n,r){et(e[r])&&et(n)?e[r]=mt(e[r],n):et(n)?e[r]=mt({},n):pt(n)?e[r]=n.slice():e[r]=n}for(var t=0,o=arguments.length;t<o;t++)vt(arguments[t],a);return e}function Mr(e,a,t){return vt(a,function(n,r){t&&typeof n=="function"?e[r]=Or(n,t):e[r]=n}),e}function Wr(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var $={isArray:pt,isArrayBuffer:an,isBuffer:Dr,isFormData:Ar,isArrayBufferView:Fr,isString:Lr,isNumber:kr,isObject:on,isPlainObject:et,isUndefined:ht,isDate:Pr,isFile:Ur,isBlob:Nr,isFunction:sn,isStream:jr,isURLSearchParams:Ir,isStandardBrowserEnv:Vr,forEach:vt,merge:mt,extend:Mr,trim:Br,stripBOM:Wr},xe=$;function un(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var cn=function(a,t,o){if(!t)return a;var n;if(o)n=o(t);else if(xe.isURLSearchParams(t))n=t.toString();else{var r=[];xe.forEach(t,function(d,u){d===null||typeof d>"u"||(xe.isArray(d)?u=u+"[]":d=[d],xe.forEach(d,function(l){xe.isDate(l)?l=l.toISOString():xe.isObject(l)&&(l=JSON.stringify(l)),r.push(un(u)+"="+un(l))}))}),n=r.join("&")}if(n){var s=a.indexOf("#");s!==-1&&(a=a.slice(0,s)),a+=(a.indexOf("?")===-1?"?":"&")+n}return a},Hr=$;function tt(){this.handlers=[]}tt.prototype.use=function(a,t,o){return this.handlers.push({fulfilled:a,rejected:t,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1},tt.prototype.eject=function(a){this.handlers[a]&&(this.handlers[a]=null)},tt.prototype.forEach=function(a){Hr.forEach(this.handlers,function(o){o!==null&&a(o)})};var Jr=tt,Gr=$,Yr=function(a,t){Gr.forEach(a,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(a[t]=n,delete a[r])})},ln=function(a,t,o,n,r){return a.config=t,o&&(a.code=o),a.request=n,a.response=r,a.isAxiosError=!0,a.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}},a},fn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},yt,dn;function pn(){if(dn)return yt;dn=1;var e=ln;return yt=function(t,o,n,r,s){var c=new Error(t);return e(c,o,n,r,s)},yt}var _t,hn;function qr(){if(hn)return _t;hn=1;var e=pn();return _t=function(t,o,n){var r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):o(e("Request failed with status code "+n.status,n.config,null,n.request,n))},_t}var bt,vn;function zr(){if(vn)return bt;vn=1;var e=$;return bt=e.isStandardBrowserEnv()?function(){return{write:function(o,n,r,s,c,d){var u=[];u.push(o+"="+encodeURIComponent(n)),e.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),e.isString(s)&&u.push("path="+s),e.isString(c)&&u.push("domain="+c),d===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(o){var n=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(o){this.write(o,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),bt}var wt,mn;function Kr(){return mn||(mn=1,wt=function(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}),wt}var Et,yn;function Xr(){return yn||(yn=1,Et=function(a,t){return t?a.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):a}),Et}var St,_n;function Qr(){if(_n)return St;_n=1;var e=Kr(),a=Xr();return St=function(o,n){return o&&!e(n)?a(o,n):n},St}var gt,bn;function Zr(){if(bn)return gt;bn=1;var e=$,a=["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 gt=function(o){var n={},r,s,c;return o&&e.forEach(o.split(`
2
+ `),function(u){if(c=u.indexOf(":"),r=e.trim(u.substr(0,c)).toLowerCase(),s=e.trim(u.substr(c+1)),r){if(n[r]&&a.indexOf(r)>=0)return;r==="set-cookie"?n[r]=(n[r]?n[r]:[]).concat([s]):n[r]=n[r]?n[r]+", "+s:s}}),n},gt}var Rt,wn;function $r(){if(wn)return Rt;wn=1;var e=$;return Rt=e.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a"),n;function r(s){var c=s;return t&&(o.setAttribute("href",c),c=o.href),o.setAttribute("href",c),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:o.pathname.charAt(0)==="/"?o.pathname:"/"+o.pathname}}return n=r(window.location.href),function(c){var d=e.isString(c)?r(c):c;return d.protocol===n.protocol&&d.host===n.host}}():function(){return function(){return!0}}(),Rt}var Ct,En;function nt(){if(En)return Ct;En=1;function e(a){this.message=a}return e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,Ct=e,Ct}var Tt,Sn;function gn(){if(Sn)return Tt;Sn=1;var e=$,a=qr(),t=zr(),o=cn,n=Qr(),r=Zr(),s=$r(),c=pn(),d=fn,u=nt();return Tt=function(l){return new Promise(function(v,w){var b=l.data,T=l.headers,D=l.responseType,g;function O(){l.cancelToken&&l.cancelToken.unsubscribe(g),l.signal&&l.signal.removeEventListener("abort",g)}e.isFormData(b)&&delete T["Content-Type"];var _=new XMLHttpRequest;if(l.auth){var B=l.auth.username||"",E=l.auth.password?unescape(encodeURIComponent(l.auth.password)):"";T.Authorization="Basic "+btoa(B+":"+E)}var k=n(l.baseURL,l.url);_.open(l.method.toUpperCase(),o(k,l.params,l.paramsSerializer),!0),_.timeout=l.timeout;function J(){if(!!_){var I="getAllResponseHeaders"in _?r(_.getAllResponseHeaders()):null,q=!D||D==="text"||D==="json"?_.responseText:_.response,Q={data:q,status:_.status,statusText:_.statusText,headers:I,config:l,request:_};a(function(K){v(K),O()},function(K){w(K),O()},Q),_=null}}if("onloadend"in _?_.onloadend=J:_.onreadystatechange=function(){!_||_.readyState!==4||_.status===0&&!(_.responseURL&&_.responseURL.indexOf("file:")===0)||setTimeout(J)},_.onabort=function(){!_||(w(c("Request aborted",l,"ECONNABORTED",_)),_=null)},_.onerror=function(){w(c("Network Error",l,null,_)),_=null},_.ontimeout=function(){var q=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",Q=l.transitional||d;l.timeoutErrorMessage&&(q=l.timeoutErrorMessage),w(c(q,l,Q.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",_)),_=null},e.isStandardBrowserEnv()){var N=(l.withCredentials||s(k))&&l.xsrfCookieName?t.read(l.xsrfCookieName):void 0;N&&(T[l.xsrfHeaderName]=N)}"setRequestHeader"in _&&e.forEach(T,function(q,Q){typeof b>"u"&&Q.toLowerCase()==="content-type"?delete T[Q]:_.setRequestHeader(Q,q)}),e.isUndefined(l.withCredentials)||(_.withCredentials=!!l.withCredentials),D&&D!=="json"&&(_.responseType=l.responseType),typeof l.onDownloadProgress=="function"&&_.addEventListener("progress",l.onDownloadProgress),typeof l.onUploadProgress=="function"&&_.upload&&_.upload.addEventListener("progress",l.onUploadProgress),(l.cancelToken||l.signal)&&(g=function(I){!_||(w(!I||I&&I.type?new u("canceled"):I),_.abort(),_=null)},l.cancelToken&&l.cancelToken.subscribe(g),l.signal&&(l.signal.aborted?g():l.signal.addEventListener("abort",g))),b||(b=null),_.send(b)})},Tt}var z=$,Rn=Yr,ea=ln,ta=fn,na={"Content-Type":"application/x-www-form-urlencoded"};function Cn(e,a){!z.isUndefined(e)&&z.isUndefined(e["Content-Type"])&&(e["Content-Type"]=a)}function ra(){var e;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(e=gn()),e}function aa(e,a,t){if(z.isString(e))try{return(a||JSON.parse)(e),z.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(t||JSON.stringify)(e)}var rt={transitional:ta,adapter:ra(),transformRequest:[function(a,t){return Rn(t,"Accept"),Rn(t,"Content-Type"),z.isFormData(a)||z.isArrayBuffer(a)||z.isBuffer(a)||z.isStream(a)||z.isFile(a)||z.isBlob(a)?a:z.isArrayBufferView(a)?a.buffer:z.isURLSearchParams(a)?(Cn(t,"application/x-www-form-urlencoded;charset=utf-8"),a.toString()):z.isObject(a)||t&&t["Content-Type"]==="application/json"?(Cn(t,"application/json"),aa(a)):a}],transformResponse:[function(a){var t=this.transitional||rt.transitional,o=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,r=!o&&this.responseType==="json";if(r||n&&z.isString(a)&&a.length)try{return JSON.parse(a)}catch(s){if(r)throw s.name==="SyntaxError"?ea(s,this,"E_JSON_PARSE"):s}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};z.forEach(["delete","get","head"],function(a){rt.headers[a]={}}),z.forEach(["post","put","patch"],function(a){rt.headers[a]=z.merge(na)});var xt=rt,oa=$,sa=xt,ia=function(a,t,o){var n=this||sa;return oa.forEach(o,function(s){a=s.call(n,a,t)}),a},Ot,Tn;function xn(){return Tn||(Tn=1,Ot=function(a){return!!(a&&a.__CANCEL__)}),Ot}var On=$,Dt=ia,ua=xn(),ca=xt,la=nt();function At(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new la("canceled")}var fa=function(a){At(a),a.headers=a.headers||{},a.data=Dt.call(a,a.data,a.headers,a.transformRequest),a.headers=On.merge(a.headers.common||{},a.headers[a.method]||{},a.headers),On.forEach(["delete","get","head","post","put","patch","common"],function(n){delete a.headers[n]});var t=a.adapter||ca.adapter;return t(a).then(function(n){return At(a),n.data=Dt.call(a,n.data,n.headers,a.transformResponse),n},function(n){return ua(n)||(At(a),n&&n.response&&(n.response.data=Dt.call(a,n.response.data,n.response.headers,a.transformResponse))),Promise.reject(n)})},ne=$,Dn=function(a,t){t=t||{};var o={};function n(f,l){return ne.isPlainObject(f)&&ne.isPlainObject(l)?ne.merge(f,l):ne.isPlainObject(l)?ne.merge({},l):ne.isArray(l)?l.slice():l}function r(f){if(ne.isUndefined(t[f])){if(!ne.isUndefined(a[f]))return n(void 0,a[f])}else return n(a[f],t[f])}function s(f){if(!ne.isUndefined(t[f]))return n(void 0,t[f])}function c(f){if(ne.isUndefined(t[f])){if(!ne.isUndefined(a[f]))return n(void 0,a[f])}else return n(void 0,t[f])}function d(f){if(f in t)return n(a[f],t[f]);if(f in a)return n(void 0,a[f])}var u={url:s,method:s,data:s,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d};return ne.forEach(Object.keys(a).concat(Object.keys(t)),function(l){var y=u[l]||r,v=y(l);ne.isUndefined(v)&&y!==d||(o[l]=v)}),o},Ft,An;function Fn(){return An||(An=1,Ft={version:"0.26.1"}),Ft}var da=Fn().version,Lt={};["object","boolean","number","function","string","symbol"].forEach(function(e,a){Lt[e]=function(o){return typeof o===e||"a"+(a<1?"n ":" ")+e}});var Ln={};Lt.transitional=function(a,t,o){function n(r,s){return"[Axios v"+da+"] Transitional option '"+r+"'"+s+(o?". "+o:"")}return function(r,s,c){if(a===!1)throw new Error(n(s," has been removed"+(t?" in "+t:"")));return t&&!Ln[s]&&(Ln[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),a?a(r,s,c):!0}};function pa(e,a,t){if(typeof e!="object")throw new TypeError("options must be an object");for(var o=Object.keys(e),n=o.length;n-- >0;){var r=o[n],s=a[r];if(s){var c=e[r],d=c===void 0||s(c,r,e);if(d!==!0)throw new TypeError("option "+r+" must be "+d);continue}if(t!==!0)throw Error("Unknown option "+r)}}var ha={assertOptions:pa,validators:Lt},kn=$,va=cn,Pn=Jr,Un=fa,at=Dn,Nn=ha,Oe=Nn.validators;function je(e){this.defaults=e,this.interceptors={request:new Pn,response:new Pn}}je.prototype.request=function(a,t){typeof a=="string"?(t=t||{},t.url=a):t=a||{},t=at(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var o=t.transitional;o!==void 0&&Nn.assertOptions(o,{silentJSONParsing:Oe.transitional(Oe.boolean),forcedJSONParsing:Oe.transitional(Oe.boolean),clarifyTimeoutError:Oe.transitional(Oe.boolean)},!1);var n=[],r=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(t)===!1||(r=r&&v.synchronous,n.unshift(v.fulfilled,v.rejected))});var s=[];this.interceptors.response.forEach(function(v){s.push(v.fulfilled,v.rejected)});var c;if(!r){var d=[Un,void 0];for(Array.prototype.unshift.apply(d,n),d=d.concat(s),c=Promise.resolve(t);d.length;)c=c.then(d.shift(),d.shift());return c}for(var u=t;n.length;){var f=n.shift(),l=n.shift();try{u=f(u)}catch(y){l(y);break}}try{c=Un(u)}catch(y){return Promise.reject(y)}for(;s.length;)c=c.then(s.shift(),s.shift());return c},je.prototype.getUri=function(a){return a=at(this.defaults,a),va(a.url,a.params,a.paramsSerializer).replace(/^\?/,"")},kn.forEach(["delete","get","head","options"],function(a){je.prototype[a]=function(t,o){return this.request(at(o||{},{method:a,url:t,data:(o||{}).data}))}}),kn.forEach(["post","put","patch"],function(a){je.prototype[a]=function(t,o,n){return this.request(at(n||{},{method:a,url:t,data:o}))}});var ma=je,kt,jn;function ya(){if(jn)return kt;jn=1;var e=nt();function a(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var o;this.promise=new Promise(function(s){o=s});var n=this;this.promise.then(function(r){if(!!n._listeners){var s,c=n._listeners.length;for(s=0;s<c;s++)n._listeners[s](r);n._listeners=null}}),this.promise.then=function(r){var s,c=new Promise(function(d){n.subscribe(d),s=d}).then(r);return c.cancel=function(){n.unsubscribe(s)},c},t(function(s){n.reason||(n.reason=new e(s),o(n.reason))})}return a.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},a.prototype.subscribe=function(o){if(this.reason){o(this.reason);return}this._listeners?this._listeners.push(o):this._listeners=[o]},a.prototype.unsubscribe=function(o){if(!!this._listeners){var n=this._listeners.indexOf(o);n!==-1&&this._listeners.splice(n,1)}},a.source=function(){var o,n=new a(function(s){o=s});return{token:n,cancel:o}},kt=a,kt}var Pt,In;function _a(){return In||(In=1,Pt=function(a){return function(o){return a.apply(null,o)}}),Pt}var Ut,Bn;function ba(){if(Bn)return Ut;Bn=1;var e=$;return Ut=function(t){return e.isObject(t)&&t.isAxiosError===!0},Ut}var Vn=$,wa=rn,ot=ma,Ea=Dn,Sa=xt;function Mn(e){var a=new ot(e),t=wa(ot.prototype.request,a);return Vn.extend(t,ot.prototype,a),Vn.extend(t,a),t.create=function(n){return Mn(Ea(e,n))},t}var se=Mn(Sa);se.Axios=ot,se.Cancel=nt(),se.CancelToken=ya(),se.isCancel=xn(),se.VERSION=Fn().version,se.all=function(a){return Promise.all(a)},se.spread=_a(),se.isAxiosError=ba(),dt.exports=se,dt.exports.default=se,function(e){e.exports=dt.exports}(nn),Object.defineProperty(Te,"__esModule",{value:!0}),Te.getRequestHeaders=Te.getAxiosClient=void 0;var ga=nn.exports;function Ra(e,a,t,o){return ga.default.create({baseURL:e,headers:Wn(a,o,t),withCredentials:!0})}Te.getAxiosClient=Ra;function Wn(e,a,t){e===void 0&&(e=!1);var o={Accept:"application/json","Content-Type":"application/json; charset=utf-8"};return e&&a&&t&&(o.Authorization="".concat(a," ").concat(t())),typeof window<"u"&&(o["X-Frappe-Site-Name"]=window.location.hostname,window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(o["X-Frappe-CSRF-Token"]=window.csrf_token)),o}Te.getRequestHeaders=Wn;var Hn;function Ca(){if(Hn)return ke;Hn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.FrappeApp=void 0;var e=Gn(),a=Pe,t=Ue,o=Ne,n=Te,r=function(){function s(c,d,u){var f,l;this.url=c,this.name=u!=null?u:"FrappeApp",this.useToken=(f=d==null?void 0:d.useToken)!==null&&f!==void 0?f:!1,this.token=d==null?void 0:d.token,this.tokenType=(l=d==null?void 0:d.type)!==null&&l!==void 0?l:"Bearer",this.axios=(0,n.getAxiosClient)(this.url,this.useToken,this.token,this.tokenType)}return s.prototype.auth=function(){return new e.FrappeAuth(this.url,this.axios,this.useToken,this.token,this.tokenType)},s.prototype.db=function(){return new t.FrappeDB(this.url,this.axios,this.useToken,this.token,this.tokenType)},s.prototype.file=function(){return new o.FrappeFileUpload(this.url,this.axios,this.useToken,this.token,this.tokenType)},s.prototype.call=function(){return new a.FrappeCall(this.url,this.axios,this.useToken,this.token,this.tokenType)},s}();return ke.FrappeApp=r,ke}var st={},it=L&&L.__awaiter||function(e,a,t,o){function n(r){return r instanceof t?r:new t(function(s){s(r)})}return new(t||(t=Promise))(function(r,s){function c(f){try{u(o.next(f))}catch(l){s(l)}}function d(f){try{u(o.throw(f))}catch(l){s(l)}}function u(f){f.done?r(f.value):n(f.value).then(c,d)}u((o=o.apply(e,a||[])).next())})},ut=L&&L.__generator||function(e,a){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(f){return d([u,f])}}function d(u){if(o)throw new TypeError("Generator is already executing.");for(;t;)try{if(o=1,n&&(r=u[0]&2?n.return:u[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,u[1])).done)return r;switch(n=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,n=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){t.label=u[1];break}if(u[0]===6&&t.label<r[1]){t.label=r[1],r=u;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(u);break}r[2]&&t.ops.pop(),t.trys.pop();continue}u=a.call(e,t)}catch(f){u=[6,f],n=0}finally{o=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(st,"__esModule",{value:!0}),st.FrappeAuth=void 0;var Ta=function(){function e(a,t,o,n,r){this.appURL=a,this.axios=t,this.useToken=o!=null?o:!1,this.token=n,this.tokenType=r}return e.prototype.loginWithUsernamePassword=function(a){return it(this,void 0,void 0,function(){var t,o,n;return ut(this,function(r){return t=a.username,o=a.password,n=a.device,[2,this.axios.post("/api/method/login",{usr:t,pwd:o,device:n}).then(function(s){return s.data}).catch(function(s){var c,d;throw{httpStatus:s.response.status,httpStatusText:s.response.statusText,message:(c=s.response.data.message)!==null&&c!==void 0?c:"There was an error while logging in",exception:(d=s.response.data.exception)!==null&&d!==void 0?d:""}})]})})},e.prototype.getLoggedInUser=function(){return it(this,void 0,void 0,function(){return ut(this,function(a){return[2,this.axios.get("/api/method/frappe.auth.get_logged_user").then(function(t){return t.data.message}).catch(function(t){var o;throw{httpStatus:t.response.status,httpStatusText:t.response.statusText,message:"There was an error while fetching the logged in user",exception:(o=t.response.data.exception)!==null&&o!==void 0?o:""}})]})})},e.prototype.logout=function(){return it(this,void 0,void 0,function(){return ut(this,function(a){return[2,this.axios.post("/api/method/logout",{}).then(function(){}).catch(function(t){var o,n;throw{httpStatus:t.response.status,httpStatusText:t.response.statusText,message:(o=t.response.data.message)!==null&&o!==void 0?o:"There was an error while logging out",exception:(n=t.response.data.exception)!==null&&n!==void 0?n:""}})]})})},e.prototype.forgetPassword=function(a){return it(this,void 0,void 0,function(){return ut(this,function(t){return[2,this.axios.post("/",{cmd:"frappe.core.doctype.user.user.reset_password",user:a}).then(function(){}).catch(function(o){var n,r;throw{httpStatus:o.response.status,httpStatusText:o.response.statusText,message:(n=o.response.data.message)!==null&&n!==void 0?n:"There was an error sending password reset email.",exception:(r=o.response.data.exception)!==null&&r!==void 0?r:""}})]})})},e}();st.FrappeAuth=Ta;var Jn;function Gn(){return Jn||(Jn=1,function(e){var a=L&&L.__createBinding||(Object.create?function(o,n,r,s){s===void 0&&(s=r);var c=Object.getOwnPropertyDescriptor(n,r);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[r]}}),Object.defineProperty(o,s,c)}:function(o,n,r,s){s===void 0&&(s=r),o[s]=n[r]}),t=L&&L.__exportStar||function(o,n){for(var r in o)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&a(n,o,r)};Object.defineProperty(e,"__esModule",{value:!0}),t(Ca(),e),t(st,e),t(Ue,e),t(Ne,e),t(Pe,e)}(ft)),ft}var xa=Gn(),Yn={exports:{}},Nt={};/**
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 qn;function Oa(){if(qn)return Nt;qn=1;var e=Ce.default;function a(l,y){return l===y&&(l!==0||1/l===1/y)||l!==l&&y!==y}var t=typeof Object.is=="function"?Object.is:a,o=e.useState,n=e.useEffect,r=e.useLayoutEffect,s=e.useDebugValue;function c(l,y){var v=y(),w=o({inst:{value:v,getSnapshot:y}}),b=w[0].inst,x=w[1];return r(function(){b.value=v,b.getSnapshot=y,d(b)&&x({inst:b})},[l,v,y]),n(function(){return d(b)&&x({inst:b}),l(function(){d(b)&&x({inst:b})})},[l]),s(v),v}function d(l){var y=l.getSnapshot;l=l.value;try{var v=y();return!t(l,v)}catch{return!0}}function u(l,y){return y()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:c;return Nt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Nt}var jt={};/**
10
+ */var qn;function Oa(){if(qn)return Nt;qn=1;var e=Ce.default;function a(l,y){return l===y&&(l!==0||1/l===1/y)||l!==l&&y!==y}var t=typeof Object.is=="function"?Object.is:a,o=e.useState,n=e.useEffect,r=e.useLayoutEffect,s=e.useDebugValue;function c(l,y){var v=y(),w=o({inst:{value:v,getSnapshot:y}}),b=w[0].inst,T=w[1];return r(function(){b.value=v,b.getSnapshot=y,d(b)&&T({inst:b})},[l,v,y]),n(function(){return d(b)&&T({inst:b}),l(function(){d(b)&&T({inst:b})})},[l]),s(v),v}function d(l){var y=l.getSnapshot;l=l.value;try{var v=y();return!t(l,v)}catch{return!0}}function u(l,y){return y()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:c;return Nt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,Nt}var jt={};/**
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 zn;function Da(){return zn||(zn=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 e=Ce.default,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(O){{for(var _=arguments.length,B=new Array(_>1?_-1:0),E=1;E<_;E++)B[E-1]=arguments[E];o("error",O,B)}}function o(O,_,B){{var E=a.ReactDebugCurrentFrame,P=E.getStackAddendum();P!==""&&(_+="%s",B=B.concat([P]));var J=B.map(function(N){return String(N)});J.unshift("Warning: "+_),Function.prototype.apply.call(console[O],console,J)}}function n(O,_){return O===_&&(O!==0||1/O===1/_)||O!==O&&_!==_}var r=typeof Object.is=="function"?Object.is:n,s=e.useState,c=e.useEffect,d=e.useLayoutEffect,u=e.useDebugValue,f=!1,l=!1;function y(O,_,B){f||e.startTransition!==void 0&&(f=!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 E=_();if(!l){var P=_();r(E,P)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var J=s({inst:{value:E,getSnapshot:_}}),N=J[0].inst,I=J[1];return d(function(){N.value=E,N.getSnapshot=_,v(N)&&I({inst:N})},[O,E,_]),c(function(){v(N)&&I({inst:N});var q=function(){v(N)&&I({inst:N})};return O(q)},[O]),u(E),E}function v(O){var _=O.getSnapshot,B=O.value;try{var E=_();return!r(B,E)}catch{return!0}}function w(O,_,B){return _()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!b,D=x?w:y,g=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:D;jt.useSyncExternalStore=g,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),jt}(function(e){process.env.NODE_ENV==="production"?e.exports=Oa():e.exports=Da()})(Yn);const ce=new WeakMap,Kn={},ye=()=>{},ae=ye(),It=Object,U=e=>e===ae,le=e=>typeof e=="function",_e=(e,a)=>({...e,...a}),Bt="undefined",ct=typeof window!=Bt,Vt=typeof document!=Bt,Aa=()=>ct&&typeof window.requestAnimationFrame!=Bt,Xn=(e,a)=>{const t=ce.get(e);return[()=>e.get(a)||Kn,o=>{const n=e.get(a);t[5](a,_e(n,o),n||Kn)},t[6]]},lt=new WeakMap;let Fa=0;const Ie=e=>{const a=typeof e,t=e&&e.constructor,o=t==Date;let n,r;if(It(e)===e&&!o&&t!=RegExp){if(n=lt.get(e),n)return n;if(n=++Fa+"~",lt.set(e,n),t==Array){for(n="@",r=0;r<e.length;r++)n+=Ie(e[r])+",";lt.set(e,n)}if(t==It){n="#";const s=It.keys(e).sort();for(;!U(r=s.pop());)U(e[r])||(n+=r+":"+Ie(e[r])+",");lt.set(e,n)}}else n=o?e.toJSON():a=="symbol"?e.toString():a=="string"?JSON.stringify(e):""+e;return n};let Mt=!0;const La=()=>Mt,[Wt,Ht]=ct&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ye,ye],Pa=()=>{const e=Vt&&document.visibilityState;return U(e)||e!=="hidden"},ka=e=>(Vt&&document.addEventListener("visibilitychange",e),Wt("focus",e),()=>{Vt&&document.removeEventListener("visibilitychange",e),Ht("focus",e)}),Ua=e=>{const a=()=>{Mt=!0,e()},t=()=>{Mt=!1};return Wt("online",a),Wt("offline",t),()=>{Ht("online",a),Ht("offline",t)}},Na={isOnline:La,isVisible:Pa},ja={initFocus:ka,initReconnect:Ua},Qn=!Ce.default.useId,Be=!ct||"Deno"in window,Ia=e=>Aa()?window.requestAnimationFrame(e):setTimeout(e,1),Jt=Be?h.useEffect:h.useLayoutEffect,Gt=typeof navigator<"u"&&navigator.connection,Zn=!Be&&Gt&&(["slow-2g","2g"].includes(Gt.effectiveType)||Gt.saveData),Yt=e=>{if(le(e))try{e=e()}catch{e=""}const a=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Ie(e):"",[e,a]};let Ba=0;const qt=()=>++Ba,$n=0,er=1,tr=2;var zt={__proto__:null,FOCUS_EVENT:$n,RECONNECT_EVENT:er,MUTATE_EVENT:tr};async function nr(...e){const[a,t,o,n]=e,r=_e({populateCache:!0,throwOnError:!0},typeof n=="boolean"?{revalidate:n}:n||{});let s=r.populateCache;const c=r.rollbackOnError;let d=r.optimisticData;const u=r.revalidate!==!1,f=v=>typeof c=="function"?c(v):c!==!1,l=r.throwOnError;if(le(t)){const v=t,w=[],b=a.keys();for(let x=b.next();!x.done;x=b.next()){const D=x.value;!D.startsWith("$inf$")&&v(a.get(D)._k)&&w.push(D)}return Promise.all(w.map(y))}return y(t);async function y(v){const[w]=Yt(v);if(!w)return;const[b,x]=Xn(a,w),[D,g,O]=ce.get(a),_=D[w],B=()=>u&&(delete O[w],_&&_[0])?_[0](tr).then(()=>b().data):b().data;if(e.length<3)return B();let E=o,P;const J=qt();g[w]=[J,0];const N=!U(d),I=b(),q=I.data,Q=I._c,W=U(Q)?q:Q;if(N&&(d=le(d)?d(W):d,x({data:d,_c:W})),le(E))try{E=E(W)}catch(X){P=X}if(E&&le(E.then))if(E=await E.catch(X=>{P=X}),J!==g[w][0]){if(P)throw P;return E}else P&&N&&f(P)&&(s=!0,E=W,x({data:E,_c:ae}));s&&(P||(le(s)&&(E=s(E,W)),x({data:E,_c:ae}))),g[w][1]=qt();const K=await B();if(x({_c:ae}),P){if(l)throw P;return}return s?K:E}}const rr=(e,a)=>{for(const t in e)e[t][0]&&e[t][0](a)},Va=(e,a)=>{if(!ce.has(e)){const t=_e(ja,a),o={},n=nr.bind(ae,e);let r=ye;const s={},c=(f,l)=>{const y=s[f]||[];return s[f]=y,y.push(l),()=>y.splice(y.indexOf(l),1)},d=(f,l,y)=>{e.set(f,l);const v=s[f];if(v)for(let w=v.length;w--;)v[w](y,l)},u=()=>{if(!ce.has(e)&&(ce.set(e,[o,{},{},{},n,d,c]),!Be)){const f=t.initFocus(setTimeout.bind(ae,rr.bind(ae,o,$n))),l=t.initReconnect(setTimeout.bind(ae,rr.bind(ae,o,er)));r=()=>{f&&f(),l&&l(),ce.delete(e)}}};return u(),[e,n,u,r]}return[e,ce.get(e)[4]]},Ma=(e,a,t,o,n)=>{const r=t.errorRetryCount,s=n.retryCount,c=~~((Math.random()+.5)*(1<<(s<8?s:8)))*t.errorRetryInterval;!U(r)&&s>r||setTimeout(o,c,n)},Wa=(e,a)=>Ie(e)==Ie(a),[ar,Ha]=Va(new Map),Ja=_e({onLoadingSlow:ye,onSuccess:ye,onError:ye,onErrorRetry:Ma,onDiscarded:ye,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Zn?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Zn?5e3:3e3,compare:Wa,isPaused:()=>!1,cache:ar,mutate:Ha,fallback:{}},Na),Ga=(e,a)=>{const t=_e(e,a);if(a){const{use:o,fallback:n}=e,{use:r,fallback:s}=a;o&&r&&(t.use=o.concat(r)),n&&s&&(t.fallback=_e(n,s))}return t},Ya=h.createContext({}),or=ct&&window.__SWR_DEVTOOLS_USE__,qa=or?window.__SWR_DEVTOOLS_USE__:[],za=()=>{or&&(window.__SWR_DEVTOOLS_REACT__=Ce.default)},Ka=e=>le(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Xa=()=>_e(Ja,h.useContext(Ya)),Qa=e=>(a,t,o)=>e(a,t&&((...r)=>{const s=Yt(a)[0],[,,,c]=ce.get(ar),d=c[s];return d?(delete c[s],d):t(...r)}),o),Za=qa.concat(Qa),$a=e=>function(...t){const o=Xa(),[n,r,s]=Ka(t),c=Ga(o,s);let d=e;const{use:u}=c,f=(u||[]).concat(Za);for(let l=f.length;l--;)d=f[l](d);return d(n,r||c.fetcher||null,c)},eo=(e,a,t)=>{const o=a[e]||(a[e]=[]);return o.push(t),()=>{const n=o.indexOf(t);n>=0&&(o[n]=o[o.length-1],o.pop())}};za();const Kt={dedupe:!0};var Ve=$a((e,a,t)=>{const{cache:o,compare:n,suspense:r,fallbackData:s,revalidateOnMount:c,refreshInterval:d,refreshWhenHidden:u,refreshWhenOffline:f,keepPreviousData:l}=t,[y,v,w]=ce.get(o),[b,x]=Yt(e),D=h.useRef(!1),g=h.useRef(!1),O=h.useRef(b),_=h.useRef(a),B=h.useRef(t),E=()=>B.current,P=()=>E().isVisible()&&E().isOnline(),[J,N,I]=Xn(o,b),q=h.useRef({}).current,Q=U(s)?t.fallback[b]:s,W=(F,V)=>{let k=!0;for(const G in q){const Y=G;n(V[Y],F[Y])||Y==="data"&&U(F[Y])&&n(V[Y],Ae)||(k=!1)}return k},K=h.useMemo(()=>{const F=(()=>!b||!a?!1:U(c)?!(E().isPaused()||r):c)(),V=()=>{const G=J(),Y=_e(G);return delete Y._k,F?{isValidating:!0,isLoading:!0,...Y}:Y};let k=V();return()=>{const G=V();return W(G,k)?k:k=G}},[o,b]),X=Yn.exports.useSyncExternalStore(h.useCallback(F=>I(b,(V,k)=>{W(V,k)||F()}),[o,b]),K,K),He=!D.current,fe=X.data,ie=U(fe)?Q:fe,De=X.error,Je=h.useRef(ie),Ae=l?U(fe)?Je.current:fe:ie,Ge=(()=>He&&!U(c)?c:E().isPaused()?!1:r?U(ie)?!1:t.revalidateIfStale:U(ie)||t.revalidateIfStale)(),Ye=!!(b&&a&&He&&Ge),Xt=U(X.isValidating)?Ye:X.isValidating,Qt=U(X.isLoading)?Ye:X.isLoading,de=h.useCallback(async F=>{const V=_.current;if(!b||!V||g.current||E().isPaused())return!1;let k,G,Y=!0;const Se=F||{},be=!w[b]||!Se.dedupe,ue=()=>Qn?!g.current&&b===O.current&&D.current:b===O.current,pe={isValidating:!1,isLoading:!1},ze=()=>{N(pe)},Ke=()=>{const te=w[b];te&&te[1]===G&&delete w[b]},ge={isValidating:!0};U(J().data)&&(ge.isLoading=!0);try{if(be&&(N(ge),t.loadingTimeout&&U(J().data)&&setTimeout(()=>{Y&&ue()&&E().onLoadingSlow(b,t)},t.loadingTimeout),w[b]=[V(x),qt()]),[k,G]=w[b],k=await k,be&&setTimeout(Ke,t.dedupingInterval),!w[b]||w[b][1]!==G)return be&&ue()&&E().onDiscarded(b),!1;pe.error=ae;const te=v[b];if(!U(te)&&(G<=te[0]||G<=te[1]||te[1]===0))return ze(),be&&ue()&&E().onDiscarded(b),!1;const oe=J().data;pe.data=n(oe,k)?oe:k,be&&ue()&&E().onSuccess(k,b,t)}catch(te){Ke();const oe=E(),{shouldRetryOnError:Re}=oe;oe.isPaused()||(pe.error=te,be&&ue()&&(oe.onError(te,b,oe),(Re===!0||le(Re)&&Re(te))&&P()&&oe.onErrorRetry(te,b,oe,de,{retryCount:(Se.retryCount||0)+1,dedupe:!0})))}return Y=!1,ze(),!0},[b,o]),qe=h.useCallback((...F)=>nr(o,O.current,...F),[]);if(Jt(()=>{_.current=a,B.current=t,U(fe)||(Je.current=fe)}),Jt(()=>{if(!b)return;const F=de.bind(ae,Kt);let V=0;const G=eo(b,y,Y=>{if(Y==zt.FOCUS_EVENT){const Se=Date.now();E().revalidateOnFocus&&Se>V&&P()&&(V=Se+E().focusThrottleInterval,F())}else if(Y==zt.RECONNECT_EVENT)E().revalidateOnReconnect&&P()&&F();else if(Y==zt.MUTATE_EVENT)return de()});return g.current=!1,O.current=b,D.current=!0,N({_k:x}),Ge&&(U(ie)||Be?F():Ia(F)),()=>{g.current=!0,G()}},[b]),Jt(()=>{let F;function V(){const G=le(d)?d(ie):d;G&&F!==-1&&(F=setTimeout(k,G))}function k(){!J().error&&(u||E().isVisible())&&(f||E().isOnline())?de(Kt).then(V):V()}return V(),()=>{F&&(clearTimeout(F),F=-1)}},[d,u,f,b]),h.useDebugValue(Ae),r&&U(ie)&&b)throw!Qn&&Be?new Error("Fallback data is required when using suspense in SSR."):(_.current=a,B.current=t,g.current=!1,U(De)?de(Kt):De);return{mutate:qe,get data(){return q.data=!0,Ae},get error(){return q.error=!0,De},get isValidating(){return q.isValidating=!0,Xt},get isLoading(){return q.isLoading=!0,Qt}}}),sr={exports:{}},Me={};/**
18
+ */var zn;function Da(){return zn||(zn=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 e=Ce.default,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function t(O){{for(var _=arguments.length,B=new Array(_>1?_-1:0),E=1;E<_;E++)B[E-1]=arguments[E];o("error",O,B)}}function o(O,_,B){{var E=a.ReactDebugCurrentFrame,k=E.getStackAddendum();k!==""&&(_+="%s",B=B.concat([k]));var J=B.map(function(N){return String(N)});J.unshift("Warning: "+_),Function.prototype.apply.call(console[O],console,J)}}function n(O,_){return O===_&&(O!==0||1/O===1/_)||O!==O&&_!==_}var r=typeof Object.is=="function"?Object.is:n,s=e.useState,c=e.useEffect,d=e.useLayoutEffect,u=e.useDebugValue,f=!1,l=!1;function y(O,_,B){f||e.startTransition!==void 0&&(f=!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 E=_();if(!l){var k=_();r(E,k)||(t("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var J=s({inst:{value:E,getSnapshot:_}}),N=J[0].inst,I=J[1];return d(function(){N.value=E,N.getSnapshot=_,v(N)&&I({inst:N})},[O,E,_]),c(function(){v(N)&&I({inst:N});var q=function(){v(N)&&I({inst:N})};return O(q)},[O]),u(E),E}function v(O){var _=O.getSnapshot,B=O.value;try{var E=_();return!r(B,E)}catch{return!0}}function w(O,_,B){return _()}var b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",T=!b,D=T?w:y,g=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:D;jt.useSyncExternalStore=g,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),jt}(function(e){process.env.NODE_ENV==="production"?e.exports=Oa():e.exports=Da()})(Yn);const ce=new WeakMap,Kn={},ye=()=>{},ae=ye(),It=Object,U=e=>e===ae,le=e=>typeof e=="function",_e=(e,a)=>({...e,...a}),Bt="undefined",ct=typeof window!=Bt,Vt=typeof document!=Bt,Aa=()=>ct&&typeof window.requestAnimationFrame!=Bt,Xn=(e,a)=>{const t=ce.get(e);return[()=>e.get(a)||Kn,o=>{const n=e.get(a);t[5](a,_e(n,o),n||Kn)},t[6]]},lt=new WeakMap;let Fa=0;const Ie=e=>{const a=typeof e,t=e&&e.constructor,o=t==Date;let n,r;if(It(e)===e&&!o&&t!=RegExp){if(n=lt.get(e),n)return n;if(n=++Fa+"~",lt.set(e,n),t==Array){for(n="@",r=0;r<e.length;r++)n+=Ie(e[r])+",";lt.set(e,n)}if(t==It){n="#";const s=It.keys(e).sort();for(;!U(r=s.pop());)U(e[r])||(n+=r+":"+Ie(e[r])+",");lt.set(e,n)}}else n=o?e.toJSON():a=="symbol"?e.toString():a=="string"?JSON.stringify(e):""+e;return n};let Mt=!0;const La=()=>Mt,[Wt,Ht]=ct&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ye,ye],ka=()=>{const e=Vt&&document.visibilityState;return U(e)||e!=="hidden"},Pa=e=>(Vt&&document.addEventListener("visibilitychange",e),Wt("focus",e),()=>{Vt&&document.removeEventListener("visibilitychange",e),Ht("focus",e)}),Ua=e=>{const a=()=>{Mt=!0,e()},t=()=>{Mt=!1};return Wt("online",a),Wt("offline",t),()=>{Ht("online",a),Ht("offline",t)}},Na={isOnline:La,isVisible:ka},ja={initFocus:Pa,initReconnect:Ua},Qn=!Ce.default.useId,Be=!ct||"Deno"in window,Ia=e=>Aa()?window.requestAnimationFrame(e):setTimeout(e,1),Jt=Be?h.useEffect:h.useLayoutEffect,Gt=typeof navigator<"u"&&navigator.connection,Zn=!Be&&Gt&&(["slow-2g","2g"].includes(Gt.effectiveType)||Gt.saveData),Yt=e=>{if(le(e))try{e=e()}catch{e=""}const a=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Ie(e):"",[e,a]};let Ba=0;const qt=()=>++Ba,$n=0,er=1,tr=2;var zt={__proto__:null,FOCUS_EVENT:$n,RECONNECT_EVENT:er,MUTATE_EVENT:tr};async function nr(...e){const[a,t,o,n]=e,r=_e({populateCache:!0,throwOnError:!0},typeof n=="boolean"?{revalidate:n}:n||{});let s=r.populateCache;const c=r.rollbackOnError;let d=r.optimisticData;const u=r.revalidate!==!1,f=v=>typeof c=="function"?c(v):c!==!1,l=r.throwOnError;if(le(t)){const v=t,w=[],b=a.keys();for(let T=b.next();!T.done;T=b.next()){const D=T.value;!D.startsWith("$inf$")&&v(a.get(D)._k)&&w.push(D)}return Promise.all(w.map(y))}return y(t);async function y(v){const[w]=Yt(v);if(!w)return;const[b,T]=Xn(a,w),[D,g,O]=ce.get(a),_=D[w],B=()=>u&&(delete O[w],_&&_[0])?_[0](tr).then(()=>b().data):b().data;if(e.length<3)return B();let E=o,k;const J=qt();g[w]=[J,0];const N=!U(d),I=b(),q=I.data,Q=I._c,W=U(Q)?q:Q;if(N&&(d=le(d)?d(W):d,T({data:d,_c:W})),le(E))try{E=E(W)}catch(X){k=X}if(E&&le(E.then))if(E=await E.catch(X=>{k=X}),J!==g[w][0]){if(k)throw k;return E}else k&&N&&f(k)&&(s=!0,E=W,T({data:E,_c:ae}));s&&(k||(le(s)&&(E=s(E,W)),T({data:E,_c:ae}))),g[w][1]=qt();const K=await B();if(T({_c:ae}),k){if(l)throw k;return}return s?K:E}}const rr=(e,a)=>{for(const t in e)e[t][0]&&e[t][0](a)},Va=(e,a)=>{if(!ce.has(e)){const t=_e(ja,a),o={},n=nr.bind(ae,e);let r=ye;const s={},c=(f,l)=>{const y=s[f]||[];return s[f]=y,y.push(l),()=>y.splice(y.indexOf(l),1)},d=(f,l,y)=>{e.set(f,l);const v=s[f];if(v)for(let w=v.length;w--;)v[w](y,l)},u=()=>{if(!ce.has(e)&&(ce.set(e,[o,{},{},{},n,d,c]),!Be)){const f=t.initFocus(setTimeout.bind(ae,rr.bind(ae,o,$n))),l=t.initReconnect(setTimeout.bind(ae,rr.bind(ae,o,er)));r=()=>{f&&f(),l&&l(),ce.delete(e)}}};return u(),[e,n,u,r]}return[e,ce.get(e)[4]]},Ma=(e,a,t,o,n)=>{const r=t.errorRetryCount,s=n.retryCount,c=~~((Math.random()+.5)*(1<<(s<8?s:8)))*t.errorRetryInterval;!U(r)&&s>r||setTimeout(o,c,n)},Wa=(e,a)=>Ie(e)==Ie(a),[ar,Ha]=Va(new Map),Ja=_e({onLoadingSlow:ye,onSuccess:ye,onError:ye,onErrorRetry:Ma,onDiscarded:ye,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Zn?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Zn?5e3:3e3,compare:Wa,isPaused:()=>!1,cache:ar,mutate:Ha,fallback:{}},Na),Ga=(e,a)=>{const t=_e(e,a);if(a){const{use:o,fallback:n}=e,{use:r,fallback:s}=a;o&&r&&(t.use=o.concat(r)),n&&s&&(t.fallback=_e(n,s))}return t},Ya=h.createContext({}),or=ct&&window.__SWR_DEVTOOLS_USE__,qa=or?window.__SWR_DEVTOOLS_USE__:[],za=()=>{or&&(window.__SWR_DEVTOOLS_REACT__=Ce.default)},Ka=e=>le(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Xa=()=>_e(Ja,h.useContext(Ya)),Qa=e=>(a,t,o)=>e(a,t&&((...r)=>{const s=Yt(a)[0],[,,,c]=ce.get(ar),d=c[s];return d?(delete c[s],d):t(...r)}),o),Za=qa.concat(Qa),$a=e=>function(...t){const o=Xa(),[n,r,s]=Ka(t),c=Ga(o,s);let d=e;const{use:u}=c,f=(u||[]).concat(Za);for(let l=f.length;l--;)d=f[l](d);return d(n,r||c.fetcher||null,c)},eo=(e,a,t)=>{const o=a[e]||(a[e]=[]);return o.push(t),()=>{const n=o.indexOf(t);n>=0&&(o[n]=o[o.length-1],o.pop())}};za();const Kt={dedupe:!0};var Ve=$a((e,a,t)=>{const{cache:o,compare:n,suspense:r,fallbackData:s,revalidateOnMount:c,refreshInterval:d,refreshWhenHidden:u,refreshWhenOffline:f,keepPreviousData:l}=t,[y,v,w]=ce.get(o),[b,T]=Yt(e),D=h.useRef(!1),g=h.useRef(!1),O=h.useRef(b),_=h.useRef(a),B=h.useRef(t),E=()=>B.current,k=()=>E().isVisible()&&E().isOnline(),[J,N,I]=Xn(o,b),q=h.useRef({}).current,Q=U(s)?t.fallback[b]:s,W=(F,V)=>{let P=!0;for(const G in q){const Y=G;n(V[Y],F[Y])||Y==="data"&&U(F[Y])&&n(V[Y],Ae)||(P=!1)}return P},K=h.useMemo(()=>{const F=(()=>!b||!a?!1:U(c)?!(E().isPaused()||r):c)(),V=()=>{const G=J(),Y=_e(G);return delete Y._k,F?{isValidating:!0,isLoading:!0,...Y}:Y};let P=V();return()=>{const G=V();return W(G,P)?P:P=G}},[o,b]),X=Yn.exports.useSyncExternalStore(h.useCallback(F=>I(b,(V,P)=>{W(V,P)||F()}),[o,b]),K,K),He=!D.current,fe=X.data,ie=U(fe)?Q:fe,De=X.error,Je=h.useRef(ie),Ae=l?U(fe)?Je.current:fe:ie,Ge=(()=>He&&!U(c)?c:E().isPaused()?!1:r?U(ie)?!1:t.revalidateIfStale:U(ie)||t.revalidateIfStale)(),Ye=!!(b&&a&&He&&Ge),Xt=U(X.isValidating)?Ye:X.isValidating,Qt=U(X.isLoading)?Ye:X.isLoading,de=h.useCallback(async F=>{const V=_.current;if(!b||!V||g.current||E().isPaused())return!1;let P,G,Y=!0;const Se=F||{},be=!w[b]||!Se.dedupe,ue=()=>Qn?!g.current&&b===O.current&&D.current:b===O.current,pe={isValidating:!1,isLoading:!1},ze=()=>{N(pe)},Ke=()=>{const te=w[b];te&&te[1]===G&&delete w[b]},ge={isValidating:!0};U(J().data)&&(ge.isLoading=!0);try{if(be&&(N(ge),t.loadingTimeout&&U(J().data)&&setTimeout(()=>{Y&&ue()&&E().onLoadingSlow(b,t)},t.loadingTimeout),w[b]=[V(T),qt()]),[P,G]=w[b],P=await P,be&&setTimeout(Ke,t.dedupingInterval),!w[b]||w[b][1]!==G)return be&&ue()&&E().onDiscarded(b),!1;pe.error=ae;const te=v[b];if(!U(te)&&(G<=te[0]||G<=te[1]||te[1]===0))return ze(),be&&ue()&&E().onDiscarded(b),!1;const oe=J().data;pe.data=n(oe,P)?oe:P,be&&ue()&&E().onSuccess(P,b,t)}catch(te){Ke();const oe=E(),{shouldRetryOnError:Re}=oe;oe.isPaused()||(pe.error=te,be&&ue()&&(oe.onError(te,b,oe),(Re===!0||le(Re)&&Re(te))&&k()&&oe.onErrorRetry(te,b,oe,de,{retryCount:(Se.retryCount||0)+1,dedupe:!0})))}return Y=!1,ze(),!0},[b,o]),qe=h.useCallback((...F)=>nr(o,O.current,...F),[]);if(Jt(()=>{_.current=a,B.current=t,U(fe)||(Je.current=fe)}),Jt(()=>{if(!b)return;const F=de.bind(ae,Kt);let V=0;const G=eo(b,y,Y=>{if(Y==zt.FOCUS_EVENT){const Se=Date.now();E().revalidateOnFocus&&Se>V&&k()&&(V=Se+E().focusThrottleInterval,F())}else if(Y==zt.RECONNECT_EVENT)E().revalidateOnReconnect&&k()&&F();else if(Y==zt.MUTATE_EVENT)return de()});return g.current=!1,O.current=b,D.current=!0,N({_k:T}),Ge&&(U(ie)||Be?F():Ia(F)),()=>{g.current=!0,G()}},[b]),Jt(()=>{let F;function V(){const G=le(d)?d(ie):d;G&&F!==-1&&(F=setTimeout(P,G))}function P(){!J().error&&(u||E().isVisible())&&(f||E().isOnline())?de(Kt).then(V):V()}return V(),()=>{F&&(clearTimeout(F),F=-1)}},[d,u,f,b]),h.useDebugValue(Ae),r&&U(ie)&&b)throw!Qn&&Be?new Error("Fallback data is required when using suspense in SSR."):(_.current=a,B.current=t,g.current=!1,U(De)?de(Kt):De);return{mutate:qe,get data(){return q.data=!0,Ae},get error(){return q.error=!0,De},get isValidating(){return q.isValidating=!0,Xt},get isLoading(){return q.isLoading=!0,Qt}}}),sr={exports:{}},Me={};/**
19
19
  * @license React
20
20
  * react-jsx-runtime.production.min.js
21
21
  *
@@ -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 ur;function no(){return ur||(ur=1,process.env.NODE_ENV!=="production"&&function(){var e=Ce.default,a=Symbol.for("react.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),w=Symbol.iterator,b="@@iterator";function x(i){if(i===null||typeof i!="object")return null;var p=w&&i[w]||i[b];return typeof p=="function"?p:null}var D=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(i){{for(var p=arguments.length,m=new Array(p>1?p-1:0),S=1;S<p;S++)m[S-1]=arguments[S];O("error",i,m)}}function O(i,p,m){{var S=D.ReactDebugCurrentFrame,T=S.getStackAddendum();T!==""&&(p+="%s",m=m.concat([T]));var A=m.map(function(C){return String(C)});A.unshift("Warning: "+p),Function.prototype.apply.call(console[i],console,A)}}var _=!1,B=!1,E=!1,P=!1,J=!1,N;N=Symbol.for("react.module.reference");function I(i){return!!(typeof i=="string"||typeof i=="function"||i===o||i===r||J||i===n||i===u||i===f||P||i===v||_||B||E||typeof i=="object"&&i!==null&&(i.$$typeof===y||i.$$typeof===l||i.$$typeof===s||i.$$typeof===c||i.$$typeof===d||i.$$typeof===N||i.getModuleId!==void 0))}function q(i,p,m){var S=i.displayName;if(S)return S;var T=p.displayName||p.name||"";return T!==""?m+"("+T+")":m}function Q(i){return i.displayName||"Context"}function W(i){if(i==null)return null;if(typeof i.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case o:return"Fragment";case t:return"Portal";case r:return"Profiler";case n:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case c:var p=i;return Q(p)+".Consumer";case s:var m=i;return Q(m._context)+".Provider";case d:return q(i,i.render,"ForwardRef");case l:var S=i.displayName||null;return S!==null?S:W(i.type)||"Memo";case y:{var T=i,A=T._payload,C=T._init;try{return W(C(A))}catch{return null}}}return null}var K=Object.assign,X=0,He,fe,ie,De,Je,Ae,Ge;function Ye(){}Ye.__reactDisabledLog=!0;function Xt(){{if(X===0){He=console.log,fe=console.info,ie=console.warn,De=console.error,Je=console.group,Ae=console.groupCollapsed,Ge=console.groupEnd;var i={configurable:!0,enumerable:!0,value:Ye,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}X++}}function Qt(){{if(X--,X===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},i,{value:He}),info:K({},i,{value:fe}),warn:K({},i,{value:ie}),error:K({},i,{value:De}),group:K({},i,{value:Je}),groupCollapsed:K({},i,{value:Ae}),groupEnd:K({},i,{value:Ge})})}X<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=D.ReactCurrentDispatcher,qe;function F(i,p,m){{if(qe===void 0)try{throw Error()}catch(T){var S=T.stack.trim().match(/\n( *(at )?)/);qe=S&&S[1]||""}return`
35
- `+qe+i}}var V=!1,k;{var G=typeof WeakMap=="function"?WeakMap:Map;k=new G}function Y(i,p){if(!i||V)return"";{var m=k.get(i);if(m!==void 0)return m}var S;V=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var A;A=de.current,de.current=null,Xt();try{if(p){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(he){S=he}Reflect.construct(i,[],C)}else{try{C.call()}catch(he){S=he}i.call(C.prototype)}}else{try{throw Error()}catch(he){S=he}i()}}catch(he){if(he&&S&&typeof he.stack=="string"){for(var R=he.stack.split(`
34
+ */var ur;function no(){return ur||(ur=1,process.env.NODE_ENV!=="production"&&function(){var e=Ce.default,a=Symbol.for("react.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),w=Symbol.iterator,b="@@iterator";function T(i){if(i===null||typeof i!="object")return null;var p=w&&i[w]||i[b];return typeof p=="function"?p:null}var D=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(i){{for(var p=arguments.length,m=new Array(p>1?p-1:0),S=1;S<p;S++)m[S-1]=arguments[S];O("error",i,m)}}function O(i,p,m){{var S=D.ReactDebugCurrentFrame,x=S.getStackAddendum();x!==""&&(p+="%s",m=m.concat([x]));var A=m.map(function(C){return String(C)});A.unshift("Warning: "+p),Function.prototype.apply.call(console[i],console,A)}}var _=!1,B=!1,E=!1,k=!1,J=!1,N;N=Symbol.for("react.module.reference");function I(i){return!!(typeof i=="string"||typeof i=="function"||i===o||i===r||J||i===n||i===u||i===f||k||i===v||_||B||E||typeof i=="object"&&i!==null&&(i.$$typeof===y||i.$$typeof===l||i.$$typeof===s||i.$$typeof===c||i.$$typeof===d||i.$$typeof===N||i.getModuleId!==void 0))}function q(i,p,m){var S=i.displayName;if(S)return S;var x=p.displayName||p.name||"";return x!==""?m+"("+x+")":m}function Q(i){return i.displayName||"Context"}function W(i){if(i==null)return null;if(typeof i.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case o:return"Fragment";case t:return"Portal";case r:return"Profiler";case n:return"StrictMode";case u:return"Suspense";case f:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case c:var p=i;return Q(p)+".Consumer";case s:var m=i;return Q(m._context)+".Provider";case d:return q(i,i.render,"ForwardRef");case l:var S=i.displayName||null;return S!==null?S:W(i.type)||"Memo";case y:{var x=i,A=x._payload,C=x._init;try{return W(C(A))}catch{return null}}}return null}var K=Object.assign,X=0,He,fe,ie,De,Je,Ae,Ge;function Ye(){}Ye.__reactDisabledLog=!0;function Xt(){{if(X===0){He=console.log,fe=console.info,ie=console.warn,De=console.error,Je=console.group,Ae=console.groupCollapsed,Ge=console.groupEnd;var i={configurable:!0,enumerable:!0,value:Ye,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}X++}}function Qt(){{if(X--,X===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},i,{value:He}),info:K({},i,{value:fe}),warn:K({},i,{value:ie}),error:K({},i,{value:De}),group:K({},i,{value:Je}),groupCollapsed:K({},i,{value:Ae}),groupEnd:K({},i,{value:Ge})})}X<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=D.ReactCurrentDispatcher,qe;function F(i,p,m){{if(qe===void 0)try{throw Error()}catch(x){var S=x.stack.trim().match(/\n( *(at )?)/);qe=S&&S[1]||""}return`
35
+ `+qe+i}}var V=!1,P;{var G=typeof WeakMap=="function"?WeakMap:Map;P=new G}function Y(i,p){if(!i||V)return"";{var m=P.get(i);if(m!==void 0)return m}var S;V=!0;var x=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var A;A=de.current,de.current=null,Xt();try{if(p){var C=function(){throw Error()};if(Object.defineProperty(C.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(C,[])}catch(he){S=he}Reflect.construct(i,[],C)}else{try{C.call()}catch(he){S=he}i.call(C.prototype)}}else{try{throw Error()}catch(he){S=he}i()}}catch(he){if(he&&S&&typeof he.stack=="string"){for(var R=he.stack.split(`
36
36
  `),Z=S.stack.split(`
37
37
  `),M=R.length-1,H=Z.length-1;M>=1&&H>=0&&R[M]!==Z[H];)H--;for(;M>=1&&H>=0;M--,H--)if(R[M]!==Z[H]){if(M!==1||H!==1)do if(M--,H--,H<0||R[M]!==Z[H]){var re=`
38
- `+R[M].replace(" at new "," at ");return i.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",i.displayName)),typeof i=="function"&&k.set(i,re),re}while(M>=1&&H>=0);break}}}finally{V=!1,de.current=A,Qt(),Error.prepareStackTrace=T}var Le=i?i.displayName||i.name:"",Sr=Le?F(Le):"";return typeof i=="function"&&k.set(i,Sr),Sr}function Se(i,p,m){return Y(i,!1)}function be(i){var p=i.prototype;return!!(p&&p.isReactComponent)}function ue(i,p,m){if(i==null)return"";if(typeof i=="function")return Y(i,be(i));if(typeof i=="string")return F(i);switch(i){case u:return F("Suspense");case f:return F("SuspenseList")}if(typeof i=="object")switch(i.$$typeof){case d:return Se(i.render);case l:return ue(i.type,p,m);case y:{var S=i,T=S._payload,A=S._init;try{return ue(A(T),p,m)}catch{}}}return""}var pe=Object.prototype.hasOwnProperty,ze={},Ke=D.ReactDebugCurrentFrame;function ge(i){if(i){var p=i._owner,m=ue(i.type,i._source,p?p.type:null);Ke.setExtraStackFrame(m)}else Ke.setExtraStackFrame(null)}function te(i,p,m,S,T){{var A=Function.call.bind(pe);for(var C in i)if(A(i,C)){var R=void 0;try{if(typeof i[C]!="function"){var Z=Error((S||"React class")+": "+m+" type `"+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[C]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Z.name="Invariant Violation",Z}R=i[C](p,C,S,m,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(M){R=M}R&&!(R instanceof Error)&&(ge(T),g("%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).",S||"React class",m,C,typeof R),ge(null)),R instanceof Error&&!(R.message in ze)&&(ze[R.message]=!0,ge(T),g("Failed %s type: %s",m,R.message),ge(null))}}}var oe=Array.isArray;function Re(i){return oe(i)}function bo(i){{var p=typeof Symbol=="function"&&Symbol.toStringTag,m=p&&i[Symbol.toStringTag]||i.constructor.name||"Object";return m}}function wo(i){try{return dr(i),!1}catch{return!0}}function dr(i){return""+i}function pr(i){if(wo(i))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",bo(i)),dr(i)}var Xe=D.ReactCurrentOwner,Eo={key:!0,ref:!0,__self:!0,__source:!0},hr,vr,Zt;Zt={};function So(i){if(pe.call(i,"ref")){var p=Object.getOwnPropertyDescriptor(i,"ref").get;if(p&&p.isReactWarning)return!1}return i.ref!==void 0}function go(i){if(pe.call(i,"key")){var p=Object.getOwnPropertyDescriptor(i,"key").get;if(p&&p.isReactWarning)return!1}return i.key!==void 0}function Ro(i,p){if(typeof i.ref=="string"&&Xe.current&&p&&Xe.current.stateNode!==p){var m=W(Xe.current.type);Zt[m]||(g('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',W(Xe.current.type),i.ref),Zt[m]=!0)}}function Co(i,p){{var m=function(){hr||(hr=!0,g("%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(i,"key",{get:m,configurable:!0})}}function xo(i,p){{var m=function(){vr||(vr=!0,g("%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(i,"ref",{get:m,configurable:!0})}}var To=function(i,p,m,S,T,A,C){var R={$$typeof:a,type:i,key:p,ref:m,props:C,_owner:A};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:T}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function Oo(i,p,m,S,T){{var A,C={},R=null,Z=null;m!==void 0&&(pr(m),R=""+m),go(p)&&(pr(p.key),R=""+p.key),So(p)&&(Z=p.ref,Ro(p,T));for(A in p)pe.call(p,A)&&!Eo.hasOwnProperty(A)&&(C[A]=p[A]);if(i&&i.defaultProps){var M=i.defaultProps;for(A in M)C[A]===void 0&&(C[A]=M[A])}if(R||Z){var H=typeof i=="function"?i.displayName||i.name||"Unknown":i;R&&Co(C,H),Z&&xo(C,H)}return To(i,R,Z,T,S,Xe.current,C)}}var $t=D.ReactCurrentOwner,mr=D.ReactDebugCurrentFrame;function Fe(i){if(i){var p=i._owner,m=ue(i.type,i._source,p?p.type:null);mr.setExtraStackFrame(m)}else mr.setExtraStackFrame(null)}var en;en=!1;function tn(i){return typeof i=="object"&&i!==null&&i.$$typeof===a}function yr(){{if($t.current){var i=W($t.current.type);if(i)return`
38
+ `+R[M].replace(" at new "," at ");return i.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",i.displayName)),typeof i=="function"&&P.set(i,re),re}while(M>=1&&H>=0);break}}}finally{V=!1,de.current=A,Qt(),Error.prepareStackTrace=x}var Le=i?i.displayName||i.name:"",Sr=Le?F(Le):"";return typeof i=="function"&&P.set(i,Sr),Sr}function Se(i,p,m){return Y(i,!1)}function be(i){var p=i.prototype;return!!(p&&p.isReactComponent)}function ue(i,p,m){if(i==null)return"";if(typeof i=="function")return Y(i,be(i));if(typeof i=="string")return F(i);switch(i){case u:return F("Suspense");case f:return F("SuspenseList")}if(typeof i=="object")switch(i.$$typeof){case d:return Se(i.render);case l:return ue(i.type,p,m);case y:{var S=i,x=S._payload,A=S._init;try{return ue(A(x),p,m)}catch{}}}return""}var pe=Object.prototype.hasOwnProperty,ze={},Ke=D.ReactDebugCurrentFrame;function ge(i){if(i){var p=i._owner,m=ue(i.type,i._source,p?p.type:null);Ke.setExtraStackFrame(m)}else Ke.setExtraStackFrame(null)}function te(i,p,m,S,x){{var A=Function.call.bind(pe);for(var C in i)if(A(i,C)){var R=void 0;try{if(typeof i[C]!="function"){var Z=Error((S||"React class")+": "+m+" type `"+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[C]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Z.name="Invariant Violation",Z}R=i[C](p,C,S,m,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(M){R=M}R&&!(R instanceof Error)&&(ge(x),g("%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).",S||"React class",m,C,typeof R),ge(null)),R instanceof Error&&!(R.message in ze)&&(ze[R.message]=!0,ge(x),g("Failed %s type: %s",m,R.message),ge(null))}}}var oe=Array.isArray;function Re(i){return oe(i)}function bo(i){{var p=typeof Symbol=="function"&&Symbol.toStringTag,m=p&&i[Symbol.toStringTag]||i.constructor.name||"Object";return m}}function wo(i){try{return dr(i),!1}catch{return!0}}function dr(i){return""+i}function pr(i){if(wo(i))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",bo(i)),dr(i)}var Xe=D.ReactCurrentOwner,Eo={key:!0,ref:!0,__self:!0,__source:!0},hr,vr,Zt;Zt={};function So(i){if(pe.call(i,"ref")){var p=Object.getOwnPropertyDescriptor(i,"ref").get;if(p&&p.isReactWarning)return!1}return i.ref!==void 0}function go(i){if(pe.call(i,"key")){var p=Object.getOwnPropertyDescriptor(i,"key").get;if(p&&p.isReactWarning)return!1}return i.key!==void 0}function Ro(i,p){if(typeof i.ref=="string"&&Xe.current&&p&&Xe.current.stateNode!==p){var m=W(Xe.current.type);Zt[m]||(g('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',W(Xe.current.type),i.ref),Zt[m]=!0)}}function Co(i,p){{var m=function(){hr||(hr=!0,g("%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(i,"key",{get:m,configurable:!0})}}function To(i,p){{var m=function(){vr||(vr=!0,g("%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(i,"ref",{get:m,configurable:!0})}}var xo=function(i,p,m,S,x,A,C){var R={$$typeof:a,type:i,key:p,ref:m,props:C,_owner:A};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:x}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function Oo(i,p,m,S,x){{var A,C={},R=null,Z=null;m!==void 0&&(pr(m),R=""+m),go(p)&&(pr(p.key),R=""+p.key),So(p)&&(Z=p.ref,Ro(p,x));for(A in p)pe.call(p,A)&&!Eo.hasOwnProperty(A)&&(C[A]=p[A]);if(i&&i.defaultProps){var M=i.defaultProps;for(A in M)C[A]===void 0&&(C[A]=M[A])}if(R||Z){var H=typeof i=="function"?i.displayName||i.name||"Unknown":i;R&&Co(C,H),Z&&To(C,H)}return xo(i,R,Z,x,S,Xe.current,C)}}var $t=D.ReactCurrentOwner,mr=D.ReactDebugCurrentFrame;function Fe(i){if(i){var p=i._owner,m=ue(i.type,i._source,p?p.type:null);mr.setExtraStackFrame(m)}else mr.setExtraStackFrame(null)}var en;en=!1;function tn(i){return typeof i=="object"&&i!==null&&i.$$typeof===a}function yr(){{if($t.current){var i=W($t.current.type);if(i)return`
39
39
 
40
40
  Check the render method of \``+i+"`."}return""}}function Do(i){{if(i!==void 0){var p=i.fileName.replace(/^.*[\\\/]/,""),m=i.lineNumber;return`
41
41
 
42
42
  Check your code at `+p+":"+m+"."}return""}}var _r={};function Ao(i){{var p=yr();if(!p){var m=typeof i=="string"?i:i.displayName||i.name;m&&(p=`
43
43
 
44
- Check the top-level render call using <`+m+">.")}return p}}function br(i,p){{if(!i._store||i._store.validated||i.key!=null)return;i._store.validated=!0;var m=Ao(p);if(_r[m])return;_r[m]=!0;var S="";i&&i._owner&&i._owner!==$t.current&&(S=" It was passed a child from "+W(i._owner.type)+"."),Fe(i),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,S),Fe(null)}}function wr(i,p){{if(typeof i!="object")return;if(Re(i))for(var m=0;m<i.length;m++){var S=i[m];tn(S)&&br(S,p)}else if(tn(i))i._store&&(i._store.validated=!0);else if(i){var T=x(i);if(typeof T=="function"&&T!==i.entries)for(var A=T.call(i),C;!(C=A.next()).done;)tn(C.value)&&br(C.value,p)}}}function Fo(i){{var p=i.type;if(p==null||typeof p=="string")return;var m;if(typeof p=="function")m=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===d||p.$$typeof===l))m=p.propTypes;else return;if(m){var S=W(p);te(m,i.props,"prop",S,i)}else if(p.PropTypes!==void 0&&!en){en=!0;var T=W(p);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",T||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Lo(i){{for(var p=Object.keys(i.props),m=0;m<p.length;m++){var S=p[m];if(S!=="children"&&S!=="key"){Fe(i),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",S),Fe(null);break}}i.ref!==null&&(Fe(i),g("Invalid attribute `ref` supplied to `React.Fragment`."),Fe(null))}}function Er(i,p,m,S,T,A){{var C=I(i);if(!C){var R="";(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(R+=" 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 Z=Do(T);Z?R+=Z:R+=yr();var M;i===null?M="null":Re(i)?M="array":i!==void 0&&i.$$typeof===a?(M="<"+(W(i.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):M=typeof i,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",M,R)}var H=Oo(i,p,m,T,A);if(H==null)return H;if(C){var re=p.children;if(re!==void 0)if(S)if(Re(re)){for(var Le=0;Le<re.length;Le++)wr(re[Le],i);Object.freeze&&Object.freeze(re)}else g("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 wr(re,i)}return i===o?Lo(H):Fo(H),H}}function Po(i,p,m){return Er(i,p,m,!0)}function ko(i,p,m){return Er(i,p,m,!1)}var Uo=ko,No=Po;We.Fragment=o,We.jsx=Uo,We.jsxs=No}()),We}(function(e){process.env.NODE_ENV==="production"?e.exports=to():e.exports=no()})(sr);const ro=sr.exports.jsx,ee=h.createContext(null),ao=({url:e="",tokenParams:a,children:t})=>{const o=h.useMemo(()=>{const n=new Ta.FrappeApp(e,a);return{url:e,tokenParams:a,app:n,auth:n.auth(),db:n.db(),call:n.call(),file:n.file()}},[e,a]);return ro(ee.Provider,{value:o,children:t})},oo=e=>{const{url:a,auth:t}=h.useContext(ee),[o,n]=h.useState(),r=h.useCallback(()=>{const v=document.cookie.split(";").find(w=>w.trim().startsWith("user_id="));if(v){const w=v.split("=")[1];n(w&&w!=="Guest"?w:null)}else n(null)},[]);h.useEffect(()=>{r()},[]);const{data:s,error:c,isLoading:d,isValidating:u,mutate:f}=Ve(o?`${a}/api/method/frappe.auth.get_logged_user`:null,()=>t.getLoggedInUser(),{onError:()=>{n(null)},shouldRetryOnError:!1,revalidateOnFocus:!1,...e}),l=h.useCallback(async(v,w)=>t.loginWithUsernamePassword({username:v,password:w}).then(b=>{r()}),[]),y=h.useCallback(async()=>t.logout().then(()=>f(null)).then(()=>n(null)),[]);return{isLoading:o===void 0||d,currentUser:s,isValidating:u,error:c,login:l,logout:y,updateCurrentUser:f,getUserCookie:r}},so=(e,a,t,o)=>{const{url:n,db:r}=h.useContext(ee);return{...Ve(t===void 0?`${n}/api/resource/${e}/${a}`:t,()=>r.getDoc(e,a),o)}},cr=e=>{var t,o,n;let a="";if(e!=null&&e.fields&&(a+="fields="+JSON.stringify(e==null?void 0:e.fields)+"&"),e!=null&&e.filters&&(a+="filters="+JSON.stringify(e==null?void 0:e.filters)+"&"),e!=null&&e.orFilters&&(a+="or_filters="+JSON.stringify(e==null?void 0:e.orFilters)+"&"),e!=null&&e.limit_start&&(a+="limit_start="+JSON.stringify(e==null?void 0:e.limit_start)+"&"),e!=null&&e.limit&&(a+="limit="+JSON.stringify(e==null?void 0:e.limit)+"&"),e!=null&&e.groupBy&&(a+="group_by="+e.groupBy+"&"),e!=null&&e.orderBy){const r=`${(t=e.orderBy)==null?void 0:t.field} ${(n=(o=e.orderBy)==null?void 0:o.order)!=null?n:"asc"}`;a+="order_by="+r+"&"}return e!=null&&e.asDict&&(a+="as_dict="+e.asDict),a},io=(e,a,t,o)=>{const{url:n,db:r}=h.useContext(ee);return{...Ve(t===void 0?`${n}/api/resource/${e}?${cr(a)}`:t,()=>r.getDocList(e,a),o)}},uo=()=>{const{db:e}=h.useContext(ee),[a,t]=h.useState(!1),[o,n]=h.useState(null),[r,s]=h.useState(!1),c=h.useCallback(()=>{t(!1),n(null),s(!1)},[]);return{createDoc:h.useCallback(async(u,f)=>(n(null),s(!1),t(!0),e.createDoc(u,f).then(l=>(t(!1),s(!0),l)).catch(l=>{throw t(!1),s(!1),n(l),l})),[]),loading:a,error:o,isCompleted:r,reset:c}},co=()=>{const{db:e}=h.useContext(ee),[a,t]=h.useState(!1),[o,n]=h.useState(null),[r,s]=h.useState(!1),c=h.useCallback(()=>{t(!1),n(null),s(!1)},[]);return{updateDoc:h.useCallback(async(u,f,l)=>(n(null),s(!1),t(!0),e.updateDoc(u,f,l).then(y=>(t(!1),s(!0),y)).catch(y=>{throw t(!1),s(!1),n(y),y})),[]),loading:a,error:o,reset:c,isCompleted:r}},lo=()=>{const{db:e}=h.useContext(ee),[a,t]=h.useState(!1),[o,n]=h.useState(null),[r,s]=h.useState(!1),c=h.useCallback(()=>{t(!1),n(null),s(!1)},[]);return{deleteDoc:h.useCallback(async(u,f)=>(n(null),s(!1),t(!0),e.deleteDoc(u,f).then(l=>(t(!1),s(!0),l)).catch(l=>{throw t(!1),s(!1),n(l),l})),[]),loading:a,error:o,reset:c,isCompleted:r}};function lr(e){const a=[];for(let t in e)a.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return a.join("&")}const fo=(e,a,t=!1,o=!1,n,r)=>{const{url:s,db:c}=h.useContext(ee);return{...Ve(n===void 0?(()=>{const f=lr(t?{doctype:e,filters:a!=null?a:[],cache:t,debug:o}:{doctype:e,filters:a!=null?a:[],debug:o});return`${s}/api/method/frappe.client.get_count?${f}`})():n,()=>c.getCount(e,a,t,o),r)}},fr=(e,a,t,o)=>{const{call:n}=h.useContext(ee),r=lr(a!=null?a:{}),s=`${e}?${r}`;return{...Ve(t===void 0?s:t,()=>n.get(e,a),o)}},po=e=>{const{call:a}=h.useContext(ee),[t,o]=h.useState(null),[n,r]=h.useState(!1),[s,c]=h.useState(null),[d,u]=h.useState(!1),f=h.useCallback(()=>{o(null),r(!1),c(null),u(!1)},[]);return{call:h.useCallback(async y=>(c(null),u(!1),r(!0),o(null),a.post(e,y).then(v=>(o(v),r(!1),u(!0),v)).catch(v=>{throw r(!1),u(!1),c(v),v})),[]),result:t,loading:n,error:s,reset:f,isCompleted:d}},ho=e=>{const{call:a}=h.useContext(ee),[t,o]=h.useState(null),[n,r]=h.useState(!1),[s,c]=h.useState(null),[d,u]=h.useState(!1),f=h.useCallback(()=>{o(null),r(!1),c(null),u(!1)},[]);return{call:h.useCallback(async y=>(c(null),u(!1),r(!0),o(null),a.put(e,y).then(v=>(o(v),r(!1),u(!0),v)).catch(v=>{throw r(!1),u(!1),c(v),v})),[]),result:t,loading:n,error:s,reset:f,isCompleted:d}},vo=e=>{const{call:a}=h.useContext(ee),[t,o]=h.useState(null),[n,r]=h.useState(!1),[s,c]=h.useState(null),[d,u]=h.useState(!1),f=h.useCallback(()=>{o(null),r(!1),c(null),u(!1)},[]);return{call:h.useCallback(async y=>(c(null),u(!1),r(!0),o(null),a.delete(e,y).then(v=>(o(v),r(!1),u(!0),v)).catch(v=>{throw r(!1),u(!1),c(v),v})),[]),result:t,loading:n,error:s,reset:f,isCompleted:d}},mo=()=>{const{file:e}=h.useContext(ee),[a,t]=h.useState(0),[o,n]=h.useState(!1),[r,s]=h.useState(null),[c,d]=h.useState(!1),u=h.useCallback(async(l,y)=>(f(),n(!0),e.uploadFile(l,y,(v,w)=>t(Math.round(v/w*100))).then(v=>(d(!0),t(100),n(!1),v.data.message)).catch(v=>{throw console.error(v),s(v),n(!1),v})),[]),f=h.useCallback(()=>{t(0),n(!1),s(null),d(!1)},[]);return{upload:u,progress:a,loading:o,isCompleted:c,error:r,reset:f}},yo=(e,a,t=[],o=20,n=250)=>{const r=_o(a,n);return fr("frappe.desk.search.search_link",{doctype:e,page_length:o,txt:r,filters:JSON.stringify(t!=null?t:[])})},_o=(e,a)=>{const[t,o]=h.useState(e);return h.useEffect(()=>{const n=setTimeout(()=>{o(e)},a);return()=>{clearTimeout(n)}},[e,a]),t};j.FrappeContext=ee,j.FrappeProvider=ao,j.getDocListQueryString=cr,j.useFrappeAuth=oo,j.useFrappeCreateDoc=uo,j.useFrappeDeleteCall=vo,j.useFrappeDeleteDoc=lo,j.useFrappeFileUpload=mo,j.useFrappeGetCall=fr,j.useFrappeGetDoc=so,j.useFrappeGetDocCount=fo,j.useFrappeGetDocList=io,j.useFrappePostCall=po,j.useFrappePutCall=ho,j.useFrappeUpdateDoc=co,j.useSearch=yo,Object.defineProperties(j,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
44
+ Check the top-level render call using <`+m+">.")}return p}}function br(i,p){{if(!i._store||i._store.validated||i.key!=null)return;i._store.validated=!0;var m=Ao(p);if(_r[m])return;_r[m]=!0;var S="";i&&i._owner&&i._owner!==$t.current&&(S=" It was passed a child from "+W(i._owner.type)+"."),Fe(i),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',m,S),Fe(null)}}function wr(i,p){{if(typeof i!="object")return;if(Re(i))for(var m=0;m<i.length;m++){var S=i[m];tn(S)&&br(S,p)}else if(tn(i))i._store&&(i._store.validated=!0);else if(i){var x=T(i);if(typeof x=="function"&&x!==i.entries)for(var A=x.call(i),C;!(C=A.next()).done;)tn(C.value)&&br(C.value,p)}}}function Fo(i){{var p=i.type;if(p==null||typeof p=="string")return;var m;if(typeof p=="function")m=p.propTypes;else if(typeof p=="object"&&(p.$$typeof===d||p.$$typeof===l))m=p.propTypes;else return;if(m){var S=W(p);te(m,i.props,"prop",S,i)}else if(p.PropTypes!==void 0&&!en){en=!0;var x=W(p);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",x||"Unknown")}typeof p.getDefaultProps=="function"&&!p.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Lo(i){{for(var p=Object.keys(i.props),m=0;m<p.length;m++){var S=p[m];if(S!=="children"&&S!=="key"){Fe(i),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",S),Fe(null);break}}i.ref!==null&&(Fe(i),g("Invalid attribute `ref` supplied to `React.Fragment`."),Fe(null))}}function Er(i,p,m,S,x,A){{var C=I(i);if(!C){var R="";(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(R+=" 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 Z=Do(x);Z?R+=Z:R+=yr();var M;i===null?M="null":Re(i)?M="array":i!==void 0&&i.$$typeof===a?(M="<"+(W(i.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):M=typeof i,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",M,R)}var H=Oo(i,p,m,x,A);if(H==null)return H;if(C){var re=p.children;if(re!==void 0)if(S)if(Re(re)){for(var Le=0;Le<re.length;Le++)wr(re[Le],i);Object.freeze&&Object.freeze(re)}else g("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 wr(re,i)}return i===o?Lo(H):Fo(H),H}}function ko(i,p,m){return Er(i,p,m,!0)}function Po(i,p,m){return Er(i,p,m,!1)}var Uo=Po,No=ko;We.Fragment=o,We.jsx=Uo,We.jsxs=No}()),We}(function(e){process.env.NODE_ENV==="production"?e.exports=to():e.exports=no()})(sr);const ro=sr.exports.jsx,ee=h.createContext(null),ao=({url:e="",tokenParams:a,children:t})=>{const o=h.useMemo(()=>{const n=new xa.FrappeApp(e,a);return{url:e,tokenParams:a,app:n,auth:n.auth(),db:n.db(),call:n.call(),file:n.file()}},[e,a]);return ro(ee.Provider,{value:o,children:t})},oo=e=>{const{url:a,auth:t,tokenParams:o}=h.useContext(ee),[n,r]=h.useState(),s=h.useCallback(()=>{const w=document.cookie.split(";").find(b=>b.trim().startsWith("user_id="));if(w){const b=w.split("=")[1];r(b&&b!=="Guest"?b:null)}else r(null)},[]);h.useEffect(()=>{o&&o.useToken?r(null):s()},[]);const{data:c,error:d,isLoading:u,isValidating:f,mutate:l}=Ve(()=>o&&o.useToken||n?`${a}/api/method/frappe.auth.get_logged_user`:null,()=>t.getLoggedInUser(),{onError:()=>{r(null)},shouldRetryOnError:!1,revalidateOnFocus:!1,...e}),y=h.useCallback(async(w,b)=>t.loginWithUsernamePassword({username:w,password:b}).then(T=>{s()}),[]),v=h.useCallback(async()=>t.logout().then(()=>l(null)).then(()=>r(null)),[]);return{isLoading:n===void 0||u,currentUser:c,isValidating:f,error:d,login:y,logout:v,updateCurrentUser:l,getUserCookie:s}},so=(e,a,t,o)=>{const{url:n,db:r}=h.useContext(ee);return{...Ve(t===void 0?`${n}/api/resource/${e}/${a}`:t,()=>r.getDoc(e,a),o)}},cr=e=>{var t,o,n;let a="";if(e!=null&&e.fields&&(a+="fields="+JSON.stringify(e==null?void 0:e.fields)+"&"),e!=null&&e.filters&&(a+="filters="+JSON.stringify(e==null?void 0:e.filters)+"&"),e!=null&&e.orFilters&&(a+="or_filters="+JSON.stringify(e==null?void 0:e.orFilters)+"&"),e!=null&&e.limit_start&&(a+="limit_start="+JSON.stringify(e==null?void 0:e.limit_start)+"&"),e!=null&&e.limit&&(a+="limit="+JSON.stringify(e==null?void 0:e.limit)+"&"),e!=null&&e.groupBy&&(a+="group_by="+e.groupBy+"&"),e!=null&&e.orderBy){const r=`${(t=e.orderBy)==null?void 0:t.field} ${(n=(o=e.orderBy)==null?void 0:o.order)!=null?n:"asc"}`;a+="order_by="+r+"&"}return e!=null&&e.asDict&&(a+="as_dict="+e.asDict),a},io=(e,a,t,o)=>{const{url:n,db:r}=h.useContext(ee);return{...Ve(t===void 0?`${n}/api/resource/${e}?${cr(a)}`:t,()=>r.getDocList(e,a),o)}},uo=()=>{const{db:e}=h.useContext(ee),[a,t]=h.useState(!1),[o,n]=h.useState(null),[r,s]=h.useState(!1),c=h.useCallback(()=>{t(!1),n(null),s(!1)},[]);return{createDoc:h.useCallback(async(u,f)=>(n(null),s(!1),t(!0),e.createDoc(u,f).then(l=>(t(!1),s(!0),l)).catch(l=>{throw t(!1),s(!1),n(l),l})),[]),loading:a,error:o,isCompleted:r,reset:c}},co=()=>{const{db:e}=h.useContext(ee),[a,t]=h.useState(!1),[o,n]=h.useState(null),[r,s]=h.useState(!1),c=h.useCallback(()=>{t(!1),n(null),s(!1)},[]);return{updateDoc:h.useCallback(async(u,f,l)=>(n(null),s(!1),t(!0),e.updateDoc(u,f,l).then(y=>(t(!1),s(!0),y)).catch(y=>{throw t(!1),s(!1),n(y),y})),[]),loading:a,error:o,reset:c,isCompleted:r}},lo=()=>{const{db:e}=h.useContext(ee),[a,t]=h.useState(!1),[o,n]=h.useState(null),[r,s]=h.useState(!1),c=h.useCallback(()=>{t(!1),n(null),s(!1)},[]);return{deleteDoc:h.useCallback(async(u,f)=>(n(null),s(!1),t(!0),e.deleteDoc(u,f).then(l=>(t(!1),s(!0),l)).catch(l=>{throw t(!1),s(!1),n(l),l})),[]),loading:a,error:o,reset:c,isCompleted:r}};function lr(e){const a=[];for(let t in e)a.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return a.join("&")}const fo=(e,a,t=!1,o=!1,n,r)=>{const{url:s,db:c}=h.useContext(ee);return{...Ve(n===void 0?(()=>{const f=lr(t?{doctype:e,filters:a!=null?a:[],cache:t,debug:o}:{doctype:e,filters:a!=null?a:[],debug:o});return`${s}/api/method/frappe.client.get_count?${f}`})():n,()=>c.getCount(e,a,t,o),r)}},fr=(e,a,t,o)=>{const{call:n}=h.useContext(ee),r=lr(a!=null?a:{}),s=`${e}?${r}`;return{...Ve(t===void 0?s:t,()=>n.get(e,a),o)}},po=e=>{const{call:a}=h.useContext(ee),[t,o]=h.useState(null),[n,r]=h.useState(!1),[s,c]=h.useState(null),[d,u]=h.useState(!1),f=h.useCallback(()=>{o(null),r(!1),c(null),u(!1)},[]);return{call:h.useCallback(async y=>(c(null),u(!1),r(!0),o(null),a.post(e,y).then(v=>(o(v),r(!1),u(!0),v)).catch(v=>{throw r(!1),u(!1),c(v),v})),[]),result:t,loading:n,error:s,reset:f,isCompleted:d}},ho=e=>{const{call:a}=h.useContext(ee),[t,o]=h.useState(null),[n,r]=h.useState(!1),[s,c]=h.useState(null),[d,u]=h.useState(!1),f=h.useCallback(()=>{o(null),r(!1),c(null),u(!1)},[]);return{call:h.useCallback(async y=>(c(null),u(!1),r(!0),o(null),a.put(e,y).then(v=>(o(v),r(!1),u(!0),v)).catch(v=>{throw r(!1),u(!1),c(v),v})),[]),result:t,loading:n,error:s,reset:f,isCompleted:d}},vo=e=>{const{call:a}=h.useContext(ee),[t,o]=h.useState(null),[n,r]=h.useState(!1),[s,c]=h.useState(null),[d,u]=h.useState(!1),f=h.useCallback(()=>{o(null),r(!1),c(null),u(!1)},[]);return{call:h.useCallback(async y=>(c(null),u(!1),r(!0),o(null),a.delete(e,y).then(v=>(o(v),r(!1),u(!0),v)).catch(v=>{throw r(!1),u(!1),c(v),v})),[]),result:t,loading:n,error:s,reset:f,isCompleted:d}},mo=()=>{const{file:e}=h.useContext(ee),[a,t]=h.useState(0),[o,n]=h.useState(!1),[r,s]=h.useState(null),[c,d]=h.useState(!1),u=h.useCallback(async(l,y)=>(f(),n(!0),e.uploadFile(l,y,(v,w)=>t(Math.round(v/w*100))).then(v=>(d(!0),t(100),n(!1),v.data.message)).catch(v=>{throw console.error(v),s(v),n(!1),v})),[]),f=h.useCallback(()=>{t(0),n(!1),s(null),d(!1)},[]);return{upload:u,progress:a,loading:o,isCompleted:c,error:r,reset:f}},yo=(e,a,t=[],o=20,n=250)=>{const r=_o(a,n);return fr("frappe.desk.search.search_link",{doctype:e,page_length:o,txt:r,filters:JSON.stringify(t!=null?t:[])})},_o=(e,a)=>{const[t,o]=h.useState(e);return h.useEffect(()=>{const n=setTimeout(()=>{o(e)},a);return()=>{clearTimeout(n)}},[e,a]),t};j.FrappeContext=ee,j.FrappeProvider=ao,j.getDocListQueryString=cr,j.useFrappeAuth=oo,j.useFrappeCreateDoc=uo,j.useFrappeDeleteCall=vo,j.useFrappeDeleteDoc=lo,j.useFrappeFileUpload=mo,j.useFrappeGetCall=fr,j.useFrappeGetDoc=so,j.useFrappeGetDocCount=fo,j.useFrappeGetDocList=io,j.useFrappePostCall=po,j.useFrappePutCall=ho,j.useFrappeUpdateDoc=co,j.useSearch=yo,Object.defineProperties(j,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "frappe-react-sdk",
3
3
  "description": "React hooks for Frappe Framework",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Nikhil Kothari",