agora-foundation 3.8.1 → 3.8.2

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.
Files changed (59) hide show
  1. package/lib/worker/worker-factory.js +22 -1
  2. package/lib-es/decorator/bound/index.js +12 -0
  3. package/lib-es/decorator/index.js +4 -0
  4. package/lib-es/decorator/lodash/index.js +34 -0
  5. package/lib-es/decorator/log/handler.js +79 -0
  6. package/lib-es/decorator/log/index.js +28 -0
  7. package/lib-es/decorator/log/log-serializer.js +15 -0
  8. package/lib-es/decorator/proxy.js +149 -0
  9. package/lib-es/decorator/type.js +7 -0
  10. package/lib-es/decorator/validate/index.js +32 -0
  11. package/lib-es/logger/common.js +45 -0
  12. package/lib-es/logger/constants.js +3 -0
  13. package/lib-es/logger/hijack.js +61 -0
  14. package/lib-es/logger/index.js +52 -0
  15. package/lib-es/logger/logger-impl.js +122 -0
  16. package/lib-es/logger/manager-impl.js +63 -0
  17. package/lib-es/logger/type.js +7 -0
  18. package/lib-es/restful-scheduler/scheduler.js +224 -0
  19. package/lib-es/schedule/index.js +3 -0
  20. package/lib-es/schedule/scheduler.js +102 -0
  21. package/lib-es/schedule/task.js +159 -0
  22. package/lib-es/upload/index.js +1 -0
  23. package/lib-es/upload/scheduler.js +145 -0
  24. package/lib-es/upload/type.js +1 -0
  25. package/lib-es/utilities/agora-error.js +120 -0
  26. package/lib-es/utilities/async-retry.js +177 -0
  27. package/lib-es/utilities/browser.js +20 -0
  28. package/lib-es/utilities/desc-type.js +3 -0
  29. package/lib-es/utilities/env.js +54 -0
  30. package/lib-es/utilities/events.js +125 -0
  31. package/lib-es/utilities/file-reader.js +15 -0
  32. package/lib-es/utilities/interceptor.js +23 -0
  33. package/lib-es/utilities/logger.js +19 -0
  34. package/lib-es/utilities/misc.js +74 -0
  35. package/lib-es/utilities/observable.js +96 -0
  36. package/lib-es/utilities/race-condition.js +17 -0
  37. package/lib-es/utilities/safely-remove-child.js +29 -0
  38. package/lib-es/utilities/schema.js +36 -0
  39. package/lib-es/utilities/value-check.js +3 -0
  40. package/lib-es/utilities/zip.js +200 -0
  41. package/lib-es/worker/constants.js +13 -0
  42. package/lib-es/worker/handler/binary.js +157 -0
  43. package/lib-es/worker/handler/db.js +34 -0
  44. package/lib-es/worker/handler/fs-log.js +149 -0
  45. package/lib-es/worker/handler/log-rotate-new.js +230 -0
  46. package/lib-es/worker/handler/log-rotate.js +80 -0
  47. package/lib-es/worker/handler/log.js +291 -0
  48. package/lib-es/worker/handler/reply.js +15 -0
  49. package/lib-es/worker/index.js +8 -0
  50. package/lib-es/worker/interactor.js +435 -0
  51. package/lib-es/worker/mutex.js +57 -0
  52. package/lib-es/worker/type.js +1 -0
  53. package/lib-es/worker/worker-entry.js +3 -0
  54. package/lib-es/worker/worker-factory.js +15 -0
  55. package/lib-es/worker/worker-installer.js +71 -0
  56. package/package.json +8 -4
  57. package/lib/worker/545.worker-factory.js +0 -1
  58. package/lib/worker/847.worker-factory.js +0 -2
  59. package/lib/worker/847.worker-factory.js.LICENSE.txt +0 -24
