stadata-js 0.3.0 → 1.1.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 CHANGED
@@ -836,11 +836,17 @@ declare class Variable extends BaseEntity {
836
836
  readonly id: number;
837
837
  readonly title: string;
838
838
  readonly subjectId: number;
839
+ readonly subjectName: string;
840
+ readonly statisticClassificationId: number;
841
+ readonly statisticClassificationName: string;
842
+ readonly definition: string;
843
+ readonly notes: string;
839
844
  readonly unit: string;
840
845
  readonly verticalVariableCount: number;
841
846
  readonly derivedVariableCount: number;
842
- readonly graph: string[];
843
- constructor(id: number, title: string, subjectId: number, unit: string, verticalVariableCount: number, derivedVariableCount: number, graph: string[]);
847
+ readonly graphId: number;
848
+ readonly graphName: string;
849
+ constructor(id: number, title: string, subjectId: number, subjectName: string, statisticClassificationId: number, statisticClassificationName: string, definition: string, notes: string, unit: string, verticalVariableCount: number, derivedVariableCount: number, graphId: number, graphName: string);
844
850
  toJson(): Record<string, unknown>;
845
851
  static fromJson(json: Record<string, unknown>): Variable;
846
852
  }
package/dist/index.d.ts CHANGED
@@ -836,11 +836,17 @@ declare class Variable extends BaseEntity {
836
836
  readonly id: number;
837
837
  readonly title: string;
838
838
  readonly subjectId: number;
839
+ readonly subjectName: string;
840
+ readonly statisticClassificationId: number;
841
+ readonly statisticClassificationName: string;
842
+ readonly definition: string;
843
+ readonly notes: string;
839
844
  readonly unit: string;
840
845
  readonly verticalVariableCount: number;
841
846
  readonly derivedVariableCount: number;
842
- readonly graph: string[];
843
- constructor(id: number, title: string, subjectId: number, unit: string, verticalVariableCount: number, derivedVariableCount: number, graph: string[]);
847
+ readonly graphId: number;
848
+ readonly graphName: string;
849
+ constructor(id: number, title: string, subjectId: number, subjectName: string, statisticClassificationId: number, statisticClassificationName: string, definition: string, notes: string, unit: string, verticalVariableCount: number, derivedVariableCount: number, graphId: number, graphName: string);
844
850
  toJson(): Record<string, unknown>;
845
851
  static fromJson(json: Record<string, unknown>): Variable;
846
852
  }
