stadata-js 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +88 -21
- package/dist/index.d.ts +88 -21
- package/dist/index.global.js +2 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +5 -2
- package/dist/index.global.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {err,ok}from'neverthrow';var fe=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 N=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}},U=class extends N{constructor(t,r,i){super(t,i);this.statusCode=r;}},he=class extends N{constructor(e="Request was cancelled"){super(e,"CANCELLED");}},Se=class extends N{constructor(e){super(e,"NETWORK_ERROR");}},we=class extends N{constructor(e="Request timeout"){super(e,"TIMEOUT");}},be=class extends U{constructor(e="Resource not found"){super(e,404,"NOT_FOUND");}},Pe=class extends U{constructor(e="Unauthorized"){super(e,401,"UNAUTHORIZED");}},Ae=class extends U{constructor(e="Forbidden"){super(e,403,"FORBIDDEN");}},Ee=class extends U{constructor(e="Server error",t=500){super(e,t,"SERVER_ERROR");}},a=class extends N{constructor(e){super(e,"PARSE_ERROR");}},or=class extends N{constructor(e){super(e,"VALIDATION_ERROR");}};var Ie=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(([y,B])=>{y.toLowerCase()!=="content-type"&&(s[y]=B);}),Object.assign(s,r.headers);let c={method:e,headers:s};e!=="GET"&&r.body&&(c.body=JSON.stringify(r.body)),r.cancelToken&&(c.signal=r.cancelToken.signal);for(let y of this.interceptors)if(y.onRequest){let B=await y.onRequest(i,c);i=B.url,c=B.init;}let p=await this.fetchWithTimeout(i,c,r.timeout||this.timeout);for(let y of this.interceptors)y.onResponse&&(p=await y.onResponse(p));if(!p.ok)return err(await this.handleErrorResponse(p));let n=await p.json();return ok(n)}catch(i){return err(await this.handleError(i,r.cancelToken))}}async fetchWithTimeout(e,t,r){let i=new AbortController,s=setTimeout(()=>i.abort(),r);try{let c=t.signal&&t.signal instanceof AbortSignal?this.combineSignals(t.signal,i.signal):i.signal;return await fetch(e,{...t,signal:c})}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 Pe(r);case 403:return new Ae(r);case 404:return new be(r);case 500:case 502:case 503:case 504:return new Ee(r,t);default:return new U(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 he(t?.reason):r.name==="AbortError"||r.message.includes("timeout")||r.message.includes("aborted")?new we:r.message.includes("network")||r.message.includes("fetch")||r.message.includes("ECONNREFUSED")?new Se(r.message):new U(r.message)}};var G=class{};var Ce=class extends G{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 St=(c=>(c[c.DEBUG=0]="DEBUG",c[c.INFO=1]="INFO",c[c.WARN=2]="WARN",c[c.ERROR=3]="ERROR",c[c.FATAL=4]="FATAL",c[c.NONE=5]="NONE",c))(St||{}),ht=class{print(e){let t=St[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}}},$=class{constructor(e=1){this.minLevel=e;}shouldLog(e){return e.level>=this.minLevel}},O=class o{constructor(e=new ht,t=new $){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 sr=class extends G{constructor(e){super(),this.logger=e||O.getInstance();}onRequest(e,t){return this.logger.debug(`HTTP Request: ${t.method||"GET"} ${e}`,{headers:t.headers,body:t.body}),{url:e,init:t}}onResponse(e){return this.logger.debug(`HTTP Response: ${e.status} ${e.url}`,{status:e.status,statusText:e.statusText,headers:Object.fromEntries(e.headers.entries())}),e}onError(e){return this.logger.error(`HTTP Error: ${e.message}`,e),e}};var ar=class extends G{constructor(t={},r){super();this.retryCount=new Map;this.logger=r||O.getInstance(),this.config={maxRetries:t.maxRetries??3,retryDelay:t.retryDelay??1e3,retryableStatusCodes:t.retryableStatusCodes??[408,429,500,502,503,504],exponentialBackoff:t.exponentialBackoff??true};}async onResponse(t){let r=t.url,i=this.retryCount.get(r)||0;if(!t.ok&&this.config.retryableStatusCodes.includes(t.status)&&i<this.config.maxRetries){this.retryCount.set(r,i+1);let s=this.config.exponentialBackoff?this.config.retryDelay*Math.pow(2,i):this.config.retryDelay;throw this.logger.warn(`Retrying request (${i+1}/${this.config.maxRetries}) after ${s}ms: ${t.url}`),await this.sleep(s),new Error(`RETRY_NEEDED:${r}`)}return (t.ok||i>=this.config.maxRetries)&&this.retryCount.delete(r),t}sleep(t){return new Promise(r=>setTimeout(r,t))}resetRetryCount(t){this.retryCount.delete(t);}clearAllRetryCounts(){this.retryCount.clear();}};var wt={BASE_URL:"https://webapi.bps.go.id/v1/api",DEFAULT_TIMEOUT:3e4,API_VERSION:"v1",DEFAULT_PAGE_SIZE:10,MAX_PAGE_SIZE:100};var wr=(t=>(t.ID="ind",t.EN="eng",t))(wr||{});var br=(r=>(r.AVAILABLE="available",r.NOT_AVAILABLE="not-available",r.LIST_NOT_AVAILABLE="list-not-available",r))(br||{});var Pr=(s=>(s.KBLI_2009="kbli2009",s.KBLI_2015="kbli2015",s.KBLI_2017="kbli2017",s.KBLI_2020="kbli2020",s.KBKI_2015="kbki2015",s))(Pr||{}),Ar=(s=>(s.CATEGORY="kategori",s.PRIMARY_GROUP="golongan pokok",s.GROUP="golongan",s.SUB_GROUP="subgolongan",s.CLUSTER="kelompok",s))(Ar||{}),Er=(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))(Er||{});var Ir=(i=>(i.ALL="all",i.PROVINCE="prov",i.REGENCY="kab",i.REGENCY_BY_PROVINCE="kabbyprov",i))(Ir||{});var m={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 vr={KEY:"key",DOMAIN:"domain",LANG:"lang",PAGE:"page",PER_PAGE:"per_page",KEYWORD:"keyword",MONTH:"month",YEAR:"year",SUBJECT:"subj",VARIABLE:"var",TURVAR:"turvar",TURTH:"turth",PERIOD:"th",TYPE:"type",TABLE:"table",MODEL:"model",ID:"id",SHOW_DELETED:"show_deleted"};var ne=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 u=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 le=class{},nr=class extends le{call(){return this.execute()}};var _e=class o extends u{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 ve=class extends le{constructor(t){super();this.repository=t;}async execute(t){return this.repository.getAll(t)}};var bt=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=`${m.DOMAIN_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var x=class o extends u{constructor(t,r,i,s,c){super();this.page=t;this.perPage=r;this.total=i;this.pages=s;this.count=c;}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 lr=class o extends u{constructor(t,r,i){super();this.data=t;this.dataAvailability=r;this.pagination=i;}get isAvailable(){return this.dataAvailability==="available"}get totalItems(){return this.pagination?.total||this.data.length}get hasData(){return this.data.length>0}toJson(){return {data:this.data,data_availability:this.dataAvailability,pagination:this.pagination?.toJson()}}static fromJson(t,r){let s=(t.data||[]).map(p=>r(p)),c=t.pagination,l=c?x.fromJson(c):void 0;return new o(s,t["data-availability"]||"available",l)}};var d=class o extends u{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(p=>r(p)),c=t.pagination,l=x.fromJson(c);return new o(s,l)}};var Pt=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 c=s.map(y=>_e.fromJson(y)),l=Number(i.count)||s.length,p=Number(i.per_page)||l,n=new x(Number(i.page||1),p,Number(i.total||0),Number(i.pages||1),l);return new d(c,n)}catch(i){throw new a(`Failed to parse domain data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var V=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new bt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Pt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ve(r)});}static getAllDomainsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};V.REMOTE_DATA_SOURCE="DomainRemoteDataSource",V.REPOSITORY="DomainRepository",V.GET_ALL_USE_CASE="GetAllDomains";var Te=class o extends u{constructor(t,r,i,s,c){super();this.id=t;this.title=r;this.releaseDate=i;this.url=s;this.cover=c;}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 M=class o extends u{constructor(t,r,i,s,c,l,p,n,y,B,ir,Cr,kr){super();this.id=t;this.title=r;this.issn=i;this.cover=s;this.pdf=c;this.size=l;this.scheduledDate=p;this.releaseDate=n;this.updateDate=y;this.abstract=B;this.catalogueNumber=ir;this.publicationNumber=Cr;this.relatedPublications=kr;}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=>Te.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 De=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Le=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var At=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=`${m.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=`${m.PUBLICATION_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Et=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 c=s.map(n=>M.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>M.fromJson(n))}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 M.fromJson(i)}catch(i){throw new a(`Failed to parse publication data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var w=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new At(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Et(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new De(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Le(r)});}static getAllPublicationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPublicationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};w.REMOTE_DATA_SOURCE="PublicationRemoteDataSource",w.REPOSITORY="PublicationRepository",w.GET_ALL_USE_CASE="GetAllPublications",w.GET_BY_ID_USE_CASE="GetPublicationById";var W=class o extends u{constructor(t,r,i,s,c,l){super();this.id=t;this.title=r;this.image=i;this.category=s;this.downloadUrl=c;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 ke=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var xe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var It=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=`${m.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=`${m.INFOGRAPHIC_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Ct=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 c=s.map(n=>W.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>W.fromJson(n))}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 W.fromJson(i)}catch(i){throw new a(`Failed to parse infographic data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var b=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 Ct(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ke(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new xe(r)});}static getAllInfographicsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getInfographicByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};b.REMOTE_DATA_SOURCE="InfographicRemoteDataSource",b.REPOSITORY="InfographicRepository",b.GET_ALL_USE_CASE="GetAllInfographics",b.GET_BY_ID_USE_CASE="GetInfographicById";var K=class o extends Error{constructor(e){super(e),this.name="StadataException",Object.setPrototypeOf(this,o.prototype);}},z=class o extends K{constructor(t,r,i){super(t);this.statusCode=r;this.response=i;this.name="ApiException",Object.setPrototypeOf(this,o.prototype);}},Ue=class o extends K{constructor(e="Request was cancelled"){super(e),this.name="CancelledException",Object.setPrototypeOf(this,o.prototype);}},cr=class o extends K{constructor(e){super(e),this.name="NetworkException",Object.setPrototypeOf(this,o.prototype);}},ur=class o extends K{constructor(e="Request timeout"){super(e),this.name="TimeoutException",Object.setPrototypeOf(this,o.prototype);}},mr=class o extends z{constructor(e="Resource not found"){super(e,404),this.name="NotFoundException",Object.setPrototypeOf(this,o.prototype);}},pr=class o extends z{constructor(e="Unauthorized"){super(e,401),this.name="UnauthorizedException",Object.setPrototypeOf(this,o.prototype);}},dr=class o extends z{constructor(e="Forbidden"){super(e,403),this.name="ForbiddenException",Object.setPrototypeOf(this,o.prototype);}},gr=class o extends z{constructor(e="Server error",t=500){super(e,t),this.name="ServerException",Object.setPrototypeOf(this,o.prototype);}};var yr=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 Ue(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 Rr=class{static parse(e){if(!e)return null;try{let t=new Date(e);return isNaN(t.getTime())?null:t}catch{return null}}static format(e){if(!e||!(e instanceof Date))return null;try{return e.toISOString()}catch{return null}}static formatReadable(e){if(!e||!(e instanceof Date))return null;try{return e.toLocaleDateString("id-ID",{year:"numeric",month:"long",day:"numeric"})}catch{return null}}static isValid(e){return this.parse(e)!==null}static toTimestamp(e){let t=this.parse(e);return t?t.getTime():null}static fromTimestamp(e){return new Date(e)}static now(){return new Date().toISOString()}static nowTimestamp(){return Date.now()}};var J=class o extends u{constructor(t,r,i,s,c,l){super();this.id=t;this.title=r;this.content=i;this.releaseDate=s;this.categoryId=c;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.repository=e;}async execute(e){return this.repository.getAll(e)}};var ue=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Ne=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=`${m.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=`${m.NEWS_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Oe=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 c=s.map(n=>J.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>J.fromJson(n))}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 J.fromJson(i)}catch(i){throw new a(`Failed to parse news data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var f=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 Oe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ce(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ue(r)});}static getAllNewsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};f.REMOTE_DATA_SOURCE="NewsRemoteDataSource",f.REPOSITORY="NewsRepository",f.GET_ALL_USE_CASE="GetAllNews",f.GET_BY_ID_USE_CASE="GetNewsById";var H=class o extends u{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 Ve=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Fe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var _t=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=`${m.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=`${m.NEWS_CATEGORY_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var vt=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 c=s.map(n=>H.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>H.fromJson(n))}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 H.fromJson(i)}catch(i){throw new a(`Failed to parse news category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var P=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new _t(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new vt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ve(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Fe(r)});}static getAllNewsCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};P.REMOTE_DATA_SOURCE="NewsCategoryRemoteDataSource",P.REPOSITORY="NewsCategoryRepository",P.GET_ALL_USE_CASE="GetAllNewsCategories",P.GET_BY_ID_USE_CASE="GetNewsCategoryById";var Y=class o extends u{constructor(t,r,i,s,c,l,p,n,y,B,ir){super();this.id=t;this.subjectId=r;this.subject=i;this.title=s;this.abstract=c;this.releaseDate=l;this.updatedDate=p;this.pdf=n;this.size=y;this.slide=B;this.thumbnail=ir;}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 me=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var pe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Be=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=`${m.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=`${m.PRESS_RELEASE_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Ge=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 c=s.map(n=>Y.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>Y.fromJson(n))}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 Y.fromJson(i)}catch(i){throw new a(`Failed to parse press release data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var h=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Be(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ge(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new me(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new pe(r)});}static getAllPressReleasesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPressReleaseByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};h.REMOTE_DATA_SOURCE="PressReleaseRemoteDataSource",h.REPOSITORY="PressReleaseRepository",h.GET_ALL_USE_CASE="GetAllPressReleases",h.GET_BY_ID_USE_CASE="GetPressReleaseById";var q=class o extends u{constructor(t,r,i,s,c,l){super();this.id=t;this.title=r;this.subjectId=i;this.size=s;this.updatedAt=c;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 de=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var ge=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};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()),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=`${m.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=`${m.STATIC_TABLE_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};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 c=s.map(n=>q.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>q.fromJson(n))}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 q.fromJson(i)}catch(i){throw new a(`Failed to parse static table data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var S=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 Je(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new de(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ge(r)});}static getAllStaticTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStaticTableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};S.REMOTE_DATA_SOURCE="StaticTableRemoteDataSource",S.REPOSITORY="StaticTableRepository",S.GET_ALL_USE_CASE="GetAllStaticTables",S.GET_BY_ID_USE_CASE="GetStaticTableById";var Q=class o extends u{constructor(t,r,i){super();this.id=t;this.name=r;this.categoryId=i;}toJson(){return {subj_id:this.id,title:this.name,subcatid:this.categoryId}}static fromJson(t){return new o(Number(t.subj_id||t.id||0),String(t.title||t.name||""),Number(t.subcatid||t.categoryId||0))}};var Ye=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var qe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Tt=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=`${m.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=`${m.SUBJECT_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Dt=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 c=s.map(n=>Q.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>Q.fromJson(n))}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 Q.fromJson(i)}catch(i){throw new a(`Failed to parse subject data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var A=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Tt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Dt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ye(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new qe(r)});}static getAllSubjectsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};A.REMOTE_DATA_SOURCE="SubjectRemoteDataSource",A.REPOSITORY="SubjectRepository",A.GET_ALL_USE_CASE="GetAllSubjects",A.GET_BY_ID_USE_CASE="GetSubjectById";var Z=class o extends u{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.name||""))}};var Me=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var We=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Lt=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=`${m.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=`${m.SUBJECT_CATEGORY_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var kt=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 c=s.map(n=>Z.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>Z.fromJson(n))}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 Z.fromJson(i)}catch(i){throw new a(`Failed to parse subject category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var E=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Lt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new kt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Me(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new We(r)});}static getAllSubjectCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};E.REMOTE_DATA_SOURCE="SubjectCategoryRemoteDataSource",E.REPOSITORY="SubjectCategoryRepository",E.GET_ALL_USE_CASE="GetAllSubjectCategories",E.GET_BY_ID_USE_CASE="GetSubjectCategoryById";var X=class o extends u{constructor(t,r,i,s,c,l,p,n,y,B,ir){super();this.variableId=t;this.indicatorId=r;this.subjectCsa=i;this.title=s;this.name=c;this.dataSource=l;this.value=p;this.unit=n;this.category=y;this.hashId=B;this.period=ir;}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 Ke=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var ze=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var xt=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=`${m.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=`${m.STRATEGIC_INDICATOR_LIST}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Ut=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 c=s.map(n=>X.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>X.fromJson(n))}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 X.fromJson(i)}catch(i){throw new a(`Failed to parse strategic indicator data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var I=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new xt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ut(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ke(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ze(r)});}static getAllStrategicIndicatorsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStrategicIndicatorByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};I.REMOTE_DATA_SOURCE="StrategicIndicatorRemoteDataSource",I.REPOSITORY="StrategicIndicatorRepository",I.GET_ALL_USE_CASE="GetAllStrategicIndicators",I.GET_BY_ID_USE_CASE="GetStrategicIndicatorById";var j=class o extends u{constructor(t,r,i,s,c,l,p){super();this.id=t;this.title=r;this.subjectId=i;this.unit=s;this.verticalVariableCount=c;this.derivedVariableCount=l;this.graph=p;}toJson(){return {var_id:this.id,title:this.title,subject_id:this.subjectId,unit:this.unit,vertical_variable:this.verticalVariableCount,derived_variable:this.derivedVariableCount,graph:this.graph}}static fromJson(t){let r=t.graph||t.graphs,i=[];return Array.isArray(r)?i=r.map(s=>String(s)):typeof r=="string"&&(i=[r]),new o(Number(t.var_id||t.id||0),String(t.title||t.name||""),Number(t.subject_id||t.subjectId||0),String(t.unit||""),Number(t.vertical_variable||t.verticalVariableCount||0),Number(t.derived_variable||t.derivedVariableCount||0),i)}};var He=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Qe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Nt=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=`${m.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=`${m.VARIABLE_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Ot=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 c=s.map(n=>j.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>j.fromJson(n))}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 j.fromJson(i)}catch(i){throw new a(`Failed to parse variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var C=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Nt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ot(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new He(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Qe(r)});}static getAllVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};C.REMOTE_DATA_SOURCE="VariableRemoteDataSource",C.REPOSITORY="VariableRepository",C.GET_ALL_USE_CASE="GetAllVariables",C.GET_BY_ID_USE_CASE="GetVariableById";var ee=class o extends u{constructor(t,r,i,s,c){super();this.id=t;this.label=r;this.itemId=i;this.groupId=s;this.groupName=c;}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 Ze=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Xe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Vt=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=`${m.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=`${m.VERTICAL_VARIABLE_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Ft=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 c=s.map(n=>ee.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>ee.fromJson(n))}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 ee.fromJson(i)}catch(i){throw new a(`Failed to parse vertical variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var _=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Vt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ft(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ze(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Xe(r)});}static getAllVerticalVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVerticalVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};_.REMOTE_DATA_SOURCE="VerticalVariableRemoteDataSource",_.REPOSITORY="VerticalVariableRepository",_.GET_ALL_USE_CASE="GetAllVerticalVariables",_.GET_BY_ID_USE_CASE="GetVerticalVariableById";var te=class o extends u{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 je=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 Bt=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=`${m.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=`${m.UNIT_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Gt=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 c=s.map(n=>te.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>te.fromJson(n))}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 te.fromJson(i)}catch(i){throw new a(`Failed to parse unit data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var v=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Bt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Gt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new je(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new et(r)});}static getAllUnitsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getUnitByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};v.REMOTE_DATA_SOURCE="UnitRemoteDataSource",v.REPOSITORY="UnitRepository",v.GET_ALL_USE_CASE="GetAllUnits",v.GET_BY_ID_USE_CASE="GetUnitById";var re=class o extends u{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 tt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var rt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var $t=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=`${m.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=`${m.PERIOD_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Jt=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 c=s.map(n=>re.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>re.fromJson(n))}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"}`)}})}};var T=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new $t(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Jt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new tt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new rt(r)});}static getAllPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};T.REMOTE_DATA_SOURCE="PeriodRemoteDataSource",T.REPOSITORY="PeriodRepository",T.GET_ALL_USE_CASE="GetAllPeriods",T.GET_BY_ID_USE_CASE="GetPeriodById";var ie=class o extends u{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 it=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var ot=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var Yt=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=`${m.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=`${m.DERIVED_PERIOD_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var qt=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 c=s.map(n=>ie.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>ie.fromJson(n))}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 ie.fromJson(i)}catch(i){throw new a(`Failed to parse derived period data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var D=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Yt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new qt(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 ot(r)});}static getAllDerivedPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};D.REMOTE_DATA_SOURCE="DerivedPeriodRemoteDataSource",D.REPOSITORY="DerivedPeriodRepository",D.GET_ALL_USE_CASE="GetAllDerivedPeriods",D.GET_BY_ID_USE_CASE="GetDerivedPeriodById";var oe=class o extends u{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 st=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var at=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var Mt=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=`${m.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=`${m.DERIVED_VARIABLE_VIEW}/${e.id}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Wt=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 c=s.map(n=>oe.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>oe.fromJson(n))}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 oe.fromJson(i)}catch(i){throw new a(`Failed to parse derived variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var L=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Mt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Wt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new st(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new at(r)});}static getAllDerivedVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};L.REMOTE_DATA_SOURCE="DerivedVariableRemoteDataSource",L.REPOSITORY="DerivedVariableRepository",L.GET_ALL_USE_CASE="GetAllDerivedVariables",L.GET_BY_ID_USE_CASE="GetDerivedVariableById";var se=class o extends u{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 nt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var lt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var Kt=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=`${m.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=`${m.statisticClassification(i)}${r?`?${r}`:""}`;return this.client.get(s,{cancelToken:e.cancelToken})}};var zt=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 c=s.map(n=>se.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>se.fromJson(n))}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"}`)}})}};var k=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Kt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new zt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new nt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new lt(r)});}static getAllStatisticClassificationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStatisticClassificationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};k.REMOTE_DATA_SOURCE="StatisticClassificationRemoteDataSource",k.REPOSITORY="StatisticClassificationRepository",k.GET_ALL_USE_CASE="GetAllStatisticClassifications",k.GET_BY_ID_USE_CASE="GetStatisticClassificationById";var ct=class o extends u{constructor(t,r,i,s,c){super();this.id=t;this.name=r;this.itemId=i;this.itemCode=s;this.itemName=c;}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 ye=class o extends u{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 ut=class o extends u{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 mt=class o extends u{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 pt=class o extends u{constructor(t,r,i,s,c,l){super();this.id=t;this.topicId=r;this.topic=i;this.eventId=s;this.name=c;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 dt=class o extends u{constructor(t,r,i,s,c,l,p,n,y){super();this.regionId=t;this.regionCode=r;this.regionName=i;this.indicatorId=s;this.indicatorName=c;this.categories=l;this.period=p;this.value=n;this.regionLevel=y;}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}`]||""),c=String(t[`nama_kategori_${i}`]||""),l=String(t[`id_item_kategori_${i}`]||""),p=String(t[`kode_item_kategori_${i}`]||""),n=String(t[`nama_item__kategori_${i}`]||"");!s||!c||!l||!p||!n||r.push(new ct(s,c,l,p,n));}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 gt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var yt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Ht=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=`${m.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=`${m.CENSUS}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Qt=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 n=s;n.data&&Array.isArray(n.data)&&(s=n.data);}if(!s||!Array.isArray(s))return this.createEmptyListResult(e,i);let c=s.map(n=>this.parseEntity(n,e?.type)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return new d(c,new x(Number(i.page||1),p,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 ye.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 ut.fromJson(e);case "areas":return mt.fromJson(e);case "datasets":return pt.fromJson(e);case "data":return dt.fromJson(e);case "events":default:return ye.fromJson(e)}}createEmptyListResult(e,t){return d.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))}};var g=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ht(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Qt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new gt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new yt(r)});}static getAllCensusesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getCensusByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};g.REMOTE_DATA_SOURCE="CensusRemoteDataSource",g.REPOSITORY="CensusRepository",g.GET_ALL_USE_CASE="GetAllCensuses",g.GET_BY_ID_USE_CASE="GetCensusById";var Re=class o extends u{constructor(t,r,i,s,c,l,p,n,y,B,ir,Cr){super();this.variableId=t;this.title=r;this.subjectId=i;this.subjectName=s;this.notes=c;this.unit=l;this.verticalVariableId=p;this.domain=n;this.csaSubjectId=y;this.csaSubjectName=B;this.graphId=ir;this.graphName=Cr;}toJson(){return {var:this.variableId,label:this.title,subj:this.subjectId,subj_label:this.subjectName,notes:this.notes,unit:this.unit,vervar:this.verticalVariableId,table:this.domain,subcsa:this.csaSubjectId,subcsa_label:this.csaSubjectName,graph:this.graphId,graph_label:this.graphName}}static fromJson(t){let r=t.var,i=t.subj;return new o(typeof r=="number"?r:parseInt(String(r||0)),String(t.label||""),typeof i=="number"?i:parseInt(String(i||0)),String(t.subj_label||""),String(t.notes||""),String(t.unit||""),Number(t.vervar||0),String(t.table||""),t.subcsa!==void 0?Number(t.subcsa):void 0,t.subcsa_label!==void 0?String(t.subcsa_label):void 0,t.graph!==void 0?Number(t.graph):void 0,t.graph_label!==void 0?String(t.graph_label):void 0)}};var Rt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Zt=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain?t.domain=e.domain:t.domain=e.tableId,e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString());let r=new URLSearchParams(t).toString(),i=`${m.VARIABLE_LIST}${r?`?${r}`:""}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var Xt=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 c=s.map(n=>Re.fromJson(n)),l=Number(i.count)||s.length,p=Number(i.per_page)||l;return d.fromJson({data:c,pagination:{page:Number(i.page||1),per_page:p,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},n=>Re.fromJson(n))}catch(i){throw new a(`Failed to parse dynamic table: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var F=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Zt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Xt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Rt(r)});}static getAllDynamicTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};F.REMOTE_DATA_SOURCE="DynamicTableRemoteDataSource",F.REPOSITORY="DynamicTableRepository",F.GET_ALL_USE_CASE="GetAllDynamicTables";var jt=class{constructor(e){this.injector=e;}async domains(e){return V.getAllDomainsUseCase(this.injector).execute(e)}async publications(e){return w.getAllPublicationsUseCase(this.injector).execute(e)}async infographics(e){return b.getAllInfographicsUseCase(this.injector).execute(e)}async news(e){return f.getAllNewsUseCase(this.injector).execute(e)}async newsCategories(e){return P.getAllNewsCategoriesUseCase(this.injector).execute(e)}async pressReleases(e){return h.getAllPressReleasesUseCase(this.injector).execute(e)}async staticTables(e){return S.getAllStaticTablesUseCase(this.injector).execute(e)}async subjects(e){return A.getAllSubjectsUseCase(this.injector).execute(e)}async subjectCategories(e){return E.getAllSubjectCategoriesUseCase(this.injector).execute(e)}async strategicIndicators(e){return I.getAllStrategicIndicatorsUseCase(this.injector).execute(e)}async variables(e){return C.getAllVariablesUseCase(this.injector).execute(e)}async verticalVariables(e){return _.getAllVerticalVariablesUseCase(this.injector).execute(e)}async units(e){return v.getAllUnitsUseCase(this.injector).execute(e)}async periods(e){return T.getAllPeriodsUseCase(this.injector).execute(e)}async derivedPeriods(e){return D.getAllDerivedPeriodsUseCase(this.injector).execute(e)}async derivedVariables(e){return L.getAllDerivedVariablesUseCase(this.injector).execute(e)}async statisticClassifications(e){return k.getAllStatisticClassificationsUseCase(this.injector).execute(e)}async censusEvents(){return g.getAllCensusesUseCase(this.injector).execute()}async censusTopics(e){return g.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"topics"})}async censusEventAreas(e){return g.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"areas"})}async censusEventDatasets(e){return g.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,topicId:e.topicId,type:"datasets"})}async censusData(e){return g.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,censusAreaId:e.censusAreaId,datasetId:e.datasetId,type:"data"})}async dynamicTables(e){return F.getAllDynamicTablesUseCase(this.injector).execute(e)}};var er=class{constructor(e){this.injector=e;}async publication(e){return w.getPublicationByIdUseCase(this.injector).execute(e)}async infographic(e){return b.getInfographicByIdUseCase(this.injector).execute(e)}async news(e){return f.getNewsByIdUseCase(this.injector).execute(e)}async newsCategory(e){return P.getNewsCategoryByIdUseCase(this.injector).execute(e)}async pressRelease(e){return h.getPressReleaseByIdUseCase(this.injector).execute(e)}async staticTable(e){return S.getStaticTableByIdUseCase(this.injector).execute(e)}async subject(e){return A.getSubjectByIdUseCase(this.injector).execute(e)}async subjectCategory(e){return E.getSubjectCategoryByIdUseCase(this.injector).execute(e)}async strategicIndicator(e){return I.getStrategicIndicatorByIdUseCase(this.injector).execute(e)}async variable(e){return C.getVariableByIdUseCase(this.injector).execute(e)}async verticalVariable(e){return _.getVerticalVariableByIdUseCase(this.injector).execute(e)}async unit(e){return v.getUnitByIdUseCase(this.injector).execute(e)}async period(e){return T.getPeriodByIdUseCase(this.injector).execute(e)}async derivedPeriod(e){return D.getDerivedPeriodByIdUseCase(this.injector).execute(e)}async derivedVariable(e){return L.getDerivedVariableByIdUseCase(this.injector).execute(e)}async statisticClassification(e){return k.getStatisticClassificationByIdUseCase(this.injector).execute(e)}async census(e){return g.getCensusByIdUseCase(this.injector).execute(e)}};var fr=class o extends u{constructor(t,r,i,s,c,l){super();this.value=t;this.netWeight=r;this.hsCode=i;this.port=s;this.country=c;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 ft=class{constructor(e){this.repository=e;}execute(e){return this.repository.get(e)}};var tr=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=`${m.TRADE}?${r}`;return this.client.get(i,{cancelToken:e.cancelToken})}};var rr=class{constructor(e){this.remoteDataSource=e;}get(e){return this.remoteDataSource.get(e)}};var ae=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new tr(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new rr(r)}),e.registerFactory(this.GET_TRADE_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ft(r)});}static getTradeUseCase(e){return e.resolve(this.GET_TRADE_USE_CASE)}};ae.REMOTE_DATA_SOURCE="TradeRemoteDataSource",ae.REPOSITORY="TradeRepository",ae.GET_TRADE_USE_CASE="GetTrade";var R=class R{constructor(e){this.logger=O.getInstance(),this.logger.configure({enabled:e.debug??false,filter:new $(e.logLevel??1)}),ne.getInstance().setApiKey(e.apiKey),this.authInterceptor=new Ce(e.apiKey);let t=[this.authInterceptor,...e.interceptors||[]];this.networkClient=new Ie({baseURL:e.baseURL||wt.BASE_URL,timeout:e.timeout||wt.DEFAULT_TIMEOUT,interceptors:t}),this.injector=fe.getInstance(),this.setupDependencies(),this._list=new jt(this.injector),this._view=new er(this.injector),this.logger.info("StadataJS initialized successfully");}static get instance(){if(!R._instance)throw new Error("StadataJS not initialized. Call StadataJS.init() first.");return R._instance}static init(e){return R._instance&&R._instance.logger.warn("StadataJS already initialized. Reinitializing..."),R._instance=new R(e),R._instance}static isInitialized(){return R._instance!==null}static destroy(){R._instance&&(R._instance.cleanup(),R._instance=null);}get list(){return this._list}get view(){return this._view}setApiKey(e){ne.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 $(0)});}disableDebug(){this.logger.configure({filter:new $(1)});}async trade(e){return this.injector.resolve("GetTrade").execute(e)}setupDependencies(){V.register(this.injector,this.networkClient),w.register(this.injector,this.networkClient),b.register(this.injector,this.networkClient),f.register(this.injector,this.networkClient),P.register(this.injector,this.networkClient),h.register(this.injector,this.networkClient),S.register(this.injector,this.networkClient),A.register(this.injector,this.networkClient),E.register(this.injector,this.networkClient),I.register(this.injector,this.networkClient),C.register(this.injector,this.networkClient),_.register(this.injector,this.networkClient),v.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),g.register(this.injector,this.networkClient),F.register(this.injector,this.networkClient),ae.register(this.injector,this.networkClient);}cleanup(){this.injector.clear(),ne.getInstance().clearApiKey(),this.logger.info("StadataJS cleaned up");}};R._instance=null;var hr=R;var Tr=(t=>(t[t.Export=1]="Export",t[t.Import=2]="Import",t))(Tr||{}),Dr=(t=>(t[t.Monthly=1]="Monthly",t[t.Annually=2]="Annually",t))(Dr||{}),Lr=(t=>(t[t.TwoDigit=1]="TwoDigit",t[t.Full=2]="Full",t))(Lr||{});
|
|
2
|
-
export{
|
|
1
|
+
import {err,ok}from'neverthrow';var fe=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 O=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}},N=class extends O{constructor(t,r,i){super(t,i);this.statusCode=r;}},be=class extends O{constructor(e="Request was cancelled"){super(e,"CANCELLED");}},he=class extends O{constructor(e){super(e,"NETWORK_ERROR");}},we=class extends O{constructor(e="Request timeout"){super(e,"TIMEOUT");}},Se=class extends N{constructor(e="Resource not found"){super(e,404,"NOT_FOUND");}},Pe=class extends N{constructor(e="Unauthorized"){super(e,401,"UNAUTHORIZED");}},Ae=class extends N{constructor(e="Forbidden"){super(e,403,"FORBIDDEN");}},Ee=class extends N{constructor(e="Server error",t=500){super(e,t,"SERVER_ERROR");}},a=class extends O{constructor(e){super(e,"PARSE_ERROR");}},lr=class extends O{constructor(e){super(e,"VALIDATION_ERROR");}};var Ie=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,w])=>{d.toLowerCase()!=="content-type"&&(s[d]=w);}),Object.assign(s,r.headers);let l={method:e,headers:s};e!=="GET"&&r.body&&(l.body=JSON.stringify(r.body)),r.cancelToken&&(l.signal=r.cancelToken.signal);for(let d of this.interceptors)if(d.onRequest){let w=await d.onRequest(i,l);i=w.url,l=w.init;}let u=await this.fetchWithTimeout(i,l,r.timeout||this.timeout);for(let d of this.interceptors)d.onResponse&&(u=await d.onResponse(u));if(!u.ok)return err(await this.handleErrorResponse(u));let n=await u.json();return ok(n)}catch(i){return err(await this.handleError(i,r.cancelToken))}}async fetchWithTimeout(e,t,r){let i=new AbortController,s=setTimeout(()=>i.abort(),r);try{let l=t.signal&&t.signal instanceof AbortSignal?this.combineSignals(t.signal,i.signal):i.signal;return await fetch(e,{...t,signal:l})}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 Pe(r);case 403:return new Ae(r);case 404:return new Se(r);case 500:case 502:case 503:case 504:return new Ee(r,t);default:return new N(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 be(t?.reason):r.name==="AbortError"||r.message.includes("timeout")||r.message.includes("aborted")?new we:r.message.includes("network")||r.message.includes("fetch")||r.message.includes("ECONNREFUSED")?new he(r.message):new N(r.message)}};var G=class{};var Ce=class extends G{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 wt=(l=>(l[l.DEBUG=0]="DEBUG",l[l.INFO=1]="INFO",l[l.WARN=2]="WARN",l[l.ERROR=3]="ERROR",l[l.FATAL=4]="FATAL",l[l.NONE=5]="NONE",l))(wt||{}),ht=class{print(e){let t=wt[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}},V=class o{constructor(e=new ht,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 cr=class extends G{constructor(e){super(),this.logger=e||V.getInstance();}onRequest(e,t){return this.logger.debug(`HTTP Request: ${t.method||"GET"} ${e}`,{headers:t.headers,body:t.body}),{url:e,init:t}}onResponse(e){return this.logger.debug(`HTTP Response: ${e.status} ${e.url}`,{status:e.status,statusText:e.statusText,headers:Object.fromEntries(e.headers.entries())}),e}onError(e){return this.logger.error(`HTTP Error: ${e.message}`,e),e}};var ur=class extends G{constructor(t={},r){super();this.retryCount=new Map;this.logger=r||V.getInstance(),this.config={maxRetries:t.maxRetries??3,retryDelay:t.retryDelay??1e3,retryableStatusCodes:t.retryableStatusCodes??[408,429,500,502,503,504],exponentialBackoff:t.exponentialBackoff??true};}async onResponse(t){let r=t.url,i=this.retryCount.get(r)||0;if(!t.ok&&this.config.retryableStatusCodes.includes(t.status)&&i<this.config.maxRetries){this.retryCount.set(r,i+1);let s=this.config.exponentialBackoff?this.config.retryDelay*Math.pow(2,i):this.config.retryDelay;throw this.logger.warn(`Retrying request (${i+1}/${this.config.maxRetries}) after ${s}ms: ${t.url}`),await this.sleep(s),new Error(`RETRY_NEEDED:${r}`)}return (t.ok||i>=this.config.maxRetries)&&this.retryCount.delete(r),t}sleep(t){return new Promise(r=>setTimeout(r,t))}resetRetryCount(t){this.retryCount.delete(t);}clearAllRetryCounts(){this.retryCount.clear();}};var St={BASE_URL:"https://webapi.bps.go.id/v1/api",DEFAULT_TIMEOUT:3e4,API_VERSION:"v1",DEFAULT_PAGE_SIZE:10,MAX_PAGE_SIZE:100};var Ir=(t=>(t.ID="ind",t.EN="eng",t))(Ir||{});var Cr=(r=>(r.AVAILABLE="available",r.NOT_AVAILABLE="not-available",r.LIST_NOT_AVAILABLE="list-not-available",r))(Cr||{});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||{}),_r=(s=>(s.CATEGORY="kategori",s.PRIMARY_GROUP="golongan pokok",s.GROUP="golongan",s.SUB_GROUP="subgolongan",s.CLUSTER="kelompok",s))(_r||{}),Tr=(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))(Tr||{});var Dr=(i=>(i.ALL="all",i.PROVINCE="prov",i.REGENCY="kab",i.REGENCY_BY_PROVINCE="kabbyprov",i))(Dr||{});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 kr={KEY:"key",DOMAIN:"domain",LANG:"lang",PAGE:"page",PER_PAGE:"per_page",KEYWORD:"keyword",MONTH:"month",YEAR:"year",SUBJECT:"subj",VARIABLE:"var",TURVAR:"turvar",TURTH:"turth",PERIOD:"th",TYPE:"type",TABLE:"table",MODEL:"model",ID:"id",SHOW_DELETED:"show_deleted"};var le=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 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 ce=class{},mr=class extends ce{call(){return this.execute()}};var ve=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 _e=class extends ce{constructor(t){super();this.repository=t;}async execute(t){return this.repository.getAll(t)}};var Pt=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 U=class o extends m{constructor(t,r,i,s,l){super();this.page=t;this.perPage=r;this.total=i;this.pages=s;this.count=l;}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 pr=class o extends m{constructor(t,r,i){super();this.data=t;this.dataAvailability=r;this.pagination=i;}get isAvailable(){return this.dataAvailability==="available"}get totalItems(){return this.pagination?.total||this.data.length}get hasData(){return this.data.length>0}toJson(){return {data:this.data,data_availability:this.dataAvailability,pagination:this.pagination?.toJson()}}static fromJson(t,r){let s=(t.data||[]).map(u=>r(u)),l=t.pagination,c=l?U.fromJson(l):void 0;return new o(s,t["data-availability"]||"available",c)}};var g=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)),l=t.pagination,c=U.fromJson(l);return new o(s,c)}};var At=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 l=s.map(d=>ve.fromJson(d)),c=Number(i.count)||s.length,u=Number(i.per_page)||c,n=new U(Number(i.page||1),u,Number(i.total||0),Number(i.pages||1),c);return new g(l,n)}catch(i){throw new a(`Failed to parse domain data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var F=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Pt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new At(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new _e(r)});}static getAllDomainsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};F.REMOTE_DATA_SOURCE="DomainRemoteDataSource",F.REPOSITORY="DomainRepository",F.GET_ALL_USE_CASE="GetAllDomains";var Te=class o extends m{constructor(t,r,i,s,l){super();this.id=t;this.title=r;this.releaseDate=i;this.url=s;this.cover=l;}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 M=class o extends m{constructor(t,r,i,s,l,c,u,n,d,w,Ar,Or,Vr){super();this.id=t;this.title=r;this.issn=i;this.cover=s;this.pdf=l;this.size=c;this.scheduledDate=u;this.releaseDate=n;this.updateDate=d;this.abstract=w;this.catalogueNumber=Ar;this.publicationNumber=Or;this.relatedPublications=Vr;}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=>Te.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 De=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Le=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Et=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 It=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 l=s.map(n=>M.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>M.fromJson(n))}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 M.fromJson(i)}catch(i){throw new a(`Failed to parse publication data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var S=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 It(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new De(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Le(r)});}static getAllPublicationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPublicationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};S.REMOTE_DATA_SOURCE="PublicationRemoteDataSource",S.REPOSITORY="PublicationRepository",S.GET_ALL_USE_CASE="GetAllPublications",S.GET_BY_ID_USE_CASE="GetPublicationById";var W=class o extends m{constructor(t,r,i,s,l,c){super();this.id=t;this.title=r;this.image=i;this.category=s;this.downloadUrl=l;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 ke=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var xe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Ct=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 vt=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 l=s.map(n=>W.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>W.fromJson(n))}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 W.fromJson(i)}catch(i){throw new a(`Failed to parse infographic data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var P=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ct(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new vt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ke(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new xe(r)});}static getAllInfographicsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getInfographicByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};P.REMOTE_DATA_SOURCE="InfographicRemoteDataSource",P.REPOSITORY="InfographicRepository",P.GET_ALL_USE_CASE="GetAllInfographics",P.GET_BY_ID_USE_CASE="GetInfographicById";var K=class o extends Error{constructor(e){super(e),this.name="StadataException",Object.setPrototypeOf(this,o.prototype);}},z=class o extends K{constructor(t,r,i){super(t);this.statusCode=r;this.response=i;this.name="ApiException",Object.setPrototypeOf(this,o.prototype);}},Ue=class o extends K{constructor(e="Request was cancelled"){super(e),this.name="CancelledException",Object.setPrototypeOf(this,o.prototype);}},dr=class o extends K{constructor(e){super(e),this.name="NetworkException",Object.setPrototypeOf(this,o.prototype);}},gr=class o extends K{constructor(e="Request timeout"){super(e),this.name="TimeoutException",Object.setPrototypeOf(this,o.prototype);}},yr=class o extends z{constructor(e="Resource not found"){super(e,404),this.name="NotFoundException",Object.setPrototypeOf(this,o.prototype);}},Rr=class o extends z{constructor(e="Unauthorized"){super(e,401),this.name="UnauthorizedException",Object.setPrototypeOf(this,o.prototype);}},fr=class o extends z{constructor(e="Forbidden"){super(e,403),this.name="ForbiddenException",Object.setPrototypeOf(this,o.prototype);}},br=class o extends z{constructor(e="Server error",t=500){super(e,t),this.name="ServerException",Object.setPrototypeOf(this,o.prototype);}};var hr=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 Ue(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 wr=class{static parse(e){if(!e)return null;try{let t=new Date(e);return isNaN(t.getTime())?null:t}catch{return null}}static format(e){if(!e||!(e instanceof Date))return null;try{return e.toISOString()}catch{return null}}static formatReadable(e){if(!e||!(e instanceof Date))return null;try{return e.toLocaleDateString("id-ID",{year:"numeric",month:"long",day:"numeric"})}catch{return null}}static isValid(e){return this.parse(e)!==null}static toTimestamp(e){let t=this.parse(e);return t?t.getTime():null}static fromTimestamp(e){return new Date(e)}static now(){return new Date().toISOString()}static nowTimestamp(){return Date.now()}};var $=class o extends m{constructor(t,r,i,s,l,c){super();this.id=t;this.title=r;this.content=i;this.releaseDate=s;this.categoryId=l;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 ue=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var me=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Ne=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 Oe=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 l=s.map(n=>$.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>$.fromJson(n))}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 $.fromJson(i)}catch(i){throw new a(`Failed to parse news data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var f=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 Oe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ue(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new me(r)});}static getAllNewsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};f.REMOTE_DATA_SOURCE="NewsRemoteDataSource",f.REPOSITORY="NewsRepository",f.GET_ALL_USE_CASE="GetAllNews",f.GET_BY_ID_USE_CASE="GetNewsById";var H=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 Ve=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Fe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var _t=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 Tt=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 l=s.map(n=>H.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>H.fromJson(n))}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 H.fromJson(i)}catch(i){throw new a(`Failed to parse news category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var A=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new _t(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Tt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ve(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Fe(r)});}static getAllNewsCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};A.REMOTE_DATA_SOURCE="NewsCategoryRemoteDataSource",A.REPOSITORY="NewsCategoryRepository",A.GET_ALL_USE_CASE="GetAllNewsCategories",A.GET_BY_ID_USE_CASE="GetNewsCategoryById";var Y=class o extends m{constructor(t,r,i,s,l,c,u,n,d,w,Ar){super();this.id=t;this.subjectId=r;this.subject=i;this.title=s;this.abstract=l;this.releaseDate=c;this.updatedDate=u;this.pdf=n;this.size=d;this.slide=w;this.thumbnail=Ar;}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 pe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var de=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Be=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 Ge=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 l=s.map(n=>Y.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>Y.fromJson(n))}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 Y.fromJson(i)}catch(i){throw new a(`Failed to parse press release data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var b=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Be(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ge(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new pe(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new de(r)});}static getAllPressReleasesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPressReleaseByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};b.REMOTE_DATA_SOURCE="PressReleaseRemoteDataSource",b.REPOSITORY="PressReleaseRepository",b.GET_ALL_USE_CASE="GetAllPressReleases",b.GET_BY_ID_USE_CASE="GetPressReleaseById";var q=class o extends m{constructor(t,r,i,s,l,c){super();this.id=t;this.title=r;this.subjectId=i;this.size=s;this.updatedAt=l;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 ge=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var ye=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Je=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 $e=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 l=s.map(n=>q.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>q.fromJson(n))}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 q.fromJson(i)}catch(i){throw new a(`Failed to parse static table data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var h=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Je(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new $e(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ge(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ye(r)});}static getAllStaticTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStaticTableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};h.REMOTE_DATA_SOURCE="StaticTableRemoteDataSource",h.REPOSITORY="StaticTableRepository",h.GET_ALL_USE_CASE="GetAllStaticTables",h.GET_BY_ID_USE_CASE="GetStaticTableById";var Q=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 Ye=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var qe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Dt=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 Lt=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 l=s.map(n=>Q.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>Q.fromJson(n))}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 Q.fromJson(i)}catch(i){throw new a(`Failed to parse subject data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var E=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Dt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Lt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ye(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new qe(r)});}static getAllSubjectsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};E.REMOTE_DATA_SOURCE="SubjectRemoteDataSource",E.REPOSITORY="SubjectRepository",E.GET_ALL_USE_CASE="GetAllSubjects",E.GET_BY_ID_USE_CASE="GetSubjectById";var Z=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 Me=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var We=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var kt=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 xt=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 l=s.map(n=>Z.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>Z.fromJson(n))}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 Z.fromJson(i)}catch(i){throw new a(`Failed to parse subject category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var I=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new kt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new xt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Me(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new We(r)});}static getAllSubjectCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};I.REMOTE_DATA_SOURCE="SubjectCategoryRemoteDataSource",I.REPOSITORY="SubjectCategoryRepository",I.GET_ALL_USE_CASE="GetAllSubjectCategories",I.GET_BY_ID_USE_CASE="GetSubjectCategoryById";var X=class o extends m{constructor(t,r,i,s,l,c,u,n,d,w,Ar){super();this.variableId=t;this.indicatorId=r;this.subjectCsa=i;this.title=s;this.name=l;this.dataSource=c;this.value=u;this.unit=n;this.category=d;this.hashId=w;this.period=Ar;}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 Ke=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var ze=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Ut=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 Nt=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 l=s.map(n=>X.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>X.fromJson(n))}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 X.fromJson(i)}catch(i){throw new a(`Failed to parse strategic indicator data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var C=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ut(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Nt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ke(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ze(r)});}static getAllStrategicIndicatorsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStrategicIndicatorByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};C.REMOTE_DATA_SOURCE="StrategicIndicatorRemoteDataSource",C.REPOSITORY="StrategicIndicatorRepository",C.GET_ALL_USE_CASE="GetAllStrategicIndicators",C.GET_BY_ID_USE_CASE="GetStrategicIndicatorById";var j=class o extends m{constructor(t,r,i,s,l,c,u){super();this.id=t;this.title=r;this.subjectId=i;this.unit=s;this.verticalVariableCount=l;this.derivedVariableCount=c;this.graph=u;}toJson(){return {var_id:this.id,title:this.title,subject_id:this.subjectId,unit:this.unit,vertical_variable:this.verticalVariableCount,derived_variable:this.derivedVariableCount,graph:this.graph}}static fromJson(t){let r=t.graph||t.graphs,i=[];return Array.isArray(r)?i=r.map(s=>String(s)):typeof r=="string"&&(i=[r]),new o(Number(t.var_id||t.id||0),String(t.title||t.name||""),Number(t.subject_id||t.subjectId||0),String(t.unit||""),Number(t.vertical_variable||t.verticalVariableCount||0),Number(t.derived_variable||t.derivedVariableCount||0),i)}};var He=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Qe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Ot=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 Vt=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 l=s.map(n=>j.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>j.fromJson(n))}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 j.fromJson(i)}catch(i){throw new a(`Failed to parse variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var v=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ot(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Vt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new He(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Qe(r)});}static getAllVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};v.REMOTE_DATA_SOURCE="VariableRemoteDataSource",v.REPOSITORY="VariableRepository",v.GET_ALL_USE_CASE="GetAllVariables",v.GET_BY_ID_USE_CASE="GetVariableById";var ee=class o extends m{constructor(t,r,i,s,l){super();this.id=t;this.label=r;this.itemId=i;this.groupId=s;this.groupName=l;}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 Ze=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Xe=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Ft=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 Bt=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 l=s.map(n=>ee.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>ee.fromJson(n))}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 ee.fromJson(i)}catch(i){throw new a(`Failed to parse vertical variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var _=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ft(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Bt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ze(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Xe(r)});}static getAllVerticalVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVerticalVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};_.REMOTE_DATA_SOURCE="VerticalVariableRemoteDataSource",_.REPOSITORY="VerticalVariableRepository",_.GET_ALL_USE_CASE="GetAllVerticalVariables",_.GET_BY_ID_USE_CASE="GetVerticalVariableById";var te=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 je=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 Gt=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 Jt=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 l=s.map(n=>te.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>te.fromJson(n))}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 te.fromJson(i)}catch(i){throw new a(`Failed to parse unit data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var T=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Gt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Jt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new je(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new et(r)});}static getAllUnitsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getUnitByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};T.REMOTE_DATA_SOURCE="UnitRemoteDataSource",T.REPOSITORY="UnitRepository",T.GET_ALL_USE_CASE="GetAllUnits",T.GET_BY_ID_USE_CASE="GetUnitById";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 tt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var rt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var $t=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 Yt=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 l=s.map(n=>re.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>re.fromJson(n))}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"}`)}})}};var D=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new $t(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Yt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new tt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new rt(r)});}static getAllPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};D.REMOTE_DATA_SOURCE="PeriodRemoteDataSource",D.REPOSITORY="PeriodRepository",D.GET_ALL_USE_CASE="GetAllPeriods",D.GET_BY_ID_USE_CASE="GetPeriodById";var ie=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 it=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var ot=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var qt=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 Mt=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 l=s.map(n=>ie.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>ie.fromJson(n))}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 ie.fromJson(i)}catch(i){throw new a(`Failed to parse derived period data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var L=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new qt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Mt(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 ot(r)});}static getAllDerivedPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};L.REMOTE_DATA_SOURCE="DerivedPeriodRemoteDataSource",L.REPOSITORY="DerivedPeriodRepository",L.GET_ALL_USE_CASE="GetAllDerivedPeriods",L.GET_BY_ID_USE_CASE="GetDerivedPeriodById";var oe=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 st=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var at=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var Wt=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 Kt=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 l=s.map(n=>oe.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>oe.fromJson(n))}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 oe.fromJson(i)}catch(i){throw new a(`Failed to parse derived variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var k=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Wt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Kt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new st(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new at(r)});}static getAllDerivedVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};k.REMOTE_DATA_SOURCE="DerivedVariableRemoteDataSource",k.REPOSITORY="DerivedVariableRepository",k.GET_ALL_USE_CASE="GetAllDerivedVariables",k.GET_BY_ID_USE_CASE="GetDerivedVariableById";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 nt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var lt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var zt=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 Ht=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 l=s.map(n=>se.fromJson(n)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:l,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},n=>se.fromJson(n))}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"}`)}})}};var x=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new zt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Ht(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new nt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new lt(r)});}static getAllStatisticClassificationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStatisticClassificationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};x.REMOTE_DATA_SOURCE="StatisticClassificationRemoteDataSource",x.REPOSITORY="StatisticClassificationRepository",x.GET_ALL_USE_CASE="GetAllStatisticClassifications",x.GET_BY_ID_USE_CASE="GetStatisticClassificationById";var ct=class o extends m{constructor(t,r,i,s,l){super();this.id=t;this.name=r;this.itemId=i;this.itemCode=s;this.itemName=l;}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 Re=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 ut=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 mt=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 pt=class o extends m{constructor(t,r,i,s,l,c){super();this.id=t;this.topicId=r;this.topic=i;this.eventId=s;this.name=l;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 dt=class o extends m{constructor(t,r,i,s,l,c,u,n,d){super();this.regionId=t;this.regionCode=r;this.regionName=i;this.indicatorId=s;this.indicatorName=l;this.categories=c;this.period=u;this.value=n;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}`]||""),l=String(t[`nama_kategori_${i}`]||""),c=String(t[`id_item_kategori_${i}`]||""),u=String(t[`kode_item_kategori_${i}`]||""),n=String(t[`nama_item__kategori_${i}`]||"");!s||!l||!c||!u||!n||r.push(new ct(s,l,c,u,n));}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 gt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var yt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Qt=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 Zt=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 n=s;n.data&&Array.isArray(n.data)&&(s=n.data);}if(!s||!Array.isArray(s))return this.createEmptyListResult(e,i);let l=s.map(n=>this.parseEntity(n,e?.type)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return new g(l,new U(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 Re.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 ut.fromJson(e);case "areas":return mt.fromJson(e);case "datasets":return pt.fromJson(e);case "data":return dt.fromJson(e);case "events":default:return Re.fromJson(e)}}createEmptyListResult(e,t){return g.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))}};var y=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Qt(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Zt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new gt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new yt(r)});}static getAllCensusesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getCensusByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};y.REMOTE_DATA_SOURCE="CensusRemoteDataSource",y.REPOSITORY="CensusRepository",y.GET_ALL_USE_CASE="GetAllCensuses",y.GET_BY_ID_USE_CASE="GetCensusById";var Xt=class o extends m{constructor(t,r,i,s,l,c,u){super();this.value=t;this.label=r;this.unit=i;this.subject=s;this.definition=l;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||""))}},jt=class o extends ae{static fromJson(e){let t=e.val;return new o(typeof t=="number"?t:String(t||""),String(e.label||""))}},er=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||""))}},tr=class o extends m{constructor(t,r,i,s,l){super();this.id=t;this.title=r;this.tableSource=i;this.lastUpdate=s;this.link=l;}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 Rt=class o extends m{constructor(t,r,i,s,l,c,u,n,d,w){super();this.subjects=t;this.variables=r;this.verticalVariables=i;this.verticalVariableLabel=s;this.periods=l;this.derivedVariables=c;this.derivedPeriods=u;this.dataContent=n;this.related=d;this.lastUpdate=w;}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:[],l=Array.isArray(t.tahun)?t.tahun:[],c=Array.isArray(t.turvar)?t.turvar:[],u=Array.isArray(t.turtahun)?t.turtahun:[],n=Array.isArray(t.related)?t.related:[];return new o(r.map(d=>er.fromJson(d)),i.map(d=>Xt.fromJson(d)),s.map(d=>ae.fromJson(d)),String(t.labelvervar||""),l.map(d=>jt.fromJson(d)),c.map(d=>ae.fromJson(d)),u.map(d=>ae.fromJson(d)),t.datacontent||{},n.map(d=>tr.fromJson(d)),t.last_update!==void 0?t.last_update:void 0)}getDataValue(t,r,i,s,l){let c=`${t}${r}${i}${s}${l}`;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",l=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(n=>({id:n.value,label:n.label,data:this.periods.map(d=>l?{id:d.value,label:d.label,data:this.derivedPeriods.map(w=>({id:w.value,label:w.label,value:this.getDataValue(u.value,i,n.value,d.value,w.value)??null}))}:{id:d.value,label:d.label,value:this.getDataValue(u.value,i,n.value,d.value,this.derivedPeriods[0]?.value||0)??null})}))}:{id:u.value,label:u.label,data:this.periods.map(n=>({id:n.value,label:n.label,data:l?this.derivedPeriods.map(d=>({id:d.value,label:d.label,value:this.getDataValue(u.value,i,0,n.value,d.value)??null})):[{id:n.value,label:n.label,value:this.getDataValue(u.value,i,0,n.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 ft=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var rr=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 ir=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{return Rt.fromJson(r)}catch(i){throw new a(`Failed to parse dynamic table: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var B=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new rr(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new ir(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ft(r)});}static getAllDynamicTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};B.REMOTE_DATA_SOURCE="DynamicTableRemoteDataSource",B.REPOSITORY="DynamicTableRepository",B.GET_ALL_USE_CASE="GetAllDynamicTables";var or=class{constructor(e){this.injector=e;}async domains(e){return F.getAllDomainsUseCase(this.injector).execute(e)}async publications(e){return S.getAllPublicationsUseCase(this.injector).execute(e)}async infographics(e){return P.getAllInfographicsUseCase(this.injector).execute(e)}async news(e){return f.getAllNewsUseCase(this.injector).execute(e)}async newsCategories(e){return A.getAllNewsCategoriesUseCase(this.injector).execute(e)}async pressReleases(e){return b.getAllPressReleasesUseCase(this.injector).execute(e)}async staticTables(e){return h.getAllStaticTablesUseCase(this.injector).execute(e)}async subjects(e){return E.getAllSubjectsUseCase(this.injector).execute(e)}async subjectCategories(e){return I.getAllSubjectCategoriesUseCase(this.injector).execute(e)}async strategicIndicators(e){return C.getAllStrategicIndicatorsUseCase(this.injector).execute(e)}async variables(e){return v.getAllVariablesUseCase(this.injector).execute(e)}async verticalVariables(e){return _.getAllVerticalVariablesUseCase(this.injector).execute(e)}async units(e){return T.getAllUnitsUseCase(this.injector).execute(e)}async periods(e){return D.getAllPeriodsUseCase(this.injector).execute(e)}async derivedPeriods(e){return L.getAllDerivedPeriodsUseCase(this.injector).execute(e)}async derivedVariables(e){return k.getAllDerivedVariablesUseCase(this.injector).execute(e)}async statisticClassifications(e){return x.getAllStatisticClassificationsUseCase(this.injector).execute(e)}async censusEvents(){return y.getAllCensusesUseCase(this.injector).execute()}async censusTopics(e){return y.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"topics"})}async censusEventAreas(e){return y.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"areas"})}async censusEventDatasets(e){return y.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,topicId:e.topicId,type:"datasets"})}async censusData(e){return y.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,censusAreaId:e.censusAreaId,datasetId:e.datasetId,type:"data"})}async dynamicTables(e){return B.getAllDynamicTablesUseCase(this.injector).execute(e)}};var sr=class{constructor(e){this.injector=e;}async publication(e){return S.getPublicationByIdUseCase(this.injector).execute(e)}async infographic(e){return P.getInfographicByIdUseCase(this.injector).execute(e)}async news(e){return f.getNewsByIdUseCase(this.injector).execute(e)}async newsCategory(e){return A.getNewsCategoryByIdUseCase(this.injector).execute(e)}async pressRelease(e){return b.getPressReleaseByIdUseCase(this.injector).execute(e)}async staticTable(e){return h.getStaticTableByIdUseCase(this.injector).execute(e)}async subject(e){return E.getSubjectByIdUseCase(this.injector).execute(e)}async subjectCategory(e){return I.getSubjectCategoryByIdUseCase(this.injector).execute(e)}async strategicIndicator(e){return C.getStrategicIndicatorByIdUseCase(this.injector).execute(e)}async variable(e){return v.getVariableByIdUseCase(this.injector).execute(e)}async verticalVariable(e){return _.getVerticalVariableByIdUseCase(this.injector).execute(e)}async unit(e){return T.getUnitByIdUseCase(this.injector).execute(e)}async period(e){return D.getPeriodByIdUseCase(this.injector).execute(e)}async derivedPeriod(e){return L.getDerivedPeriodByIdUseCase(this.injector).execute(e)}async derivedVariable(e){return k.getDerivedVariableByIdUseCase(this.injector).execute(e)}async statisticClassification(e){return x.getStatisticClassificationByIdUseCase(this.injector).execute(e)}async census(e){return y.getCensusByIdUseCase(this.injector).execute(e)}};var Sr=class o extends m{constructor(t,r,i,s,l,c){super();this.value=t;this.netWeight=r;this.hsCode=i;this.port=s;this.country=l;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 bt=class{constructor(e){this.repository=e;}execute(e){return this.repository.get(e)}};var ar=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 nr=class{constructor(e){this.remoteDataSource=e;}get(e){return this.remoteDataSource.get(e)}};var ne=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new ar(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new nr(r)}),e.registerFactory(this.GET_TRADE_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new bt(r)});}static getTradeUseCase(e){return e.resolve(this.GET_TRADE_USE_CASE)}};ne.REMOTE_DATA_SOURCE="TradeRemoteDataSource",ne.REPOSITORY="TradeRepository",ne.GET_TRADE_USE_CASE="GetTrade";var R=class R{constructor(e){this.logger=V.getInstance(),this.logger.configure({enabled:e.debug??false,filter:new J(e.logLevel??1)}),le.getInstance().setApiKey(e.apiKey),this.authInterceptor=new Ce(e.apiKey);let t=[this.authInterceptor,...e.interceptors||[]];this.networkClient=new Ie({baseURL:e.baseURL||St.BASE_URL,timeout:e.timeout||St.DEFAULT_TIMEOUT,interceptors:t}),this.injector=fe.getInstance(),this.setupDependencies(),this._list=new or(this.injector),this._view=new sr(this.injector),this.logger.info("StadataJS initialized successfully");}static get instance(){if(!R._instance)throw new Error("StadataJS not initialized. Call StadataJS.init() first.");return R._instance}static init(e){return R._instance&&R._instance.logger.warn("StadataJS already initialized. Reinitializing..."),R._instance=new R(e),R._instance}static isInitialized(){return R._instance!==null}static destroy(){R._instance&&(R._instance.cleanup(),R._instance=null);}get list(){return this._list}get view(){return this._view}setApiKey(e){le.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(){F.register(this.injector,this.networkClient),S.register(this.injector,this.networkClient),P.register(this.injector,this.networkClient),f.register(this.injector,this.networkClient),A.register(this.injector,this.networkClient),b.register(this.injector,this.networkClient),h.register(this.injector,this.networkClient),E.register(this.injector,this.networkClient),I.register(this.injector,this.networkClient),C.register(this.injector,this.networkClient),v.register(this.injector,this.networkClient),_.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),y.register(this.injector,this.networkClient),B.register(this.injector,this.networkClient),ne.register(this.injector,this.networkClient);}cleanup(){this.injector.clear(),le.getInstance().clearApiKey(),this.logger.info("StadataJS cleaned up");}};R._instance=null;var Pr=R;var xr=(t=>(t[t.Export=1]="Export",t[t.Import=2]="Import",t))(xr||{}),Ur=(t=>(t[t.Monthly=1]="Monthly",t[t.Annually=2]="Annually",t))(Ur||{}),Nr=(t=>(t[t.TwoDigit=1]="TwoDigit",t[t.Full=2]="Full",t))(Nr||{});
|
|
2
|
+
export{St as ApiConstant,p as ApiEndpoint,z as ApiException,N as ApiFailure,pr as ApiResponse,Ce as AuthInterceptor,m as BaseEntity,hr as CancelToken,Ue as CancelledException,be as CancelledFailure,mt as CensusArea,ct as CensusCategory,dt as CensusData,pt as CensusDataset,Re as CensusEvent,ut as CensusTopic,vr as ClassificationType,ht as ConsoleLogPrinter,Cr as DataAvailability,Ir as DataLanguage,wr as DateHelper,ie as DerivedPeriod,oe as DerivedVariable,ve as Domain,Dr as DomainType,Rt as DynamicTable,O as Failure,fr as ForbiddenException,Ae as ForbiddenFailure,gt as GetAllCensuses,it as GetAllDerivedPeriods,st as GetAllDerivedVariables,_e as GetAllDomains,ft as GetAllDynamicTables,ke as GetAllInfographics,ue as GetAllNews,Ve as GetAllNewsCategories,tt as GetAllPeriods,pe as GetAllPressReleases,De as GetAllPublications,ge as GetAllStaticTables,nt as GetAllStatisticClassifications,Ke as GetAllStrategicIndicators,Me as GetAllSubjectCategories,Ye as GetAllSubjects,je as GetAllUnits,He as GetAllVariables,Ze as GetAllVerticalVariables,yt as GetCensusById,ot as GetDerivedPeriodById,at as GetDerivedVariableById,xe as GetInfographicById,me as GetNewsById,Fe as GetNewsCategoryById,rt as GetPeriodById,de as GetPressReleaseById,Le as GetPublicationById,ye as GetStaticTableById,lt as GetStatisticClassificationById,ze as GetStrategicIndicatorById,qe as GetSubjectById,We as GetSubjectCategoryById,bt as GetTrade,et as GetUnitById,Qe as GetVariableById,Xe as GetVerticalVariableById,Nr as HSCodeType,W as Infographic,fe as Injector,Tr as KBKILevel,_r as KBLILevel,g as ListResult,wt as LogLevel,V as Logger,cr as LoggingInterceptor,Ie as NetworkClient,dr as NetworkException,he as NetworkFailure,$ as News,H as NewsCategory,mr as NoParamsUseCase,yr as NotFoundException,Se as NotFoundFailure,U as Pagination,a as ParseFailure,re as Period,Y as PressRelease,J as ProductionLogFilter,M as Publication,kr as QueryParamConstant,Te as RelatedPublication,ur as RetryInterceptor,br as ServerException,Ee as ServerFailure,K as StadataException,Pr as StadataJS,q as StaticTable,se as StatisticClassification,X as StrategicIndicator,Q as Subject,Z as SubjectCategory,gr as TimeoutException,we as TimeoutFailure,Sr as Trade,Ur as TradePeriod,xr as TradeSource,Rr as UnauthorizedException,Pe as UnauthorizedFailure,te as Unit,ce as UseCase,lr as ValidationFailure,j as Variable,ee as VerticalVariable};//# sourceMappingURL=index.mjs.map
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stadata-js",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "JavaScript/TypeScript SDK for Indonesia's Central Statistics Agency (BPS) API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
},
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"files": [
|
|
17
|
-
"dist",
|
|
17
|
+
"dist/**/*.js",
|
|
18
|
+
"dist/**/*.mjs",
|
|
19
|
+
"dist/**/*.d.ts",
|
|
20
|
+
"dist/**/*.d.mts",
|
|
18
21
|
"README.md",
|
|
19
22
|
"LICENSE"
|
|
20
23
|
],
|