@squiz/component-cli-lib 1.72.4 → 1.72.6
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/lib/index.js +1 -1
- package/lib/index.js.map +2 -2
- package/package.json +2 -3
package/lib/index.js
CHANGED
|
@@ -182,7 +182,7 @@ ${(0,$p.toHex)(s)}`}getCanonicalPath({path:t}){if(this.uriEscapePath){let r=[];f
|
|
|
182
182
|
`,this.newLine=`
|
|
183
183
|
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Vp.prototype.build=function(e){return this.options.preserveOrder?$ur(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)};Vp.prototype.j2x=function(e,t){let r="",n="";for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i))if(typeof e[i]>"u")this.isAttribute(i)&&(n+="");else if(e[i]===null)this.isAttribute(i)?n+="":i[0]==="?"?n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)n+=this.buildTextValNode(e[i],i,"",t);else if(typeof e[i]!="object"){let s=this.isAttribute(i);if(s)r+=this.buildAttrPairStr(s,""+e[i]);else if(i===this.options.textNodeName){let o=this.options.tagValueProcessor(i,""+e[i]);n+=this.replaceEntitiesValue(o)}else n+=this.buildTextValNode(e[i],i,"",t)}else if(Array.isArray(e[i])){let s=e[i].length,o="",a="";for(let c=0;c<s;c++){let l=e[i][c];if(!(typeof l>"u"))if(l===null)i[0]==="?"?n+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(typeof l=="object")if(this.options.oneListGroup){let u=this.j2x(l,t+1);o+=u.val,this.options.attributesGroupName&&l.hasOwnProperty(this.options.attributesGroupName)&&(a+=u.attrStr)}else o+=this.processTextOrObjNode(l,i,t);else if(this.options.oneListGroup){let u=this.options.tagValueProcessor(i,l);u=this.replaceEntitiesValue(u),o+=u}else o+=this.buildTextValNode(l,i,"",t)}this.options.oneListGroup&&(o=this.buildObjectNode(o,i,a,t)),n+=o}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){let s=Object.keys(e[i]),o=s.length;for(let a=0;a<o;a++)r+=this.buildAttrPairStr(s[a],""+e[i][s[a]])}else n+=this.processTextOrObjNode(e[i],i,t);return{attrStr:r,val:n}};Vp.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&t==="true"?" "+e:" "+e+'="'+t+'"'};function Gur(e,t,r){let n=this.j2x(e,r+1);return e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r):this.buildObjectNode(n.val,t,n.attrStr,r)}Vp.prototype.buildObjectNode=function(e,t,r,n){if(e==="")return t[0]==="?"?this.indentate(n)+"<"+t+r+"?"+this.tagEndChar:this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar;{let i="</"+t+this.tagEndChar,s="";return t[0]==="?"&&(s="?",i=""),(r||r==="")&&e.indexOf("<")===-1?this.indentate(n)+"<"+t+r+s+">"+e+i:this.options.commentPropName!==!1&&t===this.options.commentPropName&&s.length===0?this.indentate(n)+`<!--${e}-->`+this.newLine:this.indentate(n)+"<"+t+r+s+this.tagEndChar+e+this.indentate(n)+i}};Vp.prototype.closeTag=function(e){let t="";return this.options.unpairedTags.indexOf(e)!==-1?this.options.suppressUnpairedNode||(t="/"):this.options.suppressEmptyNode?t="/":t=`></${e}`,t};Vp.prototype.buildTextValNode=function(e,t,r,n){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${e}]]>`+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(n)+`<!--${e}-->`+this.newLine;if(t[0]==="?")return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===""?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+i+"</"+t+this.tagEndChar}};Vp.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let r=this.options.entities[t];e=e.replace(r.regex,r.val)}return e};function Wur(e){return this.options.indentBy.repeat(e)}function zur(e){return e.startsWith(this.options.attributeNamePrefix)&&e!==this.options.textNodeName?e.substr(this.attrPrefixLen):!1}b5e.exports=Vp});var w5e=p((CVr,E5e)=>{"use strict";var Hur=Sz(),Kur=h5e(),Jur=S5e();E5e.exports={XMLParser:Kur,XMLValidator:Hur,XMLBuilder:Jur}});var x5e,C5e,T5e,Yur,Qur,A5e=ee(()=>{x5e=ve(Ze()),C5e=ve(w5e());vz();T5e=(e,t)=>xD(e,t).then(r=>{if(r.length){let n=new C5e.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(c,l)=>l.trim()===""&&l.includes(`
|
|
184
184
|
`)?"":void 0});n.addEntity("#xD","\r"),n.addEntity("#10",`
|
|
185
|
-
`);let i;try{i=n.parse(r,!0)}catch(c){throw c&&typeof c=="object"&&Object.defineProperty(c,"$responseBodyText",{value:r}),c}let s="#text",o=Object.keys(i)[0],a=i[o];return a[s]&&(a[o]=a[s],delete a[s]),(0,x5e.getValueFromTextNode)(a)}return{}}),Yur=async(e,t)=>{let r=await T5e(e,t);return r.Error&&(r.Error.message=r.Error.message??r.Error.Message),r},Qur=(e,t)=>{var r;if(((r=t==null?void 0:t.Error)==null?void 0:r.Code)!==void 0)return t.Error.Code;if((t==null?void 0:t.Code)!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"}});var O5e=ee(()=>{$4e();G4e();H4e();A5e()});var I5e={};Bs(I5e,{AWSSDKSigV4Signer:()=>f4e,AwsSdkSigV4ASigner:()=>_D,AwsSdkSigV4Signer:()=>Gh,NODE_SIGV4A_CONFIG_OPTIONS:()=>alr,_toBool:()=>$lr,_toNum:()=>Vlr,_toStr:()=>Blr,awsExpectUnion:()=>Glr,emitWarningIfUnsupportedVersion:()=>ilr,loadRestJsonErrorCode:()=>zlr,loadRestXmlErrorCode:()=>Qur,parseJsonBody:()=>z4e,parseJsonErrorBody:()=>Wlr,parseXmlBody:()=>T5e,parseXmlErrorBody:()=>Yur,resolveAWSSDKSigV4Config:()=>Ulr,resolveAwsSdkSigV4AConfig:()=>olr,resolveAwsSdkSigV4Config:()=>j4e,setCredentialFeature:()=>iz,setFeature:()=>slr,validateSigningProperties:()=>ww});var R5e=ee(()=>{sz();B4e();O5e()});var z5e=p((qVr,W5e)=>{"use strict";var AD=Object.defineProperty,Xur=Object.getOwnPropertyDescriptor,Zur=Object.getOwnPropertyNames,edr=Object.prototype.hasOwnProperty,rn=(e,t)=>AD(e,"name",{value:t,configurable:!0}),tdr=(e,t)=>{for(var r in t)AD(e,r,{get:t[r],enumerable:!0})},rdr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zur(t))!edr.call(e,i)&&i!==r&&AD(e,i,{get:()=>t[i],enumerable:!(n=Xur(t,i))||n.enumerable});return e},ndr=e=>rdr(AD({},"__esModule",{value:!0}),e),q5e={};tdr(q5e,{NumberValueImpl:()=>OD,convertToAttr:()=>Aw,convertToNative:()=>Tw,marshall:()=>G5e,unmarshall:()=>ldr});W5e.exports=ndr(q5e);var L5e=class j5e{constructor(t){typeof t=="object"&&"N"in t?this.value=String(t.N):this.value=String(t);let r=typeof t.valueOf()=="number"?t.valueOf():0;if(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER||Math.abs(r)===1/0||Number.isNaN(r))throw new Error(`NumberValue should not be initialized with an imprecise number=${r}. Use a string instead.`)}static from(t){return new j5e(t)}toAttributeValue(){return{N:this.toString()}}toBigInt(){let t=this.toString();return BigInt(t)}toString(){return String(this.value)}valueOf(){return this.toString()}};rn(L5e,"NumberValue");var OD=L5e,Aw=rn((e,t)=>{var r,n,i,s,o,a;if(e===void 0)throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(e===null&&typeof e=="object")return TD();if(Array.isArray(e))return idr(e,t);if(((r=e==null?void 0:e.constructor)==null?void 0:r.name)==="Set")return sdr(e,t);if(((n=e==null?void 0:e.constructor)==null?void 0:n.name)==="Map")return odr(e,t);if(((i=e==null?void 0:e.constructor)==null?void 0:i.name)==="Object"||!e.constructor&&typeof e=="object")return P5e(e,t);if(V5e(e))return e.length===0&&(t!=null&&t.convertEmptyValues)?TD():F5e(e);if(typeof e=="boolean"||((s=e==null?void 0:e.constructor)==null?void 0:s.name)==="Boolean")return{BOOL:e.valueOf()};if(typeof e=="number"||((o=e==null?void 0:e.constructor)==null?void 0:o.name)==="Number")return $5e(e);if(e instanceof OD)return e.toAttributeValue();if(typeof e=="bigint")return B5e(e);if(typeof e=="string"||((a=e==null?void 0:e.constructor)==null?void 0:a.name)==="String")return e.length===0&&(t!=null&&t.convertEmptyValues)?TD():U5e(e);if(t!=null&&t.convertClassInstanceToMap&&typeof e=="object")return P5e(e,t);throw new Error(`Unsupported type passed: ${e}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},"convertToAttr"),idr=rn((e,t)=>({L:e.filter(r=>typeof r!="function"&&(!(t!=null&&t.removeUndefinedValues)||(t==null?void 0:t.removeUndefinedValues)&&r!==void 0)).map(r=>Aw(r,t))}),"convertToListAttr"),sdr=rn((e,t)=>{let r=t!=null&&t.removeUndefinedValues?new Set([...e].filter(i=>i!==void 0)):e;if(!(t!=null&&t.removeUndefinedValues)&&r.has(void 0))throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(r.size===0){if(t!=null&&t.convertEmptyValues)return TD();throw new Error("Pass a non-empty set, or options.convertEmptyValues=true.")}let n=r.values().next().value;if(n instanceof OD)return{NS:Array.from(r).map(i=>i.toString())};if(typeof n=="number")return{NS:Array.from(r).map($5e).map(i=>i.N)};if(typeof n=="bigint")return{NS:Array.from(r).map(B5e).map(i=>i.N)};if(typeof n=="string")return{SS:Array.from(r).map(U5e).map(i=>i.S)};if(V5e(n))return{BS:Array.from(r).map(F5e).map(i=>i.B)};throw new Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},"convertToSetAttr"),odr=rn((e,t)=>({M:(r=>{let n={};for(let[i,s]of r)typeof s!="function"&&(s!==void 0||!(t!=null&&t.removeUndefinedValues))&&(n[i]=Aw(s,t));return n})(e)}),"convertToMapAttrFromIterable"),P5e=rn((e,t)=>({M:(r=>{let n={};for(let i in r){let s=r[i];typeof s!="function"&&(s!==void 0||!(t!=null&&t.removeUndefinedValues))&&(n[i]=Aw(s,t))}return n})(e)}),"convertToMapAttrFromEnumerableProps"),TD=rn(()=>({NULL:!0}),"convertToNullAttr"),F5e=rn(e=>({B:e}),"convertToBinaryAttr"),U5e=rn(e=>({S:e.toString()}),"convertToStringAttr"),B5e=rn(e=>({N:e.toString()}),"convertToBigIntAttr"),N5e=rn(e=>{throw new Error(`${e} ${typeof BigInt=="function"?"Use BigInt.":"Pass string value instead."} `)},"validateBigIntAndThrow"),$5e=rn(e=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map(t=>t.toString()).includes(e.toString()))throw new Error(`Special numeric value ${e.toString()} is not allowed`);return e>Number.MAX_SAFE_INTEGER?N5e(`Number ${e.toString()} is greater than Number.MAX_SAFE_INTEGER.`):e<Number.MIN_SAFE_INTEGER&&N5e(`Number ${e.toString()} is lesser than Number.MIN_SAFE_INTEGER.`),{N:e.toString()}},"convertToNumberAttr"),V5e=rn(e=>{let t=["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];return e!=null&&e.constructor?t.includes(e.constructor.name):!1},"isBinary"),Tw=rn((e,t)=>{for(let[r,n]of Object.entries(e))if(n!==void 0)switch(r){case"NULL":return null;case"BOOL":return!!n;case"N":return D5e(n,t);case"B":return M5e(n);case"S":return k5e(n);case"L":return adr(n,t);case"M":return cdr(n,t);case"NS":return new Set(n.map(i=>D5e(i,t)));case"BS":return new Set(n.map(M5e));case"SS":return new Set(n.map(k5e));default:throw new Error(`Unsupported type passed: ${r}`)}throw new Error(`No value defined: ${JSON.stringify(e)}`)},"convertToNative"),D5e=rn((e,t)=>{if(t!=null&&t.wrapNumbers)return OD.from(e);let r=Number(e),n=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)&&!n.includes(r))if(typeof BigInt=="function")try{return BigInt(e)}catch{throw new Error(`${e} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}else throw new Error(`${e} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);return r},"convertNumber"),k5e=rn(e=>e,"convertString"),M5e=rn(e=>e,"convertBinary"),adr=rn((e,t)=>e.map(r=>Tw(r,t)),"convertList"),cdr=rn((e,t)=>Object.entries(e).reduce((r,[n,i])=>(r[n]=Tw(i,t),r),{}),"convertMap");function G5e(e,t){let r=Aw(e,t),[n,i]=Object.entries(r)[0];switch(n){case"M":case"L":return t!=null&&t.convertTopLevelContainer?r:i;case"SS":case"NS":case"BS":case"S":case"N":case"B":case"NULL":case"BOOL":case"$unknown":default:return r}}rn(G5e,"marshall");var ldr=rn((e,t)=>t!=null&&t.convertWithoutMapWrapper?Tw(e,t):Tw({M:e},t),"unmarshall")});var xWe=p((YVr,wWe)=>{"use strict";var RD=Object.defineProperty,udr=Object.getOwnPropertyDescriptor,ddr=Object.getOwnPropertyNames,pdr=Object.prototype.hasOwnProperty,Br=(e,t)=>RD(e,"name",{value:t,configurable:!0}),fdr=(e,t)=>{for(var r in t)RD(e,r,{get:t[r],enumerable:!0})},hdr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ddr(t))!pdr.call(e,i)&&i!==r&&RD(e,i,{get:()=>t[i],enumerable:!(n=udr(t,i))||n.enumerable});return e},mdr=e=>hdr(RD({},"__esModule",{value:!0}),e),K5e={};fdr(K5e,{BatchExecuteStatementCommand:()=>Y5e,BatchGetCommand:()=>X5e,BatchWriteCommand:()=>eWe,DeleteCommand:()=>rWe,DynamoDBDocument:()=>bdr,DynamoDBDocumentClient:()=>PD,DynamoDBDocumentClientCommand:()=>Rs,ExecuteStatementCommand:()=>iWe,ExecuteTransactionCommand:()=>oWe,GetCommand:()=>cWe,NativeAttributeBinary:()=>Gp.NativeAttributeBinary,NativeAttributeValue:()=>Gp.NativeAttributeValue,NativeScalarAttributeValue:()=>Gp.NativeScalarAttributeValue,NumberValue:()=>Gp.NumberValueImpl,PaginationConfiguration:()=>Sdr.PaginationConfiguration,PutCommand:()=>uWe,QueryCommand:()=>Nz,ScanCommand:()=>Dz,TransactGetCommand:()=>hWe,TransactWriteCommand:()=>gWe,UpdateCommand:()=>yWe,__Client:()=>Iz.Client,marshallOptions:()=>Gp.marshallOptions,paginateQuery:()=>wdr,paginateScan:()=>Cdr,unmarshallOptions:()=>Gp.unmarshallOptions});wWe.exports=mdr(K5e);var ro=oW(),gdr=(R5e(),_e(I5e)),Iz=Ze(),Gp=z5e(),Ow=null,rt={},Tu=[],H5e="*",ID=Br((e,t,r)=>{if(e!==void 0){if(r==null)return t(e);{let n=Object.keys(r),i=n.length===1&&n[0]===H5e,s=n.length>=1&&!i,o=n.length===0;if(s)return Rz(e,t,r);if(o)return _dr(e,t,Ow);if(i)return Object.entries(e??{}).reduce((a,[c,l])=>(typeof l!="function"&&(a[c]=ID(l,t,r[H5e])),a),Array.isArray(e)?[]:{})}}},"processObj"),Rz=Br((e,t,r)=>{let n;if(Array.isArray(e))n=e.filter(i=>typeof i!="function");else{n={};for(let[i,s]of Object.entries(e))typeof s!="function"&&(n[i]=s)}for(let[i,s]of Object.entries(r)){if(typeof e[i]=="function")continue;let o=ID(e[i],t,s);o!==void 0&&typeof o!="function"&&(n[i]=o)}return n},"processKeysInObj"),_dr=Br((e,t,r)=>Array.isArray(e)?e.filter(n=>typeof n!="function").map(n=>ID(n,t,r)):Object.entries(e).reduce((n,[i,s])=>{if(typeof s=="function")return n;let o=ID(s,t,r);return o!==void 0&&typeof o!="function"&&(n[i]=o),n},{}),"processAllKeysInObj"),ydr=Br((e,t,r)=>Rz(e,Br(i=>(0,Gp.marshall)(i,r),"marshallFunc"),t),"marshallInput"),vdr=Br((e,t,r)=>Rz(e,Br(i=>(0,Gp.unmarshall)(i,r),"unmarshallFunc"),t),"unmarshallOutput"),Pz=class Oz extends Iz.Command{addMarshallingMiddleware(t){let{marshallOptions:r={},unmarshallOptions:n={}}=t.translateConfig||{};r.convertTopLevelContainer=r.convertTopLevelContainer??!0,n.convertWithoutMapWrapper=n.convertWithoutMapWrapper??!0,this.clientCommand.middlewareStack.addRelativeTo((i,s)=>async o=>{(0,gdr.setFeature)(s,"DDB_MAPPER","d"),o.input=ydr(this.input,this.inputKeyNodes,r),s.dynamoDbDocumentClientOptions=s.dynamoDbDocumentClientOptions||Oz.defaultLogFilterOverrides;let a=o.input;return s.dynamoDbDocumentClientOptions.overrideInputFilterSensitiveLog=()=>{var c;return(c=s.inputFilterSensitiveLog)==null?void 0:c.call(s,a)},i(o)},{name:"DocumentMarshall",relation:"before",toMiddleware:"serializerMiddleware",override:!0}),this.clientCommand.middlewareStack.addRelativeTo((i,s)=>async o=>{let a=await i(o),c=a.output;return s.dynamoDbDocumentClientOptions=s.dynamoDbDocumentClientOptions||Oz.defaultLogFilterOverrides,s.dynamoDbDocumentClientOptions.overrideOutputFilterSensitiveLog=()=>{var l;return(l=s.outputFilterSensitiveLog)==null?void 0:l.call(s,c)},a.output=vdr(a.output,this.outputKeyNodes,n),a},{name:"DocumentUnmarshall",relation:"before",toMiddleware:"deserializerMiddleware",override:!0})}};Br(Pz,"DynamoDBDocumentClientCommand");Pz.defaultLogFilterOverrides={overrideInputFilterSensitiveLog(...e){},overrideOutputFilterSensitiveLog(...e){}};var Rs=Pz,J5e=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Statements:{"*":{Parameters:Tu}}},this.outputKeyNodes={Responses:{"*":{Error:{Item:rt},Item:rt}}},this.clientCommand=new ro.BatchExecuteStatementCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(J5e,"BatchExecuteStatementCommand");var Y5e=J5e,Q5e=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={RequestItems:{"*":{Keys:{"*":rt}}}},this.outputKeyNodes={Responses:{"*":{"*":rt}},UnprocessedKeys:{"*":{Keys:{"*":rt}}}},this.clientCommand=new ro.BatchGetItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(Q5e,"BatchGetCommand");var X5e=Q5e,Z5e=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={RequestItems:{"*":{"*":{PutRequest:{Item:rt},DeleteRequest:{Key:rt}}}}},this.outputKeyNodes={UnprocessedItems:{"*":{"*":{PutRequest:{Item:rt},DeleteRequest:{Key:rt}}}},ItemCollectionMetrics:{"*":{"*":{ItemCollectionKey:rt}}}},this.clientCommand=new ro.BatchWriteItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(Z5e,"BatchWriteCommand");var eWe=Z5e,tWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Key:rt,Expected:{"*":{Value:Ow,AttributeValueList:Tu}},ExpressionAttributeValues:rt},this.outputKeyNodes={Attributes:rt,ItemCollectionMetrics:{ItemCollectionKey:rt}},this.clientCommand=new ro.DeleteItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(tWe,"DeleteCommand");var rWe=tWe,nWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Parameters:Tu},this.outputKeyNodes={Items:{"*":rt},LastEvaluatedKey:rt},this.clientCommand=new ro.ExecuteStatementCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(nWe,"ExecuteStatementCommand");var iWe=nWe,sWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={TransactStatements:{"*":{Parameters:Tu}}},this.outputKeyNodes={Responses:{"*":{Item:rt}}},this.clientCommand=new ro.ExecuteTransactionCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(sWe,"ExecuteTransactionCommand");var oWe=sWe,aWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Key:rt},this.outputKeyNodes={Item:rt},this.clientCommand=new ro.GetItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(aWe,"GetCommand");var cWe=aWe,lWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Item:rt,Expected:{"*":{Value:Ow,AttributeValueList:Tu}},ExpressionAttributeValues:rt},this.outputKeyNodes={Attributes:rt,ItemCollectionMetrics:{ItemCollectionKey:rt}},this.clientCommand=new ro.PutItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(lWe,"PutCommand");var uWe=lWe,dWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={KeyConditions:{"*":{AttributeValueList:Tu}},QueryFilter:{"*":{AttributeValueList:Tu}},ExclusiveStartKey:rt,ExpressionAttributeValues:rt},this.outputKeyNodes={Items:{"*":rt},LastEvaluatedKey:rt},this.clientCommand=new ro.QueryCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(dWe,"QueryCommand");var Nz=dWe,pWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={ScanFilter:{"*":{AttributeValueList:Tu}},ExclusiveStartKey:rt,ExpressionAttributeValues:rt},this.outputKeyNodes={Items:{"*":rt},LastEvaluatedKey:rt},this.clientCommand=new ro.ScanCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(pWe,"ScanCommand");var Dz=pWe,fWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={TransactItems:{"*":{Get:{Key:rt}}}},this.outputKeyNodes={Responses:{"*":{Item:rt}}},this.clientCommand=new ro.TransactGetItemsCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(fWe,"TransactGetCommand");var hWe=fWe,mWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={TransactItems:{"*":{ConditionCheck:{Key:rt,ExpressionAttributeValues:rt},Put:{Item:rt,ExpressionAttributeValues:rt},Delete:{Key:rt,ExpressionAttributeValues:rt},Update:{Key:rt,ExpressionAttributeValues:rt}}}},this.outputKeyNodes={ItemCollectionMetrics:{"*":{"*":{ItemCollectionKey:rt}}}},this.clientCommand=new ro.TransactWriteItemsCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(mWe,"TransactWriteCommand");var gWe=mWe,_We=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Key:rt,AttributeUpdates:{"*":{Value:Ow}},Expected:{"*":{Value:Ow,AttributeValueList:Tu}},ExpressionAttributeValues:rt},this.outputKeyNodes={Attributes:rt,ItemCollectionMetrics:{ItemCollectionKey:rt}},this.clientCommand=new ro.UpdateItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(_We,"UpdateCommand");var yWe=_We,vWe=class bWe extends Iz.Client{constructor(t,r){var n;if(super(t.config),this.config=t.config,this.config.translateConfig=r,this.middlewareStack=t.middlewareStack,(n=this.config)!=null&&n.cacheMiddleware)throw new Error("@aws-sdk/lib-dynamodb - cacheMiddleware=true is not compatible with the DynamoDBDocumentClient. This option must be set to false.")}static from(t,r){return new bWe(t,r)}destroy(){}};Br(vWe,"DynamoDBDocumentClient");var PD=vWe,SWe=class EWe extends PD{static from(t,r){return new EWe(t,r)}batchExecuteStatement(t,r,n){let i=new Y5e(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}batchGet(t,r,n){let i=new X5e(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}batchWrite(t,r,n){let i=new eWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}delete(t,r,n){let i=new rWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}executeStatement(t,r,n){let i=new iWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}executeTransaction(t,r,n){let i=new oWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}get(t,r,n){let i=new cWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}put(t,r,n){let i=new uWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}query(t,r,n){let i=new Nz(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}scan(t,r,n){let i=new Dz(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}transactGet(t,r,n){let i=new hWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}transactWrite(t,r,n){let i=new gWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}update(t,r,n){let i=new yWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}};Br(SWe,"DynamoDBDocument");var bdr=SWe,Sdr=xa(),Edr=(Ft(),_e(ir)),wdr=(0,Edr.createPaginator)(PD,Nz,"ExclusiveStartKey","LastEvaluatedKey","Limit"),xdr=(Ft(),_e(ir)),Cdr=(0,xdr.createPaginator)(PD,Dz,"ExclusiveStartKey","LastEvaluatedKey","Limit")});var Mz=p(ND=>{"use strict";Object.defineProperty(ND,"__esModule",{value:!0});ND.Component=void 0;var CWe=Yt(),kz=class{constructor(t){(0,CWe.assertIsDefined)(t),(0,CWe.assertIsString)(t.name),this.name=t.name}};ND.Component=kz});var Hy=p(DD=>{"use strict";Object.defineProperty(DD,"__esModule",{value:!0});DD.EntityDefinitions=void 0;DD.EntityDefinitions={component:{keys:{pk:{format:"c#{name}",attributeName:"pk"},sk:{format:"#meta",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_c#{bucketNumber}"},sk:{format:"{name}",attributeName:"gsi1_sk"}}},fieldsAsJsonString:[]},componentVersion:{keys:{pk:{format:"cv#{componentName}",attributeName:"pk"},sk:{format:"{version}",attributeName:"sk"}},indexes:{},fieldsAsJsonString:["icon"]},componentSet:{keys:{pk:{format:"cs#{webPath}",attributeName:"pk"},sk:{format:"#meta",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_cs#{bucketNumber}"},sk:{format:"#meta",attributeName:"gsi1_sk"}}},fieldsAsJsonString:["environmentVariables","headers"]},componentSetRule:{keys:{pk:{format:"csr#{componentName}",attributeName:"pk"},sk:{format:"{componentSet}",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_csr#{componentSet}"},sk:{attributeName:"gsi1_sk",format:"{componentName}"}}},fieldsAsJsonString:[]},componentSetComponentVersion:{keys:{pk:{format:"cscv#{componentName}",attributeName:"pk"},sk:{format:"{componentVersion}#{componentSetWebPath}",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_cscv#{componentSetWebPath}"},sk:{attributeName:"gsi1_sk",format:"{componentName}"}}},fieldsAsJsonString:["environmentVariables"]}}});var Lz=p(kD=>{"use strict";Object.defineProperty(kD,"__esModule",{value:!0});kD.ComponentRepository=void 0;var Tdr=Mz(),Adr=xu(),Odr=Hy(),TWe=40;function Idr(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].charCodeAt(0);return t%TWe}var qz=class extends Adr.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component",Odr.EntityDefinitions.component,Tdr.Component)}async createItem(t,r={}){return await super.createItem(t,r,{bucketNumber:Idr(t.name)})}async getAllComponents(t){let r=[],n={index:"gsi1_pk-gsi1_sk-index"};for(let i=0;i<TWe;i++){let s=await this.queryItems({bucketNumber:i},n);r=r.concat(s)}if(t!=null&&t.length){let i=t.toLowerCase();r=r.filter(s=>s.name.toLowerCase().includes(i))}return r}};kD.ComponentRepository=qz});var MD=p(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});Iw.ComponentVersion=void 0;Iw.assertIsValidVersion=AWe;var Au=Yt(),Rdr=/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/;function AWe(e){if(Rdr.test(e)==!1)throw new Error("ComponentVersion.version must be in the form of semver 0.0.0")}var jz=class{constructor(t){this.componentName="",this.version="",this.displayName="",this.description="",this.type=void 0,this.icon=void 0,(0,Au.assertIsDefined)(t),this.componentName=(0,Au.assertAssign)(t.componentName,Au.assertIsString,"componentName must be a string"),this.version=(0,Au.assertAssign)(t.version,Au.assertIsString,"version must be a string"),this.displayName=(0,Au.assertAssign)(t.displayName||"",Au.assertIsString,"displayName must be a string"),this.description=(0,Au.assertAssign)(t.description||"",Au.assertIsString,"description must be a string"),t.icon&&Ndr(t.icon)&&(this.icon=t.icon),t.type&&Pdr(t.type)&&(this.type=t.type),AWe(this.version)}};Iw.ComponentVersion=jz;function Pdr(e){return!!(e&&typeof e=="string"&&["edge","server"].includes(e))}function Ndr(e){return!!(e&&typeof e=="object"&&"id"in e&&"color"in e&&Ddr(e.color))}function Ddr(e){return!!e&&typeof e=="object"&&"type"in e&&"value"in e}});var Uz=p(qD=>{"use strict";Object.defineProperty(qD,"__esModule",{value:!0});qD.ComponentVersionRepository=void 0;var kdr=xu(),Mdr=Hy(),qdr=MD(),Fz=class extends kdr.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_version",Mdr.EntityDefinitions.componentVersion,qdr.ComponentVersion)}async getComponentVersions(t){return await this.queryItems({componentName:t})}async getLatestComponentVersion(t){let r=await this.queryItems({componentName:t},{order:"desc",limit:1});return r.length?r[0]:void 0}async deleteByComponentName(t,r){let n=await this.getComponentVersions(t),i=[];for(let s of n)i.push(this.deleteItem(s,r));await Promise.allSettled(i)}};qD.ComponentVersionRepository=Fz});var jD=p(LD=>{"use strict";Object.defineProperty(LD,"__esModule",{value:!0});LD.ComponentSet=void 0;var za=Yt(),OWe=require("assert"),IWe=/^[a-z0-9\-_.]+$/i,Bz=class{constructor(t){if((0,za.assertIsDefined)(t),this.webPath=(0,za.assertAssign)(t.webPath,za.assertIsString,"webPath must be a string"),this.displayName=(0,za.assertAssignWithDefaultUndefinedValue)(t.displayName,za.assertIsString,"","displayName must be a string"),this.description=(0,za.assertAssignWithDefaultUndefinedValue)(t.description,za.assertIsString,"","description must be a string"),this.environmentVariables=(0,za.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,za.assertIsMapOfStringString,{}),this.headers=(0,za.assertAssignWithDefaultUndefinedValue)(t.headers,za.assertIsMapOfStringString,{}),this.webPath.length===0)throw new OWe.AssertionError({message:"webPath.length must have length greater than 0"});if(IWe.test(this.webPath)===!1)throw new OWe.AssertionError({message:`Invalid Component Set web path, it must meet ${IWe.toString()}`})}};LD.ComponentSet=Bz});var Vz=p(FD=>{"use strict";Object.defineProperty(FD,"__esModule",{value:!0});FD.ComponentSetRepository=void 0;var Ldr=xu(),jdr=Hy(),Fdr=jD(),RWe=20;function Udr(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].charCodeAt(0);return t%RWe}var $z=class extends Ldr.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set",jdr.EntityDefinitions.componentSet,Fdr.ComponentSet)}async getComponentSetByWebPath(t){return this.getItem({webPath:t.toLowerCase()})}async createItem(t,r={}){return await super.createItem(t,r,{bucketNumber:Udr(t.webPath)})}async getAllComponentSets(){let t=[];for(let r=0;r<RWe;r++){let n=await this.queryItems({bucketNumber:r},{index:"gsi1_pk-gsi1_sk-index"});t=t.concat(n)}return t}};FD.ComponentSetRepository=$z});var Rw=p((iGr,PWe)=>{var Bdr="2.0.0",$dr=Number.MAX_SAFE_INTEGER||9007199254740991,Vdr=16,Gdr=["major","premajor","minor","preminor","patch","prepatch","prerelease"];PWe.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Vdr,MAX_SAFE_INTEGER:$dr,RELEASE_TYPES:Gdr,SEMVER_SPEC_VERSION:Bdr,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Pw=p((sGr,NWe)=>{var Wdr=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};NWe.exports=Wdr});var Ky=p((Ou,DWe)=>{var{MAX_SAFE_COMPONENT_LENGTH:Gz}=Rw(),zdr=Pw();Ou=DWe.exports={};var Hdr=Ou.re=[],Kdr=Ou.safeRe=[],Ie=Ou.src=[],Re=Ou.t={},Jdr=0,dt=(e,t,r)=>{let n=t.split("\\s*").join("\\s{0,1}").split("\\s+").join("\\s"),i=Jdr++;zdr(e,i,t),Re[e]=i,Ie[i]=t,Hdr[i]=new RegExp(t,r?"g":void 0),Kdr[i]=new RegExp(n,r?"g":void 0)};dt("NUMERICIDENTIFIER","0|[1-9]\\d*");dt("NUMERICIDENTIFIERLOOSE","[0-9]+");dt("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");dt("MAINVERSION",`(${Ie[Re.NUMERICIDENTIFIER]})\\.(${Ie[Re.NUMERICIDENTIFIER]})\\.(${Ie[Re.NUMERICIDENTIFIER]})`);dt("MAINVERSIONLOOSE",`(${Ie[Re.NUMERICIDENTIFIERLOOSE]})\\.(${Ie[Re.NUMERICIDENTIFIERLOOSE]})\\.(${Ie[Re.NUMERICIDENTIFIERLOOSE]})`);dt("PRERELEASEIDENTIFIER",`(?:${Ie[Re.NUMERICIDENTIFIER]}|${Ie[Re.NONNUMERICIDENTIFIER]})`);dt("PRERELEASEIDENTIFIERLOOSE",`(?:${Ie[Re.NUMERICIDENTIFIERLOOSE]}|${Ie[Re.NONNUMERICIDENTIFIER]})`);dt("PRERELEASE",`(?:-(${Ie[Re.PRERELEASEIDENTIFIER]}(?:\\.${Ie[Re.PRERELEASEIDENTIFIER]})*))`);dt("PRERELEASELOOSE",`(?:-?(${Ie[Re.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Ie[Re.PRERELEASEIDENTIFIERLOOSE]})*))`);dt("BUILDIDENTIFIER","[0-9A-Za-z-]+");dt("BUILD",`(?:\\+(${Ie[Re.BUILDIDENTIFIER]}(?:\\.${Ie[Re.BUILDIDENTIFIER]})*))`);dt("FULLPLAIN",`v?${Ie[Re.MAINVERSION]}${Ie[Re.PRERELEASE]}?${Ie[Re.BUILD]}?`);dt("FULL",`^${Ie[Re.FULLPLAIN]}$`);dt("LOOSEPLAIN",`[v=\\s]*${Ie[Re.MAINVERSIONLOOSE]}${Ie[Re.PRERELEASELOOSE]}?${Ie[Re.BUILD]}?`);dt("LOOSE",`^${Ie[Re.LOOSEPLAIN]}$`);dt("GTLT","((?:<|>)?=?)");dt("XRANGEIDENTIFIERLOOSE",`${Ie[Re.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);dt("XRANGEIDENTIFIER",`${Ie[Re.NUMERICIDENTIFIER]}|x|X|\\*`);dt("XRANGEPLAIN",`[v=\\s]*(${Ie[Re.XRANGEIDENTIFIER]})(?:\\.(${Ie[Re.XRANGEIDENTIFIER]})(?:\\.(${Ie[Re.XRANGEIDENTIFIER]})(?:${Ie[Re.PRERELEASE]})?${Ie[Re.BUILD]}?)?)?`);dt("XRANGEPLAINLOOSE",`[v=\\s]*(${Ie[Re.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ie[Re.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ie[Re.XRANGEIDENTIFIERLOOSE]})(?:${Ie[Re.PRERELEASELOOSE]})?${Ie[Re.BUILD]}?)?)?`);dt("XRANGE",`^${Ie[Re.GTLT]}\\s*${Ie[Re.XRANGEPLAIN]}$`);dt("XRANGELOOSE",`^${Ie[Re.GTLT]}\\s*${Ie[Re.XRANGEPLAINLOOSE]}$`);dt("COERCE",`(^|[^\\d])(\\d{1,${Gz}})(?:\\.(\\d{1,${Gz}}))?(?:\\.(\\d{1,${Gz}}))?(?:$|[^\\d])`);dt("COERCERTL",Ie[Re.COERCE],!0);dt("LONETILDE","(?:~>?)");dt("TILDETRIM",`(\\s*)${Ie[Re.LONETILDE]}\\s+`,!0);Ou.tildeTrimReplace="$1~";dt("TILDE",`^${Ie[Re.LONETILDE]}${Ie[Re.XRANGEPLAIN]}$`);dt("TILDELOOSE",`^${Ie[Re.LONETILDE]}${Ie[Re.XRANGEPLAINLOOSE]}$`);dt("LONECARET","(?:\\^)");dt("CARETTRIM",`(\\s*)${Ie[Re.LONECARET]}\\s+`,!0);Ou.caretTrimReplace="$1^";dt("CARET",`^${Ie[Re.LONECARET]}${Ie[Re.XRANGEPLAIN]}$`);dt("CARETLOOSE",`^${Ie[Re.LONECARET]}${Ie[Re.XRANGEPLAINLOOSE]}$`);dt("COMPARATORLOOSE",`^${Ie[Re.GTLT]}\\s*(${Ie[Re.LOOSEPLAIN]})$|^$`);dt("COMPARATOR",`^${Ie[Re.GTLT]}\\s*(${Ie[Re.FULLPLAIN]})$|^$`);dt("COMPARATORTRIM",`(\\s*)${Ie[Re.GTLT]}\\s*(${Ie[Re.LOOSEPLAIN]}|${Ie[Re.XRANGEPLAIN]})`,!0);Ou.comparatorTrimReplace="$1$2$3";dt("HYPHENRANGE",`^\\s*(${Ie[Re.XRANGEPLAIN]})\\s+-\\s+(${Ie[Re.XRANGEPLAIN]})\\s*$`);dt("HYPHENRANGELOOSE",`^\\s*(${Ie[Re.XRANGEPLAINLOOSE]})\\s+-\\s+(${Ie[Re.XRANGEPLAINLOOSE]})\\s*$`);dt("STAR","(<|>)?=?\\s*\\*");dt("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");dt("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var UD=p((oGr,kWe)=>{var Ydr=Object.freeze({loose:!0}),Qdr=Object.freeze({}),Xdr=e=>e?typeof e!="object"?Ydr:e:Qdr;kWe.exports=Xdr});var Wz=p((aGr,LWe)=>{var MWe=/^[0-9]+$/,qWe=(e,t)=>{let r=MWe.test(e),n=MWe.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Zdr=(e,t)=>qWe(t,e);LWe.exports={compareIdentifiers:qWe,rcompareIdentifiers:Zdr}});var ki=p((cGr,BWe)=>{var BD=Pw(),{MAX_LENGTH:jWe,MAX_SAFE_INTEGER:$D}=Rw(),{safeRe:FWe,t:UWe}=Ky(),epr=UD(),{compareIdentifiers:Jy}=Wz(),no=class{constructor(t,r){if(r=epr(r),t instanceof no){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>jWe)throw new TypeError(`version is longer than ${jWe} characters`);BD("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?FWe[UWe.LOOSE]:FWe[UWe.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>$D||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$D||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$D||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<$D)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(BD("SemVer.compare",this.version,this.options,t),!(t instanceof no)){if(typeof t=="string"&&t===this.version)return 0;t=new no(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof no||(t=new no(t,this.options)),Jy(this.major,t.major)||Jy(this.minor,t.minor)||Jy(this.patch,t.patch)}comparePre(t){if(t instanceof no||(t=new no(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(BD("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Jy(n,i)}while(++r)}compareBuild(t){t instanceof no||(t=new no(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(BD("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Jy(n,i)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Jy(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};BWe.exports=no});var zh=p((lGr,VWe)=>{var $We=ki(),tpr=(e,t,r=!1)=>{if(e instanceof $We)return e;try{return new $We(e,t)}catch(n){if(!r)return null;throw n}};VWe.exports=tpr});var WWe=p((uGr,GWe)=>{var rpr=zh(),npr=(e,t)=>{let r=rpr(e,t);return r?r.version:null};GWe.exports=npr});var HWe=p((dGr,zWe)=>{var ipr=zh(),spr=(e,t)=>{let r=ipr(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};zWe.exports=spr});var YWe=p((pGr,JWe)=>{var KWe=ki(),opr=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new KWe(e instanceof KWe?e.version:e,r).inc(t,n,i).version}catch{return null}};JWe.exports=opr});var ZWe=p((fGr,XWe)=>{var QWe=zh(),apr=(e,t)=>{let r=QWe(e,null,!0),n=QWe(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};XWe.exports=apr});var t6e=p((hGr,e6e)=>{var cpr=ki(),lpr=(e,t)=>new cpr(e,t).major;e6e.exports=lpr});var n6e=p((mGr,r6e)=>{var upr=ki(),dpr=(e,t)=>new upr(e,t).minor;r6e.exports=dpr});var s6e=p((gGr,i6e)=>{var ppr=ki(),fpr=(e,t)=>new ppr(e,t).patch;i6e.exports=fpr});var a6e=p((_Gr,o6e)=>{var hpr=zh(),mpr=(e,t)=>{let r=hpr(e,t);return r&&r.prerelease.length?r.prerelease:null};o6e.exports=mpr});var Jo=p((yGr,l6e)=>{var c6e=ki(),gpr=(e,t,r)=>new c6e(e,r).compare(new c6e(t,r));l6e.exports=gpr});var d6e=p((vGr,u6e)=>{var _pr=Jo(),ypr=(e,t,r)=>_pr(t,e,r);u6e.exports=ypr});var f6e=p((bGr,p6e)=>{var vpr=Jo(),bpr=(e,t)=>vpr(e,t,!0);p6e.exports=bpr});var VD=p((SGr,m6e)=>{var h6e=ki(),Spr=(e,t,r)=>{let n=new h6e(e,r),i=new h6e(t,r);return n.compare(i)||n.compareBuild(i)};m6e.exports=Spr});var _6e=p((EGr,g6e)=>{var Epr=VD(),wpr=(e,t)=>e.sort((r,n)=>Epr(r,n,t));g6e.exports=wpr});var v6e=p((wGr,y6e)=>{var xpr=VD(),Cpr=(e,t)=>e.sort((r,n)=>xpr(n,r,t));y6e.exports=Cpr});var Nw=p((xGr,b6e)=>{var Tpr=Jo(),Apr=(e,t,r)=>Tpr(e,t,r)>0;b6e.exports=Apr});var GD=p((CGr,S6e)=>{var Opr=Jo(),Ipr=(e,t,r)=>Opr(e,t,r)<0;S6e.exports=Ipr});var zz=p((TGr,E6e)=>{var Rpr=Jo(),Ppr=(e,t,r)=>Rpr(e,t,r)===0;E6e.exports=Ppr});var Hz=p((AGr,w6e)=>{var Npr=Jo(),Dpr=(e,t,r)=>Npr(e,t,r)!==0;w6e.exports=Dpr});var WD=p((OGr,x6e)=>{var kpr=Jo(),Mpr=(e,t,r)=>kpr(e,t,r)>=0;x6e.exports=Mpr});var zD=p((IGr,C6e)=>{var qpr=Jo(),Lpr=(e,t,r)=>qpr(e,t,r)<=0;C6e.exports=Lpr});var Kz=p((RGr,T6e)=>{var jpr=zz(),Fpr=Hz(),Upr=Nw(),Bpr=WD(),$pr=GD(),Vpr=zD(),Gpr=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return jpr(e,r,n);case"!=":return Fpr(e,r,n);case">":return Upr(e,r,n);case">=":return Bpr(e,r,n);case"<":return $pr(e,r,n);case"<=":return Vpr(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};T6e.exports=Gpr});var O6e=p((PGr,A6e)=>{var Wpr=ki(),zpr=zh(),{safeRe:HD,t:KD}=Ky(),Hpr=(e,t)=>{if(e instanceof Wpr)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(HD[KD.COERCE]);else{let n;for(;(n=HD[KD.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),HD[KD.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;HD[KD.COERCERTL].lastIndex=-1}return r===null?null:zpr(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};A6e.exports=Hpr});var R6e=p((NGr,I6e)=>{"use strict";I6e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}});var N6e=p((DGr,P6e)=>{"use strict";P6e.exports=Gt;Gt.Node=Hh;Gt.create=Gt;function Gt(e){var t=this;if(t instanceof Gt||(t=new Gt),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}Gt.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t};Gt.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};Gt.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};Gt.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Jpr(this,arguments[e]);return this.length};Gt.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Ypr(this,arguments[e]);return this.length};Gt.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};Gt.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};Gt.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++)e.call(t,r.value,n,this),r=r.next};Gt.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--)e.call(t,r.value,n,this),r=r.prev};Gt.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};Gt.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};Gt.prototype.map=function(e,t){t=t||this;for(var r=new Gt,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};Gt.prototype.mapReverse=function(e,t){t=t||this;for(var r=new Gt,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};Gt.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};Gt.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};Gt.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};Gt.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};Gt.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new Gt;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(;i!==null&&n<t;n++,i=i.next)r.push(i.value);return r};Gt.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new Gt;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};Gt.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(var s=[],n=0;i&&n<t;n++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=Kpr(this,i,r[n]);return s};Gt.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};function Kpr(e,t,r){var n=t===e.head?new Hh(r,null,t,e):new Hh(r,t,t.next,e);return n.next===null&&(e.tail=n),n.prev===null&&(e.head=n),e.length++,n}function Jpr(e,t){e.tail=new Hh(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Ypr(e,t){e.head=new Hh(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Hh(e,t,r,n){if(!(this instanceof Hh))return new Hh(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{R6e()(Gt)}catch{}});var L6e=p((kGr,q6e)=>{"use strict";var Qpr=N6e(),Kh=Symbol("max"),Ru=Symbol("length"),Yy=Symbol("lengthCalculator"),kw=Symbol("allowStale"),Jh=Symbol("maxAge"),Iu=Symbol("dispose"),D6e=Symbol("noDisposeOnSet"),Wn=Symbol("lruList"),Ha=Symbol("cache"),M6e=Symbol("updateAgeOnGet"),Jz=()=>1,Qz=class{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");let r=this[Kh]=t.max||1/0,n=t.length||Jz;if(this[Yy]=typeof n!="function"?Jz:n,this[kw]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Jh]=t.maxAge||0,this[Iu]=t.dispose,this[D6e]=t.noDisposeOnSet||!1,this[M6e]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[Kh]=t||1/0,Dw(this)}get max(){return this[Kh]}set allowStale(t){this[kw]=!!t}get allowStale(){return this[kw]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Jh]=t,Dw(this)}get maxAge(){return this[Jh]}set lengthCalculator(t){typeof t!="function"&&(t=Jz),t!==this[Yy]&&(this[Yy]=t,this[Ru]=0,this[Wn].forEach(r=>{r.length=this[Yy](r.value,r.key),this[Ru]+=r.length})),Dw(this)}get lengthCalculator(){return this[Yy]}get length(){return this[Ru]}get itemCount(){return this[Wn].length}rforEach(t,r){r=r||this;for(let n=this[Wn].tail;n!==null;){let i=n.prev;k6e(this,t,n,r),n=i}}forEach(t,r){r=r||this;for(let n=this[Wn].head;n!==null;){let i=n.next;k6e(this,t,n,r),n=i}}keys(){return this[Wn].toArray().map(t=>t.key)}values(){return this[Wn].toArray().map(t=>t.value)}reset(){this[Iu]&&this[Wn]&&this[Wn].length&&this[Wn].forEach(t=>this[Iu](t.key,t.value)),this[Ha]=new Map,this[Wn]=new Qpr,this[Ru]=0}dump(){return this[Wn].map(t=>JD(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[Wn]}set(t,r,n){if(n=n||this[Jh],n&&typeof n!="number")throw new TypeError("maxAge must be a number");let i=n?Date.now():0,s=this[Yy](r,t);if(this[Ha].has(t)){if(s>this[Kh])return Qy(this,this[Ha].get(t)),!1;let c=this[Ha].get(t).value;return this[Iu]&&(this[D6e]||this[Iu](t,c.value)),c.now=i,c.maxAge=n,c.value=r,this[Ru]+=s-c.length,c.length=s,this.get(t),Dw(this),!0}let o=new Xz(t,r,s,i,n);return o.length>this[Kh]?(this[Iu]&&this[Iu](t,r),!1):(this[Ru]+=o.length,this[Wn].unshift(o),this[Ha].set(t,this[Wn].head),Dw(this),!0)}has(t){if(!this[Ha].has(t))return!1;let r=this[Ha].get(t).value;return!JD(this,r)}get(t){return Yz(this,t,!0)}peek(t){return Yz(this,t,!1)}pop(){let t=this[Wn].tail;return t?(Qy(this,t),t.value):null}del(t){Qy(this,this[Ha].get(t))}load(t){this.reset();let r=Date.now();for(let n=t.length-1;n>=0;n--){let i=t[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{let o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Ha].forEach((t,r)=>Yz(this,r,!1))}},Yz=(e,t,r)=>{let n=e[Ha].get(t);if(n){let i=n.value;if(JD(e,i)){if(Qy(e,n),!e[kw])return}else r&&(e[M6e]&&(n.value.now=Date.now()),e[Wn].unshiftNode(n));return i.value}},JD=(e,t)=>{if(!t||!t.maxAge&&!e[Jh])return!1;let r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[Jh]&&r>e[Jh]},Dw=e=>{if(e[Ru]>e[Kh])for(let t=e[Wn].tail;e[Ru]>e[Kh]&&t!==null;){let r=t.prev;Qy(e,t),t=r}},Qy=(e,t)=>{if(t){let r=t.value;e[Iu]&&e[Iu](r.key,r.value),e[Ru]-=r.length,e[Ha].delete(r.key),e[Wn].removeNode(t)}},Xz=class{constructor(t,r,n,i,s){this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}},k6e=(e,t,r,n)=>{let i=r.value;JD(e,i)&&(Qy(e,r),e[kw]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};q6e.exports=Qz});var Yo=p((MGr,B6e)=>{var Yh=class{constructor(t,r){if(r=Zpr(r),t instanceof Yh)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new Yh(t.raw,r);if(t instanceof Zz)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(n=>this.parseRange(n)).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!F6e(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&ofr(i[0])){this.set=[i];break}}}this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){let n=((this.options.includePrerelease&&ifr)|(this.options.loose&&sfr))+":"+t,i=j6e.get(n);if(i)return i;let s=this.options.loose,o=s?Ps[os.HYPHENRANGELOOSE]:Ps[os.HYPHENRANGE];t=t.replace(o,gfr(this.options.includePrerelease)),$r("hyphen replace",t),t=t.replace(Ps[os.COMPARATORTRIM],tfr),$r("comparator trim",t),t=t.replace(Ps[os.TILDETRIM],rfr),t=t.replace(Ps[os.CARETTRIM],nfr);let a=t.split(" ").map(d=>afr(d,this.options)).join(" ").split(/\s+/).map(d=>mfr(d,this.options));s&&(a=a.filter(d=>($r("loose invalid filter",d,this.options),!!d.match(Ps[os.COMPARATORLOOSE])))),$r("range list",a);let c=new Map,l=a.map(d=>new Zz(d,this.options));for(let d of l){if(F6e(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return j6e.set(n,u),u}intersects(t,r){if(!(t instanceof Yh))throw new TypeError("a Range is required");return this.set.some(n=>U6e(n,r)&&t.set.some(i=>U6e(i,r)&&n.every(s=>i.every(o=>s.intersects(o,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new efr(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(_fr(this.set[r],t,this.options))return!0;return!1}};B6e.exports=Yh;var Xpr=L6e(),j6e=new Xpr({max:1e3}),Zpr=UD(),Zz=Mw(),$r=Pw(),efr=ki(),{safeRe:Ps,t:os,comparatorTrimReplace:tfr,tildeTrimReplace:rfr,caretTrimReplace:nfr}=Ky(),{FLAG_INCLUDE_PRERELEASE:ifr,FLAG_LOOSE:sfr}=Rw(),F6e=e=>e.value==="<0.0.0-0",ofr=e=>e.value==="",U6e=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(s=>i.intersects(s,t)),i=n.pop();return r},afr=(e,t)=>($r("comp",e,t),e=ufr(e,t),$r("caret",e),e=cfr(e,t),$r("tildes",e),e=pfr(e,t),$r("xrange",e),e=hfr(e,t),$r("stars",e),e),as=e=>!e||e.toLowerCase()==="x"||e==="*",cfr=(e,t)=>e.trim().split(/\s+/).map(r=>lfr(r,t)).join(" "),lfr=(e,t)=>{let r=t.loose?Ps[os.TILDELOOSE]:Ps[os.TILDE];return e.replace(r,(n,i,s,o,a)=>{$r("tilde",e,n,i,s,o,a);let c;return as(i)?c="":as(s)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:as(o)?c=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:a?($r("replaceTilde pr",a),c=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`):c=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`,$r("tilde return",c),c})},ufr=(e,t)=>e.trim().split(/\s+/).map(r=>dfr(r,t)).join(" "),dfr=(e,t)=>{$r("caret",e,t);let r=t.loose?Ps[os.CARETLOOSE]:Ps[os.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{$r("caret",e,i,s,o,a,c);let l;return as(s)?l="":as(o)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:as(a)?s==="0"?l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:c?($r("replaceCaret pr",c),s==="0"?o==="0"?l=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`):($r("no pr"),s==="0"?o==="0"?l=`>=${s}.${o}.${a}${n} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}${n} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),$r("caret return",l),l})},pfr=(e,t)=>($r("replaceXRanges",e,t),e.split(/\s+/).map(r=>ffr(r,t)).join(" ")),ffr=(e,t)=>{e=e.trim();let r=t.loose?Ps[os.XRANGELOOSE]:Ps[os.XRANGE];return e.replace(r,(n,i,s,o,a,c)=>{$r("xRange",e,n,i,s,o,a,c);let l=as(s),u=l||as(o),d=u||as(a),h=d;return i==="="&&h&&(i=""),c=t.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(u&&(o=0),a=0,i===">"?(i=">=",u?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",u?s=+s+1:o=+o+1),i==="<"&&(c="-0"),n=`${i+s}.${o}.${a}${c}`):u?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(n=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`),$r("xRange return",n),n})},hfr=(e,t)=>($r("replaceStars",e,t),e.trim().replace(Ps[os.STAR],"")),mfr=(e,t)=>($r("replaceGTE0",e,t),e.trim().replace(Ps[t.includePrerelease?os.GTE0PRE:os.GTE0],"")),gfr=e=>(t,r,n,i,s,o,a,c,l,u,d,h,f)=>(as(n)?r="":as(i)?r=`>=${n}.0.0${e?"-0":""}`:as(s)?r=`>=${n}.${i}.0${e?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,as(l)?c="":as(u)?c=`<${+l+1}.0.0-0`:as(d)?c=`<${l}.${+u+1}.0-0`:h?c=`<=${l}.${u}.${d}-${h}`:e?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),_fr=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if($r(e[n].semver),e[n].semver!==Zz.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var Mw=p((qGr,H6e)=>{var qw=Symbol("SemVer ANY"),Xy=class{static get ANY(){return qw}constructor(t,r){if(r=$6e(r),t instanceof Xy){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),tH("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===qw?this.value="":this.value=this.operator+this.semver.version,tH("comp",this)}parse(t){let r=this.options.loose?V6e[G6e.COMPARATORLOOSE]:V6e[G6e.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new W6e(n[2],this.options.loose):this.semver=qw}toString(){return this.value}test(t){if(tH("Comparator.test",t,this.options.loose),this.semver===qw||t===qw)return!0;if(typeof t=="string")try{t=new W6e(t,this.options)}catch{return!1}return eH(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof Xy))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new z6e(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new z6e(this.value,r).test(t.semver):(r=$6e(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||eH(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||eH(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};H6e.exports=Xy;var $6e=UD(),{safeRe:V6e,t:G6e}=Ky(),eH=Kz(),tH=Pw(),W6e=ki(),z6e=Yo()});var Lw=p((LGr,K6e)=>{var yfr=Yo(),vfr=(e,t,r)=>{try{t=new yfr(t,r)}catch{return!1}return t.test(e)};K6e.exports=vfr});var Y6e=p((jGr,J6e)=>{var bfr=Yo(),Sfr=(e,t)=>new bfr(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));J6e.exports=Sfr});var X6e=p((FGr,Q6e)=>{var Efr=ki(),wfr=Yo(),xfr=(e,t,r)=>{let n=null,i=null,s=null;try{s=new wfr(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Efr(n,r))}),n};Q6e.exports=xfr});var eze=p((UGr,Z6e)=>{var Cfr=ki(),Tfr=Yo(),Afr=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Tfr(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Cfr(n,r))}),n};Z6e.exports=Afr});var nze=p((BGr,rze)=>{var rH=ki(),Ofr=Yo(),tze=Nw(),Ifr=(e,t)=>{e=new Ofr(e,t);let r=new rH("0.0.0");if(e.test(r)||(r=new rH("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;i.forEach(o=>{let a=new rH(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||tze(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||tze(r,s))&&(r=s)}return r&&e.test(r)?r:null};rze.exports=Ifr});var sze=p(($Gr,ize)=>{var Rfr=Yo(),Pfr=(e,t)=>{try{return new Rfr(e,t).range||"*"}catch{return null}};ize.exports=Pfr});var YD=p((VGr,lze)=>{var Nfr=ki(),cze=Mw(),{ANY:Dfr}=cze,kfr=Yo(),Mfr=Lw(),oze=Nw(),aze=GD(),qfr=zD(),Lfr=WD(),jfr=(e,t,r,n)=>{e=new Nfr(e,n),t=new kfr(t,n);let i,s,o,a,c;switch(r){case">":i=oze,s=qfr,o=aze,a=">",c=">=";break;case"<":i=aze,s=Lfr,o=oze,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mfr(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],d=null,h=null;if(u.forEach(f=>{f.semver===Dfr&&(f=new cze(">=0.0.0")),d=d||f,h=h||f,i(f.semver,d.semver,n)?d=f:o(f.semver,h.semver,n)&&(h=f)}),d.operator===a||d.operator===c||(!h.operator||h.operator===a)&&s(e,h.semver))return!1;if(h.operator===c&&o(e,h.semver))return!1}return!0};lze.exports=jfr});var dze=p((GGr,uze)=>{var Ffr=YD(),Ufr=(e,t,r)=>Ffr(e,t,">",r);uze.exports=Ufr});var fze=p((WGr,pze)=>{var Bfr=YD(),$fr=(e,t,r)=>Bfr(e,t,"<",r);pze.exports=$fr});var gze=p((zGr,mze)=>{var hze=Yo(),Vfr=(e,t,r)=>(e=new hze(e,r),t=new hze(t,r),e.intersects(t,r));mze.exports=Vfr});var yze=p((HGr,_ze)=>{var Gfr=Lw(),Wfr=Jo();_ze.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((u,d)=>Wfr(u,d,r));for(let u of o)Gfr(u,t,r)?(s=u,i||(i=u)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let a=[];for(let[u,d]of n)u===d?a.push(u):!d&&u===o[0]?a.push("*"):d?u===o[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var xze=p((KGr,wze)=>{var vze=Yo(),iH=Mw(),{ANY:nH}=iH,jw=Lw(),sH=Jo(),zfr=(e,t,r={})=>{if(e===t)return!0;e=new vze(e,r),t=new vze(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=Kfr(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Hfr=[new iH(">=0.0.0-0")],bze=[new iH(">=0.0.0")],Kfr=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===nH){if(t.length===1&&t[0].semver===nH)return!0;r.includePrerelease?e=Hfr:e=bze}if(t.length===1&&t[0].semver===nH){if(r.includePrerelease)return!0;t=bze}let n=new Set,i,s;for(let f of e)f.operator===">"||f.operator===">="?i=Sze(i,f,r):f.operator==="<"||f.operator==="<="?s=Eze(s,f,r):n.add(f.semver);if(n.size>1)return null;let o;if(i&&s){if(o=sH(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let f of n){if(i&&!jw(f,String(i),r)||s&&!jw(f,String(s),r))return null;for(let y of t)if(!jw(f,String(y),r))return!1;return!0}let a,c,l,u,d=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of t){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",i){if(h&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===h.major&&f.semver.minor===h.minor&&f.semver.patch===h.patch&&(h=!1),f.operator===">"||f.operator===">="){if(a=Sze(i,f,r),a===f&&a!==i)return!1}else if(i.operator===">="&&!jw(i.semver,String(f),r))return!1}if(s){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(c=Eze(s,f,r),c===f&&c!==s)return!1}else if(s.operator==="<="&&!jw(s.semver,String(f),r))return!1}if(!f.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&u&&!i&&o!==0||h||d)},Sze=(e,t,r)=>{if(!e)return t;let n=sH(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Eze=(e,t,r)=>{if(!e)return t;let n=sH(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};wze.exports=zfr});var Zy=p((JGr,Aze)=>{var oH=Ky(),Cze=Rw(),Jfr=ki(),Tze=Wz(),Yfr=zh(),Qfr=WWe(),Xfr=HWe(),Zfr=YWe(),ehr=ZWe(),thr=t6e(),rhr=n6e(),nhr=s6e(),ihr=a6e(),shr=Jo(),ohr=d6e(),ahr=f6e(),chr=VD(),lhr=_6e(),uhr=v6e(),dhr=Nw(),phr=GD(),fhr=zz(),hhr=Hz(),mhr=WD(),ghr=zD(),_hr=Kz(),yhr=O6e(),vhr=Mw(),bhr=Yo(),Shr=Lw(),Ehr=Y6e(),whr=X6e(),xhr=eze(),Chr=nze(),Thr=sze(),Ahr=YD(),Ohr=dze(),Ihr=fze(),Rhr=gze(),Phr=yze(),Nhr=xze();Aze.exports={parse:Yfr,valid:Qfr,clean:Xfr,inc:Zfr,diff:ehr,major:thr,minor:rhr,patch:nhr,prerelease:ihr,compare:shr,rcompare:ohr,compareLoose:ahr,compareBuild:chr,sort:lhr,rsort:uhr,gt:dhr,lt:phr,eq:fhr,neq:hhr,gte:mhr,lte:ghr,cmp:_hr,coerce:yhr,Comparator:vhr,Range:bhr,satisfies:Shr,toComparators:Ehr,maxSatisfying:whr,minSatisfying:xhr,minVersion:Chr,validRange:Thr,outside:Ahr,gtr:Ohr,ltr:Ihr,intersects:Rhr,simplifyRange:Phr,subset:Nhr,SemVer:Jfr,re:oH.re,src:oH.src,tokens:oH.t,SEMVER_SPEC_VERSION:Cze.SEMVER_SPEC_VERSION,RELEASE_TYPES:Cze.RELEASE_TYPES,compareIdentifiers:Tze.compareIdentifiers,rcompareIdentifiers:Tze.rcompareIdentifiers}});var Fw=p(QD=>{"use strict";Object.defineProperty(QD,"__esModule",{value:!0});QD.EditableComponentVersionTypes=void 0;var Oze;(function(e){e.Latest="latest"})(Oze||(QD.EditableComponentVersionTypes=Oze={}))});var lH=p(Ka=>{"use strict";var Dhr=Ka&&Ka.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),khr=Ka&&Ka.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Rze=Ka&&Ka.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Dhr(r,t,n[i]);return khr(r,t),r}}();Object.defineProperty(Ka,"__esModule",{value:!0});Ka.ComponentSetRule=void 0;Ka.assertIsCompenentSetRule=Pze;var Qh=Yt(),Uw=Rze(require("assert/strict")),aH=Rze(Zy()),Ize=Fw(),cH=class{constructor(t){Pze(t),this.componentName=t.componentName,this.componentSet=t.componentSet,this.versionPattern=t.versionPattern,t.editableVersions!==void 0&&(this.editableVersions=t.editableVersions.sort().reverse()),t.excludedVersions!==void 0&&(this.excludedVersions=t.excludedVersions.sort().reverse())}};Ka.ComponentSetRule=cH;function Pze(e){if((0,Qh.assertIsDefined)(e),(0,Qh.assertIsMapOfStringAny)(e),(0,Qh.assertIsString)(e.componentName),Uw.ok(e.componentName.length>0,"componentName must not be an empty string"),(0,Qh.assertIsString)(e.componentSet),Uw.ok(e.componentSet.length>0,"componentSet must not be an empty string"),(0,Qh.assertIsString)(e.versionPattern),Uw.ok(aH.validRange(e.versionPattern),"versionPattern must be a valid semver"),e.editableVersions!==void 0){(0,Qh.assertIsArray)(e.editableVersions);for(let t of e.editableVersions)t!==Ize.EditableComponentVersionTypes.Latest&&Uw.ok(aH.valid(t),`editable component versions must be a valid semver version or "${Ize.EditableComponentVersionTypes.Latest}"`)}if(e.excludedVersions!==void 0){(0,Qh.assertIsArray)(e.excludedVersions);for(let t of e.excludedVersions)Uw.ok(aH.valid(t),"excluded versions must be a valid semver version")}}});var Nze=p(Vc=>{"use strict";var Mhr=Vc&&Vc.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),qhr=Vc&&Vc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Lhr=Vc&&Vc.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Mhr(r,t,n[i]);return qhr(r,t),r}}();Object.defineProperty(Vc,"__esModule",{value:!0});Vc.ComponentSetRuleRepository=void 0;var jhr=xu(),Fhr=Hy(),Uhr=lH(),Bhr=Lhr(Zy()),uH=class extends jhr.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set_rule",Fhr.EntityDefinitions.componentSetRule,Uhr.ComponentSetRule)}async getComponentSetRulesForSet(t){let r=await this.findByComponentSet(t);return Object.fromEntries(r.map(({componentName:n,versionPattern:i})=>[n,i]))}async findByComponentSet(t){return await this.queryItems({componentSet:t},{index:"gsi1_pk-gsi1_sk-index"})}async findByComponentName(t){return await this.queryItems({componentName:t})}async getComponentSetsMatchingComponentVersion(t,r){return(await this.findByComponentName(t)).filter(({versionPattern:i})=>Bhr.satisfies(r,i))}async deleteByComponentSet(t,r){let n=await this.findByComponentSet(t),i=[];for(let s of n)i.push(this.deleteItem(s,r));await Promise.allSettled(i)}async deleteByComponentName(t,r){let n=await this.findByComponentName(t),i=[];for(let s of n)i.push(this.deleteItem(s,r));await Promise.allSettled(i)}};Vc.ComponentSetRuleRepository=uH});var XD=p(ev=>{"use strict";Object.defineProperty(ev,"__esModule",{value:!0});ev.ComponentSetComponentVersion=ev.ComponentSetComponentVersionStatus=void 0;var Gc=Yt(),Bw;(function(e){e.active="active",e.excluded="excluded"})(Bw||(ev.ComponentSetComponentVersionStatus=Bw={}));var dH=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",this.status=Bw.active,(0,Gc.assertIsDefined)(t),this.componentSetWebPath=(0,Gc.assertAssign)(t.componentSetWebPath,Gc.assertIsString,"componentSetWebPath must be a string"),this.componentName=(0,Gc.assertAssign)(t.componentName,Gc.assertIsString,"componentName must be a string"),this.componentVersion=(0,Gc.assertAssign)(t.componentVersion,Gc.assertIsString,"componentVersion must be a string"),this.environmentVariables=(0,Gc.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,Gc.assertIsMapOfStringString,{}),t.status===void 0&&(t.status=Bw.active),(0,Gc.assertIsEnumValue)(t.status,Bw),this.status=t.status}};ev.ComponentSetComponentVersion=dH});var fH=p(ek=>{"use strict";Object.defineProperty(ek,"__esModule",{value:!0});ek.ComponentSetComponentVersionRepository=void 0;var $hr=xu(),Vhr=Hy(),ZD=XD(),pH=class extends $hr.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set_component_version",Vhr.EntityDefinitions.componentSetComponentVersion,ZD.ComponentSetComponentVersion)}async deleteByComponentSet(t,r){let n=await this.findByComponentSet(t),i=[];for(let s of n)i.push(this.deleteItem(s,r));await Promise.allSettled(i)}async deleteByComponentVersion(t,r,n){let i=await this.findByComponentVersion(t,r),s=[];for(let o of i)s.push(this.deleteItem(o,n));await Promise.allSettled(s)}async deleteByComponentName(t,r){let n=await this.findByComponentName(t),i=[];for(let s of n)i.push(this.deleteItem(s,r));await Promise.allSettled(i)}async findByComponentSet(t){return await this.queryItems({componentSetWebPath:t},{index:"gsi1_pk-gsi1_sk-index"})}async findByComponentVersion(t,r){return await this.queryItems({componentName:t},{filter:{type:"begins_with",keyword:`${r}#`}})}async findByComponentName(t){return await this.queryItems({componentName:t})}async getComponentSetVersionsList(t){let r=await this.findByComponentSet(t),n={};for(let i of r)n[i.componentName]===void 0&&(n[i.componentName]=[]),n[i.componentName].push(i.componentVersion);return Object.entries(n).forEach(([i,s])=>{n[i]=s.sort((o,a)=>o<a?1:o>a?-1:0)}),n}async findByComponentVersionActive(t,r){return(await this.findByComponentVersion(t,r)).filter(n=>n.status===ZD.ComponentSetComponentVersionStatus.active)}async findByComponentNameActive(t){return(await this.findByComponentName(t)).filter(r=>r.status===ZD.ComponentSetComponentVersionStatus.active)}async findByComponentSetActive(t){return(await this.findByComponentSet(t)).filter(r=>r.status===ZD.ComponentSetComponentVersionStatus.active)}};ek.ComponentSetComponentVersionRepository=pH});var Dze=p(hH=>{"use strict";Object.defineProperty(hH,"__esModule",{value:!0});hH.createComponentDynamoDbManager=emr;var Ghr=oW(),Whr=xu(),zhr=xWe(),Hhr=xu(),Khr=Lz(),Jhr=Uz(),Yhr=Vz(),Qhr=Nze(),Xhr=fH();function Zhr(e){return t=>({component:new Khr.ComponentRepository(e,t),componentVersion:new Jhr.ComponentVersionRepository(e,t),componentSet:new Yhr.ComponentSetRepository(e,t),componentSetRule:new Qhr.ComponentSetRuleRepository(e,t),componentSetComponentVersion:new Xhr.ComponentSetComponentVersionRepository(e,t)})}function emr(e,t,r){let n=new Ghr.DynamoDBClient((0,Hhr.getDynamoDbOptions)(t,r)),i=zhr.DynamoDBDocument.from(n);return new Whr.DynamoDbManager(i,Zhr(e))}});var kze=p(Xh=>{"use strict";var tmr=Xh&&Xh.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),rmr=Xh&&Xh.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&tmr(t,e,r)};Object.defineProperty(Xh,"__esModule",{value:!0});rmr(Dze(),Xh)});var rk=p(tk=>{"use strict";Object.defineProperty(tk,"__esModule",{value:!0});tk.AbstractComponentSetService=void 0;var mH=class{getComponentRuntimeHeaders(t,r){var n,i;let s=(n=r.output.headers)!==null&&n!==void 0?n:{},o=(i=t.headers)!==null&&i!==void 0?i:{};return{...s,...o}}};tk.AbstractComponentSetService=mH});var Mze=p(nk=>{"use strict";Object.defineProperty(nk,"__esModule",{value:!0});nk.ComponentSetServiceForLocalDev=void 0;var tv=Yt(),nmr=rk(),gH=class extends nmr.AbstractComponentSetService{constructor(t){super(),this.logger=t}async updateComponentSet(){throw new tv.MethodNotImplementedError("updateComponentSet is not implemented for local development")}async getAllComponentSets(){throw new tv.MethodNotImplementedError("getAllComponentSets is not implemented for local development")}async addComponentSet(){throw new tv.MethodNotImplementedError("addComponentSet is not implemented for local development")}async deleteComponentSet(){throw new tv.MethodNotImplementedError("deleteComponentSet is not implemented for local development")}addComponentToSet(t,r,n){throw new tv.MethodNotImplementedError("addComponentToSet is not implemented for local development")}async getPaginatedComponentSets(t=1,r=[],n="asc"){throw new tv.MethodNotImplementedError("getPaginatedComponentSets is not implemented for local development")}async getComponentSetWebModel(t){return{webPath:t,displayName:"set",description:"debug set",environmentVariables:process.env,headers:{},components:{},componentVersionRules:{}}}async getComponentSet(t){return{webPath:t,displayName:"set",description:"debug set",environmentVariables:process.env,headers:{}}}async getComponentsRuntimeSetData(t,r){let n={},i=t.getModel().environment||[],s=[];for(let o of i)r.environmentVariables[o.name]===void 0?o.required!==!1&&s.push(o.name):n[o.name]=r.environmentVariables[o.name];if(s.length>0)throw new Error(`Missing required environment variables: "${s.join('","')}"`);return{environment:n,displayName:r.displayName,webPath:r.webPath}}async componentVersionInSet(t,r){return!0}async componentVersionExcludedFromSet(t,r,n){return!1}};nk.ComponentSetServiceForLocalDev=gH});var Fze=p(Ja=>{"use strict";var imr=Ja&&Ja.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),smr=Ja&&Ja.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Lze=Ja&&Ja.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&imr(r,t,n[i]);return smr(r,t),r}}();Object.defineProperty(Ja,"__esModule",{value:!0});Ja.ComponentSetComponentVersionEditable=void 0;Ja.assertIsComponentVersionEditable=jze;var $w=Yt(),ik=Lze(require("assert/strict")),omr=Lze(Zy()),qze=Fw(),_H=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",jze(t),this.componentSetWebPath=t.componentSetWebPath,this.componentName=t.componentName,this.componentVersion=t.componentVersion}};Ja.ComponentSetComponentVersionEditable=_H;function jze(e){(0,$w.assertIsDefined)(e),(0,$w.assertIsMapOfStringString)(e),(0,$w.assertIsString)(e.componentName),ik.ok(e.componentName.length>0,"componentName must not be an empty string"),(0,$w.assertIsString)(e.componentSetWebPath),ik.ok(e.componentSetWebPath.length>0,"componentSetWebPath must not be an empty string"),(0,$w.assertIsString)(e.componentVersion),ik.ok(e.componentVersion.length>0,"editable component version must not be an empty string"),e.componentVersion!==qze.EditableComponentVersionTypes.Latest&&ik.ok(omr.valid(e.componentVersion),`editable component version must be a valid semver version or "${qze.EditableComponentVersionTypes.Latest}"`)}});var bH=p(Wc=>{"use strict";var amr=Wc&&Wc.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),cmr=Wc&&Wc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lmr=Wc&&Wc.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&amr(r,t,n[i]);return cmr(r,t),r}}();Object.defineProperty(Wc,"__esModule",{value:!0});Wc.ComponentSetServiceForProduction=void 0;var mn=Yt(),umr=jD(),dmr=Fw(),pmr=rk(),Wp=XD(),Uze=lH(),fmr=Zy(),yH=lmr(Zy()),hmr=Fze(),vH=class extends pmr.AbstractComponentSetService{constructor(t,r,n,i){super(),this.db=t,this.logger=r,this.manifestService=n,this.componentLoggingService=i}async getComponentSet(t){let r=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(!r)throw new mn.ResourceNotFoundError(`component set ${t} could not be found`);return r}async addComponentSet(t,r){await this.assertValidCreateComponentSet(t);try{let n=await this.db.executeInTransaction(async a=>{var c;let l=await this.db.repositories.componentSet.createItem(new umr.ComponentSet({webPath:t.webPath,displayName:t.displayName,description:t.description,environmentVariables:t.environmentVariables,headers:t.headers}),a),u=(c=t.componentVersionRules)!==null&&c!==void 0?c:{};return await this.setComponentVersionRules(t.webPath,u,a),await this.saveComponentSetComponents(t.webPath,u,t.components,a),l}),i=await this.getComponentSetWebModel(n.webPath),s=`Component set added: ${i.webPath}.`,o=`componentSetId:${i.webPath}`;return await this.componentLoggingService.info(s,void 0,r,o),await this.componentLoggingService.flush(),i}catch(n){throw this.logger.error(`Error occurred when creating component set ${t.webPath}: ${n}`),n}}async removeEnvironmentVariablesFromComponents(t){t.components||(t.components={}),Object.keys(t.components).forEach(r=>{t.components[r].forEach(n=>delete n.environmentVariables)})}getChangedComponentsInSet(t,r){let n=t.components?Object.keys(t.components):[],i=r.components?Object.keys(r.components):[],s=[],o=[];for(let a of i)n.includes(a)||s.push(a);for(let a of n)i.includes(a)||o.push(a);return s.concat(o)}async updateComponentSet(t,r,n){var i;let s=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(!s)throw new mn.ResourceNotFoundError(`Component set with web path ${t} does not exist`);let o=structuredClone(await this.getComponentSetWebModel(t)),a=await this.getExistingComponentSetRules(t);await this.assertValidComponentSet(r,this.normalise(s,{components:await this.getExistingComponentsForWeb(t),componentVersionRules:a})),this.assertValidComponentVersionRules(t,r.componentVersionRules),this.assertComponentVersionsMatchRules(r.components,(i=r.componentVersionRules)!==null&&i!==void 0?i:a);let c={};r.displayName!==void 0&&(c.displayName=r.displayName),r.description!==void 0&&(c.description=r.description),r.headers!==void 0&&(c.headers=r.headers),r.environmentVariables!==void 0&&(c.environmentVariables=r.environmentVariables);try{await this.db.executeInTransaction(async f=>{var y;Object.keys(c).length>0&&await this.db.repositories.componentSet.updateItem({...c,webPath:t},f),r.componentVersionRules&&await this.setComponentVersionRules(t,r.componentVersionRules,f,!0),await this.saveComponentSetComponents(t,(y=r.componentVersionRules)!==null&&y!==void 0?y:a,r.components,f)});let l=`Component set updated: "${t}".`,u=structuredClone(await this.getComponentSetWebModel(t));this.removeEnvironmentVariablesFromComponents(o),this.removeEnvironmentVariablesFromComponents(u),l+=` Changed from ${JSON.stringify(o.components)} to ${JSON.stringify(u.components)}.`;let d=this.getChangedComponentsInSet(o,u),h=`componentSetId:${u.webPath}`;return h+=` ${d.map(f=>`componentId:${f}`).join(" ")}`,await this.componentLoggingService.info(l,void 0,n,h),await this.componentLoggingService.flush(),this.getComponentSetWebModel(t)}catch(l){throw this.logger.error(`Error occurred when updating component set ${t}: ${l}`),l}}async getExistingComponentSetRules(t){var r,n;let i=await this.db.repositories.componentSetRule.findByComponentSet(t),s={};for(let o of i)s[o.componentName]={renderableVersionPattern:o.versionPattern,editableVersions:(r=o.editableVersions)!==null&&r!==void 0?r:[],excludedVersions:(n=o.excludedVersions)!==null&&n!==void 0?n:[]};return s}async saveComponentSetComponents(t,r,n,i){let[s,o]=await Promise.all([this.db.repositories.componentSetComponentVersion.findByComponentSet(t),this.getRenderableComponentVersions(r)]);await Promise.all([this.addComponentEntriesInSet(t,o,s,n,i),this.updateComponentEntriesInSet(t,o,s,n,i)])}async getRenderableComponentVersions(t){let r=[];if(t)for(let[n,i]of Object.entries(t)){let s=(await this.getComponentVersionMatchingComponentSetRule(n,i.renderableVersionPattern)).filter(o=>!i.excludedVersions.includes(o.version));r.push(...s)}return r}async addComponentEntriesInSet(t,r,n,i,s){let o=r.filter(a=>n.find(c=>c.componentName===a.componentName&&c.componentVersion===a.version)===void 0).map(a=>{var c;let l={};return i!==void 0&&i[a.componentName]!==void 0&&(l=(c=i[a.componentName].find(u=>u.version===a.version))===null||c===void 0?void 0:c.environmentVariables),new Wp.ComponentSetComponentVersion({componentSetWebPath:t,componentName:a.componentName,componentVersion:a.version,environmentVariables:l??{}})});for(let a of o)await this.db.repositories.componentSetComponentVersion.createItem(a,s)}async updateComponentEntriesInSet(t,r,n,i,s){var o;for(let a of n){let c={},l=r.find(d=>a.componentName===d.componentName&&a.componentVersion===d.version)!==void 0,u=a.status;if(l&&a.status===Wp.ComponentSetComponentVersionStatus.excluded?(c.status=Wp.ComponentSetComponentVersionStatus.active,u=c.status):!l&&a.status===Wp.ComponentSetComponentVersionStatus.active&&(c.status=Wp.ComponentSetComponentVersionStatus.excluded,u=c.status),l&&u===Wp.ComponentSetComponentVersionStatus.active&&i!==void 0&&i[a.componentName]!==void 0){let d=(o=i[a.componentName].find(h=>h.version===a.componentVersion))===null||o===void 0?void 0:o.environmentVariables;d!==void 0&&JSON.stringify(d)!==JSON.stringify(a.environmentVariables)&&(c.environmentVariables=d)}Object.keys(c).length>0&&await this.db.repositories.componentSetComponentVersion.updateItem({...c,componentSetWebPath:t,componentName:a.componentName,componentVersion:a.componentVersion},s)}}async getComponentVersionMatchingComponentSetRule(t,r){return(await this.db.repositories.componentVersion.getComponentVersions(t)).filter(i=>r.trim().length&&yH.satisfies(i.version,r))}async getComponentsRuntimeSetData(t,r){var n;let i={},s=t.getModel().environment||[],o=await this.db.repositories.componentSetComponentVersion.getItem({componentName:t.getName(),componentVersion:t.getVersion(),componentSetWebPath:r.webPath});if(!o)throw new mn.ResourceNotFoundError(`component ${t.getName()} ${t.getVersion} couldn't not be found in set ${r.webPath}`);let a=[];for(let c of s)r.environmentVariables[c.name]===void 0?c.required!==!1&&a.push(c.name):i[c.name]=(n=o.environmentVariables[c.name])!==null&&n!==void 0?n:r.environmentVariables[c.name];if(a.length>0)throw new mn.BadRequestError(`Missing required environment variables: "${a.join('","')}"`);return{environment:i,displayName:r.displayName,webPath:r.webPath}}async setComponentVersionRules(t,r,n,i=!1){let s={};i&&(await this.db.repositories.componentSetRule.findByComponentSet(t)).forEach(o=>{s[o.componentName]=o});for(let[o,a]of Object.entries(r)){let c=new Uze.ComponentSetRule({componentSet:t,componentName:o,versionPattern:a.renderableVersionPattern,editableVersions:typeof a.editableVersions=="string"?[a.editableVersions]:a.editableVersions,excludedVersions:a.excludedVersions});s[o]===void 0?await this.db.repositories.componentSetRule.createItem(c,n):(s[o].versionPattern!==c.versionPattern||!this.equalArrayValue(s[o].editableVersions,c.editableVersions)||!this.equalArrayValue(s[o].excludedVersions,c.excludedVersions))&&await this.db.repositories.componentSetRule.updateItem(c,n)}for(let[o,a]of Object.entries(s))r[o]===void 0&&await this.db.repositories.componentSetRule.deleteItem(a,n)}equalArrayValue(t,r){return!Array.isArray(t)||!Array.isArray(r)||t.length!==r.length?!1:JSON.stringify(t)===JSON.stringify(r)}async getComponentSetWebModel(t){let r=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(r===void 0)throw new mn.ResourceNotFoundError(`Component set with web path ${t} does not exist`);return this.normalise(r,{components:await this.getExistingComponentsForWeb(t),componentVersionRules:await this.getExistingComponentSetRules(t)})}async deleteComponentSet(t,r){if(!await this.db.repositories.componentSet.getComponentSetByWebPath(t))throw new mn.ResourceNotFoundError(`Component set with web path ${t} does not exist`);let n=`Component set deleted: ${t}.`,i=`componentSetId:${t}`;await this.componentLoggingService.info(n,void 0,r,i),await this.componentLoggingService.flush();let[s,o]=await Promise.all([this.db.repositories.componentSetRule.findByComponentSet(t),this.db.repositories.componentSetComponentVersion.findByComponentSet(t)]);return await Promise.allSettled([this.db.repositories.componentSetRule.deleteItems(s),this.db.repositories.componentSetComponentVersion.deleteItems(o)]),await this.db.repositories.componentSet.deleteItem({webPath:t}),1}normalise(t,{components:r,componentVersionRules:n}){var i,s,o,a,c;return{webPath:(i=t.webPath)!==null&&i!==void 0?i:"",displayName:(s=t.displayName)!==null&&s!==void 0?s:"",description:(o=t.description)!==null&&o!==void 0?o:"",environmentVariables:(a=t.environmentVariables)!==null&&a!==void 0?a:{},headers:(c=t.headers)!==null&&c!==void 0?c:{},components:r??{},componentVersionRules:n??{}}}async getExistingComponentsForWeb(t){var r,n,i;let s=await this.db.repositories.componentSetComponentVersion.findByComponentSetActive(t),o={},a={};for(let f of s)o[`${f.componentName}/${f.componentVersion}`]=f.environmentVariables,a[`${f.componentName}/${f.componentVersion}`]={componentName:f.componentName,version:f.componentVersion};let c=await this.db.repositories.componentVersion.getItems(Object.values(a)),l={};for(let f of c)(l[f.componentName]===void 0||yH.compare(f.version,l[f.componentName])>0)&&(l[f.componentName]=f.version);let u=await this.db.repositories.componentSetRule.findByComponentSet(t),d={};for(let f of u)d[f.componentName]=(r=f.editableVersions)!==null&&r!==void 0?r:[];let h={};for(let f of c){h[f.componentName]===void 0&&(h[f.componentName]=[]);let y=`${f.componentName}/${f.version}`;h[f.componentName].push({version:f.version,environmentVariables:(n=o[y])!==null&&n!==void 0?n:{},type:(i=f.type)!==null&&i!==void 0?i:"server",description:f.description,displayName:f.displayName,icon:f.icon,editable:this.isComponentVersionEditable(f.version,d[f.componentName],l[f.componentName])})}return Object.entries(h).forEach(([f,y])=>{h[f]=y.sort((S,E)=>S.version<E.version?1:S.version>E.version?-1:0)}),h}isComponentVersionEditable(t,r,n){return r===void 0||r.length<1?!1:r.includes(dmr.EditableComponentVersionTypes.Latest)&&t===n?!0:r.includes(t)}async assertValidCreateComponentSet(t){if(!t.webPath)throw new mn.BadRequestError("Component set 'webPath' must be specificed and non-empty");if(!t.displayName)throw new mn.BadRequestError("Component set 'displayName' must be specificed and non-empty");if(this.assertValidWebPath(t.webPath),await this.db.repositories.componentSet.getComponentSetByWebPath(t.webPath))throw new mn.BadRequestError(`Component set with web path ${t.webPath} already exists`);await this.assertValidComponentSet(t),this.assertValidComponentVersionRules(t.webPath,t.componentVersionRules),this.assertComponentVersionsMatchRules(t.components,t.componentVersionRules)}assertComponentVersionsMatchRules(t={},r={}){for(let[n,i]of Object.entries(t))if(!(r[n]!==void 0&&i.every(({version:o})=>(0,fmr.satisfies)(o,r[n].renderableVersionPattern))))throw new mn.BadRequestError("Component versions must satisfy version rule")}async assertValidComponentSet(t,r=void 0){var n,i;if(t.environmentVariables!==void 0&&this.assertValidEnvVars(t.environmentVariables),t.headers!==void 0&&this.assertValidHeaders(t.headers),t.components!==void 0){let s=(i=(n=t.environmentVariables)!==null&&n!==void 0?n:r==null?void 0:r.environmentVariables)!==null&&i!==void 0?i:{};await this.assertValidComponents(t.components,s)}}assertValidWebPath(t){if(t.replace(/[^a-z0-9\-_.]/i,"")!==t)throw new mn.BadRequestError("Invalid Component Set web path. Only [A-Za-z0-9_-.] chars are allowed")}assertValidEnvVars(t={}){Object.entries(t).forEach(([r,n])=>{this.assertValidProperty({name:r,value:n,type:"environment variable"})})}assertValidHeaders(t){Object.entries(t).forEach(([r,n])=>{this.assertValidProperty({name:r,value:n,type:"header"})})}assertValidProperty(t){if(!/^[a-z0-9\-_.]+$/i.test(t.name))throw new mn.BadRequestError(`Invalid '${t.type}' name for '${t.name}'. Only [A-Za-z0-9_-.] chars are allowed`);if(typeof t.value!="string")throw new mn.BadRequestError(`Invalid '${t.type}' value for '${t.name}'. Value must be a string`)}async assertValidComponents(t,r){if(t){let n=[];for(let[s,o]of Object.entries(t)){if(!s)throw new mn.BadRequestError("Component name must be non-empty");let a=[];for(let c of o){if(!c.version)throw new mn.BadRequestError("Component version must set and be non-empty");if(a.includes(c.version))throw new mn.BadRequestError(`Multiple componet version entries for component ${s} with version ${c.version}`);if(a.push(c.version),c.environmentVariables!==void 0){this.assertValidEnvVars(c.environmentVariables);let l=Object.keys(c.environmentVariables).filter(u=>!Object.keys(r).includes(u));if(l.length)throw new mn.BadRequestError(`Env var(s) '${l.join("', '")}' defined on component ${s} with version ${c.version} is/are not defined on the component set`)}n.push({componentName:s,version:c.version})}}let i=await this.db.repositories.componentVersion.getItems(n);for(let[s,o]of Object.entries(t))for(let a of o)if(!i.find(c=>c.componentName===s&&c.version===a.version))throw new mn.BadRequestError(`Component ${s} with version ${a.version} does not exists`)}}assertValidComponentVersionRules(t,r={}){for(let[n,i]of Object.entries(r))try{this.assertValidVersionRule(i.renderableVersionPattern),(0,Uze.assertIsCompenentSetRule)({componentSet:t,componentName:n,versionPattern:i.renderableVersionPattern});let s=typeof i.editableVersions=="string"?[i.editableVersions]:i.editableVersions;this.assertValidEditableVersions(s);for(let o of s)(0,hmr.assertIsComponentVersionEditable)({componentSetWebPath:t,componentName:n,componentVersion:o})}catch(s){throw new mn.BadRequestError(s.message)}}assertValidVersionRule(t){if(!yH.validRange(t))throw new Error(`Invalid renderable component version semver value: ${t}`)}assertValidEditableVersions(t){let r=t.filter((n,i)=>t.indexOf(n)!=i);if(r.length)throw new Error(`Duplicate editable versions: ${[...new Set(r)].join(", ")}`)}async getAllComponentSets(){let t=await this.db.repositories.componentSet.getAllComponentSets(),r=[];for(let n of t)r.push(this.normalise(n,{components:await this.getExistingComponentsForWeb(n.webPath),componentVersionRules:await this.getExistingComponentSetRules(n.webPath)}));return r}async getPaginatedComponentSets(t=1,r=[],n="asc"){let s=(t-1)*20,o=s+20,a=(await this.db.repositories.componentSet.getAllComponentSets()).sort((l,u)=>n==="asc"?l.displayName.localeCompare(u.displayName):u.displayName.localeCompare(l.displayName)),c=[];for(let l of a.slice(s,o))c.push(this.normalise(l,{components:await this.getExistingComponentsForWeb(l.webPath),componentVersionRules:await this.getExistingComponentSetRules(l.webPath)}));return{items:c,pageInfo:(0,mn.getPageInfo)(t,20,a.length)}}async componentVersionInSet(t,r){let n=await this.db.repositories.componentSetComponentVersion.getItem({componentName:t.getName(),componentVersion:t.getVersion(),componentSetWebPath:r});return n!==void 0&&n.status===Wp.ComponentSetComponentVersionStatus.active}async addComponentToSet(t,r,n,i){let s=await this.db.repositories.componentSetComponentVersion.createItem(new Wp.ComponentSetComponentVersion({componentSetWebPath:t,componentName:r,componentVersion:n})),o=`Component: ${r} added to ${t}.`,a=`componentSetId:${t} componentId:${r}`;return await this.componentLoggingService.info(o,void 0,i,a),await this.componentLoggingService.flush(),s}async componentVersionExcludedFromSet(t,r,n){let i=await this.db.repositories.componentSetRule.getItem({componentSet:t,componentName:r});return i!==void 0&&i.excludedVersions!==void 0&&i.excludedVersions.includes(n)}};Wc.ComponentSetServiceForProduction=vH});var EH=p(sk=>{"use strict";Object.defineProperty(sk,"__esModule",{value:!0});sk.ComponentSetRuleService=void 0;var SH=class{constructor(t,r){this.db=t,this.componentSetService=r}async addComponentVersionToRequiredSets(t,r){let n=await this.db.repositories.componentSetRule.getComponentSetsMatchingComponentVersion(t,r),i=[];for(let o of n)o.excludedVersions!==void 0&&o.excludedVersions.includes(r)||i.push(o);let s=({componentSet:o})=>this.componentSetService.addComponentToSet(o,t,r);return Promise.allSettled(i.map(s))}};sk.ComponentSetRuleService=SH});var $ze=p(Bze=>{"use strict";Object.defineProperty(Bze,"__esModule",{value:!0})});var Gze=p(Vze=>{"use strict";Object.defineProperty(Vze,"__esModule",{value:!0})});var Wze=p(ok=>{"use strict";Object.defineProperty(ok,"__esModule",{value:!0});ok.InvalidEnvironmentVariablesError=void 0;var mmr=Yt(),wH=class extends mmr.BadRequestError{constructor(t){let r=t.map(([n,i])=>`"${n}" ${i}`).join("; ");super(`Invalid Environment Variables: ${r}`),this.errors=t,this.name="InvalidEnvironmentVariablesError"}};ok.InvalidEnvironmentVariablesError=wH});var Hze=p(zze=>{"use strict";Object.defineProperty(zze,"__esModule",{value:!0})});var Jze=p(Kze=>{"use strict";Object.defineProperty(Kze,"__esModule",{value:!0})});var Yze=p(cr=>{"use strict";var gmr=cr&&cr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Qo=cr&&cr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&gmr(t,e,r)};Object.defineProperty(cr,"__esModule",{value:!0});cr.DynamoComponentSetServiceForProduction=cr.DynamoDbComponentSetRuleService=cr.DynamoDbComponentSetRepository=cr.DynamoDbComponentSetComponentVersionRepository=void 0;Qo(jD(),cr);Qo(XD(),cr);Qo(rk(),cr);Qo(Mze(),cr);Qo(bH(),cr);Qo(EH(),cr);Qo($ze(),cr);var _mr=fH();Object.defineProperty(cr,"DynamoDbComponentSetComponentVersionRepository",{enumerable:!0,get:function(){return _mr.ComponentSetComponentVersionRepository}});var ymr=Vz();Object.defineProperty(cr,"DynamoDbComponentSetRepository",{enumerable:!0,get:function(){return ymr.ComponentSetRepository}});var vmr=EH();Object.defineProperty(cr,"DynamoDbComponentSetRuleService",{enumerable:!0,get:function(){return vmr.ComponentSetRuleService}});var bmr=bH();Object.defineProperty(cr,"DynamoComponentSetServiceForProduction",{enumerable:!0,get:function(){return bmr.ComponentSetServiceForProduction}});Qo(Fw(),cr);Qo(Gze(),cr);Qo(Wze(),cr);Qo(Hze(),cr);Qo(Jze(),cr)});var Xze=p(Qze=>{"use strict";Object.defineProperty(Qze,"__esModule",{value:!0})});var eHe=p(Zze=>{"use strict";Object.defineProperty(Zze,"__esModule",{value:!0})});var rHe=p(Xo=>{"use strict";var Smr=Xo&&Xo.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Emr=Xo&&Xo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tHe=Xo&&Xo.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Smr(r,t,n[i]);return Emr(r,t),r}}();Object.defineProperty(Xo,"__esModule",{value:!0});Xo.JobV1=Xo.v1=void 0;Xo.v1=tHe(Xze());Xo.JobV1=tHe(eHe())});var xH=p((_4r,wmr)=>{wmr.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ComponentManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},namespace:{type:"string",description:"Namespace of the component",$ref:"#/definitions/name-pattern"},name:{type:"string",description:"Name of the component",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the component"},description:{type:"string",description:"Description of the component"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},icon:{$ref:"DxComponentIcons.json"},type:{type:"string",enum:["edge","server"],description:"Type of component that will be deployed to different runtimes"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},environment:{type:"array",description:"an array of environmental variables needed to execute correctly. These variables are set through your local environment variables during testing or through the component set during production run time",items:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$",description:"Environmental variable name"},required:{type:"boolean",default:!0}},required:["name"]}},staticFiles:{type:"object",properties:{locationRoot:{type:"string",description:"The location the system begins looking static files. All static files will be referenced from here."}},required:["locationRoot"]},functions:{type:"array",minItems:0,items:{title:"ComponentFunction",description:"Component function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name, this will be used as part of the url to access this function"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"},output:{oneOf:[{title:"HtmlResponse",type:"object",additionalProperties:!1,description:"The HtmlResponse type is for returning html content. The response out of the function must be a string. This response object also includes references to resources (staticFiles) the component needs to execute correctly. It is up to the integrating system to respect this.",properties:{responseType:{const:"html"},staticFiles:{type:"array",description:"A list of static resources that are required for the component to execute correctly",items:{type:"object",title:"HtmlStaticFile",additionalProperties:!1,properties:{location:{description:"The location property is used to inform integrating system if the static resource should be included in the header of footer of the document",oneOf:[{const:"header"},{const:"footer"}]},file:{oneOf:[{type:"object",title:"JsFile",additionalProperties:!1,properties:{type:{const:"js"},filepath:{type:"string"},defer:{type:"boolean"},async:{type:"boolean"},module:{oneOf:[{const:"module"},{const:"text/javascript"}]},integrity:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath","type"]},{type:"object",title:"CssFile",additionalProperties:!1,properties:{type:{const:"css"},filepath:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath"]}]}},required:["location","file"]}},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType"]},{title:"JsonResponse",type:"object",additionalProperties:!1,properties:{responseType:{const:"json"},definition:{$ref:"http://json-schema.org/draft-07/schema#"},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType","definition"]}]},queryParameters:{propertyNames:{title:"Query parameter name",type:"string"},additionalProperties:{title:"Query parameter value type",type:"object",properties:{required:{type:"boolean"}},required:["required"]}}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{type:"string",pattern:"^[a-zA-Z0-9_\\-]+$"},minProperties:1,additionalProperties:{title:"Preview Definition",type:"object",description:"Name for the preview and how it will be accessed",required:["functionData"],properties:{functionData:{description:"A map of the functions to their respective preview information. Properties must match name of a function defined in functions list",type:"object",propertyNames:{$ref:"#/definitions/name-pattern"},minProperties:1,additionalProperties:{type:"object",title:"Function preview configuration",description:"Data inputs for the preview of functions in the component",properties:{inputData:{type:"object",description:"Property for defining the input data for this preview component function",properties:{type:{description:"An enum of 'file' or 'inline' for how the input data is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to input data file"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{type:"object",description:"Input data value"}},required:["type","value"]}]},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}},wrapper:{type:"object",description:"Define the extra static files which provide a container for the component function",properties:{path:{type:"string",format:"uri-reference",description:"File path to the wrapper container"}},required:["path"]}}}}}}},mockedUris:{type:"object",description:"Mocked uri objects used in the preview",propertyNames:{type:"string",pattern:"^[a-z0-9_\\-]+:\\/\\/"},additionalProperties:{type:"object",description:"Property for defining the mock URI object",properties:{type:{description:"An enum of 'file' or 'inline' for how the uri object is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to uri object"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{$ref:"MatrixAssetSchema.json",description:"Inline URI object"}},required:["type","value"]}]}},"ui:metadata":{properties:{autoReload:{type:"boolean",default:!0}},required:["autoReload"]}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var CH=p((y4r,xmr)=>{xmr.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"JobManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},name:{type:"string",description:"Name of the job",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the job"},description:{type:"string",description:"Description of the job"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},timeout:{type:"number",description:"Timeout in seconds before a job is stopped (min 10min, max 8h)",minimum:600,maximum:28800},concurrency:{type:"number",description:"The number of these jobs that can be run at once",minimum:1},functions:{type:"array",minItems:0,items:{title:"JobFunction",description:"Job function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"}},required:["name","entry","input"]}}},required:["name","displayName","description","version","functions","$schema","mainFunction","concurrency","timeout"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var iHe=p(zp=>{"use strict";var nHe=zp&&zp.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zp,"__esModule",{value:!0});zp.JobV1=zp.v1=void 0;var Cmr=nHe(xH());zp.v1=Cmr.default;var Tmr=nHe(CH());zp.JobV1=Tmr.default});var oHe=p(sHe=>{"use strict";Object.defineProperty(sHe,"__esModule",{value:!0})});var aHe=p(zc=>{"use strict";var Amr=zc&&zc.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Omr=zc&&zc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Imr=zc&&zc.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Amr(r,t,n[i]);return Omr(r,t),r}}();Object.defineProperty(zc,"__esModule",{value:!0});zc.v1=void 0;zc.v1=Imr(oHe())});var TH=p((E4r,Rmr)=>{Rmr.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"SquizFormattedTextSchema.json",type:"array",title:"FormattedText",items:{$ref:"#/definitions/FormattedNodes"},definitions:{FormattedNodes:{anyOf:[{$ref:"#/definitions/HigherOrderFormattedNodes"},{$ref:"#/definitions/BaseFormattedNodes"}]},HigherOrderFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextLinkToMatrixAsset"},{$ref:"#/definitions/FormattedTextMatrixImage"},{$ref:"#/definitions/FormattedTextDamImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/FormattedTextFragment"},{$ref:"#/definitions/TextNode"},{$ref:"#/definitions/ComponentNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},FormattedNodeFontProperties:{type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}},FormattedTextTag:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"tag"},tag:{type:"string",minLength:1},attributes:{type:"object",additionalProperties:{type:"string"}},font:{$ref:"#/definitions/FormattedNodeFontProperties"}},required:["type","tag"]},FormattedTextFragment:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},type:{const:"fragment"}},required:["type"]},ComponentNode:{type:"object",additionalProperties:!1,properties:{type:{const:"component"},componentId:{type:"string"},componentType:{type:"string",enum:["edge","server"]},componentSet:{type:"string"},contentItem:{type:"object",title:"ContentItemReference",properties:{id:{type:"string"}},required:[]}},required:["type","componentSet","componentId","componentType"]},FormattedTextLinkToMatrixAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-matrix-asset"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},target:{type:"string",enum:["_blank","_self","_parent","_top"]},attributes:{allOf:[{type:"object",properties:{href:!1,target:!1}},{type:"object",additionalProperties:{type:"string"}}]}},required:["type","matrixDomain","matrixAssetId","target","children"]},FormattedTextMatrixImage:{type:"object",additionalProperties:!1,properties:{type:{const:"matrix-image"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},formattingOptions:{$ref:"#/definitions/FormattingOptions"},attributes:{allOf:[{type:"object",properties:{src:!1}},{type:"object",additionalProperties:{type:"string"}}]}},required:["type","matrixDomain","matrixAssetId"]},FormattedTextDamImage:{type:"object",additionalProperties:!1,properties:{type:{const:"dam-image"},damSystemType:{enum:["bynder"]},damSystemIdentifier:{type:"string",minLength:1},damObjectId:{type:"string",minLength:1},damAdditional:{type:"object",properties:{variant:{type:"string",minLength:1}}},formattingOptions:{$ref:"#/definitions/FormattingOptions"},attributes:{allOf:[{type:"object",properties:{src:!1}},{type:"object",additionalProperties:{type:"string"}}]}},required:["type","damSystemType","damSystemIdentifier","damObjectId"]}}}});var cHe=p(rv=>{"use strict";var Pmr=rv&&rv.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rv,"__esModule",{value:!0});rv.v1=void 0;var Nmr=Pmr(TH());rv.v1=Nmr.default});var OH=p((Vw,AH)=>{(function(e,t){typeof Vw=="object"&&typeof AH=="object"?AH.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof Vw=="object"?Vw.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:Vw,()=>(()=>{var e={546:function(i){typeof self<"u",i.exports=(()=>{"use strict";var s={d:(D,W)=>{for(var oe in W)s.o(W,oe)&&!s.o(D,oe)&&Object.defineProperty(D,oe,{enumerable:!0,get:W[oe]})},o:(D,W)=>Object.prototype.hasOwnProperty.call(D,W),r:D=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})}},o={};function a(D){return D==="#"||D===""||Array.isArray(D)&&D.length===0||!1}s.r(o),s.d(o,{default:()=>be,get:()=>S,isRoot:()=>a,join:()=>te,remove:()=>j,removeUndefinedItems:()=>k,set:()=>F,split:()=>y,splitLast:()=>pe});let c=/~1/g,l=/~0/g,u=/\/+/g,d=/(^[#/]*|\/+$)/g;function h(D){return D.replace(c,"/").replace(l,"~")}function f(D){return h(decodeURIComponent(D))}function y(D){if(D==null||typeof D!="string"||a(D))return Array.isArray(D)?D:[];let W=D.indexOf("#")>=0?f:h,oe=(D=(D=D.replace(u,"/")).replace(d,"")).split("/");for(let ae=0,le=oe.length;ae<le;ae+=1)oe[ae]=W(oe[ae]);return oe}function S(D,W,oe=void 0){if(W==null||D==null)return oe;if(a(W))return D;let ae=E(D,y(W));return ae===void 0?oe:ae}function E(D,W){let oe=W.shift();if(D!==void 0)return oe!==void 0?E(D[oe],W):D}let C=/^\[.*\]$/,P=/^\[(.+)\]$/;function q(D,W){return D==="__proto__"||D=="constructor"&&W.length>0&&W[0]=="prototype"}function F(D,W,oe){if(W==null)return D;let ae=y(W);if(ae.length===0)return D;D==null&&(D=C.test(ae[0])?[]:{});let le,ct,Ct=D;for(;ae.length>1;)le=ae.shift(),ct=C.test(ae[0]),q(le,ae)||(Ct=B(Ct,le,ct));return le=ae.pop(),J(Ct,le,oe),D}function J(D,W,oe){let ae,le=W.match(P);W==="[]"&&Array.isArray(D)?D.push(oe):le?(ae=le.pop(),D[ae]=oe):D[W]=oe}function B(D,W,oe){if(D[W]!=null)return D[W];let ae=oe?[]:{};return J(D,W,ae),ae}function k(D){let W=0,oe=0;for(;W+oe<D.length;)D[W+oe]===void 0&&(oe+=1),D[W]=D[W+oe],W+=1;return D.length=D.length-oe,D}function j(D,W,oe){let ae=y(W),le=ae.pop(),ct=S(D,ae);return ct&&delete ct[le],Array.isArray(ct)&&oe!==!0&&k(ct),D}let I=/\/+/g,G=/~/g,N=/\//g;function z(D,W){if(D.length===0)return W?"#":"";for(let oe=0,ae=D.length;oe<ae;oe+=1)D[oe]=D[oe].replace(G,"~0").replace(N,"~1"),W&&(D[oe]=encodeURIComponent(D[oe]));return((W?"#/":"/")+D.join("/")).replace(I,"/")}function te(D,...W){let oe=[];if(Array.isArray(D))return z(D,arguments[1]===!0);let ae=arguments[arguments.length-1],le=typeof ae=="boolean"?ae:D&&D[0]==="#";for(let Ct=0,hr=arguments.length;Ct<hr;Ct+=1)oe.push.apply(oe,y(arguments[Ct]));let ct=[];for(let Ct=0,hr=oe.length;Ct<hr;Ct+=1)if(oe[Ct]===".."){if(ct.length===0)return le?"#":"";ct.pop()}else ct.push(oe[Ct]);return z(ct,le)}function pe(D){let W=y(D);if(W.length===0)return typeof D=="string"&&D[0]==="#"?["#",W[0]]:["",void 0];if(W.length===1)return D[0]==="#"?["#",W[0]]:["",W[0]];let oe=W.pop();return[te(W,D[0]==="#"),oe]}let be={get:S,set:F,remove:j,join:te,split:y,splitLast:pe,isRoot:a,removeUndefinedItems:k};return o})()},782:(i,s,o)=>{"use strict";let a=o(492);var c;(function(l){l.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],l.defaultParser=new a.Parser(l.RULES,{debug:!1});let u=/^(!|&)/,d=/(\?|\+|\*)$/,h=/^%/;function f(B,k){if(typeof B=="string"){if(u.test(B))return"";if(h.test(B)){let j=d.exec(B),I=j?j[0]+" ":"";return function(N,z){let te=a.findRuleByName(N,z);return te&&te.bnf.length==1&&te.bnf[0].length==1&&(te.bnf[0][0]instanceof RegExp||te.bnf[0][0][0]=='"'||te.bnf[0][0][0]=="'")}(B,k)?y(B,k)+I:"("+y(B,k)+")"+I}return B}return B.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function y(B,k){let j=a.findRuleByName(B,k);return j?j.bnf.map(I=>function(G,N){return G.map(z=>f(z,N)).join(" ")}(I,k)).join(" | "):"RULE_NOT_FOUND {"+B+"}"}function S(B){let k=[];return B.grammarRules.forEach(j=>{if(!/^%/.test(j.name)){let I=j.recover?" /* { recoverUntil="+j.recover+" } */":"";k.push(j.name+" ::= "+y(j.name,B)+I)}}),k.join(`
|
|
185
|
+
`);let i;try{i=n.parse(r,!0)}catch(c){throw c&&typeof c=="object"&&Object.defineProperty(c,"$responseBodyText",{value:r}),c}let s="#text",o=Object.keys(i)[0],a=i[o];return a[s]&&(a[o]=a[s],delete a[s]),(0,x5e.getValueFromTextNode)(a)}return{}}),Yur=async(e,t)=>{let r=await T5e(e,t);return r.Error&&(r.Error.message=r.Error.message??r.Error.Message),r},Qur=(e,t)=>{var r;if(((r=t==null?void 0:t.Error)==null?void 0:r.Code)!==void 0)return t.Error.Code;if((t==null?void 0:t.Code)!==void 0)return t.Code;if(e.statusCode==404)return"NotFound"}});var O5e=ee(()=>{$4e();G4e();H4e();A5e()});var I5e={};Bs(I5e,{AWSSDKSigV4Signer:()=>f4e,AwsSdkSigV4ASigner:()=>_D,AwsSdkSigV4Signer:()=>Gh,NODE_SIGV4A_CONFIG_OPTIONS:()=>alr,_toBool:()=>$lr,_toNum:()=>Vlr,_toStr:()=>Blr,awsExpectUnion:()=>Glr,emitWarningIfUnsupportedVersion:()=>ilr,loadRestJsonErrorCode:()=>zlr,loadRestXmlErrorCode:()=>Qur,parseJsonBody:()=>z4e,parseJsonErrorBody:()=>Wlr,parseXmlBody:()=>T5e,parseXmlErrorBody:()=>Yur,resolveAWSSDKSigV4Config:()=>Ulr,resolveAwsSdkSigV4AConfig:()=>olr,resolveAwsSdkSigV4Config:()=>j4e,setCredentialFeature:()=>iz,setFeature:()=>slr,validateSigningProperties:()=>ww});var R5e=ee(()=>{sz();B4e();O5e()});var z5e=p((qVr,W5e)=>{"use strict";var AD=Object.defineProperty,Xur=Object.getOwnPropertyDescriptor,Zur=Object.getOwnPropertyNames,edr=Object.prototype.hasOwnProperty,rn=(e,t)=>AD(e,"name",{value:t,configurable:!0}),tdr=(e,t)=>{for(var r in t)AD(e,r,{get:t[r],enumerable:!0})},rdr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zur(t))!edr.call(e,i)&&i!==r&&AD(e,i,{get:()=>t[i],enumerable:!(n=Xur(t,i))||n.enumerable});return e},ndr=e=>rdr(AD({},"__esModule",{value:!0}),e),q5e={};tdr(q5e,{NumberValueImpl:()=>OD,convertToAttr:()=>Aw,convertToNative:()=>Tw,marshall:()=>G5e,unmarshall:()=>ldr});W5e.exports=ndr(q5e);var L5e=class j5e{constructor(t){typeof t=="object"&&"N"in t?this.value=String(t.N):this.value=String(t);let r=typeof t.valueOf()=="number"?t.valueOf():0;if(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER||Math.abs(r)===1/0||Number.isNaN(r))throw new Error(`NumberValue should not be initialized with an imprecise number=${r}. Use a string instead.`)}static from(t){return new j5e(t)}toAttributeValue(){return{N:this.toString()}}toBigInt(){let t=this.toString();return BigInt(t)}toString(){return String(this.value)}valueOf(){return this.toString()}};rn(L5e,"NumberValue");var OD=L5e,Aw=rn((e,t)=>{var r,n,i,s,o,a;if(e===void 0)throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(e===null&&typeof e=="object")return TD();if(Array.isArray(e))return idr(e,t);if(((r=e==null?void 0:e.constructor)==null?void 0:r.name)==="Set")return sdr(e,t);if(((n=e==null?void 0:e.constructor)==null?void 0:n.name)==="Map")return odr(e,t);if(((i=e==null?void 0:e.constructor)==null?void 0:i.name)==="Object"||!e.constructor&&typeof e=="object")return P5e(e,t);if(V5e(e))return e.length===0&&(t!=null&&t.convertEmptyValues)?TD():F5e(e);if(typeof e=="boolean"||((s=e==null?void 0:e.constructor)==null?void 0:s.name)==="Boolean")return{BOOL:e.valueOf()};if(typeof e=="number"||((o=e==null?void 0:e.constructor)==null?void 0:o.name)==="Number")return $5e(e);if(e instanceof OD)return e.toAttributeValue();if(typeof e=="bigint")return B5e(e);if(typeof e=="string"||((a=e==null?void 0:e.constructor)==null?void 0:a.name)==="String")return e.length===0&&(t!=null&&t.convertEmptyValues)?TD():U5e(e);if(t!=null&&t.convertClassInstanceToMap&&typeof e=="object")return P5e(e,t);throw new Error(`Unsupported type passed: ${e}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},"convertToAttr"),idr=rn((e,t)=>({L:e.filter(r=>typeof r!="function"&&(!(t!=null&&t.removeUndefinedValues)||(t==null?void 0:t.removeUndefinedValues)&&r!==void 0)).map(r=>Aw(r,t))}),"convertToListAttr"),sdr=rn((e,t)=>{let r=t!=null&&t.removeUndefinedValues?new Set([...e].filter(i=>i!==void 0)):e;if(!(t!=null&&t.removeUndefinedValues)&&r.has(void 0))throw new Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(r.size===0){if(t!=null&&t.convertEmptyValues)return TD();throw new Error("Pass a non-empty set, or options.convertEmptyValues=true.")}let n=r.values().next().value;if(n instanceof OD)return{NS:Array.from(r).map(i=>i.toString())};if(typeof n=="number")return{NS:Array.from(r).map($5e).map(i=>i.N)};if(typeof n=="bigint")return{NS:Array.from(r).map(B5e).map(i=>i.N)};if(typeof n=="string")return{SS:Array.from(r).map(U5e).map(i=>i.S)};if(V5e(n))return{BS:Array.from(r).map(F5e).map(i=>i.B)};throw new Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},"convertToSetAttr"),odr=rn((e,t)=>({M:(r=>{let n={};for(let[i,s]of r)typeof s!="function"&&(s!==void 0||!(t!=null&&t.removeUndefinedValues))&&(n[i]=Aw(s,t));return n})(e)}),"convertToMapAttrFromIterable"),P5e=rn((e,t)=>({M:(r=>{let n={};for(let i in r){let s=r[i];typeof s!="function"&&(s!==void 0||!(t!=null&&t.removeUndefinedValues))&&(n[i]=Aw(s,t))}return n})(e)}),"convertToMapAttrFromEnumerableProps"),TD=rn(()=>({NULL:!0}),"convertToNullAttr"),F5e=rn(e=>({B:e}),"convertToBinaryAttr"),U5e=rn(e=>({S:e.toString()}),"convertToStringAttr"),B5e=rn(e=>({N:e.toString()}),"convertToBigIntAttr"),N5e=rn(e=>{throw new Error(`${e} ${typeof BigInt=="function"?"Use BigInt.":"Pass string value instead."} `)},"validateBigIntAndThrow"),$5e=rn(e=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map(t=>t.toString()).includes(e.toString()))throw new Error(`Special numeric value ${e.toString()} is not allowed`);return e>Number.MAX_SAFE_INTEGER?N5e(`Number ${e.toString()} is greater than Number.MAX_SAFE_INTEGER.`):e<Number.MIN_SAFE_INTEGER&&N5e(`Number ${e.toString()} is lesser than Number.MIN_SAFE_INTEGER.`),{N:e.toString()}},"convertToNumberAttr"),V5e=rn(e=>{let t=["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];return e!=null&&e.constructor?t.includes(e.constructor.name):!1},"isBinary"),Tw=rn((e,t)=>{for(let[r,n]of Object.entries(e))if(n!==void 0)switch(r){case"NULL":return null;case"BOOL":return!!n;case"N":return D5e(n,t);case"B":return M5e(n);case"S":return k5e(n);case"L":return adr(n,t);case"M":return cdr(n,t);case"NS":return new Set(n.map(i=>D5e(i,t)));case"BS":return new Set(n.map(M5e));case"SS":return new Set(n.map(k5e));default:throw new Error(`Unsupported type passed: ${r}`)}throw new Error(`No value defined: ${JSON.stringify(e)}`)},"convertToNative"),D5e=rn((e,t)=>{if(t!=null&&t.wrapNumbers)return OD.from(e);let r=Number(e),n=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)&&!n.includes(r))if(typeof BigInt=="function")try{return BigInt(e)}catch{throw new Error(`${e} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}else throw new Error(`${e} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`);return r},"convertNumber"),k5e=rn(e=>e,"convertString"),M5e=rn(e=>e,"convertBinary"),adr=rn((e,t)=>e.map(r=>Tw(r,t)),"convertList"),cdr=rn((e,t)=>Object.entries(e).reduce((r,[n,i])=>(r[n]=Tw(i,t),r),{}),"convertMap");function G5e(e,t){let r=Aw(e,t),[n,i]=Object.entries(r)[0];switch(n){case"M":case"L":return t!=null&&t.convertTopLevelContainer?r:i;case"SS":case"NS":case"BS":case"S":case"N":case"B":case"NULL":case"BOOL":case"$unknown":default:return r}}rn(G5e,"marshall");var ldr=rn((e,t)=>t!=null&&t.convertWithoutMapWrapper?Tw(e,t):Tw({M:e},t),"unmarshall")});var xWe=p((YVr,wWe)=>{"use strict";var RD=Object.defineProperty,udr=Object.getOwnPropertyDescriptor,ddr=Object.getOwnPropertyNames,pdr=Object.prototype.hasOwnProperty,Br=(e,t)=>RD(e,"name",{value:t,configurable:!0}),fdr=(e,t)=>{for(var r in t)RD(e,r,{get:t[r],enumerable:!0})},hdr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ddr(t))!pdr.call(e,i)&&i!==r&&RD(e,i,{get:()=>t[i],enumerable:!(n=udr(t,i))||n.enumerable});return e},mdr=e=>hdr(RD({},"__esModule",{value:!0}),e),K5e={};fdr(K5e,{BatchExecuteStatementCommand:()=>Y5e,BatchGetCommand:()=>X5e,BatchWriteCommand:()=>eWe,DeleteCommand:()=>rWe,DynamoDBDocument:()=>bdr,DynamoDBDocumentClient:()=>PD,DynamoDBDocumentClientCommand:()=>Rs,ExecuteStatementCommand:()=>iWe,ExecuteTransactionCommand:()=>oWe,GetCommand:()=>cWe,NativeAttributeBinary:()=>Gp.NativeAttributeBinary,NativeAttributeValue:()=>Gp.NativeAttributeValue,NativeScalarAttributeValue:()=>Gp.NativeScalarAttributeValue,NumberValue:()=>Gp.NumberValueImpl,PaginationConfiguration:()=>Sdr.PaginationConfiguration,PutCommand:()=>uWe,QueryCommand:()=>Nz,ScanCommand:()=>Dz,TransactGetCommand:()=>hWe,TransactWriteCommand:()=>gWe,UpdateCommand:()=>yWe,__Client:()=>Iz.Client,marshallOptions:()=>Gp.marshallOptions,paginateQuery:()=>wdr,paginateScan:()=>Cdr,unmarshallOptions:()=>Gp.unmarshallOptions});wWe.exports=mdr(K5e);var ro=oW(),gdr=(R5e(),_e(I5e)),Iz=Ze(),Gp=z5e(),Ow=null,rt={},Tu=[],H5e="*",ID=Br((e,t,r)=>{if(e!==void 0){if(r==null)return t(e);{let n=Object.keys(r),i=n.length===1&&n[0]===H5e,s=n.length>=1&&!i,o=n.length===0;if(s)return Rz(e,t,r);if(o)return _dr(e,t,Ow);if(i)return Object.entries(e??{}).reduce((a,[c,l])=>(typeof l!="function"&&(a[c]=ID(l,t,r[H5e])),a),Array.isArray(e)?[]:{})}}},"processObj"),Rz=Br((e,t,r)=>{let n;if(Array.isArray(e))n=e.filter(i=>typeof i!="function");else{n={};for(let[i,s]of Object.entries(e))typeof s!="function"&&(n[i]=s)}for(let[i,s]of Object.entries(r)){if(typeof e[i]=="function")continue;let o=ID(e[i],t,s);o!==void 0&&typeof o!="function"&&(n[i]=o)}return n},"processKeysInObj"),_dr=Br((e,t,r)=>Array.isArray(e)?e.filter(n=>typeof n!="function").map(n=>ID(n,t,r)):Object.entries(e).reduce((n,[i,s])=>{if(typeof s=="function")return n;let o=ID(s,t,r);return o!==void 0&&typeof o!="function"&&(n[i]=o),n},{}),"processAllKeysInObj"),ydr=Br((e,t,r)=>Rz(e,Br(i=>(0,Gp.marshall)(i,r),"marshallFunc"),t),"marshallInput"),vdr=Br((e,t,r)=>Rz(e,Br(i=>(0,Gp.unmarshall)(i,r),"unmarshallFunc"),t),"unmarshallOutput"),Pz=class Oz extends Iz.Command{addMarshallingMiddleware(t){let{marshallOptions:r={},unmarshallOptions:n={}}=t.translateConfig||{};r.convertTopLevelContainer=r.convertTopLevelContainer??!0,n.convertWithoutMapWrapper=n.convertWithoutMapWrapper??!0,this.clientCommand.middlewareStack.addRelativeTo((i,s)=>async o=>{(0,gdr.setFeature)(s,"DDB_MAPPER","d"),o.input=ydr(this.input,this.inputKeyNodes,r),s.dynamoDbDocumentClientOptions=s.dynamoDbDocumentClientOptions||Oz.defaultLogFilterOverrides;let a=o.input;return s.dynamoDbDocumentClientOptions.overrideInputFilterSensitiveLog=()=>{var c;return(c=s.inputFilterSensitiveLog)==null?void 0:c.call(s,a)},i(o)},{name:"DocumentMarshall",relation:"before",toMiddleware:"serializerMiddleware",override:!0}),this.clientCommand.middlewareStack.addRelativeTo((i,s)=>async o=>{let a=await i(o),c=a.output;return s.dynamoDbDocumentClientOptions=s.dynamoDbDocumentClientOptions||Oz.defaultLogFilterOverrides,s.dynamoDbDocumentClientOptions.overrideOutputFilterSensitiveLog=()=>{var l;return(l=s.outputFilterSensitiveLog)==null?void 0:l.call(s,c)},a.output=vdr(a.output,this.outputKeyNodes,n),a},{name:"DocumentUnmarshall",relation:"before",toMiddleware:"deserializerMiddleware",override:!0})}};Br(Pz,"DynamoDBDocumentClientCommand");Pz.defaultLogFilterOverrides={overrideInputFilterSensitiveLog(...e){},overrideOutputFilterSensitiveLog(...e){}};var Rs=Pz,J5e=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Statements:{"*":{Parameters:Tu}}},this.outputKeyNodes={Responses:{"*":{Error:{Item:rt},Item:rt}}},this.clientCommand=new ro.BatchExecuteStatementCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(J5e,"BatchExecuteStatementCommand");var Y5e=J5e,Q5e=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={RequestItems:{"*":{Keys:{"*":rt}}}},this.outputKeyNodes={Responses:{"*":{"*":rt}},UnprocessedKeys:{"*":{Keys:{"*":rt}}}},this.clientCommand=new ro.BatchGetItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(Q5e,"BatchGetCommand");var X5e=Q5e,Z5e=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={RequestItems:{"*":{"*":{PutRequest:{Item:rt},DeleteRequest:{Key:rt}}}}},this.outputKeyNodes={UnprocessedItems:{"*":{"*":{PutRequest:{Item:rt},DeleteRequest:{Key:rt}}}},ItemCollectionMetrics:{"*":{"*":{ItemCollectionKey:rt}}}},this.clientCommand=new ro.BatchWriteItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(Z5e,"BatchWriteCommand");var eWe=Z5e,tWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Key:rt,Expected:{"*":{Value:Ow,AttributeValueList:Tu}},ExpressionAttributeValues:rt},this.outputKeyNodes={Attributes:rt,ItemCollectionMetrics:{ItemCollectionKey:rt}},this.clientCommand=new ro.DeleteItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(tWe,"DeleteCommand");var rWe=tWe,nWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Parameters:Tu},this.outputKeyNodes={Items:{"*":rt},LastEvaluatedKey:rt},this.clientCommand=new ro.ExecuteStatementCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(nWe,"ExecuteStatementCommand");var iWe=nWe,sWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={TransactStatements:{"*":{Parameters:Tu}}},this.outputKeyNodes={Responses:{"*":{Item:rt}}},this.clientCommand=new ro.ExecuteTransactionCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(sWe,"ExecuteTransactionCommand");var oWe=sWe,aWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Key:rt},this.outputKeyNodes={Item:rt},this.clientCommand=new ro.GetItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(aWe,"GetCommand");var cWe=aWe,lWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Item:rt,Expected:{"*":{Value:Ow,AttributeValueList:Tu}},ExpressionAttributeValues:rt},this.outputKeyNodes={Attributes:rt,ItemCollectionMetrics:{ItemCollectionKey:rt}},this.clientCommand=new ro.PutItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(lWe,"PutCommand");var uWe=lWe,dWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={KeyConditions:{"*":{AttributeValueList:Tu}},QueryFilter:{"*":{AttributeValueList:Tu}},ExclusiveStartKey:rt,ExpressionAttributeValues:rt},this.outputKeyNodes={Items:{"*":rt},LastEvaluatedKey:rt},this.clientCommand=new ro.QueryCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(dWe,"QueryCommand");var Nz=dWe,pWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={ScanFilter:{"*":{AttributeValueList:Tu}},ExclusiveStartKey:rt,ExpressionAttributeValues:rt},this.outputKeyNodes={Items:{"*":rt},LastEvaluatedKey:rt},this.clientCommand=new ro.ScanCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(pWe,"ScanCommand");var Dz=pWe,fWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={TransactItems:{"*":{Get:{Key:rt}}}},this.outputKeyNodes={Responses:{"*":{Item:rt}}},this.clientCommand=new ro.TransactGetItemsCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(fWe,"TransactGetCommand");var hWe=fWe,mWe=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={TransactItems:{"*":{ConditionCheck:{Key:rt,ExpressionAttributeValues:rt},Put:{Item:rt,ExpressionAttributeValues:rt},Delete:{Key:rt,ExpressionAttributeValues:rt},Update:{Key:rt,ExpressionAttributeValues:rt}}}},this.outputKeyNodes={ItemCollectionMetrics:{"*":{"*":{ItemCollectionKey:rt}}}},this.clientCommand=new ro.TransactWriteItemsCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(mWe,"TransactWriteCommand");var gWe=mWe,_We=class extends Rs{constructor(t){super(),this.input=t,this.inputKeyNodes={Key:rt,AttributeUpdates:{"*":{Value:Ow}},Expected:{"*":{Value:Ow,AttributeValueList:Tu}},ExpressionAttributeValues:rt},this.outputKeyNodes={Attributes:rt,ItemCollectionMetrics:{ItemCollectionKey:rt}},this.clientCommand=new ro.UpdateItemCommand(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(t,r,n){this.addMarshallingMiddleware(r);let i=t.concat(this.middlewareStack),s=this.clientCommand.resolveMiddleware(i,r,n);return async()=>s(this.clientCommand)}};Br(_We,"UpdateCommand");var yWe=_We,vWe=class bWe extends Iz.Client{constructor(t,r){var n;if(super(t.config),this.config=t.config,this.config.translateConfig=r,this.middlewareStack=t.middlewareStack,(n=this.config)!=null&&n.cacheMiddleware)throw new Error("@aws-sdk/lib-dynamodb - cacheMiddleware=true is not compatible with the DynamoDBDocumentClient. This option must be set to false.")}static from(t,r){return new bWe(t,r)}destroy(){}};Br(vWe,"DynamoDBDocumentClient");var PD=vWe,SWe=class EWe extends PD{static from(t,r){return new EWe(t,r)}batchExecuteStatement(t,r,n){let i=new Y5e(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}batchGet(t,r,n){let i=new X5e(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}batchWrite(t,r,n){let i=new eWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}delete(t,r,n){let i=new rWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}executeStatement(t,r,n){let i=new iWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}executeTransaction(t,r,n){let i=new oWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}get(t,r,n){let i=new cWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}put(t,r,n){let i=new uWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}query(t,r,n){let i=new Nz(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}scan(t,r,n){let i=new Dz(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}transactGet(t,r,n){let i=new hWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}transactWrite(t,r,n){let i=new gWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}update(t,r,n){let i=new yWe(t);if(typeof r=="function")this.send(i,r);else if(typeof n=="function"){if(typeof r!="object")throw new Error(`Expect http options but get ${typeof r}`);this.send(i,r||{},n)}else return this.send(i,r)}};Br(SWe,"DynamoDBDocument");var bdr=SWe,Sdr=xa(),Edr=(Ft(),_e(ir)),wdr=(0,Edr.createPaginator)(PD,Nz,"ExclusiveStartKey","LastEvaluatedKey","Limit"),xdr=(Ft(),_e(ir)),Cdr=(0,xdr.createPaginator)(PD,Dz,"ExclusiveStartKey","LastEvaluatedKey","Limit")});var Mz=p(ND=>{"use strict";Object.defineProperty(ND,"__esModule",{value:!0});ND.Component=void 0;var CWe=Yt(),kz=class{constructor(t){(0,CWe.assertIsDefined)(t),(0,CWe.assertIsString)(t.name),this.name=t.name}};ND.Component=kz});var Hy=p(DD=>{"use strict";Object.defineProperty(DD,"__esModule",{value:!0});DD.EntityDefinitions=void 0;DD.EntityDefinitions={component:{keys:{pk:{format:"c#{name}",attributeName:"pk"},sk:{format:"#meta",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_c#{bucketNumber}"},sk:{format:"{name}",attributeName:"gsi1_sk"}}},fieldsAsJsonString:[]},componentVersion:{keys:{pk:{format:"cv#{componentName}",attributeName:"pk"},sk:{format:"{version}",attributeName:"sk"}},indexes:{},fieldsAsJsonString:["icon"]},componentSet:{keys:{pk:{format:"cs#{webPath}",attributeName:"pk"},sk:{format:"#meta",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_cs#{bucketNumber}"},sk:{format:"#meta",attributeName:"gsi1_sk"}}},fieldsAsJsonString:["environmentVariables","headers"]},componentSetRule:{keys:{pk:{format:"csr#{componentName}",attributeName:"pk"},sk:{format:"{componentSet}",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_csr#{componentSet}"},sk:{attributeName:"gsi1_sk",format:"{componentName}"}}},fieldsAsJsonString:[]},componentSetComponentVersion:{keys:{pk:{format:"cscv#{componentName}",attributeName:"pk"},sk:{format:"{componentVersion}#{componentSetWebPath}",attributeName:"sk"}},indexes:{"gsi1_pk-gsi1_sk-index":{pk:{attributeName:"gsi1_pk",format:"gsi1_cscv#{componentSetWebPath}"},sk:{attributeName:"gsi1_sk",format:"{componentName}"}}},fieldsAsJsonString:["environmentVariables"]}}});var Lz=p(kD=>{"use strict";Object.defineProperty(kD,"__esModule",{value:!0});kD.ComponentRepository=void 0;var Tdr=Mz(),Adr=xu(),Odr=Hy(),TWe=40;function Idr(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].charCodeAt(0);return t%TWe}var qz=class extends Adr.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component",Odr.EntityDefinitions.component,Tdr.Component)}async createItem(t,r={}){return await super.createItem(t,r,{bucketNumber:Idr(t.name)})}async getAllComponents(t){let r=[],n={index:"gsi1_pk-gsi1_sk-index"};for(let i=0;i<TWe;i++){let s=await this.queryItems({bucketNumber:i},n);r=r.concat(s)}if(t!=null&&t.length){let i=t.toLowerCase();r=r.filter(s=>s.name.toLowerCase().includes(i))}return r}};kD.ComponentRepository=qz});var MD=p(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});Iw.ComponentVersion=void 0;Iw.assertIsValidVersion=AWe;var Au=Yt(),Rdr=/^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/;function AWe(e){if(Rdr.test(e)==!1)throw new Error("ComponentVersion.version must be in the form of semver 0.0.0")}var jz=class{constructor(t){this.componentName="",this.version="",this.displayName="",this.description="",this.type=void 0,this.icon=void 0,(0,Au.assertIsDefined)(t),this.componentName=(0,Au.assertAssign)(t.componentName,Au.assertIsString,"componentName must be a string"),this.version=(0,Au.assertAssign)(t.version,Au.assertIsString,"version must be a string"),this.displayName=(0,Au.assertAssign)(t.displayName||"",Au.assertIsString,"displayName must be a string"),this.description=(0,Au.assertAssign)(t.description||"",Au.assertIsString,"description must be a string"),t.icon&&Ndr(t.icon)&&(this.icon=t.icon),t.type&&Pdr(t.type)&&(this.type=t.type),AWe(this.version)}};Iw.ComponentVersion=jz;function Pdr(e){return!!(e&&typeof e=="string"&&["edge","server"].includes(e))}function Ndr(e){return!!(e&&typeof e=="object"&&"id"in e&&"color"in e&&Ddr(e.color))}function Ddr(e){return!!e&&typeof e=="object"&&"type"in e&&"value"in e}});var Uz=p(qD=>{"use strict";Object.defineProperty(qD,"__esModule",{value:!0});qD.ComponentVersionRepository=void 0;var kdr=xu(),Mdr=Hy(),qdr=MD(),Fz=class extends kdr.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_version",Mdr.EntityDefinitions.componentVersion,qdr.ComponentVersion)}async getComponentVersions(t){return await this.queryItems({componentName:t})}async getLatestComponentVersion(t){let r=await this.queryItems({componentName:t},{order:"desc",limit:1});return r.length?r[0]:void 0}async deleteByComponentName(t,r){let n=await this.getComponentVersions(t),i=[];for(let s of n)i.push(this.deleteItem(s,r));await Promise.allSettled(i)}};qD.ComponentVersionRepository=Fz});var jD=p(LD=>{"use strict";Object.defineProperty(LD,"__esModule",{value:!0});LD.ComponentSet=void 0;var za=Yt(),OWe=require("assert"),IWe=/^[a-z0-9\-_.]+$/i,Bz=class{constructor(t){if((0,za.assertIsDefined)(t),this.webPath=(0,za.assertAssign)(t.webPath,za.assertIsString,"webPath must be a string"),this.displayName=(0,za.assertAssignWithDefaultUndefinedValue)(t.displayName,za.assertIsString,"","displayName must be a string"),this.description=(0,za.assertAssignWithDefaultUndefinedValue)(t.description,za.assertIsString,"","description must be a string"),this.environmentVariables=(0,za.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,za.assertIsMapOfStringString,{}),this.headers=(0,za.assertAssignWithDefaultUndefinedValue)(t.headers,za.assertIsMapOfStringString,{}),this.webPath.length===0)throw new OWe.AssertionError({message:"webPath.length must have length greater than 0"});if(IWe.test(this.webPath)===!1)throw new OWe.AssertionError({message:`Invalid Component Set web path, it must meet ${IWe.toString()}`})}};LD.ComponentSet=Bz});var Vz=p(FD=>{"use strict";Object.defineProperty(FD,"__esModule",{value:!0});FD.ComponentSetRepository=void 0;var Ldr=xu(),jdr=Hy(),Fdr=jD(),RWe=20;function Udr(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].charCodeAt(0);return t%RWe}var $z=class extends Ldr.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set",jdr.EntityDefinitions.componentSet,Fdr.ComponentSet)}async getComponentSetByWebPath(t){return this.getItem({webPath:t.toLowerCase()})}async createItem(t,r={}){return await super.createItem(t,r,{bucketNumber:Udr(t.webPath)})}async getAllComponentSets(){let t=[];for(let r=0;r<RWe;r++){let n=await this.queryItems({bucketNumber:r},{index:"gsi1_pk-gsi1_sk-index"});t=t.concat(n)}return t}};FD.ComponentSetRepository=$z});var Rw=p((iGr,PWe)=>{var Bdr="2.0.0",$dr=Number.MAX_SAFE_INTEGER||9007199254740991,Vdr=16,Gdr=["major","premajor","minor","preminor","patch","prepatch","prerelease"];PWe.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Vdr,MAX_SAFE_INTEGER:$dr,RELEASE_TYPES:Gdr,SEMVER_SPEC_VERSION:Bdr,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Pw=p((sGr,NWe)=>{var Wdr=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};NWe.exports=Wdr});var Ky=p((Ou,DWe)=>{var{MAX_SAFE_COMPONENT_LENGTH:Gz}=Rw(),zdr=Pw();Ou=DWe.exports={};var Hdr=Ou.re=[],Kdr=Ou.safeRe=[],Ie=Ou.src=[],Re=Ou.t={},Jdr=0,dt=(e,t,r)=>{let n=t.split("\\s*").join("\\s{0,1}").split("\\s+").join("\\s"),i=Jdr++;zdr(e,i,t),Re[e]=i,Ie[i]=t,Hdr[i]=new RegExp(t,r?"g":void 0),Kdr[i]=new RegExp(n,r?"g":void 0)};dt("NUMERICIDENTIFIER","0|[1-9]\\d*");dt("NUMERICIDENTIFIERLOOSE","[0-9]+");dt("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");dt("MAINVERSION",`(${Ie[Re.NUMERICIDENTIFIER]})\\.(${Ie[Re.NUMERICIDENTIFIER]})\\.(${Ie[Re.NUMERICIDENTIFIER]})`);dt("MAINVERSIONLOOSE",`(${Ie[Re.NUMERICIDENTIFIERLOOSE]})\\.(${Ie[Re.NUMERICIDENTIFIERLOOSE]})\\.(${Ie[Re.NUMERICIDENTIFIERLOOSE]})`);dt("PRERELEASEIDENTIFIER",`(?:${Ie[Re.NUMERICIDENTIFIER]}|${Ie[Re.NONNUMERICIDENTIFIER]})`);dt("PRERELEASEIDENTIFIERLOOSE",`(?:${Ie[Re.NUMERICIDENTIFIERLOOSE]}|${Ie[Re.NONNUMERICIDENTIFIER]})`);dt("PRERELEASE",`(?:-(${Ie[Re.PRERELEASEIDENTIFIER]}(?:\\.${Ie[Re.PRERELEASEIDENTIFIER]})*))`);dt("PRERELEASELOOSE",`(?:-?(${Ie[Re.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Ie[Re.PRERELEASEIDENTIFIERLOOSE]})*))`);dt("BUILDIDENTIFIER","[0-9A-Za-z-]+");dt("BUILD",`(?:\\+(${Ie[Re.BUILDIDENTIFIER]}(?:\\.${Ie[Re.BUILDIDENTIFIER]})*))`);dt("FULLPLAIN",`v?${Ie[Re.MAINVERSION]}${Ie[Re.PRERELEASE]}?${Ie[Re.BUILD]}?`);dt("FULL",`^${Ie[Re.FULLPLAIN]}$`);dt("LOOSEPLAIN",`[v=\\s]*${Ie[Re.MAINVERSIONLOOSE]}${Ie[Re.PRERELEASELOOSE]}?${Ie[Re.BUILD]}?`);dt("LOOSE",`^${Ie[Re.LOOSEPLAIN]}$`);dt("GTLT","((?:<|>)?=?)");dt("XRANGEIDENTIFIERLOOSE",`${Ie[Re.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);dt("XRANGEIDENTIFIER",`${Ie[Re.NUMERICIDENTIFIER]}|x|X|\\*`);dt("XRANGEPLAIN",`[v=\\s]*(${Ie[Re.XRANGEIDENTIFIER]})(?:\\.(${Ie[Re.XRANGEIDENTIFIER]})(?:\\.(${Ie[Re.XRANGEIDENTIFIER]})(?:${Ie[Re.PRERELEASE]})?${Ie[Re.BUILD]}?)?)?`);dt("XRANGEPLAINLOOSE",`[v=\\s]*(${Ie[Re.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ie[Re.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Ie[Re.XRANGEIDENTIFIERLOOSE]})(?:${Ie[Re.PRERELEASELOOSE]})?${Ie[Re.BUILD]}?)?)?`);dt("XRANGE",`^${Ie[Re.GTLT]}\\s*${Ie[Re.XRANGEPLAIN]}$`);dt("XRANGELOOSE",`^${Ie[Re.GTLT]}\\s*${Ie[Re.XRANGEPLAINLOOSE]}$`);dt("COERCE",`(^|[^\\d])(\\d{1,${Gz}})(?:\\.(\\d{1,${Gz}}))?(?:\\.(\\d{1,${Gz}}))?(?:$|[^\\d])`);dt("COERCERTL",Ie[Re.COERCE],!0);dt("LONETILDE","(?:~>?)");dt("TILDETRIM",`(\\s*)${Ie[Re.LONETILDE]}\\s+`,!0);Ou.tildeTrimReplace="$1~";dt("TILDE",`^${Ie[Re.LONETILDE]}${Ie[Re.XRANGEPLAIN]}$`);dt("TILDELOOSE",`^${Ie[Re.LONETILDE]}${Ie[Re.XRANGEPLAINLOOSE]}$`);dt("LONECARET","(?:\\^)");dt("CARETTRIM",`(\\s*)${Ie[Re.LONECARET]}\\s+`,!0);Ou.caretTrimReplace="$1^";dt("CARET",`^${Ie[Re.LONECARET]}${Ie[Re.XRANGEPLAIN]}$`);dt("CARETLOOSE",`^${Ie[Re.LONECARET]}${Ie[Re.XRANGEPLAINLOOSE]}$`);dt("COMPARATORLOOSE",`^${Ie[Re.GTLT]}\\s*(${Ie[Re.LOOSEPLAIN]})$|^$`);dt("COMPARATOR",`^${Ie[Re.GTLT]}\\s*(${Ie[Re.FULLPLAIN]})$|^$`);dt("COMPARATORTRIM",`(\\s*)${Ie[Re.GTLT]}\\s*(${Ie[Re.LOOSEPLAIN]}|${Ie[Re.XRANGEPLAIN]})`,!0);Ou.comparatorTrimReplace="$1$2$3";dt("HYPHENRANGE",`^\\s*(${Ie[Re.XRANGEPLAIN]})\\s+-\\s+(${Ie[Re.XRANGEPLAIN]})\\s*$`);dt("HYPHENRANGELOOSE",`^\\s*(${Ie[Re.XRANGEPLAINLOOSE]})\\s+-\\s+(${Ie[Re.XRANGEPLAINLOOSE]})\\s*$`);dt("STAR","(<|>)?=?\\s*\\*");dt("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");dt("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var UD=p((oGr,kWe)=>{var Ydr=Object.freeze({loose:!0}),Qdr=Object.freeze({}),Xdr=e=>e?typeof e!="object"?Ydr:e:Qdr;kWe.exports=Xdr});var Wz=p((aGr,LWe)=>{var MWe=/^[0-9]+$/,qWe=(e,t)=>{let r=MWe.test(e),n=MWe.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},Zdr=(e,t)=>qWe(t,e);LWe.exports={compareIdentifiers:qWe,rcompareIdentifiers:Zdr}});var ki=p((cGr,BWe)=>{var BD=Pw(),{MAX_LENGTH:jWe,MAX_SAFE_INTEGER:$D}=Rw(),{safeRe:FWe,t:UWe}=Ky(),epr=UD(),{compareIdentifiers:Jy}=Wz(),no=class{constructor(t,r){if(r=epr(r),t instanceof no){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>jWe)throw new TypeError(`version is longer than ${jWe} characters`);BD("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?FWe[UWe.LOOSE]:FWe[UWe.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>$D||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$D||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$D||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<$D)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(BD("SemVer.compare",this.version,this.options,t),!(t instanceof no)){if(typeof t=="string"&&t===this.version)return 0;t=new no(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof no||(t=new no(t,this.options)),Jy(this.major,t.major)||Jy(this.minor,t.minor)||Jy(this.patch,t.patch)}comparePre(t){if(t instanceof no||(t=new no(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(BD("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Jy(n,i)}while(++r)}compareBuild(t){t instanceof no||(t=new no(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(BD("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Jy(n,i)}while(++r)}inc(t,r,n){switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Jy(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};BWe.exports=no});var zh=p((lGr,VWe)=>{var $We=ki(),tpr=(e,t,r=!1)=>{if(e instanceof $We)return e;try{return new $We(e,t)}catch(n){if(!r)return null;throw n}};VWe.exports=tpr});var WWe=p((uGr,GWe)=>{var rpr=zh(),npr=(e,t)=>{let r=rpr(e,t);return r?r.version:null};GWe.exports=npr});var HWe=p((dGr,zWe)=>{var ipr=zh(),spr=(e,t)=>{let r=ipr(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};zWe.exports=spr});var YWe=p((pGr,JWe)=>{var KWe=ki(),opr=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new KWe(e instanceof KWe?e.version:e,r).inc(t,n,i).version}catch{return null}};JWe.exports=opr});var ZWe=p((fGr,XWe)=>{var QWe=zh(),apr=(e,t)=>{let r=QWe(e,null,!0),n=QWe(t,null,!0),i=r.compare(n);if(i===0)return null;let s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";let u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};XWe.exports=apr});var t6e=p((hGr,e6e)=>{var cpr=ki(),lpr=(e,t)=>new cpr(e,t).major;e6e.exports=lpr});var n6e=p((mGr,r6e)=>{var upr=ki(),dpr=(e,t)=>new upr(e,t).minor;r6e.exports=dpr});var s6e=p((gGr,i6e)=>{var ppr=ki(),fpr=(e,t)=>new ppr(e,t).patch;i6e.exports=fpr});var a6e=p((_Gr,o6e)=>{var hpr=zh(),mpr=(e,t)=>{let r=hpr(e,t);return r&&r.prerelease.length?r.prerelease:null};o6e.exports=mpr});var Jo=p((yGr,l6e)=>{var c6e=ki(),gpr=(e,t,r)=>new c6e(e,r).compare(new c6e(t,r));l6e.exports=gpr});var d6e=p((vGr,u6e)=>{var _pr=Jo(),ypr=(e,t,r)=>_pr(t,e,r);u6e.exports=ypr});var f6e=p((bGr,p6e)=>{var vpr=Jo(),bpr=(e,t)=>vpr(e,t,!0);p6e.exports=bpr});var VD=p((SGr,m6e)=>{var h6e=ki(),Spr=(e,t,r)=>{let n=new h6e(e,r),i=new h6e(t,r);return n.compare(i)||n.compareBuild(i)};m6e.exports=Spr});var _6e=p((EGr,g6e)=>{var Epr=VD(),wpr=(e,t)=>e.sort((r,n)=>Epr(r,n,t));g6e.exports=wpr});var v6e=p((wGr,y6e)=>{var xpr=VD(),Cpr=(e,t)=>e.sort((r,n)=>xpr(n,r,t));y6e.exports=Cpr});var Nw=p((xGr,b6e)=>{var Tpr=Jo(),Apr=(e,t,r)=>Tpr(e,t,r)>0;b6e.exports=Apr});var GD=p((CGr,S6e)=>{var Opr=Jo(),Ipr=(e,t,r)=>Opr(e,t,r)<0;S6e.exports=Ipr});var zz=p((TGr,E6e)=>{var Rpr=Jo(),Ppr=(e,t,r)=>Rpr(e,t,r)===0;E6e.exports=Ppr});var Hz=p((AGr,w6e)=>{var Npr=Jo(),Dpr=(e,t,r)=>Npr(e,t,r)!==0;w6e.exports=Dpr});var WD=p((OGr,x6e)=>{var kpr=Jo(),Mpr=(e,t,r)=>kpr(e,t,r)>=0;x6e.exports=Mpr});var zD=p((IGr,C6e)=>{var qpr=Jo(),Lpr=(e,t,r)=>qpr(e,t,r)<=0;C6e.exports=Lpr});var Kz=p((RGr,T6e)=>{var jpr=zz(),Fpr=Hz(),Upr=Nw(),Bpr=WD(),$pr=GD(),Vpr=zD(),Gpr=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return jpr(e,r,n);case"!=":return Fpr(e,r,n);case">":return Upr(e,r,n);case">=":return Bpr(e,r,n);case"<":return $pr(e,r,n);case"<=":return Vpr(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};T6e.exports=Gpr});var O6e=p((PGr,A6e)=>{var Wpr=ki(),zpr=zh(),{safeRe:HD,t:KD}=Ky(),Hpr=(e,t)=>{if(e instanceof Wpr)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(HD[KD.COERCE]);else{let n;for(;(n=HD[KD.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),HD[KD.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;HD[KD.COERCERTL].lastIndex=-1}return r===null?null:zpr(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};A6e.exports=Hpr});var R6e=p((NGr,I6e)=>{"use strict";I6e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}});var N6e=p((DGr,P6e)=>{"use strict";P6e.exports=Gt;Gt.Node=Hh;Gt.create=Gt;function Gt(e){var t=this;if(t instanceof Gt||(t=new Gt),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}Gt.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t};Gt.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}};Gt.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}};Gt.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Jpr(this,arguments[e]);return this.length};Gt.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)Ypr(this,arguments[e]);return this.length};Gt.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}};Gt.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}};Gt.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;r!==null;n++)e.call(t,r.value,n,this),r=r.next};Gt.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;r!==null;n--)e.call(t,r.value,n,this),r=r.prev};Gt.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++)r=r.next;if(t===e&&r!==null)return r.value};Gt.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++)r=r.prev;if(t===e&&r!==null)return r.value};Gt.prototype.map=function(e,t){t=t||this;for(var r=new Gt,n=this.head;n!==null;)r.push(e.call(t,n.value,this)),n=n.next;return r};Gt.prototype.mapReverse=function(e,t){t=t||this;for(var r=new Gt,n=this.tail;n!==null;)r.push(e.call(t,n.value,this)),n=n.prev;return r};Gt.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=e(r,n.value,i),n=n.next;return r};Gt.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=e(r,n.value,i),n=n.prev;return r};Gt.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};Gt.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};Gt.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new Gt;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(;i!==null&&n<t;n++,i=i.next)r.push(i.value);return r};Gt.prototype.sliceReverse=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new Gt;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};Gt.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;i!==null&&n<e;n++)i=i.next;for(var s=[],n=0;i&&n<t;n++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=Kpr(this,i,r[n]);return s};Gt.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};function Kpr(e,t,r){var n=t===e.head?new Hh(r,null,t,e):new Hh(r,t,t.next,e);return n.next===null&&(e.tail=n),n.prev===null&&(e.head=n),e.length++,n}function Jpr(e,t){e.tail=new Hh(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function Ypr(e,t){e.head=new Hh(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Hh(e,t,r,n){if(!(this instanceof Hh))return new Hh(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{R6e()(Gt)}catch{}});var L6e=p((kGr,q6e)=>{"use strict";var Qpr=N6e(),Kh=Symbol("max"),Ru=Symbol("length"),Yy=Symbol("lengthCalculator"),kw=Symbol("allowStale"),Jh=Symbol("maxAge"),Iu=Symbol("dispose"),D6e=Symbol("noDisposeOnSet"),Wn=Symbol("lruList"),Ha=Symbol("cache"),M6e=Symbol("updateAgeOnGet"),Jz=()=>1,Qz=class{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");let r=this[Kh]=t.max||1/0,n=t.length||Jz;if(this[Yy]=typeof n!="function"?Jz:n,this[kw]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[Jh]=t.maxAge||0,this[Iu]=t.dispose,this[D6e]=t.noDisposeOnSet||!1,this[M6e]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[Kh]=t||1/0,Dw(this)}get max(){return this[Kh]}set allowStale(t){this[kw]=!!t}get allowStale(){return this[kw]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[Jh]=t,Dw(this)}get maxAge(){return this[Jh]}set lengthCalculator(t){typeof t!="function"&&(t=Jz),t!==this[Yy]&&(this[Yy]=t,this[Ru]=0,this[Wn].forEach(r=>{r.length=this[Yy](r.value,r.key),this[Ru]+=r.length})),Dw(this)}get lengthCalculator(){return this[Yy]}get length(){return this[Ru]}get itemCount(){return this[Wn].length}rforEach(t,r){r=r||this;for(let n=this[Wn].tail;n!==null;){let i=n.prev;k6e(this,t,n,r),n=i}}forEach(t,r){r=r||this;for(let n=this[Wn].head;n!==null;){let i=n.next;k6e(this,t,n,r),n=i}}keys(){return this[Wn].toArray().map(t=>t.key)}values(){return this[Wn].toArray().map(t=>t.value)}reset(){this[Iu]&&this[Wn]&&this[Wn].length&&this[Wn].forEach(t=>this[Iu](t.key,t.value)),this[Ha]=new Map,this[Wn]=new Qpr,this[Ru]=0}dump(){return this[Wn].map(t=>JD(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[Wn]}set(t,r,n){if(n=n||this[Jh],n&&typeof n!="number")throw new TypeError("maxAge must be a number");let i=n?Date.now():0,s=this[Yy](r,t);if(this[Ha].has(t)){if(s>this[Kh])return Qy(this,this[Ha].get(t)),!1;let c=this[Ha].get(t).value;return this[Iu]&&(this[D6e]||this[Iu](t,c.value)),c.now=i,c.maxAge=n,c.value=r,this[Ru]+=s-c.length,c.length=s,this.get(t),Dw(this),!0}let o=new Xz(t,r,s,i,n);return o.length>this[Kh]?(this[Iu]&&this[Iu](t,r),!1):(this[Ru]+=o.length,this[Wn].unshift(o),this[Ha].set(t,this[Wn].head),Dw(this),!0)}has(t){if(!this[Ha].has(t))return!1;let r=this[Ha].get(t).value;return!JD(this,r)}get(t){return Yz(this,t,!0)}peek(t){return Yz(this,t,!1)}pop(){let t=this[Wn].tail;return t?(Qy(this,t),t.value):null}del(t){Qy(this,this[Ha].get(t))}load(t){this.reset();let r=Date.now();for(let n=t.length-1;n>=0;n--){let i=t[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{let o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Ha].forEach((t,r)=>Yz(this,r,!1))}},Yz=(e,t,r)=>{let n=e[Ha].get(t);if(n){let i=n.value;if(JD(e,i)){if(Qy(e,n),!e[kw])return}else r&&(e[M6e]&&(n.value.now=Date.now()),e[Wn].unshiftNode(n));return i.value}},JD=(e,t)=>{if(!t||!t.maxAge&&!e[Jh])return!1;let r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[Jh]&&r>e[Jh]},Dw=e=>{if(e[Ru]>e[Kh])for(let t=e[Wn].tail;e[Ru]>e[Kh]&&t!==null;){let r=t.prev;Qy(e,t),t=r}},Qy=(e,t)=>{if(t){let r=t.value;e[Iu]&&e[Iu](r.key,r.value),e[Ru]-=r.length,e[Ha].delete(r.key),e[Wn].removeNode(t)}},Xz=class{constructor(t,r,n,i,s){this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}},k6e=(e,t,r,n)=>{let i=r.value;JD(e,i)&&(Qy(e,r),e[kw]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};q6e.exports=Qz});var Yo=p((MGr,B6e)=>{var Yh=class{constructor(t,r){if(r=Zpr(r),t instanceof Yh)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new Yh(t.raw,r);if(t instanceof Zz)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(n=>this.parseRange(n)).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!F6e(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&ofr(i[0])){this.set=[i];break}}}this.format()}format(){return this.range=this.set.map(t=>t.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(t){let n=((this.options.includePrerelease&&ifr)|(this.options.loose&&sfr))+":"+t,i=j6e.get(n);if(i)return i;let s=this.options.loose,o=s?Ps[os.HYPHENRANGELOOSE]:Ps[os.HYPHENRANGE];t=t.replace(o,gfr(this.options.includePrerelease)),$r("hyphen replace",t),t=t.replace(Ps[os.COMPARATORTRIM],tfr),$r("comparator trim",t),t=t.replace(Ps[os.TILDETRIM],rfr),t=t.replace(Ps[os.CARETTRIM],nfr);let a=t.split(" ").map(d=>afr(d,this.options)).join(" ").split(/\s+/).map(d=>mfr(d,this.options));s&&(a=a.filter(d=>($r("loose invalid filter",d,this.options),!!d.match(Ps[os.COMPARATORLOOSE])))),$r("range list",a);let c=new Map,l=a.map(d=>new Zz(d,this.options));for(let d of l){if(F6e(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let u=[...c.values()];return j6e.set(n,u),u}intersects(t,r){if(!(t instanceof Yh))throw new TypeError("a Range is required");return this.set.some(n=>U6e(n,r)&&t.set.some(i=>U6e(i,r)&&n.every(s=>i.every(o=>s.intersects(o,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new efr(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(_fr(this.set[r],t,this.options))return!0;return!1}};B6e.exports=Yh;var Xpr=L6e(),j6e=new Xpr({max:1e3}),Zpr=UD(),Zz=Mw(),$r=Pw(),efr=ki(),{safeRe:Ps,t:os,comparatorTrimReplace:tfr,tildeTrimReplace:rfr,caretTrimReplace:nfr}=Ky(),{FLAG_INCLUDE_PRERELEASE:ifr,FLAG_LOOSE:sfr}=Rw(),F6e=e=>e.value==="<0.0.0-0",ofr=e=>e.value==="",U6e=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(s=>i.intersects(s,t)),i=n.pop();return r},afr=(e,t)=>($r("comp",e,t),e=ufr(e,t),$r("caret",e),e=cfr(e,t),$r("tildes",e),e=pfr(e,t),$r("xrange",e),e=hfr(e,t),$r("stars",e),e),as=e=>!e||e.toLowerCase()==="x"||e==="*",cfr=(e,t)=>e.trim().split(/\s+/).map(r=>lfr(r,t)).join(" "),lfr=(e,t)=>{let r=t.loose?Ps[os.TILDELOOSE]:Ps[os.TILDE];return e.replace(r,(n,i,s,o,a)=>{$r("tilde",e,n,i,s,o,a);let c;return as(i)?c="":as(s)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:as(o)?c=`>=${i}.${s}.0 <${i}.${+s+1}.0-0`:a?($r("replaceTilde pr",a),c=`>=${i}.${s}.${o}-${a} <${i}.${+s+1}.0-0`):c=`>=${i}.${s}.${o} <${i}.${+s+1}.0-0`,$r("tilde return",c),c})},ufr=(e,t)=>e.trim().split(/\s+/).map(r=>dfr(r,t)).join(" "),dfr=(e,t)=>{$r("caret",e,t);let r=t.loose?Ps[os.CARETLOOSE]:Ps[os.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,s,o,a,c)=>{$r("caret",e,i,s,o,a,c);let l;return as(s)?l="":as(o)?l=`>=${s}.0.0${n} <${+s+1}.0.0-0`:as(a)?s==="0"?l=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:c?($r("replaceCaret pr",c),s==="0"?o==="0"?l=`>=${s}.${o}.${a}-${c} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}-${c} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a}-${c} <${+s+1}.0.0-0`):($r("no pr"),s==="0"?o==="0"?l=`>=${s}.${o}.${a}${n} <${s}.${o}.${+a+1}-0`:l=`>=${s}.${o}.${a}${n} <${s}.${+o+1}.0-0`:l=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),$r("caret return",l),l})},pfr=(e,t)=>($r("replaceXRanges",e,t),e.split(/\s+/).map(r=>ffr(r,t)).join(" ")),ffr=(e,t)=>{e=e.trim();let r=t.loose?Ps[os.XRANGELOOSE]:Ps[os.XRANGE];return e.replace(r,(n,i,s,o,a,c)=>{$r("xRange",e,n,i,s,o,a,c);let l=as(s),u=l||as(o),d=u||as(a),h=d;return i==="="&&h&&(i=""),c=t.includePrerelease?"-0":"",l?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&h?(u&&(o=0),a=0,i===">"?(i=">=",u?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",u?s=+s+1:o=+o+1),i==="<"&&(c="-0"),n=`${i+s}.${o}.${a}${c}`):u?n=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(n=`>=${s}.${o}.0${c} <${s}.${+o+1}.0-0`),$r("xRange return",n),n})},hfr=(e,t)=>($r("replaceStars",e,t),e.trim().replace(Ps[os.STAR],"")),mfr=(e,t)=>($r("replaceGTE0",e,t),e.trim().replace(Ps[t.includePrerelease?os.GTE0PRE:os.GTE0],"")),gfr=e=>(t,r,n,i,s,o,a,c,l,u,d,h,f)=>(as(n)?r="":as(i)?r=`>=${n}.0.0${e?"-0":""}`:as(s)?r=`>=${n}.${i}.0${e?"-0":""}`:o?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,as(l)?c="":as(u)?c=`<${+l+1}.0.0-0`:as(d)?c=`<${l}.${+u+1}.0-0`:h?c=`<=${l}.${u}.${d}-${h}`:e?c=`<${l}.${u}.${+d+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),_fr=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if($r(e[n].semver),e[n].semver!==Zz.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var Mw=p((qGr,H6e)=>{var qw=Symbol("SemVer ANY"),Xy=class{static get ANY(){return qw}constructor(t,r){if(r=$6e(r),t instanceof Xy){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),tH("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===qw?this.value="":this.value=this.operator+this.semver.version,tH("comp",this)}parse(t){let r=this.options.loose?V6e[G6e.COMPARATORLOOSE]:V6e[G6e.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new W6e(n[2],this.options.loose):this.semver=qw}toString(){return this.value}test(t){if(tH("Comparator.test",t,this.options.loose),this.semver===qw||t===qw)return!0;if(typeof t=="string")try{t=new W6e(t,this.options)}catch{return!1}return eH(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof Xy))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new z6e(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new z6e(this.value,r).test(t.semver):(r=$6e(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||eH(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||eH(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};H6e.exports=Xy;var $6e=UD(),{safeRe:V6e,t:G6e}=Ky(),eH=Kz(),tH=Pw(),W6e=ki(),z6e=Yo()});var Lw=p((LGr,K6e)=>{var yfr=Yo(),vfr=(e,t,r)=>{try{t=new yfr(t,r)}catch{return!1}return t.test(e)};K6e.exports=vfr});var Y6e=p((jGr,J6e)=>{var bfr=Yo(),Sfr=(e,t)=>new bfr(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));J6e.exports=Sfr});var X6e=p((FGr,Q6e)=>{var Efr=ki(),wfr=Yo(),xfr=(e,t,r)=>{let n=null,i=null,s=null;try{s=new wfr(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Efr(n,r))}),n};Q6e.exports=xfr});var eze=p((UGr,Z6e)=>{var Cfr=ki(),Tfr=Yo(),Afr=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Tfr(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Cfr(n,r))}),n};Z6e.exports=Afr});var nze=p((BGr,rze)=>{var rH=ki(),Ofr=Yo(),tze=Nw(),Ifr=(e,t)=>{e=new Ofr(e,t);let r=new rH("0.0.0");if(e.test(r)||(r=new rH("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],s=null;i.forEach(o=>{let a=new rH(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||tze(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||tze(r,s))&&(r=s)}return r&&e.test(r)?r:null};rze.exports=Ifr});var sze=p(($Gr,ize)=>{var Rfr=Yo(),Pfr=(e,t)=>{try{return new Rfr(e,t).range||"*"}catch{return null}};ize.exports=Pfr});var YD=p((VGr,lze)=>{var Nfr=ki(),cze=Mw(),{ANY:Dfr}=cze,kfr=Yo(),Mfr=Lw(),oze=Nw(),aze=GD(),qfr=zD(),Lfr=WD(),jfr=(e,t,r,n)=>{e=new Nfr(e,n),t=new kfr(t,n);let i,s,o,a,c;switch(r){case">":i=oze,s=qfr,o=aze,a=">",c=">=";break;case"<":i=aze,s=Lfr,o=oze,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mfr(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let u=t.set[l],d=null,h=null;if(u.forEach(f=>{f.semver===Dfr&&(f=new cze(">=0.0.0")),d=d||f,h=h||f,i(f.semver,d.semver,n)?d=f:o(f.semver,h.semver,n)&&(h=f)}),d.operator===a||d.operator===c||(!h.operator||h.operator===a)&&s(e,h.semver))return!1;if(h.operator===c&&o(e,h.semver))return!1}return!0};lze.exports=jfr});var dze=p((GGr,uze)=>{var Ffr=YD(),Ufr=(e,t,r)=>Ffr(e,t,">",r);uze.exports=Ufr});var fze=p((WGr,pze)=>{var Bfr=YD(),$fr=(e,t,r)=>Bfr(e,t,"<",r);pze.exports=$fr});var gze=p((zGr,mze)=>{var hze=Yo(),Vfr=(e,t,r)=>(e=new hze(e,r),t=new hze(t,r),e.intersects(t,r));mze.exports=Vfr});var yze=p((HGr,_ze)=>{var Gfr=Lw(),Wfr=Jo();_ze.exports=(e,t,r)=>{let n=[],i=null,s=null,o=e.sort((u,d)=>Wfr(u,d,r));for(let u of o)Gfr(u,t,r)?(s=u,i||(i=u)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let a=[];for(let[u,d]of n)u===d?a.push(u):!d&&u===o[0]?a.push("*"):d?u===o[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);let c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t}});var xze=p((KGr,wze)=>{var vze=Yo(),iH=Mw(),{ANY:nH}=iH,jw=Lw(),sH=Jo(),zfr=(e,t,r={})=>{if(e===t)return!0;e=new vze(e,r),t=new vze(t,r);let n=!1;e:for(let i of e.set){for(let s of t.set){let o=Kfr(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Hfr=[new iH(">=0.0.0-0")],bze=[new iH(">=0.0.0")],Kfr=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===nH){if(t.length===1&&t[0].semver===nH)return!0;r.includePrerelease?e=Hfr:e=bze}if(t.length===1&&t[0].semver===nH){if(r.includePrerelease)return!0;t=bze}let n=new Set,i,s;for(let f of e)f.operator===">"||f.operator===">="?i=Sze(i,f,r):f.operator==="<"||f.operator==="<="?s=Eze(s,f,r):n.add(f.semver);if(n.size>1)return null;let o;if(i&&s){if(o=sH(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let f of n){if(i&&!jw(f,String(i),r)||s&&!jw(f,String(s),r))return null;for(let y of t)if(!jw(f,String(y),r))return!1;return!0}let a,c,l,u,d=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let f of t){if(u=u||f.operator===">"||f.operator===">=",l=l||f.operator==="<"||f.operator==="<=",i){if(h&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===h.major&&f.semver.minor===h.minor&&f.semver.patch===h.patch&&(h=!1),f.operator===">"||f.operator===">="){if(a=Sze(i,f,r),a===f&&a!==i)return!1}else if(i.operator===">="&&!jw(i.semver,String(f),r))return!1}if(s){if(d&&f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===d.major&&f.semver.minor===d.minor&&f.semver.patch===d.patch&&(d=!1),f.operator==="<"||f.operator==="<="){if(c=Eze(s,f,r),c===f&&c!==s)return!1}else if(s.operator==="<="&&!jw(s.semver,String(f),r))return!1}if(!f.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&u&&!i&&o!==0||h||d)},Sze=(e,t,r)=>{if(!e)return t;let n=sH(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Eze=(e,t,r)=>{if(!e)return t;let n=sH(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};wze.exports=zfr});var Zy=p((JGr,Aze)=>{var oH=Ky(),Cze=Rw(),Jfr=ki(),Tze=Wz(),Yfr=zh(),Qfr=WWe(),Xfr=HWe(),Zfr=YWe(),ehr=ZWe(),thr=t6e(),rhr=n6e(),nhr=s6e(),ihr=a6e(),shr=Jo(),ohr=d6e(),ahr=f6e(),chr=VD(),lhr=_6e(),uhr=v6e(),dhr=Nw(),phr=GD(),fhr=zz(),hhr=Hz(),mhr=WD(),ghr=zD(),_hr=Kz(),yhr=O6e(),vhr=Mw(),bhr=Yo(),Shr=Lw(),Ehr=Y6e(),whr=X6e(),xhr=eze(),Chr=nze(),Thr=sze(),Ahr=YD(),Ohr=dze(),Ihr=fze(),Rhr=gze(),Phr=yze(),Nhr=xze();Aze.exports={parse:Yfr,valid:Qfr,clean:Xfr,inc:Zfr,diff:ehr,major:thr,minor:rhr,patch:nhr,prerelease:ihr,compare:shr,rcompare:ohr,compareLoose:ahr,compareBuild:chr,sort:lhr,rsort:uhr,gt:dhr,lt:phr,eq:fhr,neq:hhr,gte:mhr,lte:ghr,cmp:_hr,coerce:yhr,Comparator:vhr,Range:bhr,satisfies:Shr,toComparators:Ehr,maxSatisfying:whr,minSatisfying:xhr,minVersion:Chr,validRange:Thr,outside:Ahr,gtr:Ohr,ltr:Ihr,intersects:Rhr,simplifyRange:Phr,subset:Nhr,SemVer:Jfr,re:oH.re,src:oH.src,tokens:oH.t,SEMVER_SPEC_VERSION:Cze.SEMVER_SPEC_VERSION,RELEASE_TYPES:Cze.RELEASE_TYPES,compareIdentifiers:Tze.compareIdentifiers,rcompareIdentifiers:Tze.rcompareIdentifiers}});var Fw=p(QD=>{"use strict";Object.defineProperty(QD,"__esModule",{value:!0});QD.EditableComponentVersionTypes=void 0;var Oze;(function(e){e.Latest="latest"})(Oze||(QD.EditableComponentVersionTypes=Oze={}))});var lH=p(Ka=>{"use strict";var Dhr=Ka&&Ka.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),khr=Ka&&Ka.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Rze=Ka&&Ka.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Dhr(r,t,n[i]);return khr(r,t),r}}();Object.defineProperty(Ka,"__esModule",{value:!0});Ka.ComponentSetRule=void 0;Ka.assertIsCompenentSetRule=Pze;var Qh=Yt(),Uw=Rze(require("assert/strict")),aH=Rze(Zy()),Ize=Fw(),cH=class{constructor(t){Pze(t),this.componentName=t.componentName,this.componentSet=t.componentSet,this.versionPattern=t.versionPattern,t.editableVersions!==void 0&&(this.editableVersions=t.editableVersions.sort().reverse()),t.excludedVersions!==void 0&&(this.excludedVersions=t.excludedVersions.sort().reverse())}};Ka.ComponentSetRule=cH;function Pze(e){if((0,Qh.assertIsDefined)(e),(0,Qh.assertIsMapOfStringAny)(e),(0,Qh.assertIsString)(e.componentName),Uw.ok(e.componentName.length>0,"componentName must not be an empty string"),(0,Qh.assertIsString)(e.componentSet),Uw.ok(e.componentSet.length>0,"componentSet must not be an empty string"),(0,Qh.assertIsString)(e.versionPattern),Uw.ok(aH.validRange(e.versionPattern),"versionPattern must be a valid semver"),e.editableVersions!==void 0){(0,Qh.assertIsArray)(e.editableVersions);for(let t of e.editableVersions)t!==Ize.EditableComponentVersionTypes.Latest&&Uw.ok(aH.valid(t),`editable component versions must be a valid semver version or "${Ize.EditableComponentVersionTypes.Latest}"`)}if(e.excludedVersions!==void 0){(0,Qh.assertIsArray)(e.excludedVersions);for(let t of e.excludedVersions)Uw.ok(aH.valid(t),"excluded versions must be a valid semver version")}}});var Nze=p(Vc=>{"use strict";var Mhr=Vc&&Vc.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),qhr=Vc&&Vc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Lhr=Vc&&Vc.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Mhr(r,t,n[i]);return qhr(r,t),r}}();Object.defineProperty(Vc,"__esModule",{value:!0});Vc.ComponentSetRuleRepository=void 0;var jhr=xu(),Fhr=Hy(),Uhr=lH(),Bhr=Lhr(Zy()),uH=class extends jhr.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set_rule",Fhr.EntityDefinitions.componentSetRule,Uhr.ComponentSetRule)}async getComponentSetRulesForSet(t){let r=await this.findByComponentSet(t);return Object.fromEntries(r.map(({componentName:n,versionPattern:i})=>[n,i]))}async findByComponentSet(t){return await this.queryItems({componentSet:t},{index:"gsi1_pk-gsi1_sk-index"})}async findByComponentName(t){return await this.queryItems({componentName:t})}async getComponentSetsMatchingComponentVersion(t,r){return(await this.findByComponentName(t)).filter(({versionPattern:i})=>Bhr.satisfies(r,i))}async deleteByComponentSet(t,r){let n=await this.findByComponentSet(t),i=[];for(let s of n)i.push(this.deleteItem(s,r));await Promise.allSettled(i)}async deleteByComponentName(t,r){let n=await this.findByComponentName(t),i=[];for(let s of n)i.push(this.deleteItem(s,r));await Promise.allSettled(i)}};Vc.ComponentSetRuleRepository=uH});var XD=p(ev=>{"use strict";Object.defineProperty(ev,"__esModule",{value:!0});ev.ComponentSetComponentVersion=ev.ComponentSetComponentVersionStatus=void 0;var Gc=Yt(),Bw;(function(e){e.active="active",e.excluded="excluded"})(Bw||(ev.ComponentSetComponentVersionStatus=Bw={}));var dH=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",this.status=Bw.active,(0,Gc.assertIsDefined)(t),this.componentSetWebPath=(0,Gc.assertAssign)(t.componentSetWebPath,Gc.assertIsString,"componentSetWebPath must be a string"),this.componentName=(0,Gc.assertAssign)(t.componentName,Gc.assertIsString,"componentName must be a string"),this.componentVersion=(0,Gc.assertAssign)(t.componentVersion,Gc.assertIsString,"componentVersion must be a string"),this.environmentVariables=(0,Gc.assertAssignWithDefaultUndefinedValue)(t.environmentVariables,Gc.assertIsMapOfStringString,{}),t.status===void 0&&(t.status=Bw.active),(0,Gc.assertIsEnumValue)(t.status,Bw),this.status=t.status}};ev.ComponentSetComponentVersion=dH});var fH=p(ek=>{"use strict";Object.defineProperty(ek,"__esModule",{value:!0});ek.ComponentSetComponentVersionRepository=void 0;var $hr=xu(),Vhr=Hy(),ZD=XD(),pH=class extends $hr.AbstractDynamoDbRepository{constructor(t,r){super(t,r,"component_set_component_version",Vhr.EntityDefinitions.componentSetComponentVersion,ZD.ComponentSetComponentVersion)}async deleteByComponentSet(t,r){let n=await this.findByComponentSet(t),i=[];for(let s of n)i.push(this.deleteItem(s,r));await Promise.allSettled(i)}async deleteByComponentVersion(t,r,n){let i=await this.findByComponentVersion(t,r),s=[];for(let o of i)s.push(this.deleteItem(o,n));await Promise.allSettled(s)}async deleteByComponentName(t,r){let n=await this.findByComponentName(t),i=[];for(let s of n)i.push(this.deleteItem(s,r));await Promise.allSettled(i)}async findByComponentSet(t){return await this.queryItems({componentSetWebPath:t},{index:"gsi1_pk-gsi1_sk-index"})}async findByComponentVersion(t,r){return await this.queryItems({componentName:t},{filter:{type:"begins_with",keyword:`${r}#`}})}async findByComponentName(t){return await this.queryItems({componentName:t})}async getComponentSetVersionsList(t){let r=await this.findByComponentSet(t),n={};for(let i of r)n[i.componentName]===void 0&&(n[i.componentName]=[]),n[i.componentName].push(i.componentVersion);return Object.entries(n).forEach(([i,s])=>{n[i]=s.sort((o,a)=>o<a?1:o>a?-1:0)}),n}async findByComponentVersionActive(t,r){return(await this.findByComponentVersion(t,r)).filter(n=>n.status===ZD.ComponentSetComponentVersionStatus.active)}async findByComponentNameActive(t){return(await this.findByComponentName(t)).filter(r=>r.status===ZD.ComponentSetComponentVersionStatus.active)}async findByComponentSetActive(t){return(await this.findByComponentSet(t)).filter(r=>r.status===ZD.ComponentSetComponentVersionStatus.active)}};ek.ComponentSetComponentVersionRepository=pH});var Dze=p(hH=>{"use strict";Object.defineProperty(hH,"__esModule",{value:!0});hH.createComponentDynamoDbManager=emr;var Ghr=oW(),Whr=xu(),zhr=xWe(),Hhr=xu(),Khr=Lz(),Jhr=Uz(),Yhr=Vz(),Qhr=Nze(),Xhr=fH();function Zhr(e){return t=>({component:new Khr.ComponentRepository(e,t),componentVersion:new Jhr.ComponentVersionRepository(e,t),componentSet:new Yhr.ComponentSetRepository(e,t),componentSetRule:new Qhr.ComponentSetRuleRepository(e,t),componentSetComponentVersion:new Xhr.ComponentSetComponentVersionRepository(e,t)})}function emr(e,t,r){let n=new Ghr.DynamoDBClient((0,Hhr.getDynamoDbOptions)(t,r)),i=zhr.DynamoDBDocument.from(n);return new Whr.DynamoDbManager(i,Zhr(e))}});var kze=p(Xh=>{"use strict";var tmr=Xh&&Xh.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),rmr=Xh&&Xh.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&tmr(t,e,r)};Object.defineProperty(Xh,"__esModule",{value:!0});rmr(Dze(),Xh)});var rk=p(tk=>{"use strict";Object.defineProperty(tk,"__esModule",{value:!0});tk.AbstractComponentSetService=void 0;var mH=class{getComponentRuntimeHeaders(t,r){var n,i;let s=(n=r.output.headers)!==null&&n!==void 0?n:{},o=(i=t.headers)!==null&&i!==void 0?i:{};return{...s,...o}}};tk.AbstractComponentSetService=mH});var Mze=p(nk=>{"use strict";Object.defineProperty(nk,"__esModule",{value:!0});nk.ComponentSetServiceForLocalDev=void 0;var tv=Yt(),nmr=rk(),gH=class extends nmr.AbstractComponentSetService{constructor(t){super(),this.logger=t}async updateComponentSet(){throw new tv.MethodNotImplementedError("updateComponentSet is not implemented for local development")}async getAllComponentSets(){throw new tv.MethodNotImplementedError("getAllComponentSets is not implemented for local development")}async addComponentSet(){throw new tv.MethodNotImplementedError("addComponentSet is not implemented for local development")}async deleteComponentSet(){throw new tv.MethodNotImplementedError("deleteComponentSet is not implemented for local development")}addComponentToSet(t,r,n){throw new tv.MethodNotImplementedError("addComponentToSet is not implemented for local development")}async getPaginatedComponentSets(t=1,r=[],n="asc"){throw new tv.MethodNotImplementedError("getPaginatedComponentSets is not implemented for local development")}async getComponentSetWebModel(t){return{webPath:t,displayName:"set",description:"debug set",environmentVariables:process.env,headers:{},components:{},componentVersionRules:{}}}async getComponentSet(t){return{webPath:t,displayName:"set",description:"debug set",environmentVariables:process.env,headers:{}}}async getComponentsRuntimeSetData(t,r){let n={},i=t.getModel().environment||[],s=[];for(let o of i)r.environmentVariables[o.name]===void 0?o.required!==!1&&s.push(o.name):n[o.name]=r.environmentVariables[o.name];if(s.length>0)throw new Error(`Missing required environment variables: "${s.join('","')}"`);return{environment:n,displayName:r.displayName,webPath:r.webPath}}async componentVersionInSet(t,r){return!0}async componentVersionExcludedFromSet(t,r,n){return!1}};nk.ComponentSetServiceForLocalDev=gH});var Fze=p(Ja=>{"use strict";var imr=Ja&&Ja.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),smr=Ja&&Ja.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Lze=Ja&&Ja.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&imr(r,t,n[i]);return smr(r,t),r}}();Object.defineProperty(Ja,"__esModule",{value:!0});Ja.ComponentSetComponentVersionEditable=void 0;Ja.assertIsComponentVersionEditable=jze;var $w=Yt(),ik=Lze(require("assert/strict")),omr=Lze(Zy()),qze=Fw(),_H=class{constructor(t){this.componentSetWebPath="",this.componentName="",this.componentVersion="",jze(t),this.componentSetWebPath=t.componentSetWebPath,this.componentName=t.componentName,this.componentVersion=t.componentVersion}};Ja.ComponentSetComponentVersionEditable=_H;function jze(e){(0,$w.assertIsDefined)(e),(0,$w.assertIsMapOfStringString)(e),(0,$w.assertIsString)(e.componentName),ik.ok(e.componentName.length>0,"componentName must not be an empty string"),(0,$w.assertIsString)(e.componentSetWebPath),ik.ok(e.componentSetWebPath.length>0,"componentSetWebPath must not be an empty string"),(0,$w.assertIsString)(e.componentVersion),ik.ok(e.componentVersion.length>0,"editable component version must not be an empty string"),e.componentVersion!==qze.EditableComponentVersionTypes.Latest&&ik.ok(omr.valid(e.componentVersion),`editable component version must be a valid semver version or "${qze.EditableComponentVersionTypes.Latest}"`)}});var bH=p(Wc=>{"use strict";var amr=Wc&&Wc.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),cmr=Wc&&Wc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lmr=Wc&&Wc.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&amr(r,t,n[i]);return cmr(r,t),r}}();Object.defineProperty(Wc,"__esModule",{value:!0});Wc.ComponentSetServiceForProduction=void 0;var mn=Yt(),umr=jD(),dmr=Fw(),pmr=rk(),Wp=XD(),Uze=lH(),fmr=Zy(),yH=lmr(Zy()),hmr=Fze(),vH=class extends pmr.AbstractComponentSetService{constructor(t,r,n,i){super(),this.db=t,this.logger=r,this.manifestService=n,this.componentLoggingService=i}async getComponentSet(t){let r=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(!r)throw new mn.ResourceNotFoundError(`component set ${t} could not be found`);return r}async addComponentSet(t,r){await this.assertValidCreateComponentSet(t);try{let n=await this.db.executeInTransaction(async a=>{var c;let l=await this.db.repositories.componentSet.createItem(new umr.ComponentSet({webPath:t.webPath,displayName:t.displayName,description:t.description,environmentVariables:t.environmentVariables,headers:t.headers}),a),u=(c=t.componentVersionRules)!==null&&c!==void 0?c:{};return await this.setComponentVersionRules(t.webPath,u,a),await this.saveComponentSetComponents(t.webPath,u,t.components,a),l}),i=await this.getComponentSetWebModel(n.webPath),s=`Component set added: ${i.webPath}.`,o=`componentSetId:${i.webPath}`;return await this.componentLoggingService.info(s,void 0,r,o),await this.componentLoggingService.flush(),i}catch(n){throw this.logger.error(`Error occurred when creating component set ${t.webPath}: ${n}`),n}}async removeEnvironmentVariablesFromComponents(t){t.components||(t.components={}),Object.keys(t.components).forEach(r=>{t.components[r].forEach(n=>delete n.environmentVariables)})}getChangedComponentsInSet(t,r){let n=t.components?Object.keys(t.components):[],i=r.components?Object.keys(r.components):[],s=[],o=[];for(let a of i)n.includes(a)||s.push(a);for(let a of n)i.includes(a)||o.push(a);return s.concat(o)}async updateComponentSet(t,r,n){var i;let s=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(!s)throw new mn.ResourceNotFoundError(`Component set with web path ${t} does not exist`);let o=structuredClone(await this.getComponentSetWebModel(t)),a=await this.getExistingComponentSetRules(t);await this.assertValidComponentSet(r,this.normalise(s,{components:await this.getExistingComponentsForWeb(t),componentVersionRules:a})),this.assertValidComponentVersionRules(t,r.componentVersionRules),this.assertComponentVersionsMatchRules(r.components,(i=r.componentVersionRules)!==null&&i!==void 0?i:a);let c={};r.displayName!==void 0&&(c.displayName=r.displayName),r.description!==void 0&&(c.description=r.description),r.headers!==void 0&&(c.headers=r.headers),r.environmentVariables!==void 0&&(c.environmentVariables=r.environmentVariables);try{await this.db.executeInTransaction(async f=>{var y;Object.keys(c).length>0&&await this.db.repositories.componentSet.updateItem({...c,webPath:t},f),r.componentVersionRules&&await this.setComponentVersionRules(t,r.componentVersionRules,f,!0),await this.saveComponentSetComponents(t,(y=r.componentVersionRules)!==null&&y!==void 0?y:a,r.components,f)});let l=`Component set updated: "${t}".`,u=structuredClone(await this.getComponentSetWebModel(t));this.removeEnvironmentVariablesFromComponents(o),this.removeEnvironmentVariablesFromComponents(u),l+=` Changed from ${JSON.stringify(o.components)} to ${JSON.stringify(u.components)}.`;let d=this.getChangedComponentsInSet(o,u),h=`componentSetId:${u.webPath}`;return h+=` ${d.map(f=>`componentId:${f}`).join(" ")}`,await this.componentLoggingService.info(l,void 0,n,h),await this.componentLoggingService.flush(),this.getComponentSetWebModel(t)}catch(l){throw this.logger.error(`Error occurred when updating component set ${t}: ${l}`),l}}async getExistingComponentSetRules(t){var r,n;let i=await this.db.repositories.componentSetRule.findByComponentSet(t),s={};for(let o of i)s[o.componentName]={renderableVersionPattern:o.versionPattern,editableVersions:(r=o.editableVersions)!==null&&r!==void 0?r:[],excludedVersions:(n=o.excludedVersions)!==null&&n!==void 0?n:[]};return s}async saveComponentSetComponents(t,r,n,i){let[s,o]=await Promise.all([this.db.repositories.componentSetComponentVersion.findByComponentSet(t),this.getRenderableComponentVersions(r)]);await Promise.all([this.addComponentEntriesInSet(t,o,s,n,i),this.updateComponentEntriesInSet(t,o,s,n,i)])}async getRenderableComponentVersions(t){let r=[];if(t)for(let[n,i]of Object.entries(t)){let s=(await this.getComponentVersionMatchingComponentSetRule(n,i.renderableVersionPattern)).filter(o=>!i.excludedVersions.includes(o.version));r.push(...s)}return r}async addComponentEntriesInSet(t,r,n,i,s){let o=r.filter(a=>n.find(c=>c.componentName===a.componentName&&c.componentVersion===a.version)===void 0).map(a=>{var c;let l={};return i!==void 0&&i[a.componentName]!==void 0&&(l=(c=i[a.componentName].find(u=>u.version===a.version))===null||c===void 0?void 0:c.environmentVariables),new Wp.ComponentSetComponentVersion({componentSetWebPath:t,componentName:a.componentName,componentVersion:a.version,environmentVariables:l??{}})});for(let a of o)await this.db.repositories.componentSetComponentVersion.createItem(a,s)}async updateComponentEntriesInSet(t,r,n,i,s){var o;for(let a of n){let c={},l=r.find(d=>a.componentName===d.componentName&&a.componentVersion===d.version)!==void 0,u=a.status;if(l&&a.status===Wp.ComponentSetComponentVersionStatus.excluded?(c.status=Wp.ComponentSetComponentVersionStatus.active,u=c.status):!l&&a.status===Wp.ComponentSetComponentVersionStatus.active&&(c.status=Wp.ComponentSetComponentVersionStatus.excluded,u=c.status),l&&u===Wp.ComponentSetComponentVersionStatus.active&&i!==void 0&&i[a.componentName]!==void 0){let d=(o=i[a.componentName].find(h=>h.version===a.componentVersion))===null||o===void 0?void 0:o.environmentVariables;d!==void 0&&JSON.stringify(d)!==JSON.stringify(a.environmentVariables)&&(c.environmentVariables=d)}Object.keys(c).length>0&&await this.db.repositories.componentSetComponentVersion.updateItem({...c,componentSetWebPath:t,componentName:a.componentName,componentVersion:a.componentVersion},s)}}async getComponentVersionMatchingComponentSetRule(t,r){return(await this.db.repositories.componentVersion.getComponentVersions(t)).filter(i=>r.trim().length&&yH.satisfies(i.version,r))}async getComponentsRuntimeSetData(t,r){var n;let i={},s=t.getModel().environment||[],o=await this.db.repositories.componentSetComponentVersion.getItem({componentName:t.getName(),componentVersion:t.getVersion(),componentSetWebPath:r.webPath});if(!o)throw new mn.ResourceNotFoundError(`component ${t.getName()} ${t.getVersion} couldn't not be found in set ${r.webPath}`);let a=[];for(let c of s)r.environmentVariables[c.name]===void 0?c.required!==!1&&a.push(c.name):i[c.name]=(n=o.environmentVariables[c.name])!==null&&n!==void 0?n:r.environmentVariables[c.name];if(a.length>0)throw new mn.BadRequestError(`Missing required environment variables: "${a.join('","')}"`);return{environment:i,displayName:r.displayName,webPath:r.webPath}}async setComponentVersionRules(t,r,n,i=!1){let s={};i&&(await this.db.repositories.componentSetRule.findByComponentSet(t)).forEach(o=>{s[o.componentName]=o});for(let[o,a]of Object.entries(r)){let c=new Uze.ComponentSetRule({componentSet:t,componentName:o,versionPattern:a.renderableVersionPattern,editableVersions:typeof a.editableVersions=="string"?[a.editableVersions]:a.editableVersions,excludedVersions:a.excludedVersions});s[o]===void 0?await this.db.repositories.componentSetRule.createItem(c,n):(s[o].versionPattern!==c.versionPattern||!this.equalArrayValue(s[o].editableVersions,c.editableVersions)||!this.equalArrayValue(s[o].excludedVersions,c.excludedVersions))&&await this.db.repositories.componentSetRule.updateItem(c,n)}for(let[o,a]of Object.entries(s))r[o]===void 0&&await this.db.repositories.componentSetRule.deleteItem(a,n)}equalArrayValue(t,r){return!Array.isArray(t)||!Array.isArray(r)||t.length!==r.length?!1:JSON.stringify(t)===JSON.stringify(r)}async getComponentSetWebModel(t){let r=await this.db.repositories.componentSet.getComponentSetByWebPath(t);if(r===void 0)throw new mn.ResourceNotFoundError(`Component set with web path ${t} does not exist`);return this.normalise(r,{components:await this.getExistingComponentsForWeb(t),componentVersionRules:await this.getExistingComponentSetRules(t)})}async deleteComponentSet(t,r){if(!await this.db.repositories.componentSet.getComponentSetByWebPath(t))throw new mn.ResourceNotFoundError(`Component set with web path ${t} does not exist`);let n=`Component set deleted: ${t}.`,i=`componentSetId:${t}`;await this.componentLoggingService.info(n,void 0,r,i),await this.componentLoggingService.flush();let[s,o]=await Promise.all([this.db.repositories.componentSetRule.findByComponentSet(t),this.db.repositories.componentSetComponentVersion.findByComponentSet(t)]);return await Promise.allSettled([this.db.repositories.componentSetRule.deleteItems(s),this.db.repositories.componentSetComponentVersion.deleteItems(o)]),await this.db.repositories.componentSet.deleteItem({webPath:t}),1}normalise(t,{components:r,componentVersionRules:n}){var i,s,o,a,c;return{webPath:(i=t.webPath)!==null&&i!==void 0?i:"",displayName:(s=t.displayName)!==null&&s!==void 0?s:"",description:(o=t.description)!==null&&o!==void 0?o:"",environmentVariables:(a=t.environmentVariables)!==null&&a!==void 0?a:{},headers:(c=t.headers)!==null&&c!==void 0?c:{},components:r??{},componentVersionRules:n??{}}}async getExistingComponentsForWeb(t){var r,n,i;let s=await this.db.repositories.componentSetComponentVersion.findByComponentSetActive(t),o={},a={};for(let f of s)o[`${f.componentName}/${f.componentVersion}`]=f.environmentVariables,a[`${f.componentName}/${f.componentVersion}`]={componentName:f.componentName,version:f.componentVersion};let c=await this.db.repositories.componentVersion.getItems(Object.values(a)),l={};for(let f of c)(l[f.componentName]===void 0||yH.compare(f.version,l[f.componentName])>0)&&(l[f.componentName]=f.version);let u=await this.db.repositories.componentSetRule.findByComponentSet(t),d={};for(let f of u)d[f.componentName]=(r=f.editableVersions)!==null&&r!==void 0?r:[];let h={};for(let f of c){h[f.componentName]===void 0&&(h[f.componentName]=[]);let y=`${f.componentName}/${f.version}`;h[f.componentName].push({version:f.version,environmentVariables:(n=o[y])!==null&&n!==void 0?n:{},type:(i=f.type)!==null&&i!==void 0?i:"server",description:f.description,displayName:f.displayName,icon:f.icon,editable:this.isComponentVersionEditable(f.version,d[f.componentName],l[f.componentName])})}return Object.entries(h).forEach(([f,y])=>{h[f]=y.sort((S,E)=>S.version<E.version?1:S.version>E.version?-1:0)}),h}isComponentVersionEditable(t,r,n){return r===void 0||r.length<1?!1:r.includes(dmr.EditableComponentVersionTypes.Latest)&&t===n?!0:r.includes(t)}async assertValidCreateComponentSet(t){if(!t.webPath)throw new mn.BadRequestError("Component set 'webPath' must be specificed and non-empty");if(!t.displayName)throw new mn.BadRequestError("Component set 'displayName' must be specificed and non-empty");if(this.assertValidWebPath(t.webPath),await this.db.repositories.componentSet.getComponentSetByWebPath(t.webPath))throw new mn.BadRequestError(`Component set with web path ${t.webPath} already exists`);await this.assertValidComponentSet(t),this.assertValidComponentVersionRules(t.webPath,t.componentVersionRules),this.assertComponentVersionsMatchRules(t.components,t.componentVersionRules)}assertComponentVersionsMatchRules(t={},r={}){for(let[n,i]of Object.entries(t))if(!(r[n]!==void 0&&i.every(({version:o})=>(0,fmr.satisfies)(o,r[n].renderableVersionPattern))))throw new mn.BadRequestError("Component versions must satisfy version rule")}async assertValidComponentSet(t,r=void 0){var n,i;if(t.environmentVariables!==void 0&&this.assertValidEnvVars(t.environmentVariables),t.headers!==void 0&&this.assertValidHeaders(t.headers),t.components!==void 0){let s=(i=(n=t.environmentVariables)!==null&&n!==void 0?n:r==null?void 0:r.environmentVariables)!==null&&i!==void 0?i:{};await this.assertValidComponents(t.components,s)}}assertValidWebPath(t){if(t.replace(/[^a-z0-9\-_.]/i,"")!==t)throw new mn.BadRequestError("Invalid Component Set web path. Only [A-Za-z0-9_-.] chars are allowed")}assertValidEnvVars(t={}){Object.entries(t).forEach(([r,n])=>{this.assertValidProperty({name:r,value:n,type:"environment variable"})})}assertValidHeaders(t){Object.entries(t).forEach(([r,n])=>{this.assertValidProperty({name:r,value:n,type:"header"})})}assertValidProperty(t){if(!/^[a-z0-9\-_.]+$/i.test(t.name))throw new mn.BadRequestError(`Invalid '${t.type}' name for '${t.name}'. Only [A-Za-z0-9_-.] chars are allowed`);if(typeof t.value!="string")throw new mn.BadRequestError(`Invalid '${t.type}' value for '${t.name}'. Value must be a string`)}async assertValidComponents(t,r){if(t){let n=[];for(let[s,o]of Object.entries(t)){if(!s)throw new mn.BadRequestError("Component name must be non-empty");let a=[];for(let c of o){if(!c.version)throw new mn.BadRequestError("Component version must set and be non-empty");if(a.includes(c.version))throw new mn.BadRequestError(`Multiple componet version entries for component ${s} with version ${c.version}`);if(a.push(c.version),c.environmentVariables!==void 0){this.assertValidEnvVars(c.environmentVariables);let l=Object.keys(c.environmentVariables).filter(u=>!Object.keys(r).includes(u));if(l.length)throw new mn.BadRequestError(`Env var(s) '${l.join("', '")}' defined on component ${s} with version ${c.version} is/are not defined on the component set`)}n.push({componentName:s,version:c.version})}}let i=await this.db.repositories.componentVersion.getItems(n);for(let[s,o]of Object.entries(t))for(let a of o)if(!i.find(c=>c.componentName===s&&c.version===a.version))throw new mn.BadRequestError(`Component ${s} with version ${a.version} does not exists`)}}assertValidComponentVersionRules(t,r={}){for(let[n,i]of Object.entries(r))try{this.assertValidVersionRule(i.renderableVersionPattern),(0,Uze.assertIsCompenentSetRule)({componentSet:t,componentName:n,versionPattern:i.renderableVersionPattern});let s=typeof i.editableVersions=="string"?[i.editableVersions]:i.editableVersions;this.assertValidEditableVersions(s);for(let o of s)(0,hmr.assertIsComponentVersionEditable)({componentSetWebPath:t,componentName:n,componentVersion:o})}catch(s){throw new mn.BadRequestError(s.message)}}assertValidVersionRule(t){if(!yH.validRange(t))throw new Error(`Invalid renderable component version semver value: ${t}`)}assertValidEditableVersions(t){let r=t.filter((n,i)=>t.indexOf(n)!=i);if(r.length)throw new Error(`Duplicate editable versions: ${[...new Set(r)].join(", ")}`)}async getAllComponentSets(){let t=await this.db.repositories.componentSet.getAllComponentSets(),r=[];for(let n of t)r.push(this.normalise(n,{components:await this.getExistingComponentsForWeb(n.webPath),componentVersionRules:await this.getExistingComponentSetRules(n.webPath)}));return r}async getPaginatedComponentSets(t=1,r=[],n="asc"){let s=(t-1)*20,o=s+20,a=(await this.db.repositories.componentSet.getAllComponentSets()).sort((l,u)=>n==="asc"?l.displayName.localeCompare(u.displayName):u.displayName.localeCompare(l.displayName)),c=[];for(let l of a.slice(s,o))c.push(this.normalise(l,{components:await this.getExistingComponentsForWeb(l.webPath),componentVersionRules:await this.getExistingComponentSetRules(l.webPath)}));return{items:c,pageInfo:(0,mn.getPageInfo)(t,20,a.length)}}async componentVersionInSet(t,r){let n=await this.db.repositories.componentSetComponentVersion.getItem({componentName:t.getName(),componentVersion:t.getVersion(),componentSetWebPath:r});return n!==void 0&&n.status===Wp.ComponentSetComponentVersionStatus.active}async addComponentToSet(t,r,n,i){let s=await this.db.repositories.componentSetComponentVersion.createItem(new Wp.ComponentSetComponentVersion({componentSetWebPath:t,componentName:r,componentVersion:n})),o=`Component: ${r} added to ${t}.`,a=`componentSetId:${t} componentId:${r}`;return await this.componentLoggingService.info(o,void 0,i,a),await this.componentLoggingService.flush(),s}async componentVersionExcludedFromSet(t,r,n){let i=await this.db.repositories.componentSetRule.getItem({componentSet:t,componentName:r});return i!==void 0&&i.excludedVersions!==void 0&&i.excludedVersions.includes(n)}};Wc.ComponentSetServiceForProduction=vH});var EH=p(sk=>{"use strict";Object.defineProperty(sk,"__esModule",{value:!0});sk.ComponentSetRuleService=void 0;var SH=class{constructor(t,r){this.db=t,this.componentSetService=r}async addComponentVersionToRequiredSets(t,r){let n=await this.db.repositories.componentSetRule.getComponentSetsMatchingComponentVersion(t,r),i=[];for(let o of n)o.excludedVersions!==void 0&&o.excludedVersions.includes(r)||i.push(o);let s=({componentSet:o})=>this.componentSetService.addComponentToSet(o,t,r);return Promise.allSettled(i.map(s))}};sk.ComponentSetRuleService=SH});var $ze=p(Bze=>{"use strict";Object.defineProperty(Bze,"__esModule",{value:!0})});var Gze=p(Vze=>{"use strict";Object.defineProperty(Vze,"__esModule",{value:!0})});var Wze=p(ok=>{"use strict";Object.defineProperty(ok,"__esModule",{value:!0});ok.InvalidEnvironmentVariablesError=void 0;var mmr=Yt(),wH=class extends mmr.BadRequestError{constructor(t){let r=t.map(([n,i])=>`"${n}" ${i}`).join("; ");super(`Invalid Environment Variables: ${r}`),this.errors=t,this.name="InvalidEnvironmentVariablesError"}};ok.InvalidEnvironmentVariablesError=wH});var Hze=p(zze=>{"use strict";Object.defineProperty(zze,"__esModule",{value:!0})});var Jze=p(Kze=>{"use strict";Object.defineProperty(Kze,"__esModule",{value:!0})});var Yze=p(cr=>{"use strict";var gmr=cr&&cr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Qo=cr&&cr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&gmr(t,e,r)};Object.defineProperty(cr,"__esModule",{value:!0});cr.DynamoComponentSetServiceForProduction=cr.DynamoDbComponentSetRuleService=cr.DynamoDbComponentSetRepository=cr.DynamoDbComponentSetComponentVersionRepository=void 0;Qo(jD(),cr);Qo(XD(),cr);Qo(rk(),cr);Qo(Mze(),cr);Qo(bH(),cr);Qo(EH(),cr);Qo($ze(),cr);var _mr=fH();Object.defineProperty(cr,"DynamoDbComponentSetComponentVersionRepository",{enumerable:!0,get:function(){return _mr.ComponentSetComponentVersionRepository}});var ymr=Vz();Object.defineProperty(cr,"DynamoDbComponentSetRepository",{enumerable:!0,get:function(){return ymr.ComponentSetRepository}});var vmr=EH();Object.defineProperty(cr,"DynamoDbComponentSetRuleService",{enumerable:!0,get:function(){return vmr.ComponentSetRuleService}});var bmr=bH();Object.defineProperty(cr,"DynamoComponentSetServiceForProduction",{enumerable:!0,get:function(){return bmr.ComponentSetServiceForProduction}});Qo(Fw(),cr);Qo(Gze(),cr);Qo(Wze(),cr);Qo(Hze(),cr);Qo(Jze(),cr)});var Xze=p(Qze=>{"use strict";Object.defineProperty(Qze,"__esModule",{value:!0})});var eHe=p(Zze=>{"use strict";Object.defineProperty(Zze,"__esModule",{value:!0})});var rHe=p(Xo=>{"use strict";var Smr=Xo&&Xo.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Emr=Xo&&Xo.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),tHe=Xo&&Xo.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Smr(r,t,n[i]);return Emr(r,t),r}}();Object.defineProperty(Xo,"__esModule",{value:!0});Xo.JobV1=Xo.v1=void 0;Xo.v1=tHe(Xze());Xo.JobV1=tHe(eHe())});var xH=p((_4r,wmr)=>{wmr.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"ComponentManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},namespace:{type:"string",description:"Namespace of the component",$ref:"#/definitions/name-pattern"},name:{type:"string",description:"Name of the component",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the component"},description:{type:"string",description:"Description of the component"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},icon:{$ref:"DxComponentIcons.json"},type:{type:"string",enum:["edge","server"],description:"Type of component that will be deployed to different runtimes"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},environment:{type:"array",description:"an array of environmental variables needed to execute correctly. These variables are set through your local environment variables during testing or through the component set during production run time",items:{type:"object",properties:{name:{type:"string",pattern:"^[a-zA-Z_][a-zA-Z0-9_]*$",description:"Environmental variable name"},required:{type:"boolean",default:!0}},required:["name"]}},staticFiles:{type:"object",properties:{locationRoot:{type:"string",description:"The location the system begins looking static files. All static files will be referenced from here."}},required:["locationRoot"]},functions:{type:"array",minItems:0,items:{title:"ComponentFunction",description:"Component function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name, this will be used as part of the url to access this function"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"},output:{oneOf:[{title:"HtmlResponse",type:"object",additionalProperties:!1,description:"The HtmlResponse type is for returning html content. The response out of the function must be a string. This response object also includes references to resources (staticFiles) the component needs to execute correctly. It is up to the integrating system to respect this.",properties:{responseType:{const:"html"},staticFiles:{type:"array",description:"A list of static resources that are required for the component to execute correctly",items:{type:"object",title:"HtmlStaticFile",additionalProperties:!1,properties:{location:{description:"The location property is used to inform integrating system if the static resource should be included in the header of footer of the document",oneOf:[{const:"header"},{const:"footer"}]},file:{oneOf:[{type:"object",title:"JsFile",additionalProperties:!1,properties:{type:{const:"js"},filepath:{type:"string"},defer:{type:"boolean"},async:{type:"boolean"},module:{oneOf:[{const:"module"},{const:"text/javascript"}]},integrity:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath","type"]},{type:"object",title:"CssFile",additionalProperties:!1,properties:{type:{const:"css"},filepath:{type:"string"},crossorigin:{oneOf:[{const:"anonymous"},{const:"use-credentials"}]},referrerpolicy:{oneOf:[{const:"no-referrer"},{const:"no-referrer-when-downgrade"},{const:"origin"},{const:"origin-when-cross-origin"},{const:"same-origin"},{const:"strict-origin"},{const:"strict-origin-when-cross-origin"},{const:"unsafe-url"}]}},required:["filepath"]}]}},required:["location","file"]}},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType"]},{title:"JsonResponse",type:"object",additionalProperties:!1,properties:{responseType:{const:"json"},definition:{$ref:"http://json-schema.org/draft-07/schema#"},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}}},required:["responseType","definition"]}]},queryParameters:{propertyNames:{title:"Query parameter name",type:"string"},additionalProperties:{title:"Query parameter value type",type:"object",properties:{required:{type:"boolean"}},required:["required"]}}},required:["name","entry","input","output"]}},previews:{type:"object",description:"A map of previews which provide configuration to preview the component in isolation",propertyNames:{type:"string",pattern:"^[a-zA-Z0-9_\\-]+$"},minProperties:1,additionalProperties:{title:"Preview Definition",type:"object",description:"Name for the preview and how it will be accessed",required:["functionData"],properties:{functionData:{description:"A map of the functions to their respective preview information. Properties must match name of a function defined in functions list",type:"object",propertyNames:{$ref:"#/definitions/name-pattern"},minProperties:1,additionalProperties:{type:"object",title:"Function preview configuration",description:"Data inputs for the preview of functions in the component",properties:{inputData:{type:"object",description:"Property for defining the input data for this preview component function",properties:{type:{description:"An enum of 'file' or 'inline' for how the input data is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to input data file"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{type:"object",description:"Input data value"}},required:["type","value"]}]},headers:{title:"ResponseHeaders",type:"object",description:"Response headers to set",additionalProperties:{type:"string"}},wrapper:{type:"object",description:"Define the extra static files which provide a container for the component function",properties:{path:{type:"string",format:"uri-reference",description:"File path to the wrapper container"}},required:["path"]}}}}}}},mockedUris:{type:"object",description:"Mocked uri objects used in the preview",propertyNames:{type:"string",pattern:"^[a-z0-9_\\-]+:\\/\\/"},additionalProperties:{type:"object",description:"Property for defining the mock URI object",properties:{type:{description:"An enum of 'file' or 'inline' for how the uri object is defined",enum:["file","inline"]}},required:["type"],oneOf:[{type:"object",properties:{type:{enum:["file"]},path:{type:"string",format:"uri-reference",description:"Path to uri object"}},required:["type","path"]},{type:"object",properties:{type:{enum:["inline"]},value:{$ref:"MatrixAssetSchema.json",description:"Inline URI object"}},required:["type","value"]}]}},"ui:metadata":{properties:{autoReload:{type:"boolean",default:!0}},required:["autoReload"]}},required:["name","namespace","displayName","description","version","functions","$schema","mainFunction"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var CH=p((y4r,xmr)=>{xmr.exports={$schema:"http://json-schema.org/draft-07/schema#",type:"object",title:"JobManifest",additionalProperties:!1,properties:{$schema:{type:"string",description:"the manifest schema version"},name:{type:"string",description:"Name of the job",$ref:"#/definitions/name-pattern"},displayName:{type:"string",description:"Display name of the job"},description:{type:"string",description:"Description of the job"},mainFunction:{type:"string",description:"Name of the main function to be executed at the root of the access url"},version:{type:"string",description:"Semver version number",minLength:5,maxLength:14,pattern:"^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"},timeout:{type:"number",description:"Timeout in seconds before a job is stopped (min 10min, max 8h)",minimum:600,maximum:28800},concurrency:{type:"number",description:"The number of these jobs that can be run at once",minimum:1},functions:{type:"array",minItems:0,items:{title:"JobFunction",description:"Job function definition, this object provides the runtime with input validation and what to execute",type:"object",properties:{name:{type:"string",$ref:"#/definitions/name-pattern",description:"Function name"},entry:{type:"string",description:"File path to the javascript file to execute. The file path must be relative to the manifest file and cannot be in a folder above the manifest file."},input:{$ref:"DxComponentInputSchema.json"}},required:["name","entry","input"]}}},required:["name","displayName","description","version","functions","$schema","mainFunction","concurrency","timeout"],definitions:{"name-pattern":{type:"string",pattern:"^[a-z][a-z0-9_\\-]+$"}}}});var iHe=p(zp=>{"use strict";var nHe=zp&&zp.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zp,"__esModule",{value:!0});zp.JobV1=zp.v1=void 0;var Cmr=nHe(xH());zp.v1=Cmr.default;var Tmr=nHe(CH());zp.JobV1=Tmr.default});var oHe=p(sHe=>{"use strict";Object.defineProperty(sHe,"__esModule",{value:!0})});var aHe=p(zc=>{"use strict";var Amr=zc&&zc.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Omr=zc&&zc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Imr=zc&&zc.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&Amr(r,t,n[i]);return Omr(r,t),r}}();Object.defineProperty(zc,"__esModule",{value:!0});zc.v1=void 0;zc.v1=Imr(oHe())});var TH=p((E4r,Rmr)=>{Rmr.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"SquizFormattedTextSchema.json",type:"array",title:"FormattedText",items:{$ref:"#/definitions/FormattedNodes"},definitions:{FormattedNodes:{anyOf:[{$ref:"#/definitions/HigherOrderFormattedNodes"},{$ref:"#/definitions/BaseFormattedNodes"}]},HigherOrderFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextLinkToMatrixAsset"},{$ref:"#/definitions/FormattedTextMatrixImage"},{$ref:"#/definitions/FormattedTextDamImage"}]},BaseFormattedNodes:{anyOf:[{$ref:"#/definitions/FormattedTextTag"},{$ref:"#/definitions/FormattedTextFragment"},{$ref:"#/definitions/TextNode"},{$ref:"#/definitions/ComponentNode"}]},TextNode:{type:"object",additionalProperties:!1,properties:{type:{const:"text"},value:{type:"string"}},required:["type","value"]},FormattingOptions:{type:"object",properties:{alignment:{type:"string",enum:["center","left","right","justify"]}}},WithChildrenNode:{type:"array",items:{$ref:"#/definitions/FormattedNodes"}},FormattedNodeFontProperties:{type:"object",properties:{bold:{type:"boolean"},underline:{type:"boolean"},italics:{type:"boolean"},color:{type:"string"},size:{type:"string"},fontFamily:{type:"string"}}},FormattedTextTag:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"tag"},tag:{type:"string",minLength:1},attributes:{type:"object",additionalProperties:{type:"string"}},font:{$ref:"#/definitions/FormattedNodeFontProperties"}},required:["type","tag"]},FormattedTextFragment:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},type:{const:"fragment"}},required:["type"]},ComponentNode:{type:"object",additionalProperties:!1,properties:{type:{const:"component"},componentId:{type:"string"},componentType:{type:"string",enum:["edge","server"]},componentSet:{type:"string"},contentItem:{type:"object",title:"ContentItemReference",properties:{id:{type:"string"}},required:[]},error:{type:"string",required:[]}},required:["type","componentSet","componentId","componentType"]},FormattedTextLinkToMatrixAsset:{type:"object",additionalProperties:!1,properties:{children:{$ref:"#/definitions/WithChildrenNode"},formattingOptions:{$ref:"#/definitions/FormattingOptions"},type:{const:"link-to-matrix-asset"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},target:{type:"string",enum:["_blank","_self","_parent","_top"]},attributes:{allOf:[{type:"object",properties:{href:!1,target:!1}},{type:"object",additionalProperties:{type:"string"}}]}},required:["type","matrixDomain","matrixAssetId","target","children"]},FormattedTextMatrixImage:{type:"object",additionalProperties:!1,properties:{type:{const:"matrix-image"},matrixIdentifier:{type:"string",minLength:1},matrixDomain:{type:"string",minLength:1},matrixAssetId:{type:"string",minLength:1},formattingOptions:{$ref:"#/definitions/FormattingOptions"},attributes:{allOf:[{type:"object",properties:{src:!1}},{type:"object",additionalProperties:{type:"string"}}]}},required:["type","matrixDomain","matrixAssetId"]},FormattedTextDamImage:{type:"object",additionalProperties:!1,properties:{type:{const:"dam-image"},damSystemType:{enum:["bynder"]},damSystemIdentifier:{type:"string",minLength:1},damObjectId:{type:"string",minLength:1},damAdditional:{type:"object",properties:{variant:{type:"string",minLength:1}}},formattingOptions:{$ref:"#/definitions/FormattingOptions"},attributes:{allOf:[{type:"object",properties:{src:!1}},{type:"object",additionalProperties:{type:"string"}}]}},required:["type","damSystemType","damSystemIdentifier","damObjectId"]}}}});var cHe=p(rv=>{"use strict";var Pmr=rv&&rv.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rv,"__esModule",{value:!0});rv.v1=void 0;var Nmr=Pmr(TH());rv.v1=Nmr.default});var OH=p((Vw,AH)=>{(function(e,t){typeof Vw=="object"&&typeof AH=="object"?AH.exports=t():typeof define=="function"&&define.amd?define("jsonQuery",[],t):typeof Vw=="object"?Vw.jsonQuery=t():e.jsonQuery=t()})(typeof self<"u"?self:Vw,()=>(()=>{var e={546:function(i){typeof self<"u",i.exports=(()=>{"use strict";var s={d:(D,W)=>{for(var oe in W)s.o(W,oe)&&!s.o(D,oe)&&Object.defineProperty(D,oe,{enumerable:!0,get:W[oe]})},o:(D,W)=>Object.prototype.hasOwnProperty.call(D,W),r:D=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(D,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(D,"__esModule",{value:!0})}},o={};function a(D){return D==="#"||D===""||Array.isArray(D)&&D.length===0||!1}s.r(o),s.d(o,{default:()=>be,get:()=>S,isRoot:()=>a,join:()=>te,remove:()=>j,removeUndefinedItems:()=>k,set:()=>F,split:()=>y,splitLast:()=>pe});let c=/~1/g,l=/~0/g,u=/\/+/g,d=/(^[#/]*|\/+$)/g;function h(D){return D.replace(c,"/").replace(l,"~")}function f(D){return h(decodeURIComponent(D))}function y(D){if(D==null||typeof D!="string"||a(D))return Array.isArray(D)?D:[];let W=D.indexOf("#")>=0?f:h,oe=(D=(D=D.replace(u,"/")).replace(d,"")).split("/");for(let ae=0,le=oe.length;ae<le;ae+=1)oe[ae]=W(oe[ae]);return oe}function S(D,W,oe=void 0){if(W==null||D==null)return oe;if(a(W))return D;let ae=E(D,y(W));return ae===void 0?oe:ae}function E(D,W){let oe=W.shift();if(D!==void 0)return oe!==void 0?E(D[oe],W):D}let C=/^\[.*\]$/,P=/^\[(.+)\]$/;function q(D,W){return D==="__proto__"||D=="constructor"&&W.length>0&&W[0]=="prototype"}function F(D,W,oe){if(W==null)return D;let ae=y(W);if(ae.length===0)return D;D==null&&(D=C.test(ae[0])?[]:{});let le,ct,Ct=D;for(;ae.length>1;)le=ae.shift(),ct=C.test(ae[0]),q(le,ae)||(Ct=B(Ct,le,ct));return le=ae.pop(),J(Ct,le,oe),D}function J(D,W,oe){let ae,le=W.match(P);W==="[]"&&Array.isArray(D)?D.push(oe):le?(ae=le.pop(),D[ae]=oe):D[W]=oe}function B(D,W,oe){if(D[W]!=null)return D[W];let ae=oe?[]:{};return J(D,W,ae),ae}function k(D){let W=0,oe=0;for(;W+oe<D.length;)D[W+oe]===void 0&&(oe+=1),D[W]=D[W+oe],W+=1;return D.length=D.length-oe,D}function j(D,W,oe){let ae=y(W),le=ae.pop(),ct=S(D,ae);return ct&&delete ct[le],Array.isArray(ct)&&oe!==!0&&k(ct),D}let I=/\/+/g,G=/~/g,N=/\//g;function z(D,W){if(D.length===0)return W?"#":"";for(let oe=0,ae=D.length;oe<ae;oe+=1)D[oe]=D[oe].replace(G,"~0").replace(N,"~1"),W&&(D[oe]=encodeURIComponent(D[oe]));return((W?"#/":"/")+D.join("/")).replace(I,"/")}function te(D,...W){let oe=[];if(Array.isArray(D))return z(D,arguments[1]===!0);let ae=arguments[arguments.length-1],le=typeof ae=="boolean"?ae:D&&D[0]==="#";for(let Ct=0,hr=arguments.length;Ct<hr;Ct+=1)oe.push.apply(oe,y(arguments[Ct]));let ct=[];for(let Ct=0,hr=oe.length;Ct<hr;Ct+=1)if(oe[Ct]===".."){if(ct.length===0)return le?"#":"";ct.pop()}else ct.push(oe[Ct]);return z(ct,le)}function pe(D){let W=y(D);if(W.length===0)return typeof D=="string"&&D[0]==="#"?["#",W[0]]:["",void 0];if(W.length===1)return D[0]==="#"?["#",W[0]]:["",W[0]];let oe=W.pop();return[te(W,D[0]==="#"),oe]}let be={get:S,set:F,remove:j,join:te,split:y,splitLast:pe,isRoot:a,removeUndefinedItems:k};return o})()},782:(i,s,o)=>{"use strict";let a=o(492);var c;(function(l){l.RULES=[{name:"Grammar",bnf:[["RULE_S*","%Atomic*","EOF"]]},{name:"%Atomic",bnf:[["Production","RULE_S*"]],fragment:!0},{name:"Production",bnf:[["NCName","RULE_S*",'"::="',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*","RULE_EOL+","RULE_S*"]]},{name:"NCName",bnf:[[/[a-zA-Z][a-zA-Z_0-9]*/]]},{name:"Choice",bnf:[["SequenceOrDifference","%_Choice_1*"]],fragment:!0},{name:"%_Choice_1",bnf:[["RULE_WHITESPACE*",'"|"',"RULE_WHITESPACE*","SequenceOrDifference"]],fragment:!0},{name:"SequenceOrDifference",bnf:[["Item","RULE_WHITESPACE*","%_Item_1?"]]},{name:"%_Item_1",bnf:[["Minus","Item"],["Item*"]],fragment:!0},{name:"Minus",bnf:[['"-"']]},{name:"Item",bnf:[["RULE_WHITESPACE*","%Primary","PrimaryDecoration?"]],fragment:!0},{name:"PrimaryDecoration",bnf:[['"?"'],['"*"'],['"+"']]},{name:"DecorationName",bnf:[['"ebnf://"',/[^\x5D#]+/]]},{name:"%Primary",bnf:[["NCName"],["StringLiteral"],["CharCode"],["CharClass"],["SubItem"]],fragment:!0},{name:"SubItem",bnf:[['"("',"RULE_WHITESPACE*","Choice","RULE_WHITESPACE*",'")"']]},{name:"StringLiteral",bnf:[[`'"'`,/[^"]*/,`'"'`],[`"'"`,/[^']*/,`"'"`]],pinned:1},{name:"CharCode",bnf:[['"#x"',/[0-9a-zA-Z]+/]]},{name:"CharClass",bnf:[["'['","'^'?","%RULE_CharClass_1+",'"]"']]},{name:"%RULE_CharClass_1",bnf:[["CharCodeRange"],["CharRange"],["CharCode"],["RULE_Char"]],fragment:!0},{name:"RULE_Char",bnf:[[/\x09/],[/\x0A/],[/\x0D/],[/[\x20-\x5c]/],[/[\x5e-\uD7FF]/],[/[\uE000-\uFFFD]/]]},{name:"CharRange",bnf:[["RULE_Char",'"-"',"RULE_Char"]]},{name:"CharCodeRange",bnf:[["CharCode",'"-"',"CharCode"]]},{name:"RULE_WHITESPACE",bnf:[["%RULE_WHITESPACE_CHAR*"],["Comment","RULE_WHITESPACE*"]]},{name:"RULE_S",bnf:[["RULE_WHITESPACE","RULE_S*"],["RULE_EOL","RULE_S*"]]},{name:"%RULE_WHITESPACE_CHAR",bnf:[[/\x09/],[/\x20/]],fragment:!0},{name:"Comment",bnf:[['"/*"',"%RULE_Comment_Body*",'"*/"']]},{name:"%RULE_Comment_Body",bnf:[['!"*/"',/[^*]/]],fragment:!0},{name:"RULE_EOL",bnf:[[/\x0D/,/\x0A/],[/\x0A/],[/\x0D/]]},{name:"Link",bnf:[["'['","Url","']'"]]},{name:"Url",bnf:[[/[^\x5D:/?#]/,'"://"',/[^\x5D#]+/,"%Url1?"]]},{name:"%Url1",bnf:[['"#"',"NCName"]],fragment:!0}],l.defaultParser=new a.Parser(l.RULES,{debug:!1});let u=/^(!|&)/,d=/(\?|\+|\*)$/,h=/^%/;function f(B,k){if(typeof B=="string"){if(u.test(B))return"";if(h.test(B)){let j=d.exec(B),I=j?j[0]+" ":"";return function(N,z){let te=a.findRuleByName(N,z);return te&&te.bnf.length==1&&te.bnf[0].length==1&&(te.bnf[0][0]instanceof RegExp||te.bnf[0][0][0]=='"'||te.bnf[0][0][0]=="'")}(B,k)?y(B,k)+I:"("+y(B,k)+")"+I}return B}return B.source.replace(/\\(?:x|u)([a-zA-Z0-9]+)/g,"#x$1").replace(/\[\\(?:x|u)([a-zA-Z0-9]+)-\\(?:x|u)([a-zA-Z0-9]+)\]/g,"[#x$1-#x$2]")}function y(B,k){let j=a.findRuleByName(B,k);return j?j.bnf.map(I=>function(G,N){return G.map(z=>f(z,N)).join(" ")}(I,k)).join(" | "):"RULE_NOT_FOUND {"+B+"}"}function S(B){let k=[];return B.grammarRules.forEach(j=>{if(!/^%/.test(j.name)){let I=j.recover?" /* { recoverUntil="+j.recover+" } */":"";k.push(j.name+" ::= "+y(j.name,B)+I)}}),k.join(`
|
|
186
186
|
`)}l.emit=S;let E=0;function C(B){return new RegExp(B.replace(/#x([a-zA-Z0-9]{4})/g,"\\u$1").replace(/#x([a-zA-Z0-9]{3})/g,"\\u0$1").replace(/#x([a-zA-Z0-9]{2})/g,"\\x$1").replace(/#x([a-zA-Z0-9]{1})/g,"\\x0$1"))}function P(B,k,j){let I=null,G=[];return k.children.forEach((N,z)=>{N.type=="Minus"&&function(pe,be){throw console.log("reberia restar "+be+" a "+pe),new Error("Difference not supported yet")}(I,N);let te=k.children[z+1];switch(te=te&&te.type=="PrimaryDecoration"&&te.text||"",N.type){case"SubItem":let pe="%"+(j+E++);q(B,N,pe),G.push(""+pe+te);break;case"NCName":case"StringLiteral":G.push(""+N.text+te);break;case"CharCode":case"CharClass":if(te){let be={name:"%"+(j+E++),bnf:[[C(N.text)]]};B.push(be),G.push(""+be.name+te)}else G.push(C(N.text));break;case"PrimaryDecoration":break;default:throw new Error(" HOW SHOULD I PARSE THIS? "+N.type+" -> "+JSON.stringify(N.text))}I=N}),G}function q(B,k,j){let I=k.children.filter(z=>z.type=="SequenceOrDifference").map(z=>P(B,z,j)),G={name:j,bnf:I},N=null;I.forEach(z=>{N=N||z.recover,delete z.recover}),j.indexOf("%")==0&&(G.fragment=!0),N&&(G.recover=N),B.push(G)}function F(B,k=l.defaultParser){let j=k.getAST(B);if(!j)throw new Error("Could not parse "+B);if(j.errors&&j.errors.length)throw j.errors[0];let I=[];return j.children.filter(G=>G.type=="Production").map(G=>{let N=G.children.filter(z=>z.type=="NCName")[0].text;q(I,G,N)}),I}l.getRules=F,l.Transform=function(B,k=l.defaultParser){return F(B.join(""),k)};class J extends a.Parser{constructor(k,j){super(F(k,j&&j.debugRulesParser===!0?new a.Parser(l.RULES,{debug:!0}):l.defaultParser),j)}emitSource(){return S(this)}}l.Parser=J})(c||(c={})),s.A=c},492:(i,s,o)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),s.Parser=s.findRuleByName=s.parseRuleName=s.escapeRegExp=s.readToken=void 0;let a=/^[A-Z0-9_]+$/,c=/(\?|\+|\*)$/,l=/^(@|&|!)/,u="WS",d=o(594);function h(B,k){let j=k.exec(B);return j&&j.index==0?j[0].length==0&&k.source.length>0?null:{type:null,text:j[0],rest:B.substr(j[0].length),start:0,end:j[0].length-1,fullText:j[0],errors:[],children:[],parent:null}:null}function f(B){return B.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function y(B){B.rest="",B.children&&B.children.forEach(k=>y(k))}function S(B,k){B.start+=k,B.end+=k,B.children&&B.children.forEach(j=>S(j,B.start))}function E(B,k){k.errors&&k.errors.length&&k.errors.forEach(j=>B.push(j)),k.children&&k.children.forEach(j=>E(B,j))}function C(B){let k=c.exec(B),j=l.exec(B),I=k&&k[0]||"",G=j&&j[0]||"",N={raw:B,name:B.replace(c,"").replace(l,""),isOptional:I=="?"||I=="*",allowRepetition:I=="+"||I=="*",atLeastOne:I=="+",lookupPositive:G=="&",lookupNegative:G=="!",pinned:G=="@",lookup:!1,isLiteral:!1};return N.isLiteral=N.name[0]=="'"||N.name[0]=='"',N.lookup=N.lookupNegative||N.lookupPositive,N}function P(B,k){let j=C(B);return k.cachedRules[j.name]||null}function q(B,k){if(B.children){let j=B.children.filter(I=>I.type&&k.test(I.type));for(let I=0;I<j.length;I++){let G=B.children.indexOf(j[I]);G!=-1&&B.children.splice(G,1)}B.children.forEach(I=>q(I,k))}}s.readToken=h,s.escapeRegExp=f,s.parseRuleName=C,s.findRuleByName=P;let F=["EOF"];class J{constructor(k,j){this.grammarRules=k,this.options=j,this.cachedRules={},this.debug=!!j&&j.debug===!0;let I=[],G=[];if(k.forEach(N=>{let z=C(N.name);if(z.name in this.cachedRules)I.push("Duplicated rule "+z.name);else{if(this.cachedRules[z.name]=N,N.bnf&&N.bnf.length)N.bnf.forEach(te=>{if(typeof te[0]=="string"&&C(te[0]).name==N.name){let pe="Left recursion is not allowed, rule: "+N.name;I.indexOf(pe)==-1&&I.push(pe)}te.forEach(pe=>{if(typeof pe=="string"){let be=C(pe);be.isLiteral||G.indexOf(be.name)!=-1||F.indexOf(be.name)!=-1||G.push(be.name)}})});else{let te="Missing rule content, rule: "+N.name;I.indexOf(te)==-1&&I.push(te)}u==N.name&&(N.implicitWs=!1),N.implicitWs&&G.indexOf(u)==-1&&G.push(u),N.recover&&G.indexOf(N.recover)==-1&&G.push(N.recover)}}),G.forEach(N=>{N in this.cachedRules||I.push("Missing rule "+N)}),I.length)throw new Error(I.join(`
|
|
187
187
|
`))}getAST(k,j){j||(j=this.grammarRules.filter(G=>!G.fragment&&G.name.indexOf("%")!=0)[0].name);let I=this.parse(k,j);if(I){E(I.errors,I),S(I,0),q(I,/^%/),this.options&&this.options.keepUpperRules||q(I,a);let G=I.rest;G&&new d.TokenError(`Unexpected end of input:
|
|
188
188
|
`+G,I),y(I),I.rest=G}return I}emitSource(){return"CANNOT EMIT SOURCE FROM BASE Parser"}parse(k,j,I=0){let G,N=null,z=C(j),te=this.debug&&!a.test(z.name);te&&console.log(new Array(I).join("\u2502 ")+"Trying to get "+j+" from "+JSON.stringify(k.split(`
|