@@ -1,3 +1,3 @@
1
- var StadataJS=(function(exports){'use strict';var Ce=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 Hr={withStackTrace:false},Fr=(o,e,t=Hr)=>{let r=e.isOk()?{type:"Ok",value:e.value}:{type:"Err",value:e.error},i=t.withStackTrace?new Error().stack:void 0;return {data:r,message:o,stack:i}};function j(o,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s);})}return new(t||(t=Promise))(function(s,n){function l(d){try{c(r.next(d));}catch(f){n(f);}}function u(d){try{c(r.throw(d));}catch(f){n(f);}}function c(d){d.done?s(d.value):i(d.value).then(l,u);}c((r=r.apply(o,[])).next());})}function Nr(o){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&o[e],r=0;if(t)return t.call(o);if(o&&typeof o.length=="number")return {next:function(){return o&&r>=o.length&&(o=void 0),{value:o&&o[r++],done:!o}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function B(o){return this instanceof B?(this.v=o,this):new B(o)}function Vr(o,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(o,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",n),i[Symbol.asyncIterator]=function(){return this},i;function n(y){return function($){return Promise.resolve($).then(y,f)}}function l(y,$){r[y]&&(i[y]=function(Tt){return new Promise(function(Kr,zr){s.push([y,Tt,Kr,zr])>1||u(y,Tt);})},$&&(i[y]=$(i[y])));}function u(y,$){try{c(r[y]($));}catch(Tt){ve(s[0][3],Tt);}}function c(y){y.value instanceof B?Promise.resolve(y.value.v).then(d,f):ve(s[0][2],y);}function d(y){u("next",y);}function f(y){u("throw",y);}function ve(y,$){y($),s.shift(),s.length&&u(s[0][0],s[0][1]);}}function Qr(o){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=o[i]?function(n){return (t=!t)?{value:B(o[i](n)),done:false}:s?s(n):n}:s;}}function Zr(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=o[Symbol.asyncIterator],t;return e?e.call(o):(o=typeof Nr=="function"?Nr(o):o[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=o[s]&&function(n){return new Promise(function(l,u){n=o[s](n),i(l,u,n.done,n.value);})};}function i(s,n,l,u){Promise.resolve(u).then(function(c){s({value:c,done:l});},n);}}var Y=class o{constructor(e){this._promise=e;}static fromSafePromise(e){let t=e.then(r=>new E(r));return new o(t)}static fromPromise(e,t){let r=e.then(i=>new E(i)).catch(i=>new w(t(i)));return new o(r)}static fromThrowable(e,t){return (...r)=>new o(j(this,void 0,void 0,function*(){try{return new E(yield e(...r))}catch(i){return new w(t?t(i):i)}}))}static combine(e){return Xr(e)}static combineWithAllErrors(e){return jr(e)}map(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){return t.isErr()?new w(t.error):new E(yield e(t.value))})))}andThrough(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){if(t.isErr())return new w(t.error);let r=yield e(t.value);return r.isErr()?new w(r.error):new E(t.value)})))}andTee(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){if(t.isErr())return new w(t.error);try{yield e(t.value);}catch{}return new E(t.value)})))}orTee(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){if(t.isOk())return new E(t.value);try{yield e(t.error);}catch{}return new w(t.error)})))}mapErr(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){return t.isOk()?new E(t.value):new w(yield e(t.error))})))}andThen(e){return new o(this._promise.then(t=>{if(t.isErr())return new w(t.error);let r=e(t.value);return r instanceof o?r._promise:r}))}orElse(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){return t.isErr()?e(t.error):new E(t.value)})))}match(e,t){return this._promise.then(r=>r.match(e,t))}unwrapOr(e){return this._promise.then(t=>t.unwrapOr(e))}safeUnwrap(){return Vr(this,arguments,function*(){return yield B(yield B(yield*Qr(Zr(yield B(this._promise.then(t=>t.safeUnwrap()))))))})}then(e,t){return this._promise.then(e,t)}[Symbol.asyncIterator](){return Vr(this,arguments,function*(){let t=yield B(this._promise);return t.isErr()&&(yield yield B(Dt(t.error))),yield B(t.value)})}};function Dt(o){return new Y(Promise.resolve(new w(o)))}var Br=o=>{let e=G([]);for(let t of o)if(t.isErr()){e=b(t.error);break}else e.map(r=>r.push(t.value));return e},Xr=o=>Y.fromSafePromise(Promise.all(o)).andThen(Br),Gr=o=>{let e=G([]);for(let t of o)t.isErr()&&e.isErr()?e.error.push(t.error):t.isErr()&&e.isOk()?e=b([t.error]):t.isOk()&&e.isOk()&&e.value.push(t.value);return e},jr=o=>Y.fromSafePromise(Promise.all(o)).andThen(Gr),br;(function(o){function e(i,s){return (...n)=>{try{let l=i(...n);return G(l)}catch(l){return b(s?s(l):l)}}}o.fromThrowable=e;function t(i){return Br(i)}o.combine=t;function r(i){return Gr(i)}o.combineWithAllErrors=r;})(br||(br={}));function G(o){return new E(o)}function b(o){return new w(o)}var E=class{constructor(e){this.value=e;}isOk(){return true}isErr(){return !this.isOk()}map(e){return G(e(this.value))}mapErr(e){return G(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map(t=>this.value)}andTee(e){try{e(this.value);}catch{}return G(this.value)}orTee(e){return G(this.value)}orElse(e){return G(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map(()=>this.value)}asyncMap(e){return Y.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}safeUnwrap(){let e=this.value;return (function*(){return e})()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw Fr("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}},w=class{constructor(e){this.error=e;}isOk(){return false}isErr(){return !this.isOk()}map(e){return b(this.error)}mapErr(e){return b(e(this.error))}andThrough(e){return b(this.error)}andTee(e){return b(this.error)}orTee(e){try{e(this.error);}catch{}return b(this.error)}andThen(e){return b(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return Dt(this.error)}asyncAndThrough(e){return Dt(this.error)}asyncMap(e){return Dt(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}safeUnwrap(){let e=this.error;return (function*(){throw yield b(e),new Error("Do not use this generator out of `safeTry`")})()}_unsafeUnwrap(e){throw Fr("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){let e=this;return yield e,e}};br.fromThrowable;var q=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}},J=class extends q{constructor(t,r,i){super(t,i);this.statusCode=r;}},_e=class extends q{constructor(e="Request was cancelled"){super(e,"CANCELLED");}},Te=class extends q{constructor(e){super(e,"NETWORK_ERROR");}},De=class extends q{constructor(e="Request timeout"){super(e,"TIMEOUT");}},Le=class extends J{constructor(e="Resource not found"){super(e,404,"NOT_FOUND");}},ke=class extends J{constructor(e="Unauthorized"){super(e,401,"UNAUTHORIZED");}},xe=class extends J{constructor(e="Forbidden"){super(e,403,"FORBIDDEN");}},Ue=class extends J{constructor(e="Server error",t=500){super(e,t,"SERVER_ERROR");}},a=class extends q{constructor(e){super(e,"PARSE_ERROR");}},Sr=class extends q{constructor(e){super(e,"VALIDATION_ERROR");}};var Oe=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,f])=>{d.toLowerCase()!=="content-type"&&(s[d]=f);}),Object.assign(s,r.headers);let n={method:e,headers:s};e!=="GET"&&r.body&&(n.body=JSON.stringify(r.body)),r.cancelToken&&(n.signal=r.cancelToken.signal);for(let d of this.interceptors)if(d.onRequest){let f=await d.onRequest(i,n);i=f.url,n=f.init;}let u=await this.fetchWithTimeout(i,n,r.timeout||this.timeout);for(let d of this.interceptors)d.onResponse&&(u=await d.onResponse(u));if(!u.ok)return b(await this.handleErrorResponse(u));let c=await u.json();return G(c)}catch(i){return b(await this.handleError(i,r.cancelToken))}}async fetchWithTimeout(e,t,r){let i=new AbortController,s=setTimeout(()=>i.abort(),r);try{let n=t.signal&&t.signal instanceof AbortSignal?this.combineSignals(t.signal,i.signal):i.signal;return await fetch(e,{...t,signal:n})}finally{clearTimeout(s);}}combineSignals(e,t){let r=new AbortController,i=()=>r.abort();return e.addEventListener("abort",i),t.addEventListener("abort",i),r.signal}buildUrl(e){return e.startsWith("http://")||e.startsWith("https://")?e:`${this.baseURL}${e}`}async handleErrorResponse(e){let{status:t}=e,r;try{let i=await e.json();r=i.message||i.error||e.statusText;}catch{r=e.statusText;}switch(t){case 401:return new ke(r);case 403:return new xe(r);case 404:return new Le(r);case 500:case 502:case 503:case 504:return new Ue(r,t);default:return new J(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 _e(t?.reason):r.name==="AbortError"||r.message.includes("timeout")||r.message.includes("aborted")?new De:r.message.includes("network")||r.message.includes("fetch")||r.message.includes("ECONNREFUSED")?new Te(r.message):new J(r.message)}};var z=class{};var Ne=class extends z{constructor(t){super();this.apiKey=t;}onRequest(t,r){let i=new URL(t);return i.searchParams.set("key",this.apiKey),{url:i.toString(),init:r}}setApiKey(t){this.apiKey=t;}getApiKey(){return this.apiKey}};var kt=(n=>(n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n[n.FATAL=4]="FATAL",n[n.NONE=5]="NONE",n))(kt||{}),Lt=class{print(e){let t=kt[e.level],i=`[${e.timestamp.toISOString()}] [${t}] ${e.message}`;switch(e.level){case 0:console.debug(i,e.data);break;case 1:console.info(i,e.data);break;case 2:console.warn(i,e.data);break;case 3:case 4:console.error(i,e.error||e.data);break}}},H=class{constructor(e=1){this.minLevel=e;}shouldLog(e){return e.level>=this.minLevel}},M=class o{constructor(e=new Lt,t=new H){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 Pr=class extends z{constructor(e){super(),this.logger=e||M.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 z{constructor(t={},r){super();this.retryCount=new Map;this.logger=r||M.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 xt={BASE_URL:"https://webapi.bps.go.id/v1/api",DEFAULT_TIMEOUT:3e4,API_VERSION:"v1",DEFAULT_PAGE_SIZE:10,MAX_PAGE_SIZE:100};var Jr=(t=>(t.ID="ind",t.EN="eng",t))(Jr||{});var $r=(r=>(r.AVAILABLE="available",r.NOT_AVAILABLE="not-available",r.LIST_NOT_AVAILABLE="list-not-available",r))($r||{});var Yr=(s=>(s.KBLI_2009="kbli2009",s.KBLI_2015="kbli2015",s.KBLI_2017="kbli2017",s.KBLI_2020="kbli2020",s.KBKI_2015="kbki2015",s))(Yr||{}),qr=(s=>(s.CATEGORY="kategori",s.PRIMARY_GROUP="golongan pokok",s.GROUP="golongan",s.SUB_GROUP="subgolongan",s.CLUSTER="kelompok",s))(qr||{}),Mr=(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))(Mr||{});var Wr=(i=>(i.ALL="all",i.PROVINCE="prov",i.REGENCY="kab",i.REGENCY_BY_PROVINCE="kabbyprov",i))(Wr||{});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 ei={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 Re=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 he=class{},Er=class extends he{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 Fe=class extends he{constructor(t){super();this.repository=t;}async execute(t){return this.repository.getAll(t)}};var Ut=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 F=class o extends m{constructor(t,r,i,s,n){super();this.page=t;this.perPage=r;this.total=i;this.pages=s;this.count=n;}get hasNextPage(){return this.page<this.pages}get hasPreviousPage(){return this.page>1}get nextPage(){return this.hasNextPage?this.page+1:null}get previousPage(){return this.hasPreviousPage?this.page-1:null}toJson(){return {page:this.page,per_page:this.perPage,total:this.total,pages:this.pages,count:this.count}}static fromJson(t){return new o(t.page||1,t.per_page||10,t.total||0,t.pages||0,t.count||0)}};var Ir=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)),n=t.pagination,l=n?F.fromJson(n):void 0;return new o(s,t["data-availability"]||"available",l)}};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)),n=t.pagination,l=F.fromJson(n);return new o(s,l)}};var Ot=class{constructor(e){this.remoteDataSource=e;}async getAll(e){if(!e)throw new a("Domain list params are required");return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(d=>Ve.fromJson(d)),l=Number(i.count)||s.length,u=Number(i.per_page)||l,c=new F(Number(i.page||1),u,Number(i.total||0),Number(i.pages||1),l);return new g(n,c)}catch(i){throw new a(`Failed to parse domain data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var W=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 Ot(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Fe(r)});}static getAllDomainsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};W.REMOTE_DATA_SOURCE="DomainRemoteDataSource",W.REPOSITORY="DomainRepository",W.GET_ALL_USE_CASE="GetAllDomains";var Be=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.title=r;this.releaseDate=i;this.url=s;this.cover=n;}toJson(){return {id:this.id,title:this.title,rl_date:this.releaseDate.toISOString().split("T")[0],url:this.url,cover:this.cover}}static fromJson(t){return new o(String(t.id||""),String(t.title||""),new Date(String(t.rl_date||t.release_date||t.releaseDate||"")),String(t.url||""),String(t.cover||""))}};var ee=class o extends m{constructor(t,r,i,s,n,l,u,c,d,f,ve,y,$){super();this.id=t;this.title=r;this.issn=i;this.cover=s;this.pdf=n;this.size=l;this.scheduledDate=u;this.releaseDate=c;this.updateDate=d;this.abstract=f;this.catalogueNumber=ve;this.publicationNumber=y;this.relatedPublications=$;}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=>Be.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 Ge=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Je=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.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 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 n=s.map(c=>ee.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>ee.fromJson(c))}catch(i){throw new a(`Failed to parse publications: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Publication not found");let i=r.data[0];if(!i)throw new a("Publication data is empty");return ee.fromJson(i)}catch(i){throw new a(`Failed to parse publication data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var I=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 Vt(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 Je(r)});}static getAllPublicationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPublicationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};I.REMOTE_DATA_SOURCE="PublicationRemoteDataSource",I.REPOSITORY="PublicationRepository",I.GET_ALL_USE_CASE="GetAllPublications",I.GET_BY_ID_USE_CASE="GetPublicationById";var te=class o extends m{constructor(t,r,i,s,n,l){super();this.id=t;this.title=r;this.image=i;this.category=s;this.downloadUrl=n;this.description=l;}toJson(){return {inf_id:this.id,title:this.title,img:this.image,category:this.category,dl:this.downloadUrl,desc:this.description}}static fromJson(t){return new o(String(t.inf_id||t.id||""),String(t.title||""),String(t.img||t.image||""),Number(t.category||0),String(t.dl||t.downloadUrl||""),t.desc||t.description?String(t.desc||t.description):null)}};var $e=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 Ft=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 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 n=s.map(c=>te.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>te.fromJson(c))}catch(i){throw new a(`Failed to parse 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 te.fromJson(i)}catch(i){throw new a(`Failed to parse infographic data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var v=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 $e(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ye(r)});}static getAllInfographicsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getInfographicByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};v.REMOTE_DATA_SOURCE="InfographicRemoteDataSource",v.REPOSITORY="InfographicRepository",v.GET_ALL_USE_CASE="GetAllInfographics",v.GET_BY_ID_USE_CASE="GetInfographicById";var re=class o extends Error{constructor(e){super(e),this.name="StadataException",Object.setPrototypeOf(this,o.prototype);}},ie=class o extends re{constructor(t,r,i){super(t);this.statusCode=r;this.response=i;this.name="ApiException",Object.setPrototypeOf(this,o.prototype);}},qe=class o extends re{constructor(e="Request was cancelled"){super(e),this.name="CancelledException",Object.setPrototypeOf(this,o.prototype);}},vr=class o extends re{constructor(e){super(e),this.name="NetworkException",Object.setPrototypeOf(this,o.prototype);}},Cr=class o extends re{constructor(e="Request timeout"){super(e),this.name="TimeoutException",Object.setPrototypeOf(this,o.prototype);}},_r=class o extends ie{constructor(e="Resource not found"){super(e,404),this.name="NotFoundException",Object.setPrototypeOf(this,o.prototype);}},Tr=class o extends ie{constructor(e="Unauthorized"){super(e,401),this.name="UnauthorizedException",Object.setPrototypeOf(this,o.prototype);}},Dr=class o extends ie{constructor(e="Forbidden"){super(e,403),this.name="ForbiddenException",Object.setPrototypeOf(this,o.prototype);}},Lr=class o extends ie{constructor(e="Server error",t=500){super(e,t),this.name="ServerException",Object.setPrototypeOf(this,o.prototype);}};var kr=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 qe(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 xr=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 Q=class o extends m{constructor(t,r,i,s,n,l){super();this.id=t;this.title=r;this.content=i;this.releaseDate=s;this.categoryId=n;this.picture=l;}toJson(){return {news_id:this.id,title:this.title,news_content:this.content,rl_date:this.releaseDate,category_id:this.categoryId,picture:this.picture}}static fromJson(t){return new o(String(t.news_id||t.id||""),String(t.title||""),String(t.news_content||t.content||""),String(t.rl_date||t.releaseDate||""),Number(t.category_id||t.categoryId||0),t.picture?String(t.picture):null)}};var we=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var be=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Me=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 We=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>Q.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>Q.fromJson(c))}catch(i){throw new a(`Failed to parse news: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("News not found");let i=r.data[0];if(!i)throw new a("News data is empty");return Q.fromJson(i)}catch(i){throw new a(`Failed to parse news data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var S=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Me(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new We(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new we(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new be(r)});}static getAllNewsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};S.REMOTE_DATA_SOURCE="NewsRemoteDataSource",S.REPOSITORY="NewsRepository",S.GET_ALL_USE_CASE="GetAllNews",S.GET_BY_ID_USE_CASE="GetNewsById";var oe=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 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 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.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 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 n=s.map(c=>oe.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>oe.fromJson(c))}catch(i){throw new a(`Failed to parse news category: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("News category not found");let i=r.data[0];if(!i)throw new a("News category data is empty");return oe.fromJson(i)}catch(i){throw new a(`Failed to parse news category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var C=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 Ke(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ze(r)});}static getAllNewsCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};C.REMOTE_DATA_SOURCE="NewsCategoryRemoteDataSource",C.REPOSITORY="NewsCategoryRepository",C.GET_ALL_USE_CASE="GetAllNewsCategories",C.GET_BY_ID_USE_CASE="GetNewsCategoryById";var Z=class o extends m{constructor(t,r,i,s,n,l,u,c,d,f,ve){super();this.id=t;this.subjectId=r;this.subject=i;this.title=s;this.abstract=n;this.releaseDate=l;this.updatedDate=u;this.pdf=c;this.size=d;this.slide=f;this.thumbnail=ve;}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 Se=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 He=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 Qe=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>Z.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>Z.fromJson(c))}catch(i){throw new a(`Failed to parse press releases: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Press release not found");let i=r.data[0];if(!i)throw new a("Press release data is empty");return Z.fromJson(i)}catch(i){throw new a(`Failed to parse press release data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var P=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new He(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Qe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Se(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)}};P.REMOTE_DATA_SOURCE="PressReleaseRemoteDataSource",P.REPOSITORY="PressReleaseRepository",P.GET_ALL_USE_CASE="GetAllPressReleases",P.GET_BY_ID_USE_CASE="GetPressReleaseById";var X=class o extends m{constructor(t,r,i,s,n,l){super();this.id=t;this.title=r;this.subjectId=i;this.size=s;this.updatedAt=n;this.excelUrl=l;}toJson(){return {table_id:this.id,title:this.title,subj_id:this.subjectId,size:this.size,updt_date:this.updatedAt,excel:this.excelUrl}}static fromJson(t){return new o(String(t.table_id||t.id||""),String(t.title||""),Number(t.subj_id||t.subjectId||0),String(t.size||""),String(t.updt_date||t.updatedAt||""),String(t.excel||t.excelUrl||""))}};var Ae=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Ee=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Ze=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.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 Xe=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>X.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>X.fromJson(c))}catch(i){throw new a(`Failed to parse static tables: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Static table not found");let i=r.data[0];if(!i)throw new a("Static table data is empty");return X.fromJson(i)}catch(i){throw new a(`Failed to parse static table data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var A=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ze(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Xe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ae(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ee(r)});}static getAllStaticTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStaticTableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};A.REMOTE_DATA_SOURCE="StaticTableRemoteDataSource",A.REPOSITORY="StaticTableRepository",A.GET_ALL_USE_CASE="GetAllStaticTables",A.GET_BY_ID_USE_CASE="GetStaticTableById";var se=class o extends m{constructor(t,r,i,s){super();this.id=t;this.name=r;this.categoryId=i;this.category=s;}toJson(){return {subj_id:this.id,title:this.name,subcatid:this.categoryId,category:this.category}}static fromJson(t){return new o(Number(t.sub_id||t.id||0),String(t.title||t.name||""),Number(t.subcat_id||t.categoryId||0),String(t.category||t.subcat||""))}};var je=class{constructor(e){this.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 $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.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 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 n=s.map(c=>se.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>se.fromJson(c))}catch(i){throw new a(`Failed to parse 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 se.fromJson(i)}catch(i){throw new a(`Failed to parse subject data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var _=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 je(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new et(r)});}static getAllSubjectsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};_.REMOTE_DATA_SOURCE="SubjectRemoteDataSource",_.REPOSITORY="SubjectRepository",_.GET_ALL_USE_CASE="GetAllSubjects",_.GET_BY_ID_USE_CASE="GetSubjectById";var ae=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 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 qt=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 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 n=s.map(c=>ae.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>ae.fromJson(c))}catch(i){throw new a(`Failed to parse subject category: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Subject category not found");let i=r.data[0];if(!i)throw new a("Subject category data is empty");return ae.fromJson(i)}catch(i){throw new a(`Failed to parse subject category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var T=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 tt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new rt(r)});}static getAllSubjectCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};T.REMOTE_DATA_SOURCE="SubjectCategoryRemoteDataSource",T.REPOSITORY="SubjectCategoryRepository",T.GET_ALL_USE_CASE="GetAllSubjectCategories",T.GET_BY_ID_USE_CASE="GetSubjectCategoryById";var ne=class o extends m{constructor(t,r,i,s,n,l,u,c,d,f,ve){super();this.variableId=t;this.indicatorId=r;this.subjectCsa=i;this.title=s;this.name=n;this.dataSource=l;this.value=u;this.unit=c;this.category=d;this.hashId=f;this.period=ve;}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 it=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var ot=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Wt=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 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 n=s.map(c=>ne.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>ne.fromJson(c))}catch(i){throw new a(`Failed to parse 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 ne.fromJson(i)}catch(i){throw new a(`Failed to parse strategic indicator data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var D=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 it(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ot(r)});}static getAllStrategicIndicatorsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStrategicIndicatorByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};D.REMOTE_DATA_SOURCE="StrategicIndicatorRemoteDataSource",D.REPOSITORY="StrategicIndicatorRepository",D.GET_ALL_USE_CASE="GetAllStrategicIndicators",D.GET_BY_ID_USE_CASE="GetStrategicIndicatorById";var le=class o extends m{constructor(t,r,i,s,n,l,u){super();this.id=t;this.title=r;this.subjectId=i;this.unit=s;this.verticalVariableCount=n;this.derivedVariableCount=l;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 st=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var at=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var 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?.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 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 n=s.map(c=>le.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>le.fromJson(c))}catch(i){throw new a(`Failed to parse variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Variable not found");let i=r.data[0];if(!i)throw new a("Variable data is empty");return le.fromJson(i)}catch(i){throw new a(`Failed to parse variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var L=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 st(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new at(r)});}static getAllVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};L.REMOTE_DATA_SOURCE="VariableRemoteDataSource",L.REPOSITORY="VariableRepository",L.GET_ALL_USE_CASE="GetAllVariables",L.GET_BY_ID_USE_CASE="GetVariableById";var ce=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.label=r;this.itemId=i;this.groupId=s;this.groupName=n;}toJson(){return {kode_ver_id:this.id,vervar:this.label,item_ver_id:this.itemId,group_ver_id:this.groupId,name_group_ver_id:this.groupName}}static fromJson(t){return new o(Number(t.kode_ver_id||t.id||0),String(t.vervar||t.label||""),Number(t.item_ver_id||t.itemId||0),Number(t.group_ver_id||t.groupId||0),String(t.name_group_ver_id||t.groupName||""))}};var nt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var lt=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={};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 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 n=s.map(c=>ce.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>ce.fromJson(c))}catch(i){throw new a(`Failed to parse vertical variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Vertical variable not found");let i=r.data[0];if(!i)throw new a("Vertical variable data is empty");return ce.fromJson(i)}catch(i){throw new a(`Failed to parse vertical variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var k=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 nt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new lt(r)});}static getAllVerticalVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVerticalVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};k.REMOTE_DATA_SOURCE="VerticalVariableRemoteDataSource",k.REPOSITORY="VerticalVariableRepository",k.GET_ALL_USE_CASE="GetAllVerticalVariables",k.GET_BY_ID_USE_CASE="GetVerticalVariableById";var ue=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 ct=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var ut=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=`${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 n=s.map(c=>ue.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>ue.fromJson(c))}catch(i){throw new a(`Failed to parse 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 ue.fromJson(i)}catch(i){throw new a(`Failed to parse unit data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var x=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 jt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ct(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ut(r)});}static getAllUnitsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getUnitByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};x.REMOTE_DATA_SOURCE="UnitRemoteDataSource",x.REPOSITORY="UnitRepository",x.GET_ALL_USE_CASE="GetAllUnits",x.GET_BY_ID_USE_CASE="GetUnitById";var me=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 mt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var pt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var er=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 tr=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>me.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>me.fromJson(c))}catch(i){throw new a(`Failed to parse 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 me.fromJson(i)}catch(i){throw new a(`Failed to parse period data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var U=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new er(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new tr(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new mt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new pt(r)});}static getAllPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};U.REMOTE_DATA_SOURCE="PeriodRemoteDataSource",U.REPOSITORY="PeriodRepository",U.GET_ALL_USE_CASE="GetAllPeriods",U.GET_BY_ID_USE_CASE="GetPeriodById";var pe=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 dt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var gt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var rr=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 ir=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>pe.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>pe.fromJson(c))}catch(i){throw new a(`Failed to parse 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 pe.fromJson(i)}catch(i){throw new a(`Failed to parse derived period data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var O=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 dt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new gt(r)});}static getAllDerivedPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};O.REMOTE_DATA_SOURCE="DerivedPeriodRemoteDataSource",O.REPOSITORY="DerivedPeriodRepository",O.GET_ALL_USE_CASE="GetAllDerivedPeriods",O.GET_BY_ID_USE_CASE="GetDerivedPeriodById";var de=class o extends m{constructor(t,r,i,s){super();this.id=t;this.name=r;this.groupId=i;this.groupName=s;}toJson(){return {turvar_id:this.id,turvar:this.name,group_turvar_id:this.groupId,name_group_turvar:this.groupName}}static fromJson(t){return new o(Number(t.turvar_id||t.id||0),String(t.turvar||t.name||""),Number(t.group_turvar_id||t.groupId||0),String(t.name_group_turvar||t.groupName||""))}};var yt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var ft=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var or=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 sr=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>de.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>de.fromJson(c))}catch(i){throw new a(`Failed to parse derived variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Derived variable not found");let i=r.data[0];if(!i)throw new a("Derived variable data is empty");return de.fromJson(i)}catch(i){throw new a(`Failed to parse derived variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var N=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new or(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new sr(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new yt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ft(r)});}static getAllDerivedVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};N.REMOTE_DATA_SOURCE="DerivedVariableRemoteDataSource",N.REPOSITORY="DerivedVariableRepository",N.GET_ALL_USE_CASE="GetAllDerivedVariables",N.GET_BY_ID_USE_CASE="GetDerivedVariableById";var ge=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 Rt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var ht=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var ar=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 nr=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(c=>ge.fromJson(c)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:l}},c=>ge.fromJson(c))}catch(i){throw new a(`Failed to parse 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 ge.fromJson(i)}catch(i){throw new a(`Failed to parse statistic classification data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var V=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_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Rt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ht(r)});}static getAllStatisticClassificationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStatisticClassificationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};V.REMOTE_DATA_SOURCE="StatisticClassificationRemoteDataSource",V.REPOSITORY="StatisticClassificationRepository",V.GET_ALL_USE_CASE="GetAllStatisticClassifications",V.GET_BY_ID_USE_CASE="GetStatisticClassificationById";var wt=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.name=r;this.itemId=i;this.itemCode=s;this.itemName=n;}toJson(){return {id:this.id,name:this.name,itemID:this.itemId,itemCode:this.itemCode,itemName:this.itemName}}toJSON(){return this.toJson()}static fromJson(t){return new o(String(t.id||""),String(t.name||""),String(t.itemID||""),String(t.itemCode||""),String(t.itemName||""))}};var Ie=class o extends m{constructor(t,r,i){super();this.id=t;this.name=r;this.year=i;}toJson(){return {id:this.id,kegiatan:this.name,tahun_kegiatan:this.year}}toJSON(){return this.toJson()}static fromJson(t){return new o(String(t.id||""),String(t.kegiatan||""),Number(t.tahun_kegiatan||0))}};var bt=class o extends m{constructor(t,r,i,s){super();this.id=t;this.topic=r;this.eventId=i;this.eventName=s;}toJson(){return {id:this.id,topik:this.topic,id_kegiatan:this.eventId,kegiatan:this.eventName}}toJSON(){return this.toJson()}static fromJson(t){return new o(Number(t.id||0),String(t.topik||""),String(t.id_kegiatan||""),String(t.kegiatan||""))}};var St=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,n,l){super();this.id=t;this.topicId=r;this.topic=i;this.eventId=s;this.name=n;this.description=l;}toJson(){let t={id:this.id,id_topik:this.topicId,topik:this.topic,id_kegiatan:this.eventId,nama:this.name};return this.description!==void 0&&this.description!==null&&(t.deskripsi=this.description),t}toJSON(){return this.toJson()}static fromJson(t){return new o(Number(t.id||0),Number(t.id_topik||0),String(t.topik||""),Number(t.id_kegiatan||0),String(t.nama||""),t.deskripsi?String(t.deskripsi):null)}};var At=class o extends m{constructor(t,r,i,s,n,l,u,c,d){super();this.regionId=t;this.regionCode=r;this.regionName=i;this.indicatorId=s;this.indicatorName=n;this.categories=l;this.period=u;this.value=c;this.regionLevel=d;}toJson(){let t={id_wilayah:this.regionId,kode_wilayah:this.regionCode,nama_wilayah:this.regionName,id_indikator:this.indicatorId,nama_indikator:this.indicatorName,categories:this.categories.map(r=>({id:r.id,name:r.name,item_id:r.itemId,item_code:r.itemCode,item_name:r.itemName})),period:this.period,nilai:this.value};return this.regionLevel!==void 0&&this.regionLevel!==null&&(t.level_wilayah=this.regionLevel),t}toJSON(){return this.toJson()}static fromJson(t){let r=[];for(let i=1;i<=5;i++){let s=String(t[`id_kategori_${i}`]||""),n=String(t[`nama_kategori_${i}`]||""),l=String(t[`id_item_kategori_${i}`]||""),u=String(t[`kode_item_kategori_${i}`]||""),c=String(t[`nama_item__kategori_${i}`]||"");!s||!n||!l||!u||!c||r.push(new wt(s,n,l,u,c));}return new o(String(t.id_wilayah||""),String(t.kode_wilayah||""),String(t.nama_wilayah||""),String(t.id_indikator||""),String(t.nama_indikator||""),r,String(t.period||""),Number(t.nilai||0),t.level_wilayah?String(t.level_wilayah):null)}};var Et=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var It=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var lr=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 cr=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||r.data===null)return this.createEmptyListResult(e);if(!Array.isArray(r.data)||r.data.length<2)return this.createEmptyListResult(e);let i=r.data[0],s=r.data[1];if(s&&!Array.isArray(s)&&typeof s=="object"){let c=s;c.data&&Array.isArray(c.data)&&(s=c.data);}if(!s||!Array.isArray(s))return this.createEmptyListResult(e,i);let n=s.map(c=>this.parseEntity(c,e?.type)),l=Number(i.count)||s.length,u=Number(i.per_page)||l;return new g(n,new F(Number(i.page||1),u,Number(i.total||0),Number(i.pages||1),l))}catch(i){throw new a(`Failed to parse census: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{return Ie.fromJson(r)}catch(i){throw new a(`Failed to parse census event: ${i instanceof Error?i.message:"Unknown error"}`)}})}parseEntity(e,t){switch(t){case "topics":return bt.fromJson(e);case "areas":return St.fromJson(e);case "datasets":return Pt.fromJson(e);case "data":return At.fromJson(e);case "events":default:return Ie.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 R=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new lr(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new cr(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Et(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new It(r)});}static getAllCensusesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getCensusByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};R.REMOTE_DATA_SOURCE="CensusRemoteDataSource",R.REPOSITORY="CensusRepository",R.GET_ALL_USE_CASE="GetAllCensuses",R.GET_BY_ID_USE_CASE="GetCensusById";var ur=class o extends m{constructor(t,r,i,s,n,l,u){super();this.value=t;this.label=r;this.unit=i;this.subject=s;this.definition=n;this.notes=l;this.decimal=u;}toJson(){return {val:this.value,label:this.label,unit:this.unit,subj:this.subject,def:this.definition,note:this.notes,...this.decimal!==void 0&&{decimal:this.decimal}}}static fromJson(t){return new o(Number(t.val||0),String(t.label||""),String(t.unit||""),String(t.subj||""),String(t.def||""),String(t.note||""),t.decimal!==void 0?Number(t.decimal):void 0)}},ye=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||""))}},mr=class o extends ye{static fromJson(e){let t=e.val;return new o(typeof t=="number"?t:String(t||""),String(e.label||""))}},pr=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||""))}},dr=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.title=r;this.tableSource=i;this.lastUpdate=s;this.link=n;}toJson(){return {id:this.id,title:this.title,tablesource:this.tableSource,last_update:this.lastUpdate,link:this.link}}static fromJson(t){return new o(String(t.id||""),String(t.title||""),Number(t.tablesource||0),t.last_update!==null?String(t.last_update||""):null,String(t.link||""))}};var vt=class o extends m{constructor(t,r,i,s,n,l,u,c,d,f){super();this.subjects=t;this.variables=r;this.verticalVariables=i;this.verticalVariableLabel=s;this.periods=n;this.derivedVariables=l;this.derivedPeriods=u;this.dataContent=c;this.related=d;this.lastUpdate=f;}toJson(){return {subject:this.subjects.map(t=>t.toJson()),var:this.variables.map(t=>t.toJson()),vervar:this.verticalVariables.map(t=>t.toJson()),labelvervar:this.verticalVariableLabel,tahun:this.periods.map(t=>t.toJson()),turvar:this.derivedVariables.map(t=>t.toJson()),turtahun:this.derivedPeriods.map(t=>t.toJson()),datacontent:this.dataContent,related:this.related.map(t=>t.toJson()),last_update:this.lastUpdate}}static fromJson(t){let r=Array.isArray(t.subject)?t.subject:[],i=Array.isArray(t.var)?t.var:[],s=Array.isArray(t.vervar)?t.vervar:[],n=Array.isArray(t.tahun)?t.tahun:[],l=Array.isArray(t.turvar)?t.turvar:[],u=Array.isArray(t.turtahun)?t.turtahun:[],c=Array.isArray(t.related)?t.related:[];return new o(r.map(d=>pr.fromJson(d)),i.map(d=>ur.fromJson(d)),s.map(d=>ye.fromJson(d)),String(t.labelvervar||""),n.map(d=>mr.fromJson(d)),l.map(d=>ye.fromJson(d)),u.map(d=>ye.fromJson(d)),t.datacontent||{},c.map(d=>dr.fromJson(d)),t.last_update!==void 0?t.last_update:void 0)}getDataValue(t,r,i,s,n){let l=`${t}${r}${i}${s}${n}`;return this.dataContent[l]}toStructuredData(){let t=this.subjects[0],r=this.variables[0],i=r?.value||0,s=this.derivedVariables.length>1||this.derivedVariables[0]?.value!==0&&this.derivedVariables[0]?.value!=="0",n=this.derivedPeriods.length>1||this.derivedPeriods[0]?.value!==0&&this.derivedPeriods[0]?.value!=="0",l=this.verticalVariables.map(u=>s?{id:u.value,label:u.label,data:this.derivedVariables.map(c=>({id:c.value,label:c.label,data:this.periods.map(d=>n?{id:d.value,label:d.label,data:this.derivedPeriods.map(f=>({id:f.value,label:f.label,value:this.getDataValue(u.value,i,c.value,d.value,f.value)??null}))}:{id:d.value,label:d.label,value:this.getDataValue(u.value,i,c.value,d.value,this.derivedPeriods[0]?.value||0)??null})}))}:{id:u.value,label:u.label,data:this.periods.map(c=>({id:c.value,label:c.label,data:n?this.derivedPeriods.map(d=>({id:d.value,label:d.label,value:this.getDataValue(u.value,i,0,c.value,d.value)??null})):[{id:c.value,label:c.label,value:this.getDataValue(u.value,i,0,c.value,this.derivedPeriods[0]?.value||0)??null}]}))});return {subject_id:t?.value||0,subject_label:t?.label||"",variable_id:r?.value||0,variable_label:r?.label||"",variable_unit:r?.unit||"",vertical_variable_label:this.verticalVariableLabel,last_update:this.lastUpdate,data:l}}};var Ct=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var gr=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 yr=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{return vt.fromJson(r)}catch(i){throw new a(`Failed to parse dynamic table: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var K=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new gr(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new yr(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ct(r)});}static getAllDynamicTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};K.REMOTE_DATA_SOURCE="DynamicTableRemoteDataSource",K.REPOSITORY="DynamicTableRepository",K.GET_ALL_USE_CASE="GetAllDynamicTables";var fr=class{constructor(e){this.injector=e;}async domains(e){return W.getAllDomainsUseCase(this.injector).execute(e)}async publications(e){return I.getAllPublicationsUseCase(this.injector).execute(e)}async infographics(e){return v.getAllInfographicsUseCase(this.injector).execute(e)}async news(e){return S.getAllNewsUseCase(this.injector).execute(e)}async newsCategories(e){return C.getAllNewsCategoriesUseCase(this.injector).execute(e)}async pressReleases(e){return P.getAllPressReleasesUseCase(this.injector).execute(e)}async staticTables(e){return A.getAllStaticTablesUseCase(this.injector).execute(e)}async subjects(e){return _.getAllSubjectsUseCase(this.injector).execute(e)}async subjectCategories(e){return T.getAllSubjectCategoriesUseCase(this.injector).execute(e)}async strategicIndicators(e){return D.getAllStrategicIndicatorsUseCase(this.injector).execute(e)}async variables(e){return L.getAllVariablesUseCase(this.injector).execute(e)}async verticalVariables(e){return k.getAllVerticalVariablesUseCase(this.injector).execute(e)}async units(e){return x.getAllUnitsUseCase(this.injector).execute(e)}async periods(e){return U.getAllPeriodsUseCase(this.injector).execute(e)}async derivedPeriods(e){return O.getAllDerivedPeriodsUseCase(this.injector).execute(e)}async derivedVariables(e){return N.getAllDerivedVariablesUseCase(this.injector).execute(e)}async statisticClassifications(e){return V.getAllStatisticClassificationsUseCase(this.injector).execute(e)}async censusEvents(){return R.getAllCensusesUseCase(this.injector).execute()}async censusTopics(e){return R.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"topics"})}async censusEventAreas(e){return R.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"areas"})}async censusEventDatasets(e){return R.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,topicId:e.topicId,type:"datasets"})}async censusData(e){return R.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,censusAreaId:e.censusAreaId,datasetId:e.datasetId,type:"data"})}async dynamicTables(e){return K.getAllDynamicTablesUseCase(this.injector).execute(e)}};var Rr=class{constructor(e){this.injector=e;}async publication(e){return I.getPublicationByIdUseCase(this.injector).execute(e)}async infographic(e){return v.getInfographicByIdUseCase(this.injector).execute(e)}async news(e){return S.getNewsByIdUseCase(this.injector).execute(e)}async newsCategory(e){return C.getNewsCategoryByIdUseCase(this.injector).execute(e)}async pressRelease(e){return P.getPressReleaseByIdUseCase(this.injector).execute(e)}async staticTable(e){return A.getStaticTableByIdUseCase(this.injector).execute(e)}async subject(e){return _.getSubjectByIdUseCase(this.injector).execute(e)}async subjectCategory(e){return T.getSubjectCategoryByIdUseCase(this.injector).execute(e)}async strategicIndicator(e){return D.getStrategicIndicatorByIdUseCase(this.injector).execute(e)}async variable(e){return L.getVariableByIdUseCase(this.injector).execute(e)}async verticalVariable(e){return k.getVerticalVariableByIdUseCase(this.injector).execute(e)}async unit(e){return x.getUnitByIdUseCase(this.injector).execute(e)}async period(e){return U.getPeriodByIdUseCase(this.injector).execute(e)}async derivedPeriod(e){return O.getDerivedPeriodByIdUseCase(this.injector).execute(e)}async derivedVariable(e){return N.getDerivedVariableByIdUseCase(this.injector).execute(e)}async statisticClassification(e){return V.getStatisticClassificationByIdUseCase(this.injector).execute(e)}async census(e){return R.getCensusByIdUseCase(this.injector).execute(e)}};var Ur=class o extends m{constructor(t,r,i,s,n,l){super();this.value=t;this.netWeight=r;this.hsCode=i;this.port=s;this.country=n;this.year=l;}toJson(){return {value:this.value,netweight:this.netWeight,kodehs:this.hsCode,pod:this.port,ctr:this.country,tahun:this.year}}static fromJson(t){return new o(Number(t.value||0),Number(t.netweight||0),String(t.kodehs||""),String(t.pod||""),String(t.ctr||""),String(t.tahun||""))}};var _t=class{constructor(e){this.repository=e;}execute(e){return this.repository.get(e)}};var hr=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 wr=class{constructor(e){this.remoteDataSource=e;}get(e){return this.remoteDataSource.get(e)}};var fe=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new hr(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new wr(r)}),e.registerFactory(this.GET_TRADE_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new _t(r)});}static getTradeUseCase(e){return e.resolve(this.GET_TRADE_USE_CASE)}};fe.REMOTE_DATA_SOURCE="TradeRemoteDataSource",fe.REPOSITORY="TradeRepository",fe.GET_TRADE_USE_CASE="GetTrade";var h=class h{constructor(e){this.logger=M.getInstance(),this.logger.configure({enabled:e.debug??false,filter:new H(e.logLevel??1)}),Re.getInstance().setApiKey(e.apiKey),this.authInterceptor=new Ne(e.apiKey);let t=[this.authInterceptor,...e.interceptors||[]];this.networkClient=new Oe({baseURL:e.baseURL||xt.BASE_URL,timeout:e.timeout||xt.DEFAULT_TIMEOUT,interceptors:t}),this.injector=Ce.getInstance(),this.setupDependencies(),this._list=new fr(this.injector),this._view=new Rr(this.injector),this.logger.info("StadataJS initialized successfully");}static get instance(){if(!h._instance)throw new Error("StadataJS not initialized. Call StadataJS.init() first.");return h._instance}static init(e){return h._instance&&h._instance.logger.warn("StadataJS already initialized. Reinitializing..."),h._instance=new h(e),h._instance}static isInitialized(){return h._instance!==null}static destroy(){h._instance&&(h._instance.cleanup(),h._instance=null);}get list(){return this._list}get view(){return this._view}setApiKey(e){Re.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 H(0)});}disableDebug(){this.logger.configure({filter:new H(1)});}async trade(e){return this.injector.resolve("GetTrade").execute(e)}setupDependencies(){W.register(this.injector,this.networkClient),I.register(this.injector,this.networkClient),v.register(this.injector,this.networkClient),S.register(this.injector,this.networkClient),C.register(this.injector,this.networkClient),P.register(this.injector,this.networkClient),A.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),U.register(this.injector,this.networkClient),O.register(this.injector,this.networkClient),N.register(this.injector,this.networkClient),V.register(this.injector,this.networkClient),R.register(this.injector,this.networkClient),K.register(this.injector,this.networkClient),fe.register(this.injector,this.networkClient);}cleanup(){this.injector.clear(),Re.getInstance().clearApiKey(),this.logger.info("StadataJS cleaned up");}};h._instance=null;var Or=h;var ti=(t=>(t[t.Export=1]="Export",t[t.Import=2]="Import",t))(ti||{}),ri=(t=>(t[t.Monthly=1]="Monthly",t[t.Annually=2]="Annually",t))(ri||{}),ii=(t=>(t[t.TwoDigit=1]="TwoDigit",t[t.Full=2]="Full",t))(ii||{});
2
- exports.ApiConstant=xt;exports.ApiEndpoint=p;exports.ApiException=ie;exports.ApiFailure=J;exports.ApiResponse=Ir;exports.AuthInterceptor=Ne;exports.BaseEntity=m;exports.CancelToken=kr;exports.CancelledException=qe;exports.CancelledFailure=_e;exports.CensusArea=St;exports.CensusCategory=wt;exports.CensusData=At;exports.CensusDataset=Pt;exports.CensusEvent=Ie;exports.CensusTopic=bt;exports.ClassificationType=Yr;exports.ConsoleLogPrinter=Lt;exports.DataAvailability=$r;exports.DataLanguage=Jr;exports.DateHelper=xr;exports.DerivedPeriod=pe;exports.DerivedVariable=de;exports.Domain=Ve;exports.DomainType=Wr;exports.DynamicTable=vt;exports.Failure=q;exports.ForbiddenException=Dr;exports.ForbiddenFailure=xe;exports.GetAllCensuses=Et;exports.GetAllDerivedPeriods=dt;exports.GetAllDerivedVariables=yt;exports.GetAllDomains=Fe;exports.GetAllDynamicTables=Ct;exports.GetAllInfographics=$e;exports.GetAllNews=we;exports.GetAllNewsCategories=Ke;exports.GetAllPeriods=mt;exports.GetAllPressReleases=Se;exports.GetAllPublications=Ge;exports.GetAllStaticTables=Ae;exports.GetAllStatisticClassifications=Rt;exports.GetAllStrategicIndicators=it;exports.GetAllSubjectCategories=tt;exports.GetAllSubjects=je;exports.GetAllUnits=ct;exports.GetAllVariables=st;exports.GetAllVerticalVariables=nt;exports.GetCensusById=It;exports.GetDerivedPeriodById=gt;exports.GetDerivedVariableById=ft;exports.GetInfographicById=Ye;exports.GetNewsById=be;exports.GetNewsCategoryById=ze;exports.GetPeriodById=pt;exports.GetPressReleaseById=Pe;exports.GetPublicationById=Je;exports.GetStaticTableById=Ee;exports.GetStatisticClassificationById=ht;exports.GetStrategicIndicatorById=ot;exports.GetSubjectById=et;exports.GetSubjectCategoryById=rt;exports.GetTrade=_t;exports.GetUnitById=ut;exports.GetVariableById=at;exports.GetVerticalVariableById=lt;exports.HSCodeType=ii;exports.Infographic=te;exports.Injector=Ce;exports.KBKILevel=Mr;exports.KBLILevel=qr;exports.ListResult=g;exports.LogLevel=kt;exports.Logger=M;exports.LoggingInterceptor=Pr;exports.NetworkClient=Oe;exports.NetworkException=vr;exports.NetworkFailure=Te;exports.News=Q;exports.NewsCategory=oe;exports.NoParamsUseCase=Er;exports.NotFoundException=_r;exports.NotFoundFailure=Le;exports.Pagination=F;exports.ParseFailure=a;exports.Period=me;exports.PressRelease=Z;exports.ProductionLogFilter=H;exports.Publication=ee;exports.QueryParamConstant=ei;exports.RelatedPublication=Be;exports.RetryInterceptor=Ar;exports.ServerException=Lr;exports.ServerFailure=Ue;exports.StadataException=re;exports.StadataJS=Or;exports.StaticTable=X;exports.StatisticClassification=ge;exports.StrategicIndicator=ne;exports.Subject=se;exports.SubjectCategory=ae;exports.TimeoutException=Cr;exports.TimeoutFailure=De;exports.Trade=Ur;exports.TradePeriod=ri;exports.TradeSource=ti;exports.UnauthorizedException=Tr;exports.UnauthorizedFailure=ke;exports.Unit=ue;exports.UseCase=he;exports.ValidationFailure=Sr;exports.Variable=le;exports.VerticalVariable=ce;return exports;})({});//# sourceMappingURL=index.global.js.map
1
+ var StadataJS=(function(exports){'use strict';var Ce=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 Hr={withStackTrace:false},Fr=(o,e,t=Hr)=>{let r=e.isOk()?{type:"Ok",value:e.value}:{type:"Err",value:e.error},i=t.withStackTrace?new Error().stack:void 0;return {data:r,message:o,stack:i}};function j(o,e,t,r){function i(s){return s instanceof t?s:new t(function(n){n(s);})}return new(t||(t=Promise))(function(s,n){function c(d){try{l(r.next(d));}catch(f){n(f);}}function u(d){try{l(r.throw(d));}catch(f){n(f);}}function l(d){d.done?s(d.value):i(d.value).then(c,u);}l((r=r.apply(o,[])).next());})}function Nr(o){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&o[e],r=0;if(t)return t.call(o);if(o&&typeof o.length=="number")return {next:function(){return o&&r>=o.length&&(o=void 0),{value:o&&o[r++],done:!o}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function G(o){return this instanceof G?(this.v=o,this):new G(o)}function Vr(o,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(o,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",n),i[Symbol.asyncIterator]=function(){return this},i;function n(y){return function(B){return Promise.resolve(B).then(y,f)}}function c(y,B){r[y]&&(i[y]=function(Tt){return new Promise(function(Kr,zr){s.push([y,Tt,Kr,zr])>1||u(y,Tt);})},B&&(i[y]=B(i[y])));}function u(y,B){try{l(r[y](B));}catch(Tt){Re(s[0][3],Tt);}}function l(y){y.value instanceof G?Promise.resolve(y.value.v).then(d,f):Re(s[0][2],y);}function d(y){u("next",y);}function f(y){u("throw",y);}function Re(y,B){y(B),s.shift(),s.length&&u(s[0][0],s[0][1]);}}function Qr(o){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=o[i]?function(n){return (t=!t)?{value:G(o[i](n)),done:false}:s?s(n):n}:s;}}function Zr(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=o[Symbol.asyncIterator],t;return e?e.call(o):(o=typeof Nr=="function"?Nr(o):o[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=o[s]&&function(n){return new Promise(function(c,u){n=o[s](n),i(c,u,n.done,n.value);})};}function i(s,n,c,u){Promise.resolve(u).then(function(l){s({value:l,done:c});},n);}}var Y=class o{constructor(e){this._promise=e;}static fromSafePromise(e){let t=e.then(r=>new E(r));return new o(t)}static fromPromise(e,t){let r=e.then(i=>new E(i)).catch(i=>new b(t(i)));return new o(r)}static fromThrowable(e,t){return (...r)=>new o(j(this,void 0,void 0,function*(){try{return new E(yield e(...r))}catch(i){return new b(t?t(i):i)}}))}static combine(e){return Xr(e)}static combineWithAllErrors(e){return jr(e)}map(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){return t.isErr()?new b(t.error):new E(yield e(t.value))})))}andThrough(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){if(t.isErr())return new b(t.error);let r=yield e(t.value);return r.isErr()?new b(r.error):new E(t.value)})))}andTee(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){if(t.isErr())return new b(t.error);try{yield e(t.value);}catch{}return new E(t.value)})))}orTee(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){if(t.isOk())return new E(t.value);try{yield e(t.error);}catch{}return new b(t.error)})))}mapErr(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){return t.isOk()?new E(t.value):new b(yield e(t.error))})))}andThen(e){return new o(this._promise.then(t=>{if(t.isErr())return new b(t.error);let r=e(t.value);return r instanceof o?r._promise:r}))}orElse(e){return new o(this._promise.then(t=>j(this,void 0,void 0,function*(){return t.isErr()?e(t.error):new E(t.value)})))}match(e,t){return this._promise.then(r=>r.match(e,t))}unwrapOr(e){return this._promise.then(t=>t.unwrapOr(e))}safeUnwrap(){return Vr(this,arguments,function*(){return yield G(yield G(yield*Qr(Zr(yield G(this._promise.then(t=>t.safeUnwrap()))))))})}then(e,t){return this._promise.then(e,t)}[Symbol.asyncIterator](){return Vr(this,arguments,function*(){let t=yield G(this._promise);return t.isErr()&&(yield yield G(Dt(t.error))),yield G(t.value)})}};function Dt(o){return new Y(Promise.resolve(new b(o)))}var Br=o=>{let e=J([]);for(let t of o)if(t.isErr()){e=w(t.error);break}else e.map(r=>r.push(t.value));return e},Xr=o=>Y.fromSafePromise(Promise.all(o)).andThen(Br),Gr=o=>{let e=J([]);for(let t of o)t.isErr()&&e.isErr()?e.error.push(t.error):t.isErr()&&e.isOk()?e=w([t.error]):t.isOk()&&e.isOk()&&e.value.push(t.value);return e},jr=o=>Y.fromSafePromise(Promise.all(o)).andThen(Gr),wr;(function(o){function e(i,s){return (...n)=>{try{let c=i(...n);return J(c)}catch(c){return w(s?s(c):c)}}}o.fromThrowable=e;function t(i){return Br(i)}o.combine=t;function r(i){return Gr(i)}o.combineWithAllErrors=r;})(wr||(wr={}));function J(o){return new E(o)}function w(o){return new b(o)}var E=class{constructor(e){this.value=e;}isOk(){return true}isErr(){return !this.isOk()}map(e){return J(e(this.value))}mapErr(e){return J(this.value)}andThen(e){return e(this.value)}andThrough(e){return e(this.value).map(t=>this.value)}andTee(e){try{e(this.value);}catch{}return J(this.value)}orTee(e){return J(this.value)}orElse(e){return J(this.value)}asyncAndThen(e){return e(this.value)}asyncAndThrough(e){return e(this.value).map(()=>this.value)}asyncMap(e){return Y.fromSafePromise(e(this.value))}unwrapOr(e){return this.value}match(e,t){return e(this.value)}safeUnwrap(){let e=this.value;return (function*(){return e})()}_unsafeUnwrap(e){return this.value}_unsafeUnwrapErr(e){throw Fr("Called `_unsafeUnwrapErr` on an Ok",this,e)}*[Symbol.iterator](){return this.value}},b=class{constructor(e){this.error=e;}isOk(){return false}isErr(){return !this.isOk()}map(e){return w(this.error)}mapErr(e){return w(e(this.error))}andThrough(e){return w(this.error)}andTee(e){return w(this.error)}orTee(e){try{e(this.error);}catch{}return w(this.error)}andThen(e){return w(this.error)}orElse(e){return e(this.error)}asyncAndThen(e){return Dt(this.error)}asyncAndThrough(e){return Dt(this.error)}asyncMap(e){return Dt(this.error)}unwrapOr(e){return e}match(e,t){return t(this.error)}safeUnwrap(){let e=this.error;return (function*(){throw yield w(e),new Error("Do not use this generator out of `safeTry`")})()}_unsafeUnwrap(e){throw Fr("Called `_unsafeUnwrap` on an Err",this,e)}_unsafeUnwrapErr(e){return this.error}*[Symbol.iterator](){let e=this;return yield e,e}};wr.fromThrowable;var q=class o{constructor(e,t){this.message=e;this.code=t;}toString(){return `${this.constructor.name}: ${this.message}${this.code?` (${this.code})`:""}`}equals(e){return e instanceof o?this.message===e.message&&this.code===e.code&&this.constructor.name===e.constructor.name:false}},$=class extends q{constructor(t,r,i){super(t,i);this.statusCode=r;}},_e=class extends q{constructor(e="Request was cancelled"){super(e,"CANCELLED");}},Te=class extends q{constructor(e){super(e,"NETWORK_ERROR");}},De=class extends q{constructor(e="Request timeout"){super(e,"TIMEOUT");}},Le=class extends ${constructor(e="Resource not found"){super(e,404,"NOT_FOUND");}},ke=class extends ${constructor(e="Unauthorized"){super(e,401,"UNAUTHORIZED");}},xe=class extends ${constructor(e="Forbidden"){super(e,403,"FORBIDDEN");}},Ue=class extends ${constructor(e="Server error",t=500){super(e,t,"SERVER_ERROR");}},a=class extends q{constructor(e){super(e,"PARSE_ERROR");}},Sr=class extends q{constructor(e){super(e,"VALIDATION_ERROR");}};var Oe=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,f])=>{d.toLowerCase()!=="content-type"&&(s[d]=f);}),Object.assign(s,r.headers);let n={method:e,headers:s};e!=="GET"&&r.body&&(n.body=JSON.stringify(r.body)),r.cancelToken&&(n.signal=r.cancelToken.signal);for(let d of this.interceptors)if(d.onRequest){let f=await d.onRequest(i,n);i=f.url,n=f.init;}let u=await this.fetchWithTimeout(i,n,r.timeout||this.timeout);for(let d of this.interceptors)d.onResponse&&(u=await d.onResponse(u));if(!u.ok)return w(await this.handleErrorResponse(u));let l=await u.json();return J(l)}catch(i){return w(await this.handleError(i,r.cancelToken))}}async fetchWithTimeout(e,t,r){let i=new AbortController,s=setTimeout(()=>i.abort(),r);try{let n=t.signal&&t.signal instanceof AbortSignal?this.combineSignals(t.signal,i.signal):i.signal;return await fetch(e,{...t,signal:n})}finally{clearTimeout(s);}}combineSignals(e,t){let r=new AbortController,i=()=>r.abort();return e.addEventListener("abort",i),t.addEventListener("abort",i),r.signal}buildUrl(e){return e.startsWith("http://")||e.startsWith("https://")?e:`${this.baseURL}${e}`}async handleErrorResponse(e){let{status:t}=e,r;try{let i=await e.json();r=i.message||i.error||e.statusText;}catch{r=e.statusText;}switch(t){case 401:return new ke(r);case 403:return new xe(r);case 404:return new Le(r);case 500:case 502:case 503:case 504:return new Ue(r,t);default:return new $(r,t)}}async handleError(e,t){let r=e instanceof Error?e:new Error(String(e));for(let i of this.interceptors)if(i.onError){let s=await i.onError(r);s&&(r=s);}return t?.isCancelled||e.name==="AbortError"?new _e(t?.reason):r.name==="AbortError"||r.message.includes("timeout")||r.message.includes("aborted")?new De:r.message.includes("network")||r.message.includes("fetch")||r.message.includes("ECONNREFUSED")?new Te(r.message):new $(r.message)}};var z=class{};var Ne=class extends z{constructor(t){super();this.apiKey=t;}onRequest(t,r){let i=new URL(t);return i.searchParams.set("key",this.apiKey),{url:i.toString(),init:r}}setApiKey(t){this.apiKey=t;}getApiKey(){return this.apiKey}};var kt=(n=>(n[n.DEBUG=0]="DEBUG",n[n.INFO=1]="INFO",n[n.WARN=2]="WARN",n[n.ERROR=3]="ERROR",n[n.FATAL=4]="FATAL",n[n.NONE=5]="NONE",n))(kt||{}),Lt=class{print(e){let t=kt[e.level],i=`[${e.timestamp.toISOString()}] [${t}] ${e.message}`;switch(e.level){case 0:console.debug(i,e.data);break;case 1:console.info(i,e.data);break;case 2:console.warn(i,e.data);break;case 3:case 4:console.error(i,e.error||e.data);break}}},H=class{constructor(e=1){this.minLevel=e;}shouldLog(e){return e.level>=this.minLevel}},M=class o{constructor(e=new Lt,t=new H){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 Pr=class extends z{constructor(e){super(),this.logger=e||M.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 z{constructor(t={},r){super();this.retryCount=new Map;this.logger=r||M.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 xt={BASE_URL:"https://webapi.bps.go.id/v1/api",DEFAULT_TIMEOUT:3e4,API_VERSION:"v1",DEFAULT_PAGE_SIZE:10,MAX_PAGE_SIZE:100};var Jr=(t=>(t.ID="ind",t.EN="eng",t))(Jr||{});var $r=(r=>(r.AVAILABLE="available",r.NOT_AVAILABLE="not-available",r.LIST_NOT_AVAILABLE="list-not-available",r))($r||{});var Yr=(s=>(s.KBLI_2009="kbli2009",s.KBLI_2015="kbli2015",s.KBLI_2017="kbli2017",s.KBLI_2020="kbli2020",s.KBKI_2015="kbki2015",s))(Yr||{}),qr=(s=>(s.CATEGORY="kategori",s.PRIMARY_GROUP="golongan pokok",s.GROUP="golongan",s.SUB_GROUP="subgolongan",s.CLUSTER="kelompok",s))(qr||{}),Mr=(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))(Mr||{});var Wr=(i=>(i.ALL="all",i.PROVINCE="prov",i.REGENCY="kab",i.REGENCY_BY_PROVINCE="kabbyprov",i))(Wr||{});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 ei={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 he=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 be=class{},Er=class extends be{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 Fe=class extends be{constructor(t){super();this.repository=t;}async execute(t){return this.repository.getAll(t)}};var Ut=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 F=class o extends m{constructor(t,r,i,s,n){super();this.page=t;this.perPage=r;this.total=i;this.pages=s;this.count=n;}get hasNextPage(){return this.page<this.pages}get hasPreviousPage(){return this.page>1}get nextPage(){return this.hasNextPage?this.page+1:null}get previousPage(){return this.hasPreviousPage?this.page-1:null}toJson(){return {page:this.page,per_page:this.perPage,total:this.total,pages:this.pages,count:this.count}}static fromJson(t){return new o(t.page||1,t.per_page||10,t.total||0,t.pages||0,t.count||0)}};var Ir=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)),n=t.pagination,c=n?F.fromJson(n):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)),n=t.pagination,c=F.fromJson(n);return new o(s,c)}};var Ot=class{constructor(e){this.remoteDataSource=e;}async getAll(e){if(!e)throw new a("Domain list params are required");return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(d=>Ve.fromJson(d)),c=Number(i.count)||s.length,u=Number(i.per_page)||c,l=new F(Number(i.page||1),u,Number(i.total||0),Number(i.pages||1),c);return new g(n,l)}catch(i){throw new a(`Failed to parse domain data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var W=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 Ot(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Fe(r)});}static getAllDomainsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};W.REMOTE_DATA_SOURCE="DomainRemoteDataSource",W.REPOSITORY="DomainRepository",W.GET_ALL_USE_CASE="GetAllDomains";var Be=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.title=r;this.releaseDate=i;this.url=s;this.cover=n;}toJson(){return {id:this.id,title:this.title,rl_date:this.releaseDate.toISOString().split("T")[0],url:this.url,cover:this.cover}}static fromJson(t){return new o(String(t.id||""),String(t.title||""),new Date(String(t.rl_date||t.release_date||t.releaseDate||"")),String(t.url||""),String(t.cover||""))}};var ee=class o extends m{constructor(t,r,i,s,n,c,u,l,d,f,Re,y,B){super();this.id=t;this.title=r;this.issn=i;this.cover=s;this.pdf=n;this.size=c;this.scheduledDate=u;this.releaseDate=l;this.updateDate=d;this.abstract=f;this.catalogueNumber=Re;this.publicationNumber=y;this.relatedPublications=B;}toJson(){return {id:this.id,title:this.title,issn:this.issn,cover:this.cover,pdf:this.pdf,size:this.size,scheduled_date:this.scheduledDate?.toISOString().split("T")[0]||null,rl_date:this.releaseDate?.toISOString().split("T")[0]||null,updt_date:this.updateDate?.toISOString().split("T")[0]||null,abstract:this.abstract,catalogue_number:this.catalogueNumber,publication_number:this.publicationNumber,related_publications:this.relatedPublications.map(t=>t.toJson())}}static fromJson(t){let r=t.related_publications||t.relatedPublications,i=Array.isArray(r)?r.map(s=>Be.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 Ge=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Je=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.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 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 n=s.map(l=>ee.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>ee.fromJson(l))}catch(i){throw new a(`Failed to parse publications: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Publication not found");let i=r.data[0];if(!i)throw new a("Publication data is empty");return ee.fromJson(i)}catch(i){throw new a(`Failed to parse publication data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var I=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 Vt(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 Je(r)});}static getAllPublicationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPublicationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};I.REMOTE_DATA_SOURCE="PublicationRemoteDataSource",I.REPOSITORY="PublicationRepository",I.GET_ALL_USE_CASE="GetAllPublications",I.GET_BY_ID_USE_CASE="GetPublicationById";var te=class o extends m{constructor(t,r,i,s,n,c){super();this.id=t;this.title=r;this.image=i;this.category=s;this.downloadUrl=n;this.description=c;}toJson(){return {inf_id:this.id,title:this.title,img:this.image,category:this.category,dl:this.downloadUrl,desc:this.description}}static fromJson(t){return new o(String(t.inf_id||t.id||""),String(t.title||""),String(t.img||t.image||""),Number(t.category||0),String(t.dl||t.downloadUrl||""),t.desc||t.description?String(t.desc||t.description):null)}};var $e=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 Ft=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 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 n=s.map(l=>te.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>te.fromJson(l))}catch(i){throw new a(`Failed to parse 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 te.fromJson(i)}catch(i){throw new a(`Failed to parse infographic data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var v=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 $e(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ye(r)});}static getAllInfographicsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getInfographicByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};v.REMOTE_DATA_SOURCE="InfographicRemoteDataSource",v.REPOSITORY="InfographicRepository",v.GET_ALL_USE_CASE="GetAllInfographics",v.GET_BY_ID_USE_CASE="GetInfographicById";var re=class o extends Error{constructor(e){super(e),this.name="StadataException",Object.setPrototypeOf(this,o.prototype);}},ie=class o extends re{constructor(t,r,i){super(t);this.statusCode=r;this.response=i;this.name="ApiException",Object.setPrototypeOf(this,o.prototype);}},qe=class o extends re{constructor(e="Request was cancelled"){super(e),this.name="CancelledException",Object.setPrototypeOf(this,o.prototype);}},vr=class o extends re{constructor(e){super(e),this.name="NetworkException",Object.setPrototypeOf(this,o.prototype);}},Cr=class o extends re{constructor(e="Request timeout"){super(e),this.name="TimeoutException",Object.setPrototypeOf(this,o.prototype);}},_r=class o extends ie{constructor(e="Resource not found"){super(e,404),this.name="NotFoundException",Object.setPrototypeOf(this,o.prototype);}},Tr=class o extends ie{constructor(e="Unauthorized"){super(e,401),this.name="UnauthorizedException",Object.setPrototypeOf(this,o.prototype);}},Dr=class o extends ie{constructor(e="Forbidden"){super(e,403),this.name="ForbiddenException",Object.setPrototypeOf(this,o.prototype);}},Lr=class o extends ie{constructor(e="Server error",t=500){super(e,t),this.name="ServerException",Object.setPrototypeOf(this,o.prototype);}};var kr=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 qe(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 xr=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 Q=class o extends m{constructor(t,r,i,s,n,c){super();this.id=t;this.title=r;this.content=i;this.releaseDate=s;this.categoryId=n;this.picture=c;}toJson(){return {news_id:this.id,title:this.title,news_content:this.content,rl_date:this.releaseDate,category_id:this.categoryId,picture:this.picture}}static fromJson(t){return new o(String(t.news_id||t.id||""),String(t.title||""),String(t.news_content||t.content||""),String(t.rl_date||t.releaseDate||""),Number(t.category_id||t.categoryId||0),t.picture?String(t.picture):null)}};var we=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Se=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Me=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 We=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>Q.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>Q.fromJson(l))}catch(i){throw new a(`Failed to parse news: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("News not found");let i=r.data[0];if(!i)throw new a("News data is empty");return Q.fromJson(i)}catch(i){throw new a(`Failed to parse news data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var S=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Me(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new We(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new we(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Se(r)});}static getAllNewsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};S.REMOTE_DATA_SOURCE="NewsRemoteDataSource",S.REPOSITORY="NewsRepository",S.GET_ALL_USE_CASE="GetAllNews",S.GET_BY_ID_USE_CASE="GetNewsById";var oe=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 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 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.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 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 n=s.map(l=>oe.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>oe.fromJson(l))}catch(i){throw new a(`Failed to parse news category: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("News category not found");let i=r.data[0];if(!i)throw new a("News category data is empty");return oe.fromJson(i)}catch(i){throw new a(`Failed to parse news category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var C=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 Ke(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ze(r)});}static getAllNewsCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getNewsCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};C.REMOTE_DATA_SOURCE="NewsCategoryRemoteDataSource",C.REPOSITORY="NewsCategoryRepository",C.GET_ALL_USE_CASE="GetAllNewsCategories",C.GET_BY_ID_USE_CASE="GetNewsCategoryById";var Z=class o extends m{constructor(t,r,i,s,n,c,u,l,d,f,Re){super();this.id=t;this.subjectId=r;this.subject=i;this.title=s;this.abstract=n;this.releaseDate=c;this.updatedDate=u;this.pdf=l;this.size=d;this.slide=f;this.thumbnail=Re;}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 Ae=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var He=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 Qe=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>Z.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>Z.fromJson(l))}catch(i){throw new a(`Failed to parse press releases: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Press release not found");let i=r.data[0];if(!i)throw new a("Press release data is empty");return Z.fromJson(i)}catch(i){throw new a(`Failed to parse press release data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var P=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new He(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Qe(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 Ae(r)});}static getAllPressReleasesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPressReleaseByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};P.REMOTE_DATA_SOURCE="PressReleaseRemoteDataSource",P.REPOSITORY="PressReleaseRepository",P.GET_ALL_USE_CASE="GetAllPressReleases",P.GET_BY_ID_USE_CASE="GetPressReleaseById";var X=class o extends m{constructor(t,r,i,s,n,c){super();this.id=t;this.title=r;this.subjectId=i;this.size=s;this.updatedAt=n;this.excelUrl=c;}toJson(){return {table_id:this.id,title:this.title,subj_id:this.subjectId,size:this.size,updt_date:this.updatedAt,excel:this.excelUrl}}static fromJson(t){return new o(String(t.table_id||t.id||""),String(t.title||""),Number(t.subj_id||t.subjectId||0),String(t.size||""),String(t.updt_date||t.updatedAt||""),String(t.excel||t.excelUrl||""))}};var Ee=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var Ie=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Ze=class{constructor(e){this.client=e;}async getAll(e){let t={};e.domain&&(t.domain=e.domain),e.lang&&(t.lang=e.lang),e.page&&(t.page=e.page.toString()),e.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 Xe=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>X.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>X.fromJson(l))}catch(i){throw new a(`Failed to parse static tables: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Static table not found");let i=r.data[0];if(!i)throw new a("Static table data is empty");return X.fromJson(i)}catch(i){throw new a(`Failed to parse static table data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var A=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new Ze(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new Xe(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ee(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ie(r)});}static getAllStaticTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStaticTableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};A.REMOTE_DATA_SOURCE="StaticTableRemoteDataSource",A.REPOSITORY="StaticTableRepository",A.GET_ALL_USE_CASE="GetAllStaticTables",A.GET_BY_ID_USE_CASE="GetStaticTableById";var se=class o extends m{constructor(t,r,i,s){super();this.id=t;this.name=r;this.categoryId=i;this.category=s;}toJson(){return {subj_id:this.id,title:this.name,subcatid:this.categoryId,category:this.category}}static fromJson(t){return new o(Number(t.sub_id||t.id||0),String(t.title||t.name||""),Number(t.subcat_id||t.categoryId||0),String(t.category||t.subcat||""))}};var je=class{constructor(e){this.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 $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.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 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 n=s.map(l=>se.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>se.fromJson(l))}catch(i){throw new a(`Failed to parse 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 se.fromJson(i)}catch(i){throw new a(`Failed to parse subject data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var _=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 je(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new et(r)});}static getAllSubjectsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};_.REMOTE_DATA_SOURCE="SubjectRemoteDataSource",_.REPOSITORY="SubjectRepository",_.GET_ALL_USE_CASE="GetAllSubjects",_.GET_BY_ID_USE_CASE="GetSubjectById";var ae=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 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 qt=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 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 n=s.map(l=>ae.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>ae.fromJson(l))}catch(i){throw new a(`Failed to parse subject category: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Subject category not found");let i=r.data[0];if(!i)throw new a("Subject category data is empty");return ae.fromJson(i)}catch(i){throw new a(`Failed to parse subject category data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var T=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 tt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new rt(r)});}static getAllSubjectCategoriesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getSubjectCategoryByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};T.REMOTE_DATA_SOURCE="SubjectCategoryRemoteDataSource",T.REPOSITORY="SubjectCategoryRepository",T.GET_ALL_USE_CASE="GetAllSubjectCategories",T.GET_BY_ID_USE_CASE="GetSubjectCategoryById";var ne=class o extends m{constructor(t,r,i,s,n,c,u,l,d,f,Re){super();this.variableId=t;this.indicatorId=r;this.subjectCsa=i;this.title=s;this.name=n;this.dataSource=c;this.value=u;this.unit=l;this.category=d;this.hashId=f;this.period=Re;}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 it=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var ot=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var Wt=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 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 n=s.map(l=>ne.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>ne.fromJson(l))}catch(i){throw new a(`Failed to parse 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 ne.fromJson(i)}catch(i){throw new a(`Failed to parse strategic indicator data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var D=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 it(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ot(r)});}static getAllStrategicIndicatorsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStrategicIndicatorByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};D.REMOTE_DATA_SOURCE="StrategicIndicatorRemoteDataSource",D.REPOSITORY="StrategicIndicatorRepository",D.GET_ALL_USE_CASE="GetAllStrategicIndicators",D.GET_BY_ID_USE_CASE="GetStrategicIndicatorById";var le=class o extends m{constructor(t,r,i,s,n,c,u,l,d,f,Re,y,B){super();this.id=t;this.title=r;this.subjectId=i;this.subjectName=s;this.statisticClassificationId=n;this.statisticClassificationName=c;this.definition=u;this.notes=l;this.unit=d;this.verticalVariableCount=f;this.derivedVariableCount=Re;this.graphId=y;this.graphName=B;}toJson(){return {var_id:this.id,title:this.title,sub_id:this.subjectId,sub_name:this.subjectName,subcsa_id:this.statisticClassificationId,subcsa_name:this.statisticClassificationName,def:this.definition,notes:this.notes,vertical:this.verticalVariableCount,unit:this.unit,graph_id:this.graphId,graph_name:this.graphName}}static fromJson(t){return new o(Number(t.var_id||t.id||0),String(t.title||t.name||""),Number(t.sub_id||t.subject_id||t.subjectId||0),String(t.sub_name||t.subject_name||t.subjectName||""),Number(t.subcsa_id||t.statisticClassificationId||0),String(t.subcsa_name||t.statisticClassificationName||""),String(t.def||t.definition||""),String(t.notes||""),String(t.unit||""),Number(t.vertical||t.vertical_variable||t.verticalVariableCount||0),Number(t.derived_variable||t.derivedVariableCount||0),Number(t.graph_id||t.graphId||0),String(t.graph_name||t.graphName||""))}};var st=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var at=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var 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?.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 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 n=s.map(l=>le.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>le.fromJson(l))}catch(i){throw new a(`Failed to parse variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Variable not found");let i=r.data[0];if(!i)throw new a("Variable data is empty");return le.fromJson(i)}catch(i){throw new a(`Failed to parse variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var L=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 st(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new at(r)});}static getAllVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};L.REMOTE_DATA_SOURCE="VariableRemoteDataSource",L.REPOSITORY="VariableRepository",L.GET_ALL_USE_CASE="GetAllVariables",L.GET_BY_ID_USE_CASE="GetVariableById";var ce=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.label=r;this.itemId=i;this.groupId=s;this.groupName=n;}toJson(){return {kode_ver_id:this.id,vervar:this.label,item_ver_id:this.itemId,group_ver_id:this.groupId,name_group_ver_id:this.groupName}}static fromJson(t){return new o(Number(t.kode_ver_id||t.id||0),String(t.vervar||t.label||""),Number(t.item_ver_id||t.itemId||0),Number(t.group_ver_id||t.groupId||0),String(t.name_group_ver_id||t.groupName||""))}};var nt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var lt=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={};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 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 n=s.map(l=>ce.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>ce.fromJson(l))}catch(i){throw new a(`Failed to parse vertical variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Vertical variable not found");let i=r.data[0];if(!i)throw new a("Vertical variable data is empty");return ce.fromJson(i)}catch(i){throw new a(`Failed to parse vertical variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var k=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 nt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new lt(r)});}static getAllVerticalVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getVerticalVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};k.REMOTE_DATA_SOURCE="VerticalVariableRemoteDataSource",k.REPOSITORY="VerticalVariableRepository",k.GET_ALL_USE_CASE="GetAllVerticalVariables",k.GET_BY_ID_USE_CASE="GetVerticalVariableById";var ue=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 ct=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var ut=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=`${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 n=s.map(l=>ue.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>ue.fromJson(l))}catch(i){throw new a(`Failed to parse 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 ue.fromJson(i)}catch(i){throw new a(`Failed to parse unit data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var x=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 jt(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ct(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ut(r)});}static getAllUnitsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getUnitByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};x.REMOTE_DATA_SOURCE="UnitRemoteDataSource",x.REPOSITORY="UnitRepository",x.GET_ALL_USE_CASE="GetAllUnits",x.GET_BY_ID_USE_CASE="GetUnitById";var me=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 mt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var pt=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var er=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 tr=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>me.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>me.fromJson(l))}catch(i){throw new a(`Failed to parse 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 me.fromJson(i)}catch(i){throw new a(`Failed to parse period data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var U=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new er(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new tr(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new mt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new pt(r)});}static getAllPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};U.REMOTE_DATA_SOURCE="PeriodRemoteDataSource",U.REPOSITORY="PeriodRepository",U.GET_ALL_USE_CASE="GetAllPeriods",U.GET_BY_ID_USE_CASE="GetPeriodById";var pe=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 dt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var gt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var rr=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 ir=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>pe.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>pe.fromJson(l))}catch(i){throw new a(`Failed to parse 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 pe.fromJson(i)}catch(i){throw new a(`Failed to parse derived period data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var O=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 dt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new gt(r)});}static getAllDerivedPeriodsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedPeriodByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};O.REMOTE_DATA_SOURCE="DerivedPeriodRemoteDataSource",O.REPOSITORY="DerivedPeriodRepository",O.GET_ALL_USE_CASE="GetAllDerivedPeriods",O.GET_BY_ID_USE_CASE="GetDerivedPeriodById";var de=class o extends m{constructor(t,r,i,s){super();this.id=t;this.name=r;this.groupId=i;this.groupName=s;}toJson(){return {turvar_id:this.id,turvar:this.name,group_turvar_id:this.groupId,name_group_turvar:this.groupName}}static fromJson(t){return new o(Number(t.turvar_id||t.id||0),String(t.turvar||t.name||""),Number(t.group_turvar_id||t.groupId||0),String(t.name_group_turvar||t.groupName||""))}};var yt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var ft=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var or=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 sr=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>de.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>de.fromJson(l))}catch(i){throw new a(`Failed to parse derived variable: ${i instanceof Error?i.message:"Unknown error"}`)}})}async getById(e){return (await this.remoteDataSource.getById(e)).map(r=>{try{if(r.data.length===0)throw new a("Derived variable not found");let i=r.data[0];if(!i)throw new a("Derived variable data is empty");return de.fromJson(i)}catch(i){throw new a(`Failed to parse derived variable data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var N=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new or(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new sr(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new yt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ft(r)});}static getAllDerivedVariablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getDerivedVariableByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};N.REMOTE_DATA_SOURCE="DerivedVariableRemoteDataSource",N.REPOSITORY="DerivedVariableRepository",N.GET_ALL_USE_CASE="GetAllDerivedVariables",N.GET_BY_ID_USE_CASE="GetDerivedVariableById";var ge=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 Rt=class{constructor(e){this.repository=e;}execute(e){return this.repository.getAll(e)}};var ht=class{constructor(e){this.repository=e;}execute(e){return this.repository.getById(e)}};var ar=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 nr=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||!Array.isArray(r.data)||r.data.length<2)throw new a("Invalid response structure: missing or invalid data array");let i=r.data[0],s=r.data[1];if(!i||!s)throw new a("Invalid response structure");let n=s.map(l=>ge.fromJson(l)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return g.fromJson({data:n,pagination:{page:Number(i.page||1),per_page:u,total:Number(i.total||0),pages:Number(i.pages||1),count:c}},l=>ge.fromJson(l))}catch(i){throw new a(`Failed to parse 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 ge.fromJson(i)}catch(i){throw new a(`Failed to parse statistic classification data: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var V=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_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Rt(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new ht(r)});}static getAllStatisticClassificationsUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getStatisticClassificationByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};V.REMOTE_DATA_SOURCE="StatisticClassificationRemoteDataSource",V.REPOSITORY="StatisticClassificationRepository",V.GET_ALL_USE_CASE="GetAllStatisticClassifications",V.GET_BY_ID_USE_CASE="GetStatisticClassificationById";var bt=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.name=r;this.itemId=i;this.itemCode=s;this.itemName=n;}toJson(){return {id:this.id,name:this.name,itemID:this.itemId,itemCode:this.itemCode,itemName:this.itemName}}toJSON(){return this.toJson()}static fromJson(t){return new o(String(t.id||""),String(t.name||""),String(t.itemID||""),String(t.itemCode||""),String(t.itemName||""))}};var ve=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 wt=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 St=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,n,c){super();this.id=t;this.topicId=r;this.topic=i;this.eventId=s;this.name=n;this.description=c;}toJson(){let t={id:this.id,id_topik:this.topicId,topik:this.topic,id_kegiatan:this.eventId,nama:this.name};return this.description!==void 0&&this.description!==null&&(t.deskripsi=this.description),t}toJSON(){return this.toJson()}static fromJson(t){return new o(Number(t.id||0),Number(t.id_topik||0),String(t.topik||""),Number(t.id_kegiatan||0),String(t.nama||""),t.deskripsi?String(t.deskripsi):null)}};var At=class o extends m{constructor(t,r,i,s,n,c,u,l,d){super();this.regionId=t;this.regionCode=r;this.regionName=i;this.indicatorId=s;this.indicatorName=n;this.categories=c;this.period=u;this.value=l;this.regionLevel=d;}toJson(){let t={id_wilayah:this.regionId,kode_wilayah:this.regionCode,nama_wilayah:this.regionName,id_indikator:this.indicatorId,nama_indikator:this.indicatorName,categories:this.categories.map(r=>({id:r.id,name:r.name,item_id:r.itemId,item_code:r.itemCode,item_name:r.itemName})),period:this.period,nilai:this.value};return this.regionLevel!==void 0&&this.regionLevel!==null&&(t.level_wilayah=this.regionLevel),t}toJSON(){return this.toJson()}static fromJson(t){let r=[];for(let i=1;i<=5;i++){let s=String(t[`id_kategori_${i}`]||""),n=String(t[`nama_kategori_${i}`]||""),c=String(t[`id_item_kategori_${i}`]||""),u=String(t[`kode_item_kategori_${i}`]||""),l=String(t[`nama_item__kategori_${i}`]||"");!s||!n||!c||!u||!l||r.push(new bt(s,n,c,u,l));}return new o(String(t.id_wilayah||""),String(t.kode_wilayah||""),String(t.nama_wilayah||""),String(t.id_indikator||""),String(t.nama_indikator||""),r,String(t.period||""),Number(t.nilai||0),t.level_wilayah?String(t.level_wilayah):null)}};var Et=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var It=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getById(e)}};var lr=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 cr=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{if(!r.data||r.data===null)return this.createEmptyListResult(e);if(!Array.isArray(r.data)||r.data.length<2)return this.createEmptyListResult(e);let i=r.data[0],s=r.data[1];if(s&&!Array.isArray(s)&&typeof s=="object"){let l=s;l.data&&Array.isArray(l.data)&&(s=l.data);}if(!s||!Array.isArray(s))return this.createEmptyListResult(e,i);let n=s.map(l=>this.parseEntity(l,e?.type)),c=Number(i.count)||s.length,u=Number(i.per_page)||c;return new g(n,new F(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 ve.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 wt.fromJson(e);case "areas":return St.fromJson(e);case "datasets":return Pt.fromJson(e);case "data":return At.fromJson(e);case "events":default:return ve.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 R=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new lr(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new cr(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Et(r)}),e.registerFactory(this.GET_BY_ID_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new It(r)});}static getAllCensusesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}static getCensusByIdUseCase(e){return e.resolve(this.GET_BY_ID_USE_CASE)}};R.REMOTE_DATA_SOURCE="CensusRemoteDataSource",R.REPOSITORY="CensusRepository",R.GET_ALL_USE_CASE="GetAllCensuses",R.GET_BY_ID_USE_CASE="GetCensusById";var ur=class o extends m{constructor(t,r,i,s,n,c,u){super();this.value=t;this.label=r;this.unit=i;this.subject=s;this.definition=n;this.notes=c;this.decimal=u;}toJson(){return {val:this.value,label:this.label,unit:this.unit,subj:this.subject,def:this.definition,note:this.notes,...this.decimal!==void 0&&{decimal:this.decimal}}}static fromJson(t){return new o(Number(t.val||0),String(t.label||""),String(t.unit||""),String(t.subj||""),String(t.def||""),String(t.note||""),t.decimal!==void 0?Number(t.decimal):void 0)}},ye=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||""))}},mr=class o extends ye{static fromJson(e){let t=e.val;return new o(typeof t=="number"?t:String(t||""),String(e.label||""))}},pr=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||""))}},dr=class o extends m{constructor(t,r,i,s,n){super();this.id=t;this.title=r;this.tableSource=i;this.lastUpdate=s;this.link=n;}toJson(){return {id:this.id,title:this.title,tablesource:this.tableSource,last_update:this.lastUpdate,link:this.link}}static fromJson(t){return new o(String(t.id||""),String(t.title||""),Number(t.tablesource||0),t.last_update!==null?String(t.last_update||""):null,String(t.link||""))}};var vt=class o extends m{constructor(t,r,i,s,n,c,u,l,d,f){super();this.subjects=t;this.variables=r;this.verticalVariables=i;this.verticalVariableLabel=s;this.periods=n;this.derivedVariables=c;this.derivedPeriods=u;this.dataContent=l;this.related=d;this.lastUpdate=f;}toJson(){return {subject:this.subjects.map(t=>t.toJson()),var:this.variables.map(t=>t.toJson()),vervar:this.verticalVariables.map(t=>t.toJson()),labelvervar:this.verticalVariableLabel,tahun:this.periods.map(t=>t.toJson()),turvar:this.derivedVariables.map(t=>t.toJson()),turtahun:this.derivedPeriods.map(t=>t.toJson()),datacontent:this.dataContent,related:this.related.map(t=>t.toJson()),last_update:this.lastUpdate}}static fromJson(t){let r=Array.isArray(t.subject)?t.subject:[],i=Array.isArray(t.var)?t.var:[],s=Array.isArray(t.vervar)?t.vervar:[],n=Array.isArray(t.tahun)?t.tahun:[],c=Array.isArray(t.turvar)?t.turvar:[],u=Array.isArray(t.turtahun)?t.turtahun:[],l=Array.isArray(t.related)?t.related:[];return new o(r.map(d=>pr.fromJson(d)),i.map(d=>ur.fromJson(d)),s.map(d=>ye.fromJson(d)),String(t.labelvervar||""),n.map(d=>mr.fromJson(d)),c.map(d=>ye.fromJson(d)),u.map(d=>ye.fromJson(d)),t.datacontent||{},l.map(d=>dr.fromJson(d)),t.last_update!==void 0?t.last_update:void 0)}getDataValue(t,r,i,s,n){let c=`${t}${r}${i}${s}${n}`;return this.dataContent[c]}toStructuredData(){let t=this.subjects[0],r=this.variables[0],i=r?.value||0,s=this.derivedVariables.length>1||this.derivedVariables[0]?.value!==0&&this.derivedVariables[0]?.value!=="0",n=this.derivedPeriods.length>1||this.derivedPeriods[0]?.value!==0&&this.derivedPeriods[0]?.value!=="0",c=this.verticalVariables.map(u=>s?{id:u.value,label:u.label,data:this.derivedVariables.map(l=>({id:l.value,label:l.label,data:this.periods.map(d=>n?{id:d.value,label:d.label,data:this.derivedPeriods.map(f=>({id:f.value,label:f.label,value:this.getDataValue(u.value,i,l.value,d.value,f.value)??null}))}:{id:d.value,label:d.label,value:this.getDataValue(u.value,i,l.value,d.value,this.derivedPeriods[0]?.value||0)??null})}))}:{id:u.value,label:u.label,data:this.periods.map(l=>({id:l.value,label:l.label,data:n?this.derivedPeriods.map(d=>({id:d.value,label:d.label,value:this.getDataValue(u.value,i,0,l.value,d.value)??null})):[{id:l.value,label:l.label,value:this.getDataValue(u.value,i,0,l.value,this.derivedPeriods[0]?.value||0)??null}]}))});return {subject_id:t?.value||0,subject_label:t?.label||"",variable_id:r?.value||0,variable_label:r?.label||"",variable_unit:r?.unit||"",vertical_variable_label:this.verticalVariableLabel,last_update:this.lastUpdate,data:c}}};var Ct=class{constructor(e){this.repository=e;}async execute(e){return this.repository.getAll(e)}};var gr=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 yr=class{constructor(e){this.remoteDataSource=e;}async getAll(e){return (await this.remoteDataSource.getAll(e)).map(r=>{try{return vt.fromJson(r)}catch(i){throw new a(`Failed to parse dynamic table: ${i instanceof Error?i.message:"Unknown error"}`)}})}};var K=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new gr(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new yr(r)}),e.registerFactory(this.GET_ALL_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new Ct(r)});}static getAllDynamicTablesUseCase(e){return e.resolve(this.GET_ALL_USE_CASE)}};K.REMOTE_DATA_SOURCE="DynamicTableRemoteDataSource",K.REPOSITORY="DynamicTableRepository",K.GET_ALL_USE_CASE="GetAllDynamicTables";var fr=class{constructor(e){this.injector=e;}async domains(e){return W.getAllDomainsUseCase(this.injector).execute(e)}async publications(e){return I.getAllPublicationsUseCase(this.injector).execute(e)}async infographics(e){return v.getAllInfographicsUseCase(this.injector).execute(e)}async news(e){return S.getAllNewsUseCase(this.injector).execute(e)}async newsCategories(e){return C.getAllNewsCategoriesUseCase(this.injector).execute(e)}async pressReleases(e){return P.getAllPressReleasesUseCase(this.injector).execute(e)}async staticTables(e){return A.getAllStaticTablesUseCase(this.injector).execute(e)}async subjects(e){return _.getAllSubjectsUseCase(this.injector).execute(e)}async subjectCategories(e){return T.getAllSubjectCategoriesUseCase(this.injector).execute(e)}async strategicIndicators(e){return D.getAllStrategicIndicatorsUseCase(this.injector).execute(e)}async variables(e){return L.getAllVariablesUseCase(this.injector).execute(e)}async verticalVariables(e){return k.getAllVerticalVariablesUseCase(this.injector).execute(e)}async units(e){return x.getAllUnitsUseCase(this.injector).execute(e)}async periods(e){return U.getAllPeriodsUseCase(this.injector).execute(e)}async derivedPeriods(e){return O.getAllDerivedPeriodsUseCase(this.injector).execute(e)}async derivedVariables(e){return N.getAllDerivedVariablesUseCase(this.injector).execute(e)}async statisticClassifications(e){return V.getAllStatisticClassificationsUseCase(this.injector).execute(e)}async censusEvents(){return R.getAllCensusesUseCase(this.injector).execute()}async censusTopics(e){return R.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"topics"})}async censusEventAreas(e){return R.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,type:"areas"})}async censusEventDatasets(e){return R.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,topicId:e.topicId,type:"datasets"})}async censusData(e){return R.getAllCensusesUseCase(this.injector).execute({censusId:e.censusId,censusAreaId:e.censusAreaId,datasetId:e.datasetId,type:"data"})}async dynamicTables(e){return K.getAllDynamicTablesUseCase(this.injector).execute(e)}};var Rr=class{constructor(e){this.injector=e;}async publication(e){return I.getPublicationByIdUseCase(this.injector).execute(e)}async infographic(e){return v.getInfographicByIdUseCase(this.injector).execute(e)}async news(e){return S.getNewsByIdUseCase(this.injector).execute(e)}async newsCategory(e){return C.getNewsCategoryByIdUseCase(this.injector).execute(e)}async pressRelease(e){return P.getPressReleaseByIdUseCase(this.injector).execute(e)}async staticTable(e){return A.getStaticTableByIdUseCase(this.injector).execute(e)}async subject(e){return _.getSubjectByIdUseCase(this.injector).execute(e)}async subjectCategory(e){return T.getSubjectCategoryByIdUseCase(this.injector).execute(e)}async strategicIndicator(e){return D.getStrategicIndicatorByIdUseCase(this.injector).execute(e)}async variable(e){return L.getVariableByIdUseCase(this.injector).execute(e)}async verticalVariable(e){return k.getVerticalVariableByIdUseCase(this.injector).execute(e)}async unit(e){return x.getUnitByIdUseCase(this.injector).execute(e)}async period(e){return U.getPeriodByIdUseCase(this.injector).execute(e)}async derivedPeriod(e){return O.getDerivedPeriodByIdUseCase(this.injector).execute(e)}async derivedVariable(e){return N.getDerivedVariableByIdUseCase(this.injector).execute(e)}async statisticClassification(e){return V.getStatisticClassificationByIdUseCase(this.injector).execute(e)}async census(e){return R.getCensusByIdUseCase(this.injector).execute(e)}};var Ur=class o extends m{constructor(t,r,i,s,n,c){super();this.value=t;this.netWeight=r;this.hsCode=i;this.port=s;this.country=n;this.year=c;}toJson(){return {value:this.value,netweight:this.netWeight,kodehs:this.hsCode,pod:this.port,ctr:this.country,tahun:this.year}}static fromJson(t){return new o(Number(t.value||0),Number(t.netweight||0),String(t.kodehs||""),String(t.pod||""),String(t.ctr||""),String(t.tahun||""))}};var _t=class{constructor(e){this.repository=e;}execute(e){return this.repository.get(e)}};var hr=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 br=class{constructor(e){this.remoteDataSource=e;}get(e){return this.remoteDataSource.get(e)}};var fe=class{static register(e,t){e.registerFactory(this.REMOTE_DATA_SOURCE,()=>new hr(t)),e.registerFactory(this.REPOSITORY,()=>{let r=e.resolve(this.REMOTE_DATA_SOURCE);return new br(r)}),e.registerFactory(this.GET_TRADE_USE_CASE,()=>{let r=e.resolve(this.REPOSITORY);return new _t(r)});}static getTradeUseCase(e){return e.resolve(this.GET_TRADE_USE_CASE)}};fe.REMOTE_DATA_SOURCE="TradeRemoteDataSource",fe.REPOSITORY="TradeRepository",fe.GET_TRADE_USE_CASE="GetTrade";var h=class h{constructor(e){this.logger=M.getInstance(),this.logger.configure({enabled:e.debug??false,filter:new H(e.logLevel??1)}),he.getInstance().setApiKey(e.apiKey),this.authInterceptor=new Ne(e.apiKey);let t=[this.authInterceptor,...e.interceptors||[]];this.networkClient=new Oe({baseURL:e.baseURL||xt.BASE_URL,timeout:e.timeout||xt.DEFAULT_TIMEOUT,interceptors:t}),this.injector=Ce.getInstance(),this.setupDependencies(),this._list=new fr(this.injector),this._view=new Rr(this.injector),this.logger.info("StadataJS initialized successfully");}static get instance(){if(!h._instance)throw new Error("StadataJS not initialized. Call StadataJS.init() first.");return h._instance}static init(e){return h._instance&&h._instance.logger.warn("StadataJS already initialized. Reinitializing..."),h._instance=new h(e),h._instance}static isInitialized(){return h._instance!==null}static destroy(){h._instance&&(h._instance.cleanup(),h._instance=null);}get list(){return this._list}get view(){return this._view}setApiKey(e){he.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 H(0)});}disableDebug(){this.logger.configure({filter:new H(1)});}async trade(e){return this.injector.resolve("GetTrade").execute(e)}setupDependencies(){W.register(this.injector,this.networkClient),I.register(this.injector,this.networkClient),v.register(this.injector,this.networkClient),S.register(this.injector,this.networkClient),C.register(this.injector,this.networkClient),P.register(this.injector,this.networkClient),A.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),U.register(this.injector,this.networkClient),O.register(this.injector,this.networkClient),N.register(this.injector,this.networkClient),V.register(this.injector,this.networkClient),R.register(this.injector,this.networkClient),K.register(this.injector,this.networkClient),fe.register(this.injector,this.networkClient);}cleanup(){this.injector.clear(),he.getInstance().clearApiKey(),this.logger.info("StadataJS cleaned up");}};h._instance=null;var Or=h;var ti=(t=>(t[t.Export=1]="Export",t[t.Import=2]="Import",t))(ti||{}),ri=(t=>(t[t.Monthly=1]="Monthly",t[t.Annually=2]="Annually",t))(ri||{}),ii=(t=>(t[t.TwoDigit=1]="TwoDigit",t[t.Full=2]="Full",t))(ii||{});
2
+ exports.ApiConstant=xt;exports.ApiEndpoint=p;exports.ApiException=ie;exports.ApiFailure=$;exports.ApiResponse=Ir;exports.AuthInterceptor=Ne;exports.BaseEntity=m;exports.CancelToken=kr;exports.CancelledException=qe;exports.CancelledFailure=_e;exports.CensusArea=St;exports.CensusCategory=bt;exports.CensusData=At;exports.CensusDataset=Pt;exports.CensusEvent=ve;exports.CensusTopic=wt;exports.ClassificationType=Yr;exports.ConsoleLogPrinter=Lt;exports.DataAvailability=$r;exports.DataLanguage=Jr;exports.DateHelper=xr;exports.DerivedPeriod=pe;exports.DerivedVariable=de;exports.Domain=Ve;exports.DomainType=Wr;exports.DynamicTable=vt;exports.Failure=q;exports.ForbiddenException=Dr;exports.ForbiddenFailure=xe;exports.GetAllCensuses=Et;exports.GetAllDerivedPeriods=dt;exports.GetAllDerivedVariables=yt;exports.GetAllDomains=Fe;exports.GetAllDynamicTables=Ct;exports.GetAllInfographics=$e;exports.GetAllNews=we;exports.GetAllNewsCategories=Ke;exports.GetAllPeriods=mt;exports.GetAllPressReleases=Pe;exports.GetAllPublications=Ge;exports.GetAllStaticTables=Ee;exports.GetAllStatisticClassifications=Rt;exports.GetAllStrategicIndicators=it;exports.GetAllSubjectCategories=tt;exports.GetAllSubjects=je;exports.GetAllUnits=ct;exports.GetAllVariables=st;exports.GetAllVerticalVariables=nt;exports.GetCensusById=It;exports.GetDerivedPeriodById=gt;exports.GetDerivedVariableById=ft;exports.GetInfographicById=Ye;exports.GetNewsById=Se;exports.GetNewsCategoryById=ze;exports.GetPeriodById=pt;exports.GetPressReleaseById=Ae;exports.GetPublicationById=Je;exports.GetStaticTableById=Ie;exports.GetStatisticClassificationById=ht;exports.GetStrategicIndicatorById=ot;exports.GetSubjectById=et;exports.GetSubjectCategoryById=rt;exports.GetTrade=_t;exports.GetUnitById=ut;exports.GetVariableById=at;exports.GetVerticalVariableById=lt;exports.HSCodeType=ii;exports.Infographic=te;exports.Injector=Ce;exports.KBKILevel=Mr;exports.KBLILevel=qr;exports.ListResult=g;exports.LogLevel=kt;exports.Logger=M;exports.LoggingInterceptor=Pr;exports.NetworkClient=Oe;exports.NetworkException=vr;exports.NetworkFailure=Te;exports.News=Q;exports.NewsCategory=oe;exports.NoParamsUseCase=Er;exports.NotFoundException=_r;exports.NotFoundFailure=Le;exports.Pagination=F;exports.ParseFailure=a;exports.Period=me;exports.PressRelease=Z;exports.ProductionLogFilter=H;exports.Publication=ee;exports.QueryParamConstant=ei;exports.RelatedPublication=Be;exports.RetryInterceptor=Ar;exports.ServerException=Lr;exports.ServerFailure=Ue;exports.StadataException=re;exports.StadataJS=Or;exports.StaticTable=X;exports.StatisticClassification=ge;exports.StrategicIndicator=ne;exports.Subject=se;exports.SubjectCategory=ae;exports.TimeoutException=Cr;exports.TimeoutFailure=De;exports.Trade=Ur;exports.TradePeriod=ri;exports.TradeSource=ti;exports.UnauthorizedException=Tr;exports.UnauthorizedFailure=ke;exports.Unit=ue;exports.UseCase=be;exports.ValidationFailure=Sr;exports.Variable=le;exports.VerticalVariable=ce;return exports;})({});//# sourceMappingURL=index.global.js.map
3
3
  //# sourceMappingURL=index.global.js.map