@@ -1 +1,22 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,()=>(()=>{"use strict";var e={30(e,t,r){var n=r(6893),o=r(3315),i=r(4466),a=r(3770),s=r(380),u=r(7137);t.f=n&&!o?Object.defineProperties:function(e,t){a(e);for(var r,n=s(t),o=u(t),c=o.length,f=0;c>f;)i.f(e,r=o[f++],n[r]);return e}},142(e){var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},156(e,t){t.f=Object.getOwnPropertySymbols},168(e,t,r){var n=r(746),o=r(6209),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},286(e,t,r){var n=r(4578),o=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new o("Incorrect invocation")}},290(e,t,r){var n=r(9944),o=r(831),i=r(6032),a=r(2913),s=r(2287),u=r(4282),c=TypeError,f=u("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var r,u=a(e,f);if(u){if(void 0===t&&(t="default"),r=n(u,e,t),!o(r)||i(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},380(e,t,r){var n=r(7568),o=r(9509);e.exports=function(e){return n(o(e))}},495(e,t,r){r(1011);var n,o=r(5613),i=r(6893),a=r(6301),s=r(9117),u=r(5821),c=r(6881),f=r(7509),l=r(997),h=r(286),p=r(4418),v=r(9456),g=r(6859),y=r(7825),d=r(4212).codeAt,m=r(6294),b=r(2618),w=r(3754),S=r(9445),x=r(1615),P=r(3086),O=P.set,L=P.getterFor("URL"),k=x.URLSearchParams,j=x.getState,R=s.URL,U=s.TypeError,A=s.parseInt,E=Math.floor,T=Math.pow,C=c("".charAt),I=c(/./.exec),F=c([].join),q=c(1.1.toString),B=c([].pop),H=c([].push),M=c("".replace),_=c([].shift),z=c("".split),N=c("".slice),G=c("".toLowerCase),D=c([].unshift),$="Invalid scheme",V="Invalid host",W="Invalid port",J=/[a-z]/i,Q=/[\d+-.a-z]/i,Y=/\d/,X=/^0x/i,K=/^[0-7]+$/,Z=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,oe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ie=/[\t\n\r]/g,ae=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)D(t,e%256),e=E(e/256);return F(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r?n:t}(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=q(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},se={},ue=v({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),ce=v({},ue,{"#":1,"?":1,"{":1,"}":1}),fe=v({},ce,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),le=function(e,t){var r=d(e,0);return r>32&&r<127&&!p(t,e)?e:encodeURIComponent(e)},he={ftp:21,file:null,http:80,https:443,ws:80,wss:443},pe=function(e,t){var r;return 2===e.length&&I(J,C(e,0))&&(":"===(r=C(e,1))||!t&&"|"===r)},ve=function(e){var t;return e.length>1&&pe(N(e,0,2))&&(2===e.length||"/"===(t=C(e,2))||"\\"===t||"?"===t||"#"===t)},ge=function(e){return"."===e||"%2e"===G(e)},ye=function(e){return".."===(e=G(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},de={},me={},be={},we={},Se={},xe={},Pe={},Oe={},Le={},ke={},je={},Re={},Ue={},Ae={},Ee={},Te={},Ce={},Ie={},Fe={},qe={},Be={},He=function(e,t,r){var n,o,i,a=b(e);if(t){if(o=this.parse(a))throw new U(o);this.searchParams=null}else{if(void 0!==r&&(n=new He(r,!0)),o=this.parse(a,null,n))throw new U(o);(i=j(new k)).bindURL(this),this.searchParams=i}};He.prototype={type:"URL",parse:function(e,t,r){var o,i,a,s,u=this,c=t||de,f=0,l="",h=!1,v=!1,d=!1;for(e=b(e),t||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,e=M(e,ne,""),e=M(e,oe,"$1")),e=M(e,ie,""),o=g(e);f<=o.length;){switch(i=o[f],c){case de:if(!i||!I(J,i)){if(t)return $;c=be;continue}l+=G(i),c=me;break;case me:if(i&&(I(Q,i)||"+"===i||"-"===i||"."===i))l+=G(i);else{if(":"!==i){if(t)return $;l="",c=be,f=0;continue}if(t&&(u.isSpecial()!==p(he,l)||"file"===l&&(u.includesCredentials()||null!==u.port)||"file"===u.scheme&&!u.host))return;if(u.scheme=l,t)return void(u.isSpecial()&&he[u.scheme]===u.port&&(u.port=null));l="","file"===u.scheme?c=Ae:u.isSpecial()&&r&&r.scheme===u.scheme?c=we:u.isSpecial()?c=Oe:"/"===o[f+1]?(c=Se,f++):(u.cannotBeABaseURL=!0,H(u.path,""),c=Fe)}break;case be:if(!r||r.cannotBeABaseURL&&"#"!==i)return $;if(r.cannotBeABaseURL&&"#"===i){u.scheme=r.scheme,u.path=y(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,c=Be;break}c="file"===r.scheme?Ae:xe;continue;case we:if("/"!==i||"/"!==o[f+1]){c=xe;continue}c=Le,f++;break;case Se:if("/"===i){c=ke;break}c=Ie;continue;case xe:if(u.scheme=r.scheme,i===n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=y(r.path),u.query=r.query;else if("/"===i||"\\"===i&&u.isSpecial())c=Pe;else if("?"===i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=y(r.path),u.query="",c=qe;else{if("#"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=y(r.path),u.path.length--,c=Ie;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=y(r.path),u.query=r.query,u.fragment="",c=Be}break;case Pe:if(!u.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,c=Ie;continue}c=ke}else c=Le;break;case Oe:if(c=Le,"/"!==i||"/"!==C(l,f+1))continue;f++;break;case Le:if("/"!==i&&"\\"!==i){c=ke;continue}break;case ke:if("@"===i){h&&(l="%40"+l),h=!0,a=g(l);for(var m=0;m<a.length;m++){var w=a[m];if(":"!==w||d){var S=le(w,fe);d?u.password+=S:u.username+=S}else d=!0}l=""}else if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(h&&""===l)return"Invalid authority";f-=g(l).length+1,l="",c=je}else l+=i;break;case je:case Re:if(t&&"file"===u.scheme){c=Te;continue}if(":"!==i||v){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(u.isSpecial()&&""===l)return V;if(t&&""===l&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(l))return s;if(l="",c=Ce,t)return;continue}"["===i?v=!0:"]"===i&&(v=!1),l+=i}else{if(""===l)return V;if(s=u.parseHost(l))return s;if(l="",c=Ue,t===Re)return}break;case Ue:if(!I(Y,i)){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()||t){if(""!==l){var x=A(l,10);if(x>65535)return W;u.port=u.isSpecial()&&x===he[u.scheme]?null:x,l=""}if(t)return;c=Ce;continue}return W}l+=i;break;case Ae:if(u.scheme="file","/"===i||"\\"===i)c=Ee;else{if(!r||"file"!==r.scheme){c=Ie;continue}switch(i){case n:u.host=r.host,u.path=y(r.path),u.query=r.query;break;case"?":u.host=r.host,u.path=y(r.path),u.query="",c=qe;break;case"#":u.host=r.host,u.path=y(r.path),u.query=r.query,u.fragment="",c=Be;break;default:ve(F(y(o,f),""))||(u.host=r.host,u.path=y(r.path),u.shortenPath()),c=Ie;continue}}break;case Ee:if("/"===i||"\\"===i){c=Te;break}r&&"file"===r.scheme&&!ve(F(y(o,f),""))&&(pe(r.path[0],!0)?H(u.path,r.path[0]):u.host=r.host),c=Ie;continue;case Te:if(i===n||"/"===i||"\\"===i||"?"===i||"#"===i){if(!t&&pe(l))c=Ie;else if(""===l){if(u.host="",t)return;c=Ce}else{if(s=u.parseHost(l))return s;if("localhost"===u.host&&(u.host=""),t)return;l="",c=Ce}continue}l+=i;break;case Ce:if(u.isSpecial()){if(c=Ie,"/"!==i&&"\\"!==i)continue}else if(t||"?"!==i)if(t||"#"!==i){if(i!==n&&(c=Ie,"/"!==i))continue}else u.fragment="",c=Be;else u.query="",c=qe;break;case Ie:if(i===n||"/"===i||"\\"===i&&u.isSpecial()||!t&&("?"===i||"#"===i)){if(ye(l)?(u.shortenPath(),"/"===i||"\\"===i&&u.isSpecial()||H(u.path,"")):ge(l)?"/"===i||"\\"===i&&u.isSpecial()||H(u.path,""):("file"===u.scheme&&!u.path.length&&pe(l)&&(u.host&&(u.host=""),l=C(l,0)+":"),H(u.path,l)),l="","file"===u.scheme&&(i===n||"?"===i||"#"===i))for(;u.path.length>1&&""===u.path[0];)_(u.path);"?"===i?(u.query="",c=qe):"#"===i&&(u.fragment="",c=Be)}else l+=le(i,ce);break;case Fe:"?"===i?(u.query="",c=qe):"#"===i?(u.fragment="",c=Be):i!==n&&(u.path[0]+=le(i,se));break;case qe:t||"#"!==i?i!==n&&("'"===i&&u.isSpecial()?u.query+="%27":u.query+="#"===i?"%23":le(i,se)):(u.fragment="",c=Be);break;case Be:i!==n&&(u.fragment+=le(i,ue))}f++}},parseHost:function(e){var t,r,n;if("["===C(e,0)){if("]"!==C(e,e.length-1))return V;if(t=function(e){var t,r,n,o,i,a,s,u=[0,0,0,0,0,0,0,0],c=0,f=null,l=0,h=function(){return C(e,l)};if(":"===h()){if(":"!==C(e,1))return;l+=2,f=++c}for(;h();){if(8===c)return;if(":"!==h()){for(t=r=0;r<4&&I(ee,h());)t=16*t+A(h(),16),l++,r++;if("."===h()){if(0===r)return;if(l-=r,c>6)return;for(n=0;h();){if(o=null,n>0){if(!("."===h()&&n<4))return;l++}if(!I(Y,h()))return;for(;I(Y,h());){if(i=A(h(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;l++}u[c]=256*u[c]+o,2!==++n&&4!==n||c++}if(4!==n)return;break}if(":"===h()){if(l++,!h())return}else if(h())return;u[c++]=t}else{if(null!==f)return;l++,f=++c}}if(null!==f)for(a=c-f,c=7;0!==c&&a>0;)s=u[c],u[c--]=u[f+a-1],u[f+--a]=s;else if(8!==c)return;return u}(N(e,1,-1)),!t)return V;this.host=t}else if(this.isSpecial()){if(e=m(e),I(te,e))return V;if(t=function(e){var t,r,n,o,i,a,s,u=z(e,".");if(u.length&&""===u[u.length-1]&&u.length--,(t=u.length)>4)return e;for(r=[],n=0;n<t;n++){if(""===(o=u[n]))return e;if(i=10,o.length>1&&"0"===C(o,0)&&(i=I(X,o)?16:8,o=N(o,8===i?1:2)),""===o)a=0;else{if(!I(10===i?Z:8===i?K:ee,o))return e;a=A(o,i)}H(r,a)}for(n=0;n<t;n++)if(a=r[n],n===t-1){if(a>=T(256,5-t))return null}else if(a>255)return null;for(s=B(r),n=0;n<r.length;n++)s+=r[n]*T(256,3-n);return s}(e),null===t)return V;this.host=t}else{if(I(re,e))return V;for(t="",r=g(e),n=0;n<r.length;n++)t+=le(r[n],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return p(he,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&pe(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,a=e.path,s=e.query,u=e.fragment,c=t+":";return null!==o?(c+="//",e.includesCredentials()&&(c+=r+(n?":"+n:"")+"@"),c+=ae(o),null!==i&&(c+=":"+i)):"file"===t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+F(a,"/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},setHref:function(e){var t=this.parse(e);if(t)throw new U(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Me(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(b(e)+":",de)},getUsername:function(){return this.username},setUsername:function(e){var t=g(b(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=le(t[r],fe)}},getPassword:function(){return this.password},setPassword:function(e){var t=g(b(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=le(t[r],fe)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,je)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Re)},getPort:function(){var e=this.port;return null===e?"":b(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=b(e))?this.port=null:this.parse(e,Ue))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+F(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Ce))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=b(e))?this.query=null:("?"===C(e,0)&&(e=N(e,1)),this.query="",this.parse(e,qe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=b(e))?("#"===C(e,0)&&(e=N(e,1)),this.fragment="",this.parse(e,Be)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Me=function(e){var t=h(this,_e),r=S(arguments.length,1)>1?arguments[1]:void 0,n=O(t,new He(e,!1,r));i||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},_e=Me.prototype,ze=function(e,t){return{get:function(){return L(this)[e]()},set:t&&function(e){return L(this)[t](e)},configurable:!0,enumerable:!0}};if(i&&(l(_e,"href",ze("serialize","setHref")),l(_e,"origin",ze("getOrigin")),l(_e,"protocol",ze("getProtocol","setProtocol")),l(_e,"username",ze("getUsername","setUsername")),l(_e,"password",ze("getPassword","setPassword")),l(_e,"host",ze("getHost","setHost")),l(_e,"hostname",ze("getHostname","setHostname")),l(_e,"port",ze("getPort","setPort")),l(_e,"pathname",ze("getPathname","setPathname")),l(_e,"search",ze("getSearch","setSearch")),l(_e,"searchParams",ze("getSearchParams")),l(_e,"hash",ze("getHash","setHash"))),f(_e,"toJSON",function(){return L(this).serialize()},{enumerable:!0}),f(_e,"toString",function(){return L(this).serialize()},{enumerable:!0}),R){var Ne=R.createObjectURL,Ge=R.revokeObjectURL;Ne&&f(Me,"createObjectURL",u(Ne,R)),Ge&&f(Me,"revokeObjectURL",u(Ge,R))}w(Me,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:Me})},630(e,t,r){var n=r(9345),o=r(7509),i=r(2244);n||o(Object.prototype,"toString",i,{unsafe:!0})},675(e,t,r){var n=r(6744),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},680(e,t,r){var n=r(5234);e.exports=!n(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},746(e,t,r){var n=r(2694);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},831(e,t,r){var n=r(4188);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},866(e,t,r){var n=r(6881),o=r(5234),i=r(4188),a=r(5438),s=r(5604),u=r(3029),c=function(){},f=s("Reflect","construct"),l=/^\s*(?:class|function)\b/,h=n(l.exec),p=!l.test(c),v=function(e){if(!i(e))return!1;try{return f(c,[],e),!0}catch(e){return!1}},g=function(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!h(l,u(e))}catch(e){return!0}};g.sham=!0,e.exports=!f||o(function(){var e;return v(v.call)||!v(Object)||!v(function(){e=!0})||e})?g:v},997(e,t,r){var n=r(4530),o=r(4466);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),o.f(e,t,r)}},1011(e,t,r){var n=r(4212).charAt,o=r(2618),i=r(3086),a=r(3217),s=r(6224),u="String Iterator",c=i.set,f=i.getterFor(u);a(String,"String",function(e){c(this,{type:u,string:o(e),index:0})},function(){var e,t=f(this),r=t.string,o=t.index;return o>=r.length?s(void 0,!0):(e=n(r,o),t.index+=e.length,s(e,!1))})},1025(e,t,r){var n=r(6881),o=r(4977);e.exports=function(e,t,r){try{return n(o(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},1274(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},1412(e,t,r){var n=r(7509),o=r(6881),i=r(2618),a=r(9445),s=URLSearchParams,u=s.prototype,c=o(u.append),f=o(u.delete),l=o(u.forEach),h=o([].push),p=new s("a=1&a=2&b=3");p.delete("a",1),p.delete("b",void 0),p+""!="a=2"&&n(u,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return f(this,e);var n=[];l(this,function(e,t){h(n,{key:t,value:e})}),a(t,1);for(var o,s=i(e),u=i(r),p=0,v=0,g=!1,y=n.length;p<y;)o=n[p++],g||o.key===s?(g=!0,f(this,o.key)):v++;for(;v<y;)(o=n[v++]).key===s&&o.value===u||c(this,o.key,o.value)},{enumerable:!0,unsafe:!0})},1458(e,t,r){var n=r(380),o=r(675),i=r(9389),a=function(e){return function(t,r,a){var s=n(t),u=i(s);if(0===u)return!e&&-1;var c,f=o(a,u);if(e&&r!=r){for(;u>f;)if((c=s[f++])!=c)return!0}else for(;u>f;f++)if((e||f in s)&&s[f]===r)return e||f||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},1615(e,t,r){r(3873),r(3536);var n=r(5613),o=r(9117),i=r(5268),a=r(5604),s=r(9944),u=r(6881),c=r(6893),f=r(6301),l=r(7509),h=r(997),p=r(4320),v=r(3754),g=r(9383),y=r(3086),d=r(286),m=r(4188),b=r(4418),w=r(5821),S=r(5438),x=r(3770),P=r(831),O=r(2618),L=r(7065),k=r(9123),j=r(2350),R=r(9874),U=r(6224),A=r(9445),E=r(4282),T=r(9295),C=E("iterator"),I="URLSearchParams",F=I+"Iterator",q=y.set,B=y.getterFor(I),H=y.getterFor(F),M=i("fetch"),_=i("Request"),z=i("Headers"),N=_&&_.prototype,G=z&&z.prototype,D=o.TypeError,$=o.encodeURIComponent,V=String.fromCharCode,W=a("String","fromCodePoint"),J=parseInt,Q=u("".charAt),Y=u([].join),X=u([].push),K=u("".replace),Z=u([].shift),ee=u([].splice),te=u("".split),re=u("".slice),ne=u(/./.exec),oe=/\+/g,ie=/^[0-9a-f]+$/i,ae=function(e,t){var r=re(e,t,t+2);return ne(ie,r)?J(r,16):NaN},se=function(e){for(var t=0,r=128;r>0&&0!==(e&r);r>>=1)t++;return t},ue=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ce=function(e){for(var t=(e=K(e,oe," ")).length,r="",n=0;n<t;){var o=Q(e,n);if("%"===o){if("%"===Q(e,n+1)||n+3>t){r+="%",n++;continue}var i=ae(e,n+1);if(i!=i){r+=o,n++;continue}n+=2;var a=se(i);if(0===a)o=V(i);else{if(1===a||a>4){r+="�",n++;continue}for(var s=[i],u=1;u<a&&!(3+ ++n>t||"%"!==Q(e,n));){var c=ae(e,n+1);if(c!=c){n+=3;break}if(c>191||c<128)break;X(s,c),n+=2,u++}if(s.length!==a){r+="�";continue}var f=ue(s);null===f?r+="�":o=W(f)}}r+=o,n++}return r},fe=/[!'()~]|%20/g,le={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},he=function(e){return le[e]},pe=function(e){return K($(e),fe,he)},ve=g(function(e,t){q(this,{type:F,target:B(e).entries,index:0,kind:t})},I,function(){var e=H(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,U(void 0,!0);var n=t[r];switch(e.kind){case"keys":return U(n.key,!1);case"values":return U(n.value,!1)}return U([n.key,n.value],!1)},!0),ge=function(e){this.entries=[],this.url=null,void 0!==e&&(P(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Q(e,0)?re(e,1):e:O(e)))};ge.prototype={type:I,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,i,a,u,c=this.entries,f=R(e);if(f)for(r=(t=j(e,f)).next;!(n=s(r,t)).done;){if(i=(o=j(x(n.value))).next,(a=s(i,o)).done||(u=s(i,o)).done||!s(i,o).done)throw new D("Expected sequence with length 2");X(c,{key:O(a.value),value:O(u.value)})}else for(var l in e)b(e,l)&&X(c,{key:l,value:O(e[l])})},parseQuery:function(e){if(e)for(var t,r,n=this.entries,o=te(e,"&"),i=0;i<o.length;)(t=o[i++]).length&&(r=te(t,"="),X(n,{key:ce(Z(r)),value:ce(Y(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],X(r,pe(e.key)+"="+pe(e.value));return Y(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ye=function(){d(this,de);var e=q(this,new ge(arguments.length>0?arguments[0]:void 0));c||(this.size=e.entries.length)},de=ye.prototype;if(p(de,{append:function(e,t){var r=B(this);A(arguments.length,2),X(r.entries,{key:O(e),value:O(t)}),c||this.size++,r.updateURL()},delete:function(e){for(var t=B(this),r=A(arguments.length,1),n=t.entries,o=O(e),i=r<2?void 0:arguments[1],a=void 0===i?i:O(i),s=0;s<n.length;){var u=n[s];if(u.key!==o||void 0!==a&&u.value!==a)s++;else if(ee(n,s,1),void 0!==a)break}c||(this.size=n.length),t.updateURL()},get:function(e){var t=B(this).entries;A(arguments.length,1);for(var r=O(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){var t=B(this).entries;A(arguments.length,1);for(var r=O(e),n=[],o=0;o<t.length;o++)t[o].key===r&&X(n,t[o].value);return n},has:function(e){for(var t=B(this).entries,r=A(arguments.length,1),n=O(e),o=r<2?void 0:arguments[1],i=void 0===o?o:O(o),a=0;a<t.length;){var s=t[a++];if(s.key===n&&(void 0===i||s.value===i))return!0}return!1},set:function(e,t){var r=B(this);A(arguments.length,1);for(var n,o=r.entries,i=!1,a=O(e),s=O(t),u=0;u<o.length;u++)(n=o[u]).key===a&&(i?ee(o,u--,1):(i=!0,n.value=s));i||X(o,{key:a,value:s}),c||(this.size=o.length),r.updateURL()},sort:function(){var e=B(this);T(e.entries,function(e,t){return e.key>t.key?1:-1}),e.updateURL()},forEach:function(e){for(var t,r=B(this).entries,n=w(e,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new ve(this,"keys")},values:function(){return new ve(this,"values")},entries:function(){return new ve(this,"entries")}},{enumerable:!0}),l(de,C,de.entries,{name:"entries"}),l(de,"toString",function(){return B(this).serialize()},{enumerable:!0}),c&&h(de,"size",{get:function(){return B(this).entries.length},configurable:!0,enumerable:!0}),v(ye,I),n({global:!0,constructor:!0,forced:!f},{URLSearchParams:ye}),!f&&m(z)){var me=u(G.has),be=u(G.set),we=function(e){if(P(e)){var t,r=e.body;if(S(r)===I)return t=e.headers?new z(e.headers):new z,me(t,"content-type")||be(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),L(e,{body:k(0,O(r)),headers:k(0,t)})}return e};if(m(M)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return M(e,arguments.length>1?we(arguments[1]):{})}}),m(_)){var Se=function(e){return d(this,N),new _(e,arguments.length>1?we(arguments[1]):{})};N.constructor=Se,Se.prototype=N,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Se})}}e.exports={URLSearchParams:ye,getState:B}},1786(e,t,r){var n=r(4418),o=r(4188),i=r(3628),a=r(168),s=r(680),u=a("IE_PROTO"),c=Object,f=c.prototype;e.exports=s?c.getPrototypeOf:function(e){var t=i(e);if(n(t,u))return t[u];var r=t.constructor;return o(r)&&t instanceof r?r.prototype:t instanceof c?f:null}},1843(e,t,r){var n=r(6881),o=r(4418),i=r(380),a=r(1458).indexOf,s=r(7588),u=n([].push);e.exports=function(e,t){var r,n=i(e),c=0,f=[];for(r in n)!o(s,r)&&o(n,r)&&u(f,r);for(;t.length>c;)o(n,r=t[c++])&&(~a(f,r)||u(f,r));return f}},1883(e,t,r){var n=r(7509),o=r(6881),i=r(2618),a=r(9445),s=URLSearchParams,u=s.prototype,c=o(u.getAll),f=o(u.has),l=new s("a=1");!l.has("a",2)&&l.has("a",void 0)||n(u,"has",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&void 0===r)return f(this,e);var n=c(this,e);a(t,1);for(var o=i(r),s=0;s<n.length;)if(n[s++]===o)return!0;return!1},{enumerable:!0,unsafe:!0})},1942(e){e.exports=!1},2037(e,t,r){var n,o,i,a=r(5234),s=r(4188),u=r(831),c=r(7065),f=r(1786),l=r(7509),h=r(4282),p=r(1942),v=h("iterator"),g=!1;[].keys&&("next"in(i=[].keys())?(o=f(f(i)))!==Object.prototype&&(n=o):g=!0),!u(n)||a(function(){var e={};return n[v].call(e)!==e})?n={}:p&&(n=c(n)),s(n[v])||l(n,v,function(){return this}),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:g}},2244(e,t,r){var n=r(9345),o=r(5438);e.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},2287(e,t,r){var n=r(9944),o=r(4188),i=r(831),a=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&o(r=e.toString)&&!i(s=n(r,e)))return s;if(o(r=e.valueOf)&&!i(s=n(r,e)))return s;if("string"!==t&&o(r=e.toString)&&!i(s=n(r,e)))return s;throw new a("Can't convert object to primitive value")}},2344(e,t,r){var n=r(290),o=r(6032);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},2350(e,t,r){var n=r(9944),o=r(4977),i=r(3770),a=r(3174),s=r(9874),u=TypeError;e.exports=function(e,t){var r=arguments.length<2?s(e):t;if(o(r))return i(n(r,e));throw new u(a(e)+" is not iterable")}},2618(e,t,r){var n=r(5438),o=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return o(e)}},2694(e,t,r){var n=r(1942),o=r(9117),i=r(4798),a="__core-js_shared__",s=e.exports=o[a]||i(a,{});(s.versions||(s.versions=[])).push({version:"3.47.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"})},2735(e,t,r){var n=r(6893),o=r(4418),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),u=s&&"something"===function(){}.name,c=s&&(!n||n&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},2913(e,t,r){var n=r(4977),o=r(4318);e.exports=function(e,t){var r=e[t];return o(r)?void 0:n(r)}},3008(e,t,r){var n,o,i=r(9117),a=r(8060),s=i.process,u=i.Deno,c=s&&s.versions||u&&u.version,f=c&&c.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},3029(e,t,r){var n=r(6881),o=r(4188),i=r(2694),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},3086(e,t,r){var n,o,i,a=r(5945),s=r(9117),u=r(831),c=r(8088),f=r(4418),l=r(2694),h=r(168),p=r(7588),v="Object already initialized",g=s.TypeError,y=s.WeakMap;if(a||l.state){var d=l.state||(l.state=new y);d.get=d.get,d.has=d.has,d.set=d.set,n=function(e,t){if(d.has(e))throw new g(v);return t.facade=e,d.set(e,t),t},o=function(e){return d.get(e)||{}},i=function(e){return d.has(e)}}else{var m=h("state");p[m]=!0,n=function(e,t){if(f(e,m))throw new g(v);return t.facade=e,c(e,m,t),t},o=function(e){return f(e,m)?e[m]:{}},i=function(e){return f(e,m)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=o(t)).type!==e)throw new g("Incompatible receiver, "+e+" required");return r}}}},3165(e,t,r){r(495)},3168(e,t,r){var n=r(5604),o=r(6881),i=r(5629),a=r(156),s=r(3770),u=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),r=a.f;return r?u(t,r(e)):t}},3174(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3217(e,t,r){var n=r(5613),o=r(9944),i=r(1942),a=r(2735),s=r(4188),u=r(9383),c=r(1786),f=r(5054),l=r(3754),h=r(8088),p=r(7509),v=r(4282),g=r(9164),y=r(2037),d=a.PROPER,m=a.CONFIGURABLE,b=y.IteratorPrototype,w=y.BUGGY_SAFARI_ITERATORS,S=v("iterator"),x="keys",P="values",O="entries",L=function(){return this};e.exports=function(e,t,r,a,v,y,k){u(r,t,a);var j,R,U,A=function(e){if(e===v&&F)return F;if(!w&&e&&e in C)return C[e];switch(e){case x:case P:case O:return function(){return new r(this,e)}}return function(){return new r(this)}},E=t+" Iterator",T=!1,C=e.prototype,I=C[S]||C["@@iterator"]||v&&C[v],F=!w&&I||A(v),q="Array"===t&&C.entries||I;if(q&&(j=c(q.call(new e)))!==Object.prototype&&j.next&&(i||c(j)===b||(f?f(j,b):s(j[S])||p(j,S,L)),l(j,E,!0,!0),i&&(g[E]=L)),d&&v===P&&I&&I.name!==P&&(!i&&m?h(C,"name",P):(T=!0,F=function(){return o(I,this)})),v)if(R={values:A(P),keys:y?F:A(x),entries:A(O)},k)for(U in R)(w||T||!(U in C))&&p(C,U,R[U]);else n({target:t,proto:!0,forced:w||T},R);return i&&!k||C[S]===F||p(C,S,F,{name:v}),g[t]=F,R}},3315(e,t,r){var n=r(6893),o=r(5234);e.exports=n&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},3536(e,t,r){var n=r(5613),o=r(6881),i=r(675),a=RangeError,s=String.fromCharCode,u=String.fromCodePoint,c=o([].join);n({target:"String",stat:!0,arity:1,forced:!!u&&1!==u.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,o=0;n>o;){if(t=+arguments[o++],i(t,1114111)!==t)throw new a(t+" is not a valid code point");r[o]=t<65536?s(t):s(55296+((t-=65536)>>10),t%1024+56320)}return c(r,"")}})},3628(e,t,r){var n=r(9509),o=Object;e.exports=function(e){return o(n(e))}},3754(e,t,r){var n=r(4466).f,o=r(4418),i=r(4282)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!o(e,i)&&n(e,i,{configurable:!0,value:t})}},3770(e,t,r){var n=r(831),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not an object")}},3873(e,t,r){var n=r(380),o=r(5458),i=r(9164),a=r(3086),s=r(4466).f,u=r(3217),c=r(6224),f=r(1942),l=r(6893),h="Array Iterator",p=a.set,v=a.getterFor(h);e.exports=u(Array,"Array",function(e,t){p(this,{type:h,target:n(e),index:0,kind:t})},function(){var e=v(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,c(void 0,!0);switch(e.kind){case"keys":return c(r,!1);case"values":return c(t[r],!1)}return c([r,t[r]],!1)},"values");var g=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!f&&l&&"values"!==g.name)try{s(g,"name",{value:"values"})}catch(e){}},4121(e,t,r){var n=r(6712),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i("Can't set "+o(e)+" as a prototype")}},4188(e){var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},4212(e,t,r){var n=r(6881),o=r(6744),i=r(2618),a=r(9509),s=n("".charAt),u=n("".charCodeAt),c=n("".slice),f=function(e){return function(t,r){var n,f,l=i(a(t)),h=o(r),p=l.length;return h<0||h>=p?e?"":void 0:(n=u(l,h))<55296||n>56319||h+1===p||(f=u(l,h+1))<56320||f>57343?e?s(l,h):n:e?c(l,h,h+2):f-56320+(n-55296<<10)+65536}};e.exports={codeAt:f(!1),charAt:f(!0)}},4282(e,t,r){var n=r(9117),o=r(746),i=r(4418),a=r(6209),s=r(8944),u=r(9809),c=n.Symbol,f=o("wks"),l=u?c.for||c:c&&c.withoutSetter||a;e.exports=function(e){return i(f,e)||(f[e]=s&&i(c,e)?c[e]:l("Symbol."+e)),f[e]}},4318(e){e.exports=function(e){return null==e}},4320(e,t,r){var n=r(7509);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},4397(e,t,r){r(1615)},4412(e,t,r){var n=r(3770),o=r(8500);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){o(e,"throw",t)}}},4416(e,t){var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},4417(e,t,r){var n=r(6893),o=r(4466),i=r(9123);e.exports=function(e,t,r){n?o.f(e,t,i(0,r)):e[t]=r}},4418(e,t,r){var n=r(6881),o=r(3628),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},4466(e,t,r){var n=r(6893),o=r(9622),i=r(3315),a=r(3770),s=r(2344),u=TypeError,c=Object.defineProperty,f=Object.getOwnPropertyDescriptor,l="enumerable",h="configurable",p="writable";t.f=n?i?function(e,t,r){if(a(e),t=s(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&p in r&&!r[p]){var n=f(e,t);n&&n[p]&&(e[t]=r.value,r={configurable:h in r?r[h]:n[h],enumerable:l in r?r[l]:n[l],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(a(e),t=s(t),a(r),o)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new u("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},4530(e,t,r){var n=r(6881),o=r(5234),i=r(4188),a=r(4418),s=r(6893),u=r(2735).CONFIGURABLE,c=r(3029),f=r(3086),l=f.enforce,h=f.get,p=String,v=Object.defineProperty,g=n("".slice),y=n("".replace),d=n([].join),m=s&&!o(function(){return 8!==v(function(){},"length",{value:8}).length}),b=String(String).split("String"),w=e.exports=function(e,t,r){"Symbol("===g(p(t),0,7)&&(t="["+y(p(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||u&&e.name!==t)&&(s?v(e,"name",{value:t,configurable:!0}):e.name=t),m&&r&&a(r,"arity")&&e.length!==r.arity&&v(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&v(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=l(e);return a(n,"source")||(n.source=d(b,"string"==typeof t?t:"")),e};Function.prototype.toString=w(function(){return i(this)&&h(this).source||c(this)},"toString")},4541(e,t,r){var n=r(5613),o=r(9944);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return o(URL.prototype.toString,this)}})},4578(e,t,r){var n=r(6881);e.exports=n({}.isPrototypeOf)},4798(e,t,r){var n=r(9117),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},4977(e,t,r){var n=r(4188),o=r(3174),i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not a function")}},5054(e,t,r){var n=r(1025),o=r(831),i=r(9509),a=r(4121);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return i(r),a(n),o(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},5234(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},5268(e,t,r){var n=r(9117),o=r(6893),i=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!o)return n[e];var t=i(n,e);return t&&t.value}},5438(e,t,r){var n=r(9345),o=r(4188),i=r(8689),a=r(4282)("toStringTag"),s=Object,u="Arguments"===i(function(){return arguments}());e.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?r:u?i(t):"Object"===(n=i(t))&&o(t.callee)?"Arguments":n}},5458(e,t,r){var n=r(4282),o=r(7065),i=r(4466).f,a=n("unscopables"),s=Array.prototype;void 0===s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},5604(e,t,r){var n=r(9117),o=r(4188);e.exports=function(e,t){return arguments.length<2?(r=n[e],o(r)?r:void 0):n[e]&&n[e][t];var r}},5613(e,t,r){var n=r(9117),o=r(9304).f,i=r(8088),a=r(7509),s=r(4798),u=r(8657),c=r(8489);e.exports=function(e,t){var r,f,l,h,p,v=e.target,g=e.global,y=e.stat;if(r=g?n:y?n[v]||s(v,{}):n[v]&&n[v].prototype)for(f in t){if(h=t[f],l=e.dontCallGetSet?(p=o(r,f))&&p.value:r[f],!c(g?f:v+(y?".":"#")+f,e.forced)&&void 0!==l){if(typeof h==typeof l)continue;u(h,l)}(e.sham||l&&l.sham)&&i(h,"sham",!0),a(r,f,h,e)}}},5629(e,t,r){var n=r(1843),o=r(1274).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},5691(e,t,r){var n=r(8689),o=r(6881);e.exports=function(e){if("Function"===n(e))return o(e)}},5821(e,t,r){var n=r(5691),o=r(4977),i=r(9055),a=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},5926(e,t,r){var n=r(9117),o=r(831),i=n.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},5945(e,t,r){var n=r(9117),o=r(4188),i=n.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},6032(e,t,r){var n=r(5604),o=r(4188),i=r(4578),a=r(9809),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return o(t)&&i(t.prototype,s(e))}},6209(e,t,r){var n=r(6881),o=0,i=Math.random(),a=n(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},6224(e){e.exports=function(e,t){return{value:e,done:t}}},6294(e,t,r){var n=r(6881),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",u=RangeError,c=n(a.exec),f=Math.floor,l=String.fromCharCode,h=n("".charCodeAt),p=n([].join),v=n([].push),g=n("".replace),y=n("".split),d=n("".toLowerCase),m=function(e){return e+22+75*(e<26)},b=function(e,t,r){var n=0;for(e=r?f(e/700):e>>1,e+=f(e/t);e>455;)e=f(e/35),n+=36;return f(n+36*e/(e+38))},w=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=h(e,r++);if(o>=55296&&o<=56319&&r<n){var i=h(e,r++);56320==(64512&i)?v(t,((1023&o)<<10)+(1023&i)+65536):(v(t,o),r--)}else v(t,o)}return t}(e);var r,n,i=e.length,a=128,c=0,g=72;for(r=0;r<e.length;r++)(n=e[r])<128&&v(t,l(n));var y=t.length,d=y;for(y&&v(t,"-");d<i;){var w=o;for(r=0;r<e.length;r++)(n=e[r])>=a&&n<w&&(w=n);var S=d+1;if(w-a>f((o-c)/S))throw new u(s);for(c+=(w-a)*S,a=w,r=0;r<e.length;r++){if((n=e[r])<a&&++c>o)throw new u(s);if(n===a){for(var x=c,P=36;;){var O=P<=g?1:P>=g+26?26:P-g;if(x<O)break;var L=x-O,k=36-O;v(t,l(m(O+L%k))),x=f(L/k),P+=36}v(t,l(m(x))),g=b(c,S,d===y),c=0,d++}}c++,a++}return p(t,"")};e.exports=function(e){var t,r,n=[],o=y(g(d(e),a,"."),".");for(t=0;t<o.length;t++)r=o[t],v(n,c(i,r)?"xn--"+w(r):r);return p(n,".")}},6301(e,t,r){var n=r(5234),o=r(4282),i=r(6893),a=r(1942),s=o("iterator");e.exports=!n(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(e,r){t.delete("b"),n+=r+e}),r.delete("a",2),r.delete("b",void 0),a&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(a||!i)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host})},6712(e,t,r){var n=r(831);e.exports=function(e){return n(e)||null===e}},6744(e,t,r){var n=r(142);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},6859(e,t,r){var n=r(5821),o=r(9944),i=r(3628),a=r(4412),s=r(8146),u=r(866),c=r(9389),f=r(4417),l=r(2350),h=r(9874),p=Array;e.exports=function(e){var t=i(e),r=u(this),v=arguments.length,g=v>1?arguments[1]:void 0,y=void 0!==g;y&&(g=n(g,v>2?arguments[2]:void 0));var d,m,b,w,S,x,P=h(t),O=0;if(!P||this===p&&s(P))for(d=c(t),m=r?new this(d):p(d);d>O;O++)x=y?g(t[O],O):t[O],f(m,O,x);else for(m=r?new this:[],S=(w=l(t,P)).next;!(b=o(S,w)).done;O++)x=y?a(w,g,[b.value,O],!0):b.value,f(m,O,x);return m.length=O,m}},6881(e,t,r){var n=r(9055),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);e.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}},6893(e,t,r){var n=r(5234);e.exports=!n(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},7010(e,t,r){var n=r(9117),o=r(9429),i=r(7463),a=r(3873),s=r(8088),u=r(3754),c=r(4282)("iterator"),f=a.values,l=function(e,t){if(e){if(e[c]!==f)try{s(e,c,f)}catch(t){e[c]=f}if(u(e,t,!0),o[t])for(var r in a)if(e[r]!==a[r])try{s(e,r,a[r])}catch(t){e[r]=a[r]}}};for(var h in o)l(n[h]&&n[h].prototype,h);l(i,"DOMTokenList")},7065(e,t,r){var n,o=r(3770),i=r(30),a=r(1274),s=r(7588),u=r(7458),c=r(5926),f=r(168),l="prototype",h="script",p=f("IE_PROTO"),v=function(){},g=function(e){return"<"+h+">"+e+"</"+h+">"},y=function(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t},d=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;d="undefined"!=typeof document?document.domain&&n?y(n):(t=c("iframe"),r="java"+h+":",t.style.display="none",u.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F):y(n);for(var o=a.length;o--;)delete d[l][a[o]];return d()};s[p]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(v[l]=o(e),r=new v,v[l]=null,r[p]=e):r=d(),void 0===t?r:i.f(r,t)}},7137(e,t,r){var n=r(1843),o=r(1274);e.exports=Object.keys||function(e){return n(e,o)}},7458(e,t,r){var n=r(5604);e.exports=n("document","documentElement")},7463(e,t,r){var n=r(5926)("span").classList,o=n&&n.constructor&&n.constructor.prototype;e.exports=o===Object.prototype?void 0:o},7509(e,t,r){var n=r(4188),o=r(4466),i=r(4530),a=r(4798);e.exports=function(e,t,r,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:t;if(n(r)&&i(r,c,s),s.global)u?e[t]=r:a(t,r);else{try{s.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=r:o.f(e,t,{value:r,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},7568(e,t,r){var n=r(6881),o=r(5234),i=r(8689),a=Object,s=n("".split);e.exports=o(function(){return!a("z").propertyIsEnumerable(0)})?function(e){return"String"===i(e)?s(e,""):a(e)}:a},7588(e){e.exports={}},7611(e,t,r){var n=r(6744),o=Math.min;e.exports=function(e){var t=n(e);return t>0?o(t,9007199254740991):0}},7825(e,t,r){var n=r(6881);e.exports=n([].slice)},7905(e,t,r){var n=r(6893),o=r(6881),i=r(997),a=URLSearchParams.prototype,s=o(a.forEach);n&&!("size"in a)&&i(a,"size",{get:function(){var e=0;return s(this,function(){e++}),e},configurable:!0,enumerable:!0})},8060(e,t,r){var n=r(9117).navigator,o=n&&n.userAgent;e.exports=o?String(o):""},8088(e,t,r){var n=r(6893),o=r(4466),i=r(9123);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},8146(e,t,r){var n=r(4282),o=r(9164),i=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},8489(e,t,r){var n=r(5234),o=r(4188),i=/#|\.prototype\./,a=function(e,t){var r=u[s(e)];return r===f||r!==c&&(o(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},u=a.data={},c=a.NATIVE="N",f=a.POLYFILL="P";e.exports=a},8500(e,t,r){var n=r(9944),o=r(3770),i=r(2913);e.exports=function(e,t,r){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw r;if(s)throw a;return o(a),r}},8657(e,t,r){var n=r(4418),o=r(3168),i=r(9304),a=r(4466);e.exports=function(e,t,r){for(var s=o(t),u=a.f,c=i.f,f=0;f<s.length;f++){var l=s[f];n(e,l)||r&&n(r,l)||u(e,l,c(t,l))}}},8689(e,t,r){var n=r(6881),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},8944(e,t,r){var n=r(3008),o=r(5234),i=r(9117).String;e.exports=!!Object.getOwnPropertySymbols&&!o(function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},9055(e,t,r){var n=r(5234);e.exports=!n(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},9117(e,t,r){var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9123(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},9164(e){e.exports={}},9295(e,t,r){var n=r(7825),o=Math.floor,i=function(e,t){var r=e.length;if(r<8)for(var a,s,u=1;u<r;){for(s=u,a=e[u];s&&t(e[s-1],a)>0;)e[s]=e[--s];s!==u++&&(e[s]=a)}else for(var c=o(r/2),f=i(n(e,0,c),t),l=i(n(e,c),t),h=f.length,p=l.length,v=0,g=0;v<h||g<p;)e[v+g]=v<h&&g<p?t(f[v],l[g])<=0?f[v++]:l[g++]:v<h?f[v++]:l[g++];return e};e.exports=i},9304(e,t,r){var n=r(6893),o=r(9944),i=r(4416),a=r(9123),s=r(380),u=r(2344),c=r(4418),f=r(9622),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=s(e),t=u(t),f)try{return l(e,t)}catch(e){}if(c(e,t))return a(!o(i.f,e,t),e[t])}},9345(e,t,r){var n={};n[r(4282)("toStringTag")]="z",e.exports="[object z]"===String(n)},9383(e,t,r){var n=r(2037).IteratorPrototype,o=r(7065),i=r(9123),a=r(3754),s=r(9164),u=function(){return this};e.exports=function(e,t,r,c){var f=t+" Iterator";return e.prototype=o(n,{next:i(+!c,r)}),a(e,f,!1,!0),s[f]=u,e}},9389(e,t,r){var n=r(7611);e.exports=function(e){return n(e.length)}},9429(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},9445(e){var t=TypeError;e.exports=function(e,r){if(e<r)throw new t("Not enough arguments");return e}},9456(e,t,r){var n=r(6893),o=r(6881),i=r(9944),a=r(5234),s=r(7137),u=r(156),c=r(4416),f=r(3628),l=r(7568),h=Object.assign,p=Object.defineProperty,v=o([].concat);e.exports=!h||a(function(){if(n&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),o="abcdefghijklmnopqrst";return e[r]=7,o.split("").forEach(function(e){t[e]=e}),7!==h({},e)[r]||s(h({},t)).join("")!==o})?function(e,t){for(var r=f(e),o=arguments.length,a=1,h=u.f,p=c.f;o>a;)for(var g,y=l(arguments[a++]),d=h?v(s(y),h(y)):s(y),m=d.length,b=0;m>b;)g=d[b++],n&&!i(p,y,g)||(r[g]=y[g]);return r}:h},9509(e,t,r){var n=r(4318),o=TypeError;e.exports=function(e){if(n(e))throw new o("Can't call method on "+e);return e}},9622(e,t,r){var n=r(6893),o=r(5234),i=r(5926);e.exports=!n&&!o(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},9809(e,t,r){var n=r(8944);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},9874(e,t,r){var n=r(5438),o=r(2913),i=r(4318),a=r(9164),s=r(4282)("iterator");e.exports=function(e){if(!i(e))return o(e,s)||o(e,"@@iterator")||a[n(e)]}},9944(e,t,r){var n=r(9055),o=Function.prototype.call;e.exports=n?o.bind(o):function(){return o.apply(o,arguments)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.m=e,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.u=e=>e+".worker-factory.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.b="undefined"!=typeof document&&document.baseURI||self.location.href;var n={};r.r(n),r.d(n,{createWorkerInstance:()=>o}),r(3873),r(630),r(1011),r(7010),r(3165),r(4541),r(4397),r(1412),r(1883),r(7905);var o=function(){return new Worker(new URL(r.p+r.u(545),r.b),{type:void 0})};return n})());
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.createWorkerInstance = void 0;
8
+ require("core-js/modules/es.array.iterator.js");
9
+ require("core-js/modules/es.object.to-string.js");
10
+ require("core-js/modules/es.string.iterator.js");
11
+ require("core-js/modules/web.dom-collections.iterator.js");
12
+ require("core-js/modules/web.url.js");
13
+ require("core-js/modules/web.url.to-json.js");
14
+ require("core-js/modules/web.url-search-params.js");
15
+ require("core-js/modules/web.url-search-params.delete.js");
16
+ require("core-js/modules/web.url-search-params.has.js");
17
+ require("core-js/modules/web.url-search-params.size.js");
18
+ var createWorkerInstance = exports.createWorkerInstance = function createWorkerInstance() {
19
+ return new Worker(new URL('./worker-entry', import.meta.url), {
20
+ type: 'module'
21
+ });
22
+ };
@@ -0,0 +1,12 @@
1
+ import "core-js/modules/es.function.bind.js";
2
+ import "core-js/modules/es.function.name.js";
3
+ /**
4
+ * Binds correct instance to `this`.
5
+ * Note: put it to first before all other annotations in order to take effect.
6
+ */
7
+ export var bound = function bound(originalMethod, context) {
8
+ context.addInitializer(function () {
9
+ //@ts-ignore
10
+ this[context.name] = this[context.name].bind(this);
11
+ });
12
+ };
@@ -0,0 +1,4 @@
1
+ export { trace } from './log';
2
+ export { bound } from './bound';
3
+ export { debounced, throttled } from './lodash';
4
+ export { validateParams } from './validate';
@@ -0,0 +1,34 @@
1
+ import "core-js/modules/es.function.name.js";
2
+ import debounce from 'lodash/debounce';
3
+ import throttle from 'lodash/throttle';
4
+ export var cleanup = function cleanup() {};
5
+
6
+ /**
7
+ * Makes methods debounced
8
+ * @param wait
9
+ * @param options
10
+ * @returns
11
+ */
12
+ export var debounced = function debounced(wait, options) {
13
+ return function (originalMethod, context) {
14
+ context.addInitializer(function () {
15
+ //@ts-ignore
16
+ this[context.name] = debounce(this[context.name], wait, options);
17
+ });
18
+ };
19
+ };
20
+
21
+ /**
22
+ * Makes methods throttled
23
+ * @param wait
24
+ * @param options
25
+ * @returns
26
+ */
27
+ export var throttled = function throttled(wait, options) {
28
+ return function (originalMethod, context) {
29
+ context.addInitializer(function () {
30
+ //@ts-ignore
31
+ this[context.name] = throttle(this[context.name], wait, options);
32
+ });
33
+ };
34
+ };
@@ -0,0 +1,79 @@
1
+ import "core-js/modules/es.array.concat.js";
2
+ import "core-js/modules/es.date.to-string.js";
3
+ import "core-js/modules/es.function.name.js";
4
+ import { Result } from '../../utilities/interceptor';
5
+ import { randomString } from '../../utilities/misc';
6
+ import { InvocationEventType } from '../type';
7
+ import { serialize, serializeArgs } from './log-serializer';
8
+ var formatCallLog = function formatCallLog(identifier, args) {
9
+ var msg = '';
10
+ if (args !== null && args !== void 0 && args.length) {
11
+ msg += "[parameters: ".concat(serializeArgs(args), "]");
12
+ }
13
+ return "".concat(identifier.methodName, " [API Call]").concat(msg, "[traceId: ").concat(identifier.traceId, "]");
14
+ };
15
+
16
+ // const formatReturnLog = (
17
+ // identifier: { className: string; methodName: string; traceId: string },
18
+ // elapsed: number,
19
+ // args?: unknown[],
20
+ // returnValue?: unknown,
21
+ // thrown?: Error,
22
+ // ) => {
23
+ // let msg = '';
24
+ // if (args?.length) {
25
+ // msg += `[parameters: ${serializeArgs(args)}]`;
26
+ // }
27
+
28
+ // if (thrown) {
29
+ // msg += `[throw: ${thrown.name}]`;
30
+ // msg += `[message: ${thrown.message}]`;
31
+ // } else if (typeof returnValue !== 'undefined') {
32
+ // msg += `[return: ${serialize(returnValue)}]`;
33
+ // }
34
+
35
+ // return `${identifier.methodName} [API Call]${msg}[elapsed: ${elapsed}ms]`;
36
+ // };
37
+
38
+ export var createLogHandler = function createLogHandler(holder) {
39
+ return function (evt) {
40
+ if (evt.type === InvocationEventType.PRE) {
41
+ var _evt$arguments;
42
+ evt.context.start = new Date().getTime();
43
+ evt.context.traceId = randomString(5);
44
+ var msg = formatCallLog({
45
+ className: evt["class"],
46
+ methodName: evt.method,
47
+ traceId: evt.context.traceId
48
+ }, (_evt$arguments = evt.arguments) !== null && _evt$arguments !== void 0 ? _evt$arguments : []);
49
+ holder.logger.info(msg);
50
+ } else {
51
+ var elapsed = new Date().getTime() - evt.context.start;
52
+ // const msg = formatReturnLog(
53
+ // {
54
+ // className: evt.class,
55
+ // methodName: evt.method,
56
+ // traceId: evt.context.traceId,
57
+ // },
58
+ // elapsed,
59
+ // evt.arguments ?? [],
60
+ // evt.return,
61
+ // evt.error,
62
+ // );
63
+ // if (evt.error) {
64
+ // holder.logger.error(msg);
65
+ // } else {
66
+ // holder.logger.info(msg);
67
+ // }
68
+
69
+ if (evt.error) {
70
+ var _msg = "".concat(evt.method, " [throw: ").concat(evt.error.name, "][message: ").concat(evt.error.message, "][elapsed: ").concat(elapsed, "ms][traceId: ").concat(evt.context.traceId, "]");
71
+ holder.logger.error(_msg);
72
+ } else {
73
+ var _msg2 = "".concat(evt.method, " [return: ").concat(serialize(evt["return"]), "][elapsed: ").concat(elapsed, "ms][traceId: ").concat(evt.context.traceId, "]");
74
+ holder.logger.info(_msg2);
75
+ }
76
+ }
77
+ return Result.CONTINUE;
78
+ };
79
+ };
@@ -0,0 +1,28 @@
1
+ import "core-js/modules/es.function.name.js";
2
+ import { proxyMethod } from '../proxy';
3
+ import { createLogHandler } from './handler';
4
+ import { getLogger } from '../../logger';
5
+
6
+ /**
7
+ * Enables logging for invocation detail of the target method.
8
+ * @param targetOrProto The class or prototype that the method belongs to.
9
+ * @param methodName The name of the method.
10
+ */
11
+ var _trace = function _trace(originalMethod, context) {
12
+ var methodName = String(context.name);
13
+ if (context.kind === 'method') {
14
+ context.addInitializer(function () {
15
+ var logger = getLogger({
16
+ label: 'default'
17
+ });
18
+
19
+ // use default logger for trace if not set
20
+ if (!this.logger) {
21
+ this.logger = logger;
22
+ }
23
+ var handler = createLogHandler(this);
24
+ this[context.name] = proxyMethod(this[context.name], this, methodName, handler);
25
+ });
26
+ }
27
+ };
28
+ export var trace = _trace;
@@ -0,0 +1,15 @@
1
+ import "core-js/modules/es.array.join.js";
2
+ import "core-js/modules/es.array.map.js";
3
+ import "core-js/modules/es.object.to-string.js";
4
+ import "core-js/modules/esnext.iterator.constructor.js";
5
+ import "core-js/modules/esnext.iterator.map.js";
6
+ import { jsonstring } from '../../utilities/misc';
7
+ export var serialize = function serialize(data) {
8
+ if (typeof data === 'string') {
9
+ return data;
10
+ }
11
+ return "".concat(jsonstring(data));
12
+ };
13
+ export var serializeArgs = function serializeArgs(args) {
14
+ return "".concat(args.map(serialize).join(' '));
15
+ };
@@ -0,0 +1,149 @@
1
+ import _createClass from "@babel/runtime/helpers/createClass";
2
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
6
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
+ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
8
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
+ import "core-js/modules/es.array.concat.js";
11
+ import "core-js/modules/es.array.for-each.js";
12
+ import "core-js/modules/es.array.index-of.js";
13
+ import "core-js/modules/es.array.push.js";
14
+ import "core-js/modules/es.function.name.js";
15
+ import "core-js/modules/es.object.define-property.js";
16
+ import "core-js/modules/es.object.get-own-property-descriptor.js";
17
+ import "core-js/modules/es.object.get-own-property-names.js";
18
+ import "core-js/modules/es.object.get-prototype-of.js";
19
+ import "core-js/modules/es.object.keys.js";
20
+ import "core-js/modules/es.object.to-string.js";
21
+ import "core-js/modules/es.promise.js";
22
+ import "core-js/modules/es.promise.finally.js";
23
+ import "core-js/modules/es.reflect.construct.js";
24
+ import "core-js/modules/esnext.iterator.constructor.js";
25
+ import "core-js/modules/esnext.iterator.for-each.js";
26
+ import "core-js/modules/web.dom-collections.for-each.js";
27
+ import { InvocationEventType } from './type';
28
+ var failQuitely = function failQuitely(func, args) {
29
+ try {
30
+ return func.apply(void 0, _toConsumableArray(args));
31
+ } catch (e) {}
32
+ };
33
+ var invokeMethod = function invokeMethod(instance, method, proto, propertyName, args, hanlder) {
34
+ var context = {};
35
+ failQuitely(hanlder, [{
36
+ type: InvocationEventType.PRE,
37
+ arguments: args,
38
+ method: propertyName,
39
+ "class": proto.constructor.__$$className || proto.constructor.name,
40
+ context: context
41
+ }]);
42
+
43
+ // provide a way for invoking method regardless it is async or sync function, attach the return value and the error(if it occurred) to the event object
44
+ var returnVal = method.apply(instance, args);
45
+ var post = function post(val, error) {
46
+ failQuitely(hanlder, [{
47
+ type: InvocationEventType.POST,
48
+ arguments: args,
49
+ "return": val,
50
+ method: propertyName,
51
+ "class": proto.constructor.__$$className || proto.constructor.name,
52
+ context: context,
53
+ error: error
54
+ }]);
55
+ };
56
+ var isThenable = returnVal && !!returnVal.then;
57
+ if (isThenable) {
58
+ // capture async return and potential error
59
+ var rtnTemp, errTemp;
60
+ returnVal.then(function (r) {
61
+ rtnTemp = r;
62
+ })["catch"](function (e) {
63
+ errTemp = e;
64
+ })["finally"](function () {
65
+ post(rtnTemp, errTemp);
66
+ });
67
+ } else {
68
+ post(returnVal);
69
+ }
70
+ return returnVal;
71
+ };
72
+ export var proxyMethod = function proxyMethod(method, proto, propertyName, handler) {
73
+ return function () {
74
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
75
+ args[_key] = arguments[_key];
76
+ }
77
+ return invokeMethod(this, method, proto, propertyName, args, handler);
78
+ };
79
+ };
80
+ var getMethods = function getMethods(target) {
81
+ var allProps = [];
82
+ var allMethods = [];
83
+ var curr = target;
84
+ while ((curr = Object.getPrototypeOf(curr)) && curr !== Object.prototype) {
85
+ var props = Object.getOwnPropertyNames(curr);
86
+ props.forEach(function (prop) {
87
+ if (allProps.indexOf(prop) === -1) {
88
+ allProps.push(prop);
89
+ if (prop === 'constructor') {
90
+ return;
91
+ }
92
+ try {
93
+ if (typeof target[prop] === 'function') {
94
+ allMethods.push(prop);
95
+ }
96
+ } catch (e) {
97
+ var descptor = Object.getOwnPropertyDescriptor(curr, prop);
98
+ if (typeof (descptor === null || descptor === void 0 ? void 0 : descptor.value) === 'function') {
99
+ // it's a method of a class
100
+ allMethods.push(prop);
101
+ } else {
102
+ // Logger.info('undetermined type of property', descptor, curr, prop);
103
+ }
104
+ }
105
+ }
106
+ });
107
+ }
108
+ return allMethods;
109
+ };
110
+ export var extendConstructor = function extendConstructor(constructor, handler, extendProps, proxyMethods) {
111
+ var _Class;
112
+ return _Class = /*#__PURE__*/function (_constructor) {
113
+ function _Class() {
114
+ var _this;
115
+ _classCallCheck(this, _Class);
116
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
117
+ args[_key2] = arguments[_key2];
118
+ }
119
+ _this = _callSuper(this, _Class, [].concat(args));
120
+ if (proxyMethods) {
121
+ var methods = getMethods(_this);
122
+ // proxy methods
123
+ // redefine methods on the instance
124
+ methods.forEach(function (propertyName) {
125
+ var method = _this[propertyName];
126
+ Object.defineProperty(_this, propertyName, {
127
+ writable: true,
128
+ configurable: true,
129
+ enumerable: false,
130
+ value: proxyMethod(method, _this, propertyName, handler)
131
+ });
132
+ });
133
+ }
134
+
135
+ // mount extend properties
136
+ Object.keys(extendProps).forEach(function (propertyName) {
137
+ Object.defineProperty(_this, propertyName, {
138
+ configurable: true,
139
+ enumerable: false,
140
+ writable: false,
141
+ value: extendProps[propertyName]
142
+ });
143
+ });
144
+ return _this;
145
+ }
146
+ _inherits(_Class, _constructor);
147
+ return _createClass(_Class);
148
+ }(constructor), _defineProperty(_Class, "__$$className", constructor.name), _Class;
149
+ };
@@ -0,0 +1,7 @@
1
+ export var InvocationEventType = /*#__PURE__*/function (InvocationEventType) {
2
+ InvocationEventType[InvocationEventType["PRE"] = 0] = "PRE";
3
+ InvocationEventType[InvocationEventType["POST"] = 1] = "POST";
4
+ return InvocationEventType;
5
+ }({});
6
+
7
+ // make it interceptable
@@ -0,0 +1,32 @@
1
+ import "core-js/modules/es.error.cause.js";
2
+ import "core-js/modules/es.error.to-string.js";
3
+ import "core-js/modules/es.array.concat.js";
4
+ import "core-js/modules/es.array.for-each.js";
5
+ import "core-js/modules/es.function.name.js";
6
+ import "core-js/modules/es.object.to-string.js";
7
+ import "core-js/modules/esnext.iterator.constructor.js";
8
+ import "core-js/modules/esnext.iterator.for-each.js";
9
+ import "core-js/modules/web.dom-collections.for-each.js";
10
+ function validateParams(handlerError) {
11
+ return function () {
12
+ for (var _len = arguments.length, schemas = new Array(_len), _key = 0; _key < _len; _key++) {
13
+ schemas[_key] = arguments[_key];
14
+ }
15
+ return function (originalMethod, context) {
16
+ return function () {
17
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
18
+ args[_key2] = arguments[_key2];
19
+ }
20
+ schemas.forEach(function (schema, index) {
21
+ var result = schema.safeParse(args[index]);
22
+ if (!result.success) {
23
+ var message = "invalid params: ".concat(result.error.message, " Method:").concat(originalMethod.name);
24
+ throw handlerError && handlerError(result.error) || Error(message);
25
+ }
26
+ });
27
+ return originalMethod.apply(this, args);
28
+ };
29
+ };
30
+ };
31
+ }
32
+ export { validateParams };
@@ -0,0 +1,45 @@
1
+ import "core-js/modules/es.array.iterator.js";
2
+ import "core-js/modules/es.map.js";
3
+ import "core-js/modules/es.object.to-string.js";
4
+ import "core-js/modules/es.set.js";
5
+ import "core-js/modules/es.string.iterator.js";
6
+ import "core-js/modules/esnext.map.delete-all.js";
7
+ import "core-js/modules/esnext.map.emplace.js";
8
+ import "core-js/modules/esnext.map.every.js";
9
+ import "core-js/modules/esnext.map.filter.js";
10
+ import "core-js/modules/esnext.map.find.js";
11
+ import "core-js/modules/esnext.map.find-key.js";
12
+ import "core-js/modules/esnext.map.includes.js";
13
+ import "core-js/modules/esnext.map.key-of.js";
14
+ import "core-js/modules/esnext.map.map-keys.js";
15
+ import "core-js/modules/esnext.map.map-values.js";
16
+ import "core-js/modules/esnext.map.merge.js";
17
+ import "core-js/modules/esnext.map.reduce.js";
18
+ import "core-js/modules/esnext.map.some.js";
19
+ import "core-js/modules/esnext.map.update.js";
20
+ import "core-js/modules/esnext.set.add-all.js";
21
+ import "core-js/modules/esnext.set.delete-all.js";
22
+ import "core-js/modules/esnext.set.difference.v2.js";
23
+ import "core-js/modules/esnext.set.difference.js";
24
+ import "core-js/modules/esnext.set.every.js";
25
+ import "core-js/modules/esnext.set.filter.js";
26
+ import "core-js/modules/esnext.set.find.js";
27
+ import "core-js/modules/esnext.set.intersection.v2.js";
28
+ import "core-js/modules/esnext.set.intersection.js";
29
+ import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
30
+ import "core-js/modules/esnext.set.is-disjoint-from.js";
31
+ import "core-js/modules/esnext.set.is-subset-of.v2.js";
32
+ import "core-js/modules/esnext.set.is-subset-of.js";
33
+ import "core-js/modules/esnext.set.is-superset-of.v2.js";
34
+ import "core-js/modules/esnext.set.is-superset-of.js";
35
+ import "core-js/modules/esnext.set.join.js";
36
+ import "core-js/modules/esnext.set.map.js";
37
+ import "core-js/modules/esnext.set.reduce.js";
38
+ import "core-js/modules/esnext.set.some.js";
39
+ import "core-js/modules/esnext.set.symmetric-difference.v2.js";
40
+ import "core-js/modules/esnext.set.symmetric-difference.js";
41
+ import "core-js/modules/esnext.set.union.v2.js";
42
+ import "core-js/modules/esnext.set.union.js";
43
+ import "core-js/modules/web.dom-collections.iterator.js";
44
+ export var loggerRegistrar = new Map();
45
+ export var loggerLabels = new Set();
@@ -0,0 +1,3 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import { LogLevel } from './type';
3
+ export var logLevelMap = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, LogLevel.ERROR, 'error'), LogLevel.WARN, 'warn'), LogLevel.INFO, 'info'), LogLevel.DEBUG, 'debug'), "debug", LogLevel.DEBUG), "info", LogLevel.INFO), "warn", LogLevel.WARN), "error", LogLevel.ERROR);
@@ -0,0 +1,61 @@
1
+ import "core-js/modules/es.symbol.js";
2
+ import "core-js/modules/es.array.push.js";
3
+ import "core-js/modules/es.object.define-properties.js";
4
+ import "core-js/modules/es.object.define-property.js";
5
+ import "core-js/modules/es.object.get-own-property-descriptor.js";
6
+ import "core-js/modules/es.object.get-own-property-descriptors.js";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ import "core-js/modules/es.array.filter.js";
9
+ import "core-js/modules/es.array.for-each.js";
10
+ import "core-js/modules/es.array.index-of.js";
11
+ import "core-js/modules/es.object.keys.js";
12
+ import "core-js/modules/es.object.to-string.js";
13
+ import "core-js/modules/esnext.iterator.constructor.js";
14
+ import "core-js/modules/esnext.iterator.filter.js";
15
+ import "core-js/modules/esnext.iterator.for-each.js";
16
+ import "core-js/modules/web.dom-collections.for-each.js";
17
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
+ var methods = ['info', 'error', 'warn', 'debug'];
20
+ export var originConsole = window.console;
21
+ export var setupConsoleHijack = function setupConsoleHijack(logger) {
22
+ var console = _objectSpread({}, originConsole);
23
+ //@ts-ignore
24
+ if (console.__hijackSetup) {
25
+ console.log('[logger] hijack already setup!');
26
+ return;
27
+ }
28
+ console.log("[logger] setup hijack..");
29
+ function proxy(methodName) {
30
+ return function () {
31
+ switch (methodName) {
32
+ case 'debug':
33
+ logger.debug.apply(logger, arguments);
34
+ break;
35
+ case 'info':
36
+ logger.info.apply(logger, arguments);
37
+ break;
38
+ case 'warn':
39
+ logger.warn.apply(logger, arguments);
40
+ break;
41
+ case 'error':
42
+ logger.error.apply(logger, arguments);
43
+ break;
44
+ }
45
+ };
46
+ }
47
+ Object.keys(console).filter(function (e) {
48
+ return methods.indexOf(e) >= 0;
49
+ }).forEach(function (methodName) {
50
+ console[methodName] = proxy(methodName);
51
+ });
52
+ //@ts-ignore
53
+ console.__hijackSetup = true;
54
+ window.console = console;
55
+ };
56
+ export var restoreConsoleHijack = function restoreConsoleHijack() {
57
+ console.log("[logger] restore hijack..");
58
+ window.console = originConsole;
59
+ //@ts-ignore
60
+ console.__hijackSetup = false;
61
+ };