UNPKG

lambdaorm

Version:
1 lines 21.4 kB
'use strict';const a82Q=a82y;function a82s(){const sc=['normalizeMap','120jmDIGy','name','push','Primitive','distinct','addSortNode','asc','desc','450854MSpqQW','KeyVal','modelConfigService','146341oqKyDo','insert','operatorAlias','SchemaError','Arrow','Entity\x20','68FlGRxW','pop','Const','include','Operator','primitive','List','map','Include\x20not\x20implemented!!!','completeInsertInclude','last','normalizeOperand','target','\x20not\x20found','createClauseFilter','38265LLoSSy','lambdaorm-base','getForcedEntity','OperandType','filter','page','from','fieldToKeyVal','includes','not\x20found\x20relation\x20in\x20include\x20operand\x20','788733kcCZGF','clone','primaryKey','bind','defineProperty','normalizeInclude','remove','typ3s','normalizeInsert','normalizeSentence','startsWith','\x20defined\x20in\x20primary\x20key','entity','30gbpDsC','normalizeSort','pos','createReadFields','Error\x20to\x20add\x20include\x20operand\x20','completeUpdateInclude','update','relations','75843ZHZHlk','completeSelectInclude','writeVarsFromList','10157ZIHput','128nOTHfn','Operand','1hCwmbv','normalizeFirst','find','\x20not\x20found\x20property\x20','84HtFhsR','delete','Var','cloner','helper','type','normalizeLast','SintaxisError','autoIncrement','properties','completeInclude','addChildFieldField','createFilter','boolean','updateAll','functionAlias','Relation\x20not\x20found','length','normalizeDelete','toString','Type','expressions','getClauses','CallFunc','completeMapInclude','string','completeBulkInsertInclude','split','returnType','getIncludeRelation','children','LambdaOrmParentId','toLowerCase','createWriteVars','completeFilter','Field','ChildFunc','any','sort','\x20not\x20found\x20in\x20','normalizeUpdate','580677LaENnb','bulkInsert','OrmOperandNormalizer','\x20cannot\x20be\x20create\x20filter\x20because\x20the\x20primary\x20key\x20is\x20empty','deleteAll','replace','completeDeleteInclude','Relation\x20','Obj','normalize','normalizeDistinct'];a82s=function(){return sc;};return a82s();}(function(s,y){const e=a82y,g=s();while(!![]){try{const x=-parseInt(e(0x1f8))/0x1*(parseInt(e(0x239))/0x2)+parseInt(e(0x225))/0x3+parseInt(e(0x242))/0x4*(parseInt(e(0x251))/0x5)+-parseInt(e(0x1fc))/0x6*(-parseInt(e(0x1f5))/0x7)+parseInt(e(0x1f6))/0x8*(-parseInt(e(0x1f2))/0x9)+-parseInt(e(0x268))/0xa*(-parseInt(e(0x25b))/0xb)+parseInt(e(0x231))/0xc*(parseInt(e(0x23c))/0xd);if(x===y)break;else g['push'](g['shift']());}catch(m){g['push'](g['shift']());}}}(a82s,0x4c062));function a82y(s,y){const O=a82s();return a82y=function(D,g){D=D-0x1ec;let M=O[D];return M;},a82y(s,y);}Object[a82Q(0x25f)](exports,'__esModule',{'value':!![]}),exports[a82Q(0x227)]=void 0x0;const lambdaorm_base_1=require(a82Q(0x252)),_3xpr_1=require('3xpr'),typ3s_1=require(a82Q(0x262));class OrmOperandNormalizer{constructor(s,y,g,x){const n=a82Q;this[n(0x23b)]=s,this[n(0x211)]=y,this[n(0x1ff)]=g,this['helper']=x;}[a82Q(0x22e)](s){const h=a82Q,y=this['cloner'][h(0x25c)](s);this[h(0x24d)](y);if(y[h(0x201)]===_3xpr_1['OperandType'][h(0x1fe)]&&y['children'][h(0x20d)]===0x0){const g=new _3xpr_1[(h(0x1f7))](y[h(0x1ec)],'p',_3xpr_1[h(0x254)][h(0x1fe)]),x=new _3xpr_1[(h(0x1f7))](y[h(0x1ec)],'p',_3xpr_1[h(0x254)][h(0x1fe)]),m=new _3xpr_1[(h(0x1f7))](y['pos'],h(0x249),_3xpr_1[h(0x254)][h(0x240)],[y,g,x]);return this[h(0x264)](m),m;}else return this[h(0x264)](y),y;}[a82Q(0x24d)](s){const s0=a82Q;if(s[s0(0x201)]===_3xpr_1['OperandType'][s0(0x240)]||s[s0(0x201)]===_3xpr_1[s0(0x254)][s0(0x220)]||s[s0(0x201)]===_3xpr_1[s0(0x254)][s0(0x213)]){const y=this[s0(0x211)][s0(0x20b)][s0(0x1fa)](g=>g[0x0]===s[s0(0x232)]);y&&(s['name']=y[0x1]);}else{if(s[s0(0x201)]===_3xpr_1[s0(0x254)][s0(0x246)]){const g=this['expressions'][s0(0x23e)]['find'](x=>x[0x0]===s[s0(0x232)]);g&&(s[s0(0x232)]=g[0x1]);}else s['type']===_3xpr_1[s0(0x254)][s0(0x244)]&&s[s0(0x218)]!==undefined&&s[s0(0x218)][s0(0x247)]===typ3s_1[s0(0x234)][s0(0x209)]&&(s[s0(0x232)]=s[s0(0x232)][s0(0x20f)]()[s0(0x21c)]()==='true');}for(const x of s[s0(0x21a)]){this['normalizeOperand'](x);}}[a82Q(0x212)](s){const s1=a82Q,y={};let g=s;while(g){let x=g[s1(0x201)]===_3xpr_1[s1(0x254)][s1(0x1fe)]?s1(0x257):g[s1(0x232)];if(x===s1(0x233))x=s1(0x23d),g[s1(0x232)]=s1(0x23d);else x===s1(0x261)&&(x=s1(0x1fd),g['name']='delete');y[x]=g;if(g[s1(0x21a)]['length']>0x0)g=g[s1(0x21a)][0x0];else break;}return y;}[a82Q(0x264)](s,y){const s2=a82Q;let g;const x=this[s2(0x212)](s),m=this[s2(0x23b)][s2(0x253)](y||x[s2(0x257)][s2(0x232)]);if(x[s2(0x23d)])g=this[s2(0x24b)],this['normalizeInsert'](m,x[s2(0x23d)]);else{if(x[s2(0x226)])g=this[s2(0x216)],this[s2(0x263)](m,x['bulkInsert']);else{if(x[s2(0x1f0)])g=this[s2(0x1ef)],this[s2(0x21e)](m,x,x['update']),this[s2(0x224)](m,x[s2(0x1f0)]);else{if(x['updateAll'])g=this['completeUpdateInclude'],this[s2(0x224)](m,x['updateAll']),x[s2(0x20a)][s2(0x232)]=s2(0x1f0);else{if(x[s2(0x1fd)])g=this[s2(0x22b)],this['completeFilter'](m,x,x['delete']),this[s2(0x20e)](x['delete']);else{if(x[s2(0x229)])g=this[s2(0x22b)],this[s2(0x20e)](x[s2(0x229)]),x['deleteAll'][s2(0x232)]=s2(0x1fd);else{if(x[s2(0x249)])g=this[s2(0x214)],this['normalizeMap'](m,x[s2(0x249)]);else{if(x[s2(0x235)])g=this[s2(0x214)],this[s2(0x22f)](x,m);else{if(x['first'])g=this['completeMapInclude'],this[s2(0x1f9)](x,s,m);else{if(x[s2(0x24c)])g=this[s2(0x214)],this[s2(0x202)](x,s,m);else{g=this[s2(0x214)];const w=new _3xpr_1[(s2(0x1f7))](s[s2(0x1ec)],'p',_3xpr_1[s2(0x254)][s2(0x1fe)]),t=new _3xpr_1[(s2(0x1f7))](s[s2(0x1ec)],'p',_3xpr_1[s2(0x254)][s2(0x1fe)]);s[s2(0x21a)][0x0]=new _3xpr_1[(s2(0x1f7))](s[s2(0x1ec)],s2(0x249),_3xpr_1[s2(0x254)][s2(0x240)],[s[s2(0x21a)][0x0],w,t]),x[s2(0x249)]=s[s2(0x21a)][0x0],this[s2(0x230)](m,x['map']);}}}}}}}}}}x[s2(0x222)]&&this[s2(0x269)](x),x[s2(0x256)]&&!x[s2(0x222)]&&this[s2(0x236)](x,s,s2(0x237)),x['include']&&this['normalizeInclude'](x,g,m);}[a82Q(0x21e)](s,y,g){const s3=a82Q;!y[s3(0x255)]&&this[s3(0x250)](s,g);}[a82Q(0x22f)](s,y){const s4=a82Q;s['map']=s['distinct'],s['map'][s4(0x232)]=s4(0x249),this[s4(0x230)](y,s[s4(0x249)]),s['map'][s4(0x21a)][0x2]=new _3xpr_1['Operand'](s[s4(0x249)][s4(0x1ec)],s4(0x235),_3xpr_1[s4(0x254)][s4(0x213)],[s[s4(0x249)][s4(0x21a)][0x2]]);}[a82Q(0x1f9)](s,y,g){const s5=a82Q;s[s5(0x249)]=s['first'],s[s5(0x249)]['name']=s5(0x249),this[s5(0x230)](g,s[s5(0x249)]);!s[s5(0x222)]&&this[s5(0x236)](s,y,'asc');if(!s[s5(0x256)]){const x=new _3xpr_1['Operand'](y['pos'],'1',_3xpr_1[s5(0x254)][s5(0x244)],[]),m=new _3xpr_1['Operand'](y[s5(0x1ec)],'1',_3xpr_1['OperandType'][s5(0x244)],[]);y[s5(0x21a)][0x0]=new _3xpr_1[(s5(0x1f7))](y[s5(0x1ec)],s5(0x256),_3xpr_1[s5(0x254)][s5(0x220)],[y[s5(0x21a)][0x0],x,m]);}}['normalizeLast'](s,y,g){const s6=a82Q;s['map']=s[s6(0x24c)],s[s6(0x249)][s6(0x232)]=s6(0x249),this['normalizeMap'](g,s[s6(0x249)]);!s[s6(0x222)]&&this[s6(0x236)](s,y,'desc');if(!s[s6(0x256)]){const x=new _3xpr_1[(s6(0x1f7))](y[s6(0x1ec)],'1',_3xpr_1[s6(0x254)][s6(0x244)],[]),m=new _3xpr_1[(s6(0x1f7))](y[s6(0x1ec)],'1',_3xpr_1[s6(0x254)][s6(0x244)],[]);y[s6(0x21a)][0x0]=new _3xpr_1[(s6(0x1f7))](y[s6(0x1ec)],'page',_3xpr_1['OperandType'][s6(0x220)],[y[s6(0x21a)][0x0],x,m]);}}[a82Q(0x236)](s,y,g){const s7=a82Q,x=s['map'][s7(0x21a)][0x2][s7(0x21a)][0x0],m=new _3xpr_1[(s7(0x1f7))](y[s7(0x1ec)],'p',_3xpr_1['OperandType'][s7(0x1fe)],[]),w=new _3xpr_1[(s7(0x1f7))](y[s7(0x1ec)],'p.'+x[s7(0x232)],_3xpr_1[s7(0x254)][s7(0x1fe)],[]),t=new _3xpr_1[(s7(0x1f7))](y[s7(0x1ec)],g,_3xpr_1[s7(0x254)]['CallFunc'],[w]);y[s7(0x21a)][0x0]=new _3xpr_1[(s7(0x1f7))](y['pos'],s7(0x222),_3xpr_1[s7(0x254)][s7(0x240)],[y[s7(0x21a)][0x0],m,t]);}[a82Q(0x269)](s){const s8=a82Q,y=s[s8(0x222)]['children'][0x2];if(y[s8(0x201)]===_3xpr_1[s8(0x254)]['List'])for(let g=0x0;g<y[s8(0x21a)]['length'];g++){(y[s8(0x21a)][g][s8(0x201)]!==_3xpr_1[s8(0x254)][s8(0x213)]||![s8(0x237),s8(0x238)][s8(0x259)](y[s8(0x21a)][g][s8(0x232)]))&&(y['children'][g]=new _3xpr_1[(s8(0x1f7))](y[s8(0x1ec)],'asc',_3xpr_1[s8(0x254)][s8(0x213)],[y[s8(0x21a)][g]]));}else(y[s8(0x201)]!==_3xpr_1[s8(0x254)][s8(0x213)]||!['asc',s8(0x238)][s8(0x259)](y[s8(0x232)]))&&(s[s8(0x222)]['children'][0x2]=new _3xpr_1[(s8(0x1f7))](s['sort'][s8(0x1ec)],s8(0x237),_3xpr_1['OperandType'][s8(0x213)],[y]));}[a82Q(0x260)](s,y,g){const s9=a82Q;if(!y)throw new lambdaorm_base_1['SchemaError'](s9(0x24a));const x=s[s9(0x245)],m=x[s9(0x21a)][0x1][s9(0x232)],w=x[s9(0x21a)][0x2];if(w[s9(0x201)]===_3xpr_1[s9(0x254)][s9(0x248)])for(let t=0x0;t<w['children'][s9(0x20d)];t++){w[s9(0x21a)][t]=y[s9(0x25e)](this)(g,m,w[s9(0x21a)][t]),s[s9(0x249)]&&this['addChildFieldField'](s[s9(0x249)],g,w[s9(0x21a)][t]);}else x[s9(0x21a)][0x2]=y['bind'](this)(g,m,w),s[s9(0x249)]&&this[s9(0x207)](s[s9(0x249)],g,w);}['addChildFieldField'](s,y,g){const ss=a82Q,x=this[ss(0x219)](y,g),m=s[ss(0x21a)][0x1]['name'],w=new _3xpr_1[(ss(0x1f7))](s[ss(0x1ec)],m+'.'+x[ss(0x257)],_3xpr_1['OperandType']['Var']),t=new _3xpr_1[(ss(0x1f7))](s[ss(0x1ec)],'__'+x['from'],_3xpr_1[ss(0x254)][ss(0x23a)],[w]);s['children'][0x2][ss(0x21a)][ss(0x233)](t);}[a82Q(0x230)](s,y){const sy=a82Q;if(y[sy(0x21a)]&&y['children']['length']===0x3){const g=y[sy(0x21a)][0x1]['name'],x=y[sy(0x21a)][0x2];if(x[sy(0x21a)]['length']===0x0&&x[sy(0x232)]===g)y[sy(0x21a)][0x2]=this[sy(0x1ed)](y[sy(0x1ec)],s,g);else{if(x[sy(0x201)]===_3xpr_1[sy(0x254)][sy(0x1fe)]){const m=this[sy(0x258)](g,x);y[sy(0x21a)][0x2]=new _3xpr_1[(sy(0x1f7))](y[sy(0x1ec)],_3xpr_1['OperandType'][sy(0x22d)],_3xpr_1['OperandType'][sy(0x22d)],[m]);}else{if(x[sy(0x201)]===_3xpr_1['OperandType'][sy(0x248)]){const w=new _3xpr_1[(sy(0x1f7))](y[sy(0x1ec)],_3xpr_1[sy(0x254)][sy(0x22d)],_3xpr_1[sy(0x254)][sy(0x22d)],[]);for(const t of x['children']){const v=this[sy(0x258)](g,t);w[sy(0x21a)]['push'](v);}y[sy(0x21a)][0x2]=w;}}}}else{const a=new _3xpr_1['Operand'](y['pos'],'p',_3xpr_1['OperandType']['Var'],[]),c=this['createReadFields'](y['pos'],s,'p');y[sy(0x21a)][sy(0x233)](a),y[sy(0x21a)][sy(0x233)](c);}}['fieldToKeyVal'](s,y){const sO=a82Q;let g;return y[sO(0x232)][sO(0x265)](s+'.')?(g=y[sO(0x232)]['replace'](s+'.',''),g[sO(0x259)]('.')&&(g=this[sO(0x200)]['str'][sO(0x22a)](g,'.','_'))):g=y[sO(0x232)],new _3xpr_1[(sO(0x1f7))](y[sO(0x1ec)],g,_3xpr_1[sO(0x254)]['KeyVal'],[y]);}[a82Q(0x263)](s,y){const sD=a82Q;if(y['children'][sD(0x20d)]===0x1){const g=this['createWriteVars'](y[sD(0x1ec)],s,undefined,![],!![]);y['children'][sD(0x233)](g);}else{if(y[sD(0x21a)][sD(0x20d)]===0x2&&y[sD(0x21a)][0x1][sD(0x201)]===_3xpr_1['OperandType'][sD(0x1fe)])y[sD(0x21a)][0x1]=this[sD(0x21d)](y['pos'],s,y[sD(0x21a)][0x1][sD(0x232)],![],!![]);else{if(y['children'][sD(0x20d)]===0x2&&y['children'][0x1][sD(0x201)]===_3xpr_1[sD(0x254)][sD(0x248)])y[sD(0x21a)][0x1]=this['writeVarsFromList'](s,y[sD(0x21a)][0x1]);else{if(y['children'][sD(0x20d)]===0x3&&y[sD(0x21a)][0x2][sD(0x201)]===_3xpr_1[sD(0x254)][sD(0x22d)]){const x=y[sD(0x21a)][0x1][sD(0x232)];for(const m of y['children'][0x2][sD(0x21a)]){m[sD(0x232)]=m[sD(0x232)]['replace'](x+'.','');}y[sD(0x21a)][0x1]=y[sD(0x21a)][0x2],y[sD(0x21a)][sD(0x243)]();}else{if(y[sD(0x21a)][sD(0x20d)]===0x3&&y[sD(0x21a)][0x2][sD(0x201)]===_3xpr_1['OperandType'][sD(0x248)]){const w=y[sD(0x21a)][0x1][sD(0x232)];for(const t of y[sD(0x21a)][0x2][sD(0x21a)]){t[sD(0x232)]=t[sD(0x232)][sD(0x22a)](w+'.','');}y[sD(0x21a)][0x1]=this['writeVarsFromList'](s,y[sD(0x21a)][0x2]),y[sD(0x21a)][sD(0x243)]();}}}}}}[a82Q(0x224)](s,y){const sg=a82Q;if(y[sg(0x21a)][sg(0x20d)]===0x1){const g=new _3xpr_1[(sg(0x1f7))](y['pos'],'p',_3xpr_1[sg(0x254)][sg(0x1fe)],[],typ3s_1['Type'][sg(0x221)]),x=this[sg(0x21d)](y['pos'],s,undefined,![],!![]);y[sg(0x21a)]['push'](g),y[sg(0x21a)][sg(0x233)](x);}else{if(y['children'][sg(0x20d)]===0x2&&y[sg(0x21a)][0x1]['type']===_3xpr_1[sg(0x254)][sg(0x1fe)]){const m=new _3xpr_1[(sg(0x1f7))](y[sg(0x1ec)],'p',_3xpr_1['OperandType'][sg(0x1fe)],[],typ3s_1['Type']['any']),w=this[sg(0x21d)](y['pos'],s,y['children'][0x1][sg(0x232)],!![]);y[sg(0x21a)][0x1]=m,y[sg(0x21a)]['push'](w);}else{if(y[sg(0x21a)][sg(0x20d)]===0x2&&y[sg(0x21a)][0x1][sg(0x201)]===_3xpr_1[sg(0x254)][sg(0x248)]){const t=new _3xpr_1[(sg(0x1f7))](y['pos'],'p',_3xpr_1[sg(0x254)][sg(0x1fe)],[],typ3s_1[sg(0x210)][sg(0x221)]),v=this[sg(0x1f4)](s,y['children'][0x1]);y[sg(0x21a)][0x1]=t,y['children'][sg(0x233)](v);}else{if(y['children'][sg(0x20d)]===0x2&&y[sg(0x21a)][0x1]['type']===_3xpr_1['OperandType']['Obj']){const a=new _3xpr_1['Operand'](y[sg(0x1ec)],'p',_3xpr_1['OperandType'][sg(0x1fe)],[],typ3s_1[sg(0x210)]['any']),c=y[sg(0x21a)][0x1];y[sg(0x21a)][0x1]=a,y[sg(0x21a)][sg(0x233)](c);}else{if(y['children'][sg(0x20d)]===0x3&&y['children'][0x2][sg(0x201)]===_3xpr_1[sg(0x254)][sg(0x1fe)])y[sg(0x21a)][0x2][sg(0x232)]===y[sg(0x21a)][0x1][sg(0x232)]?y[sg(0x21a)][0x2]=this['createWriteVars'](y[sg(0x1ec)],s,undefined,!![]):y['children'][0x2]=this[sg(0x21d)](y[sg(0x1ec)],s,y[sg(0x21a)][0x2]['name'],!![]);else y[sg(0x21a)][sg(0x20d)]===0x3&&y['children'][0x2][sg(0x201)]===_3xpr_1[sg(0x254)][sg(0x248)]&&(y[sg(0x21a)][0x2]=this[sg(0x1f4)](s,y[sg(0x21a)][0x2]));}}}}}[a82Q(0x20e)](s){const sM=a82Q;if(s[sM(0x21a)][sM(0x20d)]===0x2)s['children']['pop']();else s['children']['length']===0x3&&(s[sM(0x21a)][sM(0x243)](),s['children'][sM(0x243)]());}[a82Q(0x1ed)](s,y,g){const sE=a82Q,x=new _3xpr_1[(sE(0x1f7))](s,_3xpr_1['OperandType']['Obj'],_3xpr_1[sE(0x254)][sE(0x22d)],[]);for(const m of y[sE(0x205)]||[]){const w=g?g+'.'+m['name']:m[sE(0x232)],t=new lambdaorm_base_1[(sE(0x21f))](s,y['name'],w,typ3s_1[sE(0x210)]['to'](m[sE(0x201)]||sE(0x215)),g,!![]),v=typ3s_1[sE(0x210)]['to'](m[sE(0x201)]||sE(0x215)),a=new _3xpr_1['Operand'](s,m['name'],_3xpr_1[sE(0x254)][sE(0x23a)],[t],v);x['children'][sE(0x233)](a);}return x;}[a82Q(0x21d)](s,y,g,x=![],m=![]){const sx=a82Q,w=new _3xpr_1['Operand'](s,_3xpr_1[sx(0x254)][sx(0x22d)],_3xpr_1[sx(0x254)][sx(0x22d)],[]);for(const t of y['properties']||[]){if((!t[sx(0x204)]||!m)&&(y['primaryKey']!==undefined&&!y[sx(0x25d)][sx(0x259)](t[sx(0x232)])||!x)){const v=g?g+'.'+t['name']:t[sx(0x232)],a=new _3xpr_1[(sx(0x1f7))](s,v,_3xpr_1['OperandType']['Var'],[],typ3s_1[sx(0x210)]['to'](t[sx(0x201)]||sx(0x215))),c=new _3xpr_1[(sx(0x1f7))](s,t[sx(0x232)],_3xpr_1[sx(0x254)]['KeyVal'],[a],typ3s_1['Type']['to'](t[sx(0x201)]||sx(0x215)));w[sx(0x21a)][sx(0x233)](c);}}return w;}[a82Q(0x1f4)](s,y){const sm=a82Q;var g;const x=new _3xpr_1[(sm(0x1f7))](y[sm(0x1ec)],_3xpr_1[sm(0x254)][sm(0x22d)],_3xpr_1['OperandType'][sm(0x22d)],[]);for(const m of y[sm(0x21a)]){const w=(g=s[sm(0x205)])===null||g===void 0x0?void 0x0:g['find'](a=>a[sm(0x232)]===m[sm(0x232)]);if(w===undefined)throw new Error(s[sm(0x232)]+'.'+m[sm(0x232)]+sm(0x24f));const t=new _3xpr_1[(sm(0x1f7))](y[sm(0x1ec)],w[sm(0x232)],_3xpr_1[sm(0x254)][sm(0x1fe)],[],typ3s_1[sm(0x210)]['to'](w[sm(0x201)]||sm(0x215))),v=new _3xpr_1['Operand'](y[sm(0x1ec)],w['name'],_3xpr_1[sm(0x254)][sm(0x23a)],[t],typ3s_1[sm(0x210)]['to'](w['type']||'string'));x[sm(0x21a)]['push'](v);}return x;}[a82Q(0x250)](s,y){const sH=a82Q;if(y['children'][sH(0x20d)]===0x1||y[sH(0x21a)][sH(0x20d)]===0x3&&y[sH(0x21a)][0x2][sH(0x201)]===_3xpr_1['OperandType'][sH(0x22d)]){const g=this[sH(0x208)](y[sH(0x1ec)],s,'p'),x=new _3xpr_1[(sH(0x1f7))](y[sH(0x1ec)],'p',_3xpr_1[sH(0x254)]['Var'],[]);y['children'][0x0]=new _3xpr_1[(sH(0x1f7))](y[sH(0x1ec)],sH(0x255),_3xpr_1['OperandType'][sH(0x240)],[y[sH(0x21a)][0x0],x,g]);}else{if(y['children'][sH(0x20d)]===0x2&&(y['children'][0x1][sH(0x201)]===_3xpr_1[sH(0x254)][sH(0x1fe)]||y['children'][0x1][sH(0x201)]===_3xpr_1[sH(0x254)][sH(0x22d)])){const m=y[sH(0x21a)][0x1][sH(0x201)]===_3xpr_1[sH(0x254)][sH(0x1fe)]?y[sH(0x21a)][0x1][sH(0x232)]:undefined,w=this[sH(0x208)](y[sH(0x1ec)],s,'p',m),t=new _3xpr_1[(sH(0x1f7))](y['pos'],'p',_3xpr_1['OperandType'][sH(0x1fe)],[]);y[sH(0x21a)][0x0]=new _3xpr_1[(sH(0x1f7))](y[sH(0x1ec)],sH(0x255),_3xpr_1[sH(0x254)][sH(0x240)],[y[sH(0x21a)][0x0],t,w]);}else{if(y['children'][sH(0x20d)]===0x3&&y['children'][0x2][sH(0x201)]===_3xpr_1[sH(0x254)][sH(0x1fe)]){const v=y[sH(0x21a)][0x1][sH(0x232)]!==y[sH(0x21a)][0x2][sH(0x232)]?y[sH(0x21a)][0x2]['name']:undefined,a=this[sH(0x208)](y['pos'],s,'p',v),c=new _3xpr_1[(sH(0x1f7))](y[sH(0x1ec)],'p',_3xpr_1[sH(0x254)][sH(0x1fe)],[]);y[sH(0x21a)][0x0]=new _3xpr_1[(sH(0x1f7))](y[sH(0x1ec)],'filter',_3xpr_1[sH(0x254)][sH(0x240)],[y['children'][0x0],c,a]);}}}}[a82Q(0x208)](s,y,g,x){const sw=a82Q;var m;if(y[sw(0x25d)]===undefined||y[sw(0x25d)][sw(0x20d)]===0x0)throw new lambdaorm_base_1[(sw(0x23f))](sw(0x241)+y[sw(0x232)]+sw(0x228));let w;for(const t of y[sw(0x25d)]){const v=(m=y[sw(0x205)])===null||m===void 0x0?void 0x0:m[sw(0x1fa)](r=>r['name']===t);if(v===undefined)throw new lambdaorm_base_1[(sw(0x23f))](sw(0x241)+y[sw(0x232)]+sw(0x1fb)+t+sw(0x266));const a=new _3xpr_1[(sw(0x1f7))](s,g?g+'.'+v[sw(0x232)]:v[sw(0x232)],_3xpr_1[sw(0x254)][sw(0x1fe)],[],typ3s_1[sw(0x210)]['to'](v[sw(0x201)]||sw(0x215))),c=new _3xpr_1['Operand'](s,x?x+'.'+t:t,_3xpr_1['OperandType']['Var'],[],typ3s_1[sw(0x210)]['to'](v[sw(0x201)]||sw(0x215))),k=new _3xpr_1[(sw(0x1f7))](s,'==',_3xpr_1[sw(0x254)][sw(0x246)],[a,c],typ3s_1[sw(0x210)][sw(0x209)]);w=w?new _3xpr_1[(sw(0x1f7))](s,'&&',_3xpr_1['OperandType'][sw(0x246)],[w,k],typ3s_1[sw(0x210)]['boolean']):k;}return w;}[a82Q(0x214)](s,y,g){const sI=a82Q;return this[sI(0x1f3)](s,y,g,sI(0x249));}['completeSelectInclude'](s,y,g,x){const sF=a82Q;let m,w;if(g['type']===_3xpr_1['OperandType'][sF(0x240)]){let o=g;while(o){if(o[sF(0x201)]===_3xpr_1[sF(0x254)][sF(0x1fe)]){const p=o['name']['split']('.'),f=p[0x1];w=s['relations']?s[sF(0x1f1)][sF(0x1fa)](q=>q[sF(0x232)]===f):undefined;break;}if(o[sF(0x21a)][sF(0x20d)]>0x0)o=o[sF(0x21a)][0x0];else break;}m=g;if(w===undefined)throw Error('Relation\x20not\x20found');this[sF(0x264)](m,w[sF(0x267)]);}else{if(g[sF(0x201)]===_3xpr_1[sF(0x254)][sF(0x1fe)]){const q=new _3xpr_1[(sF(0x1f7))](g[sF(0x1ec)],'p',_3xpr_1[sF(0x254)]['Var'],[]),j=new _3xpr_1[(sF(0x1f7))](g[sF(0x1ec)],'p',_3xpr_1[sF(0x254)][sF(0x1fe)],[]),b=g['name'][sF(0x217)]('.'),l=b[0x1];w=s[sF(0x1f1)]?s[sF(0x1f1)]['find'](u=>u[sF(0x232)]===l):undefined;if(w===undefined)throw Error(sF(0x20c));m=new _3xpr_1[(sF(0x1f7))](g[sF(0x1ec)],x,_3xpr_1['OperandType'][sF(0x240)],[g,q,j]),this[sF(0x264)](m,w[sF(0x267)]);}else throw new lambdaorm_base_1[(sF(0x203))](sF(0x1ee)+g[sF(0x201)]+':'+g['name']);}const t=this[sF(0x212)](m),v=t[sF(0x255)],a=v?v[sF(0x21a)][0x1][sF(0x232)]:'p',c=this[sF(0x23b)]['getProperty'](w['entity'],w['to']),k=new lambdaorm_base_1[(sF(0x21f))](g[sF(0x1ec)],w[sF(0x267)],a+'.'+w['to'],typ3s_1[sF(0x210)]['to'](c[sF(0x201)]||sF(0x215))),r=new _3xpr_1['Operand'](g[sF(0x1ec)],sF(0x21b),_3xpr_1[sF(0x254)][sF(0x1fe)],[],typ3s_1[sF(0x210)][sF(0x248)](typ3s_1[sF(0x210)]['to'](c[sF(0x201)]||sF(0x215)))),z=new _3xpr_1[(sF(0x1f7))](g[sF(0x1ec)],'in',_3xpr_1[sF(0x254)][sF(0x213)],[k,r]);if(!v){const u=new _3xpr_1[(sF(0x1f7))](g[sF(0x1ec)],a,_3xpr_1[sF(0x254)][sF(0x1fe)],[]);m[sF(0x21a)][0x0]=new _3xpr_1[(sF(0x1f7))](g[sF(0x1ec)],sF(0x255),_3xpr_1['OperandType']['Arrow'],[m[sF(0x21a)][0x0],u,z]);}else v[sF(0x21a)][0x0]=new _3xpr_1[(sF(0x1f7))](g[sF(0x1ec)],'&&',_3xpr_1[sF(0x254)][sF(0x246)],[v['children'][0x0],z]);const d=t[sF(0x249)][sF(0x21a)][0x1]['name'],i=new lambdaorm_base_1['Field'](g[sF(0x1ec)],w[sF(0x24e)],d+'.'+w['to'],typ3s_1[sF(0x210)]['to'](c['type']||sF(0x215)));return t[sF(0x249)]['children'][0x2][sF(0x21a)][sF(0x233)](new _3xpr_1[(sF(0x1f7))](g[sF(0x1ec)],sF(0x21b),_3xpr_1[sF(0x254)]['KeyVal'],[i])),m;}['completeBulkInsertInclude'](s,y,g){return this['completeInclude'](s,y,g,'bulkInsert');}[a82Q(0x24b)](s,y,g){const st=a82Q;return this[st(0x206)](s,y,g,st(0x23d));}['completeUpdateInclude'](s,y,g){const sv=a82Q;return this[sv(0x206)](s,y,g,'update');}[a82Q(0x22b)](s,y,g){const sR=a82Q;return this[sR(0x206)](s,y,g,sR(0x1fd));}[a82Q(0x219)](s,y){const sY=a82Q;if(y[sY(0x201)]===_3xpr_1['OperandType'][sY(0x213)]||y[sY(0x201)]===_3xpr_1[sY(0x254)][sY(0x220)]||y[sY(0x201)]===_3xpr_1['OperandType'][sY(0x240)]){let g=y;while(g){if(g[sY(0x201)]===_3xpr_1['OperandType'][sY(0x1fe)]){const x=g[sY(0x232)]['split']('.'),m=x[0x1];return s[sY(0x1f1)]?s[sY(0x1f1)][sY(0x1fa)](w=>w[sY(0x232)]===m):undefined;}if(g['children'][sY(0x20d)]>0x0)g=g[sY(0x21a)][0x0];else break;}}else{if(y[sY(0x201)]===_3xpr_1['OperandType']['Var']){const w=y[sY(0x232)][sY(0x217)]('.'),t=w[0x1];return s['relations']?s[sY(0x1f1)][sY(0x1fa)](v=>v[sY(0x232)]===t):undefined;}else throw new lambdaorm_base_1['SchemaError'](sY(0x25a)+y[sY(0x201)]+':'+y[sY(0x232)]);}}[a82Q(0x206)](s,y,g,x){const sa=a82Q;if(g[sa(0x201)]===_3xpr_1[sa(0x254)][sa(0x240)]){const m=this['getIncludeRelation'](s,g),w=this['getClauses'](g),t=w[x]?w[x]:new _3xpr_1[(sa(0x1f7))](g[sa(0x1ec)],x,_3xpr_1['OperandType'][sa(0x213)],[g]);return this['normalizeSentence'](t,m[sa(0x267)]),t;}else{if(g['type']===_3xpr_1['OperandType']['Var']){const v=this[sa(0x219)](s,g);if(!v)throw new lambdaorm_base_1['SchemaError'](sa(0x22c)+g[sa(0x232)]+sa(0x223)+s[sa(0x232)]);const a=new _3xpr_1[(sa(0x1f7))](g['pos'],x,_3xpr_1[sa(0x254)]['CallFunc'],[g]);return this['normalizeSentence'](a,v[sa(0x267)]),a;}else{if(g[sa(0x201)]===_3xpr_1['OperandType'][sa(0x213)]||g[sa(0x201)]===_3xpr_1['OperandType'][sa(0x220)]){const c=this[sa(0x219)](s,g);if(!c)throw new lambdaorm_base_1[(sa(0x23f))](sa(0x22c)+g['name']+'\x20not\x20found\x20in\x20'+s[sa(0x232)]);return this[sa(0x264)](g,c[sa(0x267)]),g;}else throw new lambdaorm_base_1[(sa(0x23f))](sa(0x1ee)+g[sa(0x201)]+':'+g[sa(0x232)]);}}}}exports['OrmOperandNormalizer']=OrmOperandNormalizer;