netlicensing-client 2.0.0 → 2.0.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.
- package/README.md +1 -1
- package/dist/index.d.mts +25 -39
- package/dist/index.d.ts +25 -39
- package/dist/index.global.js +6 -6
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/index.global.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var NetLicensing=(()=>{var At=Object.defineProperty;var Ko=Object.getOwnPropertyDescriptor;var Jo=Object.getOwnPropertyNames;var Go=Object.prototype.hasOwnProperty;var hn=(n,e)=>{for(var o in e)At(n,o,{get:e[o],enumerable:!0})},Wo=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Jo(e))!Go.call(n,r)&&r!==o&&At(n,r,{get:()=>e[r],enumerable:!(t=Ko(e,r))||t.enumerable});return n};var Xo=n=>Wo(At({},"__esModule",{value:!0}),n);var zs={};hn(zs,{ApiKeyRole:()=>Pn,Bundle:()=>qe,BundleService:()=>Mo,Constants:()=>h,Context:()=>zo,Country:()=>He,License:()=>re,LicenseService:()=>Uo,LicenseTemplate:()=>Ye,LicenseTemplateService:()=>ko,LicenseTransactionJoin:()=>ht,LicenseType:()=>Te,Licensee:()=>ze,LicenseeSecretMode:()=>Be,LicenseeService:()=>_o,LicensingModel:()=>yn,NlicError:()=>j,NodeSecretMode:()=>En,Notification:()=>Ke,NotificationEvent:()=>ge,NotificationProtocol:()=>he,NotificationService:()=>jo,Page:()=>x,PaymentMethod:()=>Je,PaymentMethodEnum:()=>Dn,PaymentMethodService:()=>Bo,Product:()=>Ge,ProductDiscount:()=>ft,ProductModule:()=>Tt,ProductModuleService:()=>Fo,ProductService:()=>Vo,SecurityMode:()=>V,Service:()=>f,TimeVolumePeriod:()=>Fe,Token:()=>gt,TokenService:()=>qo,TokenType:()=>Pe,Transaction:()=>Ae,TransactionService:()=>Ho,TransactionSource:()=>Ve,TransactionStatus:()=>ye,UtilityService:()=>$o,ValidationParameters:()=>Yo,ValidationResults:()=>Dt,defineEntity:()=>R,ensureNotEmpty:()=>E,ensureNotNull:()=>v,filterDecode:()=>wo,filterEncode:()=>S,isDefined:()=>cn,isValid:()=>we,itemToBundle:()=>G,itemToCountry:()=>$e,itemToLicense:()=>z,itemToLicenseTemplate:()=>X,itemToLicensee:()=>W,itemToNotification:()=>Q,itemToObject:()=>N,itemToPaymentMethod:()=>se,itemToProduct:()=>ee,itemToProductModule:()=>te,itemToToken:()=>pe,itemToTransaction:()=>ne,serialize:()=>L});var Qo=Object.freeze({DISABLED:"DISABLED",PREDEFINED:"PREDEFINED",CLIENT:"CLIENT"}),Be=Qo;var Zo=Object.freeze({FEATURE:"FEATURE",TIMEVOLUME:"TIMEVOLUME",FLOATING:"FLOATING",QUANTITY:"QUANTITY"}),Te=Zo;var er=Object.freeze({LICENSEE_CREATED:"LICENSEE_CREATED",LICENSE_CREATED:"LICENSE_CREATED",WARNING_LEVEL_CHANGED:"WARNING_LEVEL_CHANGED",PAYMENT_TRANSACTION_PROCESSED:"PAYMENT_TRANSACTION_PROCESSED"}),ge=er;var tr=Object.freeze({WEBHOOK:"WEBHOOK"}),he=tr;var nr=Object.freeze({BASIC_AUTHENTICATION:"BASIC_AUTH",APIKEY_IDENTIFICATION:"APIKEY",ANONYMOUS_IDENTIFICATION:"ANONYMOUS"}),V=nr;var or=Object.freeze({DAY:"DAY",WEEK:"WEEK",MONTH:"MONTH",YEAR:"YEAR"}),Fe=or;var rr=Object.freeze({DEFAULT:"DEFAULT",SHOP:"SHOP",APIKEY:"APIKEY",ACTION:"ACTION"}),Pe=rr;var sr=Object.freeze({SHOP:"SHOP",AUTO_LICENSE_CREATE:"AUTO_LICENSE_CREATE",AUTO_LICENSE_UPDATE:"AUTO_LICENSE_UPDATE",AUTO_LICENSE_DELETE:"AUTO_LICENSE_DELETE",AUTO_LICENSEE_CREATE:"AUTO_LICENSEE_CREATE",AUTO_LICENSEE_DELETE:"AUTO_LICENSEE_DELETE",AUTO_LICENSEE_VALIDATE:"AUTO_LICENSEE_VALIDATE",AUTO_LICENSETEMPLATE_DELETE:"AUTO_LICENSETEMPLATE_DELETE",AUTO_PRODUCTMODULE_DELETE:"AUTO_PRODUCTMODULE_DELETE",AUTO_PRODUCT_DELETE:"AUTO_PRODUCT_DELETE",AUTO_LICENSES_TRANSFER:"AUTO_LICENSES_TRANSFER",SUBSCRIPTION_UPDATE:"SUBSCRIPTION_UPDATE",RECURRING_PAYMENT:"RECURRING_PAYMENT",CANCEL_RECURRING_PAYMENT:"CANCEL_RECURRING_PAYMENT",OBTAIN_BUNDLE:"OBTAIN_BUNDLE"}),Ve=sr;var ir=Object.freeze({PENDING:"PENDING",CLOSED:"CLOSED",CANCELLED:"CANCELLED"}),ye=ir;var h={LicenseeSecretMode:Be,LicenseType:Te,NotificationEvent:ge,NotificationProtocol:he,SecurityMode:V,TimeVolumePeriod:Fe,TokenType:Pe,TransactionSource:Ve,TransactionStatus:ye,BASIC_AUTHENTICATION:"BASIC_AUTH",APIKEY_IDENTIFICATION:"APIKEY",ANONYMOUS_IDENTIFICATION:"ANONYMOUS",FILTER:"filter",Product:{TYPE:"Product",ENDPOINT_PATH:"product"},ProductModule:{TYPE:"ProductModule",ENDPOINT_PATH:"productmodule",PRODUCT_MODULE_NUMBER:"productModuleNumber"},Licensee:{TYPE:"Licensee",ENDPOINT_PATH:"licensee",ENDPOINT_PATH_VALIDATE:"validate",ENDPOINT_PATH_TRANSFER:"transfer",LICENSEE_NUMBER:"licenseeNumber"},LicenseTemplate:{TYPE:"LicenseTemplate",ENDPOINT_PATH:"licensetemplate",LicenseType:Te},License:{TYPE:"License",ENDPOINT_PATH:"license"},Validation:{TYPE:"ProductModuleValidation"},Token:{TYPE:"Token",ENDPOINT_PATH:"token",Type:Pe},PaymentMethod:{TYPE:"PaymentMethod",ENDPOINT_PATH:"paymentmethod"},Bundle:{TYPE:"Bundle",ENDPOINT_PATH:"bundle",ENDPOINT_OBTAIN_PATH:"obtain"},Notification:{TYPE:"Notification",ENDPOINT_PATH:"notification",Protocol:he,Event:ge},Transaction:{TYPE:"Transaction",ENDPOINT_PATH:"transaction",Status:ye},Utility:{ENDPOINT_PATH:"utility",ENDPOINT_PATH_LICENSE_TYPES:"licenseTypes",ENDPOINT_PATH_LICENSING_MODELS:"licensingModels",ENDPOINT_PATH_COUNTRIES:"countries",LICENSING_MODEL_TYPE:"LicensingModelProperties",LICENSE_TYPE:"LicenseType",COUNTRY_TYPE:"Country"}};var ar=Object.freeze({ROLE_APIKEY_LICENSEE:"ROLE_APIKEY_LICENSEE",ROLE_APIKEY_ANALYTICS:"ROLE_APIKEY_ANALYTICS",ROLE_APIKEY_OPERATION:"ROLE_APIKEY_OPERATION",ROLE_APIKEY_MAINTENANCE:"ROLE_APIKEY_MAINTENANCE",ROLE_APIKEY_ADMIN:"ROLE_APIKEY_ADMIN"}),Pn=ar;var cr=Object.freeze({TRY_AND_BUY:"TryAndBuy",SUBSCRIPTION:"Subscription",RENTAL:"Rental",FLOATING:"Floating",MULTI_FEATURE:"MultiFeature",PAY_PER_USE:"PayPerUse",PRICING_TABLE:"PricingTable",QUOTA:"Quota",NODE_LOCKED:"NodeLocked",DISCOUNT:"Discount"}),yn=cr;var ur=Object.freeze({PREDEFINED:"PREDEFINED",CLIENT:"CLIENT"}),En=ur;var dr=Object.freeze({NULL:"NULL",PAYPAL:"PAYPAL",PAYPAL_SANDBOX:"PAYPAL_SANDBOX",STRIPE:"STRIPE",STRIPE_TESTING:"STRIPE_TESTING"}),Dn=dr;var mr=n=>{try{return JSON.parse(n)}catch{return n}},pr=n=>{let e={};return n?.forEach(({name:o,value:t})=>{e[o]=mr(t)}),e},lr=n=>{let e={};return n?.forEach(o=>{let{name:t}=o;e[t]=e[t]||[],e[t].push(bn(o))}),e},bn=n=>n?{...pr(n.property),...lr(n.list)}:{},N=bn;var wt=(n,e)=>Object.hasOwn(n,e),m=(n,e,o)=>{n[e]=o},d=(n,e,o)=>wt(n,e)?n[e]:o;var L=(n,e={})=>{let o={},{ignore:t=[]}=e;return Object.entries(n).forEach(([r,s])=>{if(!t.includes(r)&&typeof s!="function")if(s===void 0)o[r]="";else if(typeof s=="string")o[r]=s;else if(s instanceof Date)o[r]=s.toISOString();else if(typeof s!="object"||s===null)o[r]=String(s);else try{o[r]=JSON.stringify(s)}catch{o[r]=String(s)}}),o};var fr=function(n,e,o={},t){let r={set:[],get:[]};t?.get&&r.get.push(t.get),t?.set&&r.set.push(t.set);let s={set(i,a){m(n,i,a)},get(i,a){return d(n,i,a)},has(i){return wt(n,i)},setProperty(i,a){this.set(i,a)},addProperty(i,a){this.set(i,a)},getProperty(i,a){return this.get(i,a)},hasProperty(i){return this.has(i)},setProperties(i){Object.entries(i).forEach(([a,p])=>{this.set(a,p)})},serialize(){return L(n)}};return new Proxy(n,{get(i,a,p){return Object.hasOwn(e,a)?e[a]:Object.hasOwn(s,a)?s[a]:(r.get.forEach(u=>{u(i,a,p)}),Reflect.get(i,a,p))},set(i,a,p,u){return r.set.forEach(l=>{l(i,a,p,u)}),Reflect.set(i,a,p,u)},getPrototypeOf(){return o.prototype||null}})},R=fr;var vn=function(n={}){let e={...n};return R(e,{setActive(t){m(e,"active",t)},getActive(t){return d(e,"active",t)},setNumber(t){m(e,"number",t)},getNumber(t){return d(e,"number",t)},setName(t){m(e,"name",t)},getName(t){return d(e,"name",t)},setPrice(t){m(e,"price",t)},getPrice(t){return d(e,"price",t)},setCurrency(t){m(e,"currency",t)},getCurrency(t){return d(e,"currency",t)},setLicenseTemplateNumbers(t){m(e,"licenseTemplateNumbers",t)},addLicenseTemplateNumber(t){e.licenseTemplateNumbers||(e.licenseTemplateNumbers=[]),e.licenseTemplateNumbers.push(t)},getLicenseTemplateNumbers(t){return d(e,"licenseTemplateNumbers",t)},removeLicenseTemplateNumber(t){let{licenseTemplateNumbers:r=[]}=e;r.splice(r.indexOf(t),1),e.licenseTemplateNumbers=r},serialize(){if(e.licenseTemplateNumbers){let t=e.licenseTemplateNumbers.join(",");return L({...e,licenseTemplateNumbers:t})}return L(e)}},vn)},qe=vn;var G=n=>{let e=N(n),{licenseTemplateNumbers:o}=e;return o&&typeof o=="string"&&(e.licenseTemplateNumbers=o.split(",")),qe(e)};var Nn=function(n={}){let o={...{code:"",name:"",vatPercent:0,isEu:!1},...n};return R(o,{getCode(){return o.code},getName(){return o.name},getVatPercent(){return o.vatPercent},getIsEu(){return o.isEu}},Nn)},He=Nn;var $e=n=>He(N(n));var Rn=function(n={}){let e={...n};return R(e,{setActive(t){m(e,"active",t)},getActive(t){return d(e,"active",t)},setNumber(t){m(e,"number",t)},getNumber(t){return d(e,"number",t)},setName(t){m(e,"name",t)},getName(t){return d(e,"name",t)},setPrice(t){m(e,"price",t)},getPrice(t){return d(e,"price",t)},setCurrency(t){m(e,"currency",t)},getCurrency(t){return d(e,"currency",t)},setHidden(t){m(e,"hidden",t)},getHidden(t){return d(e,"hidden",t)},setLicenseeNumber(t){m(e,"licenseeNumber",t)},getLicenseeNumber(t){return d(e,"licenseeNumber",t)},setLicenseTemplateNumber(t){m(e,"licenseTemplateNumber",t)},getLicenseTemplateNumber(t){return d(e,"licenseTemplateNumber",t)},setTimeVolume(t){m(e,"timeVolume",t)},getTimeVolume(t){return d(e,"timeVolume",t)},setTimeVolumePeriod(t){m(e,"timeVolumePeriod",t)},getTimeVolumePeriod(t){return d(e,"timeVolumePeriod",t)},setStartDate(t){m(e,"startDate",t)},getStartDate(t){return d(e,"startDate",t)},setParentfeature(t){m(e,"parentfeature",t)},getParentfeature(t){return d(e,"parentfeature",t)},serialize(){return L(e,{ignore:["inUse"]})}},Rn)},re=Rn;var z=n=>{let e=N(n),{startDate:o}=e;return o&&typeof o=="string"&&(e.startDate=o==="now"?o:new Date(o)),re(e)};var xn=function(n={}){let e={...n};return R(e,{setActive(t){m(e,"active",t)},getActive(t){return d(e,"active",t)},setNumber(t){m(e,"number",t)},getNumber(t){return d(e,"number",t)},setName(t){m(e,"name",t)},getName(t){return d(e,"name",t)},setProductNumber(t){m(e,"productNumber",t)},getProductNumber(t){return d(e,"productNumber",t)},setMarkedForTransfer(t){m(e,"markedForTransfer",t)},getMarkedForTransfer(t){return d(e,"markedForTransfer",t)},serialize(){return L(e,{ignore:["inUse"]})}},xn)},ze=xn;var W=n=>ze(N(n));var In=function(n={}){let e={...n};return R(e,{setActive(t){m(e,"active",t)},getActive(t){return d(e,"active",t)},setNumber(t){m(e,"number",t)},getNumber(t){return d(e,"number",t)},setName(t){m(e,"name",t)},getName(t){return d(e,"name",t)},setLicenseType(t){m(e,"licenseType",t)},getLicenseType(t){return d(e,"licenseType",t)},setPrice(t){m(e,"price",t)},getPrice(t){return d(e,"price",t)},setCurrency(t){m(e,"currency",t)},getCurrency(t){return d(e,"currency",t)},setAutomatic(t){m(e,"automatic",t)},getAutomatic(t){return d(e,"automatic",t)},setHidden(t){m(e,"hidden",t)},getHidden(t){return d(e,"hidden",t)},setHideLicenses(t){m(e,"hideLicenses",t)},getHideLicenses(t){return d(e,"hideLicenses",t)},setGracePeriod(t){m(e,"gracePeriod",t)},getGracePeriod(t){return d(e,"gracePeriod",t)},setTimeVolume(t){m(e,"timeVolume",t)},getTimeVolume(t){return d(e,"timeVolume",t)},setTimeVolumePeriod(t){m(e,"timeVolumePeriod",t)},getTimeVolumePeriod(t){return d(e,"timeVolumePeriod",t)},setMaxSessions(t){m(e,"maxSessions",t)},getMaxSessions(t){return d(e,"maxSessions",t)},setQuantity(t){m(e,"quantity",t)},getQuantity(t){return d(e,"quantity",t)},setProductModuleNumber(t){m(e,"productModuleNumber",t)},getProductModuleNumber(t){return d(e,"productModuleNumber",t)},serialize(){return L(e,{ignore:["inUse"]})}},In)},Ye=In;var X=n=>Ye(N(n));var Sn=function(n={}){let e={...n};return R(e,{setActive(t){m(e,"active",t)},getActive(t){return d(e,"active",t)},setNumber(t){m(e,"number",t)},getNumber(t){return d(e,"number",t)},setName(t){m(e,"name",t)},getName(t){return d(e,"name",t)},setProtocol(t){m(e,"protocol",t)},getProtocol(t){return d(e,"protocol",t)},setEvents(t){m(e,"events",t)},getEvents(t){return d(e,"events",t)},addEvent(t){let r=this.getEvents([]);r.push(t),this.setEvents(r)},setPayload(t){m(e,"payload",t)},getPayload(t){return d(e,"payload",t)},setEndpoint(t){m(e,"endpoint",t)},getEndpoint(t){return d(e,"endpoint",t)},serialize(){let t=L(e);return t.events&&(t.events=this.getEvents([]).join(",")),t}},Sn)},Ke=Sn;var Q=n=>{let e=N(n),{events:o}=e;return o&&typeof o=="string"&&(e.events=o.split(",")),Ke(e)};var Ln=function(n={}){let e={...n};return R(e,{setActive(t){m(e,"active",t)},getActive(t){return d(e,"active",t)},setNumber(t){m(e,"number",t)},getNumber(t){return d(e,"number",t)}},Ln)},Je=Ln;var se=n=>Je(N(n));var Cn=function(n={}){let e={...n};return R(e,{setActive(t){m(e,"active",t)},getActive(t){return d(e,"active",t)},setNumber(t){m(e,"number",t)},getNumber(t){return d(e,"number",t)},setName(t){m(e,"name",t)},getName(t){return d(e,"name",t)},setVersion(t){m(e,"version",t)},getVersion(t){return d(e,"version",t)},setDescription(t){m(e,"description",t)},getDescription(t){return d(e,"description",t)},setLicensingInfo(t){m(e,"licensingInfo",t)},getLicensingInfo(t){return d(e,"licensingInfo",t)},setLicenseeAutoCreate(t){m(e,"licenseeAutoCreate",t)},getLicenseeAutoCreate(t){return d(e,"licenseeAutoCreate",t)},setDiscounts(t){m(e,"discounts",t)},getDiscounts(t){return d(e,"discounts",t)},addDiscount(t){let r=this.getDiscounts([]);r.push(t),this.setDiscounts(r)},removeDiscount(t){let r=this.getDiscounts();Array.isArray(r)&&r.length>0&&(r.splice(r.indexOf(t),1),this.setDiscounts(r))},setProductDiscounts(t){this.setDiscounts(t)},getProductDiscounts(t){return this.getDiscounts(t)},serialize(){let t=L(e,{ignore:["discounts","inUse"]}),r=this.getDiscounts();return r&&(t.discount=r.length>0?r.map(s=>s.toString()):""),t}},Cn)},Ge=Cn;function Ee(n,e){return function(){return n.apply(e,arguments)}}var{toString:Tr}=Object.prototype,{getPrototypeOf:Mt}=Object,{iterator:Xe,toStringTag:wn}=Symbol,Qe=(n=>e=>{let o=Tr.call(e);return n[o]||(n[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),B=n=>(n=n.toLowerCase(),e=>Qe(e)===n),Ze=n=>e=>typeof e===n,{isArray:ie}=Array,De=Ze("undefined");function gr(n){return n!==null&&!De(n)&&n.constructor!==null&&!De(n.constructor)&&k(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}var On=B("ArrayBuffer");function hr(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&On(n.buffer),e}var Pr=Ze("string"),k=Ze("function"),Mn=Ze("number"),et=n=>n!==null&&typeof n=="object",yr=n=>n===!0||n===!1,We=n=>{if(Qe(n)!=="object")return!1;let e=Mt(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(wn in n)&&!(Xe in n)},Er=B("Date"),Dr=B("File"),br=B("Blob"),vr=B("FileList"),Nr=n=>et(n)&&k(n.pipe),Rr=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||k(n.append)&&((e=Qe(n))==="formdata"||e==="object"&&k(n.toString)&&n.toString()==="[object FormData]"))},xr=B("URLSearchParams"),[Ir,Sr,Lr,Cr]=["ReadableStream","Request","Response","Headers"].map(B),Ar=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function be(n,e,{allOwnKeys:o=!1}={}){if(n===null||typeof n>"u")return;let t,r;if(typeof n!="object"&&(n=[n]),ie(n))for(t=0,r=n.length;t<r;t++)e.call(null,n[t],t,n);else{let s=o?Object.getOwnPropertyNames(n):Object.keys(n),i=s.length,a;for(t=0;t<i;t++)a=s[t],e.call(null,n[a],a,n)}}function _n(n,e){e=e.toLowerCase();let o=Object.keys(n),t=o.length,r;for(;t-- >0;)if(r=o[t],e===r.toLowerCase())return r;return null}var Z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Un=n=>!De(n)&&n!==Z;function Ot(){let{caseless:n}=Un(this)&&this||{},e={},o=(t,r)=>{let s=n&&_n(e,r)||r;We(e[s])&&We(t)?e[s]=Ot(e[s],t):We(t)?e[s]=Ot({},t):ie(t)?e[s]=t.slice():e[s]=t};for(let t=0,r=arguments.length;t<r;t++)arguments[t]&&be(arguments[t],o);return e}var wr=(n,e,o,{allOwnKeys:t}={})=>(be(e,(r,s)=>{o&&k(r)?n[s]=Ee(r,o):n[s]=r},{allOwnKeys:t}),n),Or=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Mr=(n,e,o,t)=>{n.prototype=Object.create(e.prototype,t),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),o&&Object.assign(n.prototype,o)},_r=(n,e,o,t)=>{let r,s,i,a={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),s=r.length;s-- >0;)i=r[s],(!t||t(i,n,e))&&!a[i]&&(e[i]=n[i],a[i]=!0);n=o!==!1&&Mt(n)}while(n&&(!o||o(n,e))&&n!==Object.prototype);return e},Ur=(n,e,o)=>{n=String(n),(o===void 0||o>n.length)&&(o=n.length),o-=e.length;let t=n.indexOf(e,o);return t!==-1&&t===o},kr=n=>{if(!n)return null;if(ie(n))return n;let e=n.length;if(!Mn(e))return null;let o=new Array(e);for(;e-- >0;)o[e]=n[e];return o},jr=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&Mt(Uint8Array)),Br=(n,e)=>{let t=(n&&n[Xe]).call(n),r;for(;(r=t.next())&&!r.done;){let s=r.value;e.call(n,s[0],s[1])}},Fr=(n,e)=>{let o,t=[];for(;(o=n.exec(e))!==null;)t.push(o);return t},Vr=B("HTMLFormElement"),qr=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,t,r){return t.toUpperCase()+r}),An=(({hasOwnProperty:n})=>(e,o)=>n.call(e,o))(Object.prototype),Hr=B("RegExp"),kn=(n,e)=>{let o=Object.getOwnPropertyDescriptors(n),t={};be(o,(r,s)=>{let i;(i=e(r,s,n))!==!1&&(t[s]=i||r)}),Object.defineProperties(n,t)},$r=n=>{kn(n,(e,o)=>{if(k(n)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;let t=n[o];if(k(t)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},zr=(n,e)=>{let o={},t=r=>{r.forEach(s=>{o[s]=!0})};return ie(n)?t(n):t(String(n).split(e)),o},Yr=()=>{},Kr=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e;function Jr(n){return!!(n&&k(n.append)&&n[wn]==="FormData"&&n[Xe])}var Gr=n=>{let e=new Array(10),o=(t,r)=>{if(et(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;let s=ie(t)?[]:{};return be(t,(i,a)=>{let p=o(i,r+1);!De(p)&&(s[a]=p)}),e[r]=void 0,s}}return t};return o(n,0)},Wr=B("AsyncFunction"),Xr=n=>n&&(et(n)||k(n))&&k(n.then)&&k(n.catch),jn=((n,e)=>n?setImmediate:e?((o,t)=>(Z.addEventListener("message",({source:r,data:s})=>{r===Z&&s===o&&t.length&&t.shift()()},!1),r=>{t.push(r),Z.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",k(Z.postMessage)),Qr=typeof queueMicrotask<"u"?queueMicrotask.bind(Z):typeof process<"u"&&process.nextTick||jn,Zr=n=>n!=null&&k(n[Xe]),c={isArray:ie,isArrayBuffer:On,isBuffer:gr,isFormData:Rr,isArrayBufferView:hr,isString:Pr,isNumber:Mn,isBoolean:yr,isObject:et,isPlainObject:We,isReadableStream:Ir,isRequest:Sr,isResponse:Lr,isHeaders:Cr,isUndefined:De,isDate:Er,isFile:Dr,isBlob:br,isRegExp:Hr,isFunction:k,isStream:Nr,isURLSearchParams:xr,isTypedArray:jr,isFileList:vr,forEach:be,merge:Ot,extend:wr,trim:Ar,stripBOM:Or,inherits:Mr,toFlatObject:_r,kindOf:Qe,kindOfTest:B,endsWith:Ur,toArray:kr,forEachEntry:Br,matchAll:Fr,isHTMLForm:Vr,hasOwnProperty:An,hasOwnProp:An,reduceDescriptors:kn,freezeMethods:$r,toObjectSet:zr,toCamelCase:qr,noop:Yr,toFiniteNumber:Kr,findKey:_n,global:Z,isContextDefined:Un,isSpecCompliantForm:Jr,toJSONObject:Gr,isAsyncFn:Wr,isThenable:Xr,setImmediate:jn,asap:Qr,isIterable:Zr};function ae(n,e,o,t,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),o&&(this.config=o),t&&(this.request=t),r&&(this.response=r,this.status=r.status?r.status:null)}c.inherits(ae,Error,{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:c.toJSONObject(this.config),code:this.code,status:this.status}}});var Bn=ae.prototype,Fn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{Fn[n]={value:n}});Object.defineProperties(ae,Fn);Object.defineProperty(Bn,"isAxiosError",{value:!0});ae.from=(n,e,o,t,r,s)=>{let i=Object.create(Bn);return c.toFlatObject(n,i,function(p){return p!==Error.prototype},a=>a!=="isAxiosError"),ae.call(i,n.message,e,o,t,r),i.cause=n,i.name=n.name,s&&Object.assign(i,s),i};var y=ae;var tt=null;function _t(n){return c.isPlainObject(n)||c.isArray(n)}function qn(n){return c.endsWith(n,"[]")?n.slice(0,-2):n}function Vn(n,e,o){return n?n.concat(e).map(function(r,s){return r=qn(r),!o&&s?"["+r+"]":r}).join(o?".":""):e}function es(n){return c.isArray(n)&&!n.some(_t)}var ts=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function ns(n,e,o){if(!c.isObject(n))throw new TypeError("target must be an object");e=e||new(tt||FormData),o=c.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(D,P){return!c.isUndefined(P[D])});let t=o.metaTokens,r=o.visitor||l,s=o.dots,i=o.indexes,p=(o.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function u(g){if(g===null)return"";if(c.isDate(g))return g.toISOString();if(!p&&c.isBlob(g))throw new y("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(g)||c.isTypedArray(g)?p&&typeof Blob=="function"?new Blob([g]):Buffer.from(g):g}function l(g,D,P){let A=g;if(g&&!P&&typeof g=="object"){if(c.endsWith(D,"{}"))D=t?D:D.slice(0,-2),g=JSON.stringify(g);else if(c.isArray(g)&&es(g)||(c.isFileList(g)||c.endsWith(D,"[]"))&&(A=c.toArray(g)))return D=qn(D),A.forEach(function(_,$){!(c.isUndefined(_)||_===null)&&e.append(i===!0?Vn([D],$,s):i===null?D:D+"[]",u(_))}),!1}return _t(g)?!0:(e.append(Vn(P,D,s),u(g)),!1)}let T=[],b=Object.assign(ts,{defaultVisitor:l,convertValue:u,isVisitable:_t});function I(g,D){if(!c.isUndefined(g)){if(T.indexOf(g)!==-1)throw Error("Circular reference detected in "+D.join("."));T.push(g),c.forEach(g,function(A,O){(!(c.isUndefined(A)||A===null)&&r.call(e,A,c.isString(O)?O.trim():O,D,b))===!0&&I(A,D?D.concat(O):[O])}),T.pop()}}if(!c.isObject(n))throw new TypeError("data must be an object");return I(n),e}var K=ns;function Hn(n){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function $n(n,e){this._pairs=[],n&&K(n,this,e)}var zn=$n.prototype;zn.append=function(e,o){this._pairs.push([e,o])};zn.toString=function(e){let o=e?function(t){return e.call(this,t,Hn)}:Hn;return this._pairs.map(function(r){return o(r[0])+"="+o(r[1])},"").join("&")};var nt=$n;function os(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ve(n,e,o){if(!e)return n;let t=o&&o.encode||os;c.isFunction(o)&&(o={serialize:o});let r=o&&o.serialize,s;if(r?s=r(e,o):s=c.isURLSearchParams(e)?e.toString():new nt(e,o).toString(t),s){let i=n.indexOf("#");i!==-1&&(n=n.slice(0,i)),n+=(n.indexOf("?")===-1?"?":"&")+s}return n}var Ut=class{constructor(){this.handlers=[]}use(e,o,t){return this.handlers.push({fulfilled:e,rejected:o,synchronous:t?t.synchronous:!1,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(t){t!==null&&e(t)})}},kt=Ut;var ot={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Yn=typeof URLSearchParams<"u"?URLSearchParams:nt;var Kn=typeof FormData<"u"?FormData:null;var Jn=typeof Blob<"u"?Blob:null;var Gn={isBrowser:!0,classes:{URLSearchParams:Yn,FormData:Kn,Blob:Jn},protocols:["http","https","file","blob","url","data"]};var Ft={};hn(Ft,{hasBrowserEnv:()=>Bt,hasStandardBrowserEnv:()=>rs,hasStandardBrowserWebWorkerEnv:()=>ss,navigator:()=>jt,origin:()=>is});var Bt=typeof window<"u"&&typeof document<"u",jt=typeof navigator=="object"&&navigator||void 0,rs=Bt&&(!jt||["ReactNative","NativeScript","NS"].indexOf(jt.product)<0),ss=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",is=Bt&&window.location.href||"http://localhost";var C={...Ft,...Gn};function Vt(n,e){return K(n,new C.classes.URLSearchParams,Object.assign({visitor:function(o,t,r,s){return C.isNode&&c.isBuffer(o)?(this.append(t,o.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function as(n){return c.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function cs(n){let e={},o=Object.keys(n),t,r=o.length,s;for(t=0;t<r;t++)s=o[t],e[s]=n[s];return e}function us(n){function e(o,t,r,s){let i=o[s++];if(i==="__proto__")return!0;let a=Number.isFinite(+i),p=s>=o.length;return i=!i&&c.isArray(r)?r.length:i,p?(c.hasOwnProp(r,i)?r[i]=[r[i],t]:r[i]=t,!a):((!r[i]||!c.isObject(r[i]))&&(r[i]=[]),e(o,t,r[i],s)&&c.isArray(r[i])&&(r[i]=cs(r[i])),!a)}if(c.isFormData(n)&&c.isFunction(n.entries)){let o={};return c.forEachEntry(n,(t,r)=>{e(as(t),r,o,0)}),o}return null}var rt=us;function ds(n,e,o){if(c.isString(n))try{return(e||JSON.parse)(n),c.trim(n)}catch(t){if(t.name!=="SyntaxError")throw t}return(o||JSON.stringify)(n)}var qt={transitional:ot,adapter:["xhr","http","fetch"],transformRequest:[function(e,o){let t=o.getContentType()||"",r=t.indexOf("application/json")>-1,s=c.isObject(e);if(s&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return r?JSON.stringify(rt(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(t.indexOf("application/x-www-form-urlencoded")>-1)return Vt(e,this.formSerializer).toString();if((a=c.isFileList(e))||t.indexOf("multipart/form-data")>-1){let p=this.env&&this.env.FormData;return K(a?{"files[]":e}:e,p&&new p,this.formSerializer)}}return s||r?(o.setContentType("application/json",!1),ds(e)):e}],transformResponse:[function(e){let o=this.transitional||qt.transitional,t=o&&o.forcedJSONParsing,r=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(t&&!this.responseType||r)){let i=!(o&&o.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(i)throw a.name==="SyntaxError"?y.from(a,y.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:C.classes.FormData,Blob:C.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],n=>{qt.headers[n]={}});var ce=qt;var ms=c.toObjectSet(["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"]),Wn=n=>{let e={},o,t,r;return n&&n.split(`
|
|
2
|
-
`).forEach(function(i){r=i.indexOf(":"),o=i.substring(0,r).trim().toLowerCase(),t=i.substring(r+1).trim(),!(!o||e[o]&&
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...o){let t=new this(e);return o.forEach(r=>t.set(r)),t}static accessor(e){let t=(this[Xn]=this[Xn]={accessors:{}}).accessors,r=this.prototype;function s(i){let a=Ne(i);t[a]||(Ts(r,i),t[a]=!0)}return c.isArray(e)?e.forEach(s):s(e),this}};ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(ue.prototype,({value:n},e)=>{let o=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(t){this[o]=t}}});c.freezeMethods(ue);var M=ue;function Re(n,e){let o=this||ce,t=e||o,r=M.from(t.headers),s=t.data;return c.forEach(n,function(a){s=a.call(o,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function xe(n){return!!(n&&n.__CANCEL__)}function Qn(n,e,o){y.call(this,n??"canceled",y.ERR_CANCELED,e,o),this.name="CanceledError"}c.inherits(Qn,y,{__CANCEL__:!0});var q=Qn;function Ie(n,e,o){let t=o.config.validateStatus;!o.status||!t||t(o.status)?n(o):e(new y("Request failed with status code "+o.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function $t(n){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function gs(n,e){n=n||10;let o=new Array(n),t=new Array(n),r=0,s=0,i;return e=e!==void 0?e:1e3,function(p){let u=Date.now(),l=t[s];i||(i=u),o[r]=p,t[r]=u;let T=s,b=0;for(;T!==r;)b+=o[T++],T=T%n;if(r=(r+1)%n,r===s&&(s=(s+1)%n),u-i<e)return;let I=l&&u-l;return I?Math.round(b*1e3/I):void 0}}var Zn=gs;function hs(n,e){let o=0,t=1e3/e,r,s,i=(u,l=Date.now())=>{o=l,r=null,s&&(clearTimeout(s),s=null),n.apply(null,u)};return[(...u)=>{let l=Date.now(),T=l-o;T>=t?i(u,l):(r=u,s||(s=setTimeout(()=>{s=null,i(r)},t-T)))},()=>r&&i(r)]}var eo=hs;var de=(n,e,o=3)=>{let t=0,r=Zn(50,250);return eo(s=>{let i=s.loaded,a=s.lengthComputable?s.total:void 0,p=i-t,u=r(p),l=i<=a;t=i;let T={loaded:i,total:a,progress:a?i/a:void 0,bytes:p,rate:u||void 0,estimated:u&&a&&l?(a-i)/u:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(T)},o)},zt=(n,e)=>{let o=n!=null;return[t=>e[0]({lengthComputable:o,total:n,loaded:t}),e[1]]},Yt=n=>(...e)=>c.asap(()=>n(...e));var to=C.hasStandardBrowserEnv?((n,e)=>o=>(o=new URL(o,C.origin),n.protocol===o.protocol&&n.host===o.host&&(e||n.port===o.port)))(new URL(C.origin),C.navigator&&/(msie|trident)/i.test(C.navigator.userAgent)):()=>!0;var no=C.hasStandardBrowserEnv?{write(n,e,o,t,r,s){let i=[n+"="+encodeURIComponent(e)];c.isNumber(o)&&i.push("expires="+new Date(o).toGMTString()),c.isString(t)&&i.push("path="+t),c.isString(r)&&i.push("domain="+r),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(n){let e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Kt(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function Jt(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function Se(n,e,o){let t=!Kt(e);return n&&(t||o==!1)?Jt(n,e):e}var oo=n=>n instanceof M?{...n}:n;function F(n,e){e=e||{};let o={};function t(u,l,T,b){return c.isPlainObject(u)&&c.isPlainObject(l)?c.merge.call({caseless:b},u,l):c.isPlainObject(l)?c.merge({},l):c.isArray(l)?l.slice():l}function r(u,l,T,b){if(c.isUndefined(l)){if(!c.isUndefined(u))return t(void 0,u,T,b)}else return t(u,l,T,b)}function s(u,l){if(!c.isUndefined(l))return t(void 0,l)}function i(u,l){if(c.isUndefined(l)){if(!c.isUndefined(u))return t(void 0,u)}else return t(void 0,l)}function a(u,l,T){if(T in e)return t(u,l);if(T in n)return t(void 0,u)}let p={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,l,T)=>r(oo(u),oo(l),T,!0)};return c.forEach(Object.keys(Object.assign({},n,e)),function(l){let T=p[l]||r,b=T(n[l],e[l],l);c.isUndefined(b)&&T!==a||(o[l]=b)}),o}var it=n=>{let e=F({},n),{data:o,withXSRFToken:t,xsrfHeaderName:r,xsrfCookieName:s,headers:i,auth:a}=e;e.headers=i=M.from(i),e.url=ve(Se(e.baseURL,e.url,e.allowAbsoluteUrls),n.params,n.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let p;if(c.isFormData(o)){if(C.hasStandardBrowserEnv||C.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((p=i.getContentType())!==!1){let[u,...l]=p?p.split(";").map(T=>T.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(C.hasStandardBrowserEnv&&(t&&c.isFunction(t)&&(t=t(e)),t||t!==!1&&to(e.url))){let u=r&&s&&no.read(s);u&&i.set(r,u)}return e};var Ps=typeof XMLHttpRequest<"u",ro=Ps&&function(n){return new Promise(function(o,t){let r=it(n),s=r.data,i=M.from(r.headers).normalize(),{responseType:a,onUploadProgress:p,onDownloadProgress:u}=r,l,T,b,I,g;function D(){I&&I(),g&&g(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let P=new XMLHttpRequest;P.open(r.method.toUpperCase(),r.url,!0),P.timeout=r.timeout;function A(){if(!P)return;let _=M.from("getAllResponseHeaders"in P&&P.getAllResponseHeaders()),U={data:!a||a==="text"||a==="json"?P.responseText:P.response,status:P.status,statusText:P.statusText,headers:_,config:n,request:P};Ie(function(J){o(J),D()},function(J){t(J),D()},U),P=null}"onloadend"in P?P.onloadend=A:P.onreadystatechange=function(){!P||P.readyState!==4||P.status===0&&!(P.responseURL&&P.responseURL.indexOf("file:")===0)||setTimeout(A)},P.onabort=function(){P&&(t(new y("Request aborted",y.ECONNABORTED,n,P)),P=null)},P.onerror=function(){t(new y("Network Error",y.ERR_NETWORK,n,P)),P=null},P.ontimeout=function(){let $=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",U=r.transitional||ot;r.timeoutErrorMessage&&($=r.timeoutErrorMessage),t(new y($,U.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,n,P)),P=null},s===void 0&&i.setContentType(null),"setRequestHeader"in P&&c.forEach(i.toJSON(),function($,U){P.setRequestHeader(U,$)}),c.isUndefined(r.withCredentials)||(P.withCredentials=!!r.withCredentials),a&&a!=="json"&&(P.responseType=r.responseType),u&&([b,g]=de(u,!0),P.addEventListener("progress",b)),p&&P.upload&&([T,I]=de(p),P.upload.addEventListener("progress",T),P.upload.addEventListener("loadend",I)),(r.cancelToken||r.signal)&&(l=_=>{P&&(t(!_||_.type?new q(null,n,P):_),P.abort(),P=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));let O=$t(r.url);if(O&&C.protocols.indexOf(O)===-1){t(new y("Unsupported protocol "+O+":",y.ERR_BAD_REQUEST,n));return}P.send(s||null)})};var ys=(n,e)=>{let{length:o}=n=n?n.filter(Boolean):[];if(e||o){let t=new AbortController,r,s=function(u){if(!r){r=!0,a();let l=u instanceof Error?u:this.reason;t.abort(l instanceof y?l:new q(l instanceof Error?l.message:l))}},i=e&&setTimeout(()=>{i=null,s(new y(`timeout ${e} of ms exceeded`,y.ETIMEDOUT))},e),a=()=>{n&&(i&&clearTimeout(i),i=null,n.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),n=null)};n.forEach(u=>u.addEventListener("abort",s));let{signal:p}=t;return p.unsubscribe=()=>c.asap(a),p}},so=ys;var Es=function*(n,e){let o=n.byteLength;if(!e||o<e){yield n;return}let t=0,r;for(;t<o;)r=t+e,yield n.slice(t,r),t=r},Ds=async function*(n,e){for await(let o of bs(n))yield*Es(o,e)},bs=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}let e=n.getReader();try{for(;;){let{done:o,value:t}=await e.read();if(o)break;yield t}}finally{await e.cancel()}},Gt=(n,e,o,t)=>{let r=Ds(n,e),s=0,i,a=p=>{i||(i=!0,t&&t(p))};return new ReadableStream({async pull(p){try{let{done:u,value:l}=await r.next();if(u){a(),p.close();return}let T=l.byteLength;if(o){let b=s+=T;o(b)}p.enqueue(new Uint8Array(l))}catch(u){throw a(u),u}},cancel(p){return a(p),r.return()}},{highWaterMark:2})};var ct=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ao=ct&&typeof ReadableStream=="function",vs=ct&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),co=(n,...e)=>{try{return!!n(...e)}catch{return!1}},Ns=ao&&co(()=>{let n=!1,e=new Request(C.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),io=64*1024,Wt=ao&&co(()=>c.isReadableStream(new Response("").body)),at={stream:Wt&&(n=>n.body)};ct&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!at[e]&&(at[e]=c.isFunction(n[e])?o=>o[e]():(o,t)=>{throw new y(`Response type '${e}' is not supported`,y.ERR_NOT_SUPPORT,t)})})})(new Response);var Rs=async n=>{if(n==null)return 0;if(c.isBlob(n))return n.size;if(c.isSpecCompliantForm(n))return(await new Request(C.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(c.isArrayBufferView(n)||c.isArrayBuffer(n))return n.byteLength;if(c.isURLSearchParams(n)&&(n=n+""),c.isString(n))return(await vs(n)).byteLength},xs=async(n,e)=>{let o=c.toFiniteNumber(n.getContentLength());return o??Rs(e)},uo=ct&&(async n=>{let{url:e,method:o,data:t,signal:r,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:p,responseType:u,headers:l,withCredentials:T="same-origin",fetchOptions:b}=it(n);u=u?(u+"").toLowerCase():"text";let I=so([r,s&&s.toAbortSignal()],i),g,D=I&&I.unsubscribe&&(()=>{I.unsubscribe()}),P;try{if(p&&Ns&&o!=="get"&&o!=="head"&&(P=await xs(l,t))!==0){let U=new Request(e,{method:"POST",body:t,duplex:"half"}),Y;if(c.isFormData(t)&&(Y=U.headers.get("content-type"))&&l.setContentType(Y),U.body){let[J,je]=zt(P,de(Yt(p)));t=Gt(U.body,io,J,je)}}c.isString(T)||(T=T?"include":"omit");let A="credentials"in Request.prototype;g=new Request(e,{...b,signal:I,method:o.toUpperCase(),headers:l.normalize().toJSON(),body:t,duplex:"half",credentials:A?T:void 0});let O=await fetch(g),_=Wt&&(u==="stream"||u==="response");if(Wt&&(a||_&&D)){let U={};["status","statusText","headers"].forEach(gn=>{U[gn]=O[gn]});let Y=c.toFiniteNumber(O.headers.get("content-length")),[J,je]=a&&zt(Y,de(Yt(a),!0))||[];O=new Response(Gt(O.body,io,J,()=>{je&&je(),D&&D()}),U)}u=u||"text";let $=await at[c.findKey(at,u)||"text"](O,n);return!_&&D&&D(),await new Promise((U,Y)=>{Ie(U,Y,{data:$,headers:M.from(O.headers),status:O.status,statusText:O.statusText,config:n,request:g})})}catch(A){throw D&&D(),A&&A.name==="TypeError"&&/Load failed|fetch/i.test(A.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,n,g),{cause:A.cause||A}):y.from(A,A&&A.code,n,g)}});var Xt={http:tt,xhr:ro,fetch:uo};c.forEach(Xt,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});var mo=n=>`- ${n}`,Is=n=>c.isFunction(n)||n===null||n===!1,ut={getAdapter:n=>{n=c.isArray(n)?n:[n];let{length:e}=n,o,t,r={};for(let s=0;s<e;s++){o=n[s];let i;if(t=o,!Is(o)&&(t=Xt[(i=String(o)).toLowerCase()],t===void 0))throw new y(`Unknown adapter '${i}'`);if(t)break;r[i||"#"+s]=t}if(!t){let s=Object.entries(r).map(([a,p])=>`adapter ${a} `+(p===!1?"is not supported by the environment":"is not available in the build")),i=e?s.length>1?`since :
|
|
4
|
-
`+
|
|
5
|
-
`):" "+
|
|
6
|
-
`+s):t.stack=s}catch{}}throw t}}_request(e,o){typeof e=="string"?(o=o||{},o.url=e):o=e||{},o=F(this.defaults,o);let{transitional:t,paramsSerializer:r,headers:s}=o;t!==void 0&&Le.assertOptions(t,{silentJSONParsing:H.transitional(H.boolean),forcedJSONParsing:H.transitional(H.boolean),clarifyTimeoutError:H.transitional(H.boolean)},!1),r!=null&&(c.isFunction(r)?o.paramsSerializer={serialize:r}:Le.assertOptions(r,{encode:H.function,serialize:H.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Le.assertOptions(o,{baseUrl:H.spelling("baseURL"),withXsrfToken:H.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let i=s&&c.merge(s.common,s[o.method]);s&&c.forEach(["delete","get","head","post","put","patch","common"],g=>{delete s[g]}),o.headers=M.concat(i,s);let a=[],p=!0;this.interceptors.request.forEach(function(D){typeof D.runWhen=="function"&&D.runWhen(o)===!1||(p=p&&D.synchronous,a.unshift(D.fulfilled,D.rejected))});let u=[];this.interceptors.response.forEach(function(D){u.push(D.fulfilled,D.rejected)});let l,T=0,b;if(!p){let g=[dt.bind(this),void 0];for(g.unshift.apply(g,a),g.push.apply(g,u),b=g.length,l=Promise.resolve(o);T<b;)l=l.then(g[T++],g[T++]);return l}b=a.length;let I=o;for(T=0;T<b;){let g=a[T++],D=a[T++];try{I=g(I)}catch(P){D.call(this,P);break}}try{l=dt.call(this,I)}catch(g){return Promise.reject(g)}for(T=0,b=u.length;T<b;)l=l.then(u[T++],u[T++]);return l}getUri(e){e=F(this.defaults,e);let o=Se(e.baseURL,e.url,e.allowAbsoluteUrls);return ve(o,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){me.prototype[e]=function(o,t){return this.request(F(t||{},{method:e,url:o,data:(t||{}).data}))}});c.forEach(["post","put","patch"],function(e){function o(t){return function(s,i,a){return this.request(F(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}me.prototype[e]=o(),me.prototype[e+"Form"]=o(!0)});var Ce=me;var Zt=class n{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(s){o=s});let t=this;this.promise.then(r=>{if(!t._listeners)return;let s=t._listeners.length;for(;s-- >0;)t._listeners[s](r);t._listeners=null}),this.promise.then=r=>{let s,i=new Promise(a=>{t.subscribe(a),s=a}).then(r);return i.cancel=function(){t.unsubscribe(s)},i},e(function(s,i,a){t.reason||(t.reason=new q(s,i,a),o(t.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let o=this._listeners.indexOf(e);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){let e=new AbortController,o=t=>{e.abort(t)};return this.subscribe(o),e.signal.unsubscribe=()=>this.unsubscribe(o),e.signal}static source(){let e;return{token:new n(function(r){e=r}),cancel:e}}},lo=Zt;function en(n){return function(o){return n.apply(null,o)}}function tn(n){return c.isObject(n)&&n.isAxiosError===!0}var nn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(nn).forEach(([n,e])=>{nn[e]=n});var fo=nn;function To(n){let e=new Ce(n),o=Ee(Ce.prototype.request,e);return c.extend(o,Ce.prototype,e,{allOwnKeys:!0}),c.extend(o,e,null,{allOwnKeys:!0}),o.create=function(r){return To(F(n,r))},o}var w=To(ce);w.Axios=Ce;w.CanceledError=q;w.CancelToken=lo;w.isCancel=xe;w.VERSION=mt;w.toFormData=K;w.AxiosError=y;w.Cancel=w.CanceledError;w.all=function(e){return Promise.all(e)};w.spread=en;w.isAxiosError=tn;w.mergeConfig=F;w.AxiosHeaders=M;w.formToJSON=n=>rt(c.isHTMLForm(n)?new FormData(n):n);w.getAdapter=ut.getAdapter;w.HttpStatusCode=fo;w.default=w;var lt=w;var{Axios:yd,AxiosError:go,CanceledError:Ed,isCancel:Dd,CancelToken:bd,VERSION:vd,all:Nd,Cancel:Rd,isAxiosError:xd,spread:Id,toFormData:Sd,AxiosHeaders:Ld,HttpStatusCode:Cd,formToJSON:Ad,getAdapter:wd,mergeConfig:Od}=lt;var j=class n extends go{constructor(o,t,r,s,i,a){super(o,t,r,s,i);this.isNlicError=!0;this.name="NlicError",a&&(this.stack=a),Object.setPrototypeOf(this,n.prototype)}};var ho=function(n={}){let e={...n};if(e.amountFix&&e.amountPercent)throw new j('Properties "amountFix" and "amountPercent" cannot be used at the same time');return R(e,{setTotalPrice(t){m(e,"totalPrice",t)},getTotalPrice(t){return d(e,"totalPrice",t)},setCurrency(t){m(e,"currency",t)},getCurrency(t){return d(e,"currency",t)},setAmountFix(t){m(e,"amountFix",t)},getAmountFix(t){return d(e,"amountFix",t)},setAmountPercent(t){m(e,"amountPercent",t)},getAmountPercent(t){return d(e,"amountPercent",t)},toString(){let t=this.getTotalPrice(),r=this.getCurrency(),s=this.getAmountPercent()?`${this.getAmountPercent()}%`:this.getAmountFix();return t&&r&&s?`${t};${r};${s}`:""}},ho,{set:(t,r)=>{r==="amountFix"&&delete t.amountPercent,r==="amountPercent"&&delete t.amountFix}})},ft=ho;var ee=n=>{let e=N(n),o=e.discount;return delete e.discount,o&&(e.discounts=o.map(t=>ft(t))),Ge(e)};var Po=function(n={}){let e={...n};return R(e,{setActive(t){m(e,"active",t)},getActive(t){return d(e,"active",t)},setNumber(t){m(e,"number",t)},getNumber(t){return d(e,"number",t)},setName(t){m(e,"name",t)},getName(t){return d(e,"name",t)},setLicensingModel(t){m(e,"licensingModel",t)},getLicensingModel(t){return d(e,"licensingModel",t)},setMaxCheckoutValidity(t){m(e,"maxCheckoutValidity",t)},getMaxCheckoutValidity(t){return d(e,"maxCheckoutValidity",t)},setYellowThreshold(t){m(e,"yellowThreshold",t)},getYellowThreshold(t){return d(e,"yellowThreshold",t)},setRedThreshold(t){m(e,"redThreshold",t)},getRedThreshold(t){return d(e,"redThreshold",t)},setProductNumber(t){m(e,"productNumber",t)},getProductNumber(t){return d(e,"productNumber",t)},serialize(){return L(e,{ignore:["inUse"]})}},Po)},Tt=Po;var te=n=>Tt(N(n));var yo=function(n={}){let e={...n};return R(e,{setActive(t){m(e,"active",t)},getActive(t){return d(e,"active",t)},setNumber(t){m(e,"number",t)},getNumber(t){return d(e,"number",t)},setExpirationTime(t){m(e,"expirationTime",t)},getExpirationTime(t){return d(e,"expirationTime",t)},setTokenType(t){m(e,"tokenType",t)},getTokenType(t){return d(e,"tokenType",t)},setLicenseeNumber(t){m(e,"licenseeNumber",t)},getLicenseeNumber(t){return d(e,"licenseeNumber",t)},setAction(t){m(e,"action",t)},getAction(t){return d(e,"action",t)},setApiKeyRole(t){m(e,"apiKeyRole",t)},getApiKeyRole(t){return d(e,"apiKeyRole",t)},setBundleNumber(t){m(e,"bundleNumber",t)},getBundleNumber(t){return d(e,"bundleNumber",t)},setBundlePrice(t){m(e,"bundlePrice",t)},getBundlePrice(t){return d(e,"bundlePrice",t)},setProductNumber(t){m(e,"productNumber",t)},getProductNumber(t){return d(e,"productNumber",t)},setPredefinedShoppingItem(t){m(e,"predefinedShoppingItem",t)},getPredefinedShoppingItem(t){return d(e,"predefinedShoppingItem",t)},setSuccessURL(t){m(e,"successURL",t)},getSuccessURL(t){return d(e,"successURL",t)},setSuccessURLTitle(t){m(e,"successURLTitle",t)},getSuccessURLTitle(t){return d(e,"successURLTitle",t)},setCancelURL(t){m(e,"cancelURL",t)},getCancelURL(t){return d(e,"cancelURL",t)},setCancelURLTitle(t){m(e,"cancelURLTitle",t)},getCancelURLTitle(t){return d(e,"cancelURLTitle",t)},getShopURL(t){return d(e,"shopURL",t)},serialize(){return L(e,{ignore:["shopURL"]})}},yo)},gt=yo;var pe=n=>{let e=N(n),{expirationTime:o}=e;return o&&typeof o=="string"&&(e.expirationTime=new Date(o)),gt(e)};var on=class{constructor(e,o){this.transaction=e,this.license=o}setTransaction(e){this.transaction=e}getTransaction(){return this.transaction}setLicense(e){this.license=e}getLicense(){return this.license}},ht=(n,e)=>new on(n,e);var Eo=function(n={}){let e={...n};return R(e,{setActive(t){m(e,"active",t)},getActive(t){return d(e,"active",t)},setNumber(t){m(e,"number",t)},getNumber(t){return d(e,"number",t)},setStatus(t){m(e,"status",t)},getStatus(t){return d(e,"status",t)},setSource(t){m(e,"source",t)},getSource(t){return d(e,"source",t)},setGrandTotal(t){m(e,"grandTotal",t)},getGrandTotal(t){return d(e,"grandTotal",t)},setDiscount(t){m(e,"discount",t)},getDiscount(t){return d(e,"discount",t)},setCurrency(t){m(e,"currency",t)},getCurrency(t){return d(e,"currency",t)},setDateCreated(t){m(e,"dateCreated",t)},getDateCreated(t){return d(e,"dateCreated",t)},setDateClosed(t){m(e,"dateClosed",t)},getDateClosed(t){return d(e,"dateClosed",t)},setPaymentMethod(t){m(e,"paymentMethod",t)},getPaymentMethod(t){return d(e,"paymentMethod",t)},setLicenseTransactionJoins(t){m(e,"licenseTransactionJoins",t)},getLicenseTransactionJoins(t){return d(e,"licenseTransactionJoins",t)},serialize(){return L(e,{ignore:["licenseTransactionJoins","inUse"]})}},Eo)},Ae=Eo;var ne=n=>{let e=N(n),{dateCreated:o,dateClosed:t}=e;o&&typeof o=="string"&&(e.dateCreated=new Date(o)),t&&typeof t=="string"&&(e.dateClosed=new Date(t));let r=e.licenseTransactionJoin;return delete e.licenseTransactionJoin,r&&(e.licenseTransactionJoins=r.map(({transactionNumber:s,licenseNumber:i})=>{let a=Ae({number:s}),p=re({number:i});return ht(a,p)})),Ae(e)};var Do=lt.create(),bo=null,vo=[],No=n=>{Do=n},Pt=()=>Do,rn=n=>{bo=n},Ro=()=>bo,sn=n=>{vo=n},xo=()=>vo;var an={name:"netlicensing-client",version:"1.2.39",description:"JavaScript Wrapper for Labs64 NetLicensing RESTful API",keywords:["labs64","netlicensing","licensing","licensing-as-a-service","license","license-management","software-license","client","restful","restful-api","javascript","wrapper","api","client"],license:"Apache-2.0",author:"Labs64 GmbH",homepage:"https://netlicensing.io",repository:{type:"git",url:"https://github.com/Labs64/NetLicensingClient-javascript"},bugs:{url:"https://github.com/Labs64/NetLicensingClient-javascript/issues"},contributors:[{name:"Ready Brown",email:"ready.brown@hotmail.de",url:"https://github.com/r-brown"},{name:"Viacheslav Rudkovskiy",email:"viachaslau.rudkovski@labs64.de",url:"https://github.com/v-rudkovskiy"},{name:"Andrei Yushkevich",email:"yushkevich@me.com",url:"https://github.com/yushkevich"}],main:"dist/index.cjs",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.cjs"}},files:["dist"],scripts:{build:"tsup",release:"npm run lint:typecheck && npm run test && npm run build",dev:"tsup --watch",test:"vitest run","test:dev":"vitest watch",lint:"eslint --ext .js,.mjs,.ts src",typecheck:"tsc --noEmit","lint:typecheck":"npm run lint && npm run typecheck"},peerDependencies:{axios:"^1.9.0"},dependencies:{},devDependencies:{"@eslint/js":"^9.24.0","@types/node":"^22.14.0","@typescript-eslint/eslint-plugin":"^8.29.1","@typescript-eslint/parser":"^8.29.1","@vitest/eslint-plugin":"^1.1.43",axios:"^1.9.0",eslint:"^9.24.0","eslint-plugin-import":"^2.31.0",prettier:"3.5.3",tsup:"^8.4.0",typescript:"^5.8.3","typescript-eslint":"^8.29.1",vitest:"^3.1.1"},engines:{node:">= 16.9.0",npm:">= 8.0.0"},browserslist:["> 1%","last 2 versions","not ie <= 10"]};var yt=n=>{let e=[],o=(t,r)=>{if(t!=null){if(Array.isArray(t)){t.forEach(s=>{o(s,r?`${r}`:"")});return}if(t instanceof Date){e.push(`${r}=${encodeURIComponent(t.toISOString())}`);return}if(typeof t=="object"){Object.keys(t).forEach(s=>{let i=t[s];o(i,r?`${r}[${encodeURIComponent(s)}]`:encodeURIComponent(s))});return}e.push(`${r}=${encodeURIComponent(t)}`)}};return o(n),e.join("&")};var le=async(n,e,o,t,r)=>{let s={Accept:"application/json","X-Requested-With":"XMLHttpRequest"};typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(s["User-agent"]=`NetLicensing/Javascript ${an.version}/node&${process.version}`);let i={method:e,headers:s,url:encodeURI(`${n.getBaseUrl()}/${o}`),responseType:"json",transformRequest:(p,u)=>u["Content-Type"]==="application/x-www-form-urlencoded"?yt(p):(u["NetLicensing-Origin"]||(u["NetLicensing-Origin"]=`NetLicensing/Javascript ${an.version}`),p)};switch(["put","post","patch"].indexOf(e.toLowerCase())>=0?(i.method==="post"&&(s["Content-Type"]="application/x-www-form-urlencoded"),i.data=t):i.params=t,n.getSecurityMode()){case V.BASIC_AUTHENTICATION:{if(!n.getUsername())throw new j('Missing parameter "username"');if(!n.getPassword())throw new j('Missing parameter "password"');i.auth={username:n.getUsername(),password:n.getPassword()}}break;case V.APIKEY_IDENTIFICATION:if(!n.getApiKey())throw new j('Missing parameter "apiKey"');s.Authorization=`Basic ${btoa(`apiKey:${n.getApiKey()}`)}`;break;case V.ANONYMOUS_IDENTIFICATION:break;default:throw new j("Unknown security mode")}let a=r?.axiosInstance||Pt();try{let p=await a(i),u=p.data.infos?.info||[];if(rn(p),sn(u),r?.onResponse&&r.onResponse(p),u.length>0){r?.onInfo&&r.onInfo(u);let l=u.find(({type:T})=>T==="ERROR");if(l)throw new j(l.value,l.id,p.config,p.request,p)}return p}catch(p){let u=p,l=u.response,T=l?.data?.infos?.info||[];if(rn(l||null),sn(T),p.isAxiosError){let b=p.message;if(l?.data&&T.length>0){let I=T.find(({type:g})=>g==="ERROR");I&&(b=I.value)}throw new j(b,u.code,u.config,u.request,u.response)}throw p}};var Io=(n,e,o,t)=>le(n,"get",e,o,t),So=(n,e,o,t)=>le(n,"post",e,o,t),Lo=(n,e,o,t)=>le(n,"delete",e,o,t);var Cs={setAxiosInstance(n){No(n)},getAxiosInstance(){return Pt()},getLastHttpRequestInfo(){return Ro()},getInfo(){return xo()},get(n,e,o,t){return Io(n,e,o,t)},post(n,e,o,t){return So(n,e,o,t)},delete(n,e,o,t){return Lo(n,e,o,t)},request(n,e,o,t,r){return le(n,e,o,t,r)},toQueryString(n){return yt(n)}},f=Cs;var Co=";",Ao="=",S=n=>Object.keys(n).map(e=>`${e}${Ao}${String(n[e])}`).join(Co),wo=n=>{let e={};return n.split(Co).forEach(o=>{let[t,r]=o.split(Ao);e[t]=r}),e};var cn=n=>typeof n<"u"&&typeof n!="function",we=n=>cn(n)?typeof n=="number"?!Number.isNaN(n):!0:!1,v=(n,e)=>{if(n===null)throw new TypeError(`Parameter "${e}" cannot be null.`);if(!we(n))throw new TypeError(`Parameter "${e}" has an invalid value.`)},E=(n,e)=>{if(v(n,e),!n)throw new TypeError(`Parameter "${e}" cannot be empty.`)};var Oo=function(n,e){let o=parseInt(e?.pagenumber||"0",10),t=parseInt(e?.itemsnumber||"0",10),r=parseInt(e?.totalpages||"0",10),s=parseInt(e?.totalitems||"0",10),i={getContent(){return n},getPagination(){return{pageNumber:o,itemsNumber:t,totalPages:r,totalItems:s,hasNext:r>o+1}},getPageNumber(){return o},getItemsNumber(){return t},getTotalPages(){return r},getTotalItems(){return s},hasNext(){return r>o+1}};return new Proxy(n,{get(a,p,u){return Object.hasOwn(i,p)?i[p]:Reflect.get(a,p,u)},set(a,p,u,l){return Reflect.set(a,p,u,l)},getPrototypeOf(){return Oo.prototype||null}})},x=Oo;var fe=h.Bundle.ENDPOINT_PATH,As=h.Bundle.ENDPOINT_OBTAIN_PATH,Et=h.Bundle.TYPE,ws={async get(n,e,o){E(e,"number");let r=(await f.get(n,`${fe}/${e}`,{},o)).data.items?.item.find(s=>s.type===Et);return G(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let s=(await f.get(n,fe,t,o)).data.items,i=s?.item.filter(a=>a.type===Et).map(a=>G(a));return x(i||[],s)},async create(n,e,o){v(e,"bundle");let r=(await f.post(n,fe,e.serialize(),o)).data.items?.item.find(s=>s.type===Et);return G(r)},async update(n,e,o,t){E(e,"number"),v(o,"bundle");let s=(await f.post(n,`${fe}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===Et);return G(s)},delete(n,e,o,t){return E(e,"number"),f.delete(n,`${fe}/${e}`,{forceCascade:!!o},t)},async obtain(n,e,o,t){E(e,"number"),E(o,"licenseeNumber");let r={[h.Licensee.LICENSEE_NUMBER]:o};return(await f.post(n,`${fe}/${e}/${As}`,r,t)).data.items?.item.filter(p=>p.type===h.License.TYPE)?.map(p=>z(p))||[]}},Mo=ws;var un=class{constructor(){this.validations={}}getValidators(){return this.validations}setValidation(e){return this.validations[e.productModuleNumber]=e,this}getValidation(e,o){return this.validations[e]||o}setProductModuleValidation(e){return this.setValidation(e)}getProductModuleValidation(e,o){return this.getValidation(e,o)}setTtl(e){if(!we(e))throw new TypeError(`Bad ttl:${e.toString()}`);return this.ttl=new Date(e),this}getTtl(){return this.ttl}toString(){let e="ValidationResult [";return Object.keys(this.validations).forEach(o=>{e+=`ProductModule<${o}>`,o in this.validations&&(e+=JSON.stringify(this.validations[o]))}),e+="]",e}},Dt=()=>new un;var oe=h.Licensee.ENDPOINT_PATH,Os=h.Licensee.ENDPOINT_PATH_VALIDATE,Ms=h.Licensee.ENDPOINT_PATH_TRANSFER,bt=h.Licensee.TYPE,_s={async get(n,e,o){E(e,"number");let r=(await f.get(n,`${oe}/${e}`,{},o)).data.items?.item.find(s=>s.type===bt);return W(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let s=(await f.get(n,oe,t,o)).data.items,i=s?.item.filter(a=>a.type===bt).map(a=>W(a));return x(i||[],s)},async create(n,e,o,t){v(o,"licensee");let r=o.serialize();e&&(r.productNumber=e);let i=(await f.post(n,oe,r,t)).data.items?.item.find(a=>a.type===bt);return W(i)},async update(n,e,o,t){E(e,"number"),v(o,"licensee");let s=(await f.post(n,`${oe}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===bt);return W(s)},delete(n,e,o,t){return E(e,"number"),f.delete(n,`${oe}/${e}`,{forceCascade:!!o},t)},async validate(n,e,o,t){E(e,"number");let r={};if(o){let u=o.productNumber;u&&(r.productNumber=u);let l=o.licenseeProperties;Object.keys(l).forEach(b=>{r[b]=o.getLicenseeProperty(b)}),o.isForOfflineUse()&&(r.forOfflineUse=!0),o.isDryRun()&&(r.dryRun=!0);let T=o.getParameters();Object.keys(T).forEach((b,I)=>{r[`${h.ProductModule.PRODUCT_MODULE_NUMBER}${I}`]=b;let g=T[b];g&&Object.keys(g).forEach(D=>{r[D+I]=g[D]})})}let s=await f.post(n,`${oe}/${e}/${Os}`,r,t),i=Dt(),a=s.data.ttl;return a&&i.setTtl(a),s.data.items?.item.filter(u=>u.type===h.Validation.TYPE)?.forEach(u=>{i.setValidation(N(u))}),i},transfer(n,e,o,t){E(e,"number"),E(o,"sourceLicenseeNumber");let r={sourceLicenseeNumber:o};return f.post(n,`${oe}/${e}/${Ms}`,r,t)}},_o=_s;var Oe=h.License.ENDPOINT_PATH,vt=h.License.TYPE,Us={async get(n,e,o){E(e,"number");let r=(await f.get(n,`${Oe}/${e}`,{},o)).data.items?.item.find(s=>s.type===vt);return z(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let s=(await f.get(n,Oe,t,o)).data.items,i=s?.item.filter(a=>a.type===vt).map(a=>z(a));return x(i||[],s)},async create(n,e,o,t,r,s){v(r,"license");let i=r.serialize();e&&(i.licenseeNumber=e),o&&(i.licenseTemplateNumber=o),t&&(i.transactionNumber=t);let p=(await f.post(n,Oe,i,s)).data.items?.item.find(u=>u.type===vt);return z(p)},async update(n,e,o,t,r){E(e,"number"),v(t,"license");let s=t.serialize();o&&(s.transactionNumber=o);let a=(await f.post(n,`${Oe}/${e}`,s,r)).data.items?.item.find(p=>p.type===vt);return z(a)},delete(n,e,o,t){return E(e,"number"),f.delete(n,`${Oe}/${e}`,{forceCascade:!!o},t)}},Uo=Us;var Me=h.LicenseTemplate.ENDPOINT_PATH,Nt=h.LicenseTemplate.TYPE,ks={async get(n,e,o){E(e,"number");let r=(await f.get(n,`${Me}/${e}`,{},o)).data.items?.item.find(s=>s.type===Nt);return X(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let s=(await f.get(n,Me,t,o)).data.items,i=s?.item.filter(a=>a.type===Nt).map(a=>X(a));return x(i||[],s)},async create(n,e,o,t){v(o,"licenseTemplate");let r=o.serialize();e&&(r.productModuleNumber=e);let i=(await f.post(n,Me,r,t)).data.items?.item.find(a=>a.type===Nt);return X(i)},async update(n,e,o,t){E(e,"number"),v(o,"licenseTemplate");let s=(await f.post(n,`${Me}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===Nt);return X(s)},delete(n,e,o,t){return E(e,"number"),f.delete(n,`${Me}/${e}`,{forceCascade:!!o},t)}},ko=ks;var _e=h.Notification.ENDPOINT_PATH,Rt=h.Notification.TYPE,js={async get(n,e,o){E(e,"number");let r=(await f.get(n,`${_e}/${e}`,{},o)).data.items?.item.find(s=>s.type===Rt);return Q(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let s=(await f.get(n,_e,t,o)).data.items,i=s?.item.filter(a=>a.type===Rt).map(a=>Q(a));return x(i||[],s)},async create(n,e,o){v(e,"notification");let r=(await f.post(n,_e,e.serialize(),o)).data.items?.item.find(s=>s.type===Rt);return Q(r)},async update(n,e,o,t){E(e,"number"),v(o,"notification");let s=(await f.post(n,`${_e}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===Rt);return Q(s)},delete(n,e,o,t){return E(e,"number"),f.delete(n,`${_e}/${e}`,{forceCascade:!!o},t)}},jo=js;var dn=h.PaymentMethod.ENDPOINT_PATH,mn=h.PaymentMethod.TYPE,Bs={async get(n,e,o){E(e,"number");let r=(await f.get(n,`${dn}/${e}`,{},o)).data.items?.item.find(s=>s.type===mn);return se(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let s=(await f.get(n,dn,t,o)).data.items,i=s?.item.filter(a=>a.type===mn).map(a=>se(a));return x(i||[],s)},async update(n,e,o,t){E(e,"number"),v(o,"paymentMethod");let s=(await f.post(n,`${dn}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===mn);return se(s)}},Bo=Bs;var Ue=h.ProductModule.ENDPOINT_PATH,xt=h.ProductModule.TYPE,Fs={async get(n,e,o){E(e,"number");let r=(await f.get(n,`${Ue}/${e}`,{},o)).data.items?.item.find(s=>s.type===xt);return te(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let s=(await f.get(n,Ue,t,o)).data.items,i=s?.item.filter(a=>a.type===xt).map(a=>te(a));return x(i||[],s)},async create(n,e,o,t){v(o,"productModule");let r=o.serialize();e&&(r.productNumber=e);let i=(await f.post(n,Ue,r,t)).data.items?.item.find(a=>a.type===xt);return te(i)},async update(n,e,o,t){E(e,"number"),v(o,"productModule");let s=(await f.post(n,`${Ue}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===xt);return te(s)},delete(n,e,o,t){return E(e,"number"),f.delete(n,`${Ue}/${e}`,{forceCascade:!!o},t)}},Fo=Fs;var ke=h.Product.ENDPOINT_PATH,It=h.Product.TYPE,Vs={async get(n,e,o){E(e,"number");let r=(await f.get(n,`${ke}/${e}`,{},o)).data.items?.item.find(s=>s.type===It);return ee(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let s=(await f.get(n,ke,t,o)).data.items,i=s?.item.filter(a=>a.type===It).map(a=>ee(a));return x(i||[],s)},async create(n,e,o){v(e,"product");let r=(await f.post(n,ke,e.serialize(),o)).data.items?.item.find(s=>s.type===It);return ee(r)},async update(n,e,o,t){E(e,"number"),v(o,"product");let s=(await f.post(n,`${ke}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===It);return ee(s)},delete(n,e,o,t){return E(e,"number"),f.delete(n,`${ke}/${e}`,{forceCascade:!!o},t)}},Vo=Vs;var St=h.Token.ENDPOINT_PATH,pn=h.Token.TYPE,qs={async get(n,e,o){E(e,"number");let r=(await f.get(n,`${St}/${e}`,{},o)).data.items?.item.find(s=>s.type===pn);return pe(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let s=(await f.get(n,St,t,o)).data.items,i=s?.item.filter(a=>a.type===pn).map(a=>pe(a));return x(i||[],s)},async create(n,e,o){v(e,"token");let r=(await f.post(n,St,e.serialize(),o)).data.items?.item.find(s=>s.type===pn);return pe(r)},delete(n,e,o,t){return E(e,"number"),f.delete(n,`${St}/${e}`,{forceCascade:!!o},t)}},qo=qs;var Lt=h.Transaction.ENDPOINT_PATH,Ct=h.Transaction.TYPE,Hs={async get(n,e,o){E(e,"number");let r=(await f.get(n,`${Lt}/${e}`,{},o)).data.items?.item.find(s=>s.type===Ct);return ne(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let s=(await f.get(n,Lt,t,o)).data.items,i=s?.item.filter(a=>a.type===Ct).map(a=>ne(a));return x(i||[],s)},async create(n,e,o){v(e,"transaction");let r=(await f.post(n,Lt,e.serialize(),o)).data.items?.item.find(s=>s.type===Ct);return ne(r)},async update(n,e,o,t){E(e,"number"),v(o,"transaction");let s=(await f.post(n,`${Lt}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===Ct);return ne(s)}},Ho=Hs;var ln=h.Utility.ENDPOINT_PATH,$s={async listLicenseTypes(n,e){let o=`${ln}/${h.Utility.ENDPOINT_PATH_LICENSE_TYPES}`,r=(await f.get(n,o,void 0,e)).data.items,s=h.Utility.LICENSE_TYPE,i=r?.item.filter(a=>a.type===s).map(a=>N(a).name);return x(i||[],r)},async listLicensingModels(n,e){let o=`${ln}/${h.Utility.ENDPOINT_PATH_LICENSING_MODELS}`,r=(await f.get(n,o,void 0,e)).data.items,s=h.Utility.LICENSING_MODEL_TYPE,i=r?.item.filter(a=>a.type===s).map(a=>N(a).name);return x(i||[],r)},async listCountries(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:S(e));let r=`${ln}/${h.Utility.ENDPOINT_PATH_COUNTRIES}`,i=(await f.get(n,r,t,o)).data.items,a=h.Utility.COUNTRY_TYPE,p=i?.item.filter(u=>u.type===a).map(u=>$e(u));return x(p||[],i)}},$o=$s;var fn=class{constructor(e){this.baseUrl=e?.baseUrl||"https://go.netlicensing.io/core/v2/rest",this.securityMode=e?.securityMode||V.BASIC_AUTHENTICATION,this.username=e?.username,this.password=e?.password,this.apiKey=e?.apiKey,this.publicKey=e?.publicKey}setBaseUrl(e){return this.baseUrl=e,this}getBaseUrl(){return this.baseUrl}setSecurityMode(e){return this.securityMode=e,this}getSecurityMode(){return this.securityMode}setUsername(e){return this.username=e,this}getUsername(e){return this.username||e}setPassword(e){return this.password=e,this}getPassword(e){return this.password||e}setApiKey(e){return this.apiKey=e,this}getApiKey(e){return this.apiKey||e}setPublicKey(e){return this.publicKey=e,this}getPublicKey(e){return this.publicKey||e}},zo=n=>new fn(n);var Tn=class{constructor(){this.parameters={},this.licenseeProperties={}}setProductNumber(e){return this.productNumber=e,this}getProductNumber(){return this.productNumber}setLicenseeName(e){return this.licenseeProperties.licenseeName=e,this}getLicenseeName(){return this.licenseeProperties.licenseeName}setLicenseeSecret(e){return this.licenseeProperties.licenseeSecret=e,this}getLicenseeSecret(){return this.licenseeProperties.licenseeSecret}getLicenseeProperties(){return this.licenseeProperties}setLicenseeProperty(e,o){return this.licenseeProperties[e]=o,this}getLicenseeProperty(e,o){return this.licenseeProperties[e]||o}setForOfflineUse(e){return this.forOfflineUse=e,this}isForOfflineUse(){return!!this.forOfflineUse}setDryRun(e){return this.dryRun=e,this}isDryRun(){return!!this.dryRun}getParameters(){return this.parameters}setParameter(e,o){return this.parameters[e]=o,this}getParameter(e){return this.parameters[e]}getProductModuleValidationParameters(e){return this.getParameter(e)}setProductModuleValidationParameters(e,o){return this.setParameter(e,o)}},Yo=()=>new Tn;return Xo(zs);})();
|
|
1
|
+
"use strict";var NetLicensing=(()=>{var qt=Object.defineProperty;var ar=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var ur=Object.prototype.hasOwnProperty;var _n=(n,e)=>{for(var o in e)qt(n,o,{get:e[o],enumerable:!0})},dr=(n,e,o,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of cr(e))!ur.call(n,r)&&r!==o&&qt(n,r,{get:()=>e[r],enumerable:!(t=ar(e,r))||t.enumerable});return n};var mr=n=>dr(qt({},"__esModule",{value:!0}),n);var ui={};_n(ui,{ApiKeyRole:()=>Mn,Bundle:()=>Ze,BundleService:()=>Ko,Constants:()=>h,Context:()=>rr,Country:()=>et,License:()=>de,LicenseService:()=>Go,LicenseTemplate:()=>ot,LicenseTemplateService:()=>Wo,LicenseTransactionJoin:()=>vt,LicenseType:()=>Re,Licensee:()=>nt,LicenseeSecretMode:()=>We,LicenseeService:()=>Jo,LicensingModel:()=>Un,NlicError:()=>k,NodeSecretMode:()=>jn,Notification:()=>rt,NotificationEvent:()=>Ne,NotificationProtocol:()=>ve,NotificationService:()=>Xo,Page:()=>I,PaymentMethod:()=>st,PaymentMethodEnum:()=>Bn,PaymentMethodService:()=>Qo,Product:()=>it,ProductDiscount:()=>Dt,ProductModule:()=>Rt,ProductModuleService:()=>Zo,ProductService:()=>er,SecurityMode:()=>Y,Service:()=>g,TimeVolumePeriod:()=>Xe,Token:()=>Nt,TokenService:()=>tr,TokenType:()=>Ie,Transaction:()=>Fe,TransactionService:()=>nr,TransactionSource:()=>Qe,TransactionStatus:()=>xe,UtilityService:()=>or,ValidationParameters:()=>sr,ValidationResults:()=>St,defineEntity:()=>v,ensureNotEmpty:()=>b,ensureNotNull:()=>R,filterDecode:()=>zo,filterEncode:()=>x,isDefined:()=>En,isValid:()=>qe,itemToBundle:()=>ee,itemToCountry:()=>tt,itemToLicense:()=>J,itemToLicenseTemplate:()=>ne,itemToLicensee:()=>te,itemToNotification:()=>oe,itemToObject:()=>N,itemToPaymentMethod:()=>me,itemToProduct:()=>se,itemToProductModule:()=>ie,itemToToken:()=>ye,itemToTransaction:()=>ae,serialize:()=>C});var pr=Object.freeze({DISABLED:"DISABLED",PREDEFINED:"PREDEFINED",CLIENT:"CLIENT"}),We=pr;var lr=Object.freeze({FEATURE:"FEATURE",TIMEVOLUME:"TIMEVOLUME",FLOATING:"FLOATING",QUANTITY:"QUANTITY"}),Re=lr;var fr=Object.freeze({LICENSEE_CREATED:"LICENSEE_CREATED",LICENSE_CREATED:"LICENSE_CREATED",WARNING_LEVEL_CHANGED:"WARNING_LEVEL_CHANGED",PAYMENT_TRANSACTION_PROCESSED:"PAYMENT_TRANSACTION_PROCESSED"}),Ne=fr;var gr=Object.freeze({WEBHOOK:"WEBHOOK"}),ve=gr;var Tr=Object.freeze({BASIC_AUTHENTICATION:"BASIC_AUTH",APIKEY_IDENTIFICATION:"APIKEY",ANONYMOUS_IDENTIFICATION:"ANONYMOUS"}),Y=Tr;var Pr=Object.freeze({DAY:"DAY",WEEK:"WEEK",MONTH:"MONTH",YEAR:"YEAR"}),Xe=Pr;var hr=Object.freeze({DEFAULT:"DEFAULT",SHOP:"SHOP",APIKEY:"APIKEY",ACTION:"ACTION"}),Ie=hr;var yr=Object.freeze({SHOP:"SHOP",AUTO_LICENSE_CREATE:"AUTO_LICENSE_CREATE",AUTO_LICENSE_UPDATE:"AUTO_LICENSE_UPDATE",AUTO_LICENSE_DELETE:"AUTO_LICENSE_DELETE",AUTO_LICENSEE_CREATE:"AUTO_LICENSEE_CREATE",AUTO_LICENSEE_DELETE:"AUTO_LICENSEE_DELETE",AUTO_LICENSEE_VALIDATE:"AUTO_LICENSEE_VALIDATE",AUTO_LICENSETEMPLATE_DELETE:"AUTO_LICENSETEMPLATE_DELETE",AUTO_PRODUCTMODULE_DELETE:"AUTO_PRODUCTMODULE_DELETE",AUTO_PRODUCT_DELETE:"AUTO_PRODUCT_DELETE",AUTO_LICENSES_TRANSFER:"AUTO_LICENSES_TRANSFER",SUBSCRIPTION_UPDATE:"SUBSCRIPTION_UPDATE",RECURRING_PAYMENT:"RECURRING_PAYMENT",CANCEL_RECURRING_PAYMENT:"CANCEL_RECURRING_PAYMENT",OBTAIN_BUNDLE:"OBTAIN_BUNDLE"}),Qe=yr;var Er=Object.freeze({PENDING:"PENDING",CLOSED:"CLOSED",CANCELLED:"CANCELLED"}),xe=Er;var h={LicenseeSecretMode:We,LicenseType:Re,NotificationEvent:Ne,NotificationProtocol:ve,SecurityMode:Y,TimeVolumePeriod:Xe,TokenType:Ie,TransactionSource:Qe,TransactionStatus:xe,BASIC_AUTHENTICATION:"BASIC_AUTH",APIKEY_IDENTIFICATION:"APIKEY",ANONYMOUS_IDENTIFICATION:"ANONYMOUS",FILTER:"filter",Product:{TYPE:"Product",ENDPOINT_PATH:"product"},ProductModule:{TYPE:"ProductModule",ENDPOINT_PATH:"productmodule",PRODUCT_MODULE_NUMBER:"productModuleNumber"},Licensee:{TYPE:"Licensee",ENDPOINT_PATH:"licensee",ENDPOINT_PATH_VALIDATE:"validate",ENDPOINT_PATH_TRANSFER:"transfer",LICENSEE_NUMBER:"licenseeNumber"},LicenseTemplate:{TYPE:"LicenseTemplate",ENDPOINT_PATH:"licensetemplate",LicenseType:Re},License:{TYPE:"License",ENDPOINT_PATH:"license"},Validation:{TYPE:"ProductModuleValidation"},Token:{TYPE:"Token",ENDPOINT_PATH:"token",Type:Ie},PaymentMethod:{TYPE:"PaymentMethod",ENDPOINT_PATH:"paymentmethod"},Bundle:{TYPE:"Bundle",ENDPOINT_PATH:"bundle",ENDPOINT_OBTAIN_PATH:"obtain"},Notification:{TYPE:"Notification",ENDPOINT_PATH:"notification",Protocol:ve,Event:Ne},Transaction:{TYPE:"Transaction",ENDPOINT_PATH:"transaction",Status:xe},Utility:{ENDPOINT_PATH:"utility",ENDPOINT_PATH_LICENSE_TYPES:"licenseTypes",ENDPOINT_PATH_LICENSING_MODELS:"licensingModels",ENDPOINT_PATH_COUNTRIES:"countries",LICENSING_MODEL_TYPE:"LicensingModelProperties",LICENSE_TYPE:"LicenseType",COUNTRY_TYPE:"Country"}};var br=Object.freeze({ROLE_APIKEY_LICENSEE:"ROLE_APIKEY_LICENSEE",ROLE_APIKEY_ANALYTICS:"ROLE_APIKEY_ANALYTICS",ROLE_APIKEY_OPERATION:"ROLE_APIKEY_OPERATION",ROLE_APIKEY_MAINTENANCE:"ROLE_APIKEY_MAINTENANCE",ROLE_APIKEY_ADMIN:"ROLE_APIKEY_ADMIN"}),Mn=br;var Dr=Object.freeze({TRY_AND_BUY:"TryAndBuy",SUBSCRIPTION:"Subscription",RENTAL:"Rental",FLOATING:"Floating",MULTI_FEATURE:"MultiFeature",PAY_PER_USE:"PayPerUse",PRICING_TABLE:"PricingTable",QUOTA:"Quota",NODE_LOCKED:"NodeLocked",DISCOUNT:"Discount"}),Un=Dr;var Rr=Object.freeze({PREDEFINED:"PREDEFINED",CLIENT:"CLIENT"}),jn=Rr;var Nr=Object.freeze({NULL:"NULL",PAYPAL:"PAYPAL",PAYPAL_SANDBOX:"PAYPAL_SANDBOX",STRIPE:"STRIPE",STRIPE_TESTING:"STRIPE_TESTING"}),Bn=Nr;var vr=n=>{try{return JSON.parse(n)}catch{return n}},Ir=n=>{let e={};return n?.forEach(({name:o,value:t})=>{e[o]=vr(t)}),e},xr=n=>{let e={};return n?.forEach(o=>{let{name:t}=o;e[t]=e[t]||[],e[t].push(kn(o))}),e},kn=n=>n?{...Ir(n.property),...xr(n.list)}:{},N=kn;var Vt=(n,e)=>Object.hasOwn(n,e),l=(n,e,o)=>{n[e]=o},p=(n,e,o)=>Vt(n,e)?n[e]:o;var C=(n,e={})=>{let o={},{ignore:t=[]}=e;return Object.entries(n).forEach(([r,s])=>{if(!t.includes(r)&&typeof s!="function")if(s===void 0)o[r]="";else if(typeof s=="string")o[r]=s;else if(s instanceof Date)o[r]=s.toISOString();else if(typeof s!="object"||s===null)o[r]=String(s);else try{o[r]=JSON.stringify(s)}catch{o[r]=String(s)}}),o};var Lr=function(n,e,o={},t){let r={set:[],get:[]};t?.get&&r.get.push(t.get),t?.set&&r.set.push(t.set);let s={set(i,a){l(n,i,a)},get(i,a){return p(n,i,a)},has(i){return Vt(n,i)},setProperty(i,a){this.set(i,a)},addProperty(i,a){this.set(i,a)},getProperty(i,a){return this.get(i,a)},hasProperty(i){return this.has(i)},setProperties(i){Object.entries(i).forEach(([a,d])=>{this.set(a,d)})},serialize(){return C(n)}};return new Proxy(n,{get(i,a,d){return Object.hasOwn(e,a)?e[a]:Object.hasOwn(s,a)?s[a]:(r.get.forEach(u=>{u(i,a,d)}),Reflect.get(i,a,d))},set(i,a,d,u){return r.set.forEach(m=>{m(i,a,d,u)}),Reflect.set(i,a,d,u)},getPrototypeOf(){return o.prototype||null}})},v=Lr;var Fn=function(n={}){let e={...n};return v(e,{setActive(t){l(e,"active",t)},getActive(t){return p(e,"active",t)},setNumber(t){l(e,"number",t)},getNumber(t){return p(e,"number",t)},setName(t){l(e,"name",t)},getName(t){return p(e,"name",t)},setPrice(t){l(e,"price",t)},getPrice(t){return p(e,"price",t)},setCurrency(t){l(e,"currency",t)},getCurrency(t){return p(e,"currency",t)},setProductNumber(t){l(e,"productNumber",t)},getProductNumber(t){return p(e,"productNumber",t)},setLicenseTemplateNumbers(t){l(e,"licenseTemplateNumbers",t)},addLicenseTemplateNumber(t){e.licenseTemplateNumbers||(e.licenseTemplateNumbers=[]),e.licenseTemplateNumbers.push(t)},getLicenseTemplateNumbers(t){return p(e,"licenseTemplateNumbers",t)},removeLicenseTemplateNumber(t){let{licenseTemplateNumbers:r=[]}=e;r.splice(r.indexOf(t),1),e.licenseTemplateNumbers=r},getStaleLicenseTemplateNumbers(t){return p(e,"staleLicenseTemplateNumbers",t)},serialize(){let t={};return e.licenseTemplateNumbers&&(t.licenseTemplateNumbers=e.licenseTemplateNumbers.join(",")),C({...e,...t},{ignore:["staleLicenseTemplateNumbers"]})}},Fn)},Ze=Fn;var ee=n=>{let e=N(n),{licenseTemplateNumbers:o}=e;return o&&typeof o=="string"&&(e.licenseTemplateNumbers=o.split(",")),Ze(e)};var qn=function(n={}){let o={...{code:"",name:"",vatPercent:0,isEu:!1},...n};return v(o,{getCode(){return o.code},getName(){return o.name},getVatPercent(){return o.vatPercent},getIsEu(){return o.isEu}},qn)},et=qn;var tt=n=>et(N(n));var Vn=function(n={}){let e={...n};return v(e,{setActive(t){l(e,"active",t)},getActive(t){return p(e,"active",t)},setNumber(t){l(e,"number",t)},getNumber(t){return p(e,"number",t)},setName(t){l(e,"name",t)},getName(t){return p(e,"name",t)},setPrice(t){l(e,"price",t)},getPrice(t){return p(e,"price",t)},setCurrency(t){l(e,"currency",t)},getCurrency(t){return p(e,"currency",t)},setHidden(t){l(e,"hidden",t)},getHidden(t){return p(e,"hidden",t)},setLicenseeNumber(t){l(e,"licenseeNumber",t)},getLicenseeNumber(t){return p(e,"licenseeNumber",t)},setLicenseTemplateNumber(t){l(e,"licenseTemplateNumber",t)},getLicenseTemplateNumber(t){return p(e,"licenseTemplateNumber",t)},setProductModuleNumber(t){l(e,"productModuleNumber",t)},getProductModuleNumber(t){return p(e,"productModuleNumber",t)},serialize(){return C(e,{ignore:["inUse"]})}},Vn)},de=Vn;var J=n=>{let e=N(n),{startDate:o}=e;return o&&typeof o=="string"&&(e.startDate=o==="now"?o:new Date(o)),de(e)};var Hn=function(n={}){let e={...n};return v(e,{setActive(t){l(e,"active",t)},getActive(t){return p(e,"active",t)},setNumber(t){l(e,"number",t)},getNumber(t){return p(e,"number",t)},setName(t){l(e,"name",t)},getName(t){return p(e,"name",t)},setProductNumber(t){l(e,"productNumber",t)},getProductNumber(t){return p(e,"productNumber",t)},setMarkedForTransfer(t){l(e,"markedForTransfer",t)},getMarkedForTransfer(t){return p(e,"markedForTransfer",t)},serialize(){return C(e,{ignore:["inUse"]})}},Hn)},nt=Hn;var te=n=>nt(N(n));var $n=function(n={}){let e={...n};return v(e,{setActive(t){l(e,"active",t)},getActive(t){return p(e,"active",t)},setNumber(t){l(e,"number",t)},getNumber(t){return p(e,"number",t)},setName(t){l(e,"name",t)},getName(t){return p(e,"name",t)},setLicenseType(t){l(e,"licenseType",t)},getLicenseType(t){return p(e,"licenseType",t)},setPrice(t){l(e,"price",t)},getPrice(t){return p(e,"price",t)},setCurrency(t){l(e,"currency",t)},getCurrency(t){return p(e,"currency",t)},setAutomatic(t){l(e,"automatic",t)},getAutomatic(t){return p(e,"automatic",t)},setHidden(t){l(e,"hidden",t)},getHidden(t){return p(e,"hidden",t)},setHideLicenses(t){l(e,"hideLicenses",t)},getHideLicenses(t){return p(e,"hideLicenses",t)},setProductModuleNumber(t){l(e,"productModuleNumber",t)},getProductModuleNumber(t){return p(e,"productModuleNumber",t)},serialize(){return C(e,{ignore:["inUse"]})}},$n)},ot=$n;var ne=n=>ot(N(n));var zn=function(n={}){let e={...n};return v(e,{setActive(t){l(e,"active",t)},getActive(t){return p(e,"active",t)},setNumber(t){l(e,"number",t)},getNumber(t){return p(e,"number",t)},setName(t){l(e,"name",t)},getName(t){return p(e,"name",t)},setProtocol(t){l(e,"protocol",t)},getProtocol(t){return p(e,"protocol",t)},setEvents(t){l(e,"events",t)},getEvents(t){return p(e,"events",t)},addEvent(t){let r=this.getEvents([]);r.push(t),this.setEvents(r)},setPayload(t){l(e,"payload",t)},getPayload(t){return p(e,"payload",t)},setEndpoint(t){l(e,"endpoint",t)},getEndpoint(t){return p(e,"endpoint",t)},serialize(){let t=C(e);return t.events&&(t.events=this.getEvents([]).join(",")),t}},zn)},rt=zn;var oe=n=>{let e=N(n),{events:o}=e;return o&&typeof o=="string"&&(e.events=o.split(",")),rt(e)};var Yn=function(n={}){let e={...n};return v(e,{setActive(t){l(e,"active",t)},getActive(t){return p(e,"active",t)},setNumber(t){l(e,"number",t)},getNumber(t){return p(e,"number",t)}},Yn)},st=Yn;var me=n=>st(N(n));var Kn=function(n={}){let e={...n};return v(e,{setActive(t){l(e,"active",t)},getActive(t){return p(e,"active",t)},setNumber(t){l(e,"number",t)},getNumber(t){return p(e,"number",t)},setName(t){l(e,"name",t)},getName(t){return p(e,"name",t)},setVersion(t){l(e,"version",t)},getVersion(t){return p(e,"version",t)},setDescription(t){l(e,"description",t)},getDescription(t){return p(e,"description",t)},setLicensingInfo(t){l(e,"licensingInfo",t)},getLicensingInfo(t){return p(e,"licensingInfo",t)},setLicenseeAutoCreate(t){l(e,"licenseeAutoCreate",t)},getLicenseeAutoCreate(t){return p(e,"licenseeAutoCreate",t)},setDiscounts(t){l(e,"discounts",t)},getDiscounts(t){return p(e,"discounts",t)},addDiscount(t){let r=this.getDiscounts([]);r.push(t),this.setDiscounts(r)},removeDiscount(t){let r=this.getDiscounts();Array.isArray(r)&&r.length>0&&(r.splice(r.indexOf(t),1),this.setDiscounts(r))},setProductDiscounts(t){this.setDiscounts(t)},getProductDiscounts(t){return this.getDiscounts(t)},serialize(){let t=C(e,{ignore:["discounts","inUse"]}),r=this.getDiscounts();return r&&(t.discount=r.length>0?r.map(s=>s.toString()):""),t}},Kn)},it=Kn;function Le(n,e){return function(){return n.apply(e,arguments)}}var{toString:Sr}=Object.prototype,{getPrototypeOf:$t}=Object,{iterator:ct,toStringTag:Xn}=Symbol,ut=(n=>e=>{let o=Sr.call(e);return n[o]||(n[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),$=n=>(n=n.toLowerCase(),e=>ut(e)===n),dt=n=>e=>typeof e===n,{isArray:le}=Array,pe=dt("undefined");function Se(n){return n!==null&&!pe(n)&&n.constructor!==null&&!pe(n.constructor)&&B(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}var Qn=$("ArrayBuffer");function Cr(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&Qn(n.buffer),e}var Ar=dt("string"),B=dt("function"),Zn=dt("number"),Ce=n=>n!==null&&typeof n=="object",Or=n=>n===!0||n===!1,at=n=>{if(ut(n)!=="object")return!1;let e=$t(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Xn in n)&&!(ct in n)},wr=n=>{if(!Ce(n)||Se(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},_r=$("Date"),Mr=$("File"),Ur=n=>!!(n&&typeof n.uri<"u"),jr=n=>n&&typeof n.getParts<"u",Br=$("Blob"),kr=$("FileList"),Fr=n=>Ce(n)&&B(n.pipe);function qr(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}var Jn=qr(),Gn=typeof Jn.FormData<"u"?Jn.FormData:void 0,Vr=n=>{let e;return n&&(Gn&&n instanceof Gn||B(n.append)&&((e=ut(n))==="formdata"||e==="object"&&B(n.toString)&&n.toString()==="[object FormData]"))},Hr=$("URLSearchParams"),[$r,zr,Yr,Kr]=["ReadableStream","Request","Response","Headers"].map($),Jr=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ae(n,e,{allOwnKeys:o=!1}={}){if(n===null||typeof n>"u")return;let t,r;if(typeof n!="object"&&(n=[n]),le(n))for(t=0,r=n.length;t<r;t++)e.call(null,n[t],t,n);else{if(Se(n))return;let s=o?Object.getOwnPropertyNames(n):Object.keys(n),i=s.length,a;for(t=0;t<i;t++)a=s[t],e.call(null,n[a],a,n)}}function eo(n,e){if(Se(n))return null;e=e.toLowerCase();let o=Object.keys(n),t=o.length,r;for(;t-- >0;)if(r=o[t],e===r.toLowerCase())return r;return null}var re=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,to=n=>!pe(n)&&n!==re;function Ht(){let{caseless:n,skipUndefined:e}=to(this)&&this||{},o={},t=(r,s)=>{if(s==="__proto__"||s==="constructor"||s==="prototype")return;let i=n&&eo(o,s)||s;at(o[i])&&at(r)?o[i]=Ht(o[i],r):at(r)?o[i]=Ht({},r):le(r)?o[i]=r.slice():(!e||!pe(r))&&(o[i]=r)};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&Ae(arguments[r],t);return o}var Gr=(n,e,o,{allOwnKeys:t}={})=>(Ae(e,(r,s)=>{o&&B(r)?Object.defineProperty(n,s,{value:Le(r,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(n,s,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:t}),n),Wr=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Xr=(n,e,o,t)=>{n.prototype=Object.create(e.prototype,t),Object.defineProperty(n.prototype,"constructor",{value:n,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(n,"super",{value:e.prototype}),o&&Object.assign(n.prototype,o)},Qr=(n,e,o,t)=>{let r,s,i,a={};if(e=e||{},n==null)return e;do{for(r=Object.getOwnPropertyNames(n),s=r.length;s-- >0;)i=r[s],(!t||t(i,n,e))&&!a[i]&&(e[i]=n[i],a[i]=!0);n=o!==!1&&$t(n)}while(n&&(!o||o(n,e))&&n!==Object.prototype);return e},Zr=(n,e,o)=>{n=String(n),(o===void 0||o>n.length)&&(o=n.length),o-=e.length;let t=n.indexOf(e,o);return t!==-1&&t===o},es=n=>{if(!n)return null;if(le(n))return n;let e=n.length;if(!Zn(e))return null;let o=new Array(e);for(;e-- >0;)o[e]=n[e];return o},ts=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&$t(Uint8Array)),ns=(n,e)=>{let t=(n&&n[ct]).call(n),r;for(;(r=t.next())&&!r.done;){let s=r.value;e.call(n,s[0],s[1])}},os=(n,e)=>{let o,t=[];for(;(o=n.exec(e))!==null;)t.push(o);return t},rs=$("HTMLFormElement"),ss=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,t,r){return t.toUpperCase()+r}),Wn=(({hasOwnProperty:n})=>(e,o)=>n.call(e,o))(Object.prototype),is=$("RegExp"),no=(n,e)=>{let o=Object.getOwnPropertyDescriptors(n),t={};Ae(o,(r,s)=>{let i;(i=e(r,s,n))!==!1&&(t[s]=i||r)}),Object.defineProperties(n,t)},as=n=>{no(n,(e,o)=>{if(B(n)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;let t=n[o];if(B(t)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},cs=(n,e)=>{let o={},t=r=>{r.forEach(s=>{o[s]=!0})};return le(n)?t(n):t(String(n).split(e)),o},us=()=>{},ds=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e;function ms(n){return!!(n&&B(n.append)&&n[Xn]==="FormData"&&n[ct])}var ps=n=>{let e=new Array(10),o=(t,r)=>{if(Ce(t)){if(e.indexOf(t)>=0)return;if(Se(t))return t;if(!("toJSON"in t)){e[r]=t;let s=le(t)?[]:{};return Ae(t,(i,a)=>{let d=o(i,r+1);!pe(d)&&(s[a]=d)}),e[r]=void 0,s}}return t};return o(n,0)},ls=$("AsyncFunction"),fs=n=>n&&(Ce(n)||B(n))&&B(n.then)&&B(n.catch),oo=((n,e)=>n?setImmediate:e?((o,t)=>(re.addEventListener("message",({source:r,data:s})=>{r===re&&s===o&&t.length&&t.shift()()},!1),r=>{t.push(r),re.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",B(re.postMessage)),gs=typeof queueMicrotask<"u"?queueMicrotask.bind(re):typeof process<"u"&&process.nextTick||oo,Ts=n=>n!=null&&B(n[ct]),c={isArray:le,isArrayBuffer:Qn,isBuffer:Se,isFormData:Vr,isArrayBufferView:Cr,isString:Ar,isNumber:Zn,isBoolean:Or,isObject:Ce,isPlainObject:at,isEmptyObject:wr,isReadableStream:$r,isRequest:zr,isResponse:Yr,isHeaders:Kr,isUndefined:pe,isDate:_r,isFile:Mr,isReactNativeBlob:Ur,isReactNative:jr,isBlob:Br,isRegExp:is,isFunction:B,isStream:Fr,isURLSearchParams:Hr,isTypedArray:ts,isFileList:kr,forEach:Ae,merge:Ht,extend:Gr,trim:Jr,stripBOM:Wr,inherits:Xr,toFlatObject:Qr,kindOf:ut,kindOfTest:$,endsWith:Zr,toArray:es,forEachEntry:ns,matchAll:os,isHTMLForm:rs,hasOwnProperty:Wn,hasOwnProp:Wn,reduceDescriptors:no,freezeMethods:as,toObjectSet:cs,toCamelCase:ss,noop:us,toFiniteNumber:ds,findKey:eo,global:re,isContextDefined:to,isSpecCompliantForm:ms,toJSONObject:ps,isAsyncFn:ls,isThenable:fs,setImmediate:oo,asap:gs,isIterable:Ts};var M=class n extends Error{static from(e,o,t,r,s,i){let a=new n(e.message,o||e.code,t,r,s);return a.cause=e,a.name=e.name,e.status!=null&&a.status==null&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,o,t,r,s){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,o&&(this.code=o),t&&(this.config=t),r&&(this.request=r),s&&(this.response=s,this.status=s.status)}toJSON(){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:c.toJSONObject(this.config),code:this.code,status:this.status}}};M.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";M.ERR_BAD_OPTION="ERR_BAD_OPTION";M.ECONNABORTED="ECONNABORTED";M.ETIMEDOUT="ETIMEDOUT";M.ERR_NETWORK="ERR_NETWORK";M.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";M.ERR_DEPRECATED="ERR_DEPRECATED";M.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";M.ERR_BAD_REQUEST="ERR_BAD_REQUEST";M.ERR_CANCELED="ERR_CANCELED";M.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";M.ERR_INVALID_URL="ERR_INVALID_URL";var E=M;var mt=null;function Yt(n){return c.isPlainObject(n)||c.isArray(n)}function ro(n){return c.endsWith(n,"[]")?n.slice(0,-2):n}function zt(n,e,o){return n?n.concat(e).map(function(r,s){return r=ro(r),!o&&s?"["+r+"]":r}).join(o?".":""):e}function Ps(n){return c.isArray(n)&&!n.some(Yt)}var hs=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function ys(n,e,o){if(!c.isObject(n))throw new TypeError("target must be an object");e=e||new(mt||FormData),o=c.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,T){return!c.isUndefined(T[y])});let t=o.metaTokens,r=o.visitor||m,s=o.dots,i=o.indexes,d=(o.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(c.isBoolean(f))return f.toString();if(!d&&c.isBlob(f))throw new E("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?d&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function m(f,y,T){let A=f;if(c.isReactNative(e)&&c.isReactNativeBlob(f))return e.append(zt(T,y,s),u(f)),!1;if(f&&!T&&typeof f=="object"){if(c.endsWith(y,"{}"))y=t?y:y.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&Ps(f)||(c.isFileList(f)||c.endsWith(y,"[]"))&&(A=c.toArray(f)))return y=ro(y),A.forEach(function(_,U){!(c.isUndefined(_)||_===null)&&e.append(i===!0?zt([y],U,s):i===null?y:y+"[]",u(_))}),!1}return Yt(f)?!0:(e.append(zt(T,y,s),u(f)),!1)}let P=[],D=Object.assign(hs,{defaultVisitor:m,convertValue:u,isVisitable:Yt});function S(f,y){if(!c.isUndefined(f)){if(P.indexOf(f)!==-1)throw Error("Circular reference detected in "+y.join("."));P.push(f),c.forEach(f,function(A,F){(!(c.isUndefined(A)||A===null)&&r.call(e,A,c.isString(F)?F.trim():F,y,D))===!0&&S(A,y?y.concat(F):[F])}),P.pop()}}if(!c.isObject(n))throw new TypeError("data must be an object");return S(n),e}var X=ys;function so(n){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function io(n,e){this._pairs=[],n&&X(n,this,e)}var ao=io.prototype;ao.append=function(e,o){this._pairs.push([e,o])};ao.toString=function(e){let o=e?function(t){return e.call(this,t,so)}:so;return this._pairs.map(function(r){return o(r[0])+"="+o(r[1])},"").join("&")};var pt=io;function Es(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Oe(n,e,o){if(!e)return n;let t=o&&o.encode||Es,r=c.isFunction(o)?{serialize:o}:o,s=r&&r.serialize,i;if(s?i=s(e,r):i=c.isURLSearchParams(e)?e.toString():new pt(e,r).toString(t),i){let a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+i}return n}var Kt=class{constructor(){this.handlers=[]}use(e,o,t){return this.handlers.push({fulfilled:e,rejected:o,synchronous:t?t.synchronous:!1,runWhen:t?t.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(t){t!==null&&e(t)})}},Jt=Kt;var fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0};var co=typeof URLSearchParams<"u"?URLSearchParams:pt;var uo=typeof FormData<"u"?FormData:null;var mo=typeof Blob<"u"?Blob:null;var po={isBrowser:!0,classes:{URLSearchParams:co,FormData:uo,Blob:mo},protocols:["http","https","file","blob","url","data"]};var Xt={};_n(Xt,{hasBrowserEnv:()=>Wt,hasStandardBrowserEnv:()=>bs,hasStandardBrowserWebWorkerEnv:()=>Ds,navigator:()=>Gt,origin:()=>Rs});var Wt=typeof window<"u"&&typeof document<"u",Gt=typeof navigator=="object"&&navigator||void 0,bs=Wt&&(!Gt||["ReactNative","NativeScript","NS"].indexOf(Gt.product)<0),Ds=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Rs=Wt&&window.location.href||"http://localhost";var L={...Xt,...po};function Qt(n,e){return X(n,new L.classes.URLSearchParams,{visitor:function(o,t,r,s){return L.isNode&&c.isBuffer(o)?(this.append(t,o.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...e})}function Ns(n){return c.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function vs(n){let e={},o=Object.keys(n),t,r=o.length,s;for(t=0;t<r;t++)s=o[t],e[s]=n[s];return e}function Is(n){function e(o,t,r,s){let i=o[s++];if(i==="__proto__")return!0;let a=Number.isFinite(+i),d=s>=o.length;return i=!i&&c.isArray(r)?r.length:i,d?(c.hasOwnProp(r,i)?r[i]=[r[i],t]:r[i]=t,!a):((!r[i]||!c.isObject(r[i]))&&(r[i]=[]),e(o,t,r[i],s)&&c.isArray(r[i])&&(r[i]=vs(r[i])),!a)}if(c.isFormData(n)&&c.isFunction(n.entries)){let o={};return c.forEachEntry(n,(t,r)=>{e(Ns(t),r,o,0)}),o}return null}var lt=Is;function xs(n,e,o){if(c.isString(n))try{return(e||JSON.parse)(n),c.trim(n)}catch(t){if(t.name!=="SyntaxError")throw t}return(o||JSON.stringify)(n)}var Zt={transitional:fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,o){let t=o.getContentType()||"",r=t.indexOf("application/json")>-1,s=c.isObject(e);if(s&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return r?JSON.stringify(lt(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(t.indexOf("application/x-www-form-urlencoded")>-1)return Qt(e,this.formSerializer).toString();if((a=c.isFileList(e))||t.indexOf("multipart/form-data")>-1){let d=this.env&&this.env.FormData;return X(a?{"files[]":e}:e,d&&new d,this.formSerializer)}}return s||r?(o.setContentType("application/json",!1),xs(e)):e}],transformResponse:[function(e){let o=this.transitional||Zt.transitional,t=o&&o.forcedJSONParsing,r=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(t&&!this.responseType||r)){let i=!(o&&o.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?E.from(a,E.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:L.classes.FormData,Blob:L.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],n=>{Zt.headers[n]={}});var ge=Zt;var Ls=c.toObjectSet(["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"]),lo=n=>{let e={},o,t,r;return n&&n.split(`
|
|
2
|
+
`).forEach(function(i){r=i.indexOf(":"),o=i.substring(0,r).trim().toLowerCase(),t=i.substring(r+1).trim(),!(!o||e[o]&&Ls[o])&&(o==="set-cookie"?e[o]?e[o].push(t):e[o]=[t]:e[o]=e[o]?e[o]+", "+t:t)}),e};var fo=Symbol("internals");function we(n){return n&&String(n).trim().toLowerCase()}function ft(n){return n===!1||n==null?n:c.isArray(n)?n.map(ft):String(n)}function Ss(n){let e=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,t;for(;t=o.exec(n);)e[t[1]]=t[2];return e}var Cs=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function en(n,e,o,t,r){if(c.isFunction(t))return t.call(this,e,o);if(r&&(e=o),!!c.isString(e)){if(c.isString(t))return e.indexOf(t)!==-1;if(c.isRegExp(t))return t.test(e)}}function As(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,o,t)=>o.toUpperCase()+t)}function Os(n,e){let o=c.toCamelCase(" "+e);["get","set","has"].forEach(t=>{Object.defineProperty(n,t+o,{value:function(r,s,i){return this[t].call(this,e,r,s,i)},configurable:!0})})}var Te=class{constructor(e){e&&this.set(e)}set(e,o,t){let r=this;function s(a,d,u){let m=we(d);if(!m)throw new Error("header name must be a non-empty string");let P=c.findKey(r,m);(!P||r[P]===void 0||u===!0||u===void 0&&r[P]!==!1)&&(r[P||d]=ft(a))}let i=(a,d)=>c.forEach(a,(u,m)=>s(u,m,d));if(c.isPlainObject(e)||e instanceof this.constructor)i(e,o);else if(c.isString(e)&&(e=e.trim())&&!Cs(e))i(lo(e),o);else if(c.isObject(e)&&c.isIterable(e)){let a={},d,u;for(let m of e){if(!c.isArray(m))throw TypeError("Object iterator must return a key-value pair");a[u=m[0]]=(d=a[u])?c.isArray(d)?[...d,m[1]]:[d,m[1]]:m[1]}i(a,o)}else e!=null&&s(o,e,t);return this}get(e,o){if(e=we(e),e){let t=c.findKey(this,e);if(t){let r=this[t];if(!o)return r;if(o===!0)return Ss(r);if(c.isFunction(o))return o.call(this,r,t);if(c.isRegExp(o))return o.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,o){if(e=we(e),e){let t=c.findKey(this,e);return!!(t&&this[t]!==void 0&&(!o||en(this,this[t],t,o)))}return!1}delete(e,o){let t=this,r=!1;function s(i){if(i=we(i),i){let a=c.findKey(t,i);a&&(!o||en(t,t[a],a,o))&&(delete t[a],r=!0)}}return c.isArray(e)?e.forEach(s):s(e),r}clear(e){let o=Object.keys(this),t=o.length,r=!1;for(;t--;){let s=o[t];(!e||en(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){let o=this,t={};return c.forEach(this,(r,s)=>{let i=c.findKey(t,s);if(i){o[i]=ft(r),delete o[s];return}let a=e?As(s):String(s).trim();a!==s&&delete o[s],o[a]=ft(r),t[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let o=Object.create(null);return c.forEach(this,(t,r)=>{t!=null&&t!==!1&&(o[r]=e&&c.isArray(t)?t.join(", "):t)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,o])=>e+": "+o).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...o){let t=new this(e);return o.forEach(r=>t.set(r)),t}static accessor(e){let t=(this[fo]=this[fo]={accessors:{}}).accessors,r=this.prototype;function s(i){let a=we(i);t[a]||(Os(r,i),t[a]=!0)}return c.isArray(e)?e.forEach(s):s(e),this}};Te.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(Te.prototype,({value:n},e)=>{let o=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(t){this[o]=t}}});c.freezeMethods(Te);var w=Te;function _e(n,e){let o=this||ge,t=e||o,r=w.from(t.headers),s=t.data;return c.forEach(n,function(a){s=a.call(o,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function Me(n){return!!(n&&n.__CANCEL__)}var tn=class extends E{constructor(e,o,t){super(e??"canceled",E.ERR_CANCELED,o,t),this.name="CanceledError",this.__CANCEL__=!0}},K=tn;function Ue(n,e,o){let t=o.config.validateStatus;!o.status||!t||t(o.status)?n(o):e(new E("Request failed with status code "+o.status,[E.ERR_BAD_REQUEST,E.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function nn(n){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function ws(n,e){n=n||10;let o=new Array(n),t=new Array(n),r=0,s=0,i;return e=e!==void 0?e:1e3,function(d){let u=Date.now(),m=t[s];i||(i=u),o[r]=d,t[r]=u;let P=s,D=0;for(;P!==r;)D+=o[P++],P=P%n;if(r=(r+1)%n,r===s&&(s=(s+1)%n),u-i<e)return;let S=m&&u-m;return S?Math.round(D*1e3/S):void 0}}var go=ws;function _s(n,e){let o=0,t=1e3/e,r,s,i=(u,m=Date.now())=>{o=m,r=null,s&&(clearTimeout(s),s=null),n(...u)};return[(...u)=>{let m=Date.now(),P=m-o;P>=t?i(u,m):(r=u,s||(s=setTimeout(()=>{s=null,i(r)},t-P)))},()=>r&&i(r)]}var To=_s;var Pe=(n,e,o=3)=>{let t=0,r=go(50,250);return To(s=>{let i=s.loaded,a=s.lengthComputable?s.total:void 0,d=i-t,u=r(d),m=i<=a;t=i;let P={loaded:i,total:a,progress:a?i/a:void 0,bytes:d,rate:u||void 0,estimated:u&&a&&m?(a-i)/u:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(P)},o)},on=(n,e)=>{let o=n!=null;return[t=>e[0]({lengthComputable:o,total:n,loaded:t}),e[1]]},rn=n=>(...e)=>c.asap(()=>n(...e));var Po=L.hasStandardBrowserEnv?((n,e)=>o=>(o=new URL(o,L.origin),n.protocol===o.protocol&&n.host===o.host&&(e||n.port===o.port)))(new URL(L.origin),L.navigator&&/(msie|trident)/i.test(L.navigator.userAgent)):()=>!0;var ho=L.hasStandardBrowserEnv?{write(n,e,o,t,r,s,i){if(typeof document>"u")return;let a=[`${n}=${encodeURIComponent(e)}`];c.isNumber(o)&&a.push(`expires=${new Date(o).toUTCString()}`),c.isString(t)&&a.push(`path=${t}`),c.isString(r)&&a.push(`domain=${r}`),s===!0&&a.push("secure"),c.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(n){if(typeof document>"u")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+n+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(n){this.write(n,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function sn(n){return typeof n!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function an(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function je(n,e,o){let t=!sn(e);return n&&(t||o==!1)?an(n,e):e}var yo=n=>n instanceof w?{...n}:n;function z(n,e){e=e||{};let o={};function t(u,m,P,D){return c.isPlainObject(u)&&c.isPlainObject(m)?c.merge.call({caseless:D},u,m):c.isPlainObject(m)?c.merge({},m):c.isArray(m)?m.slice():m}function r(u,m,P,D){if(c.isUndefined(m)){if(!c.isUndefined(u))return t(void 0,u,P,D)}else return t(u,m,P,D)}function s(u,m){if(!c.isUndefined(m))return t(void 0,m)}function i(u,m){if(c.isUndefined(m)){if(!c.isUndefined(u))return t(void 0,u)}else return t(void 0,m)}function a(u,m,P){if(P in e)return t(u,m);if(P in n)return t(void 0,u)}let d={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(u,m,P)=>r(yo(u),yo(m),P,!0)};return c.forEach(Object.keys({...n,...e}),function(m){if(m==="__proto__"||m==="constructor"||m==="prototype")return;let P=c.hasOwnProp(d,m)?d[m]:r,D=P(n[m],e[m],m);c.isUndefined(D)&&P!==a||(o[m]=D)}),o}var gt=n=>{let e=z({},n),{data:o,withXSRFToken:t,xsrfHeaderName:r,xsrfCookieName:s,headers:i,auth:a}=e;if(e.headers=i=w.from(i),e.url=Oe(je(e.baseURL,e.url,e.allowAbsoluteUrls),n.params,n.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(o)){if(L.hasStandardBrowserEnv||L.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(c.isFunction(o.getHeaders)){let d=o.getHeaders(),u=["content-type","content-length"];Object.entries(d).forEach(([m,P])=>{u.includes(m.toLowerCase())&&i.set(m,P)})}}if(L.hasStandardBrowserEnv&&(t&&c.isFunction(t)&&(t=t(e)),t||t!==!1&&Po(e.url))){let d=r&&s&&ho.read(s);d&&i.set(r,d)}return e};var Ms=typeof XMLHttpRequest<"u",Eo=Ms&&function(n){return new Promise(function(o,t){let r=gt(n),s=r.data,i=w.from(r.headers).normalize(),{responseType:a,onUploadProgress:d,onDownloadProgress:u}=r,m,P,D,S,f;function y(){S&&S(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(m),r.signal&&r.signal.removeEventListener("abort",m)}let T=new XMLHttpRequest;T.open(r.method.toUpperCase(),r.url,!0),T.timeout=r.timeout;function A(){if(!T)return;let _=w.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),H={data:!a||a==="text"||a==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:_,config:n,request:T};Ue(function(q){o(q),y()},function(q){t(q),y()},H),T=null}"onloadend"in T?T.onloadend=A:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(A)},T.onabort=function(){T&&(t(new E("Request aborted",E.ECONNABORTED,n,T)),T=null)},T.onerror=function(U){let H=U&&U.message?U.message:"Network Error",Q=new E(H,E.ERR_NETWORK,n,T);Q.event=U||null,t(Q),T=null},T.ontimeout=function(){let U=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",H=r.transitional||fe;r.timeoutErrorMessage&&(U=r.timeoutErrorMessage),t(new E(U,H.clarifyTimeoutError?E.ETIMEDOUT:E.ECONNABORTED,n,T)),T=null},s===void 0&&i.setContentType(null),"setRequestHeader"in T&&c.forEach(i.toJSON(),function(U,H){T.setRequestHeader(H,U)}),c.isUndefined(r.withCredentials)||(T.withCredentials=!!r.withCredentials),a&&a!=="json"&&(T.responseType=r.responseType),u&&([D,f]=Pe(u,!0),T.addEventListener("progress",D)),d&&T.upload&&([P,S]=Pe(d),T.upload.addEventListener("progress",P),T.upload.addEventListener("loadend",S)),(r.cancelToken||r.signal)&&(m=_=>{T&&(t(!_||_.type?new K(null,n,T):_),T.abort(),T=null)},r.cancelToken&&r.cancelToken.subscribe(m),r.signal&&(r.signal.aborted?m():r.signal.addEventListener("abort",m)));let F=nn(r.url);if(F&&L.protocols.indexOf(F)===-1){t(new E("Unsupported protocol "+F+":",E.ERR_BAD_REQUEST,n));return}T.send(s||null)})};var Us=(n,e)=>{let{length:o}=n=n?n.filter(Boolean):[];if(e||o){let t=new AbortController,r,s=function(u){if(!r){r=!0,a();let m=u instanceof Error?u:this.reason;t.abort(m instanceof E?m:new K(m instanceof Error?m.message:m))}},i=e&&setTimeout(()=>{i=null,s(new E(`timeout of ${e}ms exceeded`,E.ETIMEDOUT))},e),a=()=>{n&&(i&&clearTimeout(i),i=null,n.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),n=null)};n.forEach(u=>u.addEventListener("abort",s));let{signal:d}=t;return d.unsubscribe=()=>c.asap(a),d}},bo=Us;var js=function*(n,e){let o=n.byteLength;if(!e||o<e){yield n;return}let t=0,r;for(;t<o;)r=t+e,yield n.slice(t,r),t=r},Bs=async function*(n,e){for await(let o of ks(n))yield*js(o,e)},ks=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}let e=n.getReader();try{for(;;){let{done:o,value:t}=await e.read();if(o)break;yield t}}finally{await e.cancel()}},cn=(n,e,o,t)=>{let r=Bs(n,e),s=0,i,a=d=>{i||(i=!0,t&&t(d))};return new ReadableStream({async pull(d){try{let{done:u,value:m}=await r.next();if(u){a(),d.close();return}let P=m.byteLength;if(o){let D=s+=P;o(D)}d.enqueue(new Uint8Array(m))}catch(u){throw a(u),u}},cancel(d){return a(d),r.return()}},{highWaterMark:2})};var Do=64*1024,{isFunction:Tt}=c,Fs=(({Request:n,Response:e})=>({Request:n,Response:e}))(c.global),{ReadableStream:Ro,TextEncoder:No}=c.global,vo=(n,...e)=>{try{return!!n(...e)}catch{return!1}},qs=n=>{n=c.merge.call({skipUndefined:!0},Fs,n);let{fetch:e,Request:o,Response:t}=n,r=e?Tt(e):typeof fetch=="function",s=Tt(o),i=Tt(t);if(!r)return!1;let a=r&&Tt(Ro),d=r&&(typeof No=="function"?(f=>y=>f.encode(y))(new No):async f=>new Uint8Array(await new o(f).arrayBuffer())),u=s&&a&&vo(()=>{let f=!1,y=new o(L.origin,{body:new Ro,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!y}),m=i&&a&&vo(()=>c.isReadableStream(new t("").body)),P={stream:m&&(f=>f.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!P[f]&&(P[f]=(y,T)=>{let A=y&&y[f];if(A)return A.call(y);throw new E(`Response type '${f}' is not supported`,E.ERR_NOT_SUPPORT,T)})});let D=async f=>{if(f==null)return 0;if(c.isBlob(f))return f.size;if(c.isSpecCompliantForm(f))return(await new o(L.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(c.isArrayBufferView(f)||c.isArrayBuffer(f))return f.byteLength;if(c.isURLSearchParams(f)&&(f=f+""),c.isString(f))return(await d(f)).byteLength},S=async(f,y)=>{let T=c.toFiniteNumber(f.getContentLength());return T??D(y)};return async f=>{let{url:y,method:T,data:A,signal:F,cancelToken:_,timeout:U,onDownloadProgress:H,onUploadProgress:Q,responseType:q,headers:kt,withCredentials:Ke="same-origin",fetchOptions:Ln}=gt(f),Sn=e||fetch;q=q?(q+"").toLowerCase():"text";let Je=bo([F,_&&_.toAbortSignal()],U),De=null,Z=Je&&Je.unsubscribe&&(()=>{Je.unsubscribe()}),Cn;try{if(Q&&u&&T!=="get"&&T!=="head"&&(Cn=await S(kt,A))!==0){let W=new o(y,{method:"POST",body:A,duplex:"half"}),ue;if(c.isFormData(A)&&(ue=W.headers.get("content-type"))&&kt.setContentType(ue),W.body){let[Ft,Ge]=on(Cn,Pe(rn(Q)));A=cn(W.body,Do,Ft,Ge)}}c.isString(Ke)||(Ke=Ke?"include":"omit");let j=s&&"credentials"in o.prototype,An={...Ln,signal:Je,method:T.toUpperCase(),headers:kt.normalize().toJSON(),body:A,duplex:"half",credentials:j?Ke:void 0};De=s&&new o(y,An);let G=await(s?Sn(De,Ln):Sn(y,An)),On=m&&(q==="stream"||q==="response");if(m&&(H||On&&Z)){let W={};["status","statusText","headers"].forEach(wn=>{W[wn]=G[wn]});let ue=c.toFiniteNumber(G.headers.get("content-length")),[Ft,Ge]=H&&on(ue,Pe(rn(H),!0))||[];G=new t(cn(G.body,Do,Ft,()=>{Ge&&Ge(),Z&&Z()}),W)}q=q||"text";let ir=await P[c.findKey(P,q)||"text"](G,f);return!On&&Z&&Z(),await new Promise((W,ue)=>{Ue(W,ue,{data:ir,headers:w.from(G.headers),status:G.status,statusText:G.statusText,config:f,request:De})})}catch(j){throw Z&&Z(),j&&j.name==="TypeError"&&/Load failed|fetch/i.test(j.message)?Object.assign(new E("Network Error",E.ERR_NETWORK,f,De,j&&j.response),{cause:j.cause||j}):E.from(j,j&&j.code,f,De,j&&j.response)}}},Vs=new Map,un=n=>{let e=n&&n.env||{},{fetch:o,Request:t,Response:r}=e,s=[t,r,o],i=s.length,a=i,d,u,m=Vs;for(;a--;)d=s[a],u=m.get(d),u===void 0&&m.set(d,u=a?new Map:qs(e)),m=u;return u},Bu=un();var dn={http:mt,xhr:Eo,fetch:{get:un}};c.forEach(dn,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});var Io=n=>`- ${n}`,$s=n=>c.isFunction(n)||n===null||n===!1;function zs(n,e){n=c.isArray(n)?n:[n];let{length:o}=n,t,r,s={};for(let i=0;i<o;i++){t=n[i];let a;if(r=t,!$s(t)&&(r=dn[(a=String(t)).toLowerCase()],r===void 0))throw new E(`Unknown adapter '${a}'`);if(r&&(c.isFunction(r)||(r=r.get(e))))break;s[a||"#"+i]=r}if(!r){let i=Object.entries(s).map(([d,u])=>`adapter ${d} `+(u===!1?"is not supported by the environment":"is not available in the build")),a=o?i.length>1?`since :
|
|
4
|
+
`+i.map(Io).join(`
|
|
5
|
+
`):" "+Io(i[0]):"as no adapter specified";throw new E("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r}var Pt={getAdapter:zs,adapters:dn};function mn(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new K(null,n)}function ht(n){return mn(n),n.headers=w.from(n.headers),n.data=_e.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Pt.getAdapter(n.adapter||ge.adapter,n)(n).then(function(t){return mn(n),t.data=_e.call(n,n.transformResponse,t),t.headers=w.from(t.headers),t},function(t){return Me(t)||(mn(n),t&&t.response&&(t.response.data=_e.call(n,n.transformResponse,t.response),t.response.headers=w.from(t.response.headers))),Promise.reject(t)})}var yt="1.13.6";var Et={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{Et[n]=function(t){return typeof t===n||"a"+(e<1?"n ":" ")+n}});var xo={};Et.transitional=function(e,o,t){function r(s,i){return"[Axios v"+yt+"] Transitional option '"+s+"'"+i+(t?". "+t:"")}return(s,i,a)=>{if(e===!1)throw new E(r(i," has been removed"+(o?" in "+o:"")),E.ERR_DEPRECATED);return o&&!xo[i]&&(xo[i]=!0,console.warn(r(i," has been deprecated since v"+o+" and will be removed in the near future"))),e?e(s,i,a):!0}};Et.spelling=function(e){return(o,t)=>(console.warn(`${t} is likely a misspelling of ${e}`),!0)};function Ys(n,e,o){if(typeof n!="object")throw new E("options must be an object",E.ERR_BAD_OPTION_VALUE);let t=Object.keys(n),r=t.length;for(;r-- >0;){let s=t[r],i=e[s];if(i){let a=n[s],d=a===void 0||i(a,s,n);if(d!==!0)throw new E("option "+s+" must be "+d,E.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new E("Unknown option "+s,E.ERR_BAD_OPTION)}}var Be={assertOptions:Ys,validators:Et};var V=Be.validators,he=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Jt,response:new Jt}}async request(e,o){try{return await this._request(e,o)}catch(t){if(t instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;let s=r.stack?r.stack.replace(/^.+\n/,""):"";try{t.stack?s&&!String(t.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(t.stack+=`
|
|
6
|
+
`+s):t.stack=s}catch{}}throw t}}_request(e,o){typeof e=="string"?(o=o||{},o.url=e):o=e||{},o=z(this.defaults,o);let{transitional:t,paramsSerializer:r,headers:s}=o;t!==void 0&&Be.assertOptions(t,{silentJSONParsing:V.transitional(V.boolean),forcedJSONParsing:V.transitional(V.boolean),clarifyTimeoutError:V.transitional(V.boolean),legacyInterceptorReqResOrdering:V.transitional(V.boolean)},!1),r!=null&&(c.isFunction(r)?o.paramsSerializer={serialize:r}:Be.assertOptions(r,{encode:V.function,serialize:V.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Be.assertOptions(o,{baseUrl:V.spelling("baseURL"),withXsrfToken:V.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let i=s&&c.merge(s.common,s[o.method]);s&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete s[f]}),o.headers=w.concat(i,s);let a=[],d=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(o)===!1)return;d=d&&y.synchronous;let T=o.transitional||fe;T&&T.legacyInterceptorReqResOrdering?a.unshift(y.fulfilled,y.rejected):a.push(y.fulfilled,y.rejected)});let u=[];this.interceptors.response.forEach(function(y){u.push(y.fulfilled,y.rejected)});let m,P=0,D;if(!d){let f=[ht.bind(this),void 0];for(f.unshift(...a),f.push(...u),D=f.length,m=Promise.resolve(o);P<D;)m=m.then(f[P++],f[P++]);return m}D=a.length;let S=o;for(;P<D;){let f=a[P++],y=a[P++];try{S=f(S)}catch(T){y.call(this,T);break}}try{m=ht.call(this,S)}catch(f){return Promise.reject(f)}for(P=0,D=u.length;P<D;)m=m.then(u[P++],u[P++]);return m}getUri(e){e=z(this.defaults,e);let o=je(e.baseURL,e.url,e.allowAbsoluteUrls);return Oe(o,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){he.prototype[e]=function(o,t){return this.request(z(t||{},{method:e,url:o,data:(t||{}).data}))}});c.forEach(["post","put","patch"],function(e){function o(t){return function(s,i,a){return this.request(z(a||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:s,data:i}))}}he.prototype[e]=o(),he.prototype[e+"Form"]=o(!0)});var ke=he;var pn=class n{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(s){o=s});let t=this;this.promise.then(r=>{if(!t._listeners)return;let s=t._listeners.length;for(;s-- >0;)t._listeners[s](r);t._listeners=null}),this.promise.then=r=>{let s,i=new Promise(a=>{t.subscribe(a),s=a}).then(r);return i.cancel=function(){t.unsubscribe(s)},i},e(function(s,i,a){t.reason||(t.reason=new K(s,i,a),o(t.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let o=this._listeners.indexOf(e);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){let e=new AbortController,o=t=>{e.abort(t)};return this.subscribe(o),e.signal.unsubscribe=()=>this.unsubscribe(o),e.signal}static source(){let e;return{token:new n(function(r){e=r}),cancel:e}}},Lo=pn;function ln(n){return function(o){return n.apply(null,o)}}function fn(n){return c.isObject(n)&&n.isAxiosError===!0}var gn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(gn).forEach(([n,e])=>{gn[e]=n});var So=gn;function Co(n){let e=new ke(n),o=Le(ke.prototype.request,e);return c.extend(o,ke.prototype,e,{allOwnKeys:!0}),c.extend(o,e,null,{allOwnKeys:!0}),o.create=function(r){return Co(z(n,r))},o}var O=Co(ge);O.Axios=ke;O.CanceledError=K;O.CancelToken=Lo;O.isCancel=Me;O.VERSION=yt;O.toFormData=X;O.AxiosError=E;O.Cancel=O.CanceledError;O.all=function(e){return Promise.all(e)};O.spread=ln;O.isAxiosError=fn;O.mergeConfig=z;O.AxiosHeaders=w;O.formToJSON=n=>lt(c.isHTMLForm(n)?new FormData(n):n);O.getAdapter=Pt.getAdapter;O.HttpStatusCode=So;O.default=O;var bt=O;var{Axios:Ud,AxiosError:Ao,CanceledError:jd,isCancel:Bd,CancelToken:kd,VERSION:Fd,all:qd,Cancel:Vd,isAxiosError:Hd,spread:$d,toFormData:zd,AxiosHeaders:Yd,HttpStatusCode:Kd,formToJSON:Jd,getAdapter:Gd,mergeConfig:Wd}=bt;var k=class n extends Ao{constructor(o,t,r,s,i,a){super(o,t,r,s,i);this.isNlicError=!0;this.name="NlicError",a&&(this.stack=a),Object.setPrototypeOf(this,n.prototype)}};var Oo=function(n={}){let e={...n};if(e.amountFix&&e.amountPercent)throw new k('Properties "amountFix" and "amountPercent" cannot be used at the same time');return v(e,{setTotalPrice(t){l(e,"totalPrice",t)},getTotalPrice(t){return p(e,"totalPrice",t)},setCurrency(t){l(e,"currency",t)},getCurrency(t){return p(e,"currency",t)},setAmountFix(t){l(e,"amountFix",t)},getAmountFix(t){return p(e,"amountFix",t)},setAmountPercent(t){l(e,"amountPercent",t)},getAmountPercent(t){return p(e,"amountPercent",t)},toString(){let t=this.getTotalPrice(),r=this.getCurrency(),s=this.getAmountPercent()?`${this.getAmountPercent()}%`:this.getAmountFix();return t&&r&&s?`${t};${r};${s}`:""}},Oo,{set:(t,r)=>{r==="amountFix"&&delete t.amountPercent,r==="amountPercent"&&delete t.amountFix}})},Dt=Oo;var se=n=>{let e=N(n),o=e.discount;return delete e.discount,o&&(e.discounts=o.map(t=>Dt(t))),it(e)};var wo=function(n={}){let e={...n};return v(e,{setActive(t){l(e,"active",t)},getActive(t){return p(e,"active",t)},setNumber(t){l(e,"number",t)},getNumber(t){return p(e,"number",t)},setName(t){l(e,"name",t)},getName(t){return p(e,"name",t)},setLicensingModel(t){l(e,"licensingModel",t)},getLicensingModel(t){return p(e,"licensingModel",t)},setProductNumber(t){l(e,"productNumber",t)},getProductNumber(t){return p(e,"productNumber",t)},serialize(){return C(e,{ignore:["inUse"]})}},wo)},Rt=wo;var ie=n=>Rt(N(n));var _o=function(n={}){let e={...n};return v(e,{setActive(t){l(e,"active",t)},getActive(t){return p(e,"active",t)},setNumber(t){l(e,"number",t)},getNumber(t){return p(e,"number",t)},setExpirationTime(t){l(e,"expirationTime",t)},getExpirationTime(t){return p(e,"expirationTime",t)},setTokenType(t){l(e,"tokenType",t)},getTokenType(t){return p(e,"tokenType",t)},setLicenseeNumber(t){l(e,"licenseeNumber",t)},getLicenseeNumber(t){return p(e,"licenseeNumber",t)},setAction(t){l(e,"action",t)},getAction(t){return p(e,"action",t)},setApiKeyRole(t){l(e,"apiKeyRole",t)},getApiKeyRole(t){return p(e,"apiKeyRole",t)},setBundleNumber(t){l(e,"bundleNumber",t)},getBundleNumber(t){return p(e,"bundleNumber",t)},setBundlePrice(t){l(e,"bundlePrice",t)},getBundlePrice(t){return p(e,"bundlePrice",t)},setProductNumber(t){l(e,"productNumber",t)},getProductNumber(t){return p(e,"productNumber",t)},setPredefinedShoppingItem(t){l(e,"predefinedShoppingItem",t)},getPredefinedShoppingItem(t){return p(e,"predefinedShoppingItem",t)},setSuccessURL(t){l(e,"successURL",t)},getSuccessURL(t){return p(e,"successURL",t)},setSuccessURLTitle(t){l(e,"successURLTitle",t)},getSuccessURLTitle(t){return p(e,"successURLTitle",t)},setCancelURL(t){l(e,"cancelURL",t)},getCancelURL(t){return p(e,"cancelURL",t)},setCancelURLTitle(t){l(e,"cancelURLTitle",t)},getCancelURLTitle(t){return p(e,"cancelURLTitle",t)},getShopURL(t){return p(e,"shopURL",t)},serialize(){return C(e,{ignore:["shopURL"]})}},_o)},Nt=_o;var ye=n=>{let e=N(n),{expirationTime:o}=e;return o&&typeof o=="string"&&(e.expirationTime=new Date(o)),Nt(e)};var Tn=class{constructor(e,o){this.transaction=e,this.license=o}setTransaction(e){this.transaction=e}getTransaction(){return this.transaction}setLicense(e){this.license=e}getLicense(){return this.license}},vt=(n,e)=>new Tn(n,e);var Mo=function(n={}){let e={...n};return v(e,{setActive(t){l(e,"active",t)},getActive(t){return p(e,"active",t)},setNumber(t){l(e,"number",t)},getNumber(t){return p(e,"number",t)},setStatus(t){l(e,"status",t)},getStatus(t){return p(e,"status",t)},setSource(t){l(e,"source",t)},getSource(t){return p(e,"source",t)},setGrandTotal(t){l(e,"grandTotal",t)},getGrandTotal(t){return p(e,"grandTotal",t)},setDiscount(t){l(e,"discount",t)},getDiscount(t){return p(e,"discount",t)},setCurrency(t){l(e,"currency",t)},getCurrency(t){return p(e,"currency",t)},setDateCreated(t){l(e,"dateCreated",t)},getDateCreated(t){return p(e,"dateCreated",t)},setDateClosed(t){l(e,"dateClosed",t)},getDateClosed(t){return p(e,"dateClosed",t)},setPaymentMethod(t){l(e,"paymentMethod",t)},getPaymentMethod(t){return p(e,"paymentMethod",t)},setLicenseTransactionJoins(t){l(e,"licenseTransactionJoins",t)},getLicenseTransactionJoins(t){return p(e,"licenseTransactionJoins",t)},serialize(){let t={...e};return t.datecreated=e.dateCreated,t.dateclosed=e.dateClosed,delete t.dateCreated,delete t.dateClosed,C(t,{ignore:["licenseTransactionJoins","inUse"]})}},Mo)},Fe=Mo;var ae=n=>{let e=N(n),{datecreated:o,dateclosed:t}=e;o&&typeof o=="string"&&(e.dateCreated=new Date(o),delete e.datecreated),t&&typeof t=="string"&&(e.dateClosed=new Date(t),delete e.dateclosed);let r=e.licenseTransactionJoin;return delete e.licenseTransactionJoin,r&&(e.licenseTransactionJoins=r.map(({transactionNumber:s,licenseNumber:i})=>{let a=Fe({number:s}),d=de({number:i});return vt(a,d)})),Fe(e)};var Uo=bt.create(),jo=null,Bo=[],ko=n=>{Uo=n},It=()=>Uo,Pn=n=>{jo=n},Fo=()=>jo,hn=n=>{Bo=n},qo=()=>Bo;var yn={name:"netlicensing-client",version:"2.0.1",description:"JavaScript Wrapper for Labs64 NetLicensing RESTful API",keywords:["labs64","netlicensing","licensing","licensing-as-a-service","license","license-management","software-license","client","restful","restful-api","javascript","wrapper","api","client"],license:"Apache-2.0",author:"Labs64 GmbH",homepage:"https://netlicensing.io",repository:{type:"git",url:"git+https://github.com/Labs64/NetLicensingClient-javascript.git"},bugs:{url:"https://github.com/Labs64/NetLicensingClient-javascript/issues"},contributors:[{name:"Ready Brown",email:"ready.brown@hotmail.de",url:"https://github.com/r-brown"},{name:"Viacheslav Rudkovskiy",email:"viachaslau.rudkovski@labs64.de",url:"https://github.com/v-rudkovskiy"},{name:"Andrei Yushkevich",email:"yushkevich@me.com",url:"https://github.com/yushkevich"}],main:"dist/index.cjs",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.cjs"}},files:["dist"],scripts:{build:"tsup",release:"npm run lint:typecheck && npm run test && npm run build",dev:"tsup --watch",test:"vitest run","test:dev":"vitest watch",lint:"eslint --ext .js,.mjs,.ts src",typecheck:"tsc --noEmit","lint:typecheck":"npm run lint && npm run typecheck"},peerDependencies:{axios:"^1.9.0"},dependencies:{},devDependencies:{"@eslint/js":"^9.39.4","@types/node":"^25.3.5","@typescript-eslint/eslint-plugin":"^8.29.1","@typescript-eslint/parser":"^8.29.1","@vitest/eslint-plugin":"^1.1.43",axios:"^1.13.6",eslint:"^9.39.4","eslint-plugin-import":"^2.31.0",prettier:"3.8.1",tsup:"^8.4.0",typescript:"^5.8.3","typescript-eslint":"^8.29.1",vitest:"^3.2.4"},engines:{node:">= 16.9.0",npm:">= 8.0.0"},browserslist:["> 1%","last 2 versions","not ie <= 10"]};var xt=n=>{let e=[],o=(t,r)=>{if(t!=null){if(Array.isArray(t)){t.forEach(s=>{o(s,r?`${r}`:"")});return}if(t instanceof Date){e.push(`${r}=${encodeURIComponent(t.toISOString())}`);return}if(typeof t=="object"){Object.keys(t).forEach(s=>{let i=t[s];o(i,r?`${r}[${encodeURIComponent(s)}]`:encodeURIComponent(s))});return}e.push(`${r}=${encodeURIComponent(t)}`)}};return o(n),e.join("&")};var Ee=async(n,e,o,t,r)=>{let s={Accept:"application/json","X-Requested-With":"XMLHttpRequest"};typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(s["User-agent"]=`NetLicensing/Javascript ${yn.version}/node&${process.version}`);let i={method:e,headers:s,url:encodeURI(`${n.getBaseUrl()}/${o}`),responseType:"json",transformRequest:(d,u)=>u["Content-Type"]==="application/x-www-form-urlencoded"?xt(d):(u["NetLicensing-Origin"]||(u["NetLicensing-Origin"]=`NetLicensing/Javascript ${yn.version}`),d)};switch(["put","post","patch"].indexOf(e.toLowerCase())>=0?(i.method==="post"&&(s["Content-Type"]="application/x-www-form-urlencoded"),i.data=t):i.params=t,n.getSecurityMode()){case Y.BASIC_AUTHENTICATION:{if(!n.getUsername())throw new k('Missing parameter "username"');if(!n.getPassword())throw new k('Missing parameter "password"');i.auth={username:n.getUsername(),password:n.getPassword()}}break;case Y.APIKEY_IDENTIFICATION:if(!n.getApiKey())throw new k('Missing parameter "apiKey"');s.Authorization=`Basic ${btoa(`apiKey:${n.getApiKey()}`)}`;break;case Y.ANONYMOUS_IDENTIFICATION:break;default:throw new k("Unknown security mode")}let a=r?.axiosInstance||It();try{let d=await a(i),u=d.data.infos?.info||[];if(Pn(d),hn(u),r?.onResponse&&r.onResponse(d),u.length>0){r?.onInfo&&r.onInfo(u);let m=u.find(({type:P})=>P==="ERROR");if(m)throw new k(m.value,m.id,d.config,d.request,d)}return d}catch(d){let u=d,m=u.response,P=m?.data?.infos?.info||[];if(Pn(m||null),hn(P),d.isAxiosError){let D=d.message;if(m?.data&&P.length>0){let S=P.find(({type:f})=>f==="ERROR");S&&(D=S.value)}throw new k(D,u.code,u.config,u.request,u.response)}throw d}};var Vo=(n,e,o,t)=>Ee(n,"get",e,o,t),Ho=(n,e,o,t)=>Ee(n,"post",e,o,t),$o=(n,e,o,t)=>Ee(n,"delete",e,o,t);var Js={setAxiosInstance(n){ko(n)},getAxiosInstance(){return It()},getLastHttpRequestInfo(){return Fo()},getInfo(){return qo()},get(n,e,o,t){return Vo(n,e,o,t)},post(n,e,o,t){return Ho(n,e,o,t)},delete(n,e,o,t){return $o(n,e,o,t)},request(n,e,o,t,r){return Ee(n,e,o,t,r)},toQueryString(n){return xt(n)}},g=Js;var x=n=>Object.keys(n).map(e=>`${e}=${String(n[e])}`).join(";"),zo=n=>{let e={};return n.split(";").forEach(o=>{let[t,r]=o.split("=");e[t]=r}),e};var En=n=>typeof n<"u"&&typeof n!="function",qe=n=>En(n)?typeof n=="number"?!Number.isNaN(n):!0:!1,R=(n,e)=>{if(n===null)throw new TypeError(`Parameter "${e}" cannot be null.`);if(!qe(n))throw new TypeError(`Parameter "${e}" has an invalid value.`)},b=(n,e)=>{if(R(n,e),!n)throw new TypeError(`Parameter "${e}" cannot be empty.`)};var Yo=function(n,e){let o=parseInt(e?.pagenumber||"0",10),t=parseInt(e?.itemsnumber||"0",10),r=parseInt(e?.totalpages||"0",10),s=parseInt(e?.totalitems||"0",10),i={getContent(){return n},getPagination(){return{pageNumber:o,itemsNumber:t,totalPages:r,totalItems:s,hasNext:r>o+1}},getPageNumber(){return o},getItemsNumber(){return t},getTotalPages(){return r},getTotalItems(){return s},hasNext(){return r>o+1}};return new Proxy(n,{get(a,d,u){return Object.hasOwn(i,d)?i[d]:Reflect.get(a,d,u)},set(a,d,u,m){return Reflect.set(a,d,u,m)},getPrototypeOf(){return Yo.prototype||null}})},I=Yo;var be=h.Bundle.ENDPOINT_PATH,Gs=h.Bundle.ENDPOINT_OBTAIN_PATH,Lt=h.Bundle.TYPE,Ws={async get(n,e,o){b(e,"number");let r=(await g.get(n,`${be}/${e}`,{},o)).data.items?.item.find(s=>s.type===Lt);return ee(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let s=(await g.get(n,be,t,o)).data.items,i=s?.item.filter(a=>a.type===Lt).map(a=>ee(a));return I(i||[],s)},async create(n,e,o){R(e,"bundle");let r=(await g.post(n,be,e.serialize(),o)).data.items?.item.find(s=>s.type===Lt);return ee(r)},async update(n,e,o,t){b(e,"number"),R(o,"bundle");let s=(await g.post(n,`${be}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===Lt);return ee(s)},delete(n,e,o,t){return b(e,"number"),g.delete(n,`${be}/${e}`,{forceCascade:!!o},t)},async obtain(n,e,o,t){b(e,"number"),b(o,"licenseeNumber");let r={[h.Licensee.LICENSEE_NUMBER]:o};return(await g.post(n,`${be}/${e}/${Gs}`,r,t)).data.items?.item.filter(d=>d.type===h.License.TYPE)?.map(d=>J(d))||[]}},Ko=Ws;var bn=class{constructor(){this.validations={}}getValidators(){return this.validations}setValidation(e){return this.validations[e.productModuleNumber]=e,this}getValidation(e,o){return this.validations[e]||o}setProductModuleValidation(e){return this.setValidation(e)}getProductModuleValidation(e,o){return this.getValidation(e,o)}setTtl(e){if(!qe(e))throw new TypeError(`Bad ttl:${e.toString()}`);return this.ttl=new Date(e),this}getTtl(){return this.ttl}toString(){let e="ValidationResult [";return Object.keys(this.validations).forEach(o=>{e+=`ProductModule<${o}>`,o in this.validations&&(e+=JSON.stringify(this.validations[o]))}),e+="]",e}},St=()=>new bn;var ce=h.Licensee.ENDPOINT_PATH,Xs=h.Licensee.ENDPOINT_PATH_VALIDATE,Qs=h.Licensee.ENDPOINT_PATH_TRANSFER,Ct=h.Licensee.TYPE,Zs={async get(n,e,o){b(e,"number");let r=(await g.get(n,`${ce}/${e}`,{},o)).data.items?.item.find(s=>s.type===Ct);return te(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let s=(await g.get(n,ce,t,o)).data.items,i=s?.item.filter(a=>a.type===Ct).map(a=>te(a));return I(i||[],s)},async create(n,e,o,t){R(o,"licensee");let r=o.serialize();e&&(r.productNumber=e);let i=(await g.post(n,ce,r,t)).data.items?.item.find(a=>a.type===Ct);return te(i)},async update(n,e,o,t){b(e,"number"),R(o,"licensee");let s=(await g.post(n,`${ce}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===Ct);return te(s)},delete(n,e,o,t){return b(e,"number"),g.delete(n,`${ce}/${e}`,{forceCascade:!!o},t)},async validate(n,e,o,t){b(e,"number");let r={};if(o){let u=o.productNumber;u&&(r.productNumber=u);let m=o.licenseeProperties;Object.keys(m).forEach(D=>{r[D]=o.getLicenseeProperty(D)}),o.isForOfflineUse()&&(r.forOfflineUse=!0),o.isDryRun()&&(r.dryRun=!0);let P=o.getParameters();Object.keys(P).forEach((D,S)=>{r[`${h.ProductModule.PRODUCT_MODULE_NUMBER}${S}`]=D;let f=P[D];f&&Object.keys(f).forEach(y=>{r[y+S]=f[y]})})}let s=await g.post(n,`${ce}/${e}/${Xs}`,r,t),i=St(),a=s.data.ttl;return a&&i.setTtl(a),s.data.items?.item.filter(u=>u.type===h.Validation.TYPE)?.forEach(u=>{i.setValidation(N(u))}),i},transfer(n,e,o,t){b(e,"number"),b(o,"sourceLicenseeNumber");let r={sourceLicenseeNumber:o};return g.post(n,`${ce}/${e}/${Qs}`,r,t)}},Jo=Zs;var Ve=h.License.ENDPOINT_PATH,At=h.License.TYPE,ei={async get(n,e,o){b(e,"number");let r=(await g.get(n,`${Ve}/${e}`,{},o)).data.items?.item.find(s=>s.type===At);return J(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let s=(await g.get(n,Ve,t,o)).data.items,i=s?.item.filter(a=>a.type===At).map(a=>J(a));return I(i||[],s)},async create(n,e,o,t,r,s){R(r,"license");let i=r.serialize();e&&(i.licenseeNumber=e),o&&(i.licenseTemplateNumber=o),t&&(i.transactionNumber=t);let d=(await g.post(n,Ve,i,s)).data.items?.item.find(u=>u.type===At);return J(d)},async update(n,e,o,t,r){b(e,"number"),R(t,"license");let s=t.serialize();o&&(s.transactionNumber=o);let a=(await g.post(n,`${Ve}/${e}`,s,r)).data.items?.item.find(d=>d.type===At);return J(a)},delete(n,e,o,t){return b(e,"number"),g.delete(n,`${Ve}/${e}`,{forceCascade:!!o},t)}},Go=ei;var He=h.LicenseTemplate.ENDPOINT_PATH,Ot=h.LicenseTemplate.TYPE,ti={async get(n,e,o){b(e,"number");let r=(await g.get(n,`${He}/${e}`,{},o)).data.items?.item.find(s=>s.type===Ot);return ne(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let s=(await g.get(n,He,t,o)).data.items,i=s?.item.filter(a=>a.type===Ot).map(a=>ne(a));return I(i||[],s)},async create(n,e,o,t){R(o,"licenseTemplate");let r=o.serialize();e&&(r.productModuleNumber=e);let i=(await g.post(n,He,r,t)).data.items?.item.find(a=>a.type===Ot);return ne(i)},async update(n,e,o,t){b(e,"number"),R(o,"licenseTemplate");let s=(await g.post(n,`${He}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===Ot);return ne(s)},delete(n,e,o,t){return b(e,"number"),g.delete(n,`${He}/${e}`,{forceCascade:!!o},t)}},Wo=ti;var $e=h.Notification.ENDPOINT_PATH,wt=h.Notification.TYPE,ni={async get(n,e,o){b(e,"number");let r=(await g.get(n,`${$e}/${e}`,{},o)).data.items?.item.find(s=>s.type===wt);return oe(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let s=(await g.get(n,$e,t,o)).data.items,i=s?.item.filter(a=>a.type===wt).map(a=>oe(a));return I(i||[],s)},async create(n,e,o){R(e,"notification");let r=(await g.post(n,$e,e.serialize(),o)).data.items?.item.find(s=>s.type===wt);return oe(r)},async update(n,e,o,t){b(e,"number"),R(o,"notification");let s=(await g.post(n,`${$e}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===wt);return oe(s)},delete(n,e,o,t){return b(e,"number"),g.delete(n,`${$e}/${e}`,{forceCascade:!!o},t)}},Xo=ni;var Dn=h.PaymentMethod.ENDPOINT_PATH,Rn=h.PaymentMethod.TYPE,oi={async get(n,e,o){b(e,"number");let r=(await g.get(n,`${Dn}/${e}`,{},o)).data.items?.item.find(s=>s.type===Rn);return me(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let s=(await g.get(n,Dn,t,o)).data.items,i=s?.item.filter(a=>a.type===Rn).map(a=>me(a));return I(i||[],s)},async update(n,e,o,t){b(e,"number"),R(o,"paymentMethod");let s=(await g.post(n,`${Dn}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===Rn);return me(s)}},Qo=oi;var ze=h.ProductModule.ENDPOINT_PATH,_t=h.ProductModule.TYPE,ri={async get(n,e,o){b(e,"number");let r=(await g.get(n,`${ze}/${e}`,{},o)).data.items?.item.find(s=>s.type===_t);return ie(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let s=(await g.get(n,ze,t,o)).data.items,i=s?.item.filter(a=>a.type===_t).map(a=>ie(a));return I(i||[],s)},async create(n,e,o,t){R(o,"productModule");let r=o.serialize();e&&(r.productNumber=e);let i=(await g.post(n,ze,r,t)).data.items?.item.find(a=>a.type===_t);return ie(i)},async update(n,e,o,t){b(e,"number"),R(o,"productModule");let s=(await g.post(n,`${ze}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===_t);return ie(s)},delete(n,e,o,t){return b(e,"number"),g.delete(n,`${ze}/${e}`,{forceCascade:!!o},t)}},Zo=ri;var Ye=h.Product.ENDPOINT_PATH,Mt=h.Product.TYPE,si={async get(n,e,o){b(e,"number");let r=(await g.get(n,`${Ye}/${e}`,{},o)).data.items?.item.find(s=>s.type===Mt);return se(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let s=(await g.get(n,Ye,t,o)).data.items,i=s?.item.filter(a=>a.type===Mt).map(a=>se(a));return I(i||[],s)},async create(n,e,o){R(e,"product");let r=(await g.post(n,Ye,e.serialize(),o)).data.items?.item.find(s=>s.type===Mt);return se(r)},async update(n,e,o,t){b(e,"number"),R(o,"product");let s=(await g.post(n,`${Ye}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===Mt);return se(s)},delete(n,e,o,t){return b(e,"number"),g.delete(n,`${Ye}/${e}`,{forceCascade:!!o},t)}},er=si;var Ut=h.Token.ENDPOINT_PATH,Nn=h.Token.TYPE,ii={async get(n,e,o){b(e,"number");let r=(await g.get(n,`${Ut}/${e}`,{},o)).data.items?.item.find(s=>s.type===Nn);return ye(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let s=(await g.get(n,Ut,t,o)).data.items,i=s?.item.filter(a=>a.type===Nn).map(a=>ye(a));return I(i||[],s)},async create(n,e,o){R(e,"token");let r=(await g.post(n,Ut,e.serialize(),o)).data.items?.item.find(s=>s.type===Nn);return ye(r)},delete(n,e,o,t){return b(e,"number"),g.delete(n,`${Ut}/${e}`,{forceCascade:!!o},t)}},tr=ii;var jt=h.Transaction.ENDPOINT_PATH,Bt=h.Transaction.TYPE,ai={async get(n,e,o){b(e,"number");let r=(await g.get(n,`${jt}/${e}`,{},o)).data.items?.item.find(s=>s.type===Bt);return ae(r)},async list(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let s=(await g.get(n,jt,t,o)).data.items,i=s?.item.filter(a=>a.type===Bt).map(a=>ae(a));return I(i||[],s)},async create(n,e,o){R(e,"transaction");let r=(await g.post(n,jt,e.serialize(),o)).data.items?.item.find(s=>s.type===Bt);return ae(r)},async update(n,e,o,t){b(e,"number"),R(o,"transaction");let s=(await g.post(n,`${jt}/${e}`,o.serialize(),t)).data.items?.item.find(i=>i.type===Bt);return ae(s)}},nr=ai;var vn=h.Utility.ENDPOINT_PATH,ci={async listLicenseTypes(n,e){let o=`${vn}/${h.Utility.ENDPOINT_PATH_LICENSE_TYPES}`,r=(await g.get(n,o,void 0,e)).data.items,s=h.Utility.LICENSE_TYPE,i=r?.item.filter(a=>a.type===s).map(a=>N(a).name);return I(i||[],r)},async listLicensingModels(n,e){let o=`${vn}/${h.Utility.ENDPOINT_PATH_LICENSING_MODELS}`,r=(await g.get(n,o,void 0,e)).data.items,s=h.Utility.LICENSING_MODEL_TYPE,i=r?.item.filter(a=>a.type===s).map(a=>N(a).name);return I(i||[],r)},async listCountries(n,e,o){let t={};e&&(t[h.FILTER]=typeof e=="string"?e:x(e));let r=`${vn}/${h.Utility.ENDPOINT_PATH_COUNTRIES}`,i=(await g.get(n,r,t,o)).data.items,a=h.Utility.COUNTRY_TYPE,d=i?.item.filter(u=>u.type===a).map(u=>tt(u));return I(d||[],i)}},or=ci;var In=class{constructor(e){this.baseUrl=e?.baseUrl||"https://go.netlicensing.io/core/v2/rest",this.securityMode=e?.securityMode||Y.BASIC_AUTHENTICATION,this.username=e?.username,this.password=e?.password,this.apiKey=e?.apiKey,this.publicKey=e?.publicKey}setBaseUrl(e){return this.baseUrl=e,this}getBaseUrl(){return this.baseUrl}setSecurityMode(e){return this.securityMode=e,this}getSecurityMode(){return this.securityMode}setUsername(e){return this.username=e,this}getUsername(e){return this.username||e}setPassword(e){return this.password=e,this}getPassword(e){return this.password||e}setApiKey(e){return this.apiKey=e,this}getApiKey(e){return this.apiKey||e}setPublicKey(e){return this.publicKey=e,this}getPublicKey(e){return this.publicKey||e}},rr=n=>new In(n);var xn=class{constructor(){this.parameters={},this.licenseeProperties={}}setProductNumber(e){return this.productNumber=e,this}getProductNumber(){return this.productNumber}setLicenseeName(e){return this.licenseeProperties.licenseeName=e,this}getLicenseeName(){return this.licenseeProperties.licenseeName}setLicenseeSecret(e){return this.licenseeProperties.licenseeSecret=e,this}getLicenseeSecret(){return this.licenseeProperties.licenseeSecret}getLicenseeProperties(){return this.licenseeProperties}setLicenseeProperty(e,o){return this.licenseeProperties[e]=o,this}getLicenseeProperty(e,o){return this.licenseeProperties[e]||o}setForOfflineUse(e){return this.forOfflineUse=e,this}isForOfflineUse(){return!!this.forOfflineUse}setDryRun(e){return this.dryRun=e,this}isDryRun(){return!!this.dryRun}getParameters(){return this.parameters}setParameter(e,o){return this.parameters[e]=o,this}getParameter(e){return this.parameters[e]}getProductModuleValidationParameters(e){return this.getParameter(e)}setProductModuleValidationParameters(e,o){return this.setParameter(e,o)}},sr=()=>new xn;return mr(ui);})();
|
|
7
7
|
//# sourceMappingURL=index.global.js.map
|