/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as e}from"tslib";import{strict as r}from"../../../core/jsonMap.js";import{JSONSupport as t}from"../../../core/JSONSupport.js";import{property as o,cast as a,subclass as i}from"../../../core/accessorSupport/decorators.js";import{ensureType as s,ensureOneOfType as l}from"../../../core/accessorSupport/ensureType.js";import{createTypeReader as p}from"../../../core/accessorSupport/extensions/serializableProperty/reader.js";import c from"../Field.js";import u from"./MapLayerSource.js";import n from"./QueryTableDataSource.js";import y from"./RasterDataSource.js";import b from"./TableDataSource.js";import{enumeration as S}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as d}from"../../../core/accessorSupport/decorators/reader.js";var f,T;const j=r()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let m=f=class extends t{constructor(e){super(e),this.type="join-table"}readLeftTableSource(e,r,t){return g()(e,r,t)}castLeftTableSource(e){return l(w(),e)}readRightTableSource(e,r,t){return g()(e,r,t)}castRightTableSource(e){return l(w(),e)}clone(){const{leftTableKey:e,rightTableKey:r,leftTableSource:t,rightTableSource:o,joinType:a}=this,i={leftTableKey:e,rightTableKey:r,leftTableSource:t?.clone()??void 0,rightTableSource:o?.clone()??void 0,joinType:a};return new f(i)}};e([S({joinTable:"join-table"}),o({json:{write:{isRequired:!0}}})],m.prototype,"type",void 0),e([o({type:String,json:{write:!0}})],m.prototype,"leftTableKey",void 0),e([o({type:String,json:{write:!0}})],m.prototype,"rightTableKey",void 0),e([o({json:{write:!0}})],m.prototype,"leftTableSource",void 0),e([d("leftTableSource")],m.prototype,"readLeftTableSource",null),e([a("leftTableSource")],m.prototype,"castLeftTableSource",null),e([o({json:{write:!0}})],m.prototype,"rightTableSource",void 0),e([d("rightTableSource")],m.prototype,"readRightTableSource",null),e([a("rightTableSource")],m.prototype,"castRightTableSource",null),e([S(j)],m.prototype,"joinType",void 0),m=f=e([i("esri.layers.support.source.JoinTableDataSource")],m);let h=null;function g(){return h||(h=p({types:w()})),h}let v=null;function w(){return v||(v={key:"type",base:null,typeMap:{"data-layer":R,"map-layer":u}}),v}const L={key:"type",base:null,typeMap:{"join-table":m,"query-table":n,raster:y,table:b}};let R=class extends t{static{T=this}constructor(e){super(e),this.type="data-layer"}clone(){const{fields:e,dataSource:r}=this;return new T({fields:e,dataSource:r})}};e([S({dataLayer:"data-layer"}),o({json:{write:{isRequired:!0}}})],R.prototype,"type",void 0),e([o({type:[c],json:{write:!0}})],R.prototype,"fields",void 0),e([o({types:L,json:{write:!0}})],R.prototype,"dataSource",void 0),R=T=e([i("esri.layers.support.source.DataLayerSource")],R),R.from=s(R);export{R as DataLayerSource,m as JoinTableDataSourceClass};
