@servicenow/sdk 3.0.2 → 3.0.3

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/lsp/index.js CHANGED
@@ -31101,7 +31101,7 @@ Input: `+this.err.str)},h.prototype[Symbol.iterator]=function(){return this._ind
31101
31101
  `+at.slice(Kt,Pt),Kt=Pt+1),ot=pn;return St+=`
31102
31102
  `,at.length-Kt>wt&&ot>Kt?St+=at.slice(Kt,ot)+`
31103
31103
  `+at.slice(ot+1):St+=at.slice(Kt),St.slice(1)}e(Ie,"E");function We(at,wt,In){var Pt,Tt,Kt,ot,pn,St;for(Kt=0,ot=(Tt=In?at.explicitTypes:at.implicitTypes).length;Kt<ot;Kt+=1)if(((pn=Tt[Kt]).instanceOf||pn.predicate)&&(!pn.instanceOf||typeof wt=="object"&&wt instanceof pn.instanceOf)&&(!pn.predicate||pn.predicate(wt))){if(at.tag=In?pn.tag:"?",pn.represent){if(St=at.styleMap[pn.tag]||pn.defaultStyle,y.call(pn.represent)==="[object Function]")Pt=pn.represent(wt,St);else{if(!b.call(pn.represent,St))throw new u("!<"+pn.tag+'> tag resolver accepts not "'+St+'" style');Pt=pn.represent[St](wt,St)}at.dump=Pt}return!0}return!1}e(We,"D");function qe(at,wt,In,Pt,Tt,Kt){at.tag=null,at.dump=In,We(at,In,!1)||We(at,In,!0);var ot=y.call(at.dump);Pt&&(Pt=at.flowLevel<0||at.flowLevel>wt);var pn,St,ar=ot==="[object Object]"||ot==="[object Array]";if(ar&&(St=(pn=at.duplicates.indexOf(In))!==-1),(at.tag!==null&&at.tag!=="?"||St||at.indent!==2&&wt>0)&&(Tt=!1),St&&at.usedDuplicates[pn])at.dump="*ref_"+pn;else{if(ar&&St&&!at.usedDuplicates[pn]&&(at.usedDuplicates[pn]=!0),ot==="[object Object]")Pt&&Object.keys(at.dump).length!==0?(function(hn,Gn,yr,Sr){var zr,Nt,ve,jt,ut,Dt,bn="",dn=hn.tag,Xr=Object.keys(yr);if(hn.sortKeys===!0)Xr.sort();else if(typeof hn.sortKeys=="function")Xr.sort(hn.sortKeys);else if(hn.sortKeys)throw new u("sortKeys must be a boolean or a function");for(zr=0,Nt=Xr.length;zr<Nt;zr+=1)Dt="",Sr&&zr===0||(Dt+=G(hn,Gn)),jt=yr[ve=Xr[zr]],qe(hn,Gn+1,ve,!0,!0,!0)&&((ut=hn.tag!==null&&hn.tag!=="?"||hn.dump&&hn.dump.length>1024)&&(hn.dump&&hn.dump.charCodeAt(0)===10?Dt+="?":Dt+="? "),Dt+=hn.dump,ut&&(Dt+=G(hn,Gn)),qe(hn,Gn+1,jt,!0,ut)&&(hn.dump&&hn.dump.charCodeAt(0)===10?Dt+=":":Dt+=": ",bn+=Dt+=hn.dump));hn.tag=dn,hn.dump=bn||"{}"}(at,wt,at.dump,Tt),St&&(at.dump="&ref_"+pn+at.dump)):(function(hn,Gn,yr){var Sr,zr,Nt,ve,jt,ut="",Dt=hn.tag,bn=Object.keys(yr);for(Sr=0,zr=bn.length;Sr<zr;Sr+=1)jt="",Sr!==0&&(jt+=", "),hn.condenseFlow&&(jt+='"'),ve=yr[Nt=bn[Sr]],qe(hn,Gn,Nt,!1,!1)&&(hn.dump.length>1024&&(jt+="? "),jt+=hn.dump+(hn.condenseFlow?'"':"")+":"+(hn.condenseFlow?"":" "),qe(hn,Gn,ve,!1,!1)&&(ut+=jt+=hn.dump));hn.tag=Dt,hn.dump="{"+ut+"}"}(at,wt,at.dump),St&&(at.dump="&ref_"+pn+" "+at.dump));else if(ot==="[object Array]"){var mr=at.noArrayIndent&&wt>0?wt-1:wt;Pt&&at.dump.length!==0?(function(hn,Gn,yr,Sr){var zr,Nt,ve="",jt=hn.tag;for(zr=0,Nt=yr.length;zr<Nt;zr+=1)qe(hn,Gn+1,yr[zr],!0,!0)&&(Sr&&zr===0||(ve+=G(hn,Gn)),hn.dump&&hn.dump.charCodeAt(0)===10?ve+="-":ve+="- ",ve+=hn.dump);hn.tag=jt,hn.dump=ve||"[]"}(at,mr,at.dump,Tt),St&&(at.dump="&ref_"+pn+at.dump)):(function(hn,Gn,yr){var Sr,zr,Nt="",ve=hn.tag;for(Sr=0,zr=yr.length;Sr<zr;Sr+=1)qe(hn,Gn,yr[Sr],!1,!1)&&(Sr!==0&&(Nt+=","+(hn.condenseFlow?"":" ")),Nt+=hn.dump);hn.tag=ve,hn.dump="["+Nt+"]"}(at,mr,at.dump),St&&(at.dump="&ref_"+pn+" "+at.dump))}else{if(ot!=="[object String]"){if(at.skipInvalid)return!1;throw new u("unacceptable kind of an object to dump "+ot)}at.tag!=="?"&&ne(at,at.dump,wt,Kt)}at.tag!==null&&at.tag!=="?"&&(at.dump="!<"+at.tag+"> "+at.dump)}return!0}e(qe,"S");function Ke(at,wt){var In,Pt,Tt=[],Kt=[];for(e(function ot(pn,St,ar){var mr,hn,Gn;if(pn!==null&&typeof pn=="object")if((hn=St.indexOf(pn))!==-1)ar.indexOf(hn)===-1&&ar.push(hn);else if(St.push(pn),Array.isArray(pn))for(hn=0,Gn=pn.length;hn<Gn;hn+=1)ot(pn[hn],St,ar);else for(mr=Object.keys(pn),hn=0,Gn=mr.length;hn<Gn;hn+=1)ot(pn[mr[hn]],St,ar)},"e")(at,Tt,Kt),In=0,Pt=Kt.length;In<Pt;In+=1)wt.duplicates.push(Tt[Kt[In]]);wt.usedDuplicates=new Array(Pt)}e(Ke,"C");function Je(at,wt){var In=new w(wt=wt||{});return In.noRefs||Ke(at,In),qe(In,0,at,!0,!0)?In.dump+`
31104
- `:""}e(Je,"A"),r.exports.dump=Je,r.exports.safeDump=function(at,wt){return Je(at,o.extend({schema:h},wt))}},function(r,n,a){"use strict";a(31),a(32),a(33),a(64),a(19),a(65),a(20),a(68),a(92),a(144),a(22),a(94),a(23);var o,u=this&&this.__extends||(o=e(function(Q,ne){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(de,be){de.__proto__=be}||function(de,be){for(var Ie in be)be.hasOwnProperty(Ie)&&(de[Ie]=be[Ie])})(Q,ne)},"n"),function(Q,ne){function de(){this.constructor=Q}e(de,"r"),o(Q,ne),Q.prototype=ne===null?Object.create(ne):(de.prototype=ne.prototype,new de)}),f=this&&this.__values||function(Q){var ne=typeof Symbol=="function"&&Symbol.iterator,de=ne&&Q[ne],be=0;if(de)return de.call(Q);if(Q&&typeof Q.length=="number")return{next:e(function(){return Q&&be>=Q.length&&(Q=void 0),{value:Q&&Q[be++],done:!Q}},"next")};throw new TypeError(ne?"Object is not iterable.":"Symbol.iterator is not defined.")},h=this&&this.__read||function(Q,ne){var de=typeof Symbol=="function"&&Q[Symbol.iterator];if(!de)return Q;var be,Ie,We=de.call(Q),qe=[];try{for(;(ne===void 0||ne-- >0)&&!(be=We.next()).done;)qe.push(be.value)}catch(Ke){Ie={error:Ke}}finally{try{be&&!be.done&&(de=We.return)&&de.call(We)}finally{if(Ie)throw Ie.error}}return qe};Object.defineProperty(n,"__esModule",{value:!0});var y=a(91),b=a(2),x=a(183),A=a(0),I=a(7),w=a(95),W=a(69),G=a(3),O=a(306),k=a(307),B=a(308),Y=function(Q){function ne(de,be){be===void 0&&(be=!1);var Ie=Q.call(this)||this;return Ie._hasDeclaration=!1,Ie._docTypeName="",Ie._hasDocumentElement=!1,Ie._currentElementSerialized=!1,Ie._openTags=[],Ie._ended=!1,Ie._fragment=be,Ie._options=b.applyDefaults(de||{},y.DefaultXMLBuilderCBOptions),Ie._builderOptions={defaultNamespace:Ie._options.defaultNamespace,namespaceAlias:Ie._options.namespaceAlias},Ie._options.format==="json"?Ie._writer=new k.JSONCBWriter(Ie._options):Ie._options.format==="yaml"?Ie._writer=new B.YAMLCBWriter(Ie._options):Ie._writer=new O.XMLCBWriter(Ie._options),Ie._options.data!==void 0&&Ie.on("data",Ie._options.data),Ie._options.end!==void 0&&Ie.on("end",Ie._options.end),Ie._options.error!==void 0&&Ie.on("error",Ie._options.error),Ie._prefixMap=new w.NamespacePrefixMap,Ie._prefixMap.set("xml",I.namespace.XML),Ie._prefixIndex={value:1},Ie._push(Ie._writer.frontMatter()),Ie}return e(ne,"t"),u(ne,Q),ne.prototype.ele=function(de,be,Ie){var We,qe;if(b.isObject(de)||b.isString(de)&&(/^\s*</.test(de)||/^\s*[\{\[]/.test(de)||/^(\s*|(#.*)|(%.*))*---/.test(de))){var Ke=x.fragment().set(this._options);try{Ke.ele(de)}catch(In){return this.emit("error",In),this}try{for(var Je=f(Ke.node.childNodes),at=Je.next();!at.done;at=Je.next()){var wt=at.value;this._fromNode(wt)}}catch(In){We={error:In}}finally{try{at&&!at.done&&(qe=Je.return)&&qe.call(Je)}finally{if(We)throw We.error}}return this}if(this._serializeOpenTag(!0),!this._fragment&&this._hasDocumentElement&&this._writer.level===0)return this.emit("error",new Error("Document cannot have multiple document element nodes.")),this;try{this._currentElement=x.fragment(this._builderOptions).ele(de,be,Ie)}catch(In){return this.emit("error",In),this}return this._fragment||this._hasDocumentElement||this._docTypeName===""||this._currentElement.node._qualifiedName===this._docTypeName?(this._currentElementSerialized=!1,this._fragment||(this._hasDocumentElement=!0),this):(this.emit("error",new Error("Document element name does not match DocType declaration name.")),this)},ne.prototype.att=function(de,be,Ie){if(this._currentElement===void 0)return this.emit("error",new Error("Cannot insert an attribute node as child of a document node.")),this;try{this._currentElement.att(de,be,Ie)}catch(We){return this.emit("error",We),this}return this},ne.prototype.com=function(de){var be;this._serializeOpenTag(!0);try{be=x.fragment(this._builderOptions).com(de).first().node}catch(Ie){return this.emit("error",Ie),this}return!this._options.wellFormed||A.xml_isLegalChar(be.data)&&be.data.indexOf("--")===-1&&!be.data.endsWith("-")?(this._push(this._writer.comment(be.data)),this):(this.emit("error",new Error("Comment data contains invalid characters (well-formed required).")),this)},ne.prototype.txt=function(de){if(!this._fragment&&this._currentElement===void 0)return this.emit("error",new Error("Cannot insert a text node as child of a document node.")),this;var be;this._serializeOpenTag(!0);try{be=x.fragment(this._builderOptions).txt(de).first().node}catch(We){return this.emit("error",We),this}if(this._options.wellFormed&&!A.xml_isLegalChar(be.data))return this.emit("error",new Error("Text data contains invalid characters (well-formed required).")),this;var Ie=be.data.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return this._push(this._writer.text(Ie)),this},ne.prototype.ins=function(de,be){var Ie;be===void 0&&(be=""),this._serializeOpenTag(!0);try{Ie=x.fragment(this._builderOptions).ins(de,be).first().node}catch(We){return this.emit("error",We),this}return this._options.wellFormed&&(Ie.target.indexOf(":")!==-1||/^xml$/i.test(Ie.target))?(this.emit("error",new Error("Processing instruction target contains invalid characters (well-formed required).")),this):this._options.wellFormed&&!A.xml_isLegalChar(Ie.data)?(this.emit("error",Error("Processing instruction data contains invalid characters (well-formed required).")),this):(this._push(this._writer.instruction(Ie.target,Ie.data)),this)},ne.prototype.dat=function(de){var be;this._serializeOpenTag(!0);try{be=x.fragment(this._builderOptions).dat(de).first().node}catch(Ie){return this.emit("error",Ie),this}return this._push(this._writer.cdata(be.data)),this},ne.prototype.dec=function(de){return de===void 0&&(de={version:"1.0"}),this._fragment?(this.emit("error",Error("Cannot insert an XML declaration into a document fragment.")),this):this._hasDeclaration?(this.emit("error",Error("XML declaration is already inserted.")),this):(this._push(this._writer.declaration(de.version||"1.0",de.encoding,de.standalone)),this._hasDeclaration=!0,this)},ne.prototype.dtd=function(de){if(this._fragment)return this.emit("error",Error("Cannot insert a DocType declaration into a document fragment.")),this;if(this._docTypeName!=="")return this.emit("error",new Error("DocType declaration is already inserted.")),this;if(this._hasDocumentElement)return this.emit("error",new Error("Cannot insert DocType declaration after document element.")),this;var be;try{be=x.create().dtd(de).first().node}catch(Ie){return this.emit("error",Ie),this}return this._options.wellFormed&&!A.xml_isPubidChar(be.publicId)?(this.emit("error",new Error("DocType public identifier does not match PubidChar construct (well-formed required).")),this):this._options.wellFormed&&(!A.xml_isLegalChar(be.systemId)||be.systemId.indexOf('"')!==-1&&be.systemId.indexOf("'")!==-1)?(this.emit("error",new Error("DocType system identifier contains invalid characters (well-formed required).")),this):(this._docTypeName=de.name,this._push(this._writer.docType(de.name,be.publicId,be.systemId)),this)},ne.prototype.import=function(de){var be,Ie,We=x.fragment().set(this._options);try{We.import(de)}catch(at){return this.emit("error",at),this}try{for(var qe=f(We.node.childNodes),Ke=qe.next();!Ke.done;Ke=qe.next()){var Je=Ke.value;this._fromNode(Je)}}catch(at){be={error:at}}finally{try{Ke&&!Ke.done&&(Ie=qe.return)&&Ie.call(qe)}finally{if(be)throw be.error}}return this},ne.prototype.up=function(){return this._serializeOpenTag(!1),this._serializeCloseTag(),this},ne.prototype.end=function(){for(this._serializeOpenTag(!1);this._openTags.length>0;)this._serializeCloseTag();return this._push(null),this},ne.prototype._serializeOpenTag=function(de){if(!this._currentElementSerialized&&this._currentElement!==void 0){var be=this._currentElement.node;if(!this._options.wellFormed||be.localName.indexOf(":")===-1&&A.xml_isName(be.localName)){var Ie="",We=!1,qe=this._prefixMap.copy(),Ke={},Je=this._recordNamespaceInformation(be,qe,Ke),at=this._openTags.length===0?null:this._openTags[this._openTags.length-1][1],wt=be.namespaceURI;if(wt===null&&(wt=at),at===wt)Je!==null&&(We=!0),Ie=wt===I.namespace.XML?"xml:"+be.localName:be.localName,this._writer.beginElement(Ie),this._push(this._writer.openTagBegin(Ie));else{var In=be.prefix,Pt=null;if(In===null&&wt===Je||(Pt=qe.get(In,wt)),In==="xmlns"){if(this._options.wellFormed)return void this.emit("error",new Error("An element cannot have the 'xmlns' prefix (well-formed required)."));Pt=In}Pt!==null?(Ie=Pt+":"+be.localName,Je!==null&&Je!==I.namespace.XML&&(at=Je||null),this._writer.beginElement(Ie),this._push(this._writer.openTagBegin(Ie))):In!==null?(In in Ke&&(In=this._generatePrefix(wt,qe,this._prefixIndex)),qe.set(In,wt),Ie+=In+":"+be.localName,this._writer.beginElement(Ie),this._push(this._writer.openTagBegin(Ie)),this._push(this._writer.attribute("xmlns:"+In,this._serializeAttributeValue(wt,this._options.wellFormed))),Je!==null&&(at=Je||null)):Je===null||Je!==null&&Je!==wt?(We=!0,Ie+=be.localName,at=wt,this._writer.beginElement(Ie),this._push(this._writer.openTagBegin(Ie)),this._push(this._writer.attribute("xmlns",this._serializeAttributeValue(wt,this._options.wellFormed)))):(Ie+=be.localName,at=wt,this._writer.beginElement(Ie),this._push(this._writer.openTagBegin(Ie)))}this._serializeAttributes(be,qe,this._prefixIndex,Ke,We,this._options.wellFormed);var Tt=wt===I.namespace.HTML;Tt&&!de&&ne._VoidElementNames.has(be.localName)?(this._push(this._writer.openTagEnd(Ie,!0,!0)),this._writer.endElement(Ie)):Tt||de?this._push(this._writer.openTagEnd(Ie,!1,!1)):(this._push(this._writer.openTagEnd(Ie,!0,!1)),this._writer.endElement(Ie)),this._currentElementSerialized=!0,this._openTags.push([Ie,at,this._prefixMap,de]),this._isPrefixMapModified(this._prefixMap,qe)&&(this._prefixMap=qe),this._writer.level++}else this.emit("error",new Error("Node local name contains invalid characters (well-formed required)."))}},ne.prototype._serializeCloseTag=function(){this._writer.level--;var de=this._openTags.pop();if(de!==void 0){var be=h(de,4),Ie=be[0],We=(be[1],be[2]),qe=be[3];this._prefixMap=We,qe&&(this._push(this._writer.closeTag(Ie)),this._writer.endElement(Ie))}else this.emit("error",new Error("Last element is undefined."))},ne.prototype._push=function(de){de===null?(this._ended=!0,this.emit("end")):this._ended?this.emit("error",new Error("Cannot push to ended stream.")):de.length!==0&&(this._writer.hasData=!0,this.emit("data",de,this._writer.level))},ne.prototype._fromNode=function(de){var be,Ie,We,qe;if(G.Guard.isElementNode(de)){var Ke=de.prefix?de.prefix+":"+de.localName:de.localName;de.namespaceURI!==null?this.ele(de.namespaceURI,Ke):this.ele(Ke);try{for(var Je=f(de.attributes),at=Je.next();!at.done;at=Je.next()){var wt=at.value,In=wt.prefix?wt.prefix+":"+wt.localName:wt.localName;wt.namespaceURI!==null?this.att(wt.namespaceURI,In,wt.value):this.att(In,wt.value)}}catch(ot){be={error:ot}}finally{try{at&&!at.done&&(Ie=Je.return)&&Ie.call(Je)}finally{if(be)throw be.error}}try{for(var Pt=f(de.childNodes),Tt=Pt.next();!Tt.done;Tt=Pt.next()){var Kt=Tt.value;this._fromNode(Kt)}}catch(ot){We={error:ot}}finally{try{Tt&&!Tt.done&&(qe=Pt.return)&&qe.call(Pt)}finally{if(We)throw We.error}}this.up()}else G.Guard.isExclusiveTextNode(de)&&de.data?this.txt(de.data):G.Guard.isCommentNode(de)?this.com(de.data):G.Guard.isCDATASectionNode(de)?this.dat(de.data):G.Guard.isProcessingInstructionNode(de)&&this.ins(de.target,de.data)},ne.prototype._serializeAttributes=function(de,be,Ie,We,qe,Ke){var Je,at,wt=Ke?new W.LocalNameSet:void 0;try{for(var In=f(de.attributes),Pt=In.next();!Pt.done;Pt=In.next()){var Tt=Pt.value;if(Ke||qe||Tt.namespaceURI!==null){if(Ke&&wt&&wt.has(Tt.namespaceURI,Tt.localName))return void this.emit("error",new Error("Element contains duplicate attributes (well-formed required)."));Ke&&wt&&wt.set(Tt.namespaceURI,Tt.localName);var Kt=Tt.namespaceURI,ot=null;if(Kt!==null)if(ot=be.get(Tt.prefix,Kt),Kt===I.namespace.XMLNS){if(Tt.value===I.namespace.XML||Tt.prefix===null&&qe||Tt.prefix!==null&&(!(Tt.localName in We)||We[Tt.localName]!==Tt.value)&&be.has(Tt.localName,Tt.value))continue;if(Ke&&Tt.value===I.namespace.XMLNS)return void this.emit("error",new Error("XMLNS namespace is reserved (well-formed required)."));if(Ke&&Tt.value==="")return void this.emit("error",new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required)."));Tt.prefix==="xmlns"&&(ot="xmlns")}else ot===null&&(ot=Tt.prefix===null||be.hasPrefix(Tt.prefix)&&!be.has(Tt.prefix,Kt)?this._generatePrefix(Kt,be,Ie):Tt.prefix,this._push(this._writer.attribute("xmlns:"+ot,this._serializeAttributeValue(Kt,this._options.wellFormed))));if(Ke&&(Tt.localName.indexOf(":")!==-1||!A.xml_isName(Tt.localName)||Tt.localName==="xmlns"&&Kt===null))return void this.emit("error",new Error("Attribute local name contains invalid characters (well-formed required)."));this._push(this._writer.attribute((ot!==null?ot+":":"")+Tt.localName,this._serializeAttributeValue(Tt.value,this._options.wellFormed)))}else this._push(this._writer.attribute(Tt.localName,this._serializeAttributeValue(Tt.value,this._options.wellFormed)))}}catch(pn){Je={error:pn}}finally{try{Pt&&!Pt.done&&(at=In.return)&&at.call(In)}finally{if(Je)throw Je.error}}},ne.prototype._serializeAttributeValue=function(de,be){return be&&de!==null&&!A.xml_isLegalChar(de)?(this.emit("error",new Error("Invalid characters in attribute value.")),""):de===null?"":de.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},ne.prototype._recordNamespaceInformation=function(de,be,Ie){var We,qe,Ke=null;try{for(var Je=f(de.attributes),at=Je.next();!at.done;at=Je.next()){var wt=at.value,In=wt.namespaceURI,Pt=wt.prefix;if(In===I.namespace.XMLNS){if(Pt===null){Ke=wt.value;continue}var Tt=wt.localName,Kt=wt.value;if(Kt===I.namespace.XML||(Kt===""&&(Kt=null),be.has(Tt,Kt)))continue;be.set(Tt,Kt),Ie[Tt]=Kt||""}}}catch(ot){We={error:ot}}finally{try{at&&!at.done&&(qe=Je.return)&&qe.call(Je)}finally{if(We)throw We.error}}return Ke},ne.prototype._generatePrefix=function(de,be,Ie){var We="ns"+Ie.value;return Ie.value++,be.set(We,de),We},ne.prototype._isPrefixMapModified=function(de,be){var Ie=de._items,We=be._items,qe=de._nullItems,Ke=be._nullItems;for(var Je in We){var at=Ie[Je];if(at===void 0)return!0;var wt=We[Je];if(at.length!==wt.length)return!0;for(var In=0;In<at.length;In++)if(at[In]!==wt[In])return!0}if(qe.length!==Ke.length)return!0;for(In=0;In<qe.length;In++)if(qe[In]!==Ke[In])return!0;return!1},ne._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),ne}(a(309).EventEmitter);n.XMLBuilderCBImpl=Y},function(r,n,a){"use strict";a(74);var o,u=this&&this.__extends||(o=e(function(h,y){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,x){b.__proto__=x}||function(b,x){for(var A in x)x.hasOwnProperty(A)&&(b[A]=x[A])})(h,y)},"n"),function(h,y){function b(){this.constructor=h}e(b,"r"),o(h,y),h.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)});Object.defineProperty(n,"__esModule",{value:!0});var f=function(h){function y(b){var x=h.call(this,b)||this;return x._lineLength=0,x}return e(y,"t"),u(y,h),y.prototype.frontMatter=function(){return""},y.prototype.declaration=function(b,x,A){var I=this._beginLine()+"<?xml";return I+=' version="'+b+'"',x!==void 0&&(I+=' encoding="'+x+'"'),A!==void 0&&(I+=' standalone="'+(A?"yes":"no")+'"'),I+="?>"},y.prototype.docType=function(b,x,A){var I=this._beginLine();return I+=x&&A?"<!DOCTYPE "+b+' PUBLIC "'+x+'" "'+A+'">':x?"<!DOCTYPE "+b+' PUBLIC "'+x+'">':A?"<!DOCTYPE "+b+' SYSTEM "'+A+'">':"<!DOCTYPE "+b+">"},y.prototype.comment=function(b){return this._beginLine()+"<!--"+b+"-->"},y.prototype.text=function(b){return this._beginLine()+b},y.prototype.instruction=function(b,x){return x?this._beginLine()+"<?"+b+" "+x+"?>":this._beginLine()+"<?"+b+"?>"},y.prototype.cdata=function(b){return this._beginLine()+"<![CDATA["+b+"]]>"},y.prototype.openTagBegin=function(b){return this._lineLength+=1+b.length,this._beginLine()+"<"+b},y.prototype.openTagEnd=function(b,x,A){return A?" />":x?this._writerOptions.allowEmptyTags?"></"+b+">":this._writerOptions.spaceBeforeSlash?" />":"/>":">"},y.prototype.closeTag=function(b){return this._beginLine()+"</"+b+">"},y.prototype.attribute=function(b,x){var A=b+'="'+x+'"';return this._writerOptions.prettyPrint&&this._writerOptions.width>0&&this._lineLength+1+A.length>this._writerOptions.width?(A=this._beginLine()+this._indent(1)+A,this._lineLength=A.length,A):(this._lineLength+=1+A.length," "+A)},y.prototype.beginElement=function(b){},y.prototype.endElement=function(b){},y.prototype._beginLine=function(){if(this._writerOptions.prettyPrint){var b=(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level);return this._lineLength=b.length,b}return""},y.prototype._indent=function(b){return b<=0?"":this._writerOptions.indent.repeat(b)},y}(a(114).BaseCBWriter);n.XMLCBWriter=f},function(r,n,a){"use strict";a(74);var o,u=this&&this.__extends||(o=e(function(h,y){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,x){b.__proto__=x}||function(b,x){for(var A in x)x.hasOwnProperty(A)&&(b[A]=x[A])})(h,y)},"n"),function(h,y){function b(){this.constructor=h}e(b,"r"),o(h,y),h.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)});Object.defineProperty(n,"__esModule",{value:!0});var f=function(h){function y(b){var x=h.call(this,b)||this;return x._hasChildren=[],x._additionalLevel=0,x}return e(y,"t"),u(y,h),y.prototype.frontMatter=function(){return""},y.prototype.declaration=function(b,x,A){return""},y.prototype.docType=function(b,x,A){return""},y.prototype.comment=function(b){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.comment)+this._sep()+this._val(b)+this._sep()+"}"},y.prototype.text=function(b){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.text)+this._sep()+this._val(b)+this._sep()+"}"},y.prototype.instruction=function(b,x){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.ins)+this._sep()+this._val(x?b+" "+x:b)+this._sep()+"}"},y.prototype.cdata=function(b){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.cdata)+this._sep()+this._val(b)+this._sep()+"}"},y.prototype.attribute=function(b,x){return this._comma()+this._beginLine(1)+"{"+this._sep()+this._key(this._builderOptions.convert.att+b)+this._sep()+this._val(x)+this._sep()+"}"},y.prototype.openTagBegin=function(b){var x=this._comma()+this._beginLine()+"{"+this._sep()+this._key(b)+this._sep()+"{";return this._additionalLevel++,this.hasData=!0,x+=this._beginLine()+this._key(this._builderOptions.convert.text)+this._sep()+"[",this._hasChildren.push(!1),x},y.prototype.openTagEnd=function(b,x,A){if(x){var I=this._sep()+"]";return this._additionalLevel--,I+=this._beginLine()+"}"+this._sep()+"}"}return""},y.prototype.closeTag=function(b){var x=this._beginLine()+"]";return this._additionalLevel--,x+=this._beginLine()+"}"+this._sep()+"}"},y.prototype.beginElement=function(b){},y.prototype.endElement=function(b){this._hasChildren.pop()},y.prototype._beginLine=function(b){return b===void 0&&(b=0),this._writerOptions.prettyPrint?(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level+b):""},y.prototype._indent=function(b){return b+this._additionalLevel<=0?"":this._writerOptions.indent.repeat(b+this._additionalLevel)},y.prototype._comma=function(){var b=this._hasChildren[this._hasChildren.length-1]?",":"";return this._hasChildren.length>0&&(this._hasChildren[this._hasChildren.length-1]=!0),b},y.prototype._sep=function(){return this._writerOptions.prettyPrint?" ":""},y.prototype._key=function(b){return'"'+b+'":'},y.prototype._val=function(b){return JSON.stringify(b)},y}(a(114).BaseCBWriter);n.JSONCBWriter=f},function(r,n,a){"use strict";a(74);var o,u=this&&this.__extends||(o=e(function(h,y){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,x){b.__proto__=x}||function(b,x){for(var A in x)x.hasOwnProperty(A)&&(b[A]=x[A])})(h,y)},"n"),function(h,y){function b(){this.constructor=h}e(b,"r"),o(h,y),h.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)});Object.defineProperty(n,"__esModule",{value:!0});var f=function(h){function y(b){var x=h.call(this,b)||this;if(x._rootWritten=!1,x._additionalLevel=0,b.indent.length<2)throw new Error("YAML indententation string must be at least two characters long.");if(b.offset<0)throw new Error("YAML offset should be zero or a positive number.");return x}return e(y,"t"),u(y,h),y.prototype.frontMatter=function(){return this._beginLine()+"---"},y.prototype.declaration=function(b,x,A){return""},y.prototype.docType=function(b,x,A){return""},y.prototype.comment=function(b){return this._beginLine()+this._key(this._builderOptions.convert.comment)+" "+this._val(b)},y.prototype.text=function(b){return this._beginLine()+this._key(this._builderOptions.convert.text)+" "+this._val(b)},y.prototype.instruction=function(b,x){return this._beginLine()+this._key(this._builderOptions.convert.ins)+" "+this._val(x?b+" "+x:b)},y.prototype.cdata=function(b){return this._beginLine()+this._key(this._builderOptions.convert.cdata)+" "+this._val(b)},y.prototype.attribute=function(b,x){this._additionalLevel++;var A=this._beginLine()+this._key(this._builderOptions.convert.att+b)+" "+this._val(x);return this._additionalLevel--,A},y.prototype.openTagBegin=function(b){var x=this._beginLine()+this._key(b);return this._rootWritten||(this._rootWritten=!0),this.hasData=!0,this._additionalLevel++,x+=this._beginLine(!0)+this._key(this._builderOptions.convert.text)},y.prototype.openTagEnd=function(b,x,A){return x?" "+this._val(""):""},y.prototype.closeTag=function(b){return this._additionalLevel--,""},y.prototype.beginElement=function(b){},y.prototype.endElement=function(b){},y.prototype._beginLine=function(b){return b===void 0&&(b=!1),(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level,b)},y.prototype._indent=function(b,x){if(b+this._additionalLevel<=0)return"";var A=this._writerOptions.indent.repeat(b+this._additionalLevel);return!x&&this._rootWritten?A.substr(0,A.length-2)+"-"+A.substr(-1,1):A},y.prototype._key=function(b){return'"'+b+'":'},y.prototype._val=function(b){return JSON.stringify(b)},y}(a(114).BaseCBWriter);n.YAMLCBWriter=f},function(r,n,a){"use strict";var o,u=typeof Reflect=="object"?Reflect:null,f=u&&typeof u.apply=="function"?u.apply:function(B,Y,Q){return Function.prototype.apply.call(B,Y,Q)};o=u&&typeof u.ownKeys=="function"?u.ownKeys:Object.getOwnPropertySymbols?function(B){return Object.getOwnPropertyNames(B).concat(Object.getOwnPropertySymbols(B))}:function(B){return Object.getOwnPropertyNames(B)};var h=Number.isNaN||function(B){return B!=B};function y(){y.init.call(this)}e(y,"s"),r.exports=y,y.EventEmitter=y,y.prototype._events=void 0,y.prototype._eventsCount=0,y.prototype._maxListeners=void 0;var b=10;function x(B){if(typeof B!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}e(x,"l");function A(B){return B._maxListeners===void 0?y.defaultMaxListeners:B._maxListeners}e(A,"c");function I(B,Y,Q,ne){var de,be,Ie,We;if(x(Q),(be=B._events)===void 0?(be=B._events=Object.create(null),B._eventsCount=0):(be.newListener!==void 0&&(B.emit("newListener",Y,Q.listener?Q.listener:Q),be=B._events),Ie=be[Y]),Ie===void 0)Ie=be[Y]=Q,++B._eventsCount;else if(typeof Ie=="function"?Ie=be[Y]=ne?[Q,Ie]:[Ie,Q]:ne?Ie.unshift(Q):Ie.push(Q),(de=A(B))>0&&Ie.length>de&&!Ie.warned){Ie.warned=!0;var qe=new Error("Possible EventEmitter memory leak detected. "+Ie.length+" "+String(Y)+" listeners added. Use emitter.setMaxListeners() to increase limit");qe.name="MaxListenersExceededWarning",qe.emitter=B,qe.type=Y,qe.count=Ie.length,We=qe,console&&console.warn&&console.warn(We)}return B}e(I,"h");function w(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}e(w,"p");function W(B,Y,Q){var ne={fired:!1,wrapFn:void 0,target:B,type:Y,listener:Q},de=w.bind(ne);return de.listener=Q,ne.wrapFn=de,de}e(W,"f");function G(B,Y,Q){var ne=B._events;if(ne===void 0)return[];var de=ne[Y];return de===void 0?[]:typeof de=="function"?Q?[de.listener||de]:[de]:Q?function(be){for(var Ie=new Array(be.length),We=0;We<Ie.length;++We)Ie[We]=be[We].listener||be[We];return Ie}(de):k(de,de.length)}e(G,"d");function O(B){var Y=this._events;if(Y!==void 0){var Q=Y[B];if(typeof Q=="function")return 1;if(Q!==void 0)return Q.length}return 0}e(O,"m");function k(B,Y){for(var Q=new Array(Y),ne=0;ne<Y;++ne)Q[ne]=B[ne];return Q}e(k,"y"),Object.defineProperty(y,"defaultMaxListeners",{enumerable:!0,get:e(function(){return b},"get"),set:e(function(B){if(typeof B!="number"||B<0||h(B))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+B+".");b=B},"set")}),y.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},y.prototype.setMaxListeners=function(B){if(typeof B!="number"||B<0||h(B))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+B+".");return this._maxListeners=B,this},y.prototype.getMaxListeners=function(){return A(this)},y.prototype.emit=function(B){for(var Y=[],Q=1;Q<arguments.length;Q++)Y.push(arguments[Q]);var ne=B==="error",de=this._events;if(de!==void 0)ne=ne&&de.error===void 0;else if(!ne)return!1;if(ne){var be;if(Y.length>0&&(be=Y[0]),be instanceof Error)throw be;var Ie=new Error("Unhandled error."+(be?" ("+be.message+")":""));throw Ie.context=be,Ie}var We=de[B];if(We===void 0)return!1;if(typeof We=="function")f(We,this,Y);else{var qe=We.length,Ke=k(We,qe);for(Q=0;Q<qe;++Q)f(Ke[Q],this,Y)}return!0},y.prototype.addListener=function(B,Y){return I(this,B,Y,!1)},y.prototype.on=y.prototype.addListener,y.prototype.prependListener=function(B,Y){return I(this,B,Y,!0)},y.prototype.once=function(B,Y){return x(Y),this.on(B,W(this,B,Y)),this},y.prototype.prependOnceListener=function(B,Y){return x(Y),this.prependListener(B,W(this,B,Y)),this},y.prototype.removeListener=function(B,Y){var Q,ne,de,be,Ie;if(x(Y),(ne=this._events)===void 0)return this;if((Q=ne[B])===void 0)return this;if(Q===Y||Q.listener===Y)--this._eventsCount==0?this._events=Object.create(null):(delete ne[B],ne.removeListener&&this.emit("removeListener",B,Q.listener||Y));else if(typeof Q!="function"){for(de=-1,be=Q.length-1;be>=0;be--)if(Q[be]===Y||Q[be].listener===Y){Ie=Q[be].listener,de=be;break}if(de<0)return this;de===0?Q.shift():function(We,qe){for(;qe+1<We.length;qe++)We[qe]=We[qe+1];We.pop()}(Q,de),Q.length===1&&(ne[B]=Q[0]),ne.removeListener!==void 0&&this.emit("removeListener",B,Ie||Y)}return this},y.prototype.off=y.prototype.removeListener,y.prototype.removeAllListeners=function(B){var Y,Q,ne;if((Q=this._events)===void 0)return this;if(Q.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Q[B]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete Q[B]),this;if(arguments.length===0){var de,be=Object.keys(Q);for(ne=0;ne<be.length;++ne)(de=be[ne])!=="removeListener"&&this.removeAllListeners(de);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(Y=Q[B])=="function")this.removeListener(B,Y);else if(Y!==void 0)for(ne=Y.length-1;ne>=0;ne--)this.removeListener(B,Y[ne]);return this},y.prototype.listeners=function(B){return G(this,B,!0)},y.prototype.rawListeners=function(B){return G(this,B,!1)},y.listenerCount=function(B,Y){return typeof B.listenerCount=="function"?B.listenerCount(Y):O.call(B,Y)},y.prototype.listenerCount=O,y.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},function(r,n,a){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=a(77);n.createCB=function(u){return new o.XMLBuilderCBImpl(u)},n.fragmentCB=function(u){return new o.XMLBuilderCBImpl(u,!0)}}])})});var Wtn=yn(Pye=>{"use strict";me();ye();he();ge();Object.defineProperty(Pye,"__esModule",{value:!0});Pye.isValidXmlValue=Otn;Pye.unloadBuilder=kir;Pye.sanitizeNestedCdataTags=Ftn;Pye.recordXml=Btn;var Nir=Vht(),Rir=Wht();function Otn(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}e(Otn,"isValidXmlValue");function kir(r){let n=(0,Nir.create)({version:"1.0"}).ele("record_update");return{xml:n,end:e(()=>n.end({prettyPrint:!0}),"end"),record:e((o,u,f="INSERT_OR_UPDATE")=>{let h=Btn(n,o,u,{attr:{action:f},context:r});return h.addSysScope(r),h},"record")}}e(kir,"unloadBuilder");function Ftn(r){return r.replace(/]]>/g,"]]]]><![CDATA[>")}e(Ftn,"sanitizeNestedCdataTags");function Btn(r,n,a,o={}){let u=r.ele(n,o.attr||{action:"INSERT_OR_UPDATE"});u.ele("sys_id",void 0).txt(`${a}`);let f=(0,Rir.maybeGetFieldToTagMap)(n,o.context?.getAllDocuments()||[]);return{fields(h){for(let[y,b]of Object.entries(h))this.field(y,b)},field(h,y,b={},x=!1){if(!Otn(y))throw new Error(`Invalid XML value for "${h}" column: ${y}`);let A,I=f[h];return h==="script"||h==="operation_script"||I==="script"||I==="html"||I==="xml"||x?(y=I==="xml"?Ftn(y):y,A=u.ele(h,b).dat(y)):A=u.ele(h,b).txt(`${y}`),{choices(w){}}},addSysScope(h){return u.ele("sys_scope",{display_value:h.app.config.scope}).txt(h.app.config.scopeId)}}}e(Btn,"recordXml")});var ztn=yn(dP=>{"use strict";me();ye();he();ge();var Lir=dP&&dP.__createBinding||(Object.create?function(r,n,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(n,a);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:e(function(){return n[a]},"get")}),Object.defineProperty(r,o,u)}:function(r,n,a,o){o===void 0&&(o=a),r[o]=n[a]}),Mir=dP&&dP.__setModuleDefault||(Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n}),jtn=dP&&dP.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var a in r)a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)&&Lir(n,r,a);return Mir(n,r),n};Object.defineProperty(dP,"__esModule",{value:!0});dP.Keys=dP.KEYS_FILE_NAME=dP.KEYS_MODULE=void 0;var rze=mp(),Oir=Ght(),ize=vWe(),D2=jtn(VS()),Fir=jtn(XC());dP.KEYS_MODULE="@servicenow/sdk/global";dP.KEYS_FILE_NAME="keys.ts";var Bir=D2.object({explicit:D2.record(D2.string().or(D2.number()),D2.object({table:D2.string(),id:D2.string()})).default({}),composite:D2.array(D2.object({table:D2.string(),id:D2.string(),key:D2.record(D2.string(),D2.string().or(D2.number()))})).default([]),deleted:D2.record(D2.array(D2.string())).default({})}),Hht=class r{static{e(this,"Keys")}file;keys;usedIds=new Set;constructor(n){this.file=r.getKeysFile(n),this.keys=r.parseKeysFile(this.file)}static parseKeysFile(n){let a=r.getOrCreateKeysInterface(n);return Bir.parse((0,Oir.parseType)(a.getType(),a,o=>{if(o.isArray())return[];throw`Unparsable type in keys.ts: ${o.getText()}`}))}static getKeysFile(n){let a=r.getKeysFilePath(n),o=n.compiler.addSourceFileAtPathIfExists(a)??n.compiler.createSourceFile(a,"",{overwrite:!0,scriptKind:rze.ts.ScriptKind.TS});return o.getImportDeclaration(u=>u.getModuleSpecifierValue()===dP.KEYS_MODULE)||o.addImportDeclaration({moduleSpecifier:dP.KEYS_MODULE}),o}static getKeysFilePath(n){return rze.path.resolve(n.app.rootDir,n.app.config.generatedDir,dP.KEYS_FILE_NAME)}static getOrCreateKeysInterface(n){let a=n.getModule("global")??n.addModule({name:"global",declarationKind:rze.ts.ModuleDeclarationKind.Global,hasDeclareKeyword:!0}),o=a.getModule("Now")??a.addModule({name:"Now",declarationKind:rze.ts.ModuleDeclarationKind.Namespace}),u=o.getModule("Internal")??o.addModule({name:"Internal"});return u.getInterface("Keys")??u.addInterface({name:"Keys",extends:e(f=>{f.write("KeysRegistry")},"extends")})}use(n){return this.usedIds.add(n),n}get explicit(){return this.keys.explicit}get composite(){return this.keys.composite}get deleted(){return this.keys.deleted}getSourceFile(){return this.file}getNextAvailableExplicitKey(){for(let n=0;;n++){let a=`generated${n}`;if(!this.explicit[a])return a}}explicitKeyExists(n){return!!this.explicit[n]}getIdUsingExplicitKey(n){return this.explicit[n]?.id}findExplicitKeyById(n){return Object.entries(this.explicit).find(([,a])=>a.id===n)?.[0]}registerExplicitId(n,a,o){if((0,ize.isGUID)(a))return this.use(this.explicit[a]?.id??a);let u=this.explicit[a];if(u)return this.use(u.id);if(o){let h=this.findExplicitKeyById(o);if(h){let y=this.explicit[h];if(h!==a)throw`ID '${o}' is already registered for key '${h}', cannot register for key '${a}'`;return this.use(y.id)}}let f={table:n,id:(0,ize.isGUID)(a)?a:o??(0,ize.GUID)()};return this.explicit[a]=f,this.use(f.id)}registerCompositeId(n,a,o){let u=this.composite.find(h=>h.table===n&&Fir.isEqual(h.key,a));if(u){if(u.table!==n)throw`Composite key ${a} is already registered for table '${u.table}', cannot register for table '${n}'`;return this.use(u.id)}let f={table:n,id:o??(0,ize.GUID)(),key:a};return this.composite.push(f),this.use(f.id)}getUsedExplicitIds(){return Object.fromEntries(Object.entries(this.explicit).filter(([,n])=>this.usedIds.has(n.id)))}getUsedCompositeIds(){return this.composite.filter(n=>this.usedIds.has(n.id))}getDeletedAndUnusedIds(){return[...Object.values(this.explicit),...this.composite,...Object.entries(this.deleted).flatMap(([n,a])=>a.map(o=>({table:n,id:o})))].filter(n=>!this.usedIds.has(n.id)).reduce((n,a)=>(n[a.table]=[...n[a.table]??[],a.id],n),{})}async format(n){await n?.(this.file)}updateSourceFile(){let n=[],a=this.getUsedExplicitIds(),o=this.getUsedCompositeIds(),u=this.getDeletedAndUnusedIds();Object.keys(a).length>0&&n.push({name:"explicit",type:JSON.stringify(a,void 0,4)}),o.length>0&&n.push({name:"composite",type:JSON.stringify(o,void 0,4)}),Object.keys(u).length>0&&n.push({name:"deleted",type:JSON.stringify(u,void 0,4)});let f=r.getOrCreateKeysInterface(this.file);f.getProperties().forEach(h=>h.remove()),f.addProperties(n)}};dP.Keys=Hht});var Utn=yn(VW=>{"use strict";me();ye();he();ge();Object.defineProperty(VW,"__esModule",{value:!0});VW.calculateCustomPathsFromDocs=VW.getIncludePaths=VW.DefaultIncludePaths=void 0;VW.replaceTemplate=Gtn;var aze=mp();VW.DefaultIncludePaths={};var Wir=e(r=>{let n=aze.path.join(r.app.rootDir,"now.includes-mapping.json"),a=r.compiler.getSourceFile(n),o="";return a?o=a.getFullText():o=aze.FileSystem.existsSync(r.fs,n)?r.fs.readFileSync(n).toString():"",o?JSON.parse(o):VW.DefaultIncludePaths},"getIncludePaths");VW.getIncludePaths=Wir;var jir=e(r=>{let n=(0,VW.getIncludePaths)(r),a=r.getAllDocuments().filter(o=>o.kind==="record").map(o=>({table:o.data?.table,guid:o.guid,data:o.data?.data})).filter(o=>n[o.table]).map(o=>({table:o.table,guid:o.guid,fields:(n[o.table]?.fields||[]).flatMap(Object.entries).map(([u,f])=>({field:u,path:Gtn(f,{sys_id:o.guid,...o.data})}))||[]})).reduce((o,u)=>(o[u.table]=o[u.table]||[],o[u.table].push(u),o),{});return Kir(a)},"calculateCustomPathsFromDocs");VW.calculateCustomPathsFromDocs=jir;function Gtn(r,n){let a=r,o=r.matchAll(/{{([a-z_]+)}}/g);for(let u of o){let[,f]=u;if(f){let h=Vir(n[f]);a=a.replaceAll(`{{${f}}}`,h)}}return a}e(Gtn,"replaceTemplate");var zir=/[/<>?\\:|*"]/g,Gir=/^\.+$/,Uir=/[. ]+$/;function Vir(r){return r.replace(zir,"_").replace(Gir,"").replace(Uir,"")}e(Vir,"sanitizeForFilesystem");function Hir(r,n){let a=aze.path.parse(r);n[r]=(n[r]||0)+1;let o=a.base.split(".");return o[0]=`${o[0]}-${n[r]}`,aze.path.join(a.dir,o.join("."))}e(Hir,"dedupeFilename");function Kir(r){let n={};for(let o in r)r[o].flatMap(f=>f.fields.map(h=>h.path)).forEach(f=>n[f]=(n[f]||0)+1);let a={};for(let o in r){let u=r[o]||[];for(let f of u)for(let h=0;h<f.fields.length;h++){let y=f.fields[h]?.path;y&&n[y]>1&&(f.fields[h].path=Hir(y,a))}}return r}e(Kir,"dedupeFilenames")});var Uh=yn(I6=>{"use strict";me();ye();he();ge();var qir=I6&&I6.__createBinding||(Object.create?function(r,n,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(n,a);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:e(function(){return n[a]},"get")}),Object.defineProperty(r,o,u)}:function(r,n,a,o){o===void 0&&(o=a),r[o]=n[a]}),Qle=I6&&I6.__exportStar||function(r,n){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(n,a)&&qir(n,r,a)};Object.defineProperty(I6,"__esModule",{value:!0});Qle(xht(),I6);Qle(Ght(),I6);Qle(Wtn(),I6);Qle(Aht(),I6);Qle(vWe(),I6);Qle(ztn(),I6);Qle(Utn(),I6)});var oze=yn(Kht=>{"use strict";me();ye();he();ge();Object.defineProperty(Kht,"__esModule",{value:!0});Kht.getLabelDiagnostics=$ir;var Vtn=Uh(),Jir=XC(),Htn=mp();function $ir(r){let n=[],a=r.getProperty("label")?.getValue();if(a&&(0,Jir.isArray)(a)){let o={};a.forEach((u,f)=>{let h=u.language;o[h]!==void 0&&n.push(new Vtn.FluentDiagnostic(r.getProperty("label").getNode().getChildrenOfKind(210)[f]?.getProperty("language")??r.getProperty("label").getNode(),"'language' must be unique per table/column",{level:Htn.Diagnostic.Level.Error})),o[h]=f,(h===""||h&&h.length!==2)&&n.push(new Vtn.FluentDiagnostic(r.getProperty("label").getNode().getChildrenOfKind(210)[f]?.getProperty("language")??r.getProperty("label").getNode(),"'language' must be a 2 character identifier (Ex. 'en', 'es')",{level:Htn.Diagnostic.Level.Error}))})}return n}e($ir,"getLabelDiagnostics")});var qtn=yn(wd=>{"use strict";me();ye();he();ge();var Xir=wd&&wd.__createBinding||(Object.create?function(r,n,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(n,a);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:e(function(){return n[a]},"get")}),Object.defineProperty(r,o,u)}:function(r,n,a,o){o===void 0&&(o=a),r[o]=n[a]}),Yir=wd&&wd.__setModuleDefault||(Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n}),Qir=wd&&wd.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var a in r)a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)&&Xir(n,r,a);return Yir(n,r),n};Object.defineProperty(wd,"__esModule",{value:!0});wd.GenericColumnPlugin=wd.OtherDateColumnPlugin=wd.ScheduleDateTimeColumnPlugin=wd.IntegerDateColumnPlugin=wd.DueDateColumnPlugin=wd.BasicDateTimeColumnPlugin=wd.CalendarDateTimeColumnPlugin=wd.DateTimeColumnPlugin=wd.DateColumnPlugin=wd.FieldNameColumnPlugin=wd.VersionColumnPlugin=wd.UserRolesColumnPlugin=wd.TranslatedTextColumnPlugin=wd.TranslatedFieldColumnPlugin=wd.TableNameColumnPlugin=wd.SystemClassNameColumnPlugin=wd.ScriptColumnPlugin=wd.RadioColumnPlugin=wd.ReferenceColumnPlugin=wd.ListColumnPlugin=wd.DomainPathColumnPlugin=wd.DomainIdColumnPlugin=wd.DocumentIdColumnPlugin=wd.DecimalColumnPlugin=wd.ChoiceColumnPlugin=wd.ConditionsColumnPlugin=wd.BasicImageColumnPlugin=wd.IntegerColumnPlugin=wd.BooleanColumnPlugin=wd.StringColumnPlugin=void 0;var pb=Qir(mc()),sze=Uh(),Zir=oze(),Ktn=["add","coalesce","concat","datediff","dayofweek","distance_sphere","divide","greatest","least","length","multiply","position","substring","subtract"],ear=new RegExp(`^glidefunction:(${Ktn.join("|")})[(].*?[)]$`,"g");function _b(r,n){return(0,sze.Plugin)({name:`${n}Column`,extractors:{raw:{fluent:{CallExpression(a,o){let u=(0,sze.extractCallExpression)(r,`${n}_column`,a,o,()=>"NO_GUID_GENERATED");if(!u.handled||!u.data)return u;let f=u.data,h=u.diagnostics;h.push(...(0,Zir.getLabelDiagnostics)(f));let y=f.getProperty("function_definition")?.getValue();return y&&(typeof y!="string"||!y.match(ear))&&h.push(new sze.FluentDiagnostic(a,`'function_definition' must start with 'glidefunction:' and include a single function call to a predefined function:
31104
+ `:""}e(Je,"A"),r.exports.dump=Je,r.exports.safeDump=function(at,wt){return Je(at,o.extend({schema:h},wt))}},function(r,n,a){"use strict";a(31),a(32),a(33),a(64),a(19),a(65),a(20),a(68),a(92),a(144),a(22),a(94),a(23);var o,u=this&&this.__extends||(o=e(function(Q,ne){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(de,be){de.__proto__=be}||function(de,be){for(var Ie in be)be.hasOwnProperty(Ie)&&(de[Ie]=be[Ie])})(Q,ne)},"n"),function(Q,ne){function de(){this.constructor=Q}e(de,"r"),o(Q,ne),Q.prototype=ne===null?Object.create(ne):(de.prototype=ne.prototype,new de)}),f=this&&this.__values||function(Q){var ne=typeof Symbol=="function"&&Symbol.iterator,de=ne&&Q[ne],be=0;if(de)return de.call(Q);if(Q&&typeof Q.length=="number")return{next:e(function(){return Q&&be>=Q.length&&(Q=void 0),{value:Q&&Q[be++],done:!Q}},"next")};throw new TypeError(ne?"Object is not iterable.":"Symbol.iterator is not defined.")},h=this&&this.__read||function(Q,ne){var de=typeof Symbol=="function"&&Q[Symbol.iterator];if(!de)return Q;var be,Ie,We=de.call(Q),qe=[];try{for(;(ne===void 0||ne-- >0)&&!(be=We.next()).done;)qe.push(be.value)}catch(Ke){Ie={error:Ke}}finally{try{be&&!be.done&&(de=We.return)&&de.call(We)}finally{if(Ie)throw Ie.error}}return qe};Object.defineProperty(n,"__esModule",{value:!0});var y=a(91),b=a(2),x=a(183),A=a(0),I=a(7),w=a(95),W=a(69),G=a(3),O=a(306),k=a(307),B=a(308),Y=function(Q){function ne(de,be){be===void 0&&(be=!1);var Ie=Q.call(this)||this;return Ie._hasDeclaration=!1,Ie._docTypeName="",Ie._hasDocumentElement=!1,Ie._currentElementSerialized=!1,Ie._openTags=[],Ie._ended=!1,Ie._fragment=be,Ie._options=b.applyDefaults(de||{},y.DefaultXMLBuilderCBOptions),Ie._builderOptions={defaultNamespace:Ie._options.defaultNamespace,namespaceAlias:Ie._options.namespaceAlias},Ie._options.format==="json"?Ie._writer=new k.JSONCBWriter(Ie._options):Ie._options.format==="yaml"?Ie._writer=new B.YAMLCBWriter(Ie._options):Ie._writer=new O.XMLCBWriter(Ie._options),Ie._options.data!==void 0&&Ie.on("data",Ie._options.data),Ie._options.end!==void 0&&Ie.on("end",Ie._options.end),Ie._options.error!==void 0&&Ie.on("error",Ie._options.error),Ie._prefixMap=new w.NamespacePrefixMap,Ie._prefixMap.set("xml",I.namespace.XML),Ie._prefixIndex={value:1},Ie._push(Ie._writer.frontMatter()),Ie}return e(ne,"t"),u(ne,Q),ne.prototype.ele=function(de,be,Ie){var We,qe;if(b.isObject(de)||b.isString(de)&&(/^\s*</.test(de)||/^\s*[\{\[]/.test(de)||/^(\s*|(#.*)|(%.*))*---/.test(de))){var Ke=x.fragment().set(this._options);try{Ke.ele(de)}catch(In){return this.emit("error",In),this}try{for(var Je=f(Ke.node.childNodes),at=Je.next();!at.done;at=Je.next()){var wt=at.value;this._fromNode(wt)}}catch(In){We={error:In}}finally{try{at&&!at.done&&(qe=Je.return)&&qe.call(Je)}finally{if(We)throw We.error}}return this}if(this._serializeOpenTag(!0),!this._fragment&&this._hasDocumentElement&&this._writer.level===0)return this.emit("error",new Error("Document cannot have multiple document element nodes.")),this;try{this._currentElement=x.fragment(this._builderOptions).ele(de,be,Ie)}catch(In){return this.emit("error",In),this}return this._fragment||this._hasDocumentElement||this._docTypeName===""||this._currentElement.node._qualifiedName===this._docTypeName?(this._currentElementSerialized=!1,this._fragment||(this._hasDocumentElement=!0),this):(this.emit("error",new Error("Document element name does not match DocType declaration name.")),this)},ne.prototype.att=function(de,be,Ie){if(this._currentElement===void 0)return this.emit("error",new Error("Cannot insert an attribute node as child of a document node.")),this;try{this._currentElement.att(de,be,Ie)}catch(We){return this.emit("error",We),this}return this},ne.prototype.com=function(de){var be;this._serializeOpenTag(!0);try{be=x.fragment(this._builderOptions).com(de).first().node}catch(Ie){return this.emit("error",Ie),this}return!this._options.wellFormed||A.xml_isLegalChar(be.data)&&be.data.indexOf("--")===-1&&!be.data.endsWith("-")?(this._push(this._writer.comment(be.data)),this):(this.emit("error",new Error("Comment data contains invalid characters (well-formed required).")),this)},ne.prototype.txt=function(de){if(!this._fragment&&this._currentElement===void 0)return this.emit("error",new Error("Cannot insert a text node as child of a document node.")),this;var be;this._serializeOpenTag(!0);try{be=x.fragment(this._builderOptions).txt(de).first().node}catch(We){return this.emit("error",We),this}if(this._options.wellFormed&&!A.xml_isLegalChar(be.data))return this.emit("error",new Error("Text data contains invalid characters (well-formed required).")),this;var Ie=be.data.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return this._push(this._writer.text(Ie)),this},ne.prototype.ins=function(de,be){var Ie;be===void 0&&(be=""),this._serializeOpenTag(!0);try{Ie=x.fragment(this._builderOptions).ins(de,be).first().node}catch(We){return this.emit("error",We),this}return this._options.wellFormed&&(Ie.target.indexOf(":")!==-1||/^xml$/i.test(Ie.target))?(this.emit("error",new Error("Processing instruction target contains invalid characters (well-formed required).")),this):this._options.wellFormed&&!A.xml_isLegalChar(Ie.data)?(this.emit("error",Error("Processing instruction data contains invalid characters (well-formed required).")),this):(this._push(this._writer.instruction(Ie.target,Ie.data)),this)},ne.prototype.dat=function(de){var be;this._serializeOpenTag(!0);try{be=x.fragment(this._builderOptions).dat(de).first().node}catch(Ie){return this.emit("error",Ie),this}return this._push(this._writer.cdata(be.data)),this},ne.prototype.dec=function(de){return de===void 0&&(de={version:"1.0"}),this._fragment?(this.emit("error",Error("Cannot insert an XML declaration into a document fragment.")),this):this._hasDeclaration?(this.emit("error",Error("XML declaration is already inserted.")),this):(this._push(this._writer.declaration(de.version||"1.0",de.encoding,de.standalone)),this._hasDeclaration=!0,this)},ne.prototype.dtd=function(de){if(this._fragment)return this.emit("error",Error("Cannot insert a DocType declaration into a document fragment.")),this;if(this._docTypeName!=="")return this.emit("error",new Error("DocType declaration is already inserted.")),this;if(this._hasDocumentElement)return this.emit("error",new Error("Cannot insert DocType declaration after document element.")),this;var be;try{be=x.create().dtd(de).first().node}catch(Ie){return this.emit("error",Ie),this}return this._options.wellFormed&&!A.xml_isPubidChar(be.publicId)?(this.emit("error",new Error("DocType public identifier does not match PubidChar construct (well-formed required).")),this):this._options.wellFormed&&(!A.xml_isLegalChar(be.systemId)||be.systemId.indexOf('"')!==-1&&be.systemId.indexOf("'")!==-1)?(this.emit("error",new Error("DocType system identifier contains invalid characters (well-formed required).")),this):(this._docTypeName=de.name,this._push(this._writer.docType(de.name,be.publicId,be.systemId)),this)},ne.prototype.import=function(de){var be,Ie,We=x.fragment().set(this._options);try{We.import(de)}catch(at){return this.emit("error",at),this}try{for(var qe=f(We.node.childNodes),Ke=qe.next();!Ke.done;Ke=qe.next()){var Je=Ke.value;this._fromNode(Je)}}catch(at){be={error:at}}finally{try{Ke&&!Ke.done&&(Ie=qe.return)&&Ie.call(qe)}finally{if(be)throw be.error}}return this},ne.prototype.up=function(){return this._serializeOpenTag(!1),this._serializeCloseTag(),this},ne.prototype.end=function(){for(this._serializeOpenTag(!1);this._openTags.length>0;)this._serializeCloseTag();return this._push(null),this},ne.prototype._serializeOpenTag=function(de){if(!this._currentElementSerialized&&this._currentElement!==void 0){var be=this._currentElement.node;if(!this._options.wellFormed||be.localName.indexOf(":")===-1&&A.xml_isName(be.localName)){var Ie="",We=!1,qe=this._prefixMap.copy(),Ke={},Je=this._recordNamespaceInformation(be,qe,Ke),at=this._openTags.length===0?null:this._openTags[this._openTags.length-1][1],wt=be.namespaceURI;if(wt===null&&(wt=at),at===wt)Je!==null&&(We=!0),Ie=wt===I.namespace.XML?"xml:"+be.localName:be.localName,this._writer.beginElement(Ie),this._push(this._writer.openTagBegin(Ie));else{var In=be.prefix,Pt=null;if(In===null&&wt===Je||(Pt=qe.get(In,wt)),In==="xmlns"){if(this._options.wellFormed)return void this.emit("error",new Error("An element cannot have the 'xmlns' prefix (well-formed required)."));Pt=In}Pt!==null?(Ie=Pt+":"+be.localName,Je!==null&&Je!==I.namespace.XML&&(at=Je||null),this._writer.beginElement(Ie),this._push(this._writer.openTagBegin(Ie))):In!==null?(In in Ke&&(In=this._generatePrefix(wt,qe,this._prefixIndex)),qe.set(In,wt),Ie+=In+":"+be.localName,this._writer.beginElement(Ie),this._push(this._writer.openTagBegin(Ie)),this._push(this._writer.attribute("xmlns:"+In,this._serializeAttributeValue(wt,this._options.wellFormed))),Je!==null&&(at=Je||null)):Je===null||Je!==null&&Je!==wt?(We=!0,Ie+=be.localName,at=wt,this._writer.beginElement(Ie),this._push(this._writer.openTagBegin(Ie)),this._push(this._writer.attribute("xmlns",this._serializeAttributeValue(wt,this._options.wellFormed)))):(Ie+=be.localName,at=wt,this._writer.beginElement(Ie),this._push(this._writer.openTagBegin(Ie)))}this._serializeAttributes(be,qe,this._prefixIndex,Ke,We,this._options.wellFormed);var Tt=wt===I.namespace.HTML;Tt&&!de&&ne._VoidElementNames.has(be.localName)?(this._push(this._writer.openTagEnd(Ie,!0,!0)),this._writer.endElement(Ie)):Tt||de?this._push(this._writer.openTagEnd(Ie,!1,!1)):(this._push(this._writer.openTagEnd(Ie,!0,!1)),this._writer.endElement(Ie)),this._currentElementSerialized=!0,this._openTags.push([Ie,at,this._prefixMap,de]),this._isPrefixMapModified(this._prefixMap,qe)&&(this._prefixMap=qe),this._writer.level++}else this.emit("error",new Error("Node local name contains invalid characters (well-formed required)."))}},ne.prototype._serializeCloseTag=function(){this._writer.level--;var de=this._openTags.pop();if(de!==void 0){var be=h(de,4),Ie=be[0],We=(be[1],be[2]),qe=be[3];this._prefixMap=We,qe&&(this._push(this._writer.closeTag(Ie)),this._writer.endElement(Ie))}else this.emit("error",new Error("Last element is undefined."))},ne.prototype._push=function(de){de===null?(this._ended=!0,this.emit("end")):this._ended?this.emit("error",new Error("Cannot push to ended stream.")):de.length!==0&&(this._writer.hasData=!0,this.emit("data",de,this._writer.level))},ne.prototype._fromNode=function(de){var be,Ie,We,qe;if(G.Guard.isElementNode(de)){var Ke=de.prefix?de.prefix+":"+de.localName:de.localName;de.namespaceURI!==null?this.ele(de.namespaceURI,Ke):this.ele(Ke);try{for(var Je=f(de.attributes),at=Je.next();!at.done;at=Je.next()){var wt=at.value,In=wt.prefix?wt.prefix+":"+wt.localName:wt.localName;wt.namespaceURI!==null?this.att(wt.namespaceURI,In,wt.value):this.att(In,wt.value)}}catch(ot){be={error:ot}}finally{try{at&&!at.done&&(Ie=Je.return)&&Ie.call(Je)}finally{if(be)throw be.error}}try{for(var Pt=f(de.childNodes),Tt=Pt.next();!Tt.done;Tt=Pt.next()){var Kt=Tt.value;this._fromNode(Kt)}}catch(ot){We={error:ot}}finally{try{Tt&&!Tt.done&&(qe=Pt.return)&&qe.call(Pt)}finally{if(We)throw We.error}}this.up()}else G.Guard.isExclusiveTextNode(de)&&de.data?this.txt(de.data):G.Guard.isCommentNode(de)?this.com(de.data):G.Guard.isCDATASectionNode(de)?this.dat(de.data):G.Guard.isProcessingInstructionNode(de)&&this.ins(de.target,de.data)},ne.prototype._serializeAttributes=function(de,be,Ie,We,qe,Ke){var Je,at,wt=Ke?new W.LocalNameSet:void 0;try{for(var In=f(de.attributes),Pt=In.next();!Pt.done;Pt=In.next()){var Tt=Pt.value;if(Ke||qe||Tt.namespaceURI!==null){if(Ke&&wt&&wt.has(Tt.namespaceURI,Tt.localName))return void this.emit("error",new Error("Element contains duplicate attributes (well-formed required)."));Ke&&wt&&wt.set(Tt.namespaceURI,Tt.localName);var Kt=Tt.namespaceURI,ot=null;if(Kt!==null)if(ot=be.get(Tt.prefix,Kt),Kt===I.namespace.XMLNS){if(Tt.value===I.namespace.XML||Tt.prefix===null&&qe||Tt.prefix!==null&&(!(Tt.localName in We)||We[Tt.localName]!==Tt.value)&&be.has(Tt.localName,Tt.value))continue;if(Ke&&Tt.value===I.namespace.XMLNS)return void this.emit("error",new Error("XMLNS namespace is reserved (well-formed required)."));if(Ke&&Tt.value==="")return void this.emit("error",new Error("Namespace prefix declarations cannot be used to undeclare a namespace (well-formed required)."));Tt.prefix==="xmlns"&&(ot="xmlns")}else ot===null&&(ot=Tt.prefix===null||be.hasPrefix(Tt.prefix)&&!be.has(Tt.prefix,Kt)?this._generatePrefix(Kt,be,Ie):Tt.prefix,this._push(this._writer.attribute("xmlns:"+ot,this._serializeAttributeValue(Kt,this._options.wellFormed))));if(Ke&&(Tt.localName.indexOf(":")!==-1||!A.xml_isName(Tt.localName)||Tt.localName==="xmlns"&&Kt===null))return void this.emit("error",new Error("Attribute local name contains invalid characters (well-formed required)."));this._push(this._writer.attribute((ot!==null?ot+":":"")+Tt.localName,this._serializeAttributeValue(Tt.value,this._options.wellFormed)))}else this._push(this._writer.attribute(Tt.localName,this._serializeAttributeValue(Tt.value,this._options.wellFormed)))}}catch(pn){Je={error:pn}}finally{try{Pt&&!Pt.done&&(at=In.return)&&at.call(In)}finally{if(Je)throw Je.error}}},ne.prototype._serializeAttributeValue=function(de,be){return be&&de!==null&&!A.xml_isLegalChar(de)?(this.emit("error",new Error("Invalid characters in attribute value.")),""):de===null?"":de.replace(/(?!&(lt|gt|amp|apos|quot);)&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},ne.prototype._recordNamespaceInformation=function(de,be,Ie){var We,qe,Ke=null;try{for(var Je=f(de.attributes),at=Je.next();!at.done;at=Je.next()){var wt=at.value,In=wt.namespaceURI,Pt=wt.prefix;if(In===I.namespace.XMLNS){if(Pt===null){Ke=wt.value;continue}var Tt=wt.localName,Kt=wt.value;if(Kt===I.namespace.XML||(Kt===""&&(Kt=null),be.has(Tt,Kt)))continue;be.set(Tt,Kt),Ie[Tt]=Kt||""}}}catch(ot){We={error:ot}}finally{try{at&&!at.done&&(qe=Je.return)&&qe.call(Je)}finally{if(We)throw We.error}}return Ke},ne.prototype._generatePrefix=function(de,be,Ie){var We="ns"+Ie.value;return Ie.value++,be.set(We,de),We},ne.prototype._isPrefixMapModified=function(de,be){var Ie=de._items,We=be._items,qe=de._nullItems,Ke=be._nullItems;for(var Je in We){var at=Ie[Je];if(at===void 0)return!0;var wt=We[Je];if(at.length!==wt.length)return!0;for(var In=0;In<at.length;In++)if(at[In]!==wt[In])return!0}if(qe.length!==Ke.length)return!0;for(In=0;In<qe.length;In++)if(qe[In]!==Ke[In])return!0;return!1},ne._VoidElementNames=new Set(["area","base","basefont","bgsound","br","col","embed","frame","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"]),ne}(a(309).EventEmitter);n.XMLBuilderCBImpl=Y},function(r,n,a){"use strict";a(74);var o,u=this&&this.__extends||(o=e(function(h,y){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,x){b.__proto__=x}||function(b,x){for(var A in x)x.hasOwnProperty(A)&&(b[A]=x[A])})(h,y)},"n"),function(h,y){function b(){this.constructor=h}e(b,"r"),o(h,y),h.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)});Object.defineProperty(n,"__esModule",{value:!0});var f=function(h){function y(b){var x=h.call(this,b)||this;return x._lineLength=0,x}return e(y,"t"),u(y,h),y.prototype.frontMatter=function(){return""},y.prototype.declaration=function(b,x,A){var I=this._beginLine()+"<?xml";return I+=' version="'+b+'"',x!==void 0&&(I+=' encoding="'+x+'"'),A!==void 0&&(I+=' standalone="'+(A?"yes":"no")+'"'),I+="?>"},y.prototype.docType=function(b,x,A){var I=this._beginLine();return I+=x&&A?"<!DOCTYPE "+b+' PUBLIC "'+x+'" "'+A+'">':x?"<!DOCTYPE "+b+' PUBLIC "'+x+'">':A?"<!DOCTYPE "+b+' SYSTEM "'+A+'">':"<!DOCTYPE "+b+">"},y.prototype.comment=function(b){return this._beginLine()+"<!--"+b+"-->"},y.prototype.text=function(b){return this._beginLine()+b},y.prototype.instruction=function(b,x){return x?this._beginLine()+"<?"+b+" "+x+"?>":this._beginLine()+"<?"+b+"?>"},y.prototype.cdata=function(b){return this._beginLine()+"<![CDATA["+b+"]]>"},y.prototype.openTagBegin=function(b){return this._lineLength+=1+b.length,this._beginLine()+"<"+b},y.prototype.openTagEnd=function(b,x,A){return A?" />":x?this._writerOptions.allowEmptyTags?"></"+b+">":this._writerOptions.spaceBeforeSlash?" />":"/>":">"},y.prototype.closeTag=function(b){return this._beginLine()+"</"+b+">"},y.prototype.attribute=function(b,x){var A=b+'="'+x+'"';return this._writerOptions.prettyPrint&&this._writerOptions.width>0&&this._lineLength+1+A.length>this._writerOptions.width?(A=this._beginLine()+this._indent(1)+A,this._lineLength=A.length,A):(this._lineLength+=1+A.length," "+A)},y.prototype.beginElement=function(b){},y.prototype.endElement=function(b){},y.prototype._beginLine=function(){if(this._writerOptions.prettyPrint){var b=(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level);return this._lineLength=b.length,b}return""},y.prototype._indent=function(b){return b<=0?"":this._writerOptions.indent.repeat(b)},y}(a(114).BaseCBWriter);n.XMLCBWriter=f},function(r,n,a){"use strict";a(74);var o,u=this&&this.__extends||(o=e(function(h,y){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,x){b.__proto__=x}||function(b,x){for(var A in x)x.hasOwnProperty(A)&&(b[A]=x[A])})(h,y)},"n"),function(h,y){function b(){this.constructor=h}e(b,"r"),o(h,y),h.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)});Object.defineProperty(n,"__esModule",{value:!0});var f=function(h){function y(b){var x=h.call(this,b)||this;return x._hasChildren=[],x._additionalLevel=0,x}return e(y,"t"),u(y,h),y.prototype.frontMatter=function(){return""},y.prototype.declaration=function(b,x,A){return""},y.prototype.docType=function(b,x,A){return""},y.prototype.comment=function(b){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.comment)+this._sep()+this._val(b)+this._sep()+"}"},y.prototype.text=function(b){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.text)+this._sep()+this._val(b)+this._sep()+"}"},y.prototype.instruction=function(b,x){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.ins)+this._sep()+this._val(x?b+" "+x:b)+this._sep()+"}"},y.prototype.cdata=function(b){return this._comma()+this._beginLine()+"{"+this._sep()+this._key(this._builderOptions.convert.cdata)+this._sep()+this._val(b)+this._sep()+"}"},y.prototype.attribute=function(b,x){return this._comma()+this._beginLine(1)+"{"+this._sep()+this._key(this._builderOptions.convert.att+b)+this._sep()+this._val(x)+this._sep()+"}"},y.prototype.openTagBegin=function(b){var x=this._comma()+this._beginLine()+"{"+this._sep()+this._key(b)+this._sep()+"{";return this._additionalLevel++,this.hasData=!0,x+=this._beginLine()+this._key(this._builderOptions.convert.text)+this._sep()+"[",this._hasChildren.push(!1),x},y.prototype.openTagEnd=function(b,x,A){if(x){var I=this._sep()+"]";return this._additionalLevel--,I+=this._beginLine()+"}"+this._sep()+"}"}return""},y.prototype.closeTag=function(b){var x=this._beginLine()+"]";return this._additionalLevel--,x+=this._beginLine()+"}"+this._sep()+"}"},y.prototype.beginElement=function(b){},y.prototype.endElement=function(b){this._hasChildren.pop()},y.prototype._beginLine=function(b){return b===void 0&&(b=0),this._writerOptions.prettyPrint?(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level+b):""},y.prototype._indent=function(b){return b+this._additionalLevel<=0?"":this._writerOptions.indent.repeat(b+this._additionalLevel)},y.prototype._comma=function(){var b=this._hasChildren[this._hasChildren.length-1]?",":"";return this._hasChildren.length>0&&(this._hasChildren[this._hasChildren.length-1]=!0),b},y.prototype._sep=function(){return this._writerOptions.prettyPrint?" ":""},y.prototype._key=function(b){return'"'+b+'":'},y.prototype._val=function(b){return JSON.stringify(b)},y}(a(114).BaseCBWriter);n.JSONCBWriter=f},function(r,n,a){"use strict";a(74);var o,u=this&&this.__extends||(o=e(function(h,y){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,x){b.__proto__=x}||function(b,x){for(var A in x)x.hasOwnProperty(A)&&(b[A]=x[A])})(h,y)},"n"),function(h,y){function b(){this.constructor=h}e(b,"r"),o(h,y),h.prototype=y===null?Object.create(y):(b.prototype=y.prototype,new b)});Object.defineProperty(n,"__esModule",{value:!0});var f=function(h){function y(b){var x=h.call(this,b)||this;if(x._rootWritten=!1,x._additionalLevel=0,b.indent.length<2)throw new Error("YAML indententation string must be at least two characters long.");if(b.offset<0)throw new Error("YAML offset should be zero or a positive number.");return x}return e(y,"t"),u(y,h),y.prototype.frontMatter=function(){return this._beginLine()+"---"},y.prototype.declaration=function(b,x,A){return""},y.prototype.docType=function(b,x,A){return""},y.prototype.comment=function(b){return this._beginLine()+this._key(this._builderOptions.convert.comment)+" "+this._val(b)},y.prototype.text=function(b){return this._beginLine()+this._key(this._builderOptions.convert.text)+" "+this._val(b)},y.prototype.instruction=function(b,x){return this._beginLine()+this._key(this._builderOptions.convert.ins)+" "+this._val(x?b+" "+x:b)},y.prototype.cdata=function(b){return this._beginLine()+this._key(this._builderOptions.convert.cdata)+" "+this._val(b)},y.prototype.attribute=function(b,x){this._additionalLevel++;var A=this._beginLine()+this._key(this._builderOptions.convert.att+b)+" "+this._val(x);return this._additionalLevel--,A},y.prototype.openTagBegin=function(b){var x=this._beginLine()+this._key(b);return this._rootWritten||(this._rootWritten=!0),this.hasData=!0,this._additionalLevel++,x+=this._beginLine(!0)+this._key(this._builderOptions.convert.text)},y.prototype.openTagEnd=function(b,x,A){return x?" "+this._val(""):""},y.prototype.closeTag=function(b){return this._additionalLevel--,""},y.prototype.beginElement=function(b){},y.prototype.endElement=function(b){},y.prototype._beginLine=function(b){return b===void 0&&(b=!1),(this.hasData?this._writerOptions.newline:"")+this._indent(this._writerOptions.offset+this.level,b)},y.prototype._indent=function(b,x){if(b+this._additionalLevel<=0)return"";var A=this._writerOptions.indent.repeat(b+this._additionalLevel);return!x&&this._rootWritten?A.substr(0,A.length-2)+"-"+A.substr(-1,1):A},y.prototype._key=function(b){return'"'+b+'":'},y.prototype._val=function(b){return JSON.stringify(b)},y}(a(114).BaseCBWriter);n.YAMLCBWriter=f},function(r,n,a){"use strict";var o,u=typeof Reflect=="object"?Reflect:null,f=u&&typeof u.apply=="function"?u.apply:function(B,Y,Q){return Function.prototype.apply.call(B,Y,Q)};o=u&&typeof u.ownKeys=="function"?u.ownKeys:Object.getOwnPropertySymbols?function(B){return Object.getOwnPropertyNames(B).concat(Object.getOwnPropertySymbols(B))}:function(B){return Object.getOwnPropertyNames(B)};var h=Number.isNaN||function(B){return B!=B};function y(){y.init.call(this)}e(y,"s"),r.exports=y,y.EventEmitter=y,y.prototype._events=void 0,y.prototype._eventsCount=0,y.prototype._maxListeners=void 0;var b=10;function x(B){if(typeof B!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}e(x,"l");function A(B){return B._maxListeners===void 0?y.defaultMaxListeners:B._maxListeners}e(A,"c");function I(B,Y,Q,ne){var de,be,Ie,We;if(x(Q),(be=B._events)===void 0?(be=B._events=Object.create(null),B._eventsCount=0):(be.newListener!==void 0&&(B.emit("newListener",Y,Q.listener?Q.listener:Q),be=B._events),Ie=be[Y]),Ie===void 0)Ie=be[Y]=Q,++B._eventsCount;else if(typeof Ie=="function"?Ie=be[Y]=ne?[Q,Ie]:[Ie,Q]:ne?Ie.unshift(Q):Ie.push(Q),(de=A(B))>0&&Ie.length>de&&!Ie.warned){Ie.warned=!0;var qe=new Error("Possible EventEmitter memory leak detected. "+Ie.length+" "+String(Y)+" listeners added. Use emitter.setMaxListeners() to increase limit");qe.name="MaxListenersExceededWarning",qe.emitter=B,qe.type=Y,qe.count=Ie.length,We=qe,console&&console.warn&&console.warn(We)}return B}e(I,"h");function w(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}e(w,"p");function W(B,Y,Q){var ne={fired:!1,wrapFn:void 0,target:B,type:Y,listener:Q},de=w.bind(ne);return de.listener=Q,ne.wrapFn=de,de}e(W,"f");function G(B,Y,Q){var ne=B._events;if(ne===void 0)return[];var de=ne[Y];return de===void 0?[]:typeof de=="function"?Q?[de.listener||de]:[de]:Q?function(be){for(var Ie=new Array(be.length),We=0;We<Ie.length;++We)Ie[We]=be[We].listener||be[We];return Ie}(de):k(de,de.length)}e(G,"d");function O(B){var Y=this._events;if(Y!==void 0){var Q=Y[B];if(typeof Q=="function")return 1;if(Q!==void 0)return Q.length}return 0}e(O,"m");function k(B,Y){for(var Q=new Array(Y),ne=0;ne<Y;++ne)Q[ne]=B[ne];return Q}e(k,"y"),Object.defineProperty(y,"defaultMaxListeners",{enumerable:!0,get:e(function(){return b},"get"),set:e(function(B){if(typeof B!="number"||B<0||h(B))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+B+".");b=B},"set")}),y.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},y.prototype.setMaxListeners=function(B){if(typeof B!="number"||B<0||h(B))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+B+".");return this._maxListeners=B,this},y.prototype.getMaxListeners=function(){return A(this)},y.prototype.emit=function(B){for(var Y=[],Q=1;Q<arguments.length;Q++)Y.push(arguments[Q]);var ne=B==="error",de=this._events;if(de!==void 0)ne=ne&&de.error===void 0;else if(!ne)return!1;if(ne){var be;if(Y.length>0&&(be=Y[0]),be instanceof Error)throw be;var Ie=new Error("Unhandled error."+(be?" ("+be.message+")":""));throw Ie.context=be,Ie}var We=de[B];if(We===void 0)return!1;if(typeof We=="function")f(We,this,Y);else{var qe=We.length,Ke=k(We,qe);for(Q=0;Q<qe;++Q)f(Ke[Q],this,Y)}return!0},y.prototype.addListener=function(B,Y){return I(this,B,Y,!1)},y.prototype.on=y.prototype.addListener,y.prototype.prependListener=function(B,Y){return I(this,B,Y,!0)},y.prototype.once=function(B,Y){return x(Y),this.on(B,W(this,B,Y)),this},y.prototype.prependOnceListener=function(B,Y){return x(Y),this.prependListener(B,W(this,B,Y)),this},y.prototype.removeListener=function(B,Y){var Q,ne,de,be,Ie;if(x(Y),(ne=this._events)===void 0)return this;if((Q=ne[B])===void 0)return this;if(Q===Y||Q.listener===Y)--this._eventsCount==0?this._events=Object.create(null):(delete ne[B],ne.removeListener&&this.emit("removeListener",B,Q.listener||Y));else if(typeof Q!="function"){for(de=-1,be=Q.length-1;be>=0;be--)if(Q[be]===Y||Q[be].listener===Y){Ie=Q[be].listener,de=be;break}if(de<0)return this;de===0?Q.shift():function(We,qe){for(;qe+1<We.length;qe++)We[qe]=We[qe+1];We.pop()}(Q,de),Q.length===1&&(ne[B]=Q[0]),ne.removeListener!==void 0&&this.emit("removeListener",B,Ie||Y)}return this},y.prototype.off=y.prototype.removeListener,y.prototype.removeAllListeners=function(B){var Y,Q,ne;if((Q=this._events)===void 0)return this;if(Q.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Q[B]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete Q[B]),this;if(arguments.length===0){var de,be=Object.keys(Q);for(ne=0;ne<be.length;++ne)(de=be[ne])!=="removeListener"&&this.removeAllListeners(de);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(Y=Q[B])=="function")this.removeListener(B,Y);else if(Y!==void 0)for(ne=Y.length-1;ne>=0;ne--)this.removeListener(B,Y[ne]);return this},y.prototype.listeners=function(B){return G(this,B,!0)},y.prototype.rawListeners=function(B){return G(this,B,!1)},y.listenerCount=function(B,Y){return typeof B.listenerCount=="function"?B.listenerCount(Y):O.call(B,Y)},y.prototype.listenerCount=O,y.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},function(r,n,a){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=a(77);n.createCB=function(u){return new o.XMLBuilderCBImpl(u)},n.fragmentCB=function(u){return new o.XMLBuilderCBImpl(u,!0)}}])})});var Wtn=yn(Pye=>{"use strict";me();ye();he();ge();Object.defineProperty(Pye,"__esModule",{value:!0});Pye.isValidXmlValue=Otn;Pye.unloadBuilder=kir;Pye.sanitizeNestedCdataTags=Ftn;Pye.recordXml=Btn;var Nir=Vht(),Rir=Wht();function Otn(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"}e(Otn,"isValidXmlValue");function kir(r){let n=(0,Nir.create)({version:"1.0"}).ele("record_update");return{xml:n,end:e(()=>n.end({prettyPrint:!0}).replaceAll("&nbsp;","&amp;nbsp;"),"end"),record:e((o,u,f="INSERT_OR_UPDATE")=>{let h=Btn(n,o,u,{attr:{action:f},context:r});return h.addSysScope(r),h},"record")}}e(kir,"unloadBuilder");function Ftn(r){return r.replace(/]]>/g,"]]]]><![CDATA[>")}e(Ftn,"sanitizeNestedCdataTags");function Btn(r,n,a,o={}){let u=r.ele(n,o.attr||{action:"INSERT_OR_UPDATE"});u.ele("sys_id",void 0).txt(`${a}`);let f=(0,Rir.maybeGetFieldToTagMap)(n,o.context?.getAllDocuments()||[]);return{fields(h){for(let[y,b]of Object.entries(h))this.field(y,b)},field(h,y,b={},x=!1){if(!Otn(y))throw new Error(`Invalid XML value for "${h}" column: ${y}`);let A,I=f[h];return h==="script"||h==="operation_script"||I==="script"||I==="html"||I==="xml"||x?(y=I==="xml"?Ftn(y):y,A=u.ele(h,b).dat(y)):A=u.ele(h,b).txt(`${y}`.replaceAll("&nbsp;","&amp;nbsp;")),{choices(w){}}},addSysScope(h){return u.ele("sys_scope",{display_value:h.app.config.scope}).txt(h.app.config.scopeId)}}}e(Btn,"recordXml")});var ztn=yn(dP=>{"use strict";me();ye();he();ge();var Lir=dP&&dP.__createBinding||(Object.create?function(r,n,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(n,a);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:e(function(){return n[a]},"get")}),Object.defineProperty(r,o,u)}:function(r,n,a,o){o===void 0&&(o=a),r[o]=n[a]}),Mir=dP&&dP.__setModuleDefault||(Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n}),jtn=dP&&dP.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var a in r)a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)&&Lir(n,r,a);return Mir(n,r),n};Object.defineProperty(dP,"__esModule",{value:!0});dP.Keys=dP.KEYS_FILE_NAME=dP.KEYS_MODULE=void 0;var rze=mp(),Oir=Ght(),ize=vWe(),D2=jtn(VS()),Fir=jtn(XC());dP.KEYS_MODULE="@servicenow/sdk/global";dP.KEYS_FILE_NAME="keys.ts";var Bir=D2.object({explicit:D2.record(D2.string().or(D2.number()),D2.object({table:D2.string(),id:D2.string()})).default({}),composite:D2.array(D2.object({table:D2.string(),id:D2.string(),key:D2.record(D2.string(),D2.string().or(D2.number()))})).default([]),deleted:D2.record(D2.array(D2.string())).default({})}),Hht=class r{static{e(this,"Keys")}file;keys;usedIds=new Set;constructor(n){this.file=r.getKeysFile(n),this.keys=r.parseKeysFile(this.file)}static parseKeysFile(n){let a=r.getOrCreateKeysInterface(n);return Bir.parse((0,Oir.parseType)(a.getType(),a,o=>{if(o.isArray())return[];throw`Unparsable type in keys.ts: ${o.getText()}`}))}static getKeysFile(n){let a=r.getKeysFilePath(n),o=n.compiler.addSourceFileAtPathIfExists(a)??n.compiler.createSourceFile(a,"",{overwrite:!0,scriptKind:rze.ts.ScriptKind.TS});return o.getImportDeclaration(u=>u.getModuleSpecifierValue()===dP.KEYS_MODULE)||o.addImportDeclaration({moduleSpecifier:dP.KEYS_MODULE}),o}static getKeysFilePath(n){return rze.path.resolve(n.app.rootDir,n.app.config.generatedDir,dP.KEYS_FILE_NAME)}static getOrCreateKeysInterface(n){let a=n.getModule("global")??n.addModule({name:"global",declarationKind:rze.ts.ModuleDeclarationKind.Global,hasDeclareKeyword:!0}),o=a.getModule("Now")??a.addModule({name:"Now",declarationKind:rze.ts.ModuleDeclarationKind.Namespace}),u=o.getModule("Internal")??o.addModule({name:"Internal"});return u.getInterface("Keys")??u.addInterface({name:"Keys",extends:e(f=>{f.write("KeysRegistry")},"extends")})}use(n){return this.usedIds.add(n),n}get explicit(){return this.keys.explicit}get composite(){return this.keys.composite}get deleted(){return this.keys.deleted}getSourceFile(){return this.file}getNextAvailableExplicitKey(){for(let n=0;;n++){let a=`generated${n}`;if(!this.explicit[a])return a}}explicitKeyExists(n){return!!this.explicit[n]}getIdUsingExplicitKey(n){return this.explicit[n]?.id}findExplicitKeyById(n){return Object.entries(this.explicit).find(([,a])=>a.id===n)?.[0]}registerExplicitId(n,a,o){if((0,ize.isGUID)(a))return this.use(this.explicit[a]?.id??a);let u=this.explicit[a];if(u)return this.use(u.id);if(o){let h=this.findExplicitKeyById(o);if(h){let y=this.explicit[h];if(h!==a)throw`ID '${o}' is already registered for key '${h}', cannot register for key '${a}'`;return this.use(y.id)}}let f={table:n,id:(0,ize.isGUID)(a)?a:o??(0,ize.GUID)()};return this.explicit[a]=f,this.use(f.id)}registerCompositeId(n,a,o){let u=this.composite.find(h=>h.table===n&&Fir.isEqual(h.key,a));if(u){if(u.table!==n)throw`Composite key ${a} is already registered for table '${u.table}', cannot register for table '${n}'`;return this.use(u.id)}let f={table:n,id:o??(0,ize.GUID)(),key:a};return this.composite.push(f),this.use(f.id)}getUsedExplicitIds(){return Object.fromEntries(Object.entries(this.explicit).filter(([,n])=>this.usedIds.has(n.id)))}getUsedCompositeIds(){return this.composite.filter(n=>this.usedIds.has(n.id))}getDeletedAndUnusedIds(){return[...Object.values(this.explicit),...this.composite,...Object.entries(this.deleted).flatMap(([n,a])=>a.map(o=>({table:n,id:o})))].filter(n=>!this.usedIds.has(n.id)).reduce((n,a)=>(n[a.table]=[...n[a.table]??[],a.id],n),{})}async format(n){await n?.(this.file)}updateSourceFile(){let n=[],a=this.getUsedExplicitIds(),o=this.getUsedCompositeIds(),u=this.getDeletedAndUnusedIds();Object.keys(a).length>0&&n.push({name:"explicit",type:JSON.stringify(a,void 0,4)}),o.length>0&&n.push({name:"composite",type:JSON.stringify(o,void 0,4)}),Object.keys(u).length>0&&n.push({name:"deleted",type:JSON.stringify(u,void 0,4)});let f=r.getOrCreateKeysInterface(this.file);f.getProperties().forEach(h=>h.remove()),f.addProperties(n)}};dP.Keys=Hht});var Utn=yn(VW=>{"use strict";me();ye();he();ge();Object.defineProperty(VW,"__esModule",{value:!0});VW.calculateCustomPathsFromDocs=VW.getIncludePaths=VW.DefaultIncludePaths=void 0;VW.replaceTemplate=Gtn;var aze=mp();VW.DefaultIncludePaths={};var Wir=e(r=>{let n=aze.path.join(r.app.rootDir,"now.includes-mapping.json"),a=r.compiler.getSourceFile(n),o="";return a?o=a.getFullText():o=aze.FileSystem.existsSync(r.fs,n)?r.fs.readFileSync(n).toString():"",o?JSON.parse(o):VW.DefaultIncludePaths},"getIncludePaths");VW.getIncludePaths=Wir;var jir=e(r=>{let n=(0,VW.getIncludePaths)(r),a=r.getAllDocuments().filter(o=>o.kind==="record").map(o=>({table:o.data?.table,guid:o.guid,data:o.data?.data})).filter(o=>n[o.table]).map(o=>({table:o.table,guid:o.guid,fields:(n[o.table]?.fields||[]).flatMap(Object.entries).map(([u,f])=>({field:u,path:Gtn(f,{sys_id:o.guid,...o.data})}))||[]})).reduce((o,u)=>(o[u.table]=o[u.table]||[],o[u.table].push(u),o),{});return Kir(a)},"calculateCustomPathsFromDocs");VW.calculateCustomPathsFromDocs=jir;function Gtn(r,n){let a=r,o=r.matchAll(/{{([a-z_]+)}}/g);for(let u of o){let[,f]=u;if(f){let h=Vir(n[f]);a=a.replaceAll(`{{${f}}}`,h)}}return a}e(Gtn,"replaceTemplate");var zir=/[/<>?\\:|*"]/g,Gir=/^\.+$/,Uir=/[. ]+$/;function Vir(r){return r.replace(zir,"_").replace(Gir,"").replace(Uir,"")}e(Vir,"sanitizeForFilesystem");function Hir(r,n){let a=aze.path.parse(r);n[r]=(n[r]||0)+1;let o=a.base.split(".");return o[0]=`${o[0]}-${n[r]}`,aze.path.join(a.dir,o.join("."))}e(Hir,"dedupeFilename");function Kir(r){let n={};for(let o in r)r[o].flatMap(f=>f.fields.map(h=>h.path)).forEach(f=>n[f]=(n[f]||0)+1);let a={};for(let o in r){let u=r[o]||[];for(let f of u)for(let h=0;h<f.fields.length;h++){let y=f.fields[h]?.path;y&&n[y]>1&&(f.fields[h].path=Hir(y,a))}}return r}e(Kir,"dedupeFilenames")});var Uh=yn(I6=>{"use strict";me();ye();he();ge();var qir=I6&&I6.__createBinding||(Object.create?function(r,n,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(n,a);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:e(function(){return n[a]},"get")}),Object.defineProperty(r,o,u)}:function(r,n,a,o){o===void 0&&(o=a),r[o]=n[a]}),Qle=I6&&I6.__exportStar||function(r,n){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(n,a)&&qir(n,r,a)};Object.defineProperty(I6,"__esModule",{value:!0});Qle(xht(),I6);Qle(Ght(),I6);Qle(Wtn(),I6);Qle(Aht(),I6);Qle(vWe(),I6);Qle(ztn(),I6);Qle(Utn(),I6)});var oze=yn(Kht=>{"use strict";me();ye();he();ge();Object.defineProperty(Kht,"__esModule",{value:!0});Kht.getLabelDiagnostics=$ir;var Vtn=Uh(),Jir=XC(),Htn=mp();function $ir(r){let n=[],a=r.getProperty("label")?.getValue();if(a&&(0,Jir.isArray)(a)){let o={};a.forEach((u,f)=>{let h=u.language;o[h]!==void 0&&n.push(new Vtn.FluentDiagnostic(r.getProperty("label").getNode().getChildrenOfKind(210)[f]?.getProperty("language")??r.getProperty("label").getNode(),"'language' must be unique per table/column",{level:Htn.Diagnostic.Level.Error})),o[h]=f,(h===""||h&&h.length!==2)&&n.push(new Vtn.FluentDiagnostic(r.getProperty("label").getNode().getChildrenOfKind(210)[f]?.getProperty("language")??r.getProperty("label").getNode(),"'language' must be a 2 character identifier (Ex. 'en', 'es')",{level:Htn.Diagnostic.Level.Error}))})}return n}e($ir,"getLabelDiagnostics")});var qtn=yn(wd=>{"use strict";me();ye();he();ge();var Xir=wd&&wd.__createBinding||(Object.create?function(r,n,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(n,a);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:e(function(){return n[a]},"get")}),Object.defineProperty(r,o,u)}:function(r,n,a,o){o===void 0&&(o=a),r[o]=n[a]}),Yir=wd&&wd.__setModuleDefault||(Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n}),Qir=wd&&wd.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var a in r)a!=="default"&&Object.prototype.hasOwnProperty.call(r,a)&&Xir(n,r,a);return Yir(n,r),n};Object.defineProperty(wd,"__esModule",{value:!0});wd.GenericColumnPlugin=wd.OtherDateColumnPlugin=wd.ScheduleDateTimeColumnPlugin=wd.IntegerDateColumnPlugin=wd.DueDateColumnPlugin=wd.BasicDateTimeColumnPlugin=wd.CalendarDateTimeColumnPlugin=wd.DateTimeColumnPlugin=wd.DateColumnPlugin=wd.FieldNameColumnPlugin=wd.VersionColumnPlugin=wd.UserRolesColumnPlugin=wd.TranslatedTextColumnPlugin=wd.TranslatedFieldColumnPlugin=wd.TableNameColumnPlugin=wd.SystemClassNameColumnPlugin=wd.ScriptColumnPlugin=wd.RadioColumnPlugin=wd.ReferenceColumnPlugin=wd.ListColumnPlugin=wd.DomainPathColumnPlugin=wd.DomainIdColumnPlugin=wd.DocumentIdColumnPlugin=wd.DecimalColumnPlugin=wd.ChoiceColumnPlugin=wd.ConditionsColumnPlugin=wd.BasicImageColumnPlugin=wd.IntegerColumnPlugin=wd.BooleanColumnPlugin=wd.StringColumnPlugin=void 0;var pb=Qir(mc()),sze=Uh(),Zir=oze(),Ktn=["add","coalesce","concat","datediff","dayofweek","distance_sphere","divide","greatest","least","length","multiply","position","substring","subtract"],ear=new RegExp(`^glidefunction:(${Ktn.join("|")})[(].*?[)]$`,"g");function _b(r,n){return(0,sze.Plugin)({name:`${n}Column`,extractors:{raw:{fluent:{CallExpression(a,o){let u=(0,sze.extractCallExpression)(r,`${n}_column`,a,o,()=>"NO_GUID_GENERATED");if(!u.handled||!u.data)return u;let f=u.data,h=u.diagnostics;h.push(...(0,Zir.getLabelDiagnostics)(f));let y=f.getProperty("function_definition")?.getValue();return y&&(typeof y!="string"||!y.match(ear))&&h.push(new sze.FluentDiagnostic(a,`'function_definition' must start with 'glidefunction:' and include a single function call to a predefined function:
31105
31105
  ${Ktn.join(`
31106
31106
  `)}`)),{handled:!0,diagnostics:h,data:sze.ObjectData.fromObjectValue({...f.getValue(),entityKind:n},f.getNode())}}}}}})}e(_b,"ColumnPlugin");wd.StringColumnPlugin=_b(pb.StringColumn,"string");wd.BooleanColumnPlugin=_b(pb.BooleanColumn,"boolean");wd.IntegerColumnPlugin=_b(pb.IntegerColumn,"integer");wd.BasicImageColumnPlugin=_b(pb.BasicImageColumn,"image");wd.ConditionsColumnPlugin=_b(pb.ConditionsColumn,"conditions");wd.ChoiceColumnPlugin=_b(pb.ChoiceColumn,"choice");wd.DecimalColumnPlugin=_b(pb.DecimalColumn,"decimal");wd.DocumentIdColumnPlugin=_b(pb.DocumentIdColumn,"document_id");wd.DomainIdColumnPlugin=_b(pb.DomainIdColumn,"domain_id");wd.DomainPathColumnPlugin=_b(pb.DomainPathColumn,"domain_path");wd.ListColumnPlugin=_b(pb.ListColumn,"glide_list");wd.ReferenceColumnPlugin=_b(pb.ReferenceColumn,"reference");wd.RadioColumnPlugin=_b(pb.RadioColumn,"radio");wd.ScriptColumnPlugin=_b(pb.ScriptColumn,"script");wd.SystemClassNameColumnPlugin=_b(pb.SystemClassNameColumn,"sys_class_name");wd.TableNameColumnPlugin=_b(pb.TableNameColumn,"table_name");wd.TranslatedFieldColumnPlugin=_b(pb.TranslatedFieldColumn,"translated_field");wd.TranslatedTextColumnPlugin=_b(pb.TranslatedTextColumn,"translated_text");wd.UserRolesColumnPlugin=_b(pb.UserRolesColumn,"user_roles");wd.VersionColumnPlugin=_b(pb.VersionColumn,"version");wd.FieldNameColumnPlugin=_b(pb.FieldNameColumn,"field_name");wd.DateColumnPlugin=_b(pb.DateColumn,"glide_date");wd.DateTimeColumnPlugin=_b(pb.DateTimeColumn,"glide_date_time");wd.CalendarDateTimeColumnPlugin=_b(pb.CalendarDateTimeColumn,"calendar_date_time");wd.BasicDateTimeColumnPlugin=_b(pb.BasicDateTimeColumn,"datetime");wd.DueDateColumnPlugin=_b(pb.DueDateColumn,"due_date");wd.IntegerDateColumnPlugin=_b(pb.IntegerDateColumn,"integer_date");wd.ScheduleDateTimeColumnPlugin=_b(pb.ScheduleDateTimeColumn,"schedule_date_time");wd.OtherDateColumnPlugin=_b(pb.OtherDateColumn,"date");wd.GenericColumnPlugin=_b(pb.GenericColumn,"generic")});var Nye=yn(qht=>{"use strict";me();ye();he();ge();Object.defineProperty(qht,"__esModule",{value:!0});qht.except=tar;function tar(r,n){return Object.keys(r).filter(a=>!n(a)).reduce((a,o)=>({...a,[o]:r[o]}),{})}e(tar,"except")});var cze=yn(lze=>{"use strict";me();ye();he();ge();Object.defineProperty(lze,"__esModule",{value:!0});lze.fieldHasNowIncludeCallExpression=iar;var HW=mp(),A2=Uh(),y$=mp(),nar=mc();lze.default=(0,A2.Plugin)({name:"Include",extractors:{raw:{fluent:{CallExpression(r,n){if(!(0,A2.isNowIncludeCall)(r))return{handled:!1};let a=r.getArguments(),o=a[0]?.isKind(HW.ts.SyntaxKind.StringLiteral);if(a[0]&&!o)return{handled:!0,diagnostics:[new A2.FluentDiagnostic(a[0],"Invalid argument, String literal expected")],data:new A2.StringData("",r)};let u=a[0]?.asKind(HW.ts.SyntaxKind.StringLiteral)?.getLiteralText();if(!u)return{handled:!0,diagnostics:[new A2.FluentDiagnostic(a[0],"File path cannot be empty")],data:new A2.StringData("",r)};let f=y$.path.dirname(r.getSourceFile().getFilePath()),h=y$.path.resolve(f,u);if(!HW.FileSystem.existsSync(n.fs,h))return{handled:!0,diagnostics:[new A2.FluentDiagnostic(a[0],"File not found")],data:new A2.StringData("",r)};let y=y$.path.resolve(n.app.rootDir);return y$.path.relative(y,h).startsWith("..")?{handled:!0,diagnostics:[new A2.FluentDiagnostic(a[0],"File not within project")],data:new A2.StringData("",r)}:{handled:!0,diagnostics:[],data:new A2.StringData(n.fs.readFileSync(h).toString(),r,{needsCDATA:!0})}}}}},transformers:{record:{CallExpression(r,n){if(r.action==="DELETE")return!1;let{table:a}=r.data,[o]=r.node.getArguments();if(!HW.ts.Node.isObjectLiteralExpression(o)||!r.changedData)return!1;let u=r.node.getSourceFile().getDirectory().getPath();if(o.getDescendantsOfKind(HW.ts.SyntaxKind.CallExpression).filter(A2.isNowIncludeCall).map(x=>({field:x.getParentIfKind(HW.ts.SyntaxKind.PropertyAssignment)?.getName(),path:x?.getArguments()[0]?.asKind(HW.ts.SyntaxKind.StringLiteral)?.getLiteralText()})).filter(x=>x.field&&x.path).forEach(x=>{let A=r.changedData.data?.[x.field];if(A){let I=y$.path.resolve(u,x.path);Jtn(n.compiler,I,A)}}),!(0,A2.getIncludePaths)(n)[a])return!1;let h;(0,A2.getCallExpressionName)(r.node)!==nar.Record.name?h=o:h=(0,A2.getOrCreatePropertyAssignment)(o,"data","{}").getInitializer();let y=(0,A2.calculateCustomPathsFromDocs)(n)[a]?.find(x=>x.guid===r.guid)?.fields||[],b=rar(y.map(x=>x.field),h);for(let x of y){let A=r.changedData.data?.[x.field];if(typeof A!="string")continue;if(y$.path.parse(x.path).base!==x.path){n.logger.error(`Custom include name for table ${a} and field ${x.field} must be for filename only. Record ${r.guid}.`);continue}if(!b[x.field]){let w=y$.path.resolve(n.app.rootDir,n.app.config.generatedDir,x.path),W=y$.path.relative(u,w);(0,A2.addCallExpressionToProperty)(h,x.field,`Now.include('${W}')`),Jtn(n.compiler,w,A)}}return!1}}}});function Jtn(r,n,a){let o=y$.path.parse(n).dir;r.getDirectory(o)||r.addDirectoryAtPath(o,{recursive:!0}),r.createSourceFile(n,a,{overwrite:!0,scriptKind:HW.FluentScriptKinds.IncludeFile})}e(Jtn,"writeScriptToFile");function rar(r,n){return r.map(a=>({[a]:n.getProperty(a)?.asKind(HW.ts.SyntaxKind.PropertyAssignment)})).reduce((a,o)=>({...a,...o}),{})}e(rar,"getScriptFieldPropertyAssignments");function iar(r,n){let a=r.getProperty(n)?.asKind(HW.ts.SyntaxKind.PropertyAssignment)?.getInitializerIfKind(HW.ts.SyntaxKind.CallExpression);return!!a&&(0,A2.isNowIncludeCall)(a)}e(iar,"fieldHasNowIncludeCallExpression")});var P6=yn(iw=>{"use strict";me();ye();he();ge();Object.defineProperty(iw,"__esModule",{value:!0});iw.RecordPlugin=iw.RecordXmlSchema=iw.TextNumberSchema=iw.TextBooleanSchema=iw.TextStringSchema=iw.RecordEntitySchema=void 0;iw.getOutputDirectoryForDocument=$tn;iw.propertyAssignmentIsInlineScript=_ar;iw.extractCallExpressionAsRecord=mar;var uze=mc(),TA=Uh(),f_=VS(),X5=mp(),aar=Nye(),oar=cze();iw.RecordEntitySchema=f_.z.object({$id:f_.z.string().or(f_.z.number()),data:f_.z.record(f_.z.any()),table:f_.z.string()});var sar=f_.z.object({record_update:f_.z.record(f_.z.any())}),lar=f_.z.object({"@_table":f_.z.string()});iw.TextStringSchema=f_.z.object({"#text":f_.z.string()}).transform(r=>r["#text"]);iw.TextBooleanSchema=f_.z.object({"#text":f_.z.boolean()}).transform(r=>r["#text"]);iw.TextNumberSchema=f_.z.object({"#text":f_.z.number().or(f_.z.literal(""))}).transform(r=>r["#text"]);var car=["sys_created_by","sys_created_on","sys_updated_by","sys_updated_on","sys_mod_count","sys_class_name","sys_id","sys_package","sys_policy","sys_scope","sys_update_name"],uar=["sys_translated_text","sys_es_latest_script"];iw.RecordXmlSchema=f_.z.object({"@_action":f_.z.union([f_.z.literal("INSERT_OR_UPDATE"),f_.z.literal("DELETE"),f_.z.literal("delete_multiple")]),sys_id:f_.z.object({"#text":f_.z.string().min(32).max(32).or(f_.z.number().transform(r=>r.toString()))})}).catchall(f_.z.intersection(f_.z.object({"#text":f_.z.union([f_.z.string(),f_.z.boolean(),f_.z.number(),f_.z.undefined()])}),f_.z.record(f_.z.any())));var dar=f_.z.object({data:f_.z.record(f_.z.union([f_.z.string(),f_.z.number(),f_.z.boolean(),f_.z.undefined(),f_.z.null()])),table:f_.z.string()}),far=f_.z.union([f_.z.literal("update"),f_.z.literal("dictionary"),f_.z.literal("scope"),f_.z.literal("demo"),f_.z.literal("first install")]).default("update").transform(r=>r==="demo"?"unload.demo":r==="first install"?"unload":r);function $tn(r,n){return n==="sys_app"?"scope":far.parse(r.directory)}e($tn,"getOutputDirectoryForDocument");function par(r){return uar.forEach(n=>delete r[n]),r}e(par,"cleanRecordUpdate");function _ar(r){return r.getInitializerIfKind(X5.ts.SyntaxKind.StringLiteral)||r.getInitializerIfKind(X5.ts.SyntaxKind.TaggedTemplateExpression)||r.getInitializerIfKind(X5.ts.SyntaxKind.TemplateExpression)||r.getInitializerIfKind(X5.ts.SyntaxKind.NoSubstitutionTemplateLiteral)}e(_ar,"propertyAssignmentIsInlineScript");iw.RecordPlugin=(0,TA.Plugin)({name:"Record",extractors:{entity:{fluent:{CallExpression:e((r,n)=>{let a=(0,TA.extractCallExpression)(uze.Record,"record",r,n,y=>"sys_id"in y.data?y.data.sys_id:(0,TA.isGUID)(y.$id)?y.$id:n.keys.registerExplicitId(y.table,y.$id),y=>iw.RecordEntitySchema.safeParse(y).success);if(!a.handled||!a.data)return a;let o=a.data,u=a.diagnostics,f=o.getProperty("table").getValue(),h=n.getPluginForTable(f);if(h){let{logLevel:y,api:b}=h,x=r.getFirstChildByKindOrThrow(X5.ts.SyntaxKind.ObjectLiteralExpression).getPropertyOrThrow("table");u.push(new TA.FluentDiagnostic(x,`${f} should not be created by the Record API. Please use the ${b} API.`,{level:y}))}if(f==="sys_ui_view"){let y=o.getProperty("data").getProperty("name")?.getValue(),x=r.getFirstChildByKindOrThrow(X5.ts.SyntaxKind.ObjectLiteralExpression).getPropertyOrThrow("data").asKindOrThrow(X5.ts.SyntaxKind.PropertyAssignment).getInitializerIfKind(X5.ts.SyntaxKind.ObjectLiteralExpression)?.getPropertyOrThrow("name"),A=new RegExp("^[a-zA-Z0-9_]+$");(typeof y!="string"||!y.match(A))&&u.push(new TA.FluentDiagnostic(x,"View name can only contain alphanumeric characters"))}return{handled:!0,diagnostics:u,data:o}},"CallExpression")}},xml(r){let n=sar.safeParse(r.data);if(!n.success)return;let a=par(n.data.record_update),o,u,f=lar.safeParse(a);if(f.success?(u=f.data["@_table"],o=a[f.data["@_table"]]):(u=Object.keys(a)[0],o=a[u]),!(!o||!iw.RecordXmlSchema.safeParse(o).success)&&!(o["@_action"]!=="DELETE"&&Object.keys(a).some(y=>y!==u&&!y.startsWith("@_"))))try{let{"@_action":y,sys_id:{"#text":b},...x}=o,A=Object.entries(x).reduce((I,[w,W])=>(I[w]=W?W["#text"]:void 0,I),{});return new TA.XmlData({id:b,table:u,data:A},r.filePath,"record",y)}catch{return}}},composers:{entity:{record(r,n){let a=r.getProperty("$id");!TA.Data.isString(a)&&!TA.Data.isNumber(a)&&Promise.reject("Record ID must be a string or number");let o=r.getProperty("table");TA.Data.isString(o)||Promise.reject("Record table must be a string");let u=r.getProperty("data");TA.Data.isObject(u)||Promise.reject("Record data must be an object");let f=r.getProperty("data","object")?.getProperties(),h=[];return f&&h.push(...Object.entries(f).reduce((y,[b,x])=>(TA.Data.isString(x)&&x.needsCDATATag()&&y.push(b),y),[])),Promise.resolve({kind:"record",guid:r.getGuid(),node:r.getNode(),directory:r.getInstallMethod(),cdataFields:h,data:{$id:a.getValue(),table:o.getValue(),data:u.getValue()}})}},xml:{record(r){let n=r.data.table,a=r.data.id;return{action:r.action,guid:a,kind:"record",data:{table:n,data:r.data.data}}}}},serializers:{record(r,n){let a=r.cdataFields,{table:o,data:u}=dar.parse(r.data),f=(0,TA.unloadBuilder)(n),h=f.record(o,r.guid,r.action);return Object.entries(u).filter(([y,b])=>typeof b<"u"&&y!=="sys_id").forEach(([y,b])=>{a&&a.includes(y)?h.field(y,b,{},!0):h.field(y,b)}),{name:`${o}_${r.guid}.xml`,directory:$tn(r,o),content:f.end()}}},generators:{record(r,n){return(0,TA.linkDocument)(r,(0,TA.generateCallExpressionExportForDocument)(n,{sourceFile:(0,TA.getOrCreateEntitySourceFile)(n,`${r.data?.table}_${r.guid}`),moduleSpecifier:"@servicenow/sdk/core"},uze.Record,{$id:r.guid}).getExpressionIfKindOrThrow(X5.ts.SyntaxKind.CallExpression))}},transformers:{record:{CallExpression(r,n){if((0,TA.getCallExpressionName)(r.node)!==uze.Record.name)return!1;if(r.action==="DELETE")return(0,TA.removeNode)(r.node),!0;if(!r.changedData)return!1;let[a]=r.node.getArguments();if(!X5.ts.Node.isObjectLiteralExpression(a))return!1;let{table:o}=r.data,u=r.changedData.data,f=Object.keys(u).reduce((y,b)=>(car.includes(b)||u[b]!==""&&u[b]!==void 0&&(y[b]=u[b]),y),{}),h=a.getProperty("data")?.asKind(X5.ts.SyntaxKind.PropertyAssignment)?.getInitializerIfKind(X5.ts.SyntaxKind.ObjectLiteralExpression);return(0,TA.transformFunctionArguments)(r.node,uze.Record,{table:o,data:(0,aar.except)(f,y=>!!h&&(0,oar.fieldHasNowIncludeCallExpression)(h,y))}),n.argTypesToFix.push(r.node),!0}}}});function mar(r,n,a,o,u){let f=(0,TA.extractCallExpression)(r,"record",o,u,a);return f.handled?{handled:!0,diagnostics:f.diagnostics,data:f.data?new TA.EntityData("record",f.data.getGuid(),n(f.data),o,f.data.getInstallMethod(),f.data.getExplicitIds()):void 0}:f}e(mar,"extractCallExpressionAsRecord")});var Ytn=yn((_yi,Xtn)=>{"use strict";me();ye();he();ge();Xtn.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Jht=yn((vyi,Ztn)=>{me();ye();he();ge();var ECe=Ytn(),Qtn={};for(let r of Object.keys(ECe))Qtn[ECe[r]]=r;var Pf={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Ztn.exports=Pf;for(let r of Object.keys(Pf)){if(!("channels"in Pf[r]))throw new Error("missing channels property: "+r);if(!("labels"in Pf[r]))throw new Error("missing channel labels property: "+r);if(Pf[r].labels.length!==Pf[r].channels)throw new Error("channel and label counts mismatch: "+r);let{channels:n,labels:a}=Pf[r];delete Pf[r].channels,delete Pf[r].labels,Object.defineProperty(Pf[r],"channels",{value:n}),Object.defineProperty(Pf[r],"labels",{value:a})}Pf.rgb.hsl=function(r){let n=r[0]/255,a=r[1]/255,o=r[2]/255,u=Math.min(n,a,o),f=Math.max(n,a,o),h=f-u,y,b;f===u?y=0:n===f?y=(a-o)/h:a===f?y=2+(o-n)/h:o===f&&(y=4+(n-a)/h),y=Math.min(y*60,360),y<0&&(y+=360);let x=(u+f)/2;return f===u?b=0:x<=.5?b=h/(f+u):b=h/(2-f-u),[y,b*100,x*100]};Pf.rgb.hsv=function(r){let n,a,o,u,f,h=r[0]/255,y=r[1]/255,b=r[2]/255,x=Math.max(h,y,b),A=x-Math.min(h,y,b),I=e(function(w){return(x-w)/6/A+1/2},"diffc");return A===0?(u=0,f=0):(f=A/x,n=I(h),a=I(y),o=I(b),h===x?u=o-a:y===x?u=1/3+n-o:b===x&&(u=2/3+a-n),u<0?u+=1:u>1&&(u-=1)),[u*360,f*100,x*100]};Pf.rgb.hwb=function(r){let n=r[0],a=r[1],o=r[2],u=Pf.rgb.hsl(r)[0],f=1/255*Math.min(n,Math.min(a,o));return o=1-1/255*Math.max(n,Math.max(a,o)),[u,f*100,o*100]};Pf.rgb.cmyk=function(r){let n=r[0]/255,a=r[1]/255,o=r[2]/255,u=Math.min(1-n,1-a,1-o),f=(1-n-u)/(1-u)||0,h=(1-a-u)/(1-u)||0,y=(1-o-u)/(1-u)||0;return[f*100,h*100,y*100,u*100]};function har(r,n){return(r[0]-n[0])**2+(r[1]-n[1])**2+(r[2]-n[2])**2}e(har,"comparativeDistance");Pf.rgb.keyword=function(r){let n=Qtn[r];if(n)return n;let a=1/0,o;for(let u of Object.keys(ECe)){let f=ECe[u],h=har(r,f);h<a&&(a=h,o=u)}return o};Pf.keyword.rgb=function(r){return ECe[r]};Pf.rgb.xyz=function(r){let n=r[0]/255,a=r[1]/255,o=r[2]/255;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92;let u=n*.4124+a*.3576+o*.1805,f=n*.2126+a*.7152+o*.0722,h=n*.0193+a*.1192+o*.9505;return[u*100,f*100,h*100]};Pf.rgb.lab=function(r){let n=Pf.rgb.xyz(r),a=n[0],o=n[1],u=n[2];a/=95.047,o/=100,u/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;let f=116*o-16,h=500*(a-o),y=200*(o-u);return[f,h,y]};Pf.hsl.rgb=function(r){let n=r[0]/360,a=r[1]/100,o=r[2]/100,u,f,h;if(a===0)return h=o*255,[h,h,h];o<.5?u=o*(1+a):u=o+a-o*a;let y=2*o-u,b=[0,0,0];for(let x=0;x<3;x++)f=n+1/3*-(x-1),f<0&&f++,f>1&&f--,6*f<1?h=y+(u-y)*6*f:2*f<1?h=u:3*f<2?h=y+(u-y)*(2/3-f)*6:h=y,b[x]=h*255;return b};Pf.hsl.hsv=function(r){let n=r[0],a=r[1]/100,o=r[2]/100,u=a,f=Math.max(o,.01);o*=2,a*=o<=1?o:2-o,u*=f<=1?f:2-f;let h=(o+a)/2,y=o===0?2*u/(f+u):2*a/(o+a);return[n,y*100,h*100]};Pf.hsv.rgb=function(r){let n=r[0]/60,a=r[1]/100,o=r[2]/100,u=Math.floor(n)%6,f=n-Math.floor(n),h=255*o*(1-a),y=255*o*(1-a*f),b=255*o*(1-a*(1-f));switch(o*=255,u){case 0:return[o,b,h];case 1:return[y,o,h];case 2:return[h,o,b];case 3:return[h,y,o];case 4:return[b,h,o];case 5:return[o,h,y]}};Pf.hsv.hsl=function(r){let n=r[0],a=r[1]/100,o=r[2]/100,u=Math.max(o,.01),f,h;h=(2-a)*o;let y=(2-a)*u;return f=a*u,f/=y<=1?y:2-y,f=f||0,h/=2,[n,f*100,h*100]};Pf.hwb.rgb=function(r){let n=r[0]/360,a=r[1]/100,o=r[2]/100,u=a+o,f;u>1&&(a/=u,o/=u);let h=Math.floor(6*n),y=1-o;f=6*n-h,h&1&&(f=1-f);let b=a+f*(y-a),x,A,I;switch(h){default:case 6:case 0:x=y,A=b,I=a;break;case 1:x=b,A=y,I=a;break;case 2:x=a,A=y,I=b;break;case 3:x=a,A=b,I=y;break;case 4:x=b,A=a,I=y;break;case 5:x=y,A=a,I=b;break}return[x*255,A*255,I*255]};Pf.cmyk.rgb=function(r){let n=r[0]/100,a=r[1]/100,o=r[2]/100,u=r[3]/100,f=1-Math.min(1,n*(1-u)+u),h=1-Math.min(1,a*(1-u)+u),y=1-Math.min(1,o*(1-u)+u);return[f*255,h*255,y*255]};Pf.xyz.rgb=function(r){let n=r[0]/100,a=r[1]/100,o=r[2]/100,u,f,h;return u=n*3.2406+a*-1.5372+o*-.4986,f=n*-.9689+a*1.8758+o*.0415,h=n*.0557+a*-.204+o*1.057,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,f=f>.0031308?1.055*f**(1/2.4)-.055:f*12.92,h=h>.0031308?1.055*h**(1/2.4)-.055:h*12.92,u=Math.min(Math.max(0,u),1),f=Math.min(Math.max(0,f),1),h=Math.min(Math.max(0,h),1),[u*255,f*255,h*255]};Pf.xyz.lab=function(r){let n=r[0],a=r[1],o=r[2];n/=95.047,a/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let u=116*a-16,f=500*(n-a),h=200*(a-o);return[u,f,h]};Pf.lab.xyz=function(r){let n=r[0],a=r[1],o=r[2],u,f,h;f=(n+16)/116,u=a/500+f,h=f-o/200;let y=f**3,b=u**3,x=h**3;return f=y>.008856?y:(f-16/116)/7.787,u=b>.008856?b:(u-16/116)/7.787,h=x>.008856?x:(h-16/116)/7.787,u*=95.047,f*=100,h*=108.883,[u,f,h]};Pf.lab.lch=function(r){let n=r[0],a=r[1],o=r[2],u;u=Math.atan2(o,a)*360/2/Math.PI,u<0&&(u+=360);let h=Math.sqrt(a*a+o*o);return[n,h,u]};Pf.lch.lab=function(r){let n=r[0],a=r[1],u=r[2]/360*2*Math.PI,f=a*Math.cos(u),h=a*Math.sin(u);return[n,f,h]};Pf.rgb.ansi16=function(r,n=null){let[a,o,u]=r,f=n===null?Pf.rgb.hsv(r)[2]:n;if(f=Math.round(f/50),f===0)return 30;let h=30+(Math.round(u/255)<<2|Math.round(o/255)<<1|Math.round(a/255));return f===2&&(h+=60),h};Pf.hsv.ansi16=function(r){return Pf.rgb.ansi16(Pf.hsv.rgb(r),r[2])};Pf.rgb.ansi256=function(r){let n=r[0],a=r[1],o=r[2];return n===a&&a===o?n<8?16:n>248?231:Math.round((n-8)/247*24)+232:16+36*Math.round(n/255*5)+6*Math.round(a/255*5)+Math.round(o/255*5)};Pf.ansi16.rgb=function(r){let n=r%10;if(n===0||n===7)return r>50&&(n+=3.5),n=n/10.5*255,[n,n,n];let a=(~~(r>50)+1)*.5,o=(n&1)*a*255,u=(n>>1&1)*a*255,f=(n>>2&1)*a*255;return[o,u,f]};Pf.ansi256.rgb=function(r){if(r>=232){let f=(r-232)*10+8;return[f,f,f]}r-=16;let n,a=Math.floor(r/36)/5*255,o=Math.floor((n=r%36)/6)/5*255,u=n%6/5*255;return[a,o,u]};Pf.rgb.hex=function(r){let a=(((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255)).toString(16).toUpperCase();return"000000".substring(a.length)+a};Pf.hex.rgb=function(r){let n=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n)return[0,0,0];let a=n[0];n[0].length===3&&(a=a.split("").map(y=>y+y).join(""));let o=parseInt(a,16),u=o>>16&255,f=o>>8&255,h=o&255;return[u,f,h]};Pf.rgb.hcg=function(r){let n=r[0]/255,a=r[1]/255,o=r[2]/255,u=Math.max(Math.max(n,a),o),f=Math.min(Math.min(n,a),o),h=u-f,y,b;return h<1?y=f/(1-h):y=0,h<=0?b=0:u===n?b=(a-o)/h%6:u===a?b=2+(o-n)/h:b=4+(n-a)/h,b/=6,b%=1,[b*360,h*100,y*100]};Pf.hsl.hcg=function(r){let n=r[1]/100,a=r[2]/100,o=a<.5?2*n*a:2*n*(1-a),u=0;return o<1&&(u=(a-.5*o)/(1-o)),[r[0],o*100,u*100]};Pf.hsv.hcg=function(r){let n=r[1]/100,a=r[2]/100,o=n*a,u=0;return o<1&&(u=(a-o)/(1-o)),[r[0],o*100,u*100]};Pf.hcg.rgb=function(r){let n=r[0]/360,a=r[1]/100,o=r[2]/100;if(a===0)return[o*255,o*255,o*255];let u=[0,0,0],f=n%1*6,h=f%1,y=1-h,b=0;switch(Math.floor(f)){case 0:u[0]=1,u[1]=h,u[2]=0;break;case 1:u[0]=y,u[1]=1,u[2]=0;break;case 2:u[0]=0,u[1]=1,u[2]=h;break;case 3:u[0]=0,u[1]=y,u[2]=1;break;case 4:u[0]=h,u[1]=0,u[2]=1;break;default:u[0]=1,u[1]=0,u[2]=y}return b=(1-a)*o,[(a*u[0]+b)*255,(a*u[1]+b)*255,(a*u[2]+b)*255]};Pf.hcg.hsv=function(r){let n=r[1]/100,a=r[2]/100,o=n+a*(1-n),u=0;return o>0&&(u=n/o),[r[0],u*100,o*100]};Pf.hcg.hsl=function(r){let n=r[1]/100,o=r[2]/100*(1-n)+.5*n,u=0;return o>0&&o<.5?u=n/(2*o):o>=.5&&o<1&&(u=n/(2*(1-o))),[r[0],u*100,o*100]};Pf.hcg.hwb=function(r){let n=r[1]/100,a=r[2]/100,o=n+a*(1-n);return[r[0],(o-n)*100,(1-o)*100]};Pf.hwb.hcg=function(r){let n=r[1]/100,o=1-r[2]/100,u=o-n,f=0;return u<1&&(f=(o-u)/(1-u)),[r[0],u*100,f*100]};Pf.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};Pf.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};Pf.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};Pf.gray.hsl=function(r){return[0,0,r[0]]};Pf.gray.hsv=Pf.gray.hsl;Pf.gray.hwb=function(r){return[0,100,r[0]]};Pf.gray.cmyk=function(r){return[0,0,0,r[0]]};Pf.gray.lab=function(r){return[r[0],0,0]};Pf.gray.hex=function(r){let n=Math.round(r[0]/100*255)&255,o=((n<<16)+(n<<8)+n).toString(16).toUpperCase();return"000000".substring(o.length)+o};Pf.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]}});var tnn=yn((Dyi,enn)=>{me();ye();he();ge();var dze=Jht();function gar(){let r={},n=Object.keys(dze);for(let a=n.length,o=0;o<a;o++)r[n[o]]={distance:-1,parent:null};return r}e(gar,"buildGraph");function yar(r){let n=gar(),a=[r];for(n[r].distance=0;a.length;){let o=a.pop(),u=Object.keys(dze[o]);for(let f=u.length,h=0;h<f;h++){let y=u[h],b=n[y];b.distance===-1&&(b.distance=n[o].distance+1,b.parent=o,a.unshift(y))}}return n}e(yar,"deriveBFS");function bar(r,n){return function(a){return n(r(a))}}e(bar,"link");function Sar(r,n){let a=[n[r].parent,r],o=dze[n[r].parent][r],u=n[r].parent;for(;n[u].parent;)a.unshift(n[u].parent),o=bar(dze[n[u].parent][u],o),u=n[u].parent;return o.conversion=a,o}e(Sar,"wrapConversion");enn.exports=function(r){let n=yar(r),a={},o=Object.keys(n);for(let u=o.length,f=0;f<u;f++){let h=o[f];n[h].parent!==null&&(a[h]=Sar(h,n))}return a}});var rnn=yn((Nyi,nnn)=>{me();ye();he();ge();var $ht=Jht(),Ear=tnn(),Rye={},xar=Object.keys($ht);function Tar(r){let n=e(function(...a){let o=a[0];return o==null?o:(o.length>1&&(a=o),r(a))},"wrappedFn");return"conversion"in r&&(n.conversion=r.conversion),n}e(Tar,"wrapRaw");function Dar(r){let n=e(function(...a){let o=a[0];if(o==null)return o;o.length>1&&(a=o);let u=r(a);if(typeof u=="object")for(let f=u.length,h=0;h<f;h++)u[h]=Math.round(u[h]);return u},"wrappedFn");return"conversion"in r&&(n.conversion=r.conversion),n}e(Dar,"wrapRounded");xar.forEach(r=>{Rye[r]={},Object.defineProperty(Rye[r],"channels",{value:$ht[r].channels}),Object.defineProperty(Rye[r],"labels",{value:$ht[r].labels});let n=Ear(r);Object.keys(n).forEach(o=>{let u=n[o];Rye[r][o]=Dar(u),Rye[r][o].raw=Tar(u)})});nnn.exports=Rye});var cnn=yn((Fyi,lnn)=>{"use strict";me();ye();he();ge();var inn=e((r,n)=>(...a)=>`\x1B[${r(...a)+n}m`,"wrapAnsi16"),ann=e((r,n)=>(...a)=>{let o=r(...a);return`\x1B[${38+n};5;${o}m`},"wrapAnsi256"),onn=e((r,n)=>(...a)=>{let o=r(...a);return`\x1B[${38+n};2;${o[0]};${o[1]};${o[2]}m`},"wrapAnsi16m"),fze=e(r=>r,"ansi2ansi"),snn=e((r,n,a)=>[r,n,a],"rgb2rgb"),kye=e((r,n,a)=>{Object.defineProperty(r,n,{get:e(()=>{let o=a();return Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0}),o},"get"),enumerable:!0,configurable:!0})},"setLazyProperty"),Xht,Lye=e((r,n,a,o)=>{Xht===void 0&&(Xht=rnn());let u=o?10:0,f={};for(let[h,y]of Object.entries(Xht)){let b=h==="ansi16"?"ansi":h;h===n?f[b]=r(a,u):typeof y=="object"&&(f[b]=r(y[n],u))}return f},"makeDynamicStyles");function Aar(){let r=new Map,n={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};n.color.gray=n.color.blackBright,n.bgColor.bgGray=n.bgColor.bgBlackBright,n.color.grey=n.color.blackBright,n.bgColor.bgGrey=n.bgColor.bgBlackBright;for(let[a,o]of Object.entries(n)){for(let[u,f]of Object.entries(o))n[u]={open:`\x1B[${f[0]}m`,close:`\x1B[${f[1]}m`},o[u]=n[u],r.set(f[0],f[1]);Object.defineProperty(n,a,{value:o,enumerable:!1})}return Object.defineProperty(n,"codes",{value:r,enumerable:!1}),n.color.close="\x1B[39m",n.bgColor.close="\x1B[49m",kye(n.color,"ansi",()=>Lye(inn,"ansi16",fze,!1)),kye(n.color,"ansi256",()=>Lye(ann,"ansi256",fze,!1)),kye(n.color,"ansi16m",()=>Lye(onn,"rgb",snn,!1)),kye(n.bgColor,"ansi",()=>Lye(inn,"ansi16",fze,!0)),kye(n.bgColor,"ansi256",()=>Lye(ann,"ansi256",fze,!0)),kye(n.bgColor,"ansi16m",()=>Lye(onn,"rgb",snn,!0)),n}e(Aar,"assembleStyles");Object.defineProperty(lnn,"exports",{enumerable:!0,get:Aar})});var dnn=yn((Uyi,unn)=>{"use strict";me();ye();he();ge();unn.exports={stdout:!1,stderr:!1}});var pnn=yn((Jyi,fnn)=>{"use strict";me();ye();he();ge();var Car=e((r,n,a)=>{let o=r.indexOf(n);if(o===-1)return r;let u=n.length,f=0,h="";do h+=r.substr(f,o-f)+n+a,f=o+u,o=r.indexOf(n,f);while(o!==-1);return h+=r.substr(f),h},"stringReplaceAll"),war=e((r,n,a,o)=>{let u=0,f="";do{let h=r[o-1]==="\r";f+=r.substr(u,(h?o-1:o)-u)+n+(h?`\r
31107
31107
  `:`
@@ -48259,7 +48259,7 @@ ${a(o)};`}};Nce.ModuleFunctionData=wwe;function byr(r,n){let{modulePaths:a}=n.ap
48259
48259
  <external_source>true</external_source>
48260
48260
  <content><![CDATA[${Oln(f)}]]></content>
48261
48261
  </sys_module>
48262
- </record_update>`}}}})});var hbt=yn(Nve=>{"use strict";me();ye();he();ge();Object.defineProperty(Nve,"__esModule",{value:!0});Nve.getDefaultMaxLength=Zln;Nve.generateColumnExpression=rvr;Nve.createObjectExpression=mbt;var Nm=mc(),Mp=Uh(),Cyr=Vht(),aw=XC(),la=VS(),_y=P6(),Ym=mp(),wyr=oze(),Iyr=Rce(),Pve=["none","tracking","restricted"],Pyr=la.z.object({name:la.z.string(),schema:la.z.record(la.z.record(la.z.any())).default({}),extends:la.z.string().optional(),label:la.z.string().or(la.z.array(la.z.any())).optional(),display:la.z.string().optional(),extensible:la.z.boolean().optional().default(!1),live_feed:la.z.boolean().optional().default(!1),auto_number:la.z.object({prefix:la.z.string().default("pre").optional(),number:la.z.number().default(1e3).optional(),number_of_digits:la.z.number().default(7).optional()}).optional(),accessible_from:la.z.union([la.z.literal("package_private"),la.z.literal("public")]).optional().default("public"),caller_access:la.z.enum(Pve).optional(),actions:la.z.array(la.z.union([la.z.literal("read"),la.z.literal("update"),la.z.literal("delete"),la.z.literal("create")])).optional(),allow_web_service_access:la.z.boolean().optional().default(!1),allow_new_fields:la.z.boolean().optional().default(!1),allow_ui_actions:la.z.boolean().optional().default(!1),allow_client_scripts:la.z.boolean().optional().default(!1),audit:la.z.boolean().optional().default(!1),read_only:la.z.boolean().optional().default(!1),text_index:la.z.boolean().optional().default(!1),attributes:la.z.record(la.z.union([la.z.string(),la.z.number(),la.z.boolean()])).optional(),index:la.z.array(la.z.object({name:la.z.string(),unique:la.z.boolean(),element:la.z.string().or(la.z.array(la.z.string())).transform(r=>(0,aw.isArray)(r)?r:[r])})).optional(),licensing_config:la.z.record(la.z.any()).optional(),scriptable_table:la.z.boolean().default(!1)}),Nyr=["sys_dictionary","sys_choice","sys_documentation","ua_table_licensing_config"],Ryr=la.z.object({entityKind:la.z.string().optional(),column_type:la.z.string().optional(),audit:la.z.boolean().optional().default(!1),label:la.z.string().or(la.z.array(la.z.any())).optional(),maxLength:la.z.number().optional(),mandatory:la.z.boolean().optional().default(!1),read_only:la.z.boolean().optional().default(!1),default:la.z.any().optional(),attributes:la.z.record(la.z.string(),la.z.union([la.z.string(),la.z.boolean(),la.z.number()])).optional(),referenceTable:la.z.string().optional(),cascadeRule:la.z.string().optional(),dropdown:la.z.enum(Nm.choiceDropdown).default("none").optional(),choices:la.z.record(la.z.any()).or(la.z.array(la.z.any())).optional(),choice_elements:la.z.record(la.z.any()).or(la.z.array(la.z.any())).optional(),display:la.z.boolean().default(!1).optional(),function_definition:la.z.string().optional(),dynamic_value_definitions:la.z.object({type:la.z.union([la.z.literal("dynamic_default"),la.z.literal("choices_from_other_table"),la.z.literal("calculated_value"),la.z.literal("dependent_field")])}).and(la.z.any()).optional(),plural:la.z.string().optional(),hint:la.z.string().optional(),help:la.z.string().optional(),widget:la.z.string().optional(),table_reference:la.z.boolean().optional(),reference_floats:la.z.boolean().optional(),dynamic_creation:la.z.boolean().optional(),dynamic_creation_script:la.z.string().optional(),element_reference:la.z.boolean().optional(),spell_check:la.z.boolean().optional(),xml_view:la.z.boolean().optional(),array:la.z.boolean().optional(),text_index:la.z.boolean().optional(),primary:la.z.boolean().optional(),unique:la.z.boolean().optional(),reference_key:la.z.string().optional(),reference_qual:la.z.string().optional()}),Rm=la.z.string().transform(r=>r==="true").or(la.z.boolean()).optional(),Kln=la.z.string().transform(r=>(0,aw.parseInt)(r)).or(la.z.number()).optional(),qln=la.z.object({name:_y.TextStringSchema.or(la.z.string()).optional(),read_access:_y.TextBooleanSchema.or(Rm).optional(),create_access:_y.TextBooleanSchema.or(Rm).optional(),update_access:_y.TextBooleanSchema.or(Rm).optional(),delete_access:_y.TextBooleanSchema.or(Rm).optional(),ws_access:_y.TextBooleanSchema.or(Rm).optional(),caller_access:_y.TextNumberSchema.or(Kln).transform(r=>{if(r)return Pve[r]}).optional(),alter_access:_y.TextBooleanSchema.or(Rm).optional(),client_scripts_access:_y.TextBooleanSchema.or(Rm).optional(),actions_access:_y.TextBooleanSchema.or(Rm).optional(),is_extendable:_y.TextBooleanSchema.or(Rm).optional(),access:_y.TextStringSchema.or(la.z.string()).optional(),scriptable_table:_y.TextBooleanSchema.or(Rm).optional()}),kyr=la.z.object({name:la.z.string(),extends:la.z.string().optional(),label:la.z.string().or(la.z.array(la.z.any())).optional(),extensible:la.z.boolean().optional().default(!1),live_feed:la.z.boolean().optional().default(!1),auto_number:la.z.object({prefix:la.z.string().default("pre").optional(),number:la.z.number().default(1e3).optional(),number_of_digits:la.z.number().default(7).optional()}).optional(),number_ref:la.z.any().optional(),accessible_from:la.z.union([la.z.literal("public"),la.z.literal("package_private")]).optional().default("public"),caller_access:la.z.enum(Pve).default("none").optional(),actions:la.z.array(la.z.union([la.z.literal("read"),la.z.literal("update"),la.z.literal("delete"),la.z.literal("create")])).default(["read"]).optional(),allow_web_service_access:la.z.boolean().optional().default(!0),allow_new_fields:la.z.boolean().optional().default(!1),allow_ui_actions:la.z.boolean().optional().default(!1),allow_client_scripts:la.z.boolean().optional().default(!1),audit:la.z.boolean().optional().default(!1),read_only:la.z.boolean().optional().default(!1),text_index:la.z.boolean().optional().default(!1),scriptable_table:la.z.boolean().optional().default(!1),attributes:la.z.record(la.z.union([la.z.string(),la.z.number(),la.z.boolean()])).default({}).optional()}),Jln=kyr.omit({actions:!0}).extend({caller_access:la.z.union([la.z.literal(0),la.z.literal(1),la.z.literal(2)]).transform(r=>{if(r)return Pve[r]}).optional(),accessible_from:la.z.union([la.z.literal("public"),la.z.literal("package_private")]).optional(),extends:la.z.string().or(la.z.object({name:la.z.string()}).transform(r=>r.name)).optional(),live_feed:la.z.boolean().optional().default(!1),index:la.z.any().optional(),columns:la.z.any().optional()}),Lyr=la.z.object({element:la.z.record(la.z.any())}),Myr=la.z.object({"@_table":la.z.literal("sys_db_object"),sys_db_object:la.z.record(la.z.any())}),Oyr=la.z.object({sys_documentation:la.z.object({element:_y.TextStringSchema.optional(),label:_y.TextStringSchema.optional(),language:_y.TextStringSchema.optional(),hint:_y.TextStringSchema.optional(),help:_y.TextStringSchema.optional(),name:_y.TextStringSchema.optional(),plural:_y.TextStringSchema.optional(),sys_id:_y.TextStringSchema.optional(),url:_y.TextStringSchema.optional(),url_target:_y.TextStringSchema.optional()})}),Fyr=la.z.object({ua_table_licensing_config:la.z.object({name:_y.TextStringSchema.optional(),op_insert:_y.TextBooleanSchema.optional(),op_update:_y.TextBooleanSchema.optional(),op_delete:_y.TextBooleanSchema.optional(),is_fulfillment:_y.TextBooleanSchema.optional(),license_model:_y.TextStringSchema.optional(),owner_condition:_y.TextStringSchema.optional(),license_condition:_y.TextStringSchema.optional(),license_roles:_y.TextStringSchema.optional()})}),$ln=la.z.object({"@_name":la.z.string(),"@_extends":la.z.string().optional(),"@_label":la.z.string().optional(),"@_max_length":la.z.any().optional(),"@_audit":Rm,"@_read_only":Rm,"@_text_index":Rm,"@_client_scripts_access":Rm,"@_ws_access":Rm,"@_alter_access":Rm,"@_create_access":Rm,"@_delete_access":Rm,"@_update_access":Rm,"@_query_access":Rm,"@_actions_access":Rm,"@_read_access":Rm,"@_is_extendable":Rm,"@_caller_access":Kln,"@_scriptable_table":Rm,"@_attributes":la.z.string().transform(r=>{let n={};return r===""?void 0:(r.split(",").forEach(o=>{let u=o.split("=");if(u.length===2&&u[0]&&u[1])try{n[u[0]]=JSON.parse(u[1])}catch{n[u[0]]=u[1]}}),n)}).optional()}).catchall(la.z.any()),Byr=la.z.object({sys_dictionary:la.z.object({"@_action":la.z.union([la.z.literal("INSERT_OR_UPDATE"),la.z.literal("DELETE"),la.z.literal("delete_multiple")]),sys_id:la.z.object({"#text":la.z.string().min(32).max(32).or(la.z.number())}).transform(r=>r["#text"]).optional(),"@_element":la.z.string(),"@_table":la.z.string()}).catchall(la.z.object({"#text":la.z.union([la.z.string(),la.z.boolean(),la.z.number(),la.z.undefined()])}).transform(r=>r["#text"]))}),Wyr=la.z.object({"@_name":la.z.string(),"@_unique":Rm,element:la.z.object({"@_name":la.z.string()}).or(la.z.array(la.z.object({"@_name":la.z.string()})))}),jyr=$ln.omit({"@_extends":!0}).extend({"@_choice":la.z.coerce.number().optional(),"@_active":Rm,"@_mandatory":Rm,"@_display":Rm,"@_type":la.z.string().optional(),"@_use_dependent_field":Rm,"@_use_dynamic_default":Rm,"@_reference":la.z.string().optional(),"@_virtual":Rm,"@_default":la.z.string().optional(),"@_calculation":la.z.string().optional(),"@_choice_field":la.z.string().optional(),"@_function_definition":la.z.string().optional(),"@_reference_floats":Rm,"@_reference_key":la.z.string().optional(),"@_dynamic_creation_script":la.z.string().optional(),"@_dynamic_creation":Rm,"@_plural":la.z.string().optional(),"@_hint":la.z.string().optional(),"@_help":la.z.string().optional(),"@_widget":la.z.string().optional(),"@_table_reference":Rm,"@_element_reference":Rm,"@_unique":Rm,"@_spell_check":Rm,"@_xml_view":Rm,"@_array":Rm,"@_text_index":Rm,"@_primary":Rm,"@_reference_qual":la.z.string().optional(),choice:la.z.object({element:la.z.array(la.z.any()).or(la.z.record(la.z.any())).optional()}).optional(),"@_attributes":la.z.string().transform(r=>{let n={};return r===""?void 0:(r.split(",").forEach(o=>{let u=o.split("=");if(u.length===2&&u[0]&&u[1])try{n[u[0]]=JSON.parse(u[1])}catch{n[u[0]]=u[1]}}),n)}).optional()}).catchall(la.z.any()),Xln=la.z.object({label:la.z.string().optional(),value:la.z.string().optional(),sequence:la.z.coerce.number().optional(),dependent_value:la.z.coerce.number().or(la.z.string()).optional(),hint:la.z.string().optional(),inactive:Rm.default(!1).optional(),inactive_on_update:Rm.default(!1).optional(),language:la.z.string().optional()}),zyr=Xln.omit({value:!0});function Gyr(r,n,a){return{kind:"ua_table_licensing_config",guid:`${r}_license`,data:{table:"ua_table_licensing_config",$id:r,data:{name:r,op_insert:n.op_insert??!0,op_update:n.op_update??!0,op_delete:n.op_delete??!0,is_fulfillment:n.is_fulfillment??!1,license_model:n.license_model??"none",owner_condition:n.owner_condition??"",license_condition:n.license_condition??"",license_roles:n.license_roles?n.license_roles.join(","):""}},node:a}}e(Gyr,"composeLicenseConfig");var Wln=new RegExp("^[a-z_][a-z0-9_]*[a-z0-9]$");Nve.default=(0,Mp.Plugin)({name:"Table",ownedTables:{sys_db_object:{diagnosticLevel:Ym.Diagnostic.Level.Warn}},extractors:{entity:{fluent:{CallExpression:e((r,n)=>{let a=(0,Mp.extractCallExpression)(Nm.Table,"table",r,n,O=>O.name);if(!a.handled||!a.data)return a;let o=a.data,u=a.diagnostics,f=n.app.config.scope,h=new RegExp(`^${f}_`),y=new RegExp("^[a-z_][a-z0-9_]*$"),b=o.getProperty("name"),x=b.getValue().match(h),A=!1;b.getValue().match(Wln)||u.push(new Mp.FluentDiagnostic(b.getNode(),"Table name must only contain lowercase letters, numbers, and underscores and end with a letter or number")),x||(b.getNode().asKindOrThrow(Ym.ts.SyntaxKind.StringLiteral).getParent().getKindName()!=="AsExpression"?u.push(new Mp.FluentDiagnostic(b.getNode(),`'name' property must start with scope prefix '${f}'`)):A=!0);let I=o.getProperty("schema"),w=I.getNode().asKindOrThrow(Ym.ts.SyntaxKind.ObjectLiteralExpression);for(let O in I.getValue()){let k=w.getPropertyOrThrow(O);!A&&!x&&!(0,Mp.isSNScope)(f)&&!O.match(h)&&u.push(new Mp.FluentDiagnostic(k,`Column name must be prefixed with scope '${f}' if table name does not contain prefix`)),O.match(y)||u.push(new Mp.FluentDiagnostic(k,"Column name must only contain lowercase letters, numbers, and underscores"))}let W=r.getParentIfKind(Ym.ts.SyntaxKind.VariableDeclaration);return(!W||!W.isExported()||!W.isNamedExport()||W.getName()!==b.getValue())&&u.push(new Mp.FluentDiagnostic(r,`Table definition should be exported as a named export with the name '${b.getValue()}'`,{level:Ym.Diagnostic.Level.Warn})),u.push(...(0,wyr.getLabelDiagnostics)(o)),{handled:!0,data:new Mp.EntityData("table",b.getValue(),new Mp.ObjectData(o.getProperties(),o.getNode()),o.getNode(),o.getInstallMethod(),[b.getValue()]),diagnostics:u}},"CallExpression")}},xml(r,n){let a={},o={},u=Lyr.safeParse(r.data.database);if(u.success){let b=$ln.parse(u.data.element);Object.entries(b).forEach(([x,A])=>{x.startsWith("@_")?a[x.substring(2)]=A:x==="element"||(a[x]=A)}),n.updateHandledXMLs(r.filePath,"handled")}let f=Myr.safeParse(r.data.record_update);if(f.success)return o=qln.parse(f.data.sys_db_object),n.updateHandledXMLs(r.filePath,"handled"),new Mp.XmlData(o,r.filePath,"sys_db_object",f.data.sys_db_object["@_action"]);if(!u.success){let b=r.data.record_update;if(b){let x=Object.keys(b)[0];if(!x||!Nyr.includes(x))return;if(x==="sys_documentation"){let I=Oyr.parse(b[x]).sys_documentation;return new Mp.XmlData({table:x,id:b[x][x].sys_id?.["#text"]??(0,Mp.GUID)(),data:I},r.filePath,"sys_documentation",b[x]["@_action"])}if(x==="ua_table_licensing_config"){let I=Fyr.parse(b).ua_table_licensing_config;return new Mp.XmlData({table:x,id:b[x].sys_id?.["#text"]??(0,Mp.GUID)(),data:I},r.filePath,"ua_table_licensing_config",b[x]["@_action"])}let A=Byr.safeParse(b);if(A.success){let{"@_action":I,"@_element":w,"@_table":W,sys_id:G,...O}=A.data.sys_dictionary;return new Mp.XmlData({table:x,id:G??`${O.name}_${O.element!==""?O.element:"_null"}`,data:O},r.filePath,"sys_dictionary",I)}n.updateHandledXMLs(r.filePath,"ignored");return}}let h=[],y=[];if(u.success&&u.data.element.element){let b=u.data.element.element,x=(0,aw.isArray)(b)?b:[b];h.push(...la.z.array(jyr).parse(x)),h.forEach(I=>{I.choice&&!(0,aw.isEmpty)(I.choice)&&(I.choice_elements={},((0,aw.isArray)(I.choice.element)?I.choice.element:[I.choice.element]).forEach(W=>{let G=Vln(W),O=zyr.parse(G);O.label||(O.label=G.value),I.choice_elements[G.value]=O})),I=Vln(I)}),a.columns=h.reduce((I,w)=>(I[w.name]=w,I),{});let A=u.data.element.index;A=(0,aw.isArray)(A)?A:[A],A.forEach(I=>{let w=Wyr.safeParse(I);w.success&&y.push({name:w.data["@_name"],element:(0,aw.isArray)(w.data.element)?w.data.element.reduce((W,G)=>(W.push(G["@_name"]),W),[]):w.data.element["@_name"],unique:w.data["@_unique"]??!1})}),a.index=y}return new Mp.XmlData(a,r.filePath,"bootstrap")}},composers:{entity:{async table(r,n){let a=r.getNode(),o=r.getValue(),u=Pyr.parse(o),f=qyr(u),{columnData:h,documentation:y}=Kyr(u.schema,n,u.name,u.display);f.columns=h;let b=[];if(u.auto_number){let A=u.auto_number,I=nvr(u.name,A.number_of_digits,A.number,A.prefix),w=await _y.RecordPlugin.composers.entity.record(new Mp.EntityData("record",n.registerExplicitId(I.table,I.$id),Mp.ObjectData.fromObjectValue(I,a),a),n);b.push(w),f.number_ref=w.guid}return y.forEach(A=>{b.push({kind:"sys_documentation",node:a,data:A,guid:A.$id})}),Yln("",u.name,u.label).forEach(A=>{b.push({kind:"sys_documentation",node:a,data:A,guid:A.$id})}),f.index=u.index,u.licensing_config&&b.push(Gyr(f.name,u.licensing_config,a)),b.push({kind:"bootstrap",node:a,guid:f.name,data:{data:{bootstrapData:f,dbObjectData:f}}}),b}},xml:{bootstrap(r){return{kind:r.kind,guid:r.data.name,data:{data:{bootstrapData:r.data}}}},sys_db_object(r){return{kind:"bootstrap",guid:`${r.data.name}`,data:{data:{dbObjectData:r.data}},action:r.action}},sys_dictionary(r){let n=r.data.data;return{kind:"sys_dictionary",guid:r.data.id??`${n.name}_${n.element!==""?n.element:"_null"}`,data:r.data,action:r.action}}}},arrangers:{bootstrap(r){return{handled:!1}},sys_dictionary(r){if(r.data.table!=="sys_dictionary")return{handled:!1};let n=r.data.data.name;return{handled:!0,result:n?{kind:"bootstrap",guid:n}:void 0}}},generators:{bootstrap(r,n){let a=Jln.safeParse(r.data.data.bootstrapData);if(a.success)return(0,Mp.linkDocument)(r,Yyr(n,{sourceFile:(0,Mp.getOrCreateEntitySourceFile)(n,a.data.name),moduleSpecifier:"@servicenow/sdk/core",exportName:a.data.name},Nm.Table,{}).getInitializerIfKindOrThrow(Ym.ts.SyntaxKind.CallExpression))},sys_dictionary(r,n,a){let o=r.data.data,u=o.sys_update_name,f=a.find(h=>h.guid===o.name);return f&&f.node?{...r,node:f.node}:(0,Mp.linkDocument)(r,(0,Mp.generateCallExpressionExportForDocument)(n,{sourceFile:(0,Mp.getOrCreateEntitySourceFile)(n,u??`sys_dictionary_${r.guid}`),moduleSpecifier:"@servicenow/sdk/core"},Nm.Record,{$id:r.guid}).getExpressionIfKindOrThrow(Ym.ts.SyntaxKind.CallExpression))},record(r,n){if(!(r.data?.table!=="sys_documentation"&&r.data?.table!=="ua_table_licensing_config"))return(0,Mp.linkDocument)(r,(0,Mp.generateCallExpression)(n,(0,Mp.getOrCreateEntitySourceFile)(n,`${r.data?.data.name}`),"@servicenow/sdk/core",Nm.Record,{$id:r.guid}))}},serializers:{bootstrap(r){let n=r.data.data,{columns:a,index:o,attributes:u,...f}=n.bootstrapData;f.live_feed&&(u.live_feed=!0);let h=(0,Cyr.create)({version:"1.0"}).ele("database"),y=jln(u),b=h.ele("element",{...f,attributes:y});for(let x of Object.values(a)){let{choice_elements:A,attributes:I,...w}=x,W=jln(I),G=b.ele("element",{...w,attributes:W});evr(x,G)}return Zyr(o,b),{name:`${f.name}.xml`,directory:"dictionary",content:h.end({prettyPrint:!0}),usedIds:[]}},sys_dictionary(r){}},transformers:{bootstrap:{CallExpression(r,n){return Uyr(r,n)}},sys_dictionary:{CallExpression(r,n){return(0,Mp.getCallExpressionName)(r.node)!==Nm.Table.name?_y.RecordPlugin.transformers.record.CallExpression(r,n):(n.logger.info(`Deferring handling of sys_dictionary '${r.guid}' values to values in bootstrap.xml '${r.parent.guid}'`),!0)}}},postProcessors:{entities(r,n){let{interfaces:a,properties:o,imports:u,namedImports:f}={interfaces:[],properties:[],imports:{},namedImports:[]},h=n.compiler.getGeneratedTableFile();r.filter(y=>y.getKind()==="table").forEach(y=>{let b=y.getProperty("name").getValue(),x=y.getProperty("extends")?.getValue();if(b&&b.trim().length>0&&b.match(Wln)){if(n.compiler.interfaceExistsInGlobalDeclaration(b)||a.push({name:b,extends:[`Helper<typeof ${b}>`]}),!n.compiler.propertyExistsInGlobalDeclaration(b)){let W=`Table<TableSchemas.${b}>`;x&&(W=`Table<TableSchemas.${b}, "${x}">`),o.push({name:b,type:W})}let A=y.getNode().getSourceFile().getFilePath(),I=h?.getRelativePathAsModuleSpecifierTo(A),w=n.compiler.importExistsInGlobalDeclaration(I);w?w?.getNamedImports().find(G=>G.getName()===b)||f.push({existingImport:w,name:b}):u[A]?u[A].namedImports.push(b):u[A]={namedImports:[b],moduleSpecifier:I}}}),n.compiler.addTableInterfacesToGlobalDeclaration({interfaces:a,properties:o,imports:u,namedImports:f})}}});function Uyr(r,n){if((0,Mp.getCallExpressionName)(r.node)!==Nm.Table.name)return!1;let[o]=r.node.getArguments();if(!Ym.ts.Node.isObjectLiteralExpression(o))return!1;if(r.action==="DELETE")return(0,Mp.removeNode)(r.node),!0;if(!r.changedData)return!0;let u=r.changedData.data,f=r.xmlData.data,h={},y={};(0,aw.isEmpty)(u.bootstrapData)||(h=Jln.partial().parse(u.bootstrapData)),(0,aw.isEmpty)(u.dbObjectData)||(y=qln.partial().parse(u.dbObjectData));let{auto_number:b,number_ref:x,extends:A,index:I,columns:w,...W}=Gln(h),{create_access:G,delete_access:O,update_access:k,read_access:B,caller_access:Y,...Q}=Gln(y),ne={...W,...Q};A&&(ne.extends=A),Y&&(ne.caller_access=Pve[Y]),(0,aw.isEmpty)(y)||(ne.actions=Qyr(f.dbObjectData)),ne.attributes||delete ne.attributes,(0,Mp.transformFunctionArguments)(r.node,Nm.Table,ne);let de=f.bootstrapData?f.bootstrapData.columns:void 0;return Hyr(r.node,w,de),Jyr(w,de,o,n),Vyr(f,o),!0}e(Uyr,"transformTable");function Vyr(r,n){if(r.bootstrapData?.index?.length>0){let a=(0,Mp.getPropertyAssignment)(n,"index");a?(0,Mp.mergeDataIntoObjectLiteralArray)(a.getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.ArrayLiteralExpression),Object.values(r.bootstrapData?.index),"name"):(0,Mp.getOrCreatePropertyAssignment)(n,"index","[]").setInitializer((0,Mp.stringify)(r.bootstrapData.index))}else if(r.bootstrapData){let a=(0,Mp.getPropertyAssignment)(n,"index");a&&a.remove()}}e(Vyr,"transformIndexes");function jln(r){return r?Object.entries(r).map(([n,a])=>`${n}=${a}`).join(","):""}e(jln,"composeAttributes");function Hyr(r,n,a){if(Object.values(n??{}).filter(u=>u.display)){let u=Object.values(a??{}).find(f=>f.display);u&&(0,Mp.transformFunctionArguments)(r,Nm.Table,{display:u.name})}}e(Hyr,"updateDisplayValue");function Yln(r,n,a){let o=[];return!a||!(0,aw.isArray)(a)||a.forEach(u=>{let f=u.label??r!==""?r:n;o.push((0,Nm.Record)({table:"sys_documentation",$id:`${n}_${r?r+"_":""}${u.language}`,data:{label:f,element:r,name:n,...u}}))}),o}e(Yln,"composeDocumentation");function Qln(r){if(!(!r||(0,aw.isArray)(r)))return r}e(Qln,"getLabel");function Zln(r){switch(r.entityKind){case"conditions":case"glide_list":return 4e3;case"decimal":return 20;case"domain_id":case"document_id":case"reference":return 32;case"domain_path":case"user_roles":return 255;case"script":return 8e3;case"table_name":case"field_name":return 80;default:return 40}}e(Zln,"getDefaultMaxLength");function Kyr(r,n,a,o){let u={},f=[];for(let[h,y]of Object.entries(r)){let{maxLength:b,...x}=y,A=Ryr.parse(x),I=A.dynamic_value_definitions||A.choices,w={name:h,type:A.entityKind==="generic"?A.column_type:A.entityKind,attributes:A.attributes??void 0,reference:A.referenceTable,reference_cascade_rule:A.referenceTable?A.cascadeRule:void 0,audit:A.audit,label:Qln(A.label)??h,max_length:b??Zln(A),mandatory:A.mandatory,read_only:A.read_only,choice:Nm.choiceDropdown.indexOf(A.dropdown??(I?"dropdown_with_none":"none")),display:o?o===h:!1,virtual:A.dynamic_value_definitions?.type==="calculated_value"?!0:void 0,calculation:A.dynamic_value_definitions?.type==="calculated_value"?Iyr.ModuleFunctionData.getGlueCode(A.dynamic_value_definitions.calculated_value,W=>`${W}(current)`):void 0,choice_table:A.dynamic_value_definitions?.type==="choices_from_other_table"?A.dynamic_value_definitions.table:void 0,choice_field:A.dynamic_value_definitions?.type==="choices_from_other_table"?A.dynamic_value_definitions.field:void 0,use_dependent_field:A.dynamic_value_definitions?.type==="dependent_field"||void 0,dependent:A.dynamic_value_definitions?.type==="dependent_field"?A.dynamic_value_definitions.column_name:void 0,default:A.default,function_definition:A.function_definition,function_field:!!A.function_definition,plural:A.plural,hint:A.hint,help:A.help,widget:A.widget,table_reference:A.table_reference,element_reference:A.element_reference,reference_key:A.reference_key,spell_check:A.spell_check,xml_view:A.xml_view,reference_floats:A.reference_floats,dynamic_creation:A.dynamic_creation,dynamic_creation_script:A.dynamic_creation_script,array:A.array,text_index:A.text_index,primary:A.primary,unique:A.unique,reference_qual:A.reference_qual};f.push(...Yln(h,a,A.label)),A.choices&&(Object.keys(A.choices).forEach(W=>{(0,aw.isObject)(A.choices[W])?A.choices[W]={value:W,...A.choices[W]}:A.choices[W]={value:W,label:A.choices[W]}}),w.choice_elements=la.z.record(Xln).parse(A.choices)),u[h]=w}return{columnData:u,documentation:f}}e(Kyr,"composeColumns");function qyr(r){return r.live_feed&&(r.attributes={...r.attributes,live_feed:!0}),{name:r.name,type:"collection",extends:r.extends,label:Qln(r.label)??r.name,is_extendable:r.extensible,text_index:r.text_index,read_only:r.read_only,audit:r.audit,access:r.accessible_from,caller_access:Pve.indexOf(r.caller_access??"none"),read_access:r.actions?.includes("read"),update_access:r.actions?.includes("update"),create_access:r.actions?.includes("create"),delete_access:r.actions?.includes("delete"),ws_access:r.allow_web_service_access,alter_access:r.allow_new_fields,actions_access:r.allow_ui_actions,client_scripts_access:r.allow_client_scripts,scriptable_table:r.scriptable_table,attributes:r.attributes}}e(qyr,"compose");var zln={client_scripts_access:"allow_client_scripts",alter_access:"allow_new_fields",actions_access:"allow_ui_actions",ws_access:"allow_web_service_access",is_extendable:"extensible",access:"accessible_from",live_feed_enabled:"live_feed"};function Gln(r){return Object.keys(r).forEach(n=>{zln[n]&&(r[zln[n]]=r[n],delete r[n])}),r}e(Gln,"mapNames");function Jyr(r,n,a,o){let u=(0,Mp.getOrCreatePropertyAssignment)(a,"schema","{}");if(!n)return;let f=u.getChildrenOfKind(Ym.ts.SyntaxKind.ObjectLiteralExpression)[0];if(!f)return;let h={};f.getProperties().forEach(y=>{let b=y.asKindOrThrow(Ym.ts.SyntaxKind.PropertyAssignment),x=b.getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.Identifier).getText(),A=b.getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.CallExpression),I=A.getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.Identifier).getText(),w=A.getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.ObjectLiteralExpression);h[x]={node:b,type:I,objectLiteral:w},n[x]||(0,Mp.removeNode)(b)}),!(!r||(0,aw.isEmpty)(r))&&Object.keys(n).forEach(y=>{let b=r[y];if(h[y]){let x=h[y];if(b)if(b.type&&x.type!==b.type){(0,Mp.removeNode)(x.node);let A=Hln(b.type);Uln(f,A.name,n[y],o)}else{let A=ecn(b,x.type);(0,Mp.mergeDataIntoObjectLiteral)(x.objectLiteral,{...A,choices:b.choice_elements})}x.node&&!x.node.wasForgotten()&&($yr(x,n[y]),Xyr(x,n[y]))}else{let x=Hln(b.type);Uln(f,x.name,b,o)}})}e(Jyr,"transformColumns");function $yr(r,n){let a=r.objectLiteral.getProperties().reduce((f,h)=>({...f,[(0,Mp.getObjectPropertyAssignmentName)(h)]:h}),{});if(!a.choices)return;if(!n.choice_elements){(0,Mp.removeNode)(a.choices);return}let o=Object.keys(n.choice_elements),u=a.choices.getFirstChildByKind(Ym.ts.SyntaxKind.ObjectLiteralExpression).getProperties().reduce((f,h)=>({...f,[(0,Mp.getObjectPropertyAssignmentName)(h)]:h}),{});Object.keys(u).forEach(f=>{o.includes(f)||(0,Mp.removeNode)(u[f])})}e($yr,"removeChoicesIfNecessary");function Xyr(r,n){let a=r.objectLiteral.getProperties().reduce((u,f)=>({...u,[(0,Mp.getObjectPropertyAssignmentName)(f)]:f}),{});if(!a.attributes)return;if(!n.attributes){(0,Mp.removeNode)(a.attributes);return}let o=a.attributes.getFirstChildByKind(Ym.ts.SyntaxKind.ObjectLiteralExpression).getProperties().reduce((u,f)=>({...u,[(0,Mp.getObjectPropertyAssignmentName)(f)]:f}),{});Object.keys(o).forEach(u=>{u in n.attributes||(0,Mp.removeNode)(o[u])})}e(Xyr,"removeAttributesIfNecessary");function Yyr(r,n,a,...o){let{sourceFile:u,moduleSpecifier:f}=n;return(0,Mp.generateCallExpressionExport)(r,u,f,n.exportName,a,...o)}e(Yyr,"generateNamedCallExpressionExportForDocument");function Uln(r,n,a,o){let f=r.addPropertyAssignment({name:a.name,initializer:`${n}({})`}).getInitializer().getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.ObjectLiteralExpression),h=ecn(a,n);(0,Mp.mergeDataIntoObjectLiteral)(f,{...h,choices:a.choice_elements}),(0,Mp.addNamedImportIfAbsent)(o,r.getSourceFile(),"@servicenow/sdk/core",{name:n})}e(Uln,"createNewColumn");function Qyr(r){let n=[];return r.read_access&&n.push("read"),r.update_access&&n.push("update"),r.delete_access&&n.push("delete"),r.create_access&&n.push("create"),n}e(Qyr,"getActionsArray");function Zyr(r=[],n){r.forEach(a=>{let o=n.ele("index",{name:a.name,unique:a.unique});(0,aw.isArray)(a.element)?a.element.forEach(u=>{o.ele("element",{name:u})}):o.ele("element",{name:a.element})})}e(Zyr,"buildIndexes");function evr(r,n){if(!r.choice_elements)return;let a=n.ele("choice");if(Array.isArray(r.choices)&&r.choices.length>0)for(let o in r.choices)a.ele("element",{value:r.choices[o],label:r.choices[o]});else Object.entries(r.choice_elements).forEach(o=>{(0,aw.isObject)(o[1])?a.ele("element",{value:o[0],...o[1]}):a.ele("element",{value:o[1],label:o[0]})})}e(evr,"buildChoices");function ecn(r,n){let{type:a,choice:o,name:u,virtual:f,display:h,choice_table:y,choice_field:b,use_dependent_field:x,dependent:A,calculation:I,use_dynamic_default:w,default_value:W,choice_elements:G,table:O,default:k,max_length:B,reference:Y,reference_cascade_rule:Q,function_field:ne,reference_qual_condition:de,...be}=r;return B!==void 0&&(be.maxLength=(0,aw.parseInt)(B,10)),a&&n==="GenericColumn"&&(be.column_type=a),o!==void 0&&(be.dropdown=Nm.choiceDropdown[o]),Y&&(be.referenceTable=Y),Q&&(be.cascadeRule=Q),I?be.dynamic_value_definitions={type:"calculated_value",calculated_value:I}:y||b?be.dynamic_value_definitions={type:"choices_from_other_table",table:y,field:b}:A?be.dynamic_value_definitions={type:"dependent_field",column_name:A}:k?be.default=k:W&&(be.default=W),be.label&&be.label===u&&delete be.label,((0,aw.isEmpty)(be.attributes)||tvr(be.attributes))&&delete be.attributes,be}e(ecn,"transformColumnData");function tvr(r){return r&&Object.entries(r).length===1&&r.edge_encryption_enabled!==void 0&&r.edge_encryption_enabled}e(tvr,"isDefaultEdgeEncryptionAttribute");function Vln(r){return Object.entries(r).forEach(([n,a])=>{n.startsWith("@_")&&(r[n.substring(2)]=a,delete r[n])}),r}e(Vln,"removeAttributeTag");function nvr(r,n,a,o){return(0,Nm.Record)({table:"sys_number",$id:`${r}_${o}`,data:{category:r,maximum_digits:n??1e3,number:a??7,prefix:o??"PRE"}})}e(nvr,"SysNumber");function rvr(r,n,a){let o={...n};return a&&Object.keys(a).forEach(u=>{a[u]!==void 0&&(o[u]=a[u])}),Ym.tsc.factory.createCallExpression(Ym.tsc.factory.createIdentifier(r.name),void 0,[mbt(o)])}e(rvr,"generateColumnExpression");function mbt(r){return Ym.tsc.factory.createObjectLiteralExpression(Object.entries(r).filter(([n,a])=>a!==void 0).map(([n,a])=>n==="referenceTable"?Ym.tsc.factory.createPropertyAssignment(Ym.tsc.factory.createIdentifier("referenceTable"),Ym.tsc.factory.createStringLiteral(a)):n==="calculated_value"?Ym.tsc.factory.createPropertyAssignment(Ym.tsc.factory.createIdentifier(n),Ym.tsc.factory.createTaggedTemplateExpression(Ym.tsc.factory.createIdentifier("script"),void 0,Ym.tsc.factory.createNoSubstitutionTemplateLiteral(a,a))):n==="maxLength"?isNaN(+a)?Ym.tsc.factory.createPropertyAssignment(Ym.tsc.factory.createIdentifier(n),Ym.tsc.factory.createAsExpression(Ym.tsc.factory.createStringLiteral(a),Ym.tsc.factory.createKeywordTypeNode(Ym.ts.SyntaxKind.AnyKeyword))):Ym.tsc.factory.createPropertyAssignment(Ym.tsc.factory.createIdentifier(n),Ym.tsc.factory.createNumericLiteral(a)):Ym.tsc.factory.createPropertyAssignment((0,Mp.createPropertyIdentifier)(n),tcn(a,Ym.tsc.factory))))}e(mbt,"createObjectExpression");function tcn(r,n){if(typeof r=="string")return n.createStringLiteral(r);if(typeof r=="number")return r>=0?n.createNumericLiteral(r):n.createPrefixUnaryExpression(Ym.tsc.SyntaxKind.MinusToken,n.createNumericLiteral(Math.abs(r)));if(typeof r=="boolean")return r?n.createTrue():n.createFalse();if(typeof r=="object"){if(r===null)return n.createNull();if((0,aw.isArray)(r)){let a=[];return Object.values(r).forEach(o=>{a.push(tcn(o,n))}),n.createArrayLiteralExpression(a)}else return Ym.ts.Structure.isImportSpecifier(r)?n.createIdentifier(r.name):mbt(r)}return n.createNull()}e(tcn,"factoryCreateValue");function Hln(r){switch(r){case void 0:case"string":return Nm.StringColumn;case"boolean":return Nm.BooleanColumn;case"choice":return Nm.ChoiceColumn;case"conditions":return Nm.ConditionsColumn;case"date":return Nm.OtherDateColumn;case"calendar_date_time":return Nm.CalendarDateTimeColumn;case"datetime":return Nm.BasicDateTimeColumn;case"due_date":return Nm.DueDateColumn;case"glide_date":return Nm.DateColumn;case"glide_date_time":return Nm.DateTimeColumn;case"integer_date":return Nm.IntegerDateColumn;case"schedule_date_time":return Nm.ScheduleDateTimeColumn;case"decimal":return Nm.DecimalColumn;case"document_id":return Nm.DocumentIdColumn;case"domain_id":return Nm.DomainIdColumn;case"domain_path":return Nm.DomainPathColumn;case"field_name":return Nm.FieldNameColumn;case"integer":return Nm.IntegerColumn;case"radio":return Nm.RadioColumn;case"reference":return Nm.ReferenceColumn;case"script":return Nm.ScriptColumn;case"sys_class_name":return Nm.SystemClassNameColumn;case"table_name":return Nm.TableNameColumn;case"translated_field":return Nm.TranslatedFieldColumn;case"translated_text":return Nm.TranslatedTextColumn;case"user_roles":return Nm.UserRolesColumn;case"version":return Nm.VersionColumn;case"glide_list":return Nm.ListColumn;case"image":return Nm.BasicImageColumn;case"int":case"string_types":case"approval_rules":case"audio":case"auto_increment":case"auto_number":case"bootstrap_color":case"breakdown_element":case"catalog_preview":case"char":case"collection":case"color":case"color_display":case"composite_field":case"composite_name":case"compressed":case"condition_string":case"counter":case"css":case"currency":case"currency2":case"data_array":case"data_object":case"data_structure":case"days_of_week":case"day_of_week":case"documentation_field":case"dynamic_json":case"email":case"email_script":case"expression":case"external_names":case"field_list":case"file_attachment":case"float":case"formula":case"geo_point":case"glide_action_list":case"glide_duration":case"glide_precise_time":case"glide_time":case"glide_utc_time":case"glide_var":case"glyphicon":case"graphql_schema":case"GUID":case"html":case"html_script":case"html_template":case"icon":case"index_name":case"insert_timestamp":case"integer_time":case"internal_type":case"ip_addr":case"ip_address":case"journal":case"journal_input":case"journal_list":case"json":case"json_translations":case"language":case"long":case"longint":case"mask_code":case"metric_absolute":case"metric_counter":case"metric_derive":case"metric_gauge":case"mid_config":case"month_of_year":case"multi_small":case"multi_two_lines":case"name_values":case"nds_icon":case"nl_task_int1":case"order_index":case"password":case"password2":case"percent_complete":case"phone_number":case"phone_number_e164":case"ph_number":case"price":case"properties":case"records":case"reference_name":case"related_tags":case"reminder_field_name":case"repeat_count":case"repeat_type":case"replication_payload":case"schedule_interval_count":case"script_client":case"script_plain":case"script_server":case"short_field_name":case"short_table_name":case"simple_name_values":case"slushbucket":case"snapshot_template_value":case"source_id":case"source_name":case"source_table":case"string_boolean":case"string_full_utf8":case"structure":case"sysevent_name":case"sysrule_field_name":case"sys_class_path":case"template_value":case"time":case"timer":case"translated":case"translated_html":case"tree_code":case"tree_path":case"url":case"user_image":case"user_input":case"variables":case"variable_conditions":case"variable_template_value":case"video":case"week_of_month":case"wide_text":case"wiki_text":case"wms_job":case"workflow":case"workflow_conditions":case"xml":default:return Nm.GenericColumn}}e(Hln,"getCallExpressionFromType")});var rcn=yn(ybt=>{"use strict";me();ye();he();ge();Object.defineProperty(ybt,"__esModule",{value:!0});var _P=Uh(),Iwe=mc(),ivr=hbt(),_L=mp(),gbt=P6(),avr=XC();function ovr(r){try{return(0,_P.getCallExpressionName)(r)===Iwe.Record.name&&r.getArguments()[0]?.getProperty("table")?.getInitializerIfKind(_L.ts.SyntaxKind.StringLiteral)?.getLiteralValue()==="sys_documentation"}catch{}return!1}e(ovr,"isSysDocumentationRecord");var ncn=e(r=>`${r.name}_${r.element?r.element+"_":""}${r.language}`,"generateSysId");ybt.default=(0,_P.Plugin)({name:"Documentation",extractors:{entity:{fluent:{CallExpression:e((r,n)=>{if(ovr(r)){let a=(0,_P.extractCallExpression)(Iwe.Record,"record",r,n,o=>ncn(o.data),o=>gbt.RecordEntitySchema.safeParse(o).success);return!a.handled||!a.data?a:{handled:!0,diagnostics:a.diagnostics,data:a.data}}return{handled:!1}},"CallExpression")}}},composers:{xml:{sys_documentation(r){let n=r.data.data;return{kind:"sys_documentation",guid:ncn(n),data:r.data,action:r.action}}}},serializers:{sys_documentation(r,n){return gbt.RecordPlugin.serializers.record(r,n)}},arrangers:{sys_documentation(r){if(r.data.table!=="sys_documentation")return{handled:!1};let n=r.data.data.name;return{handled:!0,result:n?{kind:"bootstrap",guid:n}:void 0}}},generators:{sys_documentation(r,n,a){let o=r.data.data.name,u=a.find(f=>f.guid===o);return u&&u.node?{...r,node:u.node}:(0,_P.linkDocument)(r,(0,_P.generateCallExpressionExportForDocument)(n,{sourceFile:(0,_P.getOrCreateEntitySourceFile)(n,`${r.guid}`),moduleSpecifier:"@servicenow/sdk/core"},Iwe.Record,{$id:r.guid}).getExpressionIfKindOrThrow(_L.ts.SyntaxKind.CallExpression))}},transformers:{sys_documentation:{CallExpression(r,n){if((0,_P.getCallExpressionName)(r.node)!==Iwe.Table.name)return gbt.RecordPlugin.transformers.record.CallExpression(r,n);let{element:o}=r.data.data,[u]=r.node.getArguments();if(!u)return!1;let f=r.data.data;delete f.element,delete f.name,delete f.sys_id;let h,y,b;if(o){let I=(0,_P.getPropertyAssignment)(u,"schema")?.getChildrenOfKind(_L.ts.SyntaxKind.ObjectLiteralExpression)[0];if(!I)return!1;let w=I.getProperties().find(G=>o===G.getFirstChildByKindOrThrow(_L.ts.SyntaxKind.Identifier).getText().trim());if(!w)return!1;let W=w.getFirstChildByKind(_L.ts.SyntaxKind.CallExpression);if(!W||(y=W.getFirstChildByKind(_L.ts.SyntaxKind.ObjectLiteralExpression),!y))return!1;b=w.getFirstChildByKindOrThrow(_L.ts.SyntaxKind.Identifier),h=(0,_P.getPropertyAssignment)(y,"label")}else{if(y=u.asKind(_L.ts.SyntaxKind.ObjectLiteralExpression)??u.getFirstDescendantByKind(_L.ts.SyntaxKind.ObjectLiteralExpression),!y)return!1;b=(0,_P.getPropertyAssignment)(y,"name"),h=(0,_P.getPropertyAssignment)(y,"label")}let x=h?.getFirstChildByKind(_L.ts.SyntaxKind.ArrayLiteralExpression);if(x)return(0,_P.mergeDataIntoObjectLiteralArray)(x,[f],"language",r.action),!0;{let A=h?.getFirstChildByKind(_L.ts.SyntaxKind.StringLiteral);return cvr(f)?svr(A,f,b,y):lvr(h,y,f)}}}}});function svr(r,n,a,o){if(r){if(r.getLiteralValue()&&n.label?.toLowerCase().trim()===r.getLiteralValue().toLowerCase().trim())return!0;r.setLiteralValue(n.label)}else{if(a&&a.getText().toLowerCase().trim()===n.label?.toLowerCase().trim())return!0;(0,_P.getOrCreatePropertyAssignment)(o,"label",(0,_P.stringify)(n.label))}return!0}e(svr,"updateDefaultLabelParameters");function lvr(r,n,a){r=(0,_P.getOrCreatePropertyAssignment)(n,"label","[]");let o=r.getFirstChildByKind(_L.ts.SyntaxKind.StringLiteral)?.getLiteralText();return r.transform(u=>{if(_L.tsc.isPropertyAssignment(u.currentNode)){let f=u.factory.createArrayLiteralExpression([(0,ivr.createObjectExpression)({...(0,_P.filterEmpty)(a)})]);return u.factory.updatePropertyAssignment(u.currentNode,_L.tsc.factory.createIdentifier("label"),f)}return u.currentNode}),o&&a.label?.toLowerCase().trim()!==o.toLowerCase().trim()&&r.getFirstChildByKindOrThrow(_L.ts.SyntaxKind.ArrayLiteralExpression).addElement((0,_P.stringify)({label:o})),!0}e(lvr,"createArrayLabel");function cvr(r){let{label:n,name:a,element:o}=r,u=uvr(n,a,o);return(0,avr.isEqual)(u.data,r)}e(cvr,"isDefaultDocumentationRecord");function uvr(r,n,a){return(0,Iwe.Record)({table:"sys_documentation",$id:`${n}_${a?a+"_":""}en`,data:{label:r,hint:"",help:"",language:"en",plural:_vr(r),url:"",url_target:""}})}e(uvr,"defaultDocumentationRecord");var dvr=["s","ed","by","Active",")"," to"," with"," for"," in"," out"," use","Data"," data"],fvr=["ry","ty","dy","cy","fy","ly","ny"],pvr=["x","sh","ch","z"];function _vr(r){if(!r)return"";for(let n of dvr)if(r.endsWith(n))return r;for(let n of fvr)if(r.endsWith(n))return r.substring(0,r.lastIndexOf("y"))+"ies";for(let n of pvr)if(r.endsWith(n))return r+"es";return r+"s"}e(_vr,"generatePlural")});var ocn=yn($te=>{"use strict";me();ye();he();ge();Object.defineProperty($te,"__esModule",{value:!0});$te.ua_table_licensing_config=void 0;var Jte=Uh(),vbt=mc(),icn=P6(),mVe=mp(),mvr=XC();$te.ua_table_licensing_config="ua_table_licensing_config";$te.default=(0,Jte.Plugin)({name:"LicensingConfig",composers:{xml:{ua_table_licensing_config(r){return{kind:$te.ua_table_licensing_config,guid:r.data.id??(0,Jte.GUID)(),data:r.data,action:r.action}}}},serializers:{ua_table_licensing_config(r,n){return icn.RecordPlugin.serializers.record(r,n)}},arrangers:{ua_table_licensing_config(r){if(r.data.table!==$te.ua_table_licensing_config)return{handled:!1};let n=r.data.data.name;return{handled:!0,result:n?{kind:"bootstrap",guid:n}:void 0}}},generators:{ua_table_licensing_config(r,n,a){let o=a.find(u=>u.guid===r.data.data.name);return o&&o.node?{...r,node:o.node}:(0,Jte.linkDocument)(r,(0,Jte.generateCallExpressionExportForDocument)(n,{sourceFile:(0,Jte.getOrCreateEntitySourceFile)(n,`${r.kind}_${r.guid}`),moduleSpecifier:"@servicenow/sdk/core"},vbt.Record,{$id:r.guid}).getExpressionIfKindOrThrow(mVe.ts.SyntaxKind.CallExpression))}},transformers:{ua_table_licensing_config:{CallExpression(r,n){if((0,Jte.getCallExpressionName)(r.node)!==vbt.Table.name)return icn.RecordPlugin.transformers.record.CallExpression(r,n);let[o]=r.node.getArguments();if(!o)return!1;let u=r.changedData.data,f=r.data.data,h,y,b=(0,Jte.getPropertyAssignment)(o,"licensing_config");if(b)y=u,h=b.getFirstChildByKindOrThrow(mVe.ts.SyntaxKind.ObjectLiteralExpression);else{if(hvr(f))return!0;let x=acn(f.name).data;y={},Object.entries(f).filter(([w])=>f[w]!==x[w]).map(([w,W])=>{y[w]=W}),h=r.node.getFirstChildByKindOrThrow(mVe.ts.SyntaxKind.ObjectLiteralExpression).addPropertyAssignment({name:"licensing_config",initializer:"{}"}).getFirstChildByKindOrThrow(mVe.ts.SyntaxKind.ObjectLiteralExpression)}return y.license_roles&&(y.license_roles=y.license_roles.split(",")),(0,Jte.mergeDataIntoObjectLiteral)(h,y),!0}}}});function hvr(r){return(0,mvr.isEqual)(r,acn(r.name).data)}e(hvr,"isDefaultLicensingConfig");function acn(r){return(0,vbt.Record)({table:$te.ua_table_licensing_config,$id:`${r}_license`,data:{name:r,op_insert:!0,op_update:!0,op_delete:!0,is_fulfillment:!1,license_model:"none",owner_condition:"",license_condition:"",license_roles:""}})}e(acn,"defaultLicensingConfigRecord")});var Sbt=yn(AA=>{"use strict";me();ye();he();ge();var gvr=AA&&AA.__createBinding||(Object.create?function(r,n,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(n,a);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:e(function(){return n[a]},"get")}),Object.defineProperty(r,o,u)}:function(r,n,a,o){o===void 0&&(o=a),r[o]=n[a]}),scn=AA&&AA.__exportStar||function(r,n){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(n,a)&&gvr(n,r,a)},bbt=AA&&AA.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(AA,"__esModule",{value:!0});AA.LicensingPlugin=AA.DocumentationPlugin=AA.RecordPlugin=AA.generateColumnExpression=AA.TablePlugin=void 0;scn(qtn(),AA);var lcn=hbt();Object.defineProperty(AA,"TablePlugin",{enumerable:!0,get:e(function(){return bbt(lcn).default},"get")});Object.defineProperty(AA,"generateColumnExpression",{enumerable:!0,get:e(function(){return lcn.generateColumnExpression},"get")});var yvr=P6();Object.defineProperty(AA,"RecordPlugin",{enumerable:!0,get:e(function(){return yvr.RecordPlugin},"get")});var vvr=rcn();Object.defineProperty(AA,"DocumentationPlugin",{enumerable:!0,get:e(function(){return bbt(vvr).default},"get")});var bvr=ocn();Object.defineProperty(AA,"LicensingPlugin",{enumerable:!0,get:e(function(){return bbt(bvr).default},"get")});scn(oze(),AA)});var ccn=yn(Rve=>{"use strict";me();ye();he();ge();Object.defineProperty(Rve,"__esModule",{value:!0});Rve.ExperienceSchema=void 0;Rve.Experience=Svr;var Xte=VS();Rve.ExperienceSchema=Xte.z.object({$id:Xte.z.string().or(Xte.z.number()),name:Xte.z.string(),active:Xte.z.boolean().default(!0),baseUrlPath:Xte.z.string().default(""),landingPath:Xte.z.string().default(""),description:Xte.z.string().default("")});var O1i=Rve.ExperienceSchema.omit({$id:!0});function Svr(r){return r}e(Svr,"Experience")});var ucn=yn(kve=>{"use strict";me();ye();he();ge();Object.defineProperty(kve,"__esModule",{value:!0});kve.BaseUXRouteSchema=void 0;kve.Routes=Evr;var FV=VS();kve.BaseUXRouteSchema=FV.z.object({$id:FV.z.string().or(FV.z.number()),name:FV.z.string(),active:FV.z.boolean().default(!0),description:FV.z.string().default(""),component:FV.z.object({tagName:FV.z.string(),properties:FV.z.record(FV.z.string()).optional()})});var U1i=kve.BaseUXRouteSchema.omit({$id:!0});function Evr(r){return r}e(Evr,"Routes")});var Ebt=yn(Yte=>{"use strict";me();ye();he();ge();var xvr=Yte&&Yte.__createBinding||(Object.create?function(r,n,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(n,a);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:e(function(){return n[a]},"get")}),Object.defineProperty(r,o,u)}:function(r,n,a,o){o===void 0&&(o=a),r[o]=n[a]}),dcn=Yte&&Yte.__exportStar||function(r,n){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(n,a)&&xvr(n,r,a)};Object.defineProperty(Yte,"__esModule",{value:!0});dcn(ccn(),Yte);dcn(ucn(),Yte)});var xbt=yn(Lve=>{"use strict";me();ye();he();ge();Object.defineProperty(Lve,"__esModule",{value:!0});Lve.PARENT_APP_SHELL_ID=Lve.WORKSPACE_APP_SHELL_ID=void 0;Lve.WORKSPACE_APP_SHELL_ID="c276387cc331101080d6d3658940ddd2";Lve.PARENT_APP_SHELL_ID="c86a62e2c7022010099a308dc7c26022"});var hcn=yn(Tbt=>{"use strict";me();ye();he();ge();Object.defineProperty(Tbt,"__esModule",{value:!0});var fcn=Ebt(),pcn=mc(),_cn=Uh(),mcn=xbt();Tbt.default=(0,_cn.Plugin)({name:"Experience",ownedTables:{},extractors:{entity:{fluent:{CallExpression:e((r,n)=>(0,_cn.extractCallExpression)(fcn.Experience,"experience",r,n,a=>n.registerExplicitId("sys_ux_app_config",a.$id)),"CallExpression")}}},composers:{entity:{experience(r,n){let a=r.getNode(),o=r.getValue(),u=r.getGuid(),f=fcn.ExperienceSchema.parse(o),h=(0,pcn.Record)({table:"sys_ux_app_config",$id:u,data:{name:f.name,active:f.active,base_url_path:f.baseUrlPath,landing_path:f.landingPath,description:f.description}}),y=(0,pcn.Record)({table:"sys_ux_page_registry",$id:n.registerExplicitId("sys_ux_page_registry",`${u}_registry`),data:{title:f.name,active:f.active,admin_panel:h.$id,admin_panel_table:"sys_ux_app_config",parent_app:mcn.PARENT_APP_SHELL_ID,path:f.baseUrlPath,root_macroponent:mcn.WORKSPACE_APP_SHELL_ID}});return Promise.resolve([h,y].map(b=>({kind:"record",guid:b.$id,node:a,data:b})))}}}})});var ycn=yn((gcn,hVe)=>{me();ye();he();ge();(function(r,n){typeof hVe=="object"&&hVe.exports?hVe.exports=n():r.nearley=n()})(gcn,function(){function r(b,x,A){return this.id=++r.highestId,this.name=b,this.symbols=x,this.postprocess=A,this}e(r,"Rule"),r.highestId=0,r.prototype.toString=function(b){var x=typeof b>"u"?this.symbols.map(y).join(" "):this.symbols.slice(0,b).map(y).join(" ")+" \u25CF "+this.symbols.slice(b).map(y).join(" ");return this.name+" \u2192 "+x};function n(b,x,A,I){this.rule=b,this.dot=x,this.reference=A,this.data=[],this.wantedBy=I,this.isComplete=this.dot===b.symbols.length}e(n,"State"),n.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},n.prototype.nextState=function(b){var x=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return x.left=this,x.right=b,x.isComplete&&(x.data=x.build(),x.right=void 0),x},n.prototype.build=function(){var b=[],x=this;do b.push(x.right.data),x=x.left;while(x.left);return b.reverse(),b},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,f.fail))};function a(b,x){this.grammar=b,this.index=x,this.states=[],this.wants={},this.scannable=[],this.completed={}}e(a,"Column"),a.prototype.process=function(b){for(var x=this.states,A=this.wants,I=this.completed,w=0;w<x.length;w++){var W=x[w];if(W.isComplete){if(W.finish(),W.data!==f.fail){for(var G=W.wantedBy,O=G.length;O--;){var k=G[O];this.complete(k,W)}if(W.reference===this.index){var B=W.rule.name;(this.completed[B]=this.completed[B]||[]).push(W)}}}else{var B=W.rule.symbols[W.dot];if(typeof B!="string"){this.scannable.push(W);continue}if(A[B]){if(A[B].push(W),I.hasOwnProperty(B))for(var Y=I[B],O=0;O<Y.length;O++){var Q=Y[O];this.complete(W,Q)}}else A[B]=[W],this.predict(B)}}},a.prototype.predict=function(b){for(var x=this.grammar.byName[b]||[],A=0;A<x.length;A++){var I=x[A],w=this.wants[b],W=new n(I,0,this.index,w);this.states.push(W)}},a.prototype.complete=function(b,x){var A=b.nextState(x);this.states.push(A)};function o(b,x){this.rules=b,this.start=x||this.rules[0].name;var A=this.byName={};this.rules.forEach(function(I){A.hasOwnProperty(I.name)||(A[I.name]=[]),A[I.name].push(I)})}e(o,"Grammar"),o.fromCompiled=function(I,x){var A=I.Lexer;I.ParserStart&&(x=I.ParserStart,I=I.ParserRules);var I=I.map(function(W){return new r(W.name,W.symbols,W.postprocess)}),w=new o(I,x);return w.lexer=A,w};function u(){this.reset("")}e(u,"StreamLexer"),u.prototype.reset=function(b,x){this.buffer=b,this.index=0,this.line=x?x.line:1,this.lastLineBreak=x?-x.col:0},u.prototype.next=function(){if(this.index<this.buffer.length){var b=this.buffer[this.index++];return b===`
48262
+ </record_update>`}}}})});var hbt=yn(Nve=>{"use strict";me();ye();he();ge();Object.defineProperty(Nve,"__esModule",{value:!0});Nve.getDefaultMaxLength=Zln;Nve.generateColumnExpression=rvr;Nve.createObjectExpression=mbt;var Nm=mc(),Mp=Uh(),Cyr=Vht(),aw=XC(),la=VS(),_y=P6(),Ym=mp(),wyr=oze(),Iyr=Rce(),Pve=["none","tracking","restricted"],Pyr=la.z.object({name:la.z.string(),schema:la.z.record(la.z.record(la.z.any())).default({}),extends:la.z.string().optional(),label:la.z.string().or(la.z.array(la.z.any())).optional(),display:la.z.string().optional(),extensible:la.z.boolean().optional().default(!1),live_feed:la.z.boolean().optional().default(!1),auto_number:la.z.object({prefix:la.z.string().default("pre").optional(),number:la.z.number().default(1e3).optional(),number_of_digits:la.z.number().default(7).optional()}).optional(),accessible_from:la.z.union([la.z.literal("package_private"),la.z.literal("public")]).optional().default("public"),caller_access:la.z.enum(Pve).optional(),actions:la.z.array(la.z.union([la.z.literal("read"),la.z.literal("update"),la.z.literal("delete"),la.z.literal("create")])).optional(),allow_web_service_access:la.z.boolean().optional().default(!1),allow_new_fields:la.z.boolean().optional().default(!1),allow_ui_actions:la.z.boolean().optional().default(!1),allow_client_scripts:la.z.boolean().optional().default(!1),audit:la.z.boolean().optional().default(!1),read_only:la.z.boolean().optional().default(!1),text_index:la.z.boolean().optional().default(!1),attributes:la.z.record(la.z.union([la.z.string(),la.z.number(),la.z.boolean()])).optional(),index:la.z.array(la.z.object({name:la.z.string(),unique:la.z.boolean(),element:la.z.string().or(la.z.array(la.z.string())).transform(r=>(0,aw.isArray)(r)?r:[r])})).optional(),licensing_config:la.z.record(la.z.any()).optional(),scriptable_table:la.z.boolean().default(!1)}),Nyr=["sys_dictionary","sys_choice","sys_documentation","ua_table_licensing_config"],Ryr=la.z.object({entityKind:la.z.string().optional(),column_type:la.z.string().optional(),audit:la.z.boolean().optional().default(!1),label:la.z.string().or(la.z.array(la.z.any())).optional(),maxLength:la.z.number().optional(),mandatory:la.z.boolean().optional().default(!1),read_only:la.z.boolean().optional().default(!1),default:la.z.any().optional(),attributes:la.z.record(la.z.string(),la.z.union([la.z.string(),la.z.boolean(),la.z.number()])).optional(),referenceTable:la.z.string().optional(),cascadeRule:la.z.string().optional(),dropdown:la.z.enum(Nm.choiceDropdown).default("none").optional(),choices:la.z.record(la.z.any()).or(la.z.array(la.z.any())).optional(),choice_elements:la.z.record(la.z.any()).or(la.z.array(la.z.any())).optional(),display:la.z.boolean().default(!1).optional(),function_definition:la.z.string().optional(),dynamic_value_definitions:la.z.object({type:la.z.union([la.z.literal("dynamic_default"),la.z.literal("choices_from_other_table"),la.z.literal("calculated_value"),la.z.literal("dependent_field")])}).and(la.z.any()).optional(),plural:la.z.string().optional(),hint:la.z.string().optional(),help:la.z.string().optional(),widget:la.z.string().optional(),table_reference:la.z.boolean().optional(),reference_floats:la.z.boolean().optional(),dynamic_creation:la.z.boolean().optional(),dynamic_creation_script:la.z.string().optional(),element_reference:la.z.boolean().optional(),spell_check:la.z.boolean().optional(),xml_view:la.z.boolean().optional(),array:la.z.boolean().optional(),text_index:la.z.boolean().optional(),primary:la.z.boolean().optional(),unique:la.z.boolean().optional(),reference_key:la.z.string().optional(),reference_qual:la.z.string().optional()}),Rm=la.z.string().transform(r=>r==="true").or(la.z.boolean()).optional(),Kln=la.z.string().transform(r=>(0,aw.parseInt)(r)).or(la.z.number()).optional(),qln=la.z.object({name:_y.TextStringSchema.or(la.z.string()).optional(),read_access:_y.TextBooleanSchema.or(Rm).optional(),create_access:_y.TextBooleanSchema.or(Rm).optional(),update_access:_y.TextBooleanSchema.or(Rm).optional(),delete_access:_y.TextBooleanSchema.or(Rm).optional(),ws_access:_y.TextBooleanSchema.or(Rm).optional(),caller_access:_y.TextNumberSchema.or(Kln).transform(r=>{if(r)return Pve[r]}).optional(),alter_access:_y.TextBooleanSchema.or(Rm).optional(),client_scripts_access:_y.TextBooleanSchema.or(Rm).optional(),actions_access:_y.TextBooleanSchema.or(Rm).optional(),is_extendable:_y.TextBooleanSchema.or(Rm).optional(),access:_y.TextStringSchema.or(la.z.string()).optional(),scriptable_table:_y.TextBooleanSchema.or(Rm).optional()}),kyr=la.z.object({name:la.z.string(),extends:la.z.string().optional(),label:la.z.string().or(la.z.array(la.z.any())).optional(),extensible:la.z.boolean().optional().default(!1),live_feed:la.z.boolean().optional().default(!1),auto_number:la.z.object({prefix:la.z.string().default("pre").optional(),number:la.z.number().default(1e3).optional(),number_of_digits:la.z.number().default(7).optional()}).optional(),number_ref:la.z.any().optional(),accessible_from:la.z.union([la.z.literal("public"),la.z.literal("package_private")]).optional().default("public"),caller_access:la.z.enum(Pve).default("none").optional(),actions:la.z.array(la.z.union([la.z.literal("read"),la.z.literal("update"),la.z.literal("delete"),la.z.literal("create")])).default(["read"]).optional(),allow_web_service_access:la.z.boolean().optional().default(!0),allow_new_fields:la.z.boolean().optional().default(!1),allow_ui_actions:la.z.boolean().optional().default(!1),allow_client_scripts:la.z.boolean().optional().default(!1),audit:la.z.boolean().optional().default(!1),read_only:la.z.boolean().optional().default(!1),text_index:la.z.boolean().optional().default(!1),scriptable_table:la.z.boolean().optional().default(!1),attributes:la.z.record(la.z.union([la.z.string(),la.z.number(),la.z.boolean()])).default({}).optional()}),Jln=kyr.omit({actions:!0}).extend({caller_access:la.z.union([la.z.literal(0),la.z.literal(1),la.z.literal(2)]).transform(r=>{if(r)return Pve[r]}).optional(),accessible_from:la.z.union([la.z.literal("public"),la.z.literal("package_private")]).optional(),extends:la.z.string().or(la.z.object({name:la.z.string()}).transform(r=>r.name)).optional(),live_feed:la.z.boolean().optional().default(!1),index:la.z.any().optional(),columns:la.z.any().optional()}),Lyr=la.z.object({element:la.z.record(la.z.any())}),Myr=la.z.object({"@_table":la.z.literal("sys_db_object"),sys_db_object:la.z.record(la.z.any())}),Oyr=la.z.object({sys_documentation:la.z.object({element:_y.TextStringSchema.optional(),label:_y.TextStringSchema.optional(),language:_y.TextStringSchema.optional(),hint:_y.TextStringSchema.optional(),help:_y.TextStringSchema.optional(),name:_y.TextStringSchema.optional(),plural:_y.TextStringSchema.optional(),sys_id:_y.TextStringSchema.optional(),url:_y.TextStringSchema.optional(),url_target:_y.TextStringSchema.optional()})}),Fyr=la.z.object({ua_table_licensing_config:la.z.object({name:_y.TextStringSchema.optional(),op_insert:_y.TextBooleanSchema.optional(),op_update:_y.TextBooleanSchema.optional(),op_delete:_y.TextBooleanSchema.optional(),is_fulfillment:_y.TextBooleanSchema.optional(),license_model:_y.TextStringSchema.optional(),owner_condition:_y.TextStringSchema.optional(),license_condition:_y.TextStringSchema.optional(),license_roles:_y.TextStringSchema.optional()})}),$ln=la.z.object({"@_name":la.z.string(),"@_extends":la.z.string().optional(),"@_label":la.z.string().optional(),"@_max_length":la.z.any().optional(),"@_audit":Rm,"@_read_only":Rm,"@_text_index":Rm,"@_client_scripts_access":Rm,"@_ws_access":Rm,"@_alter_access":Rm,"@_create_access":Rm,"@_delete_access":Rm,"@_update_access":Rm,"@_query_access":Rm,"@_actions_access":Rm,"@_read_access":Rm,"@_is_extendable":Rm,"@_caller_access":Kln,"@_scriptable_table":Rm,"@_attributes":la.z.string().transform(r=>{let n={};return r===""?void 0:(r.split(",").forEach(o=>{let u=o.split("=");if(u.length===2&&u[0]&&u[1])try{n[u[0]]=JSON.parse(u[1])}catch{n[u[0]]=u[1]}}),n)}).optional()}).catchall(la.z.any()),Byr=la.z.object({sys_dictionary:la.z.object({"@_action":la.z.union([la.z.literal("INSERT_OR_UPDATE"),la.z.literal("DELETE"),la.z.literal("delete_multiple")]),sys_id:la.z.object({"#text":la.z.string().min(32).max(32).or(la.z.number())}).transform(r=>r["#text"]).optional(),"@_element":la.z.string(),"@_table":la.z.string()}).catchall(la.z.object({"#text":la.z.union([la.z.string(),la.z.boolean(),la.z.number(),la.z.undefined()])}).transform(r=>r["#text"]))}),Wyr=la.z.object({"@_name":la.z.string(),"@_unique":Rm,element:la.z.object({"@_name":la.z.string()}).or(la.z.array(la.z.object({"@_name":la.z.string()})))}),jyr=$ln.omit({"@_extends":!0}).extend({"@_choice":la.z.coerce.number().optional(),"@_active":Rm,"@_mandatory":Rm,"@_display":Rm,"@_type":la.z.string().optional(),"@_use_dependent_field":Rm,"@_use_dynamic_default":Rm,"@_reference":la.z.string().optional(),"@_virtual":Rm,"@_default":la.z.string().optional(),"@_calculation":la.z.string().optional(),"@_choice_field":la.z.string().optional(),"@_function_definition":la.z.string().optional(),"@_reference_floats":Rm,"@_reference_key":la.z.string().optional(),"@_dynamic_creation_script":la.z.string().optional(),"@_dynamic_creation":Rm,"@_plural":la.z.string().optional(),"@_hint":la.z.string().optional(),"@_help":la.z.string().optional(),"@_widget":la.z.string().optional(),"@_table_reference":Rm,"@_element_reference":Rm,"@_unique":Rm,"@_spell_check":Rm,"@_xml_view":Rm,"@_array":Rm,"@_text_index":Rm,"@_primary":Rm,"@_reference_qual":la.z.string().optional(),choice:la.z.object({element:la.z.array(la.z.any()).or(la.z.record(la.z.any())).optional()}).optional(),"@_attributes":la.z.string().transform(r=>{let n={};return r===""?void 0:(r.split(",").forEach(o=>{let u=o.split("=");if(u.length===2&&u[0]&&u[1])try{n[u[0]]=JSON.parse(u[1])}catch{n[u[0]]=u[1]}}),n)}).optional()}).catchall(la.z.any()),Xln=la.z.object({label:la.z.string().optional(),value:la.z.string().optional(),sequence:la.z.coerce.number().optional(),dependent_value:la.z.coerce.number().or(la.z.string()).optional(),hint:la.z.string().optional(),inactive:Rm.default(!1).optional(),inactive_on_update:Rm.default(!1).optional(),language:la.z.string().optional()}),zyr=Xln.omit({value:!0});function Gyr(r,n,a){return{kind:"ua_table_licensing_config",guid:`${r}_license`,data:{table:"ua_table_licensing_config",$id:r,data:{name:r,op_insert:n.op_insert??!0,op_update:n.op_update??!0,op_delete:n.op_delete??!0,is_fulfillment:n.is_fulfillment??!1,license_model:n.license_model??"none",owner_condition:n.owner_condition??"",license_condition:n.license_condition??"",license_roles:n.license_roles?n.license_roles.join(","):""}},node:a}}e(Gyr,"composeLicenseConfig");var Wln=new RegExp("^[a-z_][a-z0-9_]*[a-z0-9]$");Nve.default=(0,Mp.Plugin)({name:"Table",ownedTables:{sys_db_object:{diagnosticLevel:Ym.Diagnostic.Level.Warn}},extractors:{entity:{fluent:{CallExpression:e((r,n)=>{let a=(0,Mp.extractCallExpression)(Nm.Table,"table",r,n,O=>O.name);if(!a.handled||!a.data)return a;let o=a.data,u=a.diagnostics,f=n.app.config.scope,h=new RegExp(`^${f}_`),y=new RegExp("^[a-z_][a-z0-9_]*$"),b=o.getProperty("name"),x=b.getValue().match(h),A=!1;b.getValue().match(Wln)||u.push(new Mp.FluentDiagnostic(b.getNode(),"Table name must only contain lowercase letters, numbers, and underscores and end with a letter or number")),x||(b.getNode().asKindOrThrow(Ym.ts.SyntaxKind.StringLiteral).getParent().getKindName()!=="AsExpression"?u.push(new Mp.FluentDiagnostic(b.getNode(),`'name' property must start with scope prefix '${f}'`)):A=!0);let I=o.getProperty("schema"),w=I.getNode().asKindOrThrow(Ym.ts.SyntaxKind.ObjectLiteralExpression);for(let O in I.getValue()){let k=w.getPropertyOrThrow(O);!A&&!x&&!(0,Mp.isSNScope)(f)&&!O.match(h)&&u.push(new Mp.FluentDiagnostic(k,`Column name must be prefixed with scope '${f}' if table name does not contain prefix`)),O.match(y)||u.push(new Mp.FluentDiagnostic(k,"Column name must only contain lowercase letters, numbers, and underscores"))}let W=r.getParentIfKind(Ym.ts.SyntaxKind.VariableDeclaration);return(!W||!W.isExported()||!W.isNamedExport()||W.getName()!==b.getValue())&&u.push(new Mp.FluentDiagnostic(r,`Table definition should be exported as a named export with the name '${b.getValue()}'`,{level:Ym.Diagnostic.Level.Warn})),u.push(...(0,wyr.getLabelDiagnostics)(o)),{handled:!0,data:new Mp.EntityData("table",b.getValue(),new Mp.ObjectData(o.getProperties(),o.getNode()),o.getNode(),o.getInstallMethod(),[b.getValue()]),diagnostics:u}},"CallExpression")}},xml(r,n){let a={},o={},u=Lyr.safeParse(r.data.database);if(u.success){let b=$ln.parse(u.data.element);Object.entries(b).forEach(([x,A])=>{x.startsWith("@_")?a[x.substring(2)]=A:x==="element"||(a[x]=A)}),n.updateHandledXMLs(r.filePath,"handled")}let f=Myr.safeParse(r.data.record_update);if(f.success)return o=qln.parse(f.data.sys_db_object),n.updateHandledXMLs(r.filePath,"handled"),new Mp.XmlData(o,r.filePath,"sys_db_object",f.data.sys_db_object["@_action"]);if(!u.success){let b=r.data.record_update;if(b){let x=Object.keys(b)[0];if(!x||!Nyr.includes(x))return;if(x==="sys_documentation"){let I=Oyr.parse(b[x]).sys_documentation;return new Mp.XmlData({table:x,id:b[x][x].sys_id?.["#text"]??(0,Mp.GUID)(),data:I},r.filePath,"sys_documentation",b[x]["@_action"])}if(x==="ua_table_licensing_config"){let I=Fyr.parse(b).ua_table_licensing_config;return new Mp.XmlData({table:x,id:b[x].sys_id?.["#text"]??(0,Mp.GUID)(),data:I},r.filePath,"ua_table_licensing_config",b[x]["@_action"])}let A=Byr.safeParse(b);if(A.success){let{"@_action":I,"@_element":w,"@_table":W,sys_id:G,...O}=A.data.sys_dictionary;return new Mp.XmlData({table:x,id:G??`${O.name}_${O.element!==""?O.element:"_null"}`,data:O},r.filePath,"sys_dictionary",I)}n.updateHandledXMLs(r.filePath,"ignored");return}}let h=[],y=[];if(u.success&&u.data.element.element){let b=u.data.element.element,x=(0,aw.isArray)(b)?b:[b];h.push(...la.z.array(jyr).parse(x)),h.forEach(I=>{I.choice&&!(0,aw.isEmpty)(I.choice)&&(I.choice_elements={},((0,aw.isArray)(I.choice.element)?I.choice.element:[I.choice.element]).forEach(W=>{let G=Vln(W),O=zyr.parse(G);O.label||(O.label=G.value),I.choice_elements[G.value]=O})),I=Vln(I)}),a.columns=h.reduce((I,w)=>(I[w.name]=w,I),{});let A=u.data.element.index;A=(0,aw.isArray)(A)?A:[A],A.forEach(I=>{let w=Wyr.safeParse(I);w.success&&y.push({name:w.data["@_name"],element:(0,aw.isArray)(w.data.element)?w.data.element.reduce((W,G)=>(W.push(G["@_name"]),W),[]):w.data.element["@_name"],unique:w.data["@_unique"]??!1})}),a.index=y}return new Mp.XmlData(a,r.filePath,"bootstrap")}},composers:{entity:{async table(r,n){let a=r.getNode(),o=r.getValue(),u=Pyr.parse(o),f=qyr(u),{columnData:h,documentation:y}=Kyr(u.schema,n,u.name,u.display);f.columns=h;let b=[];if(u.auto_number){let A=u.auto_number,I=nvr(u.name,A.number_of_digits,A.number,A.prefix),w=await _y.RecordPlugin.composers.entity.record(new Mp.EntityData("record",n.registerExplicitId(I.table,I.$id),Mp.ObjectData.fromObjectValue(I,a),a),n);b.push(w),f.number_ref=w.guid}return y.forEach(A=>{b.push({kind:"sys_documentation",node:a,data:A,guid:A.$id})}),Yln("",u.name,u.label).forEach(A=>{b.push({kind:"sys_documentation",node:a,data:A,guid:A.$id})}),f.index=u.index,u.licensing_config&&b.push(Gyr(f.name,u.licensing_config,a)),b.push({kind:"bootstrap",node:a,guid:f.name,data:{data:{bootstrapData:f,dbObjectData:f}}}),b}},xml:{bootstrap(r){return{kind:r.kind,guid:r.data.name,data:{data:{bootstrapData:r.data}}}},sys_db_object(r){return{kind:"bootstrap",guid:`${r.data.name}`,data:{data:{dbObjectData:r.data}},action:r.action}},sys_dictionary(r){let n=r.data.data;return{kind:"sys_dictionary",guid:r.data.id??`${n.name}_${n.element!==""?n.element:"_null"}`,data:r.data,action:r.action}}}},arrangers:{bootstrap(r){return{handled:!1}},sys_dictionary(r){if(r.data.table!=="sys_dictionary")return{handled:!1};let n=r.data.data.name;return{handled:!0,result:n?{kind:"bootstrap",guid:n}:void 0}}},generators:{bootstrap(r,n){let a=Jln.safeParse(r.data.data.bootstrapData);if(a.success)return(0,Mp.linkDocument)(r,Yyr(n,{sourceFile:(0,Mp.getOrCreateEntitySourceFile)(n,a.data.name),moduleSpecifier:"@servicenow/sdk/core",exportName:a.data.name},Nm.Table,{}).getInitializerIfKindOrThrow(Ym.ts.SyntaxKind.CallExpression))},sys_dictionary(r,n,a){let o=r.data.data,u=o.sys_update_name,f=a.find(h=>h.guid===o.name);return f&&f.node?{...r,node:f.node}:(0,Mp.linkDocument)(r,(0,Mp.generateCallExpressionExportForDocument)(n,{sourceFile:(0,Mp.getOrCreateEntitySourceFile)(n,u??`sys_dictionary_${r.guid}`),moduleSpecifier:"@servicenow/sdk/core"},Nm.Record,{$id:r.guid}).getExpressionIfKindOrThrow(Ym.ts.SyntaxKind.CallExpression))},record(r,n){if(!(r.data?.table!=="sys_documentation"&&r.data?.table!=="ua_table_licensing_config"))return(0,Mp.linkDocument)(r,(0,Mp.generateCallExpression)(n,(0,Mp.getOrCreateEntitySourceFile)(n,`${r.data?.data.name}`),"@servicenow/sdk/core",Nm.Record,{$id:r.guid}))}},serializers:{bootstrap(r){let n=r.data.data,{columns:a,index:o,attributes:u,...f}=n.bootstrapData;f.live_feed&&(u.live_feed=!0);let h=(0,Cyr.create)({version:"1.0"}).ele("database"),y=jln(u),b=h.ele("element",{...f,attributes:y});for(let x of Object.values(a)){let{choice_elements:A,attributes:I,...w}=x,W=jln(I),G=b.ele("element",{...w,attributes:W});evr(x,G)}return Zyr(o,b),{name:`${f.name}.xml`,directory:"dictionary",content:h.end({prettyPrint:!0}),usedIds:[]}},sys_dictionary(r){}},transformers:{bootstrap:{CallExpression(r,n){return Uyr(r,n)}},sys_dictionary:{CallExpression(r,n){return(0,Mp.getCallExpressionName)(r.node)!==Nm.Table.name?_y.RecordPlugin.transformers.record.CallExpression(r,n):(n.logger.info(`Deferring handling of sys_dictionary '${r.guid}' values to values in bootstrap.xml '${r.parent.guid}'`),!0)}}},postProcessors:{entities(r,n){let{interfaces:a,properties:o,imports:u,namedImports:f}={interfaces:[],properties:[],imports:{},namedImports:[]},h=n.compiler.getGeneratedTableFile();r.filter(y=>y.getKind()==="table").forEach(y=>{let b=y.getProperty("name").getValue(),x=y.getProperty("extends")?.getValue();if(b&&b.trim().length>0&&b.match(Wln)){if(n.compiler.interfaceExistsInGlobalDeclaration(b)||a.push({name:b,extends:[`Helper<typeof ${b}>`]}),!n.compiler.propertyExistsInGlobalDeclaration(b)){let W=`Table<TableSchemas.${b}>`;x&&(W=`Table<TableSchemas.${b}, "${x}">`),o.push({name:b,type:W})}let A=y.getNode().getSourceFile().getFilePath(),I=h?.getRelativePathAsModuleSpecifierTo(A),w=n.compiler.importExistsInGlobalDeclaration(I);w?w?.getNamedImports().find(G=>G.getName()===b)||f.push({existingImport:w,name:b}):u[A]?u[A].namedImports.push(b):u[A]={namedImports:[b],moduleSpecifier:I}}}),n.compiler.addTableInterfacesToGlobalDeclaration({interfaces:a,properties:o,imports:u,namedImports:f})}}});function Uyr(r,n){if((0,Mp.getCallExpressionName)(r.node)!==Nm.Table.name)return!1;let[o]=r.node.getArguments();if(!Ym.ts.Node.isObjectLiteralExpression(o))return!1;if(r.action==="DELETE")return(0,Mp.removeNode)(r.node),!0;if(!r.changedData)return!0;let u=r.changedData.data,f=r.xmlData.data,h={},y={};(0,aw.isEmpty)(u.bootstrapData)||(h=Jln.partial().parse(u.bootstrapData)),(0,aw.isEmpty)(u.dbObjectData)||(y=qln.partial().parse(u.dbObjectData));let{auto_number:b,number_ref:x,extends:A,index:I,columns:w,...W}=Gln(h),{create_access:G,delete_access:O,update_access:k,read_access:B,caller_access:Y,...Q}=Gln(y),ne={...W,...Q};A&&(ne.extends=A),Y&&(ne.caller_access=Pve[Y]),(0,aw.isEmpty)(y)||(ne.actions=Qyr(f.dbObjectData)),ne.attributes||delete ne.attributes,(0,Mp.transformFunctionArguments)(r.node,Nm.Table,ne);let de=f.bootstrapData?f.bootstrapData.columns:void 0;return Hyr(r.node,w,de),Jyr(w,de,o,n),Vyr(f,o),!0}e(Uyr,"transformTable");function Vyr(r,n){if(r.bootstrapData?.index?.length>0){let a=(0,Mp.getPropertyAssignment)(n,"index");a?(0,Mp.mergeDataIntoObjectLiteralArray)(a.getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.ArrayLiteralExpression),Object.values(r.bootstrapData?.index),"name"):(0,Mp.getOrCreatePropertyAssignment)(n,"index","[]").setInitializer((0,Mp.stringify)(r.bootstrapData.index))}else if(r.bootstrapData){let a=(0,Mp.getPropertyAssignment)(n,"index");a&&a.remove()}}e(Vyr,"transformIndexes");function jln(r){return r?Object.entries(r).map(([n,a])=>`${n}=${a}`).join(","):""}e(jln,"composeAttributes");function Hyr(r,n,a){if(Object.values(n??{}).filter(u=>u.display)){let u=Object.values(a??{}).find(f=>f.display);u&&(0,Mp.transformFunctionArguments)(r,Nm.Table,{display:u.name})}}e(Hyr,"updateDisplayValue");function Yln(r,n,a){let o=[];return!a||!(0,aw.isArray)(a)||a.forEach(u=>{let f=u.label??r!==""?r:n;o.push((0,Nm.Record)({table:"sys_documentation",$id:`${n}_${r?r+"_":""}${u.language}`,data:{label:f,element:r,name:n,...u}}))}),o}e(Yln,"composeDocumentation");function Qln(r){if(!(!r||(0,aw.isArray)(r)))return r}e(Qln,"getLabel");function Zln(r){switch(r.entityKind){case"conditions":case"glide_list":return 4e3;case"decimal":return 20;case"domain_id":case"document_id":case"reference":return 32;case"domain_path":case"user_roles":return 255;case"script":return 8e3;case"table_name":case"field_name":return 80;default:return 40}}e(Zln,"getDefaultMaxLength");function Kyr(r,n,a,o){let u={},f=[];for(let[h,y]of Object.entries(r)){let{maxLength:b,...x}=y,A=Ryr.parse(x),I=A.dynamic_value_definitions||A.choices,w={name:h,type:A.entityKind==="generic"?A.column_type:A.entityKind,attributes:A.attributes??void 0,reference:A.referenceTable,reference_cascade_rule:A.referenceTable?A.cascadeRule:void 0,audit:A.audit,label:Qln(A.label)??h,max_length:b??Zln(A),mandatory:A.mandatory,read_only:A.read_only,choice:Nm.choiceDropdown.indexOf(A.dropdown??(I?"dropdown_with_none":"none")),display:o?o===h:!1,virtual:A.dynamic_value_definitions?.type==="calculated_value"?!0:void 0,calculation:A.dynamic_value_definitions?.type==="calculated_value"?typeof A.dynamic_value_definitions.calculated_value=="string"?A.dynamic_value_definitions.calculated_value:Iyr.ModuleFunctionData.getGlueCode(A.dynamic_value_definitions.calculated_value,W=>`${W}(current)`):void 0,choice_table:A.dynamic_value_definitions?.type==="choices_from_other_table"?A.dynamic_value_definitions.table:void 0,choice_field:A.dynamic_value_definitions?.type==="choices_from_other_table"?A.dynamic_value_definitions.field:void 0,use_dependent_field:A.dynamic_value_definitions?.type==="dependent_field"||void 0,dependent:A.dynamic_value_definitions?.type==="dependent_field"?A.dynamic_value_definitions.column_name:void 0,default:A.default,function_definition:A.function_definition,function_field:!!A.function_definition,plural:A.plural,hint:A.hint,help:A.help,widget:A.widget,table_reference:A.table_reference,element_reference:A.element_reference,reference_key:A.reference_key,spell_check:A.spell_check,xml_view:A.xml_view,reference_floats:A.reference_floats,dynamic_creation:A.dynamic_creation,dynamic_creation_script:A.dynamic_creation_script,array:A.array,text_index:A.text_index,primary:A.primary,unique:A.unique,reference_qual:A.reference_qual};f.push(...Yln(h,a,A.label)),A.choices&&(Object.keys(A.choices).forEach(W=>{(0,aw.isObject)(A.choices[W])?A.choices[W]={value:W,...A.choices[W]}:A.choices[W]={value:W,label:A.choices[W]}}),w.choice_elements=la.z.record(Xln).parse(A.choices)),u[h]=w}return{columnData:u,documentation:f}}e(Kyr,"composeColumns");function qyr(r){return r.live_feed&&(r.attributes={...r.attributes,live_feed:!0}),{name:r.name,type:"collection",extends:r.extends,label:Qln(r.label)??r.name,is_extendable:r.extensible,text_index:r.text_index,read_only:r.read_only,audit:r.audit,access:r.accessible_from,caller_access:Pve.indexOf(r.caller_access??"none"),read_access:r.actions?.includes("read"),update_access:r.actions?.includes("update"),create_access:r.actions?.includes("create"),delete_access:r.actions?.includes("delete"),ws_access:r.allow_web_service_access,alter_access:r.allow_new_fields,actions_access:r.allow_ui_actions,client_scripts_access:r.allow_client_scripts,scriptable_table:r.scriptable_table,attributes:r.attributes}}e(qyr,"compose");var zln={client_scripts_access:"allow_client_scripts",alter_access:"allow_new_fields",actions_access:"allow_ui_actions",ws_access:"allow_web_service_access",is_extendable:"extensible",access:"accessible_from",live_feed_enabled:"live_feed"};function Gln(r){return Object.keys(r).forEach(n=>{zln[n]&&(r[zln[n]]=r[n],delete r[n])}),r}e(Gln,"mapNames");function Jyr(r,n,a,o){let u=(0,Mp.getOrCreatePropertyAssignment)(a,"schema","{}");if(!n)return;let f=u.getChildrenOfKind(Ym.ts.SyntaxKind.ObjectLiteralExpression)[0];if(!f)return;let h={};f.getProperties().forEach(y=>{let b=y.asKindOrThrow(Ym.ts.SyntaxKind.PropertyAssignment),x=b.getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.Identifier).getText(),A=b.getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.CallExpression),I=A.getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.Identifier).getText(),w=A.getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.ObjectLiteralExpression);h[x]={node:b,type:I,objectLiteral:w},n[x]||(0,Mp.removeNode)(b)}),!(!r||(0,aw.isEmpty)(r))&&Object.keys(n).forEach(y=>{let b=r[y];if(h[y]){let x=h[y];if(b)if(b.type&&x.type!==b.type){(0,Mp.removeNode)(x.node);let A=Hln(b.type);Uln(f,A.name,n[y],o)}else{let A=ecn(b,x.type);(0,Mp.mergeDataIntoObjectLiteral)(x.objectLiteral,{...A,choices:b.choice_elements})}x.node&&!x.node.wasForgotten()&&($yr(x,n[y]),Xyr(x,n[y]))}else{let x=Hln(b.type);Uln(f,x.name,b,o)}})}e(Jyr,"transformColumns");function $yr(r,n){let a=r.objectLiteral.getProperties().reduce((f,h)=>({...f,[(0,Mp.getObjectPropertyAssignmentName)(h)]:h}),{});if(!a.choices)return;if(!n.choice_elements){(0,Mp.removeNode)(a.choices);return}let o=Object.keys(n.choice_elements),u=a.choices.getFirstChildByKind(Ym.ts.SyntaxKind.ObjectLiteralExpression).getProperties().reduce((f,h)=>({...f,[(0,Mp.getObjectPropertyAssignmentName)(h)]:h}),{});Object.keys(u).forEach(f=>{o.includes(f)||(0,Mp.removeNode)(u[f])})}e($yr,"removeChoicesIfNecessary");function Xyr(r,n){let a=r.objectLiteral.getProperties().reduce((u,f)=>({...u,[(0,Mp.getObjectPropertyAssignmentName)(f)]:f}),{});if(!a.attributes)return;if(!n.attributes){(0,Mp.removeNode)(a.attributes);return}let o=a.attributes.getFirstChildByKind(Ym.ts.SyntaxKind.ObjectLiteralExpression).getProperties().reduce((u,f)=>({...u,[(0,Mp.getObjectPropertyAssignmentName)(f)]:f}),{});Object.keys(o).forEach(u=>{u in n.attributes||(0,Mp.removeNode)(o[u])})}e(Xyr,"removeAttributesIfNecessary");function Yyr(r,n,a,...o){let{sourceFile:u,moduleSpecifier:f}=n;return(0,Mp.generateCallExpressionExport)(r,u,f,n.exportName,a,...o)}e(Yyr,"generateNamedCallExpressionExportForDocument");function Uln(r,n,a,o){let f=r.addPropertyAssignment({name:a.name,initializer:`${n}({})`}).getInitializer().getFirstChildByKindOrThrow(Ym.ts.SyntaxKind.ObjectLiteralExpression),h=ecn(a,n);(0,Mp.mergeDataIntoObjectLiteral)(f,{...h,choices:a.choice_elements}),(0,Mp.addNamedImportIfAbsent)(o,r.getSourceFile(),"@servicenow/sdk/core",{name:n})}e(Uln,"createNewColumn");function Qyr(r){let n=[];return r.read_access&&n.push("read"),r.update_access&&n.push("update"),r.delete_access&&n.push("delete"),r.create_access&&n.push("create"),n}e(Qyr,"getActionsArray");function Zyr(r=[],n){r.forEach(a=>{let o=n.ele("index",{name:a.name,unique:a.unique});(0,aw.isArray)(a.element)?a.element.forEach(u=>{o.ele("element",{name:u})}):o.ele("element",{name:a.element})})}e(Zyr,"buildIndexes");function evr(r,n){if(!r.choice_elements)return;let a=n.ele("choice");if(Array.isArray(r.choices)&&r.choices.length>0)for(let o in r.choices)a.ele("element",{value:r.choices[o],label:r.choices[o]});else Object.entries(r.choice_elements).forEach(o=>{(0,aw.isObject)(o[1])?a.ele("element",{value:o[0],...o[1]}):a.ele("element",{value:o[1],label:o[0]})})}e(evr,"buildChoices");function ecn(r,n){let{type:a,choice:o,name:u,virtual:f,display:h,choice_table:y,choice_field:b,use_dependent_field:x,dependent:A,calculation:I,use_dynamic_default:w,default_value:W,choice_elements:G,table:O,default:k,max_length:B,reference:Y,reference_cascade_rule:Q,function_field:ne,reference_qual_condition:de,...be}=r;return B!==void 0&&(be.maxLength=(0,aw.parseInt)(B,10)),a&&n==="GenericColumn"&&(be.column_type=a),o!==void 0&&(be.dropdown=Nm.choiceDropdown[o]),Y&&(be.referenceTable=Y),Q&&(be.cascadeRule=Q),I?be.dynamic_value_definitions={type:"calculated_value",calculated_value:I}:y||b?be.dynamic_value_definitions={type:"choices_from_other_table",table:y,field:b}:A?be.dynamic_value_definitions={type:"dependent_field",column_name:A}:k?be.default=k:W&&(be.default=W),be.label&&be.label===u&&delete be.label,((0,aw.isEmpty)(be.attributes)||tvr(be.attributes))&&delete be.attributes,be}e(ecn,"transformColumnData");function tvr(r){return r&&Object.entries(r).length===1&&r.edge_encryption_enabled!==void 0&&r.edge_encryption_enabled}e(tvr,"isDefaultEdgeEncryptionAttribute");function Vln(r){return Object.entries(r).forEach(([n,a])=>{n.startsWith("@_")&&(r[n.substring(2)]=a,delete r[n])}),r}e(Vln,"removeAttributeTag");function nvr(r,n,a,o){return(0,Nm.Record)({table:"sys_number",$id:`${r}_${o}`,data:{category:r,maximum_digits:n??1e3,number:a??7,prefix:o??"PRE"}})}e(nvr,"SysNumber");function rvr(r,n,a){let o={...n};return a&&Object.keys(a).forEach(u=>{a[u]!==void 0&&(o[u]=a[u])}),Ym.tsc.factory.createCallExpression(Ym.tsc.factory.createIdentifier(r.name),void 0,[mbt(o)])}e(rvr,"generateColumnExpression");function mbt(r){return Ym.tsc.factory.createObjectLiteralExpression(Object.entries(r).filter(([n,a])=>a!==void 0).map(([n,a])=>n==="referenceTable"?Ym.tsc.factory.createPropertyAssignment(Ym.tsc.factory.createIdentifier("referenceTable"),Ym.tsc.factory.createStringLiteral(a)):n==="calculated_value"?Ym.tsc.factory.createPropertyAssignment(Ym.tsc.factory.createIdentifier(n),Ym.tsc.factory.createTaggedTemplateExpression(Ym.tsc.factory.createIdentifier("script"),void 0,Ym.tsc.factory.createNoSubstitutionTemplateLiteral(a,a))):n==="maxLength"?isNaN(+a)?Ym.tsc.factory.createPropertyAssignment(Ym.tsc.factory.createIdentifier(n),Ym.tsc.factory.createAsExpression(Ym.tsc.factory.createStringLiteral(a),Ym.tsc.factory.createKeywordTypeNode(Ym.ts.SyntaxKind.AnyKeyword))):Ym.tsc.factory.createPropertyAssignment(Ym.tsc.factory.createIdentifier(n),Ym.tsc.factory.createNumericLiteral(a)):Ym.tsc.factory.createPropertyAssignment((0,Mp.createPropertyIdentifier)(n),tcn(a,Ym.tsc.factory))))}e(mbt,"createObjectExpression");function tcn(r,n){if(typeof r=="string")return n.createStringLiteral(r);if(typeof r=="number")return r>=0?n.createNumericLiteral(r):n.createPrefixUnaryExpression(Ym.tsc.SyntaxKind.MinusToken,n.createNumericLiteral(Math.abs(r)));if(typeof r=="boolean")return r?n.createTrue():n.createFalse();if(typeof r=="object"){if(r===null)return n.createNull();if((0,aw.isArray)(r)){let a=[];return Object.values(r).forEach(o=>{a.push(tcn(o,n))}),n.createArrayLiteralExpression(a)}else return Ym.ts.Structure.isImportSpecifier(r)?n.createIdentifier(r.name):mbt(r)}return n.createNull()}e(tcn,"factoryCreateValue");function Hln(r){switch(r){case void 0:case"string":return Nm.StringColumn;case"boolean":return Nm.BooleanColumn;case"choice":return Nm.ChoiceColumn;case"conditions":return Nm.ConditionsColumn;case"date":return Nm.OtherDateColumn;case"calendar_date_time":return Nm.CalendarDateTimeColumn;case"datetime":return Nm.BasicDateTimeColumn;case"due_date":return Nm.DueDateColumn;case"glide_date":return Nm.DateColumn;case"glide_date_time":return Nm.DateTimeColumn;case"integer_date":return Nm.IntegerDateColumn;case"schedule_date_time":return Nm.ScheduleDateTimeColumn;case"decimal":return Nm.DecimalColumn;case"document_id":return Nm.DocumentIdColumn;case"domain_id":return Nm.DomainIdColumn;case"domain_path":return Nm.DomainPathColumn;case"field_name":return Nm.FieldNameColumn;case"integer":return Nm.IntegerColumn;case"radio":return Nm.RadioColumn;case"reference":return Nm.ReferenceColumn;case"script":return Nm.ScriptColumn;case"sys_class_name":return Nm.SystemClassNameColumn;case"table_name":return Nm.TableNameColumn;case"translated_field":return Nm.TranslatedFieldColumn;case"translated_text":return Nm.TranslatedTextColumn;case"user_roles":return Nm.UserRolesColumn;case"version":return Nm.VersionColumn;case"glide_list":return Nm.ListColumn;case"image":return Nm.BasicImageColumn;case"int":case"string_types":case"approval_rules":case"audio":case"auto_increment":case"auto_number":case"bootstrap_color":case"breakdown_element":case"catalog_preview":case"char":case"collection":case"color":case"color_display":case"composite_field":case"composite_name":case"compressed":case"condition_string":case"counter":case"css":case"currency":case"currency2":case"data_array":case"data_object":case"data_structure":case"days_of_week":case"day_of_week":case"documentation_field":case"dynamic_json":case"email":case"email_script":case"expression":case"external_names":case"field_list":case"file_attachment":case"float":case"formula":case"geo_point":case"glide_action_list":case"glide_duration":case"glide_precise_time":case"glide_time":case"glide_utc_time":case"glide_var":case"glyphicon":case"graphql_schema":case"GUID":case"html":case"html_script":case"html_template":case"icon":case"index_name":case"insert_timestamp":case"integer_time":case"internal_type":case"ip_addr":case"ip_address":case"journal":case"journal_input":case"journal_list":case"json":case"json_translations":case"language":case"long":case"longint":case"mask_code":case"metric_absolute":case"metric_counter":case"metric_derive":case"metric_gauge":case"mid_config":case"month_of_year":case"multi_small":case"multi_two_lines":case"name_values":case"nds_icon":case"nl_task_int1":case"order_index":case"password":case"password2":case"percent_complete":case"phone_number":case"phone_number_e164":case"ph_number":case"price":case"properties":case"records":case"reference_name":case"related_tags":case"reminder_field_name":case"repeat_count":case"repeat_type":case"replication_payload":case"schedule_interval_count":case"script_client":case"script_plain":case"script_server":case"short_field_name":case"short_table_name":case"simple_name_values":case"slushbucket":case"snapshot_template_value":case"source_id":case"source_name":case"source_table":case"string_boolean":case"string_full_utf8":case"structure":case"sysevent_name":case"sysrule_field_name":case"sys_class_path":case"template_value":case"time":case"timer":case"translated":case"translated_html":case"tree_code":case"tree_path":case"url":case"user_image":case"user_input":case"variables":case"variable_conditions":case"variable_template_value":case"video":case"week_of_month":case"wide_text":case"wiki_text":case"wms_job":case"workflow":case"workflow_conditions":case"xml":default:return Nm.GenericColumn}}e(Hln,"getCallExpressionFromType")});var rcn=yn(ybt=>{"use strict";me();ye();he();ge();Object.defineProperty(ybt,"__esModule",{value:!0});var _P=Uh(),Iwe=mc(),ivr=hbt(),_L=mp(),gbt=P6(),avr=XC();function ovr(r){try{return(0,_P.getCallExpressionName)(r)===Iwe.Record.name&&r.getArguments()[0]?.getProperty("table")?.getInitializerIfKind(_L.ts.SyntaxKind.StringLiteral)?.getLiteralValue()==="sys_documentation"}catch{}return!1}e(ovr,"isSysDocumentationRecord");var ncn=e(r=>`${r.name}_${r.element?r.element+"_":""}${r.language}`,"generateSysId");ybt.default=(0,_P.Plugin)({name:"Documentation",extractors:{entity:{fluent:{CallExpression:e((r,n)=>{if(ovr(r)){let a=(0,_P.extractCallExpression)(Iwe.Record,"record",r,n,o=>ncn(o.data),o=>gbt.RecordEntitySchema.safeParse(o).success);return!a.handled||!a.data?a:{handled:!0,diagnostics:a.diagnostics,data:a.data}}return{handled:!1}},"CallExpression")}}},composers:{xml:{sys_documentation(r){let n=r.data.data;return{kind:"sys_documentation",guid:ncn(n),data:r.data,action:r.action}}}},serializers:{sys_documentation(r,n){return gbt.RecordPlugin.serializers.record(r,n)}},arrangers:{sys_documentation(r){if(r.data.table!=="sys_documentation")return{handled:!1};let n=r.data.data.name;return{handled:!0,result:n?{kind:"bootstrap",guid:n}:void 0}}},generators:{sys_documentation(r,n,a){let o=r.data.data.name,u=a.find(f=>f.guid===o);return u&&u.node?{...r,node:u.node}:(0,_P.linkDocument)(r,(0,_P.generateCallExpressionExportForDocument)(n,{sourceFile:(0,_P.getOrCreateEntitySourceFile)(n,`${r.guid}`),moduleSpecifier:"@servicenow/sdk/core"},Iwe.Record,{$id:r.guid}).getExpressionIfKindOrThrow(_L.ts.SyntaxKind.CallExpression))}},transformers:{sys_documentation:{CallExpression(r,n){if((0,_P.getCallExpressionName)(r.node)!==Iwe.Table.name)return gbt.RecordPlugin.transformers.record.CallExpression(r,n);let{element:o}=r.data.data,[u]=r.node.getArguments();if(!u)return!1;let f=r.data.data;delete f.element,delete f.name,delete f.sys_id;let h,y,b;if(o){let I=(0,_P.getPropertyAssignment)(u,"schema")?.getChildrenOfKind(_L.ts.SyntaxKind.ObjectLiteralExpression)[0];if(!I)return!1;let w=I.getProperties().find(G=>o===G.getFirstChildByKindOrThrow(_L.ts.SyntaxKind.Identifier).getText().trim());if(!w)return!1;let W=w.getFirstChildByKind(_L.ts.SyntaxKind.CallExpression);if(!W||(y=W.getFirstChildByKind(_L.ts.SyntaxKind.ObjectLiteralExpression),!y))return!1;b=w.getFirstChildByKindOrThrow(_L.ts.SyntaxKind.Identifier),h=(0,_P.getPropertyAssignment)(y,"label")}else{if(y=u.asKind(_L.ts.SyntaxKind.ObjectLiteralExpression)??u.getFirstDescendantByKind(_L.ts.SyntaxKind.ObjectLiteralExpression),!y)return!1;b=(0,_P.getPropertyAssignment)(y,"name"),h=(0,_P.getPropertyAssignment)(y,"label")}let x=h?.getFirstChildByKind(_L.ts.SyntaxKind.ArrayLiteralExpression);if(x)return(0,_P.mergeDataIntoObjectLiteralArray)(x,[f],"language",r.action),!0;{let A=h?.getFirstChildByKind(_L.ts.SyntaxKind.StringLiteral);return cvr(f)?svr(A,f,b,y):lvr(h,y,f)}}}}});function svr(r,n,a,o){if(r){if(r.getLiteralValue()&&n.label?.toLowerCase().trim()===r.getLiteralValue().toLowerCase().trim())return!0;r.setLiteralValue(n.label)}else{if(a&&a.getText().toLowerCase().trim()===n.label?.toLowerCase().trim())return!0;(0,_P.getOrCreatePropertyAssignment)(o,"label",(0,_P.stringify)(n.label))}return!0}e(svr,"updateDefaultLabelParameters");function lvr(r,n,a){r=(0,_P.getOrCreatePropertyAssignment)(n,"label","[]");let o=r.getFirstChildByKind(_L.ts.SyntaxKind.StringLiteral)?.getLiteralText();return r.transform(u=>{if(_L.tsc.isPropertyAssignment(u.currentNode)){let f=u.factory.createArrayLiteralExpression([(0,ivr.createObjectExpression)({...(0,_P.filterEmpty)(a)})]);return u.factory.updatePropertyAssignment(u.currentNode,_L.tsc.factory.createIdentifier("label"),f)}return u.currentNode}),o&&a.label?.toLowerCase().trim()!==o.toLowerCase().trim()&&r.getFirstChildByKindOrThrow(_L.ts.SyntaxKind.ArrayLiteralExpression).addElement((0,_P.stringify)({label:o})),!0}e(lvr,"createArrayLabel");function cvr(r){let{label:n,name:a,element:o}=r,u=uvr(n,a,o);return(0,avr.isEqual)(u.data,r)}e(cvr,"isDefaultDocumentationRecord");function uvr(r,n,a){return(0,Iwe.Record)({table:"sys_documentation",$id:`${n}_${a?a+"_":""}en`,data:{label:r,hint:"",help:"",language:"en",plural:_vr(r),url:"",url_target:""}})}e(uvr,"defaultDocumentationRecord");var dvr=["s","ed","by","Active",")"," to"," with"," for"," in"," out"," use","Data"," data"],fvr=["ry","ty","dy","cy","fy","ly","ny"],pvr=["x","sh","ch","z"];function _vr(r){if(!r)return"";for(let n of dvr)if(r.endsWith(n))return r;for(let n of fvr)if(r.endsWith(n))return r.substring(0,r.lastIndexOf("y"))+"ies";for(let n of pvr)if(r.endsWith(n))return r+"es";return r+"s"}e(_vr,"generatePlural")});var ocn=yn($te=>{"use strict";me();ye();he();ge();Object.defineProperty($te,"__esModule",{value:!0});$te.ua_table_licensing_config=void 0;var Jte=Uh(),vbt=mc(),icn=P6(),mVe=mp(),mvr=XC();$te.ua_table_licensing_config="ua_table_licensing_config";$te.default=(0,Jte.Plugin)({name:"LicensingConfig",composers:{xml:{ua_table_licensing_config(r){return{kind:$te.ua_table_licensing_config,guid:r.data.id??(0,Jte.GUID)(),data:r.data,action:r.action}}}},serializers:{ua_table_licensing_config(r,n){return icn.RecordPlugin.serializers.record(r,n)}},arrangers:{ua_table_licensing_config(r){if(r.data.table!==$te.ua_table_licensing_config)return{handled:!1};let n=r.data.data.name;return{handled:!0,result:n?{kind:"bootstrap",guid:n}:void 0}}},generators:{ua_table_licensing_config(r,n,a){let o=a.find(u=>u.guid===r.data.data.name);return o&&o.node?{...r,node:o.node}:(0,Jte.linkDocument)(r,(0,Jte.generateCallExpressionExportForDocument)(n,{sourceFile:(0,Jte.getOrCreateEntitySourceFile)(n,`${r.kind}_${r.guid}`),moduleSpecifier:"@servicenow/sdk/core"},vbt.Record,{$id:r.guid}).getExpressionIfKindOrThrow(mVe.ts.SyntaxKind.CallExpression))}},transformers:{ua_table_licensing_config:{CallExpression(r,n){if((0,Jte.getCallExpressionName)(r.node)!==vbt.Table.name)return icn.RecordPlugin.transformers.record.CallExpression(r,n);let[o]=r.node.getArguments();if(!o)return!1;let u=r.changedData.data,f=r.data.data,h,y,b=(0,Jte.getPropertyAssignment)(o,"licensing_config");if(b)y=u,h=b.getFirstChildByKindOrThrow(mVe.ts.SyntaxKind.ObjectLiteralExpression);else{if(hvr(f))return!0;let x=acn(f.name).data;y={},Object.entries(f).filter(([w])=>f[w]!==x[w]).map(([w,W])=>{y[w]=W}),h=r.node.getFirstChildByKindOrThrow(mVe.ts.SyntaxKind.ObjectLiteralExpression).addPropertyAssignment({name:"licensing_config",initializer:"{}"}).getFirstChildByKindOrThrow(mVe.ts.SyntaxKind.ObjectLiteralExpression)}return y.license_roles&&(y.license_roles=y.license_roles.split(",")),(0,Jte.mergeDataIntoObjectLiteral)(h,y),!0}}}});function hvr(r){return(0,mvr.isEqual)(r,acn(r.name).data)}e(hvr,"isDefaultLicensingConfig");function acn(r){return(0,vbt.Record)({table:$te.ua_table_licensing_config,$id:`${r}_license`,data:{name:r,op_insert:!0,op_update:!0,op_delete:!0,is_fulfillment:!1,license_model:"none",owner_condition:"",license_condition:"",license_roles:""}})}e(acn,"defaultLicensingConfigRecord")});var Sbt=yn(AA=>{"use strict";me();ye();he();ge();var gvr=AA&&AA.__createBinding||(Object.create?function(r,n,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(n,a);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:e(function(){return n[a]},"get")}),Object.defineProperty(r,o,u)}:function(r,n,a,o){o===void 0&&(o=a),r[o]=n[a]}),scn=AA&&AA.__exportStar||function(r,n){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(n,a)&&gvr(n,r,a)},bbt=AA&&AA.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(AA,"__esModule",{value:!0});AA.LicensingPlugin=AA.DocumentationPlugin=AA.RecordPlugin=AA.generateColumnExpression=AA.TablePlugin=void 0;scn(qtn(),AA);var lcn=hbt();Object.defineProperty(AA,"TablePlugin",{enumerable:!0,get:e(function(){return bbt(lcn).default},"get")});Object.defineProperty(AA,"generateColumnExpression",{enumerable:!0,get:e(function(){return lcn.generateColumnExpression},"get")});var yvr=P6();Object.defineProperty(AA,"RecordPlugin",{enumerable:!0,get:e(function(){return yvr.RecordPlugin},"get")});var vvr=rcn();Object.defineProperty(AA,"DocumentationPlugin",{enumerable:!0,get:e(function(){return bbt(vvr).default},"get")});var bvr=ocn();Object.defineProperty(AA,"LicensingPlugin",{enumerable:!0,get:e(function(){return bbt(bvr).default},"get")});scn(oze(),AA)});var ccn=yn(Rve=>{"use strict";me();ye();he();ge();Object.defineProperty(Rve,"__esModule",{value:!0});Rve.ExperienceSchema=void 0;Rve.Experience=Svr;var Xte=VS();Rve.ExperienceSchema=Xte.z.object({$id:Xte.z.string().or(Xte.z.number()),name:Xte.z.string(),active:Xte.z.boolean().default(!0),baseUrlPath:Xte.z.string().default(""),landingPath:Xte.z.string().default(""),description:Xte.z.string().default("")});var O1i=Rve.ExperienceSchema.omit({$id:!0});function Svr(r){return r}e(Svr,"Experience")});var ucn=yn(kve=>{"use strict";me();ye();he();ge();Object.defineProperty(kve,"__esModule",{value:!0});kve.BaseUXRouteSchema=void 0;kve.Routes=Evr;var FV=VS();kve.BaseUXRouteSchema=FV.z.object({$id:FV.z.string().or(FV.z.number()),name:FV.z.string(),active:FV.z.boolean().default(!0),description:FV.z.string().default(""),component:FV.z.object({tagName:FV.z.string(),properties:FV.z.record(FV.z.string()).optional()})});var U1i=kve.BaseUXRouteSchema.omit({$id:!0});function Evr(r){return r}e(Evr,"Routes")});var Ebt=yn(Yte=>{"use strict";me();ye();he();ge();var xvr=Yte&&Yte.__createBinding||(Object.create?function(r,n,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(n,a);(!u||("get"in u?!n.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:e(function(){return n[a]},"get")}),Object.defineProperty(r,o,u)}:function(r,n,a,o){o===void 0&&(o=a),r[o]=n[a]}),dcn=Yte&&Yte.__exportStar||function(r,n){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(n,a)&&xvr(n,r,a)};Object.defineProperty(Yte,"__esModule",{value:!0});dcn(ccn(),Yte);dcn(ucn(),Yte)});var xbt=yn(Lve=>{"use strict";me();ye();he();ge();Object.defineProperty(Lve,"__esModule",{value:!0});Lve.PARENT_APP_SHELL_ID=Lve.WORKSPACE_APP_SHELL_ID=void 0;Lve.WORKSPACE_APP_SHELL_ID="c276387cc331101080d6d3658940ddd2";Lve.PARENT_APP_SHELL_ID="c86a62e2c7022010099a308dc7c26022"});var hcn=yn(Tbt=>{"use strict";me();ye();he();ge();Object.defineProperty(Tbt,"__esModule",{value:!0});var fcn=Ebt(),pcn=mc(),_cn=Uh(),mcn=xbt();Tbt.default=(0,_cn.Plugin)({name:"Experience",ownedTables:{},extractors:{entity:{fluent:{CallExpression:e((r,n)=>(0,_cn.extractCallExpression)(fcn.Experience,"experience",r,n,a=>n.registerExplicitId("sys_ux_app_config",a.$id)),"CallExpression")}}},composers:{entity:{experience(r,n){let a=r.getNode(),o=r.getValue(),u=r.getGuid(),f=fcn.ExperienceSchema.parse(o),h=(0,pcn.Record)({table:"sys_ux_app_config",$id:u,data:{name:f.name,active:f.active,base_url_path:f.baseUrlPath,landing_path:f.landingPath,description:f.description}}),y=(0,pcn.Record)({table:"sys_ux_page_registry",$id:n.registerExplicitId("sys_ux_page_registry",`${u}_registry`),data:{title:f.name,active:f.active,admin_panel:h.$id,admin_panel_table:"sys_ux_app_config",parent_app:mcn.PARENT_APP_SHELL_ID,path:f.baseUrlPath,root_macroponent:mcn.WORKSPACE_APP_SHELL_ID}});return Promise.resolve([h,y].map(b=>({kind:"record",guid:b.$id,node:a,data:b})))}}}})});var ycn=yn((gcn,hVe)=>{me();ye();he();ge();(function(r,n){typeof hVe=="object"&&hVe.exports?hVe.exports=n():r.nearley=n()})(gcn,function(){function r(b,x,A){return this.id=++r.highestId,this.name=b,this.symbols=x,this.postprocess=A,this}e(r,"Rule"),r.highestId=0,r.prototype.toString=function(b){var x=typeof b>"u"?this.symbols.map(y).join(" "):this.symbols.slice(0,b).map(y).join(" ")+" \u25CF "+this.symbols.slice(b).map(y).join(" ");return this.name+" \u2192 "+x};function n(b,x,A,I){this.rule=b,this.dot=x,this.reference=A,this.data=[],this.wantedBy=I,this.isComplete=this.dot===b.symbols.length}e(n,"State"),n.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},n.prototype.nextState=function(b){var x=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return x.left=this,x.right=b,x.isComplete&&(x.data=x.build(),x.right=void 0),x},n.prototype.build=function(){var b=[],x=this;do b.push(x.right.data),x=x.left;while(x.left);return b.reverse(),b},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,f.fail))};function a(b,x){this.grammar=b,this.index=x,this.states=[],this.wants={},this.scannable=[],this.completed={}}e(a,"Column"),a.prototype.process=function(b){for(var x=this.states,A=this.wants,I=this.completed,w=0;w<x.length;w++){var W=x[w];if(W.isComplete){if(W.finish(),W.data!==f.fail){for(var G=W.wantedBy,O=G.length;O--;){var k=G[O];this.complete(k,W)}if(W.reference===this.index){var B=W.rule.name;(this.completed[B]=this.completed[B]||[]).push(W)}}}else{var B=W.rule.symbols[W.dot];if(typeof B!="string"){this.scannable.push(W);continue}if(A[B]){if(A[B].push(W),I.hasOwnProperty(B))for(var Y=I[B],O=0;O<Y.length;O++){var Q=Y[O];this.complete(W,Q)}}else A[B]=[W],this.predict(B)}}},a.prototype.predict=function(b){for(var x=this.grammar.byName[b]||[],A=0;A<x.length;A++){var I=x[A],w=this.wants[b],W=new n(I,0,this.index,w);this.states.push(W)}},a.prototype.complete=function(b,x){var A=b.nextState(x);this.states.push(A)};function o(b,x){this.rules=b,this.start=x||this.rules[0].name;var A=this.byName={};this.rules.forEach(function(I){A.hasOwnProperty(I.name)||(A[I.name]=[]),A[I.name].push(I)})}e(o,"Grammar"),o.fromCompiled=function(I,x){var A=I.Lexer;I.ParserStart&&(x=I.ParserStart,I=I.ParserRules);var I=I.map(function(W){return new r(W.name,W.symbols,W.postprocess)}),w=new o(I,x);return w.lexer=A,w};function u(){this.reset("")}e(u,"StreamLexer"),u.prototype.reset=function(b,x){this.buffer=b,this.index=0,this.line=x?x.line:1,this.lastLineBreak=x?-x.col:0},u.prototype.next=function(){if(this.index<this.buffer.length){var b=this.buffer[this.index++];return b===`
48263
48263
  `&&(this.line+=1,this.lastLineBreak=this.index),{value:b}}},u.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},u.prototype.formatError=function(b,x){var A=this.buffer;if(typeof A=="string"){var I=A.split(`
48264
48264
  `).slice(Math.max(0,this.line-5),this.line),w=A.indexOf(`
48265
48265
  `,this.index);w===-1&&(w=A.length);var W=this.index-this.lastLineBreak,G=String(this.line).length;return x+=" at line "+this.line+" col "+W+`: