stadata-js 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- var StadataJS=(function(exports){'use strict';var ai={withStackTrace:false},Tr=(o,e,t=ai)=>{let r=e.isOk()?{type:"Ok",value:e.value}:{type:"Err",value:e.error},i=t.withStackTrace?new Error().stack:void 0;return {data:r,message:o,stack:i}};function X(o,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s);})}return new(t||(t=Promise))(function(s,n){function c(d){try{l(r.next(d));}catch(R){n(R);}}function u(d){try{l(r.throw(d));}catch(R){n(R);}}function l(d){d.done?s(d.value):i(d.value).then(c,u);}l((r=r.apply(o,[])).next());})}function vr(o){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&o[e],r=0;if(t)return t.call(o);if(o&&typeof o.length=="number")return {next:function(){return o&&r>=o.length&&(o=void 0),{value:o&&o[r++],done:!o}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function G(o){return this instanceof G?(this.v=o,this):new G(o)}function _r(o,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(o,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",n),i[Symbol.asyncIterator]=function(){return this},i;function n(y){return function(B){return Promise.resolve(B).then(y,R)}}function c(y,B){r[y]&&(i[y]=function(_t){return new Promise(function(oi,si){s.push([y,_t,oi,si])>1||u(y,_t);})},B&&(i[y]=B(i[y])));}function u(y,B){try{l(r[y](B));}catch(_t){Pe(s[0][3],_t);}}function l(y){y.value instanceof G?Promise.resolve(y.value.v).then(d,R):Pe(s[0][2],y);}function d(y){u("next",y);}function R(y){u("throw",y);}function Pe(y,B){y(B),s.shift(),s.length&&u(s[0][0],s[0][1]);}}function ni(o){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=o[i]?function(n){return (t=!t)?{value:G(o[i](n)),done:false}:s?s(n):n}:s;}}function li(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=o[Symbol.asyncIterator],t;return e?e.call(o):(o=typeof vr=="function"?vr(o):o[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=o[s]&&function(n){return new Promise(function(c,u){n=o[s](n),i(c,u,n.done,n.value);})};}function i(s,n,c,u){Promise.resolve(u).then(function(l){s({value:l,done:c});},n);}}var Y=class o{constructor(e){this._promise=e;}static fromSafePromise(e){let t=e.then(r=>new E(r));return new o(t)}static fromPromise(e,t){let r=e.then(i=>new E(i)).catch(i=>new S(t(i)));return new o(r)}static fromThrowable(e,t){return (...r)=>new o(X(this,void 0,void 0,function*(){try{return new E(yield e(...r))}catch(i){return new S(t?t(i):i)}}))}static combine(e){return ci(e)}static combineWithAllErrors(e){return ui(e)}map(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){return t.isErr()?new S(t.error):new E(yield e(t.value))})))}andThrough(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){if(t.isErr())return new S(t.error);let r=yield e(t.value);return r.isErr()?new S(r.error):new E(t.value)})))}andTee(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){if(t.isErr())return new S(t.error);try{yield e(t.value);}catch{}return new E(t.value)})))}orTee(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){if(t.isOk())return new E(t.value);try{yield e(t.error);}catch{}return new S(t.error)})))}mapErr(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){return t.isOk()?new E(t.value):new S(yield e(t.error))})))}andThen(e){return new o(this._promise.then(t=>{if(t.isErr())return new S(t.error);let r=e(t.value);return r instanceof o?r._promise:r}))}orElse(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){return t.isErr()?e(t.error):new E(t.value)})))}match(e,t){return this._promise.then(r=>r.match(e,t))}unwrapOr(e){return this._promise.then(t=>t.unwrapOr(e))}safeUnwrap(){return _r(this,arguments,function*(){return yield G(yield G(yield*ni(li(yield G(this._promise.then(t=>t.safeUnwrap()))))))})}then(e,t){return this._promise.then(e,t)}[Symbol.asyncIterator](){return _r(this,arguments,function*(){let t=yield G(this._promise);return t.isErr()&&(yield yield G(Tt(t.error))),yield G(t.value)})}};function Tt(o){return new Y(Promise.resolve(new S(o)))}var Dr=o=>{let e=J([]);for(let t of o)if(t.isErr()){e=w(t.error);break}else e.map(r=>r.push(t.value));return e},ci=o=>Y.fromSafePromise(Promise.all(o)).andThen(Dr),Lr=o=>{let e=J([]);for(let t of o)t.isErr()&&e.isErr()?e.error.push(t.error):t.isErr()&&e.isOk()?e=w([t.error]):t.isOk()&&e.isOk()&&e.value.push(t.value);return e},ui=o=>Y.fromSafePromise(Promise.all(o)).andThen(Lr),hr;(function(o){function e(i,s){return (...n)=>{try{let c=i(...n);return J(c)}catch(c){return w(s?s(c):c)}}}o.fromThrowable=e;function t(i){return Dr(i)}o.combine=t;function r(i){return Lr(i)}o.combineWithAllErrors=r;})(hr||(hr={}));function J(o){return new E(o)}function w(o){return new S(o)}var E=class{constructor(e){this.value=e;}isOk(){return true}isErr(){return !this.isOk()}map(e){return J(e(this.value))}mapErr(e){return J(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map(t=>this.value)}andTee(e){try{e(this.value);}catch{}return J(this.value)}orTee(e){return J(this.value)}orElse(e){return J(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map(()=>this.value)}asyncMap(e){return Y.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}safeUnwrap(){let e=this.value;return (function*(){return e})()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw Tr("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}},S=class{constructor(e){this.error=e;}isOk(){return false}isErr(){return !this.isOk()}map(e){return w(this.error)}mapErr(e){return w(e(this.error))}andThrough(e){return w(this.error)}andTee(e){return w(this.error)}orTee(e){try{e(this.error);}catch{}return w(this.error)}andThen(e){return w(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return Tt(this.error)}asyncAndThrough(e){return Tt(this.error)}asyncMap(e){return Tt(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}safeUnwrap(){let e=this.error;return (function*(){throw yield w(e),new Error("Do not use this generator out of `safeTry`")})()}_unsafeUnwrap(e){throw Tr("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){let e=this;return yield e,e}};hr.fromThrowable;var K=class o{constructor(e,t){this.message=e;this.code=t;}toString(){return `${this.constructor.name}: ${this.message}${this.code?` (${this.code})`:""}`}equals(e){return e instanceof o?this.message===e.message&&this.code===e.code&&this.constructor.name===e.constructor.name:false}},$=class extends K{constructor(t,r,i){super(t,i);this.statusCode=r;}},at=class extends K{constructor(e="Request was cancelled"){super(e,"CANCELLED");}},nt=class extends K{constructor(e){super(e,"NETWORK_ERROR");}},lt=class extends K{constructor(e="Request timeout"){super(e,"TIMEOUT");}},ct=class extends ${constructor(e="Resource not found"){super(e,404,"NOT_FOUND");}},ut=class extends ${constructor(e="Unauthorized"){super(e,401,"UNAUTHORIZED");}},mt=class extends ${constructor(e="Forbidden"){super(e,403,"FORBIDDEN");}},pt=class extends ${constructor(e="Server error",t=500){super(e,t,"SERVER_ERROR");}},a=class extends K{constructor(e){super(e,"PARSE_ERROR");}},Sr=class extends K{constructor(e){super(e,"VALIDATION_ERROR");}};var Q=class{constructor(e={}){this.baseURL=e.baseURL||"",this.timeout=e.timeout||3e4,this.defaultHeaders={"Content-Type":"application/json",...e.headers},this.interceptors=e.interceptors||[];}addInterceptor(e){this.interceptors.push(e);}removeInterceptor(e){let t=this.interceptors.indexOf(e);t!==-1&&this.interceptors.splice(t,1);}async get(e,t){return this.request("GET",e,t)}async post(e,t){return this.request("POST",e,t)}async put(e,t){return this.request("PUT",e,t)}async delete(e,t){return this.request("DELETE",e,t)}async patch(e,t){return this.request("PATCH",e,t)}async request(e,t,r={}){try{let i=this.buildUrl(t),s={};e!=="GET"?Object.assign(s,this.defaultHeaders):Object.entries(this.defaultHeaders).forEach(([d,R])=>{d.toLowerCase()!=="content-type"&&(s[d]=R);}),Object.assign(s,r.headers);let n={method:e,headers:s};e!=="GET"&&r.body&&(n.body=JSON.stringify(r.body)),r.cancelToken&&(n.signal=r.cancelToken.signal);for(let d of this.interceptors)if(d.onRequest){let R=await d.onRequest(i,n);i=R.url,n=R.init;}let u=await this.fetchWithTimeout(i,n,r.timeout||this.timeout);for(let d of this.interceptors)d.onResponse&&(u=await d.onResponse(u));if(!u.ok)return w(await this.handleErrorResponse(u));let l=await u.json();return J(l)}catch(i){return w(await this.handleError(i,r.cancelToken))}}async fetchWithTimeout(e,t,r){let i=new AbortController,s=setTimeout(()=>i.abort(),r);try{let n=t.signal&&t.signal instanceof AbortSignal?this.combineSignals(t.signal,i.signal):i.signal;return await fetch(e,{...t,signal:n})}finally{clearTimeout(s);}}combineSignals(e,t){let r=new AbortController,i=()=>r.abort();return e.addEventListener("abort",i),t.addEventListener("abort",i),r.signal}buildUrl(e){return e.startsWith("http://")||e.startsWith("https://")?e:`${this.baseURL}${e}`}async handleErrorResponse(e){let{status:t}=e,r;try{let i=await e.json();r=i.message||i.error||e.statusText;}catch{r=e.statusText;}switch(t){case 401:return new ut(r);case 403:return new mt(r);case 404:return new ct(r);case 500:case 502:case 503:case 504:return new pt(r,t);default:return new $(r,t)}}async handleError(e,t){let r=e instanceof Error?e:new Error(String(e));for(let i of this.interceptors)if(i.onError){let s=await i.onError(r);s&&(r=s);}return t?.isCancelled||e.name==="AbortError"?new at(t?.reason):r.name==="AbortError"||r.message.includes("timeout")||r.message.includes("aborted")?new lt:r.message.includes("network")||r.message.includes("fetch")||r.message.includes("ECONNREFUSED")?new nt(r.message):new $(r.message)}};var Dt=class{};var Ae=class extends Dt{constructor(t){super();this.apiKey=t;}onRequest(t,r){let i=new URL(t);return i.searchParams.set("key",this.apiKey),{url:i.toString(),init:r}}setApiKey(t){this.apiKey=t;}getApiKey(){return this.apiKey}};var kt=(n=>(n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n[n.FATAL=4]="FATAL",n[n.NONE=5]="NONE",n))(kt||{}),wr=class{print(e){let t=kt[e.level],i=`[${e.timestamp.toISOString()}] [${t}] ${e.message}`;switch(e.level){case 0:console.debug(i,e.data);break;case 1:console.info(i,e.data);break;case 2:console.warn(i,e.data);break;case 3:case 4:console.error(i,e.error||e.data);break}}},j=class{constructor(e=1){this.minLevel=e;}shouldLog(e){return e.level>=this.minLevel}},Lt=class o{constructor(e=new wr,t=new j){this.enabled=true;this.printer=e,this.filter=t;}static getInstance(){return o.instance||(o.instance=new o),o.instance}configure(e){e.printer&&(this.printer=e.printer),e.filter&&(this.filter=e.filter),e.enabled!==void 0&&(this.enabled=e.enabled);}debug(e,t){this.log(0,e,t);}info(e,t){this.log(1,e,t);}warn(e,t){this.log(2,e,t);}error(e,t){let r=t instanceof Error?t:void 0,i=t instanceof Error?void 0:t;this.log(3,e,i,r);}fatal(e,t){let r=t instanceof Error?t:void 0,i=t instanceof Error?void 0:t;this.log(4,e,i,r);}log(e,t,r,i){if(!this.enabled)return;let s={level:e,message:t,timestamp:new Date,data:r,error:i};this.filter.shouldLog(s)&&this.printer.print(s);}enable(){this.enabled=true;}disable(){this.enabled=false;}};var ee={BASE_URL:"https://webapi.bps.go.id/v1/api",DEFAULT_TIMEOUT:3e4,API_VERSION:"v1",DEFAULT_PAGE_SIZE:10,MAX_PAGE_SIZE:100};var kr=(t=>(t.ID="ind",t.EN="eng",t))(kr||{});var xr=(r=>(r.AVAILABLE="available",r.NOT_AVAILABLE="not-available",r.LIST_NOT_AVAILABLE="list-not-available",r))(xr||{});var Ur=(s=>(s.KBLI_2009="kbli2009",s.KBLI_2015="kbli2015",s.KBLI_2017="kbli2017",s.KBLI_2020="kbli2020",s.KBKI_2015="kbki2015",s))(Ur||{}),Vr=(s=>(s.CATEGORY="kategori",s.PRIMARY_GROUP="golongan pokok",s.GROUP="golongan",s.SUB_GROUP="subgolongan",s.CLUSTER="kelompok",s))(Vr||{}),Nr=(c=>(c.SECTION="seksi",c.DIVISION="divisi",c.GROUP="kelompok",c.CLASSES="kelas",c.SUB_CLASS="subkelas",c.COMMODITY_GROUP="kelompok komoditas",c.COMMODITY="komoditas",c))(Nr||{});var Fr=(i=>(i.ALL="all",i.PROVINCE="prov",i.REGENCY="kab",i.REGENCY_BY_PROVINCE="kabbyprov",i))(Fr||{});var p={DOMAIN_LIST:"/domain",PUBLICATION_LIST:"/list/model/publication",PUBLICATION_VIEW:"/view/model/publication",INFOGRAPHIC_LIST:"/list/model/infographic",INFOGRAPHIC_VIEW:"/view/model/infographic",STATIC_TABLE_LIST:"/list/model/statictable",STATIC_TABLE_VIEW:"/view/model/statictable",NEWS_LIST:"/list/model/news",NEWS_VIEW:"/view/model/news",NEWS_CATEGORY_LIST:"/list/model/newscategory",NEWS_CATEGORY_VIEW:"/view/model/newscategory",PRESS_RELEASE_LIST:"/list/model/pressrelease",PRESS_RELEASE_VIEW:"/view/model/pressrelease",SUBJECT_LIST:"/list/model/subject",SUBJECT_VIEW:"/view/model/subject",SUBJECT_CATEGORY_LIST:"/list/model/subcat",SUBJECT_CATEGORY_VIEW:"/view/model/subcat",STRATEGIC_INDICATOR_LIST:"/list/model/indicators",STRATEGIC_INDICATOR_VIEW:"/view/model/indicators",VARIABLE_LIST:"/list/model/var",VARIABLE_VIEW:"/view/model/var",VERTICAL_VARIABLE_LIST:"/list/model/vervar",VERTICAL_VARIABLE_VIEW:"/view/model/vervar",UNIT_LIST:"/list/model/unit",UNIT_VIEW:"/view/model/unit",PERIOD_LIST:"/list/model/th",PERIOD_VIEW:"/view/model/th",DERIVED_PERIOD_LIST:"/list/model/turth",DERIVED_PERIOD_VIEW:"/view/model/turth",DERIVED_VARIABLE_LIST:"/list/model/turvar",DERIVED_VARIABLE_VIEW:"/view/model/turvar",DYNAMIC_TABLE_LIST:"/list/model/data",statisticClassification:(o="kbli2020")=>`/view/model/${o}`,CENSUS:"/interoperabilitas/datasource/sensus",TRADE:"/dataexim"};var dt=null;function mi(o){return dt=Pr(o),dt}function g(){if(!dt)throw new Error('[stadata-js] Client not initialized. Call initStadata({ apiKey: "..." }) before using composables.');return dt}function pi(){dt=null;}var Ce=class{constructor(e){this.client=e;}async getAll(e){let t={type:e.type};e.provinceCode&&(t.prov=e.provinceCode),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.perPage&&(t.per_page=e.perPage.toString()),e.keyword&&(t.keyword=e.keyword);let r=new URLSearchParams(t).toString(),i=`${p.DOMAIN_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var m=class o{toString(){return JSON.stringify(this.toJson(),null,2)}equals(e){return e instanceof o?JSON.stringify(this.toJson())===JSON.stringify(e.toJson()):false}copyWith(e){let r={...this.toJson(),...e};return Object.assign(Object.create(Object.getPrototypeOf(this)),r)}};var xt=class{};var gt=class o extends m{constructor(t,r,i){super();this.id=t;this.name=r;this.url=i;}toJson(){return {domain_id:this.id,domain_name:this.name,domain_url:this.url}}static fromJson(t){return new o(t.domain_id||t.id||"",t.domain_name||t.name||"",t.domain_url||t.url||"")}};var q=class o extends m{constructor(t,r,i,s,n){super();this.page=t;this.perPage=r;this.total=i;this.pages=s;this.count=n;}get hasNextPage(){return this.page<this.pages}get hasPreviousPage(){return this.page>1}get nextPage(){return this.hasNextPage?this.page+1:null}get previousPage(){return this.hasPreviousPage?this.page-1:null}toJson(){return {page:this.page,per_page:this.perPage,total:this.total,pages:this.pages,count:this.count}}static fromJson(t){return new o(t.page||1,t.per_page||10,t.total||0,t.pages||0,t.count||0)}};var f=class o extends m{constructor(t,r){super();this.data=t;this.pagination=r;}get hasMore(){return this.pagination.hasNextPage}get totalItems(){return this.pagination.total}get items(){return this.data}get itemCount(){return this.data.length}toJson(){return {data:this.data,pagination:this.pagination.toJson()}}static fromJson(t,r){let s=(t.data||[]).map(u=>r(u)),n=t.pagination,c=q.fromJson(n);return new o(s,c)}};var Ee=class{constructor(e){this.remoteDataSource=e;}async getAll(e){if(!e)throw new a("Domain list params are required");return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(d=>gt.fromJson(d)),c=Number(i.count)||s.length,u=Number(i.per_page)||c,l=new q(Number(i.page||1),u,Number(i.total||0),Number(i.pages||1),c);return new f(n,l)}catch(i){throw new a(`Failed to parse domain data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Or(o){let e=o??g(),t=new Ce(e.networkClient),r=new Ee(t);return {fetchDomainList:i=>r.getAll(i)}}var Ie=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.keyword&&(t.keyword=e.keyword),e.month&&(t.month=e.month.toString()),e.year&&(t.year=e.year.toString());let r=new URLSearchParams(t).toString(),i=`${p.PUBLICATION_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.PUBLICATION_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ft=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.title=r;this.releaseDate=i;this.url=s;this.cover=n;}toJson(){return {id:this.id,title:this.title,rl_date:this.releaseDate.toISOString().split("T")[0],url:this.url,cover:this.cover}}static fromJson(t){return new o(String(t.id||""),String(t.title||""),new Date(String(t.rl_date||t.release_date||t.releaseDate||"")),String(t.url||""),String(t.cover||""))}};var te=class o extends m{constructor(t,r,i,s,n,c,u,l,d,R,Pe,y,B){super();this.id=t;this.title=r;this.issn=i;this.cover=s;this.pdf=n;this.size=c;this.scheduledDate=u;this.releaseDate=l;this.updateDate=d;this.abstract=R;this.catalogueNumber=Pe;this.publicationNumber=y;this.relatedPublications=B;}toJson(){return {id:this.id,title:this.title,issn:this.issn,cover:this.cover,pdf:this.pdf,size:this.size,scheduled_date:this.scheduledDate?.toISOString().split("T")[0]||null,rl_date:this.releaseDate?.toISOString().split("T")[0]||null,updt_date:this.updateDate?.toISOString().split("T")[0]||null,abstract:this.abstract,catalogue_number:this.catalogueNumber,publication_number:this.publicationNumber,related_publications:this.relatedPublications.map(t=>t.toJson())}}static fromJson(t){let r=t.related_publications||t.relatedPublications,i=Array.isArray(r)?r.map(s=>ft.fromJson(s)):[];return new o(String(t.id||""),String(t.title||""),String(t.issn||""),String(t.cover||""),String(t.pdf||""),String(t.size||""),t.scheduled_date||t.scheduledDate?new Date(String(t.scheduled_date||t.scheduledDate)):null,t.rl_date||t.release_date||t.releaseDate?new Date(String(t.rl_date||t.release_date||t.releaseDate)):null,t.updt_date||t.update_date||t.updateDate?new Date(String(t.updt_date||t.update_date||t.updateDate)):null,t.abstract?String(t.abstract):null,t.catalogue_number||t.catalogueNumber?String(t.catalogue_number||t.catalogueNumber):null,t.publication_number||t.publicationNumber?String(t.publication_number||t.publicationNumber):null,i)}};var ve=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>te.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>te.fromJson(l))}catch(i){throw new a(`Failed to parse publications: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Publication not found");let i=r.data[0];if(!i)throw new a("Publication data is empty");return te.fromJson(i)}catch(i){throw new a(`Failed to parse publication data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Br(o){let e=o??g(),t=new Ie(e.networkClient),r=new ve(t);return {fetchPublicationList:i=>r.getAll(i),fetchPublicationDetail:i=>r.getById(i)}}var re=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.keyword&&(t.keyword=e.keyword),e.month&&(t.month=e.month.toString()),e.year&&(t.year=e.year.toString());let r=new URLSearchParams(t).toString(),i=`${p.PRESS_RELEASE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.PRESS_RELEASE_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Ut=class o{constructor(){this.container=new Map;this.factories=new Map;}static getInstance(){return o.instance||(o.instance=new o),o.instance}register(e,t){this.container.set(e,t);}registerFactory(e,t){this.factories.set(e,t);}resolve(e){if(this.container.has(e))return this.container.get(e);if(this.factories.has(e)){let t=this.factories.get(e);if(t){let r=t();return this.container.set(e,r),r}}throw new Error(`Dependency not found: ${e}`)}has(e){return this.container.has(e)||this.factories.has(e)}clear(){this.container.clear(),this.factories.clear();}remove(e){this.container.delete(e),this.factories.delete(e);}};var Ar=class o extends Error{constructor(e){super(e),this.name="StadataException",Object.setPrototypeOf(this,o.prototype);}};var Vt=class o extends Ar{constructor(e="Request was cancelled"){super(e),this.name="CancelledException",Object.setPrototypeOf(this,o.prototype);}};var Cr=class o{constructor(){this._isCancelled=false;this.abortController=new AbortController;}get signal(){return this.abortController.signal}get isCancelled(){return this._isCancelled}get reason(){return this._reason}cancel(e){this._isCancelled||(this._isCancelled=true,this._reason=e,this.abortController.abort());}throwIfCancelled(){if(this._isCancelled)throw new Vt(this._reason||"Request was cancelled")}static create(){return new o}static source(){let e=new o;return {token:e,cancel:t=>e.cancel(t)}}};var z=class o extends m{constructor(t,r,i,s,n,c,u,l,d,R,Pe){super();this.id=t;this.subjectId=r;this.subject=i;this.title=s;this.abstract=n;this.releaseDate=c;this.updatedDate=u;this.pdf=l;this.size=d;this.slide=R;this.thumbnail=Pe;}toJson(){return {brs_id:this.id,subj_id:this.subjectId,subj:this.subject,title:this.title,abstract:this.abstract,rl_date:this.releaseDate,updt_date:this.updatedDate,pdf:this.pdf,size:this.size,slide:this.slide,thumbnail:this.thumbnail}}static fromJson(t){return new o(Number(t.brs_id||t.id||0),Number(t.subj_id||t.subjectId||0),String(t.subj||t.subject||""),String(t.title||""),String(t.abstract||""),String(t.rl_date||t.releaseDate||""),t.updt_date?String(t.updt_date):null,String(t.pdf||""),String(t.size||""),String(t.slide||""),String(t.thumbnail||""))}};var ie=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>z.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>z.fromJson(l))}catch(i){throw new a(`Failed to parse press releases: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Press release not found");let i=r.data[0];if(!i)throw new a("Press release data is empty");return z.fromJson(i)}catch(i){throw new a(`Failed to parse press release data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Gr(o){let e=o??g(),t=new re(e.networkClient),r=new ie(t);return {fetchPressReleaseList:i=>r.getAll(i),fetchPressReleaseDetail:i=>r.getById(i)}}var oe=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.keyword&&(t.keyword=e.keyword),e.month&&(t.month=e.month.toString()),e.year&&(t.year=e.year.toString());let r=new URLSearchParams(t).toString(),i=`${p.STATIC_TABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.STATIC_TABLE_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var H=class o extends m{constructor(t,r,i,s,n,c){super();this.id=t;this.title=r;this.subjectId=i;this.size=s;this.updatedAt=n;this.excelUrl=c;}toJson(){return {table_id:this.id,title:this.title,subj_id:this.subjectId,size:this.size,updt_date:this.updatedAt,excel:this.excelUrl}}static fromJson(t){return new o(String(t.table_id||t.id||""),String(t.title||""),Number(t.subj_id||t.subjectId||0),String(t.size||""),String(t.updt_date||t.updatedAt||""),String(t.excel||t.excelUrl||""))}};var se=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>H.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>H.fromJson(l))}catch(i){throw new a(`Failed to parse static tables: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Static table not found");let i=r.data[0];if(!i)throw new a("Static table data is empty");return H.fromJson(i)}catch(i){throw new a(`Failed to parse static table data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Jr(o){let e=o??g(),t=new oe(e.networkClient),r=new se(t);return {fetchStaticTableList:i=>r.getAll(i),fetchStaticTableDetail:i=>r.getById(i)}}var _e=class{constructor(e){this.client=e;}async getAll(e){let t={domain:e.domain||"",var:e.variableId.toString(),th:e.periodId.toString()};e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.verticalVariableId!==void 0&&(t.vervar=e.verticalVariableId.toString()),e.derivedVariableId!==void 0&&(t.turvar=e.derivedVariableId.toString()),e.derivedPeriodId!==void 0&&(t.turth=e.derivedPeriodId.toString());let r=new URLSearchParams(t).toString(),i=`${p.DYNAMIC_TABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Nt=class o extends m{constructor(t,r,i,s,n,c,u){super();this.value=t;this.label=r;this.unit=i;this.subject=s;this.definition=n;this.notes=c;this.decimal=u;}toJson(){return {val:this.value,label:this.label,unit:this.unit,subj:this.subject,def:this.definition,note:this.notes,...this.decimal!==void 0&&{decimal:this.decimal}}}static fromJson(t){return new o(Number(t.val||0),String(t.label||""),String(t.unit||""),String(t.subj||""),String(t.def||""),String(t.note||""),t.decimal!==void 0?Number(t.decimal):void 0)}},ae=class o extends m{constructor(t,r){super();this.value=t;this.label=r;}toJson(){return {val:this.value,label:this.label}}static fromJson(t){let r=t.val;return new o(typeof r=="number"?r:String(r||""),String(t.label||""))}},Ft=class o extends ae{static fromJson(e){let t=e.val;return new o(typeof t=="number"?t:String(t||""),String(e.label||""))}},Ot=class o extends m{constructor(t,r){super();this.value=t;this.label=r;}toJson(){return {val:this.value,label:this.label}}static fromJson(t){return new o(Number(t.val||0),String(t.label||""))}},Bt=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.title=r;this.tableSource=i;this.lastUpdate=s;this.link=n;}toJson(){return {id:this.id,title:this.title,tablesource:this.tableSource,last_update:this.lastUpdate,link:this.link}}static fromJson(t){return new o(String(t.id||""),String(t.title||""),Number(t.tablesource||0),t.last_update!==null?String(t.last_update||""):null,String(t.link||""))}};var yt=class o extends m{constructor(t,r,i,s,n,c,u,l,d,R){super();this.subjects=t;this.variables=r;this.verticalVariables=i;this.verticalVariableLabel=s;this.periods=n;this.derivedVariables=c;this.derivedPeriods=u;this.dataContent=l;this.related=d;this.lastUpdate=R;}toJson(){return {subject:this.subjects.map(t=>t.toJson()),var:this.variables.map(t=>t.toJson()),vervar:this.verticalVariables.map(t=>t.toJson()),labelvervar:this.verticalVariableLabel,tahun:this.periods.map(t=>t.toJson()),turvar:this.derivedVariables.map(t=>t.toJson()),turtahun:this.derivedPeriods.map(t=>t.toJson()),datacontent:this.dataContent,related:this.related.map(t=>t.toJson()),last_update:this.lastUpdate}}static fromJson(t){let r=Array.isArray(t.subject)?t.subject:[],i=Array.isArray(t.var)?t.var:[],s=Array.isArray(t.vervar)?t.vervar:[],n=Array.isArray(t.tahun)?t.tahun:[],c=Array.isArray(t.turvar)?t.turvar:[],u=Array.isArray(t.turtahun)?t.turtahun:[],l=Array.isArray(t.related)?t.related:[];return new o(r.map(d=>Ot.fromJson(d)),i.map(d=>Nt.fromJson(d)),s.map(d=>ae.fromJson(d)),String(t.labelvervar||""),n.map(d=>Ft.fromJson(d)),c.map(d=>ae.fromJson(d)),u.map(d=>ae.fromJson(d)),t.datacontent||{},l.map(d=>Bt.fromJson(d)),t.last_update!==void 0?t.last_update:void 0)}getDataValue(t,r,i,s,n){let c=`${t}${r}${i}${s}${n}`;return this.dataContent[c]}toStructuredData(){let t=this.subjects[0],r=this.variables[0],i=r?.value||0,s=this.derivedVariables.length>1||this.derivedVariables[0]?.value!==0&&this.derivedVariables[0]?.value!=="0",n=this.derivedPeriods.length>1||this.derivedPeriods[0]?.value!==0&&this.derivedPeriods[0]?.value!=="0",c=this.verticalVariables.map(u=>s?{id:u.value,label:u.label,data:this.derivedVariables.map(l=>({id:l.value,label:l.label,data:this.periods.map(d=>n?{id:d.value,label:d.label,data:this.derivedPeriods.map(R=>({id:R.value,label:R.label,value:this.getDataValue(u.value,i,l.value,d.value,R.value)??null}))}:{id:d.value,label:d.label,value:this.getDataValue(u.value,i,l.value,d.value,this.derivedPeriods[0]?.value||0)??null})}))}:{id:u.value,label:u.label,data:this.periods.map(l=>({id:l.value,label:l.label,data:n?this.derivedPeriods.map(d=>({id:d.value,label:d.label,value:this.getDataValue(u.value,i,0,l.value,d.value)??null})):[{id:l.value,label:l.label,value:this.getDataValue(u.value,i,0,l.value,this.derivedPeriods[0]?.value||0)??null}]}))});return {subject_id:t?.value||0,subject_label:t?.label||"",variable_id:r?.value||0,variable_label:r?.label||"",variable_unit:r?.unit||"",vertical_variable_label:this.verticalVariableLabel,last_update:this.lastUpdate,data:c}}};var Te=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{return yt.fromJson(r)}catch(i){throw new a(`Failed to parse dynamic table: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function $r(o){let e=o??g(),t=new _e(e.networkClient),r=new Te(t);return {fetchDynamicTableList:i=>r.getAll(i)}}var De=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.keyword&&(t.keyword=e.keyword);let r=new URLSearchParams(t).toString(),i=`${p.INFOGRAPHIC_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.INFOGRAPHIC_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ne=class o extends m{constructor(t,r,i,s,n,c){super();this.id=t;this.title=r;this.image=i;this.category=s;this.downloadUrl=n;this.description=c;}toJson(){return {inf_id:this.id,title:this.title,img:this.image,category:this.category,dl:this.downloadUrl,desc:this.description}}static fromJson(t){return new o(String(t.inf_id||t.id||""),String(t.title||""),String(t.img||t.image||""),Number(t.category||0),String(t.dl||t.downloadUrl||""),t.desc||t.description?String(t.desc||t.description):null)}};var Le=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>ne.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>ne.fromJson(l))}catch(i){throw new a(`Failed to parse infographics: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Infographic not found");let i=r.data[0];if(!i)throw new a("Infographic data is empty");return ne.fromJson(i)}catch(i){throw new a(`Failed to parse infographic data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Yr(o){let e=o??g(),t=new De(e.networkClient),r=new Le(t);return {fetchInfographicList:i=>r.getAll(i)}}var le=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.keyword&&(t.keyword=e.keyword),e.month&&(t.month=e.month.toString()),e.year&&(t.year=e.year.toString()),e.newsCategoryId&&(t.news_category_id=e.newsCategoryId);let r=new URLSearchParams(t).toString(),i=`${p.NEWS_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.NEWS_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Z=class o extends m{constructor(t,r,i,s,n,c){super();this.id=t;this.title=r;this.content=i;this.releaseDate=s;this.categoryId=n;this.picture=c;}toJson(){return {news_id:this.id,title:this.title,news_content:this.content,rl_date:this.releaseDate,category_id:this.categoryId,picture:this.picture}}static fromJson(t){return new o(String(t.news_id||t.id||""),String(t.title||""),String(t.news_content||t.content||""),String(t.rl_date||t.releaseDate||""),Number(t.category_id||t.categoryId||0),t.picture?String(t.picture):null)}};var ce=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>Z.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>Z.fromJson(l))}catch(i){throw new a(`Failed to parse news: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("News not found");let i=r.data[0];if(!i)throw new a("News data is empty");return Z.fromJson(i)}catch(i){throw new a(`Failed to parse news data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function qr(o){let e=o??g(),t=new le(e.networkClient),r=new ce(t);return {fetchNewList:i=>r.getAll(i),fetchNewDetail:i=>r.getById(i)}}var ke=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.NEWS_CATEGORY_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.NEWS_CATEGORY_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ue=class o extends m{constructor(t,r){super();this.id=t;this.name=r;}toJson(){return {newscat_id:this.id,newscat_name:this.name}}static fromJson(t){return new o(String(t.newscat_id||t.id||""),String(t.newscat_name||t.name||""))}};var xe=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>ue.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>ue.fromJson(l))}catch(i){throw new a(`Failed to parse news category: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("News category not found");let i=r.data[0];if(!i)throw new a("News category data is empty");return ue.fromJson(i)}catch(i){throw new a(`Failed to parse news category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Mr(o){let e=o??g(),t=new ke(e.networkClient),r=new xe(t);return {fetchNewsCategoryList:i=>r.getAll(i)}}var Ue=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString()),e?.subjectId&&(t.subject=e.subjectId.toString()),e?.showDeleted!==void 0&&(t.show_deleted=e.showDeleted?"1":"0");let r=new URLSearchParams(t).toString(),i=`${p.VARIABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.VARIABLE_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var me=class o extends m{constructor(t,r,i,s,n,c,u,l,d,R,Pe,y,B){super();this.id=t;this.title=r;this.subjectId=i;this.subjectName=s;this.statisticClassificationId=n;this.statisticClassificationName=c;this.definition=u;this.notes=l;this.unit=d;this.verticalVariableCount=R;this.derivedVariableCount=Pe;this.graphId=y;this.graphName=B;}toJson(){return {var_id:this.id,title:this.title,sub_id:this.subjectId,sub_name:this.subjectName,subcsa_id:this.statisticClassificationId,subcsa_name:this.statisticClassificationName,def:this.definition,notes:this.notes,vertical:this.verticalVariableCount,unit:this.unit,graph_id:this.graphId,graph_name:this.graphName}}static fromJson(t){return new o(Number(t.var_id||t.id||0),String(t.title||t.name||""),Number(t.sub_id||t.subject_id||t.subjectId||0),String(t.sub_name||t.subject_name||t.subjectName||""),Number(t.subcsa_id||t.statisticClassificationId||0),String(t.subcsa_name||t.statisticClassificationName||""),String(t.def||t.definition||""),String(t.notes||""),String(t.unit||""),Number(t.vertical||t.vertical_variable||t.verticalVariableCount||0),Number(t.derived_variable||t.derivedVariableCount||0),Number(t.graph_id||t.graphId||0),String(t.graph_name||t.graphName||""))}};var Ve=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>me.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>me.fromJson(l))}catch(i){throw new a(`Failed to parse variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Variable not found");let i=r.data[0];if(!i)throw new a("Variable data is empty");return me.fromJson(i)}catch(i){throw new a(`Failed to parse variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Wr(o){let e=o??g(),t=new Ue(e.networkClient),r=new Ve(t);return {fetchVariableList:i=>r.getAll(i),fetchVariableDetail:i=>r.getById(i)}}var Ne=class{constructor(e){this.client=e;}async getAll(e){let t={};e.variableId!==void 0&&(t.var=e.variableId.toString()),e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.VERTICAL_VARIABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.VERTICAL_VARIABLE_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var pe=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.label=r;this.itemId=i;this.groupId=s;this.groupName=n;}toJson(){return {kode_ver_id:this.id,vervar:this.label,item_ver_id:this.itemId,group_ver_id:this.groupId,name_group_ver_id:this.groupName}}static fromJson(t){return new o(Number(t.kode_ver_id||t.id||0),String(t.vervar||t.label||""),Number(t.item_ver_id||t.itemId||0),Number(t.group_ver_id||t.groupId||0),String(t.name_group_ver_id||t.groupName||""))}};var Fe=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>pe.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>pe.fromJson(l))}catch(i){throw new a(`Failed to parse vertical variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Vertical variable not found");let i=r.data[0];if(!i)throw new a("Vertical variable data is empty");return pe.fromJson(i)}catch(i){throw new a(`Failed to parse vertical variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Kr(o){let e=o??g(),t=new Ne(e.networkClient),r=new Fe(t);return {fetchVerticalVariableList:i=>r.getAll(i)}}var Oe=class{constructor(e){this.client=e;}async getAll(e){let t={};e.variableId!==void 0&&(t.var=e.variableId.toString()),e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.DERIVED_VARIABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.DERIVED_VARIABLE_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var de=class o extends m{constructor(t,r,i,s){super();this.id=t;this.name=r;this.groupId=i;this.groupName=s;}toJson(){return {turvar_id:this.id,turvar:this.name,group_turvar_id:this.groupId,name_group_turvar:this.groupName}}static fromJson(t){return new o(Number(t.turvar_id||t.id||0),String(t.turvar||t.name||""),Number(t.group_turvar_id||t.groupId||0),String(t.name_group_turvar||t.groupName||""))}};var Be=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>de.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>de.fromJson(l))}catch(i){throw new a(`Failed to parse derived variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Derived variable not found");let i=r.data[0];if(!i)throw new a("Derived variable data is empty");return de.fromJson(i)}catch(i){throw new a(`Failed to parse derived variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function zr(o){let e=o??g(),t=new Oe(e.networkClient),r=new Be(t);return {fetchDerivedVariableList:i=>r.getAll(i)}}var Ge=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.SUBJECT_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.SUBJECT_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ge=class o extends m{constructor(t,r,i,s){super();this.id=t;this.name=r;this.categoryId=i;this.category=s;}toJson(){return {subj_id:this.id,title:this.name,subcatid:this.categoryId,category:this.category}}static fromJson(t){return new o(Number(t.sub_id||t.id||0),String(t.title||t.name||""),Number(t.subcat_id||t.categoryId||0),String(t.category||t.subcat||""))}};var Je=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>ge.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>ge.fromJson(l))}catch(i){throw new a(`Failed to parse subject: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Subject not found");let i=r.data[0];if(!i)throw new a("Subject data is empty");return ge.fromJson(i)}catch(i){throw new a(`Failed to parse subject data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Hr(o){let e=o??g(),t=new Ge(e.networkClient),r=new Je(t);return {fetchSubjectList:i=>r.getAll(i),fetchSubjectDetail:i=>r.getById(i)}}var $e=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.SUBJECT_CATEGORY_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.SUBJECT_CATEGORY_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var fe=class o extends m{constructor(t,r){super();this.id=t;this.name=r;}toJson(){return {subcat_id:this.id,subcat_name:this.name}}static fromJson(t){return new o(Number(t.subcat_id||t.id||0),String(t.subcat_name||t.title||t.name||""))}};var Ye=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>fe.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>fe.fromJson(l))}catch(i){throw new a(`Failed to parse subject category: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Subject category not found");let i=r.data[0];if(!i)throw new a("Subject category data is empty");return fe.fromJson(i)}catch(i){throw new a(`Failed to parse subject category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Zr(o){let e=o??g(),t=new $e(e.networkClient),r=new Ye(t);return {fetchSubjectCategoryList:i=>r.getAll(i)}}var qe=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.UNIT_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.UNIT_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ye=class o extends m{constructor(t,r){super();this.id=t;this.name=r;}toJson(){return {unit_id:this.id,unit:this.name}}static fromJson(t){return new o(Number(t.unit_id||t.id||0),String(t.unit||t.name||""))}};var Me=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>ye.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>ye.fromJson(l))}catch(i){throw new a(`Failed to parse unit: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Unit not found");let i=r.data[0];if(!i)throw new a("Unit data is empty");return ye.fromJson(i)}catch(i){throw new a(`Failed to parse unit data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Xr(o){let e=o??g(),t=new qe(e.networkClient),r=new Me(t);return {fetchUnitList:i=>r.getAll(i),fetchUnitDetail:i=>r.getById(i)}}var We=class{constructor(e){this.client=e;}async getAll(e){let t={};e.variableId!==void 0&&(t.var=e.variableId.toString()),e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.PERIOD_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.PERIOD_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Re=class o extends m{constructor(t,r){super();this.id=t;this.period=r;}toJson(){return {th_id:this.id,th:this.period}}static fromJson(t){return new o(Number(t.th_id||t.id||0),Number(t.th||t.period||0))}};var Ke=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>Re.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>Re.fromJson(l))}catch(i){throw new a(`Failed to parse period: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Period not found");let i=r.data[0];if(!i)throw new a("Period data is empty");return Re.fromJson(i)}catch(i){throw new a(`Failed to parse period data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Qr(o){let e=o??g(),t=new We(e.networkClient),r=new Ke(t);return {fetchPeriodList:i=>r.getAll(i)}}var ze=class{constructor(e){this.client=e;}async getAll(e){let t={};e.variableId!==void 0&&(t.var=e.variableId.toString()),e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.DERIVED_PERIOD_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.DERIVED_PERIOD_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var be=class o extends m{constructor(t,r,i,s){super();this.id=t;this.period=r;this.groupId=i;this.groupName=s;}toJson(){return {turth_id:this.id,turth:this.period,group_turth_id:this.groupId,name_group_turth:this.groupName}}static fromJson(t){return new o(Number(t.turth_id||t.id||0),String(t.turth||t.period||""),Number(t.group_turth_id||t.groupId||0),String(t.name_group_turth||t.groupName||""))}};var He=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>be.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>be.fromJson(l))}catch(i){throw new a(`Failed to parse derived period: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Derived period not found");let i=r.data[0];if(!i)throw new a("Derived period data is empty");return be.fromJson(i)}catch(i){throw new a(`Failed to parse derived period data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function jr(o){let e=o??g(),t=new ze(e.networkClient),r=new He(t);return {fetchDerivedPeriodList:i=>r.getAll(i)}}var Ze=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.STRATEGIC_INDICATOR_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.STRATEGIC_INDICATOR_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var he=class o extends m{constructor(t,r,i,s,n,c,u,l,d,R,Pe){super();this.variableId=t;this.indicatorId=r;this.subjectCsa=i;this.title=s;this.name=n;this.dataSource=c;this.value=u;this.unit=l;this.category=d;this.hashId=R;this.period=Pe;}toJson(){return {var:this.variableId,indicator_id:this.indicatorId,subject_csa:this.subjectCsa,title:this.title,name:this.name,data_source:this.dataSource,value:this.value,unit:this.unit,category:this.category,hash_id:this.hashId,periode:this.period}}static fromJson(t){return new o(Number(t.var||t.variableId||0),Number(t.indicator_id||t.indicatorId||0),Number(t.subject_csa||t.subjectCsa||0),String(t.title||""),String(t.name||""),String(t.data_source||t.dataSource||""),Number(t.value||0),String(t.unit||""),Number(t.category||0),String(t.hash_id||t.hashId||""),String(t.periode||t.period||""))}};var Xe=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>he.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>he.fromJson(l))}catch(i){throw new a(`Failed to parse strategic indicator: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Strategic indicator not found");let i=r.data[0];if(!i)throw new a("Strategic indicator data is empty");return he.fromJson(i)}catch(i){throw new a(`Failed to parse strategic indicator data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function ei(o){let e=o??g(),t=new Ze(e.networkClient),r=new Xe(t);return {fetchStrategicIndicatorList:i=>r.getAll(i),fetchStrategicIndicatorDetail:i=>r.getById(i)}}var Qe=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString()),e?.keyword&&(t.keyword=e.keyword),e?.level&&(t.level=e.level);let r=new URLSearchParams(t).toString(),i=e?.type||"kbli2020",s=`${p.statisticClassification(i)}${r?`?${r}`:""}`;return this.client.get(s,{cancelToken:e?.cancelToken})}async getById(e){let t={id:e.id.toString()};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=e.type||"kbli2020",s=`${p.statisticClassification(i)}${r?`?${r}`:""}`;return this.client.get(s,{cancelToken:e.cancelToken})}};var Se=class o extends m{constructor(t,r){super();this.id=t;this.title=r;}toJson(){return {kbli_id:this.id,title:this.title}}static fromJson(t){return new o(String(t.kbli_id||t.id||""),String(t.title||t.name||""))}};var je=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>Se.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>Se.fromJson(l))}catch(i){throw new a(`Failed to parse statistic classification: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Statistic classification not found");let i=r.data[0];if(!i)throw new a("Statistic classification data is empty");return Se.fromJson(i)}catch(i){throw new a(`Failed to parse statistic classification data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function ti(o){let e=o??g(),t=new Qe(e.networkClient),r=new je(t);return {fetchStatisticClassificationList:i=>r.getAll(i),fetchStatisticClassificationDetail:i=>r.getById(i)}}var et=class{constructor(e){this.client=e;}async getAll(e){let t={};switch(e?.type){case "topics":t.id="38",e.censusId&&(t.kegiatan=e.censusId);break;case "areas":t.id="39",e.censusId&&(t.kegiatan=e.censusId);break;case "datasets":t.id="40",e.censusId&&(t.kegiatan=e.censusId),e.topicId&&(t.topik=e.topicId.toString());break;case "data":t.id="41",e.censusId&&(t.kegiatan=e.censusId),e.censusAreaId&&(t.wilayah_sensus=e.censusAreaId),e.datasetId&&(t.dataset=e.datasetId);break;default:t.id="37";break}let r=new URLSearchParams(t).toString(),i=`${p.CENSUS}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={id:e.id.toString(),domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.CENSUS}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Rt=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.name=r;this.itemId=i;this.itemCode=s;this.itemName=n;}toJson(){return {id:this.id,name:this.name,itemID:this.itemId,itemCode:this.itemCode,itemName:this.itemName}}toJSON(){return this.toJson()}static fromJson(t){return new o(String(t.id||""),String(t.name||""),String(t.itemID||""),String(t.itemCode||""),String(t.itemName||""))}};var tt=class o extends m{constructor(t,r,i){super();this.id=t;this.name=r;this.year=i;}toJson(){return {id:this.id,kegiatan:this.name,tahun_kegiatan:this.year}}toJSON(){return this.toJson()}static fromJson(t){return new o(String(t.id||""),String(t.kegiatan||""),Number(t.tahun_kegiatan||0))}};var bt=class o extends m{constructor(t,r,i,s){super();this.id=t;this.topic=r;this.eventId=i;this.eventName=s;}toJson(){return {id:this.id,topik:this.topic,id_kegiatan:this.eventId,kegiatan:this.eventName}}toJSON(){return this.toJson()}static fromJson(t){return new o(Number(t.id||0),String(t.topik||""),String(t.id_kegiatan||""),String(t.kegiatan||""))}};var ht=class o extends m{constructor(t,r,i,s){super();this.id=t;this.mfdCode=r;this.name=i;this.slug=s;}toJson(){return {id:this.id,kode_mfd:this.mfdCode,nama:this.name,slug:this.slug}}toJSON(){return this.toJson()}static fromJson(t){return new o(Number(t.id||0),String(t.kode_mfd||""),String(t.nama||""),String(t.slug||""))}};var St=class o extends m{constructor(t,r,i,s,n,c){super();this.id=t;this.topicId=r;this.topic=i;this.eventId=s;this.name=n;this.description=c;}toJson(){let t={id:this.id,id_topik:this.topicId,topik:this.topic,id_kegiatan:this.eventId,nama:this.name};return this.description!==void 0&&this.description!==null&&(t.deskripsi=this.description),t}toJSON(){return this.toJson()}static fromJson(t){return new o(Number(t.id||0),Number(t.id_topik||0),String(t.topik||""),Number(t.id_kegiatan||0),String(t.nama||""),t.deskripsi?String(t.deskripsi):null)}};var wt=class o extends m{constructor(t,r,i,s,n,c,u,l,d){super();this.regionId=t;this.regionCode=r;this.regionName=i;this.indicatorId=s;this.indicatorName=n;this.categories=c;this.period=u;this.value=l;this.regionLevel=d;}toJson(){let t={id_wilayah:this.regionId,kode_wilayah:this.regionCode,nama_wilayah:this.regionName,id_indikator:this.indicatorId,nama_indikator:this.indicatorName,categories:this.categories.map(r=>({id:r.id,name:r.name,item_id:r.itemId,item_code:r.itemCode,item_name:r.itemName})),period:this.period,nilai:this.value};return this.regionLevel!==void 0&&this.regionLevel!==null&&(t.level_wilayah=this.regionLevel),t}toJSON(){return this.toJson()}static fromJson(t){let r=[];for(let i=1;i<=5;i++){let s=String(t[`id_kategori_${i}`]||""),n=String(t[`nama_kategori_${i}`]||""),c=String(t[`id_item_kategori_${i}`]||""),u=String(t[`kode_item_kategori_${i}`]||""),l=String(t[`nama_item__kategori_${i}`]||"");!s||!n||!c||!u||!l||r.push(new Rt(s,n,c,u,l));}return new o(String(t.id_wilayah||""),String(t.kode_wilayah||""),String(t.nama_wilayah||""),String(t.id_indikator||""),String(t.nama_indikator||""),r,String(t.period||""),Number(t.nilai||0),t.level_wilayah?String(t.level_wilayah):null)}};var rt=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||r.data===null)return this.createEmptyListResult(e);if(!Array.isArray(r.data)||r.data.length<2)return this.createEmptyListResult(e);let i=r.data[0],s=r.data[1];if(s&&!Array.isArray(s)&&typeof s=="object"){let l=s;l.data&&Array.isArray(l.data)&&(s=l.data);}if(!s||!Array.isArray(s))return this.createEmptyListResult(e,i);let n=s.map(l=>this.parseEntity(l,e?.type)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return new f(n,new q(Number(i.page||1),u,Number(i.total||0),Number(i.pages||1),c))}catch(i){throw new a(`Failed to parse census: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{return tt.fromJson(r)}catch(i){throw new a(`Failed to parse census event: ${i instanceof Error?i.message:"Unknown error"}`)}})}parseEntity(e,t){switch(t){case "topics":return bt.fromJson(e);case "areas":return ht.fromJson(e);case "datasets":return St.fromJson(e);case "data":return wt.fromJson(e);case "events":default:return tt.fromJson(e)}}createEmptyListResult(e,t){return f.fromJson({data:[],pagination:{page:Number(t?.page||1),per_page:Number(t?.per_page||10),total:Number(t?.total||0),pages:Number(t?.pages||0),count:0}},r=>this.parseEntity(r,e?.type))}};function ri(o){let e=o??g(),t=new et(e.networkClient),r=new rt(t);return {fetchCensusList:i=>r.getAll(i)}}var it=class{constructor(e){this.client=e;}async get(e){let t={sumber:e.source.toString(),periode:e.period.toString(),kodehs:e.hsCode,jenishs:e.hsType.toString(),tahun:e.year},r=new URLSearchParams(t).toString(),i=`${p.TRADE}?${r}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ot=class{constructor(e){this.remoteDataSource=e;}get(e){return this.remoteDataSource.get(e)}};function ii(o){let e=o??g(),t=new it(e.networkClient),r=new ot(t);return {fetchTradeData:i=>r.get(i)}}function Pr(o){let e=new Ae(o.apiKey),r={networkClient:new Q({baseURL:o.baseURL??ee.BASE_URL,timeout:o.timeout??ee.DEFAULT_TIMEOUT,interceptors:[e,...o.interceptors??[]]}),config:o};return {...r,useDomains:()=>Or(r),usePublications:()=>Br(r),usePressReleases:()=>Gr(r),useStaticTables:()=>Jr(r),useDynamicTables:()=>$r(r),useInfographics:()=>Yr(r),useNews:()=>qr(r),useNewsCategories:()=>Mr(r),useVariables:()=>Wr(r),useVerticalVariables:()=>Kr(r),useDerivedVariables:()=>zr(r),useSubjects:()=>Hr(r),useSubjectCategories:()=>Zr(r),useUnits:()=>Xr(r),usePeriods:()=>Qr(r),useDerivedPeriods:()=>jr(r),useStrategicIndicators:()=>ei(r),useStatisticClassifications:()=>ti(r),useCensus:()=>ri(r),useTrade:()=>ii(r)}}var st=class o{constructor(){this._apiKey=null;}static getInstance(){return o.instance||(o.instance=new o),o.instance}setApiKey(e){this._apiKey=e;}getApiKey(){if(!this._apiKey)throw new Error("API key not set. Call setApiKey() first.");return this._apiKey}hasApiKey(){return this._apiKey!==null}clearApiKey(){this._apiKey=null;}};var Gt=class extends xt{constructor(t){super();this.repository=t;}async execute(t){return this.repository.getAll(t)}};var M=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ce(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ee(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Gt(r)});}static getAllDomainsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};M.REMOTE_DATA_SOURCE="DomainRemoteDataSource",M.REPOSITORY="DomainRepository",M.GET_ALL_USE_CASE="GetAllDomains";var Jt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var $t=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var I=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ie(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new ve(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Jt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new $t(r)});}static getAllPublicationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPublicationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};I.REMOTE_DATA_SOURCE="PublicationRemoteDataSource",I.REPOSITORY="PublicationRepository",I.GET_ALL_USE_CASE="GetAllPublications",I.GET_BY_ID_USE_CASE="GetPublicationById";var Yt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var qt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var v=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new De(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Le(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Yt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new qt(r)});}static getAllInfographicsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getInfographicByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};v.REMOTE_DATA_SOURCE="InfographicRemoteDataSource",v.REPOSITORY="InfographicRepository",v.GET_ALL_USE_CASE="GetAllInfographics",v.GET_BY_ID_USE_CASE="GetInfographicById";var Pt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var At=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var P=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new le(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new ce(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Pt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new At(r)});}static getAllNewsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};P.REMOTE_DATA_SOURCE="NewsRemoteDataSource",P.REPOSITORY="NewsRepository",P.GET_ALL_USE_CASE="GetAllNews",P.GET_BY_ID_USE_CASE="GetNewsById";var Mt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Wt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var _=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new ke(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new xe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Mt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Wt(r)});}static getAllNewsCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};_.REMOTE_DATA_SOURCE="NewsCategoryRemoteDataSource",_.REPOSITORY="NewsCategoryRepository",_.GET_ALL_USE_CASE="GetAllNewsCategories",_.GET_BY_ID_USE_CASE="GetNewsCategoryById";var Ct=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Et=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var A=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new re(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new ie(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ct(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Et(r)});}static getAllPressReleasesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPressReleaseByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};A.REMOTE_DATA_SOURCE="PressReleaseRemoteDataSource",A.REPOSITORY="PressReleaseRepository",A.GET_ALL_USE_CASE="GetAllPressReleases",A.GET_BY_ID_USE_CASE="GetPressReleaseById";var It=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var vt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var C=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new oe(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new se(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new It(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new vt(r)});}static getAllStaticTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStaticTableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};C.REMOTE_DATA_SOURCE="StaticTableRemoteDataSource",C.REPOSITORY="StaticTableRepository",C.GET_ALL_USE_CASE="GetAllStaticTables",C.GET_BY_ID_USE_CASE="GetStaticTableById";var Kt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var zt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var T=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ge(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Je(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Kt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new zt(r)});}static getAllSubjectsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};T.REMOTE_DATA_SOURCE="SubjectRemoteDataSource",T.REPOSITORY="SubjectRepository",T.GET_ALL_USE_CASE="GetAllSubjects",T.GET_BY_ID_USE_CASE="GetSubjectById";var Ht=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Zt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var D=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new $e(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ye(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ht(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Zt(r)});}static getAllSubjectCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};D.REMOTE_DATA_SOURCE="SubjectCategoryRemoteDataSource",D.REPOSITORY="SubjectCategoryRepository",D.GET_ALL_USE_CASE="GetAllSubjectCategories",D.GET_BY_ID_USE_CASE="GetSubjectCategoryById";var Xt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Qt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var L=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ze(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Xe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Xt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Qt(r)});}static getAllStrategicIndicatorsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStrategicIndicatorByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};L.REMOTE_DATA_SOURCE="StrategicIndicatorRemoteDataSource",L.REPOSITORY="StrategicIndicatorRepository",L.GET_ALL_USE_CASE="GetAllStrategicIndicators",L.GET_BY_ID_USE_CASE="GetStrategicIndicatorById";var jt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var er=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var k=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ue(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ve(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new jt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new er(r)});}static getAllVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};k.REMOTE_DATA_SOURCE="VariableRemoteDataSource",k.REPOSITORY="VariableRepository",k.GET_ALL_USE_CASE="GetAllVariables",k.GET_BY_ID_USE_CASE="GetVariableById";var tr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var rr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var x=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ne(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Fe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new tr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new rr(r)});}static getAllVerticalVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVerticalVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};x.REMOTE_DATA_SOURCE="VerticalVariableRemoteDataSource",x.REPOSITORY="VerticalVariableRepository",x.GET_ALL_USE_CASE="GetAllVerticalVariables",x.GET_BY_ID_USE_CASE="GetVerticalVariableById";var ir=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var or=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var U=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new qe(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Me(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ir(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new or(r)});}static getAllUnitsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getUnitByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};U.REMOTE_DATA_SOURCE="UnitRemoteDataSource",U.REPOSITORY="UnitRepository",U.GET_ALL_USE_CASE="GetAllUnits",U.GET_BY_ID_USE_CASE="GetUnitById";var sr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var ar=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var V=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new We(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ke(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new sr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ar(r)});}static getAllPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};V.REMOTE_DATA_SOURCE="PeriodRemoteDataSource",V.REPOSITORY="PeriodRepository",V.GET_ALL_USE_CASE="GetAllPeriods",V.GET_BY_ID_USE_CASE="GetPeriodById";var nr=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var lr=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var N=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new ze(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new He(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new nr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new lr(r)});}static getAllDerivedPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};N.REMOTE_DATA_SOURCE="DerivedPeriodRemoteDataSource",N.REPOSITORY="DerivedPeriodRepository",N.GET_ALL_USE_CASE="GetAllDerivedPeriods",N.GET_BY_ID_USE_CASE="GetDerivedPeriodById";var cr=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var ur=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var F=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Oe(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Be(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new cr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ur(r)});}static getAllDerivedVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};F.REMOTE_DATA_SOURCE="DerivedVariableRemoteDataSource",F.REPOSITORY="DerivedVariableRepository",F.GET_ALL_USE_CASE="GetAllDerivedVariables",F.GET_BY_ID_USE_CASE="GetDerivedVariableById";var mr=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var pr=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var O=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Qe(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new je(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new mr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new pr(r)});}static getAllStatisticClassificationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStatisticClassificationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};O.REMOTE_DATA_SOURCE="StatisticClassificationRemoteDataSource",O.REPOSITORY="StatisticClassificationRepository",O.GET_ALL_USE_CASE="GetAllStatisticClassifications",O.GET_BY_ID_USE_CASE="GetStatisticClassificationById";var dr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var gr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var b=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new et(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new rt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new dr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new gr(r)});}static getAllCensusesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getCensusByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};b.REMOTE_DATA_SOURCE="CensusRemoteDataSource",b.REPOSITORY="CensusRepository",b.GET_ALL_USE_CASE="GetAllCensuses",b.GET_BY_ID_USE_CASE="GetCensusById";var fr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var W=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new _e(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Te(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new fr(r)});}static getAllDynamicTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};W.REMOTE_DATA_SOURCE="DynamicTableRemoteDataSource",W.REPOSITORY="DynamicTableRepository",W.GET_ALL_USE_CASE="GetAllDynamicTables";var yr=class{constructor(e){this.injector=e;}async domains(e){return M.getAllDomainsUseCase(this.injector).execute(e)}async publications(e){return I.getAllPublicationsUseCase(this.injector).execute(e)}async infographics(e){return v.getAllInfographicsUseCase(this.injector).execute(e)}async news(e){return P.getAllNewsUseCase(this.injector).execute(e)}async newsCategories(e){return _.getAllNewsCategoriesUseCase(this.injector).execute(e)}async pressReleases(e){return A.getAllPressReleasesUseCase(this.injector).execute(e)}async staticTables(e){return C.getAllStaticTablesUseCase(this.injector).execute(e)}async subjects(e){return T.getAllSubjectsUseCase(this.injector).execute(e)}async subjectCategories(e){return D.getAllSubjectCategoriesUseCase(this.injector).execute(e)}async strategicIndicators(e){return L.getAllStrategicIndicatorsUseCase(this.injector).execute(e)}async variables(e){return k.getAllVariablesUseCase(this.injector).execute(e)}async verticalVariables(e){return x.getAllVerticalVariablesUseCase(this.injector).execute(e)}async units(e){return U.getAllUnitsUseCase(this.injector).execute(e)}async periods(e){return V.getAllPeriodsUseCase(this.injector).execute(e)}async derivedPeriods(e){return N.getAllDerivedPeriodsUseCase(this.injector).execute(e)}async derivedVariables(e){return F.getAllDerivedVariablesUseCase(this.injector).execute(e)}async statisticClassifications(e){return O.getAllStatisticClassificationsUseCase(this.injector).execute(e)}async censusEvents(){return b.getAllCensusesUseCase(this.injector).execute()}async censusTopics(e){return b.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"topics"})}async censusEventAreas(e){return b.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"areas"})}async censusEventDatasets(e){return b.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,topicId:e.topicId,type:"datasets"})}async censusData(e){return b.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,censusAreaId:e.censusAreaId,datasetId:e.datasetId,type:"data"})}async dynamicTables(e){return W.getAllDynamicTablesUseCase(this.injector).execute(e)}};var Rr=class{constructor(e){this.injector=e;}async publication(e){return I.getPublicationByIdUseCase(this.injector).execute(e)}async infographic(e){return v.getInfographicByIdUseCase(this.injector).execute(e)}async news(e){return P.getNewsByIdUseCase(this.injector).execute(e)}async newsCategory(e){return _.getNewsCategoryByIdUseCase(this.injector).execute(e)}async pressRelease(e){return A.getPressReleaseByIdUseCase(this.injector).execute(e)}async staticTable(e){return C.getStaticTableByIdUseCase(this.injector).execute(e)}async subject(e){return T.getSubjectByIdUseCase(this.injector).execute(e)}async subjectCategory(e){return D.getSubjectCategoryByIdUseCase(this.injector).execute(e)}async strategicIndicator(e){return L.getStrategicIndicatorByIdUseCase(this.injector).execute(e)}async variable(e){return k.getVariableByIdUseCase(this.injector).execute(e)}async verticalVariable(e){return x.getVerticalVariableByIdUseCase(this.injector).execute(e)}async unit(e){return U.getUnitByIdUseCase(this.injector).execute(e)}async period(e){return V.getPeriodByIdUseCase(this.injector).execute(e)}async derivedPeriod(e){return N.getDerivedPeriodByIdUseCase(this.injector).execute(e)}async derivedVariable(e){return F.getDerivedVariableByIdUseCase(this.injector).execute(e)}async statisticClassification(e){return O.getStatisticClassificationByIdUseCase(this.injector).execute(e)}async census(e){return b.getCensusByIdUseCase(this.injector).execute(e)}};var Er=class o extends m{constructor(t,r,i,s,n,c){super();this.value=t;this.netWeight=r;this.hsCode=i;this.port=s;this.country=n;this.year=c;}toJson(){return {value:this.value,netweight:this.netWeight,kodehs:this.hsCode,pod:this.port,ctr:this.country,tahun:this.year}}static fromJson(t){return new o(Number(t.value||0),Number(t.netweight||0),String(t.kodehs||""),String(t.pod||""),String(t.ctr||""),String(t.tahun||""))}};var br=class{constructor(e){this.repository=e;}execute(e){return this.repository.get(e)}};var we=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new it(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new ot(r)}),e.registerFactory(this.GET_TRADE_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new br(r)});}static getTradeUseCase(e){return e.resolve(this.GET_TRADE_USE_CASE)}};we.REMOTE_DATA_SOURCE="TradeRemoteDataSource",we.REPOSITORY="TradeRepository",we.GET_TRADE_USE_CASE="GetTrade";var h=class h{constructor(e){this.logger=Lt.getInstance(),this.logger.configure({enabled:e.debug??false,filter:new j(e.logLevel??1)}),st.getInstance().setApiKey(e.apiKey),this.authInterceptor=new Ae(e.apiKey);let t=[this.authInterceptor,...e.interceptors||[]];this.networkClient=new Q({baseURL:e.baseURL||ee.BASE_URL,timeout:e.timeout||ee.DEFAULT_TIMEOUT,interceptors:t}),this.injector=Ut.getInstance(),this.setupDependencies(),this._list=new yr(this.injector),this._view=new Rr(this.injector),this.logger.info("StadataJS initialized successfully");}static get instance(){if(!h._instance)throw new Error("StadataJS not initialized. Call StadataJS.init() first.");return h._instance}static init(e){return h._instance&&h._instance.logger.warn("StadataJS already initialized. Reinitializing..."),h._instance=new h(e),h._instance}static isInitialized(){return h._instance!==null}static destroy(){h._instance&&(h._instance.cleanup(),h._instance=null);}get list(){return this._list}get view(){return this._view}setApiKey(e){st.getInstance().setApiKey(e),this.authInterceptor.setApiKey(e),this.logger.info("API key updated");}addInterceptor(e){this.networkClient.addInterceptor(e),this.logger.debug("Interceptor added");}removeInterceptor(e){this.networkClient.removeInterceptor(e),this.logger.debug("Interceptor removed");}enableDebug(){this.logger.enable(),this.logger.configure({filter:new j(0)});}disableDebug(){this.logger.configure({filter:new j(1)});}async trade(e){return this.injector.resolve("GetTrade").execute(e)}setupDependencies(){M.register(this.injector,this.networkClient),I.register(this.injector,this.networkClient),v.register(this.injector,this.networkClient),P.register(this.injector,this.networkClient),_.register(this.injector,this.networkClient),A.register(this.injector,this.networkClient),C.register(this.injector,this.networkClient),T.register(this.injector,this.networkClient),D.register(this.injector,this.networkClient),L.register(this.injector,this.networkClient),k.register(this.injector,this.networkClient),x.register(this.injector,this.networkClient),U.register(this.injector,this.networkClient),V.register(this.injector,this.networkClient),N.register(this.injector,this.networkClient),F.register(this.injector,this.networkClient),O.register(this.injector,this.networkClient),b.register(this.injector,this.networkClient),W.register(this.injector,this.networkClient),we.register(this.injector,this.networkClient);}cleanup(){this.injector.clear(),st.getInstance().clearApiKey(),this.logger.info("StadataJS cleaned up");}};h._instance=null;var Ir=h;var di=(t=>(t[t.Export=1]="Export",t[t.Import=2]="Import",t))(di||{}),gi=(t=>(t[t.Monthly=1]="Monthly",t[t.Annually=2]="Annually",t))(gi||{}),fi=(t=>(t[t.TwoDigit=1]="TwoDigit",t[t.Full=2]="Full",t))(fi||{});
2
- exports.ApiConstant=ee;exports.ApiEndpoint=p;exports.ApiFailure=$;exports.CancelToken=Cr;exports.CancelledFailure=at;exports.CensusArea=ht;exports.CensusCategory=Rt;exports.CensusData=wt;exports.CensusDataset=St;exports.CensusEvent=tt;exports.CensusTopic=bt;exports.ClassificationType=Ur;exports.DataAvailability=xr;exports.DataLanguage=kr;exports.DerivedPeriod=be;exports.DerivedVariable=de;exports.Domain=gt;exports.DomainType=Fr;exports.DynamicTable=yt;exports.ForbiddenFailure=mt;exports.HSCodeType=fi;exports.Infographic=ne;exports.KBKILevel=Nr;exports.KBLILevel=Vr;exports.ListResult=f;exports.LogLevel=kt;exports.NetworkClient=Q;exports.NetworkFailure=nt;exports.News=Z;exports.NewsCategory=ue;exports.NotFoundFailure=ct;exports.Pagination=q;exports.ParseFailure=a;exports.Period=Re;exports.PressRelease=z;exports.Publication=te;exports.RelatedPublication=ft;exports.ServerFailure=pt;exports.StadataJS=Ir;exports.StaticTable=H;exports.StatisticClassification=Se;exports.StrategicIndicator=he;exports.Subject=ge;exports.SubjectCategory=fe;exports.TimeoutFailure=lt;exports.Trade=Er;exports.TradePeriod=gi;exports.TradeSource=di;exports.UnauthorizedFailure=ut;exports.Unit=ye;exports.ValidationFailure=Sr;exports.Variable=me;exports.VerticalVariable=pe;exports.createStadataClient=Pr;exports.getGlobalClient=g;exports.initStadata=mi;exports.resetGlobalClient=pi;exports.useCensus=ri;exports.useDerivedPeriods=jr;exports.useDerivedVariables=zr;exports.useDomains=Or;exports.useDynamicTables=$r;exports.useInfographics=Yr;exports.useNews=qr;exports.useNewsCategories=Mr;exports.usePeriods=Qr;exports.usePressReleases=Gr;exports.usePublications=Br;exports.useStaticTables=Jr;exports.useStatisticClassifications=ti;exports.useStrategicIndicators=ei;exports.useSubjectCategories=Zr;exports.useSubjects=Hr;exports.useTrade=ii;exports.useUnits=Xr;exports.useVariables=Wr;exports.useVerticalVariables=Kr;return exports;})({});//# sourceMappingURL=index.global.js.map
1
+ var StadataJS=(function(exports){'use strict';var ni={withStackTrace:false},Tr=(o,e,t=ni)=>{let r=e.isOk()?{type:"Ok",value:e.value}:{type:"Err",value:e.error},i=t.withStackTrace?new Error().stack:void 0;return {data:r,message:o,stack:i}};function X(o,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s);})}return new(t||(t=Promise))(function(s,n){function l(d){try{c(r.next(d));}catch(R){n(R);}}function u(d){try{c(r.throw(d));}catch(R){n(R);}}function c(d){d.done?s(d.value):i(d.value).then(l,u);}c((r=r.apply(o,[])).next());})}function _r(o){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&o[e],r=0;if(t)return t.call(o);if(o&&typeof o.length=="number")return {next:function(){return o&&r>=o.length&&(o=void 0),{value:o&&o[r++],done:!o}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function G(o){return this instanceof G?(this.v=o,this):new G(o)}function Dr(o,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(o,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",n),i[Symbol.asyncIterator]=function(){return this},i;function n(y){return function(B){return Promise.resolve(B).then(y,R)}}function l(y,B){r[y]&&(i[y]=function(_t){return new Promise(function(si,ai){s.push([y,_t,si,ai])>1||u(y,_t);})},B&&(i[y]=B(i[y])));}function u(y,B){try{c(r[y](B));}catch(_t){Pe(s[0][3],_t);}}function c(y){y.value instanceof G?Promise.resolve(y.value.v).then(d,R):Pe(s[0][2],y);}function d(y){u("next",y);}function R(y){u("throw",y);}function Pe(y,B){y(B),s.shift(),s.length&&u(s[0][0],s[0][1]);}}function li(o){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=o[i]?function(n){return (t=!t)?{value:G(o[i](n)),done:false}:s?s(n):n}:s;}}function ci(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=o[Symbol.asyncIterator],t;return e?e.call(o):(o=typeof _r=="function"?_r(o):o[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=o[s]&&function(n){return new Promise(function(l,u){n=o[s](n),i(l,u,n.done,n.value);})};}function i(s,n,l,u){Promise.resolve(u).then(function(c){s({value:c,done:l});},n);}}var Y=class o{constructor(e){this._promise=e;}static fromSafePromise(e){let t=e.then(r=>new E(r));return new o(t)}static fromPromise(e,t){let r=e.then(i=>new E(i)).catch(i=>new S(t(i)));return new o(r)}static fromThrowable(e,t){return (...r)=>new o(X(this,void 0,void 0,function*(){try{return new E(yield e(...r))}catch(i){return new S(t?t(i):i)}}))}static combine(e){return ui(e)}static combineWithAllErrors(e){return mi(e)}map(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){return t.isErr()?new S(t.error):new E(yield e(t.value))})))}andThrough(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){if(t.isErr())return new S(t.error);let r=yield e(t.value);return r.isErr()?new S(r.error):new E(t.value)})))}andTee(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){if(t.isErr())return new S(t.error);try{yield e(t.value);}catch{}return new E(t.value)})))}orTee(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){if(t.isOk())return new E(t.value);try{yield e(t.error);}catch{}return new S(t.error)})))}mapErr(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){return t.isOk()?new E(t.value):new S(yield e(t.error))})))}andThen(e){return new o(this._promise.then(t=>{if(t.isErr())return new S(t.error);let r=e(t.value);return r instanceof o?r._promise:r}))}orElse(e){return new o(this._promise.then(t=>X(this,void 0,void 0,function*(){return t.isErr()?e(t.error):new E(t.value)})))}match(e,t){return this._promise.then(r=>r.match(e,t))}unwrapOr(e){return this._promise.then(t=>t.unwrapOr(e))}safeUnwrap(){return Dr(this,arguments,function*(){return yield G(yield G(yield*li(ci(yield G(this._promise.then(t=>t.safeUnwrap()))))))})}then(e,t){return this._promise.then(e,t)}[Symbol.asyncIterator](){return Dr(this,arguments,function*(){let t=yield G(this._promise);return t.isErr()&&(yield yield G(Dt(t.error))),yield G(t.value)})}};function Dt(o){return new Y(Promise.resolve(new S(o)))}var Lr=o=>{let e=J([]);for(let t of o)if(t.isErr()){e=w(t.error);break}else e.map(r=>r.push(t.value));return e},ui=o=>Y.fromSafePromise(Promise.all(o)).andThen(Lr),kr=o=>{let e=J([]);for(let t of o)t.isErr()&&e.isErr()?e.error.push(t.error):t.isErr()&&e.isOk()?e=w([t.error]):t.isOk()&&e.isOk()&&e.value.push(t.value);return e},mi=o=>Y.fromSafePromise(Promise.all(o)).andThen(kr),hr;(function(o){function e(i,s){return (...n)=>{try{let l=i(...n);return J(l)}catch(l){return w(s?s(l):l)}}}o.fromThrowable=e;function t(i){return Lr(i)}o.combine=t;function r(i){return kr(i)}o.combineWithAllErrors=r;})(hr||(hr={}));function J(o){return new E(o)}function w(o){return new S(o)}var E=class{constructor(e){this.value=e;}isOk(){return true}isErr(){return !this.isOk()}map(e){return J(e(this.value))}mapErr(e){return J(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map(t=>this.value)}andTee(e){try{e(this.value);}catch{}return J(this.value)}orTee(e){return J(this.value)}orElse(e){return J(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map(()=>this.value)}asyncMap(e){return Y.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}safeUnwrap(){let e=this.value;return (function*(){return e})()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw Tr("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}},S=class{constructor(e){this.error=e;}isOk(){return false}isErr(){return !this.isOk()}map(e){return w(this.error)}mapErr(e){return w(e(this.error))}andThrough(e){return w(this.error)}andTee(e){return w(this.error)}orTee(e){try{e(this.error);}catch{}return w(this.error)}andThen(e){return w(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return Dt(this.error)}asyncAndThrough(e){return Dt(this.error)}asyncMap(e){return Dt(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}safeUnwrap(){let e=this.error;return (function*(){throw yield w(e),new Error("Do not use this generator out of `safeTry`")})()}_unsafeUnwrap(e){throw Tr("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){let e=this;return yield e,e}};hr.fromThrowable;var K=class o{constructor(e,t){this.message=e;this.code=t;}toString(){return `${this.constructor.name}: ${this.message}${this.code?` (${this.code})`:""}`}equals(e){return e instanceof o?this.message===e.message&&this.code===e.code&&this.constructor.name===e.constructor.name:false}},$=class extends K{constructor(t,r,i){super(t,i);this.statusCode=r;}},at=class extends K{constructor(e="Request was cancelled"){super(e,"CANCELLED");}},nt=class extends K{constructor(e){super(e,"NETWORK_ERROR");}},lt=class extends K{constructor(e="Request timeout"){super(e,"TIMEOUT");}},ct=class extends ${constructor(e="Resource not found"){super(e,404,"NOT_FOUND");}},ut=class extends ${constructor(e="Unauthorized"){super(e,401,"UNAUTHORIZED");}},mt=class extends ${constructor(e="Forbidden"){super(e,403,"FORBIDDEN");}},pt=class extends ${constructor(e="Server error",t=500){super(e,t,"SERVER_ERROR");}},a=class extends K{constructor(e){super(e,"PARSE_ERROR");}},Sr=class extends K{constructor(e){super(e,"VALIDATION_ERROR");}};var Q=class{constructor(e={}){this.baseURL=e.baseURL||"",this.timeout=e.timeout||3e4,this.defaultHeaders={"Content-Type":"application/json",...e.headers},this.interceptors=e.interceptors||[];}addInterceptor(e){this.interceptors.push(e);}removeInterceptor(e){let t=this.interceptors.indexOf(e);t!==-1&&this.interceptors.splice(t,1);}async get(e,t){return this.request("GET",e,t)}async post(e,t){return this.request("POST",e,t)}async put(e,t){return this.request("PUT",e,t)}async delete(e,t){return this.request("DELETE",e,t)}async patch(e,t){return this.request("PATCH",e,t)}async request(e,t,r={}){try{let i=this.buildUrl(t),s={};e!=="GET"?Object.assign(s,this.defaultHeaders):Object.entries(this.defaultHeaders).forEach(([d,R])=>{d.toLowerCase()!=="content-type"&&(s[d]=R);}),Object.assign(s,r.headers);let n={method:e,headers:s};e!=="GET"&&r.body&&(n.body=JSON.stringify(r.body)),r.cancelToken&&(n.signal=r.cancelToken.signal);for(let d of this.interceptors)if(d.onRequest){let R=await d.onRequest(i,n);i=R.url,n=R.init;}let u=await this.fetchWithTimeout(i,n,r.timeout||this.timeout);for(let d of this.interceptors)d.onResponse&&(u=await d.onResponse(u));if(!u.ok)return w(await this.handleErrorResponse(u));let c=await u.json();return J(c)}catch(i){return w(await this.handleError(i,r.cancelToken))}}async fetchWithTimeout(e,t,r){let i=new AbortController,s=setTimeout(()=>i.abort(),r);try{let n=t.signal&&t.signal instanceof AbortSignal?this.combineSignals(t.signal,i.signal):i.signal;return await fetch(e,{...t,signal:n})}finally{clearTimeout(s);}}combineSignals(e,t){let r=new AbortController,i=()=>r.abort();return e.addEventListener("abort",i),t.addEventListener("abort",i),r.signal}buildUrl(e){return e.startsWith("http://")||e.startsWith("https://")?e:`${this.baseURL}${e}`}async handleErrorResponse(e){let{status:t}=e,r;try{let i=await e.json();r=i.message||i.error||e.statusText;}catch{r=e.statusText;}switch(t){case 401:return new ut(r);case 403:return new mt(r);case 404:return new ct(r);case 500:case 502:case 503:case 504:return new pt(r,t);default:return new $(r,t)}}async handleError(e,t){let r=e instanceof Error?e:new Error(String(e));for(let i of this.interceptors)if(i.onError){let s=await i.onError(r);s&&(r=s);}return t?.isCancelled||e.name==="AbortError"?new at(t?.reason):r.name==="AbortError"||r.message.includes("timeout")||r.message.includes("aborted")?new lt:r.message.includes("network")||r.message.includes("fetch")||r.message.includes("ECONNREFUSED")?new nt(r.message):new $(r.message)}};var Tt=class{};var Ae=class extends Tt{constructor(t){super();this.apiKey=t;}onRequest(t,r){let i=new URL(t);return i.searchParams.set("key",this.apiKey),{url:i.toString(),init:r}}setApiKey(t){this.apiKey=t;}getApiKey(){return this.apiKey}};var kt=(n=>(n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n[n.FATAL=4]="FATAL",n[n.NONE=5]="NONE",n))(kt||{}),wr=class{print(e){let t=kt[e.level],i=`[${e.timestamp.toISOString()}] [${t}] ${e.message}`;switch(e.level){case 0:console.debug(i,e.data);break;case 1:console.info(i,e.data);break;case 2:console.warn(i,e.data);break;case 3:case 4:console.error(i,e.error||e.data);break}}},j=class{constructor(e=1){this.minLevel=e;}shouldLog(e){return e.level>=this.minLevel}},Lt=class o{constructor(e=new wr,t=new j){this.enabled=true;this.printer=e,this.filter=t;}static getInstance(){return o.instance||(o.instance=new o),o.instance}configure(e){e.printer&&(this.printer=e.printer),e.filter&&(this.filter=e.filter),e.enabled!==void 0&&(this.enabled=e.enabled);}debug(e,t){this.log(0,e,t);}info(e,t){this.log(1,e,t);}warn(e,t){this.log(2,e,t);}error(e,t){let r=t instanceof Error?t:void 0,i=t instanceof Error?void 0:t;this.log(3,e,i,r);}fatal(e,t){let r=t instanceof Error?t:void 0,i=t instanceof Error?void 0:t;this.log(4,e,i,r);}log(e,t,r,i){if(!this.enabled)return;let s={level:e,message:t,timestamp:new Date,data:r,error:i};this.filter.shouldLog(s)&&this.printer.print(s);}enable(){this.enabled=true;}disable(){this.enabled=false;}};var ee={BASE_URL:"https://webapi.bps.go.id/v1/api",DEFAULT_TIMEOUT:3e4,API_VERSION:"v1",DEFAULT_PAGE_SIZE:10,MAX_PAGE_SIZE:100};var xr=(t=>(t.ID="ind",t.EN="eng",t))(xr||{});var Ur=(r=>(r.AVAILABLE="available",r.NOT_AVAILABLE="not-available",r.LIST_NOT_AVAILABLE="list-not-available",r))(Ur||{});var Vr=(s=>(s.KBLI_2009="kbli2009",s.KBLI_2015="kbli2015",s.KBLI_2017="kbli2017",s.KBLI_2020="kbli2020",s.KBKI_2015="kbki2015",s))(Vr||{}),Nr=(s=>(s.CATEGORY="kategori",s.PRIMARY_GROUP="golongan pokok",s.GROUP="golongan",s.SUB_GROUP="subgolongan",s.CLUSTER="kelompok",s))(Nr||{}),Fr=(l=>(l.SECTION="seksi",l.DIVISION="divisi",l.GROUP="kelompok",l.CLASSES="kelas",l.SUB_CLASS="subkelas",l.COMMODITY_GROUP="kelompok komoditas",l.COMMODITY="komoditas",l))(Fr||{});var Or=(i=>(i.ALL="all",i.PROVINCE="prov",i.REGENCY="kab",i.REGENCY_BY_PROVINCE="kabbyprov",i))(Or||{});var p={DOMAIN_LIST:"/domain",PUBLICATION_LIST:"/list/model/publication",PUBLICATION_VIEW:"/view/model/publication",INFOGRAPHIC_LIST:"/list/model/infographic",INFOGRAPHIC_VIEW:"/view/model/infographic",STATIC_TABLE_LIST:"/list/model/statictable",STATIC_TABLE_VIEW:"/view/model/statictable",NEWS_LIST:"/list/model/news",NEWS_VIEW:"/view/model/news",NEWS_CATEGORY_LIST:"/list/model/newscategory",NEWS_CATEGORY_VIEW:"/view/model/newscategory",PRESS_RELEASE_LIST:"/list/model/pressrelease",PRESS_RELEASE_VIEW:"/view/model/pressrelease",SUBJECT_LIST:"/list/model/subject",SUBJECT_VIEW:"/view/model/subject",SUBJECT_CATEGORY_LIST:"/list/model/subcat",SUBJECT_CATEGORY_VIEW:"/view/model/subcat",STRATEGIC_INDICATOR_LIST:"/list/model/indicators",STRATEGIC_INDICATOR_VIEW:"/view/model/indicators",VARIABLE_LIST:"/list/model/var",VARIABLE_VIEW:"/view/model/var",VERTICAL_VARIABLE_LIST:"/list/model/vervar",VERTICAL_VARIABLE_VIEW:"/view/model/vervar",UNIT_LIST:"/list/model/unit",UNIT_VIEW:"/view/model/unit",PERIOD_LIST:"/list/model/th",PERIOD_VIEW:"/view/model/th",DERIVED_PERIOD_LIST:"/list/model/turth",DERIVED_PERIOD_VIEW:"/view/model/turth",DERIVED_VARIABLE_LIST:"/list/model/turvar",DERIVED_VARIABLE_VIEW:"/view/model/turvar",DYNAMIC_TABLE_LIST:"/list/model/data",statisticClassification:(o="kbli2020")=>`/view/model/${o}`,CENSUS:"/interoperabilitas/datasource/sensus",TRADE:"/dataexim"};var dt=null;function pi(o){return dt=Pr(o),dt}function g(){if(!dt)throw new Error('[stadata-js] Client not initialized. Call initStadata({ apiKey: "..." }) before using composables.');return dt}function di(){dt=null;}var Ce=class{constructor(e){this.client=e;}async getAll(e){let t={type:e.type};e.provinceCode&&(t.prov=e.provinceCode),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.perPage&&(t.per_page=e.perPage.toString()),e.keyword&&(t.keyword=e.keyword);let r=new URLSearchParams(t).toString(),i=`${p.DOMAIN_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var m=class o{toString(){return JSON.stringify(this.toJson(),null,2)}equals(e){return e instanceof o?JSON.stringify(this.toJson())===JSON.stringify(e.toJson()):false}copyWith(e){let r={...this.toJson(),...e};return Object.assign(Object.create(Object.getPrototypeOf(this)),r)}};var xt=class{};var gt=class o extends m{constructor(t,r,i){super();this.id=t;this.name=r;this.url=i;}toJson(){return {domain_id:this.id,domain_name:this.name,domain_url:this.url}}static fromJson(t){return new o(t.domain_id||t.id||"",t.domain_name||t.name||"",t.domain_url||t.url||"")}};var q=class o extends m{constructor(t,r,i,s,n){super();this.page=t;this.perPage=r;this.total=i;this.pages=s;this.count=n;}get hasNextPage(){return this.page<this.pages}get hasPreviousPage(){return this.page>1}get nextPage(){return this.hasNextPage?this.page+1:null}get previousPage(){return this.hasPreviousPage?this.page-1:null}toJson(){return {page:this.page,per_page:this.perPage,total:this.total,pages:this.pages,count:this.count}}static fromJson(t){return new o(t.page||1,t.per_page||10,t.total||0,t.pages||0,t.count||0)}};var f=class o extends m{constructor(t,r){super();this.data=t;this.pagination=r;}get hasMore(){return this.pagination.hasNextPage}get totalItems(){return this.pagination.total}get items(){return this.data}get itemCount(){return this.data.length}toJson(){return {data:this.data,pagination:this.pagination.toJson()}}static fromJson(t,r){let s=(t.data||[]).map(u=>r(u)),n=t.pagination,l=q.fromJson(n);return new o(s,l)}};var Ee=class{constructor(e){this.remoteDataSource=e;}async getAll(e){if(!e)throw new a("Domain list params are required");return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(d=>gt.fromJson(d)),l=Number(i.count)||s.length,u=Number(i.per_page)||l,c=new q(Number(i.page||1),u,Number(i.total||0),Number(i.pages||1),l);return new f(n,c)}catch(i){throw new a(`Failed to parse domain data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Br(o){let e=o??g(),t=new Ce(e.networkClient),r=new Ee(t);return {fetchDomainList:i=>r.getAll(i)}}var Ie=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.keyword&&(t.keyword=e.keyword),e.month&&(t.month=e.month.toString()),e.year&&(t.year=e.year.toString());let r=new URLSearchParams(t).toString(),i=`${p.PUBLICATION_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.PUBLICATION_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ft=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.title=r;this.releaseDate=i;this.url=s;this.cover=n;}toJson(){return {id:this.id,title:this.title,rl_date:this.releaseDate.toISOString().split("T")[0],url:this.url,cover:this.cover}}static fromJson(t){return new o(String(t.id||""),String(t.title||""),new Date(String(t.rl_date||t.release_date||t.releaseDate||"")),String(t.url||""),String(t.cover||""))}};var te=class o extends m{constructor(t,r,i,s,n,l,u,c,d,R,Pe,y,B){super();this.id=t;this.title=r;this.issn=i;this.cover=s;this.pdf=n;this.size=l;this.scheduledDate=u;this.releaseDate=c;this.updateDate=d;this.abstract=R;this.catalogueNumber=Pe;this.publicationNumber=y;this.relatedPublications=B;}toJson(){return {id:this.id,title:this.title,issn:this.issn,cover:this.cover,pdf:this.pdf,size:this.size,scheduled_date:this.scheduledDate?.toISOString().split("T")[0]||null,rl_date:this.releaseDate?.toISOString().split("T")[0]||null,updt_date:this.updateDate?.toISOString().split("T")[0]||null,abstract:this.abstract,catalogue_number:this.catalogueNumber,publication_number:this.publicationNumber,related_publications:this.relatedPublications.map(t=>t.toJson())}}static fromJson(t){let r=t.related_publications||t.relatedPublications,i=Array.isArray(r)?r.map(s=>ft.fromJson(s)):[];return new o(String(t.id||""),String(t.title||""),String(t.issn||""),String(t.cover||""),String(t.pdf||""),String(t.size||""),t.scheduled_date||t.scheduledDate?new Date(String(t.scheduled_date||t.scheduledDate)):null,t.rl_date||t.release_date||t.releaseDate?new Date(String(t.rl_date||t.release_date||t.releaseDate)):null,t.updt_date||t.update_date||t.updateDate?new Date(String(t.updt_date||t.update_date||t.updateDate)):null,t.abstract?String(t.abstract):null,t.catalogue_number||t.catalogueNumber?String(t.catalogue_number||t.catalogueNumber):null,t.publication_number||t.publicationNumber?String(t.publication_number||t.publicationNumber):null,i)}};var ve=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>te.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>te.fromJson(c))}catch(i){throw new a(`Failed to parse publications: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Publication not found");let i=r.data[0];if(!i)throw new a("Publication data is empty");return te.fromJson(i)}catch(i){throw new a(`Failed to parse publication data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Gr(o){let e=o??g(),t=new Ie(e.networkClient),r=new ve(t);return {fetchPublicationList:i=>r.getAll(i),fetchPublicationDetail:i=>r.getById(i)}}var re=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.keyword&&(t.keyword=e.keyword),e.month&&(t.month=e.month.toString()),e.year&&(t.year=e.year.toString());let r=new URLSearchParams(t).toString(),i=`${p.PRESS_RELEASE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.PRESS_RELEASE_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Ut=class o{constructor(){this.container=new Map;this.factories=new Map;}static getInstance(){return o.instance||(o.instance=new o),o.instance}register(e,t){this.container.set(e,t);}registerFactory(e,t){this.factories.set(e,t);}resolve(e){if(this.container.has(e))return this.container.get(e);if(this.factories.has(e)){let t=this.factories.get(e);if(t){let r=t();return this.container.set(e,r),r}}throw new Error(`Dependency not found: ${e}`)}has(e){return this.container.has(e)||this.factories.has(e)}clear(){this.container.clear(),this.factories.clear();}remove(e){this.container.delete(e),this.factories.delete(e);}};var Ar=class o extends Error{constructor(e){super(e),this.name="StadataException",Object.setPrototypeOf(this,o.prototype);}};var Vt=class o extends Ar{constructor(e="Request was cancelled"){super(e),this.name="CancelledException",Object.setPrototypeOf(this,o.prototype);}};var Cr=class o{constructor(){this._isCancelled=false;this.abortController=new AbortController;}get signal(){return this.abortController.signal}get isCancelled(){return this._isCancelled}get reason(){return this._reason}cancel(e){this._isCancelled||(this._isCancelled=true,this._reason=e,this.abortController.abort());}throwIfCancelled(){if(this._isCancelled)throw new Vt(this._reason||"Request was cancelled")}static create(){return new o}static source(){let e=new o;return {token:e,cancel:t=>e.cancel(t)}}};var z=class o extends m{constructor(t,r,i,s,n,l,u,c,d,R,Pe){super();this.id=t;this.subjectId=r;this.subject=i;this.title=s;this.abstract=n;this.releaseDate=l;this.updatedDate=u;this.pdf=c;this.size=d;this.slide=R;this.thumbnail=Pe;}toJson(){return {brs_id:this.id,subj_id:this.subjectId,subj:this.subject,title:this.title,abstract:this.abstract,rl_date:this.releaseDate,updt_date:this.updatedDate,pdf:this.pdf,size:this.size,slide:this.slide,thumbnail:this.thumbnail}}static fromJson(t){return new o(Number(t.brs_id||t.id||0),Number(t.subj_id||t.subjectId||0),String(t.subj||t.subject||""),String(t.title||""),String(t.abstract||""),String(t.rl_date||t.releaseDate||""),t.updt_date?String(t.updt_date):null,String(t.pdf||""),String(t.size||""),String(t.slide||""),String(t.thumbnail||""))}};var ie=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>z.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>z.fromJson(c))}catch(i){throw new a(`Failed to parse press releases: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Press release not found");let i=r.data[0];if(!i)throw new a("Press release data is empty");return z.fromJson(i)}catch(i){throw new a(`Failed to parse press release data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Jr(o){let e=o??g(),t=new re(e.networkClient),r=new ie(t);return {fetchPressReleaseList:i=>r.getAll(i),fetchPressReleaseDetail:i=>r.getById(i)}}var oe=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.keyword&&(t.keyword=e.keyword),e.month&&(t.month=e.month.toString()),e.year&&(t.year=e.year.toString());let r=new URLSearchParams(t).toString(),i=`${p.STATIC_TABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.STATIC_TABLE_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var H=class o extends m{constructor(t,r,i,s,n,l){super();this.id=t;this.title=r;this.subjectId=i;this.size=s;this.updatedAt=n;this.excelUrl=l;}toJson(){return {table_id:this.id,title:this.title,subj_id:this.subjectId,size:this.size,updt_date:this.updatedAt,excel:this.excelUrl}}static fromJson(t){return new o(String(t.table_id||t.id||""),String(t.title||""),Number(t.subj_id||t.subjectId||0),String(t.size||""),String(t.updt_date||t.updatedAt||""),String(t.excel||t.excelUrl||""))}};var se=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>H.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>H.fromJson(c))}catch(i){throw new a(`Failed to parse static tables: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Static table not found");let i=r.data[0];if(!i)throw new a("Static table data is empty");return H.fromJson(i)}catch(i){throw new a(`Failed to parse static table data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function $r(o){let e=o??g(),t=new oe(e.networkClient),r=new se(t);return {fetchStaticTableList:i=>r.getAll(i),fetchStaticTableDetail:i=>r.getById(i)}}var _e=class{constructor(e){this.client=e;}async getAll(e){let t={domain:e.domain||"",var:e.variableId.toString(),th:e.periodId.toString()};e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.verticalVariableId!==void 0&&(t.vervar=e.verticalVariableId.toString()),e.derivedVariableId!==void 0&&(t.turvar=e.derivedVariableId.toString()),e.derivedPeriodId!==void 0&&(t.turth=e.derivedPeriodId.toString());let r=new URLSearchParams(t).toString(),i=`${p.DYNAMIC_TABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Nt=class o extends m{constructor(t,r,i,s,n,l,u){super();this.value=t;this.label=r;this.unit=i;this.subject=s;this.definition=n;this.notes=l;this.decimal=u;}toJson(){return {val:this.value,label:this.label,unit:this.unit,subj:this.subject,def:this.definition,note:this.notes,...this.decimal!==void 0&&{decimal:this.decimal}}}static fromJson(t){return new o(Number(t.val||0),String(t.label||""),String(t.unit||""),String(t.subj||""),String(t.def||""),String(t.note||""),t.decimal!==void 0?Number(t.decimal):void 0)}},ae=class o extends m{constructor(t,r){super();this.value=t;this.label=r;}toJson(){return {val:this.value,label:this.label}}static fromJson(t){let r=t.val;return new o(typeof r=="number"?r:String(r||""),String(t.label||""))}},Ft=class o extends ae{static fromJson(e){let t=e.val;return new o(typeof t=="number"?t:String(t||""),String(e.label||""))}},Ot=class o extends m{constructor(t,r){super();this.value=t;this.label=r;}toJson(){return {val:this.value,label:this.label}}static fromJson(t){return new o(Number(t.val||0),String(t.label||""))}},Bt=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.title=r;this.tableSource=i;this.lastUpdate=s;this.link=n;}toJson(){return {id:this.id,title:this.title,tablesource:this.tableSource,last_update:this.lastUpdate,link:this.link}}static fromJson(t){return new o(String(t.id||""),String(t.title||""),Number(t.tablesource||0),t.last_update!==null?String(t.last_update||""):null,String(t.link||""))}};var yt=class o extends m{constructor(t,r,i,s,n,l,u,c,d,R){super();this.subjects=t;this.variables=r;this.verticalVariables=i;this.verticalVariableLabel=s;this.periods=n;this.derivedVariables=l;this.derivedPeriods=u;this.dataContent=c;this.related=d;this.lastUpdate=R;}toJson(){return {subject:this.subjects.map(t=>t.toJson()),var:this.variables.map(t=>t.toJson()),vervar:this.verticalVariables.map(t=>t.toJson()),labelvervar:this.verticalVariableLabel,tahun:this.periods.map(t=>t.toJson()),turvar:this.derivedVariables.map(t=>t.toJson()),turtahun:this.derivedPeriods.map(t=>t.toJson()),datacontent:this.dataContent,related:this.related.map(t=>t.toJson()),last_update:this.lastUpdate}}static fromJson(t){let r=Array.isArray(t.subject)?t.subject:[],i=Array.isArray(t.var)?t.var:[],s=Array.isArray(t.vervar)?t.vervar:[],n=Array.isArray(t.tahun)?t.tahun:[],l=Array.isArray(t.turvar)?t.turvar:[],u=Array.isArray(t.turtahun)?t.turtahun:[],c=Array.isArray(t.related)?t.related:[];return new o(r.map(d=>Ot.fromJson(d)),i.map(d=>Nt.fromJson(d)),s.map(d=>ae.fromJson(d)),String(t.labelvervar||""),n.map(d=>Ft.fromJson(d)),l.map(d=>ae.fromJson(d)),u.map(d=>ae.fromJson(d)),t.datacontent||{},c.map(d=>Bt.fromJson(d)),t.last_update!==void 0?t.last_update:void 0)}getDataValue(t,r,i,s,n){let l=`${t}${r}${i}${s}${n}`;return this.dataContent[l]}toStructuredData(){let t=this.subjects[0],r=this.variables[0],i=r?.value||0,s=this.derivedVariables.length>1||this.derivedVariables[0]?.value!==0&&this.derivedVariables[0]?.value!=="0",n=this.derivedPeriods.length>1||this.derivedPeriods[0]?.value!==0&&this.derivedPeriods[0]?.value!=="0",l=this.verticalVariables.map(u=>s?{id:u.value,label:u.label,data:this.derivedVariables.map(c=>({id:c.value,label:c.label,data:this.periods.map(d=>n?{id:d.value,label:d.label,data:this.derivedPeriods.map(R=>({id:R.value,label:R.label,value:this.getDataValue(u.value,i,c.value,d.value,R.value)??null}))}:{id:d.value,label:d.label,value:this.getDataValue(u.value,i,c.value,d.value,this.derivedPeriods[0]?.value||0)??null})}))}:{id:u.value,label:u.label,data:this.periods.map(c=>({id:c.value,label:c.label,data:n?this.derivedPeriods.map(d=>({id:d.value,label:d.label,value:this.getDataValue(u.value,i,0,c.value,d.value)??null})):[{id:c.value,label:c.label,value:this.getDataValue(u.value,i,0,c.value,this.derivedPeriods[0]?.value||0)??null}]}))});return {subject_id:t?.value||0,subject_label:t?.label||"",variable_id:r?.value||0,variable_label:r?.label||"",variable_unit:r?.unit||"",vertical_variable_label:this.verticalVariableLabel,last_update:this.lastUpdate,data:l}}};var De=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{return yt.fromJson(r)}catch(i){throw new a(`Failed to parse dynamic table: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Yr(o){let e=o??g(),t=new _e(e.networkClient),r=new De(t);return {fetchDynamicTableList:i=>r.getAll(i)}}var Te=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.keyword&&(t.keyword=e.keyword);let r=new URLSearchParams(t).toString(),i=`${p.INFOGRAPHIC_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.INFOGRAPHIC_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ne=class o extends m{constructor(t,r,i,s,n,l){super();this.id=t;this.title=r;this.image=i;this.category=s;this.downloadUrl=n;this.description=l;}toJson(){return {inf_id:this.id,title:this.title,img:this.image,category:this.category,dl:this.downloadUrl,desc:this.description}}static fromJson(t){return new o(String(t.inf_id||t.id||""),String(t.title||""),String(t.img||t.image||""),Number(t.category||0),String(t.dl||t.downloadUrl||""),t.desc||t.description?String(t.desc||t.description):null)}};var Le=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>ne.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>ne.fromJson(c))}catch(i){throw new a(`Failed to parse infographics: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Infographic not found");let i=r.data[0];if(!i)throw new a("Infographic data is empty");return ne.fromJson(i)}catch(i){throw new a(`Failed to parse infographic data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function qr(o){let e=o??g(),t=new Te(e.networkClient),r=new Le(t);return {fetchInfographicList:i=>r.getAll(i)}}var le=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.keyword&&(t.keyword=e.keyword),e.month&&(t.month=e.month.toString()),e.year&&(t.year=e.year.toString()),e.newsCategoryId&&(t.news_category_id=e.newsCategoryId);let r=new URLSearchParams(t).toString(),i=`${p.NEWS_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.NEWS_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Z=class o extends m{constructor(t,r,i,s,n,l){super();this.id=t;this.title=r;this.content=i;this.releaseDate=s;this.categoryId=n;this.picture=l;}toJson(){return {news_id:this.id,title:this.title,news_content:this.content,rl_date:this.releaseDate,category_id:this.categoryId,picture:this.picture}}static fromJson(t){return new o(String(t.news_id||t.id||""),String(t.title||""),String(t.news_content||t.content||""),String(t.rl_date||t.releaseDate||""),Number(t.category_id||t.categoryId||0),t.picture?String(t.picture):null)}};var ce=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>Z.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>Z.fromJson(c))}catch(i){throw new a(`Failed to parse news: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("News not found");let i=r.data[0];if(!i)throw new a("News data is empty");return Z.fromJson(i)}catch(i){throw new a(`Failed to parse news data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Mr(o){let e=o??g(),t=new le(e.networkClient),r=new ce(t);return {fetchNewList:i=>r.getAll(i),fetchNewDetail:i=>r.getById(i)}}var ke=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.NEWS_CATEGORY_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.NEWS_CATEGORY_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ue=class o extends m{constructor(t,r){super();this.id=t;this.name=r;}toJson(){return {newscat_id:this.id,newscat_name:this.name}}static fromJson(t){return new o(String(t.newscat_id||t.id||""),String(t.newscat_name||t.name||""))}};var xe=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>ue.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>ue.fromJson(c))}catch(i){throw new a(`Failed to parse news category: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("News category not found");let i=r.data[0];if(!i)throw new a("News category data is empty");return ue.fromJson(i)}catch(i){throw new a(`Failed to parse news category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Wr(o){let e=o??g(),t=new ke(e.networkClient),r=new xe(t);return {fetchNewsCategoryList:i=>r.getAll(i)}}var Ue=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString()),e?.subjectId&&(t.subject=e.subjectId.toString()),e?.year!==void 0&&(t.year=e.year.toString()),e?.showExistingVariables!==void 0?t.area=e.showExistingVariables?"1":"0":e?.showDeleted!==void 0&&(t.area=e.showDeleted?"1":"0");let r=new URLSearchParams(t).toString(),i=`${p.VARIABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.VARIABLE_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var me=class o extends m{constructor(t,r,i,s,n,l,u,c,d,R,Pe,y,B){super();this.id=t;this.title=r;this.subjectId=i;this.subjectName=s;this.statisticClassificationId=n;this.statisticClassificationName=l;this.definition=u;this.notes=c;this.unit=d;this.verticalVariableCount=R;this.derivedVariableCount=Pe;this.graphId=y;this.graphName=B;}toJson(){return {var_id:this.id,title:this.title,sub_id:this.subjectId,sub_name:this.subjectName,subcsa_id:this.statisticClassificationId,subcsa_name:this.statisticClassificationName,def:this.definition,notes:this.notes,vertical:this.verticalVariableCount,unit:this.unit,graph_id:this.graphId,graph_name:this.graphName}}static fromJson(t){return new o(Number(t.var_id||t.id||0),String(t.title||t.name||""),Number(t.sub_id||t.subject_id||t.subjectId||0),String(t.sub_name||t.subject_name||t.subjectName||""),Number(t.subcsa_id||t.statisticClassificationId||0),String(t.subcsa_name||t.statisticClassificationName||""),String(t.def||t.definition||""),String(t.notes||""),String(t.unit||""),Number(t.vertical||t.vertical_variable||t.verticalVariableCount||0),Number(t.derived_variable||t.derivedVariableCount||0),Number(t.graph_id||t.graphId||0),String(t.graph_name||t.graphName||""))}};var Ve=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>me.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>me.fromJson(c))}catch(i){throw new a(`Failed to parse variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Variable not found");let i=r.data[0];if(!i)throw new a("Variable data is empty");return me.fromJson(i)}catch(i){throw new a(`Failed to parse variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Kr(o){let e=o??g(),t=new Ue(e.networkClient),r=new Ve(t);return {fetchVariableList:i=>r.getAll(i),fetchVariableDetail:i=>r.getById(i)}}var Ne=class{constructor(e){this.client=e;}async getAll(e){let t={};e.variableId!==void 0&&(t.var=e.variableId.toString()),e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.VERTICAL_VARIABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.VERTICAL_VARIABLE_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var pe=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.label=r;this.itemId=i;this.groupId=s;this.groupName=n;}toJson(){return {kode_ver_id:this.id,vervar:this.label,item_ver_id:this.itemId,group_ver_id:this.groupId,name_group_ver_id:this.groupName}}static fromJson(t){return new o(Number(t.kode_ver_id||t.id||0),String(t.vervar||t.label||""),Number(t.item_ver_id||t.itemId||0),Number(t.group_ver_id||t.groupId||0),String(t.name_group_ver_id||t.groupName||""))}};var Fe=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>pe.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>pe.fromJson(c))}catch(i){throw new a(`Failed to parse vertical variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Vertical variable not found");let i=r.data[0];if(!i)throw new a("Vertical variable data is empty");return pe.fromJson(i)}catch(i){throw new a(`Failed to parse vertical variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function zr(o){let e=o??g(),t=new Ne(e.networkClient),r=new Fe(t);return {fetchVerticalVariableList:i=>r.getAll(i)}}var Oe=class{constructor(e){this.client=e;}async getAll(e){let t={};e.variableId!==void 0&&(t.var=e.variableId.toString()),e.verticalGroup!==void 0&&(t.group=e.verticalGroup.toString()),e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.DERIVED_VARIABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.DERIVED_VARIABLE_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var de=class o extends m{constructor(t,r,i,s){super();this.id=t;this.name=r;this.groupId=i;this.groupName=s;}toJson(){return {turvar_id:this.id,turvar:this.name,group_turvar_id:this.groupId,name_group_turvar:this.groupName}}static fromJson(t){return new o(Number(t.turvar_id||t.id||0),String(t.turvar||t.name||""),Number(t.group_turvar_id||t.groupId||0),String(t.name_group_turvar||t.groupName||""))}};var Be=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>de.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>de.fromJson(c))}catch(i){throw new a(`Failed to parse derived variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Derived variable not found");let i=r.data[0];if(!i)throw new a("Derived variable data is empty");return de.fromJson(i)}catch(i){throw new a(`Failed to parse derived variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Hr(o){let e=o??g(),t=new Oe(e.networkClient),r=new Be(t);return {fetchDerivedVariableList:i=>r.getAll(i)}}var Ge=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString()),e?.subjectCategoryId!==void 0&&(t.subcat=e.subjectCategoryId.toString());let r=new URLSearchParams(t).toString(),i=`${p.SUBJECT_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.SUBJECT_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ge=class o extends m{constructor(t,r,i,s){super();this.id=t;this.name=r;this.categoryId=i;this.category=s;}toJson(){return {subj_id:this.id,title:this.name,subcatid:this.categoryId,category:this.category}}static fromJson(t){return new o(Number(t.sub_id||t.id||0),String(t.title||t.name||""),Number(t.subcat_id||t.categoryId||0),String(t.category||t.subcat||""))}};var Je=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>ge.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>ge.fromJson(c))}catch(i){throw new a(`Failed to parse subject: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Subject not found");let i=r.data[0];if(!i)throw new a("Subject data is empty");return ge.fromJson(i)}catch(i){throw new a(`Failed to parse subject data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Zr(o){let e=o??g(),t=new Ge(e.networkClient),r=new Je(t);return {fetchSubjectList:i=>r.getAll(i),fetchSubjectDetail:i=>r.getById(i)}}var $e=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.SUBJECT_CATEGORY_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.SUBJECT_CATEGORY_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var fe=class o extends m{constructor(t,r){super();this.id=t;this.name=r;}toJson(){return {subcat_id:this.id,subcat_name:this.name}}static fromJson(t){return new o(Number(t.subcat_id||t.id||0),String(t.subcat_name||t.title||t.name||""))}};var Ye=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>fe.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>fe.fromJson(c))}catch(i){throw new a(`Failed to parse subject category: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Subject category not found");let i=r.data[0];if(!i)throw new a("Subject category data is empty");return fe.fromJson(i)}catch(i){throw new a(`Failed to parse subject category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Xr(o){let e=o??g(),t=new $e(e.networkClient),r=new Ye(t);return {fetchSubjectCategoryList:i=>r.getAll(i)}}var qe=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString()),e?.variableId!==void 0&&(t.var=e.variableId.toString());let r=new URLSearchParams(t).toString(),i=`${p.UNIT_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.UNIT_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ye=class o extends m{constructor(t,r){super();this.id=t;this.name=r;}toJson(){return {unit_id:this.id,unit:this.name}}static fromJson(t){return new o(Number(t.unit_id||t.id||0),String(t.unit||t.name||""))}};var Me=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>ye.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>ye.fromJson(c))}catch(i){throw new a(`Failed to parse unit: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Unit not found");let i=r.data[0];if(!i)throw new a("Unit data is empty");return ye.fromJson(i)}catch(i){throw new a(`Failed to parse unit data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function Qr(o){let e=o??g(),t=new qe(e.networkClient),r=new Me(t);return {fetchUnitList:i=>r.getAll(i),fetchUnitDetail:i=>r.getById(i)}}var We=class{constructor(e){this.client=e;}async getAll(e){let t={};e.variableId!==void 0&&(t.var=e.variableId.toString()),e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.PERIOD_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.PERIOD_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Re=class o extends m{constructor(t,r){super();this.id=t;this.period=r;}toJson(){return {th_id:this.id,th:this.period}}static fromJson(t){return new o(Number(t.th_id||t.id||0),Number(t.th||t.period||0))}};var Ke=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>Re.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>Re.fromJson(c))}catch(i){throw new a(`Failed to parse period: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Period not found");let i=r.data[0];if(!i)throw new a("Period data is empty");return Re.fromJson(i)}catch(i){throw new a(`Failed to parse period data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function jr(o){let e=o??g(),t=new We(e.networkClient),r=new Ke(t);return {fetchPeriodList:i=>r.getAll(i)}}var ze=class{constructor(e){this.client=e;}async getAll(e){let t={};e.variableId!==void 0&&(t.var=e.variableId.toString()),e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${p.DERIVED_PERIOD_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.DERIVED_PERIOD_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var be=class o extends m{constructor(t,r,i,s){super();this.id=t;this.period=r;this.groupId=i;this.groupName=s;}toJson(){return {turth_id:this.id,turth:this.period,group_turth_id:this.groupId,name_group_turth:this.groupName}}static fromJson(t){return new o(Number(t.turth_id||t.id||0),String(t.turth||t.period||""),Number(t.group_turth_id||t.groupId||0),String(t.name_group_turth||t.groupName||""))}};var He=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>be.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>be.fromJson(c))}catch(i){throw new a(`Failed to parse derived period: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Derived period not found");let i=r.data[0];if(!i)throw new a("Derived period data is empty");return be.fromJson(i)}catch(i){throw new a(`Failed to parse derived period data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function ei(o){let e=o??g(),t=new ze(e.networkClient),r=new He(t);return {fetchDerivedPeriodList:i=>r.getAll(i)}}var Ze=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString()),e?.variableId!==void 0&&(t.var=e.variableId.toString());let r=new URLSearchParams(t).toString(),i=`${p.STRATEGIC_INDICATOR_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.STRATEGIC_INDICATOR_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var he=class o extends m{constructor(t,r,i,s,n,l,u,c,d,R,Pe){super();this.variableId=t;this.indicatorId=r;this.subjectCsa=i;this.title=s;this.name=n;this.dataSource=l;this.value=u;this.unit=c;this.category=d;this.hashId=R;this.period=Pe;}toJson(){return {var:this.variableId,indicator_id:this.indicatorId,subject_csa:this.subjectCsa,title:this.title,name:this.name,data_source:this.dataSource,value:this.value,unit:this.unit,category:this.category,hash_id:this.hashId,periode:this.period}}static fromJson(t){return new o(Number(t.var||t.variableId||0),Number(t.indicator_id||t.indicatorId||0),Number(t.subject_csa||t.subjectCsa||0),String(t.title||""),String(t.name||""),String(t.data_source||t.dataSource||""),Number(t.value||0),String(t.unit||""),Number(t.category||0),String(t.hash_id||t.hashId||""),String(t.periode||t.period||""))}};var Xe=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>he.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>he.fromJson(c))}catch(i){throw new a(`Failed to parse strategic indicator: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Strategic indicator not found");let i=r.data[0];if(!i)throw new a("Strategic indicator data is empty");return he.fromJson(i)}catch(i){throw new a(`Failed to parse strategic indicator data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function ti(o){let e=o??g(),t=new Ze(e.networkClient),r=new Xe(t);return {fetchStrategicIndicatorList:i=>r.getAll(i),fetchStrategicIndicatorDetail:i=>r.getById(i)}}var Qe=class{constructor(e){this.client=e;}async getAll(e){let t={};e?.domain&&(t.domain=e.domain),e?.lang&&(t.lang=e.lang),e?.page&&(t.page=e.page.toString()),e?.keyword&&(t.keyword=e.keyword),e?.level&&(t.level=e.level);let r=new URLSearchParams(t).toString(),i=e?.type||"kbli2020",s=`${p.statisticClassification(i)}${r?`?${r}`:""}`;return this.client.get(s,{cancelToken:e?.cancelToken})}async getById(e){let t={id:e.id.toString()};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=e.type||"kbli2020",s=`${p.statisticClassification(i)}${r?`?${r}`:""}`;return this.client.get(s,{cancelToken:e.cancelToken})}};var Se=class o extends m{constructor(t,r){super();this.id=t;this.title=r;}toJson(){return {kbli_id:this.id,title:this.title}}static fromJson(t){return new o(String(t.kbli_id||t.id||""),String(t.title||t.name||""))}};var je=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>Se.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return f.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>Se.fromJson(c))}catch(i){throw new a(`Failed to parse statistic classification: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Statistic classification not found");let i=r.data[0];if(!i)throw new a("Statistic classification data is empty");return Se.fromJson(i)}catch(i){throw new a(`Failed to parse statistic classification data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};function ri(o){let e=o??g(),t=new Qe(e.networkClient),r=new je(t);return {fetchStatisticClassificationList:i=>r.getAll(i),fetchStatisticClassificationDetail:i=>r.getById(i)}}var et=class{constructor(e){this.client=e;}async getAll(e){let t={};switch(e?.type){case "topics":t.id="38",e.censusId&&(t.kegiatan=e.censusId);break;case "areas":t.id="39",e.censusId&&(t.kegiatan=e.censusId);break;case "datasets":t.id="40",e.censusId&&(t.kegiatan=e.censusId),e.topicId&&(t.topik=e.topicId.toString());break;case "data":t.id="41",e.censusId&&(t.kegiatan=e.censusId),e.censusAreaId&&(t.wilayah_sensus=e.censusAreaId),e.datasetId&&(t.dataset=e.datasetId);break;default:t.id="37";break}let r=new URLSearchParams(t).toString(),i=`${p.CENSUS}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e?.cancelToken})}async getById(e){let t={id:e.id.toString(),domain:e.domain};e.lang&&(t.lang=e.lang);let r=new URLSearchParams(t).toString(),i=`${p.CENSUS}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Rt=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.name=r;this.itemId=i;this.itemCode=s;this.itemName=n;}toJson(){return {id:this.id,name:this.name,itemID:this.itemId,itemCode:this.itemCode,itemName:this.itemName}}toJSON(){return this.toJson()}static fromJson(t){return new o(String(t.id||""),String(t.name||""),String(t.itemID||""),String(t.itemCode||""),String(t.itemName||""))}};var tt=class o extends m{constructor(t,r,i){super();this.id=t;this.name=r;this.year=i;}toJson(){return {id:this.id,kegiatan:this.name,tahun_kegiatan:this.year}}toJSON(){return this.toJson()}static fromJson(t){return new o(String(t.id||""),String(t.kegiatan||""),Number(t.tahun_kegiatan||0))}};var bt=class o extends m{constructor(t,r,i,s){super();this.id=t;this.topic=r;this.eventId=i;this.eventName=s;}toJson(){return {id:this.id,topik:this.topic,id_kegiatan:this.eventId,kegiatan:this.eventName}}toJSON(){return this.toJson()}static fromJson(t){return new o(Number(t.id||0),String(t.topik||""),String(t.id_kegiatan||""),String(t.kegiatan||""))}};var ht=class o extends m{constructor(t,r,i,s){super();this.id=t;this.mfdCode=r;this.name=i;this.slug=s;}toJson(){return {id:this.id,kode_mfd:this.mfdCode,nama:this.name,slug:this.slug}}toJSON(){return this.toJson()}static fromJson(t){return new o(Number(t.id||0),String(t.kode_mfd||""),String(t.nama||""),String(t.slug||""))}};var St=class o extends m{constructor(t,r,i,s,n,l){super();this.id=t;this.topicId=r;this.topic=i;this.eventId=s;this.name=n;this.description=l;}toJson(){let t={id:this.id,id_topik:this.topicId,topik:this.topic,id_kegiatan:this.eventId,nama:this.name};return this.description!==void 0&&this.description!==null&&(t.deskripsi=this.description),t}toJSON(){return this.toJson()}static fromJson(t){return new o(Number(t.id||0),Number(t.id_topik||0),String(t.topik||""),Number(t.id_kegiatan||0),String(t.nama||""),t.deskripsi?String(t.deskripsi):null)}};var wt=class o extends m{constructor(t,r,i,s,n,l,u,c,d){super();this.regionId=t;this.regionCode=r;this.regionName=i;this.indicatorId=s;this.indicatorName=n;this.categories=l;this.period=u;this.value=c;this.regionLevel=d;}toJson(){let t={id_wilayah:this.regionId,kode_wilayah:this.regionCode,nama_wilayah:this.regionName,id_indikator:this.indicatorId,nama_indikator:this.indicatorName,categories:this.categories.map(r=>({id:r.id,name:r.name,item_id:r.itemId,item_code:r.itemCode,item_name:r.itemName})),period:this.period,nilai:this.value};return this.regionLevel!==void 0&&this.regionLevel!==null&&(t.level_wilayah=this.regionLevel),t}toJSON(){return this.toJson()}static fromJson(t){let r=[];for(let i=1;i<=5;i++){let s=String(t[`id_kategori_${i}`]||""),n=String(t[`nama_kategori_${i}`]||""),l=String(t[`id_item_kategori_${i}`]||""),u=String(t[`kode_item_kategori_${i}`]||""),c=String(t[`nama_item__kategori_${i}`]||"");!s||!n||!l||!u||!c||r.push(new Rt(s,n,l,u,c));}return new o(String(t.id_wilayah||""),String(t.kode_wilayah||""),String(t.nama_wilayah||""),String(t.id_indikator||""),String(t.nama_indikator||""),r,String(t.period||""),Number(t.nilai||0),t.level_wilayah?String(t.level_wilayah):null)}};var rt=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||r.data===null)return this.createEmptyListResult(e);if(!Array.isArray(r.data)||r.data.length<2)return this.createEmptyListResult(e);let i=r.data[0],s=r.data[1];if(s&&!Array.isArray(s)&&typeof s=="object"){let c=s;c.data&&Array.isArray(c.data)&&(s=c.data);}if(!s||!Array.isArray(s))return this.createEmptyListResult(e,i);let n=s.map(c=>this.parseEntity(c,e?.type)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return new f(n,new q(Number(i.page||1),u,Number(i.total||0),Number(i.pages||1),l))}catch(i){throw new a(`Failed to parse census: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{return tt.fromJson(r)}catch(i){throw new a(`Failed to parse census event: ${i instanceof Error?i.message:"Unknown error"}`)}})}parseEntity(e,t){switch(t){case "topics":return bt.fromJson(e);case "areas":return ht.fromJson(e);case "datasets":return St.fromJson(e);case "data":return wt.fromJson(e);case "events":default:return tt.fromJson(e)}}createEmptyListResult(e,t){return f.fromJson({data:[],pagination:{page:Number(t?.page||1),per_page:Number(t?.per_page||10),total:Number(t?.total||0),pages:Number(t?.pages||0),count:0}},r=>this.parseEntity(r,e?.type))}};function ii(o){let e=o??g(),t=new et(e.networkClient),r=new rt(t);return {fetchCensusList:i=>r.getAll(i)}}var it=class{constructor(e){this.client=e;}async get(e){let t={sumber:e.source.toString(),periode:e.period.toString(),kodehs:e.hsCode,jenishs:e.hsType.toString(),tahun:e.year},r=new URLSearchParams(t).toString(),i=`${p.TRADE}?${r}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var ot=class{constructor(e){this.remoteDataSource=e;}get(e){return this.remoteDataSource.get(e)}};function oi(o){let e=o??g(),t=new it(e.networkClient),r=new ot(t);return {fetchTradeData:i=>r.get(i)}}function Pr(o){let e=new Ae(o.apiKey),r={networkClient:new Q({baseURL:o.baseURL??ee.BASE_URL,timeout:o.timeout??ee.DEFAULT_TIMEOUT,interceptors:[e,...o.interceptors??[]]}),config:o};return {...r,useDomains:()=>Br(r),usePublications:()=>Gr(r),usePressReleases:()=>Jr(r),useStaticTables:()=>$r(r),useDynamicTables:()=>Yr(r),useInfographics:()=>qr(r),useNews:()=>Mr(r),useNewsCategories:()=>Wr(r),useVariables:()=>Kr(r),useVerticalVariables:()=>zr(r),useDerivedVariables:()=>Hr(r),useSubjects:()=>Zr(r),useSubjectCategories:()=>Xr(r),useUnits:()=>Qr(r),usePeriods:()=>jr(r),useDerivedPeriods:()=>ei(r),useStrategicIndicators:()=>ti(r),useStatisticClassifications:()=>ri(r),useCensus:()=>ii(r),useTrade:()=>oi(r)}}var st=class o{constructor(){this._apiKey=null;}static getInstance(){return o.instance||(o.instance=new o),o.instance}setApiKey(e){this._apiKey=e;}getApiKey(){if(!this._apiKey)throw new Error("API key not set. Call setApiKey() first.");return this._apiKey}hasApiKey(){return this._apiKey!==null}clearApiKey(){this._apiKey=null;}};var Gt=class extends xt{constructor(t){super();this.repository=t;}async execute(t){return this.repository.getAll(t)}};var M=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ce(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ee(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Gt(r)});}static getAllDomainsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};M.REMOTE_DATA_SOURCE="DomainRemoteDataSource",M.REPOSITORY="DomainRepository",M.GET_ALL_USE_CASE="GetAllDomains";var Jt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var $t=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var I=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ie(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new ve(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Jt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new $t(r)});}static getAllPublicationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPublicationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};I.REMOTE_DATA_SOURCE="PublicationRemoteDataSource",I.REPOSITORY="PublicationRepository",I.GET_ALL_USE_CASE="GetAllPublications",I.GET_BY_ID_USE_CASE="GetPublicationById";var Yt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var qt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var v=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Te(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Le(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Yt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new qt(r)});}static getAllInfographicsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getInfographicByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};v.REMOTE_DATA_SOURCE="InfographicRemoteDataSource",v.REPOSITORY="InfographicRepository",v.GET_ALL_USE_CASE="GetAllInfographics",v.GET_BY_ID_USE_CASE="GetInfographicById";var Pt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var At=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var P=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new le(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new ce(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Pt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new At(r)});}static getAllNewsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};P.REMOTE_DATA_SOURCE="NewsRemoteDataSource",P.REPOSITORY="NewsRepository",P.GET_ALL_USE_CASE="GetAllNews",P.GET_BY_ID_USE_CASE="GetNewsById";var Mt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Wt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var _=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new ke(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new xe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Mt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Wt(r)});}static getAllNewsCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};_.REMOTE_DATA_SOURCE="NewsCategoryRemoteDataSource",_.REPOSITORY="NewsCategoryRepository",_.GET_ALL_USE_CASE="GetAllNewsCategories",_.GET_BY_ID_USE_CASE="GetNewsCategoryById";var Ct=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Et=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var A=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new re(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new ie(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ct(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Et(r)});}static getAllPressReleasesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPressReleaseByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};A.REMOTE_DATA_SOURCE="PressReleaseRemoteDataSource",A.REPOSITORY="PressReleaseRepository",A.GET_ALL_USE_CASE="GetAllPressReleases",A.GET_BY_ID_USE_CASE="GetPressReleaseById";var It=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var vt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var C=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new oe(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new se(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new It(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new vt(r)});}static getAllStaticTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStaticTableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};C.REMOTE_DATA_SOURCE="StaticTableRemoteDataSource",C.REPOSITORY="StaticTableRepository",C.GET_ALL_USE_CASE="GetAllStaticTables",C.GET_BY_ID_USE_CASE="GetStaticTableById";var Kt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var zt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var D=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ge(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Je(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Kt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new zt(r)});}static getAllSubjectsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};D.REMOTE_DATA_SOURCE="SubjectRemoteDataSource",D.REPOSITORY="SubjectRepository",D.GET_ALL_USE_CASE="GetAllSubjects",D.GET_BY_ID_USE_CASE="GetSubjectById";var Ht=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Zt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var T=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new $e(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ye(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ht(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Zt(r)});}static getAllSubjectCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};T.REMOTE_DATA_SOURCE="SubjectCategoryRemoteDataSource",T.REPOSITORY="SubjectCategoryRepository",T.GET_ALL_USE_CASE="GetAllSubjectCategories",T.GET_BY_ID_USE_CASE="GetSubjectCategoryById";var Xt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Qt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var L=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ze(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Xe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Xt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Qt(r)});}static getAllStrategicIndicatorsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStrategicIndicatorByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};L.REMOTE_DATA_SOURCE="StrategicIndicatorRemoteDataSource",L.REPOSITORY="StrategicIndicatorRepository",L.GET_ALL_USE_CASE="GetAllStrategicIndicators",L.GET_BY_ID_USE_CASE="GetStrategicIndicatorById";var jt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var er=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var k=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ue(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ve(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new jt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new er(r)});}static getAllVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};k.REMOTE_DATA_SOURCE="VariableRemoteDataSource",k.REPOSITORY="VariableRepository",k.GET_ALL_USE_CASE="GetAllVariables",k.GET_BY_ID_USE_CASE="GetVariableById";var tr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var rr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var x=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ne(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Fe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new tr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new rr(r)});}static getAllVerticalVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVerticalVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};x.REMOTE_DATA_SOURCE="VerticalVariableRemoteDataSource",x.REPOSITORY="VerticalVariableRepository",x.GET_ALL_USE_CASE="GetAllVerticalVariables",x.GET_BY_ID_USE_CASE="GetVerticalVariableById";var ir=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var or=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var U=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new qe(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Me(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ir(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new or(r)});}static getAllUnitsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getUnitByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};U.REMOTE_DATA_SOURCE="UnitRemoteDataSource",U.REPOSITORY="UnitRepository",U.GET_ALL_USE_CASE="GetAllUnits",U.GET_BY_ID_USE_CASE="GetUnitById";var sr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var ar=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var V=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new We(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ke(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new sr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ar(r)});}static getAllPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};V.REMOTE_DATA_SOURCE="PeriodRemoteDataSource",V.REPOSITORY="PeriodRepository",V.GET_ALL_USE_CASE="GetAllPeriods",V.GET_BY_ID_USE_CASE="GetPeriodById";var nr=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var lr=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var N=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new ze(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new He(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new nr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new lr(r)});}static getAllDerivedPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};N.REMOTE_DATA_SOURCE="DerivedPeriodRemoteDataSource",N.REPOSITORY="DerivedPeriodRepository",N.GET_ALL_USE_CASE="GetAllDerivedPeriods",N.GET_BY_ID_USE_CASE="GetDerivedPeriodById";var cr=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var ur=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var F=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Oe(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Be(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new cr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ur(r)});}static getAllDerivedVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};F.REMOTE_DATA_SOURCE="DerivedVariableRemoteDataSource",F.REPOSITORY="DerivedVariableRepository",F.GET_ALL_USE_CASE="GetAllDerivedVariables",F.GET_BY_ID_USE_CASE="GetDerivedVariableById";var mr=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var pr=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var O=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Qe(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new je(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new mr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new pr(r)});}static getAllStatisticClassificationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStatisticClassificationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};O.REMOTE_DATA_SOURCE="StatisticClassificationRemoteDataSource",O.REPOSITORY="StatisticClassificationRepository",O.GET_ALL_USE_CASE="GetAllStatisticClassifications",O.GET_BY_ID_USE_CASE="GetStatisticClassificationById";var dr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var gr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var b=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new et(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new rt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new dr(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new gr(r)});}static getAllCensusesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getCensusByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};b.REMOTE_DATA_SOURCE="CensusRemoteDataSource",b.REPOSITORY="CensusRepository",b.GET_ALL_USE_CASE="GetAllCensuses",b.GET_BY_ID_USE_CASE="GetCensusById";var fr=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Er=class{static generate(e){let t=e.derivedVariables.length>1||e.derivedVariables[0]?.value!==0,r=e.derivedPeriods.length>1||e.derivedPeriods[0]?.value!==0,i='<table border="1" cellpadding="5" cellspacing="0">';return i+=this.generateHeader(e,t),i+=this.generateBody(e,t,r),i+="</table>",i}static generateHeader(e,t){let r="<thead>";r+="<tr>",r+=`<th rowspan="${t?3:2}">${e.verticalVariableLabel}</th>`;let i=e.variables[0]?.label||"Variable",s=t?e.derivedVariables.length*e.periods.length:e.periods.length;r+=`<th colspan="${s}">${i}</th>`,r+="</tr>",t&&(r+="<tr>",e.derivedVariables.forEach(l=>{r+=`<th colspan="${e.periods.length}">${l.label}</th>`;}),r+="</tr>"),r+="<tr>";let n=t?e.derivedVariables.length:1;for(let l=0;l<n;l++)e.periods.forEach(u=>{r+=`<th>${u.label}</th>`;});return r+="</tr>",r+="</thead>",r}static generateBody(e,t,r){let i="<tbody>",s=e.variables[0]?.value||0,n=r&&e.derivedPeriods[0]?.value||0;return e.verticalVariables.forEach(l=>{i+="<tr>",i+=`<td>${l.label}</td>`,t?e.derivedVariables.forEach(u=>{e.periods.forEach(c=>{let d=e.getDataValue(l.value,s,u.value,c.value,n);i+=`<td>${this.formatValue(d)}</td>`;});}):e.periods.forEach(u=>{let c=e.getDataValue(l.value,s,0,u.value,n);i+=`<td>${this.formatValue(c)}</td>`;}),i+="</tr>";}),i+="</tbody>",i}static formatValue(e){return e==null?"-":typeof e=="number"?e.toLocaleString("en-US"):String(e)}};var W=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new _e(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new De(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new fr(r)});}static getAllDynamicTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};W.REMOTE_DATA_SOURCE="DynamicTableRemoteDataSource",W.REPOSITORY="DynamicTableRepository",W.GET_ALL_USE_CASE="GetAllDynamicTables";var yr=class{constructor(e){this.injector=e;}async domains(e){return M.getAllDomainsUseCase(this.injector).execute(e)}async publications(e){return I.getAllPublicationsUseCase(this.injector).execute(e)}async infographics(e){return v.getAllInfographicsUseCase(this.injector).execute(e)}async news(e){return P.getAllNewsUseCase(this.injector).execute(e)}async newsCategories(e){return _.getAllNewsCategoriesUseCase(this.injector).execute(e)}async pressReleases(e){return A.getAllPressReleasesUseCase(this.injector).execute(e)}async staticTables(e){return C.getAllStaticTablesUseCase(this.injector).execute(e)}async subjects(e){return D.getAllSubjectsUseCase(this.injector).execute(e)}async subjectCategories(e){return T.getAllSubjectCategoriesUseCase(this.injector).execute(e)}async strategicIndicators(e){return L.getAllStrategicIndicatorsUseCase(this.injector).execute(e)}async variables(e){return k.getAllVariablesUseCase(this.injector).execute(e)}async verticalVariables(e){return x.getAllVerticalVariablesUseCase(this.injector).execute(e)}async units(e){return U.getAllUnitsUseCase(this.injector).execute(e)}async periods(e){return V.getAllPeriodsUseCase(this.injector).execute(e)}async derivedPeriods(e){return N.getAllDerivedPeriodsUseCase(this.injector).execute(e)}async derivedVariables(e){return F.getAllDerivedVariablesUseCase(this.injector).execute(e)}async statisticClassifications(e){return O.getAllStatisticClassificationsUseCase(this.injector).execute(e)}async censusEvents(){return b.getAllCensusesUseCase(this.injector).execute()}async censusTopics(e){return b.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"topics"})}async censusEventAreas(e){return b.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"areas"})}async censusEventDatasets(e){return b.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,topicId:e.topicId,type:"datasets"})}async censusData(e){return b.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,censusAreaId:e.censusAreaId,datasetId:e.datasetId,type:"data"})}async dynamicTables(e){return W.getAllDynamicTablesUseCase(this.injector).execute(e)}};var Rr=class{constructor(e){this.injector=e;}async publication(e){return I.getPublicationByIdUseCase(this.injector).execute(e)}async infographic(e){return v.getInfographicByIdUseCase(this.injector).execute(e)}async news(e){return P.getNewsByIdUseCase(this.injector).execute(e)}async newsCategory(e){return _.getNewsCategoryByIdUseCase(this.injector).execute(e)}async pressRelease(e){return A.getPressReleaseByIdUseCase(this.injector).execute(e)}async staticTable(e){return C.getStaticTableByIdUseCase(this.injector).execute(e)}async subject(e){return D.getSubjectByIdUseCase(this.injector).execute(e)}async subjectCategory(e){return T.getSubjectCategoryByIdUseCase(this.injector).execute(e)}async strategicIndicator(e){return L.getStrategicIndicatorByIdUseCase(this.injector).execute(e)}async variable(e){return k.getVariableByIdUseCase(this.injector).execute(e)}async verticalVariable(e){return x.getVerticalVariableByIdUseCase(this.injector).execute(e)}async unit(e){return U.getUnitByIdUseCase(this.injector).execute(e)}async period(e){return V.getPeriodByIdUseCase(this.injector).execute(e)}async derivedPeriod(e){return N.getDerivedPeriodByIdUseCase(this.injector).execute(e)}async derivedVariable(e){return F.getDerivedVariableByIdUseCase(this.injector).execute(e)}async statisticClassification(e){return O.getStatisticClassificationByIdUseCase(this.injector).execute(e)}async census(e){return b.getCensusByIdUseCase(this.injector).execute(e)}};var Ir=class o extends m{constructor(t,r,i,s,n,l){super();this.value=t;this.netWeight=r;this.hsCode=i;this.port=s;this.country=n;this.year=l;}toJson(){return {value:this.value,netweight:this.netWeight,kodehs:this.hsCode,pod:this.port,ctr:this.country,tahun:this.year}}static fromJson(t){return new o(Number(t.value||0),Number(t.netweight||0),String(t.kodehs||""),String(t.pod||""),String(t.ctr||""),String(t.tahun||""))}};var br=class{constructor(e){this.repository=e;}execute(e){return this.repository.get(e)}};var we=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new it(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new ot(r)}),e.registerFactory(this.GET_TRADE_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new br(r)});}static getTradeUseCase(e){return e.resolve(this.GET_TRADE_USE_CASE)}};we.REMOTE_DATA_SOURCE="TradeRemoteDataSource",we.REPOSITORY="TradeRepository",we.GET_TRADE_USE_CASE="GetTrade";var h=class h{constructor(e){this.logger=Lt.getInstance(),this.logger.configure({enabled:e.debug??false,filter:new j(e.logLevel??1)}),st.getInstance().setApiKey(e.apiKey),this.authInterceptor=new Ae(e.apiKey);let t=[this.authInterceptor,...e.interceptors||[]];this.networkClient=new Q({baseURL:e.baseURL||ee.BASE_URL,timeout:e.timeout||ee.DEFAULT_TIMEOUT,interceptors:t}),this.injector=Ut.getInstance(),this.setupDependencies(),this._list=new yr(this.injector),this._view=new Rr(this.injector),this.logger.info("StadataJS initialized successfully");}static get instance(){if(!h._instance)throw new Error("StadataJS not initialized. Call StadataJS.init() first.");return h._instance}static init(e){return h._instance&&h._instance.logger.warn("StadataJS already initialized. Reinitializing..."),h._instance=new h(e),h._instance}static isInitialized(){return h._instance!==null}static destroy(){h._instance&&(h._instance.cleanup(),h._instance=null);}get list(){return this._list}get view(){return this._view}setApiKey(e){st.getInstance().setApiKey(e),this.authInterceptor.setApiKey(e),this.logger.info("API key updated");}addInterceptor(e){this.networkClient.addInterceptor(e),this.logger.debug("Interceptor added");}removeInterceptor(e){this.networkClient.removeInterceptor(e),this.logger.debug("Interceptor removed");}enableDebug(){this.logger.enable(),this.logger.configure({filter:new j(0)});}disableDebug(){this.logger.configure({filter:new j(1)});}async trade(e){return this.injector.resolve("GetTrade").execute(e)}setupDependencies(){M.register(this.injector,this.networkClient),I.register(this.injector,this.networkClient),v.register(this.injector,this.networkClient),P.register(this.injector,this.networkClient),_.register(this.injector,this.networkClient),A.register(this.injector,this.networkClient),C.register(this.injector,this.networkClient),D.register(this.injector,this.networkClient),T.register(this.injector,this.networkClient),L.register(this.injector,this.networkClient),k.register(this.injector,this.networkClient),x.register(this.injector,this.networkClient),U.register(this.injector,this.networkClient),V.register(this.injector,this.networkClient),N.register(this.injector,this.networkClient),F.register(this.injector,this.networkClient),O.register(this.injector,this.networkClient),b.register(this.injector,this.networkClient),W.register(this.injector,this.networkClient),we.register(this.injector,this.networkClient);}cleanup(){this.injector.clear(),st.getInstance().clearApiKey(),this.logger.info("StadataJS cleaned up");}};h._instance=null;var vr=h;var gi=(t=>(t[t.Export=1]="Export",t[t.Import=2]="Import",t))(gi||{}),fi=(t=>(t[t.Monthly=1]="Monthly",t[t.Annually=2]="Annually",t))(fi||{}),yi=(t=>(t[t.TwoDigit=1]="TwoDigit",t[t.Full=2]="Full",t))(yi||{});
2
+ exports.ApiConstant=ee;exports.ApiEndpoint=p;exports.ApiFailure=$;exports.CancelToken=Cr;exports.CancelledFailure=at;exports.CensusArea=ht;exports.CensusCategory=Rt;exports.CensusData=wt;exports.CensusDataset=St;exports.CensusEvent=tt;exports.CensusTopic=bt;exports.ClassificationType=Vr;exports.DataAvailability=Ur;exports.DataLanguage=xr;exports.DerivedPeriod=be;exports.DerivedVariable=de;exports.Domain=gt;exports.DomainType=Or;exports.DynamicTable=yt;exports.DynamicTableHtmlGenerator=Er;exports.ForbiddenFailure=mt;exports.HSCodeType=yi;exports.Infographic=ne;exports.KBKILevel=Fr;exports.KBLILevel=Nr;exports.ListResult=f;exports.LogLevel=kt;exports.NetworkClient=Q;exports.NetworkFailure=nt;exports.News=Z;exports.NewsCategory=ue;exports.NotFoundFailure=ct;exports.Pagination=q;exports.ParseFailure=a;exports.Period=Re;exports.PressRelease=z;exports.Publication=te;exports.RelatedPublication=ft;exports.ServerFailure=pt;exports.StadataJS=vr;exports.StaticTable=H;exports.StatisticClassification=Se;exports.StrategicIndicator=he;exports.Subject=ge;exports.SubjectCategory=fe;exports.TimeoutFailure=lt;exports.Trade=Ir;exports.TradePeriod=fi;exports.TradeSource=gi;exports.UnauthorizedFailure=ut;exports.Unit=ye;exports.ValidationFailure=Sr;exports.Variable=me;exports.VerticalVariable=pe;exports.createStadataClient=Pr;exports.getGlobalClient=g;exports.initStadata=pi;exports.resetGlobalClient=di;exports.useCensus=ii;exports.useDerivedPeriods=ei;exports.useDerivedVariables=Hr;exports.useDomains=Br;exports.useDynamicTables=Yr;exports.useInfographics=qr;exports.useNews=Mr;exports.useNewsCategories=Wr;exports.usePeriods=jr;exports.usePressReleases=Jr;exports.usePublications=Gr;exports.useStaticTables=$r;exports.useStatisticClassifications=ri;exports.useStrategicIndicators=ti;exports.useSubjectCategories=Xr;exports.useSubjects=Zr;exports.useTrade=oi;exports.useUnits=Qr;exports.useVariables=Kr;exports.useVerticalVariables=zr;return exports;})({});//# sourceMappingURL=index.global.js.map
3
3
  //# sourceMappingURL=index.global.js.map