/*-
 * ~~~~~~licensing~~~~~~
 * atlasmap-entaxy-ui
 * ==========
 * Copyright (C) 2020 - 2025 EmDev LLC
 * ==========
 * You may not use this file except in accordance with the License Terms of the Copyright
 * Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
 * rights to the Software and any copies are the property of the Copyright Holder. Unless
 * it is explicitly allowed the Copyright Holder, the User is prohibited from using the
 * Software for commercial purposes to provide services to third parties.
 * 
 * The Copyright Holder hereby declares that the Software is provided on an "AS IS".
 * Under no circumstances does the Copyright Holder guarantee or promise that the
 * Software provided by him will be suitable or not suitable for the specific purposes
 * of the User, that the Software will meet all commercial and personal subjective
 * expectations of the User, that the Software will work properly, without technical
 * errors, quickly and uninterruptedly.
 * 
 * Under no circumstances shall the Copyright Holder or its Affiliates is not liable
 * to the User for any direct or indirect losses of the User, his expenses or actual
 * damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
 * or damage to data, property, etc.
 * ~~~~~~/licensing~~~~~~
 */
(this["webpackJsonp@atlasmap/standalone"]=this["webpackJsonp@atlasmap/standalone"]||[]).push([[0],{359:function(e,t,n){e.exports=n(596)},360:function(e,t,n){},361:function(e,t,n){"use strict";var i=n(38);Object.defineProperty(t,"__esModule",{value:!0});var a,r,o,l,s,c,u,p,d=n(362),f=n(595),m=n(363),g=(a=n(364))&&"object"==i(a)&&"default"in a?a.default:a,v=n(365),h=n(333);(r=t.DataSourceType||(t.DataSourceType={})).SOURCE="SOURCE",r.TARGET="TARGET",(o=t.CollectionType||(t.CollectionType={})).ALL="ALL",o.ARRAY="ARRAY",o.LIST="LIST",o.MAP="MAP",o.NONE="NONE",(l=t.FieldStatus||(t.FieldStatus={})).SUPPORTED="SUPPORTED",l.UNSUPPORTED="UNSUPPORTED",l.CACHED="CACHED",l.ERROR="ERROR",l.NOT_FOUND="NOT_FOUND",l.EXCLUDED="EXCLUDED",(s=t.FieldType||(t.FieldType={})).ANY="ANY",s.ANY_DATE="ANY_DATE",s.BIG_INTEGER="BIG_INTEGER",s.BOOLEAN="BOOLEAN",s.BYTE="BYTE",s.BYTE_ARRAY="BYTE_ARRAY",s.CHAR="CHAR",s.COMPLEX="COMPLEX",s.DATE="DATE",s.DATE_TIME="DATE_TIME",s.DATE_TIME_TZ="DATE_TIME_TZ",s.DATE_TZ="DATE_TZ",s.DECIMAL="DECIMAL",s.DOUBLE="DOUBLE",s.FLOAT="FLOAT",s.INTEGER="INTEGER",s.LONG="LONG",s.NONE="NONE",s.NUMBER="NUMBER",s.SHORT="SHORT",s.STRING="STRING",s.TIME="TIME",s.TIME_TZ="TIME_TZ",s.UNSIGNED_BYTE="UNSIGNED_BYTE",s.UNSIGNED_INTEGER="UNSIGNED_INTEGER",s.UNSIGNED_LONG="UNSIGNED_LONG",s.UNSIGNED_SHORT="UNSIGNED_SHORT",s.UNSUPPORTED="UNSUPPORTED",(c=t.DocumentType||(t.DocumentType={})).JAVA="JAVA",c.XML="XML",c.XSD="XSD",c.JSON="JSON",c.CORE="Core",c.CSV="CSV",c.CONSTANT="Constants",c.PROPERTY="Property",(u=t.InspectionType||(t.InspectionType={})).JAVA_CLASS="JAVA_CLASS",u.SCHEMA="SCHEMA",u.INSTANCE="INSTANCE",u.UNKNOWN="UNKNOWN",(p=t.DocumentDefaultName||(t.DocumentDefaultName={})).CONSTANTS="Constants",p.PROPERTIES="Properties";var E,y,b,S,F,T,C=[[t.CollectionType[t.CollectionType.ARRAY],"Array"],[t.CollectionType[t.CollectionType.LIST],"List"],[t.CollectionType[t.CollectionType.MAP],"Map"],[t.CollectionType[t.CollectionType.NONE],"None"]],M=[["STRING","String"],["BOOLEAN","Boolean"],["BIG_INTEGER","Big Integer"],["BYTE","Byte"],["BYTE_ARRAY","ByteArray"],["CHAR","Char"],["COMPLEX","Complex"],["DECIMAL","Decimal"],["DOUBLE","Double"],["FLOAT","Float"],["INTEGER","Integer"],["LONG","Long"],["SHORT","Short"],["TIME","Time"],["DATE","Date"],["DATE_TIME","DateTime"],["DATE_TZ","DateTZ"],["TIME_TZ","TimeTZ"],["DATE_TIME_TZ","DateTimeTZ"],["UNSIGNED_BYTE","Unsigned Byte"],["UNSIGNED_INTEGER","Unsigned Integer"],["UNSIGNED_LONG","Unsigned Long"],["UNSIGNED_SHORT","Unsigned Short"]],O=[["STRING","String"],["ANY","Any"],["BOOLEAN","Boolean"],["BIG_INTEGER","Big Integer"],["BYTE","Byte"],["BYTE_ARRAY","ByteArray"],["CHAR","Char"],["COMPLEX","Complex"],["DECIMAL","Decimal"],["DOUBLE","Double"],["FLOAT","Float"],["INTEGER","Integer"],["LONG","Long"],["SHORT","Short"],["TIME","Time"],["DATE","Date"],["DATE_TIME","DateTime"],["DATE_TZ","DateTZ"],["TIME_TZ","TimeTZ"],["DATE_TIME_TZ","DateTimeTZ"],["UNSIGNED_BYTE","Unsigned Byte"],["UNSIGNED_INTEGER","Unsigned Integer"],["UNSIGNED_LONG","Unsigned Long"],["UNSIGNED_SHORT","Unsigned Short"]];function A(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function D(e,t,n){return t&&A(e.prototype,t),n&&A(e,n),e}function N(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function x(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return I(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(E=t.Modifier||(t.Modifier={})).ALL="ALL",E.ABSTRACT="ABSTRACT",E.FINAL="FINAL",E.INTERFACE="INTERFACE",E.NATIVE="NATIVE",E.PACKAGE_PRIVATE="Package Private",E.PUBLIC="PUBLIC",E.PROTECTED="PROTECTED",E.PRIVATE="PRIVATE",E.STATIC="STATIC",E.STRICT="STRICT",E.SYNCHRONIZED="SYNCHRONIZED",E.TRANSIENT="TRANSIENT",E.VOLATILE="VOLATILE",E.NONE="NONE",(y=t.Multiplicity||(t.Multiplicity={})).ONE_TO_ONE="ONE_TO_ONE",y.ONE_TO_MANY="ONE_TO_MANY",y.MANY_TO_ONE="MANY_TO_ONE",y.ZERO_TO_ONE="ZERO_TO_ONE",y.MANY_TO_MANY="MANY_TO_MANY",(b=t.MappingType||(t.MappingType={})).ALL="ALL",b.COLLECTION="COLLECTION",b.COMBINE="COMBINE",b.LOOKUP="LOOKUP",b.MAP="MAP",b.SEPARATE="SEPARATE",b.NONE="NONE",(S=t.ValidationScope||(t.ValidationScope={})).DATA_SOURCE="DATA_SOURCE",S.MAPPING="MAPPING",S.LOOKUP_TABLE="LOOKUP_TABLE",S.CONSTANT="CONSTANT",S.PROPERTY="PROPERTY",(F=t.ValidationStatus||(t.ValidationStatus={})).INFO="INFO",F.WARN="WARN",F.ERROR="ERROR",(T=t.AuditStatus||(t.AuditStatus={})).INFO="INFO",T.WARN="WARN",T.ERROR="ERROR";var P=function(){function e(){}return e.removeItemFromArray=function(e,t){if(null==e||null==t||0===t.length)return!1;for(var n=0,i=!1;n<t.length;)t[n]===e?(t.splice(n,1),i=!0):n++;return i},e.splitByString=function(e,t){var n=0,i=0,a=null,r=t.length,o=[];if(null===e||0===e.length||null===t||0===r)return[];for(;-1!==n;)n=e.indexOf(t),i=e.indexOf(t,n+1),a=e.substring(n,i),o.push(a),e=e.substring(i+r);return o},e.str2bytes=function(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t},e.readFile=function(e,t){try{return Promise.resolve(new Promise((function(n){t.onload=function(){n(t.result)},t.readAsText(e)})))}catch(e){return Promise.reject(e)}},e.readBinaryFile=function(e,t){try{return Promise.resolve(new Promise((function(n){t.onload=function(){var e=new Int8Array(t.result);n(e)},t.readAsArrayBuffer(e)})))}catch(e){return Promise.reject(e)}},e.writeFile=function(e,t){try{return Promise.resolve(new Promise((function(n){d.saveAs(e,t),n(!0)})))}catch(e){return Promise.reject(e)}},e.toDisplayable=function(e){if(void 0===e||!e||e.indexOf(" ")>=0)return e;for(var t=e.charAt(0).toUpperCase(),n=1;n<e.length;n++){var i=e.charAt(n);i!==i.toLowerCase()&&(t+=" "),t+=i}return t},e.extractDisplayPath=function(e,t){var n=t-4;if(!e||n<=0)return"";if(e.length<=n)return e;var i=e.split("/"),a="/"+i[i.length-1];return a.length>=n?a.substr(0,n):e.substr(0,n-a.length)+"..."+a},e.sanitizeJSON=function(e){return JSON.stringify(e).replace(/[\u007F-\uFFFF]/g,(function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).substr(-4)}))},e.objectize=function(e){return"string"==typeof e?JSON.parse(e):e},e.urlWithParameters=function(e,t){var n=new URL(e),i=[];return n.searchParams.forEach((function(e,t){return i.push(t)})),i.forEach((function(e){return n.searchParams.delete(e)})),new URLSearchParams(t).forEach((function(e,t){return n.searchParams.append(t,e)})),n.toString()},e}(),w=function(){},R=function(){function e(){this.documentField={jsonType:""},this.partOfMapping=!1,this.partOfTransformation=!1,this.visibleInCurrentDocumentSearch=!0,this.enumeration=!1,this.enumValues=[],this.children=[],this.fieldDepth=0,this.collapsed=!0,this.hasUnmappedChildren=!1,this.isCollection=!1,this.isArray=!1,this.isAttribute=!1,this.isPrimitive=!1,this.userCreated=!1,this.uuid=e.uuidCounter.toString(),e.uuidCounter++}e.fieldHasUnmappedChild=function(t){if(null==t)return!1;if(t.isTerminal())return!1===t.partOfMapping;for(var n,i=x(t.children);!(n=i()).done;){var a=n.value;if(a.hasUnmappedChildren||e.fieldHasUnmappedChild(a))return!0}return!1},e.getFieldPaths=function(e){for(var t,n=[],i=x(e);!(t=i()).done;)n.push(t.value.path);return n},e.getFieldNames=function(e){for(var t,n=[],i=x(e);!(t=i()).done;)n.push(t.value.name);return n},e.getField=function(e,t){return t.find((function(t){return e===t.path}))},e.alphabetizeFields=function(e){for(var t,n={},i=[],a=x(e);!(t=a()).done;){var r=t.value,o=r.path;null==n[o]&&(n[o]=r,i.push(o))}i.sort(),e.length=0;for(var l=0,s=i;l<s.length;l++)e.push(n[s[l]]);for(var c,u=x(e);!(c=u()).done;){var p=c.value;p.children&&p.children.length&&this.alphabetizeFields(p.children)}};var n=e.prototype;return n.expandToRoot=function(){for(var e=this;null!=e;)e.collapsed=!1,e.isPropertyOrConstant()&&e.docDef&&(e.docDef.showFields=!0),e=e.parentField},n.getNameWithNamespace=function(){return this.namespaceAlias?this.namespaceAlias+":"+this.name:this.name},n.isParentField=function(){return!(!this.isCollection||this.isPrimitive)||"COMPLEX"===this.type},n.isStringField=function(){return"STRING"===this.type},n.isTerminal=function(){return!!this.enumeration||!(this.isCollection&&!this.isPrimitive)&&"COMPLEX"!==this.type},n.copy=function(){var t=new e;Object.assign(t,this),t.documentField=this.documentField,t.parentField=this.parentField,t.docDef=this.docDef,t.children=[];for(var n,i=x(this.children);!(n=i()).done;)t.children.push(n.value.copy());return t},n.copyFrom=function(e){Object.assign(this,e),this.documentField=e.documentField,this.parentField=e.parentField,this.docDef=e.docDef,this.children=[];for(var t,n=x(e.children);!(t=n()).done;)this.children.push(t.value.copy())},n.getCollectionParentField=function(){for(var e=this;null!=e;){if(e.isCollection)return e;e=e.parentField}},n.isInCollection=function(){return null!=this.getCollectionParentField()},n.getCollectionCount=function(){for(var e=0,t=this;null!=t;)t.isCollection&&e++,t=t.parentField;return e},n.isSource=function(){return null!=this.docDef&&this.docDef.isSource},n.getCollectionType=function(){return this.isCollection?this.isArray?"ARRAY":"LIST":null},n.getFieldLabel=function(e,t){var n="";if(t)n=this.path;else{var i=this.path.split("/");n=this.isAttribute&&i.length>0&&i[i.length-1].startsWith("@")?this.path.split("@")[1]:this.getNameWithNamespace()}return e&&this.type&&!this.isPropertyOrConstant()?n+=" ("+this.type+")":this.isProperty()&&null!=this.value&&(n+=" = "+this.value,e&&this.type&&(n+=" ("+this.type+")")),n||this.parentField||(n="< Document Root >"),n},n.isPropertyOrConstant=function(){return null!=this.docDef&&this.docDef.isPropertyOrConstant},n.isProperty=function(){return null!=this.docDef&&this.docDef.type===t.DocumentType.PROPERTY},n.isConstant=function(){return null!=this.docDef&&this.docDef.type===t.DocumentType.CONSTANT},e}();R.uuidCounter=0;var _,j,k,L=function(){function e(){this.createdByUser=!1,this.isTarget=!1}e.getUnqualifiedNamespace=function(){if(null==e.unqualifiedNamespace){var t=new e;t.alias="Unqualified",e.unqualifiedNamespace=t}return e.unqualifiedNamespace};var t=e.prototype;return t.getPrettyLabel=function(){return this===e.getUnqualifiedNamespace()?this.alias:(this.isTarget?"Target":this.alias)+" ["+(null==this.uri?"NO URI":this.uri)+"]"},t.copy=function(){var t=new e;return Object.assign(t,this),t},t.copyFrom=function(e){Object.assign(this,e)},e}(),U=function(e){function n(n){var i;return(i=e.call(this)||this)._isSource=n,i.name="<padding field>",i.classIdentifier="<padding field>",i.type=t.FieldType.NONE,i.displayName="<padding field>",i.path="",i}return N(n,e),n.prototype.isSource=function(){return this._isSource},n}(R),V=function(){function e(){this.LEFT_BRACKET="[",this.RIGHT_BRACKET="]",this.initialized=!1,this.errorOccurred=!1,this.fields=[],this.allFields=[],this.terminalFields=[],this.complexFieldsByClassIdentifier={},this.enumFieldsByClassIdentifier={},this.fieldsByPath={},this.fieldPaths=[],this.showFields=!0,this.visibleInCurrentDocumentSearch=!0,this.namespaces=[]}var n=e.prototype;return n.getComplexField=function(e){return this.complexFieldsByClassIdentifier[e]},n.getEnumField=function(e){return this.enumFieldsByClassIdentifier[e]},n.getAllFields=function(){return[].concat(this.allFields)},n.fieldExists=function(e,t){for(var n,i=x(this.getAllFields());!(n=i()).done;){var a=n.value;if(a.name===e.name&&a.docDef.type===t)return!0}return!1},n.isFieldsExist=function(e){if(null==e||0===e.length)return!0;var t=this.getFields(R.getFieldPaths(e));return null!=t&&e.length===t.length},n.getFields=function(e){for(var t,n=[],i=x(e);!(t=i()).done;){var a=this.getField(t.value);null!=a&&n.push(a)}return n},n.getName=function(e){var t=this.name;if(e&&!this.isPropertyOrConstant){var n=this.type;n&&(t+=" ("+n+")")}return t},n.getNamespaceForAlias=function(e){return this.namespaces.find((function(t){return e===t.alias}))},n.getField=function(e){if(!e)return null;var t=this.fieldsByPath[e],n=e;if(null!=n&&0===n.indexOf("/")&&(n=n.substring(1)),null==t&&-1!==n.indexOf("/")){for(var i="";-1!==n.indexOf("/");){var a=n.substr(0,n.indexOf("/")),r=this.fieldsByPath[i+="/"+a];if(null==r){if(-1!==n.indexOf("/")){n=n.substr(n.indexOf("/")+1);continue}break}this.populateChildren(r),-1!==n.indexOf("/")&&(n=n.substr(n.indexOf("/")+1))}t=this.fieldsByPath[e]}return t},n.getComplexFields=function(){return this.discoverAllComplexFields(this.fields)},n.getTerminalFields=function(){return[].concat(this.terminalFields)},n.initializeFromFields=function(){this.type===t.DocumentType.JAVA&&this.prepareComplexFields();for(var e,n=x(this.fields);!(e=n()).done;){var i=e.value;this.populateFieldData(i),this.allFields.push(i),this.populateChildren(i)}this.initialized=!0},n.updateField=function(e,t){null!=t&&t.length>0&&null!=this.fieldsByPath[t]?(delete this.fieldsByPath[t],P.removeItemFromArray(t,this.fieldPaths)):P.removeItemFromArray(e.path,this.fieldPaths),this.populateFieldData(e)},n.addField=function(e){!e.parentField||this.isPropertyOrConstant?this.fields.push(e):(this.populateChildren(e.parentField),e.parentField.children.push(e)),this.populateFieldData(e),this.allFields.push(e)},n.populateChildren=function(e){if(e.isTerminal()||e.children.length>0)return!0;var t=this.getComplexField(e.classIdentifier);if(null==t)return!1;for(var n,i=x((t=t.copy()).children);!(n=i()).done;){var a=n.value;(a=a.copy()).parentField=e,this.rewriteFieldPath(a),this.populateFieldData(a),e.children.push(a)}return e.children.length>0},n.rewriteFieldPath=function(e){var t=e.parentField,n=e.path.split("/");e.path=t.path+"/"+n.slice(-1)[0];for(var i,a=x(e.children);!(i=a()).done;)this.rewriteFieldPath(i.value)},n.clearFields=function(){this.initialized=!1,this.fields=[],this.allFields=[],this.terminalFields=[],this.fieldPaths=[],this.namespaces=[],this.fieldsByPath={},this.complexFieldsByClassIdentifier={},this.enumFieldsByClassIdentifier={}},n.getFieldIndex=function(e,t){for(var n=0;n<t.length;n++)if(t[n].path===e.path)return n;return-1},n.removeField=function(e){if(null!=e){var t=this.getFieldIndex(e,this.fields);t>-1&&this.fields.splice(t,1),(t=this.getFieldIndex(e,this.allFields))>-1&&this.allFields.splice(t,1),(t=this.getFieldIndex(e,this.terminalFields))>-1&&this.terminalFields.splice(t,1);var n=e.path;P.removeItemFromArray(n,this.fieldPaths),delete this.fieldsByPath[n],null!=e.parentField&&P.removeItemFromArray(e,e.parentField.children)}},n.updateFromMappings=function(e){if(null!==e){for(var t,n=x(this.allFields);!(t=n()).done;){var i=t.value;i.partOfMapping=!1,i.hasUnmappedChildren=!1,i.partOfTransformation=!1}for(var a,r=x(e.getAllMappings(!0));!(a=r()).done;)for(var o,l=a.value,s=x(l.getAllFields());!(o=s()).done;)for(var c=o.value,u=c,p=l.getMappedFieldForField(c).actions.length>0;null!=u;)u.partOfMapping=!0,u.partOfTransformation=u.partOfTransformation||p,u=u.parentField;for(var d,f=x(this.allFields);!(d=f()).done;){var m=d.value;m.hasUnmappedChildren=R.fieldHasUnmappedChild(m)}}},n.populateFieldData=function(e){e.docDef=this;var t=e.path;if(this.fieldPaths.push(t),this.fieldsByPath[t]=e,e.enumeration&&(this.enumFieldsByClassIdentifier[e.classIdentifier]=e),e.isTerminal())this.terminalFields.push(e);else for(var n,i=x(e.children);!(n=i()).done;){var a=n.value;this.populateFieldData(a),this.allFields.push(a)}},n.prepareComplexFields=function(){var e=this.fields;for(var t in this.discoverComplexFields(e),this.complexFieldsByClassIdentifier)if(this.complexFieldsByClassIdentifier.hasOwnProperty(t))for(var n,i=x(this.complexFieldsByClassIdentifier[t].children);!(n=i()).done;)n.value.children=[]},n.discoverAllComplexFields=function(e){for(var t,n=[],i=x(e);!(t=i()).done;){var a=t.value;"COMPLEX"!==a.type||"SUPPORTED"!==a.documentField.status&&"CACHED"!==a.documentField.status||n.push(a.copy()),a.children&&(n=n.concat(this.discoverAllComplexFields(a.children)))}return n},n.discoverComplexFields=function(e){for(var t,n=x(e);!(t=n()).done;){var i=t.value;"COMPLEX"===i.type&&("SUPPORTED"===i.documentField.status&&(this.complexFieldsByClassIdentifier[i.classIdentifier]=i.copy()),i.children&&this.discoverComplexFields(i.children))}},D(e,[{key:"type",get:function(){return this._type},set:function(e){this._type=e,this.isPropertyOrConstant=e===t.DocumentType.CONSTANT||e===t.DocumentType.PROPERTY}}]),e}(),z=function(){this.dataMapperVersion="",this.initialized=!1,this.loadingStatus="Loading.",this.admHttpTimeout=3e4,this.initializationErrorOccurred=!1,this.classPathFetchTimeoutInMilliseconds=3e4,this.fieldNameExclusions=[],this.classNameExclusions=[],this.disablePrivateOnlyFields=!1,this.disableProtectedOnlyFields=!1,this.disablePublicOnlyFields=!1,this.disablePublicGetterSetterFields=!1,this.disableMappingPreviewMode=!1,this.disableNavbar=!0,this.mappingInitialized=!1},B=function(){this.showFields=!0},J=function(){function e(){this.initCfg=new z,this.showMappingDetailTray=!1,this.showMappingTable=!1,this.showNamespaceTable=!1,this.showLinesAlways=!0,this.showTypes=!1,this.showMappedFields=!0,this.showUnmappedFields=!0,this._showMappingPreview=!1,this.currentDraggedField=null,this.openedArchiveFileLocation=null,this.hideImport=!1,this.hideExport=!1,this.sourceDocs=[],this.targetDocs=[],this.sourcePropertyDoc=new V,this.targetPropertyDoc=new V,this.constantDoc=new V,this.mappingFiles=[],this.mappingDefinitionId=0,this.mappings=null,this.preloadedMappingJson=null,this.setConstantPropertyDocs()}e.getConfig=function(){return e.cfg},e.setConfig=function(t){e.cfg=t};var n=e.prototype;return n.initializePropertyDoc=function(e,n){e.clearFields(),e.type=t.DocumentType.PROPERTY,e.name=t.DocumentDefaultName.PROPERTIES,e.id="DOC."+e.name+"."+Math.floor(1e6*Math.random()+1).toString(),e.isSource=n,e.showFields=!1,e.isPropertyOrConstant=!0},n.setConstantPropertyDocs=function(){this.initializePropertyDoc(this.sourcePropertyDoc,!0),this.initializePropertyDoc(this.targetPropertyDoc,!1),this.constantDoc.clearFields(),this.constantDoc.type=t.DocumentType.CONSTANT,this.constantDoc.name=t.DocumentDefaultName.CONSTANTS,this.constantDoc.id="DOC."+this.constantDoc.name+"."+Math.floor(1e6*Math.random()+1).toString(),this.constantDoc.isSource=!0,this.constantDoc.showFields=!1,this.constantDoc.isPropertyOrConstant=!0},n.addDocument=function(e){var n=new V;return n.initModel=e,n.id=e.id,n.type=e.type,n.name=e.name,n.description=e.description,n.isSource=e.isSource,n.showFields=e.showFields,n.inspectionType=e.inspectionType,n.inspectionSource=e.inspectionSource,n.inspectionResult=e.inspectionResult,n.inspectionParameters=e.inspectionParameters,n.selectedRoot=e.selectedRoot,n.type===t.DocumentType.XSD?n.uri="atlas:xml:"+n.id:n.type===t.DocumentType.JAVA?(n.uri="atlas:java:"+n.id+"?className="+n.inspectionSource,e.collectionType&&e.collectionType!==t.CollectionType.NONE&&(n.uri+="&collectionType="+e.collectionType,e.collectionClassName&&(n.uri+="&collectionClassName="+e.collectionClassName))):n.uri="atlas:"+n.type.toLowerCase()+":"+n.id,e.isSource?this.sourceDocs.push(n):this.targetDocs.push(n),n},n.addDocuments=function(e){for(var t,n=[],i=x(e);!(t=i()).done;)n.push(this.addDocument(t.value));return n},n.getDocsWithoutPropertyDoc=function(e){return[].concat(e?this.sourceDocs:this.targetDocs)},n.getDocs=function(e){var t=this.getDocsWithoutPropertyDoc(e);return e?[this.sourcePropertyDoc,this.constantDoc].concat(t):[this.targetPropertyDoc].concat(t)},n.clearDocs=function(){this.sourceDocs=[],this.targetDocs=[],this.sourcePropertyDoc.clearFields(),this.targetPropertyDoc.clearFields(),this.constantDoc.clearFields(),this.mappingFiles=[]},n.hasJavaDocuments=function(){for(var e,n=x(this.getAllDocs());!(e=n()).done;)if(e.value.type===t.DocumentType.JAVA)return!0;return!1},n.getDocForIdentifier=function(e,t){return this.getDocs(t).find((function(t){return t.id===e}))},n.getFirstXmlDoc=function(e){return this.getDocsWithoutPropertyDoc(e).find((function(e){return e.type===t.DocumentType.XML}))},n.getAllDocs=function(){return[this.sourcePropertyDoc,this.constantDoc].concat(this.sourceDocs).concat(this.targetPropertyDoc).concat(this.targetDocs)},n.documentsAreLoaded=function(){for(var e,t=x(this.getAllDocs());!(e=t()).done;)if(!e.value.initialized)return!1;return!0},D(e,[{key:"showMappingPreview",get:function(){return this._showMappingPreview},set:function(e){this._showMappingPreview=e}}]),e}();J.cfg=new J,(_=t.ErrorLevel||(t.ErrorLevel={})).DEBUG="DEBUG",_.INFO="INFO",_.WARN="WARN",_.ERROR="ERROR",(j=t.ErrorScope||(t.ErrorScope={})).APPLICATION="APPLICATION",j.DATA_SOURCE="DATA_SOURCE",j.LOOKUP_TABLE="LOOKUP_TABLE",j.MAPPING="MAPPING",j.FIELD="FIELD",j.FORM="FORM",j.CONSTANT="CONSTANT",j.PROPERTY="PROPERTY",(k=t.ErrorType||(t.ErrorType={})).INTERNAL="INTERNAL",k.USER="USER",k.VALIDATION="VALIDATION",k.PREVIEW="PREVIEW",k.FORM="FORM";var G=function(){function e(t){this._identifier=e.errorIdentifierCounter.toString(),e.errorIdentifierCounter++,Object.assign(this,t)}return D(e,[{key:"identifier",get:function(){return this._identifier}}]),e}();G.errorIdentifierCounter=0;var H=function(){};H.pom='\n    <project xmlns="http://maven.apache.org/POM/4.0.0"\n        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\n\n        <modelVersion>4.0.0</modelVersion>\n        <groupId>foo.bar</groupId>\n        <artifactId>test.model</artifactId>\n        <version>1.10.0</version>\n        <packaging>jar</packaging>\n        <name>Test :: Model</name>\n\n        <dependencies>\n            <dependency>\n                <groupId>com.fasterxml.jackson.core</groupId>\n                <artifactId>jackson-annotations</artifactId>\n                <version>2.8.5</version>\n            </dependency>\n            <dependency>\n                <groupId>com.fasterxml.jackson.core</groupId>\n                <artifactId>jackson-databind</artifactId>\n                <version>2.8.5</version>\n            </dependency>\n            <dependency>\n                <groupId>com.fasterxml.jackson.core</groupId>\n                <artifactId>jackson-core</artifactId>\n                <version>2.8.5</version>\n            </dependency>\n        </dependencies>\n    </project>\n  ';var q=function(e,t){this.node=e,this.offset=t},Y=function(){function e(t){this.uuid=t+e.sequence++}return e.prototype.getUuid=function(){return this.uuid},e}();Y.sequence=0;var X=function(e){function t(n){var i;return(i=e.call(this,t.PREFIX)||this).str=n,i}N(t,e);var n=t.prototype;return n.toText=function(){return this.str},n.toHTML=function(){return'<span id="'+this.uuid+'">'+this.str.replace(/ /g,"&nbsp;")+"</span>"},t}(Y);X.PREFIX="expression-text-";var W=function(e){function t(n,i,a,r,o){var l;if(void 0===r&&(r=0),(l=e.call(this,t.PREFIX)||this).mapping=n,l.mappedField=i,l.metaStr=a,l.collectionContextPath=o,!i){if(a){var s=a.split(":");l.mappedField=1===s.length?n.getMappedFieldByPath(o?o+s[0]:s[0],!0):n.getMappedFieldByPath(s[1],!0,s[0]),l.mappedField||(l.mappedField=n.getReferenceField(s[0],s[1]))}else{var c;l.mappedField=n.getMappedFieldForIndex(null===(c=r+1)||void 0===c?void 0:c.toString(),!0)}i=l.mappedField}return l}N(t,e);var n=t.prototype;return n.toText=function(){if(!this.mappedField||!this.mappedField.field)return"";if(this.mappedField.field.enumeration)return'"'+this.mappedField.field.enumValues[this.mappedField.field.enumIndexValue?this.mappedField.field.enumIndexValue:0].name+'"';var e,t="${";return this.mappedField.field.parentField&&this.mappedField.field.parentField===(null===(e=this.mapping.referenceFields[0])||void 0===e?void 0:e.field)?t+="/"+this.mappedField.field.name+"}":t+=this.mappedField.field.docDef.id+":"+this.mappedField.field.path+"}",t},n.toHTML=function(){if(this.mappedField&&this.mappedField.field){var e="",t=this.mappedField.field.name;return this.mappedField.field.enumeration&&(t+="."+this.mappedField.field.enumValues[this.mappedField.field.enumIndexValue?this.mappedField.field.enumIndexValue:0].name,e=":  Click to select an enumeration value."),'<span style="font-weight:bold" contenteditable="false" id="'+this.uuid+'" title="'+this.mappedField.field.docDef.name+":"+this.mappedField.field.path+e+'"\n        class="expressionFieldLabel label label-default">'+t+"</span>"}return'<span contenteditable="false" id="'+this.uuid+'"\n        title="Field index \''+(this.mapping.getIndexForMappedField(this.mappedField)-1)+'\' is not available"\n        class="expressionFieldLabel label label-danger">N/A</span>'},n.hasComplexField=function(){var e,t,n,i,a,r;return"COMPLEX"===(null===(e=this.mappedField)||void 0===e||null===(t=e.field)||void 0===t?void 0:t.documentField.fieldType)&&("SUPPORTED"===(null===(n=this.mappedField)||void 0===n||null===(i=n.field)||void 0===i?void 0:i.documentField.status)||"CACHED"===(null===(a=this.mappedField)||void 0===a||null===(r=a.field)||void 0===r?void 0:r.documentField.status))},t}(Y);W.PREFIX="expression-field-";var K,Z,$=function(){function e(e,t){this.mapping=e,this.cfg=t,this.expressionHTML="",this.expressionUpdatedSource=new f.Subject,this.expressionUpdated$=this.expressionUpdatedSource.asObservable(),this._nodes=[],this.textCache=""}var n=e.prototype;return n.generateInitialExpression=function(){var e=this;this.mapping.getUserMappedFields(!0).forEach((function(t){return e.appendFieldNode(t)}))},n.getLastNodeIndex=function(){return this._nodes.length-1},n.getLastNode=function(){return this._nodes[this.getLastNodeIndex()]},n.getNode=function(e){return e?this._nodes.find((function(t){return t.getUuid()===e})):this.getLastNode()},n.setConfigModel=function(e){this.cfg=e},n.clearText=function(e,t,n){var i=null;if(e){var a=this._nodes.find((function(t){return t.getUuid()===e}));if(!(a instanceof X&&n))return null;var r=(i=a).str.replace(i.str.substring(t,n),"");i.str=r}else{var o=this.getLastNode();if(!(o instanceof X))return null;var l=o.str.indexOf("@");-1!==l&&((i=o).str=i.str.substring(0,l))}return this.updateCache(),this.expressionUpdatedSource.next(),i},n.insertText=function(e,t,n){this.insertNodes(this.createNodesFromText(e),t,n)},n.insertNodes=function(e,t,n){if(!t){var i,a,r=this.getLastNode();if(r)if(r instanceof X&&e[0]instanceof X)r.str+=e[0].str,e.splice(0,1,r),(a=this._nodes).splice.apply(a,[this.getLastNodeIndex(),1].concat(e));else if(r instanceof W&&e[0]instanceof W){var o;(o=this._nodes).splice.apply(o,[this.getLastNodeIndex(),0,new X(" + ")].concat(e))}else{var l;(l=this._nodes).push.apply(l,e)}else(i=this._nodes).push.apply(i,e);return this.updateCache(),void this.expressionUpdatedSource.next()}var s=new q,c=this._nodes.find((function(e){return e.getUuid()===t})),u=this._nodes.indexOf(c);if(c instanceof X){var p;(null==n||n<0)&&(n=c.str.length);var d=c.str.substring(0,n),f=c.str.substring(n);if(d.length>0&&(e[0]instanceof X?(c.str=d+e[0].str,e.splice(0,1,c)):(c.str=d,e.splice(0,0,c))),f.length>0){var m,g=e.length-1;e[g]instanceof X?(d.length>0?(m=e[g]).str+=f:(m=c).str=e[g].str+f,e.splice(g,1,m)):d.length>0?e.push(new X(f)):(c.str=f,e.push(c))}(p=this._nodes).splice.apply(p,[u,1].concat(e));var v=u+e.length-1;if(this._nodes[v]instanceof W&&this.nodes[v+1]instanceof W){var h=new X(" + ");this._nodes.splice(v+1,0,h),s.node=h,s.offset=1}else this._nodes[v]instanceof W?(s.node=this._nodes[v+1],s.offset=0):(s.node=this._nodes[v],s.offset=this._nodes[v].str.length-f.length);return this.updateCache(),void this.expressionUpdatedSource.next(s)}0!==n&&e[0]instanceof W&&e.splice(0,0,new X(" + "));var E,y=0===n?u:u+1,b=this._nodes[y];if(b instanceof X&&e[e.length-1]instanceof X)s.offset=e[e.length-1].str.length,b.str=e[e.length-1].str+b.str,e.pop(),(E=this._nodes).splice.apply(E,[y,1].concat(e)),s.node=b;else if(b instanceof W&&e[e.length-1]instanceof W){var S,F=new X(" + ");(S=this._nodes).splice.apply(S,[y,0].concat(e,[F])),s.node=F,s.offset=1}else{var T;(T=this._nodes).splice.apply(T,[y,0].concat(e)),b instanceof X?(s.node=b,s.offset=0):(s.node=e[e.length-1],s.offset=e[e.length-1].str.length)}this.updateCache(),this.expressionUpdatedSource.next(s)},n.removeToken=function(e,t,n){if(!e){var i=this.getLastNode();if(!i)return;if(i instanceof W){var a=this._nodes.pop();this._nodes.find((function(e){return e instanceof W&&e.mappedField===a.mappedField}))||(this.mapping.removeField(a.mappedField.field),this.cfg.mappingService.updateMappedField(this.mapping))}else i instanceof X&&(i.str.length>0&&(i.str=i.str.substring(0,i.str.length-1)),0===i.str.length&&this._nodes.pop());return this.updateCache(),void this.expressionUpdatedSource.next()}var r=new q,o=this._nodes.find((function(t){return t.getUuid()===e})),l=this._nodes.indexOf(o);if(n&&(l++,o=this._nodes[l]),!o||-1===t){if(l<1)return;t=(o=this._nodes[--l])instanceof X?o.str.length:1}if(o instanceof W){var s=this._nodes.splice(l,1)[0];if(this._nodes.find((function(e){return e instanceof W&&e.mappedField===s.mappedField}))||(this.mapping.removeField(s.mappedField.field),this.cfg.mappingService.updateMappedField(this.mapping)),this._nodes.length>l)if(this._nodes[l-1]instanceof X&&this._nodes[l]instanceof X){var c=this._nodes[l-1].str.length;this._nodes[l-1].str+=this._nodes[l].str,this._nodes.splice(l,1),r.node=this._nodes[l-1],r.offset=c}else if(this._nodes[l-1]instanceof W&&this._nodes[l]instanceof W){var u=new X(" + ");this._nodes.splice(l,0,u),r.node=u,r.offset=3}else this._nodes[l-1]instanceof X?(r.node=this._nodes[l-1],r.offset=this._nodes[l-1].str.length):this._nodes[l]instanceof X&&(r.node=this._nodes[l],r.offset=0);else r=void 0}else{var p=o.str;1===p.length?this._nodes.splice(l,1):(o.str=0===t?p.substr(1):p.substring(0,t)+p.substring(t+1),r.node=o,r.offset=t)}this.updateCache(),this.expressionUpdatedSource.next(r)},n.clearToEnd=function(e){var t=this.getLastNode();t instanceof X&&(t.str=t.str.substring(0,e))},n.updateFieldReference=function(e,t,n){for(var i,a=this,r=e.getUserMappedFields(!0),o=e.getReferenceMappedFields(),l=this._nodes.filter((function(e){return e instanceof W})),s=x(l);!(i=s()).done;){var c=i.value;if(!(r.includes(c.mappedField)||o.includes(c.mappedField)||c.hasComplexField())){var u=this._nodes.indexOf(c);this._nodes.splice(u,1),this._nodes.length>u&&this._nodes[u-1]instanceof X&&this._nodes[u]instanceof X&&(this._nodes[u-1].str+=this._nodes[u].str,this._nodes.splice(u,1))}}l=this._nodes.filter((function(e){return e instanceof W}));for(var p,d=function(){var e=p.value;l.find((function(t){return t.mappedField===e}))||o.find((function(t){return t.field===e.field}))||(t?a.insertNodes([new W(a.mapping,e)],t,n):a.appendFieldNode(e))},f=x(r);!(p=f()).done;)d();this.updateCache(),this.expressionUpdatedSource.next()},n.clear=function(){this._nodes=[],this.updateCache(),this.expressionUpdatedSource.next()},n.toText=function(){return 0===this.textCache.length&&this.updateCache(),this.textCache},n.toHTML=function(){return 0===this.expressionHTML.length&&this.updateCache(),this.expressionHTML},n.addConditionalExpressionNode=function(e,t,n){this.insertNodes([new W(this.mapping,e)],t,n)},n.updateCache=function(){var e="";this._nodes.forEach((function(t){return e+=t.toText()})),this.textCache=e,e="",this._nodes.forEach((function(t){return e+=t.toHTML()})),this.expressionHTML=e},n.createNodesFromText=function(e){for(var n=[],i=-1,a=null;-1!==e.search(/\$\{[a-zA-Z0-9.:/<>[\]_-]+\}/);){0!==(i=e.search(/\$/))&&n.push(new X(e.substring(0,i)));var r,o,l=e.substring(i+2,e.indexOf("}")),s=null;if(isNaN(Number(l))){var c,u;s=a?new W(this.mapping,void 0,l,void 0,null===(c=a.mappedField)||void 0===c||null===(u=c.field)||void 0===u?void 0:u.path):new W(this.mapping,void 0,l)}else{var p=parseInt(l,10);s=new W(this.mapping,void 0,void 0,p)}s&&s.mappedField?(null!==(r=s.mappedField)&&void 0!==r&&null!==(o=r.field)&&void 0!==o&&o.isCollection&&(a=s),n.push(s)):this.cfg.errorService.addError(new G({message:"Unable to map expression element '"+l+"' to a field node.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.MAPPING,type:t.ErrorType.INTERNAL,mapping:this.mapping})),e=e.substring(e.indexOf("}")+1)}return e.length>0&&n.push(new X(e)),n},n.appendFieldNode=function(e){var t=this._nodes.pop();t instanceof W?this._nodes.push(t,new X(" + ")):t instanceof X&&this._nodes.push(0===t.str.length?new X(" + "):t),this._nodes.push(new W(this.mapping,e))},D(e,[{key:"hasComplexField",get:function(){return this._hasComplexField},set:function(e){this._hasComplexField=e}},{key:"nodes",get:function(){return this._nodes}}]),e}(),Q=function(){this.type=t.FieldType.STRING,this.values=null,this.serviceObject={}},ee=function(){},te=function(){function e(){this.arguments=[],this.sourceType=t.FieldType.NONE,this.targetType=t.FieldType.NONE,this.multiplicity=t.Multiplicity.ONE_TO_ONE,this.serviceObject={}}var n=e.prototype;return n.populateFieldAction=function(e){if(e.name=this.name,e.definition=this,null==e.argumentValues||0===e.argumentValues.length){e.argumentValues=[];for(var t,n=x(this.arguments);!(t=n()).done;){var i=t.value;-1!==["LONG","INTEGER","FLOAT","DOUBLE","SHORT","BYTE","DECIMAL","NUMBER"].indexOf(i.type.toUpperCase())?e.setArgumentValue(i.name,"0"):"BOOLEAN"===i.type.toUpperCase()?e.setArgumentValue(i.name,"false"):e.setArgumentValue(i.name,"")}}},n.getArgumentForName=function(e){return this.arguments.find((function(t){return t.name===e}))},e}(),ne=function(){function e(){this.argumentValues=[]}e.create=function(t){var n=new e;return n.definition=t,n.name=null==t?void 0:t.name,n};var t=e.prototype;return t.getArgumentValue=function(e){for(var t,n=x(this.argumentValues);!(t=n()).done;){var i=t.value;if(i.name===e)return i}var a=new ee;return a.name=e,a.value="0",this.argumentValues.push(a),a},t.setArgumentValue=function(e,t){this.getArgumentValue(e).value=t},e}(),ie=function(){function e(e,t){this.cfg=e,this.doc=t}return e.prototype.parseFieldFromDocument=function(e,n){if(null!=e&&"NOT_FOUND"===e.status)return this.cfg.errorService.addError(new G({message:"Ignoring unknown field: "+e.name+" ("+e.path+"), document: "+this.doc.name,level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER})),null;if(null!=e&&"EXCLUDED"===e.status)return null;var i=new R;return i.name=e.name,i.type=e.fieldType,i.path=e.path,i.isPrimitive="COMPLEX"!==e.fieldType,i.documentField=e,"LIST"!==e.collectionType&&"ARRAY"!==e.collectionType||(i.isCollection=!0,"ARRAY"===e.collectionType&&(i.isArray=!0)),null!=n?(i.parentField=n,n.children.push(i)):this.doc.fields.push(i),i},e}(),ae=function(e,t){this.cfg=e,this.doc=t},re=function(e,t){this.cfg=e,this.doc=t,this.headers={"Content-Type":"application/json"},this.searchParams={}},oe=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).request=new le(t.cfg,t.doc),t}N(n,e);var i=n.prototype;return i.isOnlineInspectionCapable=function(){return null!=this.cfg.initCfg.baseCSVInspectionServiceUrl||(this.cfg.errorService.addError(new G({message:"CSV inspection service is not configured. Document will not be loaded: "+this.doc.name,level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:this.doc})),!1)},i.parseResponse=function(e){if(void 0!==e.CsvInspectionResponse)this.extractCSVDocumentDefinitionFromInspectionResponse(e.CsvInspectionResponse);else{if(void 0===e.CsvDocument)throw new Error("Unknown CSV inspection result format: "+e);this.extractCSVDocumentDefinition(e.CsvDocument)}},i.extractCSVDocumentDefinitionFromInspectionResponse=function(e){if(e.errorMessage)throw this.doc.errorOccurred=!0,new Error("Could not load JSON document, error: "+e.errorMessage);this.extractCSVDocumentDefinition(e.csvDocument)},i.extractCSVDocumentDefinition=function(e){this.doc.description||(this.doc.description=this.doc.id),this.doc.name||(this.doc.name=this.doc.id),this.doc.inspectionParameters&&(this.doc.uri=P.urlWithParameters(this.doc.uri,this.doc.inspectionParameters));for(var t,n=x(e.fields.field);!(t=n()).done;)this.parseCSVFieldFromDocument(t.value,null)},i.parseCSVFieldFromDocument=function(e,n){var i,a,r=this.parseFieldFromDocument(e,n);if(null!=r&&(r.column=e.column,e.fieldType===t.FieldType.COMPLEX)&&null!==(i=e.csvFields)&&void 0!==i&&null!==(a=i.csvField)&&void 0!==a&&a.length)for(var o,l=x(e.csvFields.csvField);!(o=l()).done;)this.parseCSVFieldFromDocument(o.value,r)},n}(ie),le=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).url=t.cfg.initCfg.baseCSVInspectionServiceUrl+"inspect",t.options=new se(t.cfg,t.doc),t}return N(t,e),t}(ae),se=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).body=t.doc.inspectionSource,t.searchParams=t.doc.inspectionParameters,t}return N(t,e),t}(re),ce=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).request=new ue(t.cfg,t.doc),t}N(n,e);var i=n.prototype;return i.isOnlineInspectionCapable=function(){return null!=this.cfg.initCfg.baseJavaInspectionServiceUrl||(this.cfg.errorService.addError(new G({message:"Java inspection service is not configured. Document will not be loaded: "+this.doc.name,level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:this.doc})),!1)},i.parseResponse=function(e){var n;if(e.ClassInspectionResponse){if(e.errorMessage)throw this.doc.errorOccurred=!0,new Error("Could not load JSON document, error: "+e.errorMessage);n=e.ClassInspectionResponse.javaClass}else n=e.JavaClass;var i=this.doc.id;if(!n||"NOT_FOUND"===n.status)throw this.doc.errorOccurred=!0,new Error("Could not load JAVA document. Document is not found: "+i);this.doc.description||(this.doc.description=n.className),this.doc.name||(this.doc.name=n.className,this.doc.name&&-1!==this.doc.name.indexOf(".")&&(this.doc.name=this.doc.name.substr(this.doc.name.lastIndexOf(".")+1))),!n.uri||this.doc.uri&&0!==this.doc.uri.length||(this.doc.uri=n.uri);var a=null;n.collectionType&&n.collectionType!==t.CollectionType.NONE.valueOf()&&(this.parseJavaFieldFromDocument(n,null),a=this.doc.fields[0]);for(var r,o=x(n.javaFields.javaField);!(r=o()).done;)this.parseJavaFieldFromDocument(r.value,a)},i.parseJavaFieldFromDocument=function(e,n){var i,a,r,o=this.parseFieldFromDocument(e,n);if(null!=o&&(e.className&&(o.classIdentifier=e.className),e.fieldType===t.FieldType.COMPLEX)){var l=e;if(o.enumeration=l.enumeration,l.enumeration&&null!==(i=l.javaEnumFields)&&void 0!==i&&i.javaEnumField)for(var s,c=x(l.javaEnumFields.javaEnumField);!(s=c()).done;){var u=s.value,p=new w;p.name=u.name,p.ordinal=u.ordinal,o.enumValues.push(p)}if(null!==(a=l.javaFields)&&void 0!==a&&null!==(r=a.javaField)&&void 0!==r&&r.length)for(var d,f=x(l.javaFields.javaField);!(d=f()).done;)this.parseJavaFieldFromDocument(d.value,o)}},n}(ie),ue=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).url=t.cfg.initCfg.baseJavaInspectionServiceUrl+"class",t.options=new pe(t.cfg,t.doc),t}return N(t,e),t}(ae),pe=function(e){function n(n,i){var a;(a=e.call(this,n,i)||this).cfg=n,a.doc=i;var r={ClassInspectionRequest:{jsonType:"io.atlasmap.java.v2.ClassInspectionRequest",className:a.doc.inspectionSource,disablePrivateOnlyFields:a.cfg.initCfg.disablePrivateOnlyFields,disableProtectedOnlyFields:a.cfg.initCfg.disableProtectedOnlyFields,disablePublicOnlyFields:a.cfg.initCfg.disablePublicOnlyFields,disablePublicGetterSetterFields:a.cfg.initCfg.disablePublicGetterSetterFields}};return a.json=r,a.doc.initModel.collectionType&&a.doc.initModel.collectionType!==t.CollectionType.NONE&&(r.ClassInspectionRequest.collectionType=a.doc.initModel.collectionType,a.doc.initModel.collectionClassName&&(r.ClassInspectionRequest.collectionClassName=a.doc.initModel.collectionClassName)),a.cfg.initCfg.fieldNameExclusions&&a.cfg.initCfg.fieldNameExclusions.length&&(r.ClassInspectionRequest.fieldNameExclusions={string:a.cfg.initCfg.fieldNameExclusions}),a.cfg.initCfg.classNameExclusions&&a.cfg.initCfg.classNameExclusions.length&&(r.ClassInspectionRequest.classNameExclusions={string:a.cfg.initCfg.classNameExclusions}),a}return N(n,e),n}(re),de=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).request=new fe(t.cfg,t.doc),t}N(n,e);var i=n.prototype;return i.isOnlineInspectionCapable=function(){return null!=this.cfg.initCfg.baseJSONInspectionServiceUrl||(this.cfg.errorService.addError(new G({message:"JSON inspection service is not configured. Document will not be loaded: "+this.doc.name,level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:this.doc})),!1)},i.parseResponse=function(e){if(void 0!==e.JsonInspectionResponse)this.extractJSONDocumentDefinitionFromInspectionResponse(e.JsonInspectionResponse);else{if(void 0===e.JsonDocument)throw new Error("Unknown JSON inspection result format: "+e);this.extractJSONDocumentDefinition(e.JsonDocument)}},i.extractJSONDocumentDefinitionFromInspectionResponse=function(e){if(e.errorMessage)throw this.doc.errorOccurred=!0,new Error("Could not load JSON document, error: "+e.errorMessage);this.extractJSONDocumentDefinition(e.jsonDocument)},i.extractJSONDocumentDefinition=function(e){this.doc.description||(this.doc.description=this.doc.id),this.doc.name||(this.doc.name=this.doc.id);for(var t,n=x(e.fields.field);!(t=n()).done;)this.parseJSONFieldFromDocument(t.value,null)},i.parseJSONFieldFromDocument=function(e,n){var i,a,r=this.parseFieldFromDocument(e,n);if(null!=r&&e.fieldType===t.FieldType.COMPLEX){var o=e;if(r.enumeration=o.enumeration,r.enumeration&&null!==(i=o.jsonEnumFields)&&void 0!==i&&i.jsonEnumField)for(var l,s=x(o.jsonEnumFields.jsonEnumField);!(l=s()).done;){var c=l.value,u=new w;u.name=c.name,u.ordinal=c.ordinal,r.enumValues.push(u)}if(null!==(a=o.jsonFields)&&void 0!==a&&a.jsonField.length)for(var p,d=x(o.jsonFields.jsonField);!(p=d()).done;)this.parseJSONFieldFromDocument(p.value,r)}},n}(ie),fe=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).url=t.cfg.initCfg.baseJSONInspectionServiceUrl+"inspect",t.options=new me(t.cfg,t.doc),t}return N(t,e),t}(ae),me=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).json={JsonInspectionRequest:{jsonType:"io.atlasmap.json.v2.JsonInspectionRequest",type:t.doc.inspectionType,jsonData:t.doc.inspectionSource}},t}return N(t,e),t}(re),ge=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).request=new ve(t.cfg,t.doc),t}N(n,e);var i=n.prototype;return i.isOnlineInspectionCapable=function(){return null!=this.cfg.initCfg.baseXMLInspectionServiceUrl||(this.cfg.errorService.addError(new G({message:"XML inspection service is not configured. Document will not be loaded: "+this.doc.name,level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:this.doc})),!1)},i.parseResponse=function(e){if(void 0!==e.XmlInspectionResponse)this.extractXMLDocumentDefinitionFromInspectionResponse(e.XmlInspectionResponse);else{if(void 0===e.XmlDocument)throw new Error("Unknown XML inspection result format: "+e);this.extractXMLDocumentDefinition(e.XmlDocument)}},i.extractXMLDocumentDefinitionFromInspectionResponse=function(e){if(e.errorMessage)throw this.doc.errorOccurred=!0,new Error("Could not load XML document, error: "+e.errorMessage);this.extractXMLDocumentDefinition(e.xmlDocument)},i.extractXMLDocumentDefinition=function(e){var t,n;if(this.doc.description||(this.doc.description=this.doc.id),this.doc.name||(this.doc.name=this.doc.id),null!=e&&null!==(t=e.xmlNamespaces)&&void 0!==t&&null!==(n=t.xmlNamespace)&&void 0!==n&&n.length)for(var i,a=x(e.xmlNamespaces.xmlNamespace);!(i=a()).done;){var r=i.value,o=new L;o.alias=r.alias,o.uri=r.uri,o.locationUri=r.locationUri,o.isTarget=r.targetNamespace,this.doc.namespaces.push(o)}for(var l,s=x(e.fields.field);!(l=s()).done;){var c=l.value;if(!this.doc.selectedRoot||this.isSelectedRootElement(c)){this.parseXMLFieldFromDocument(c,null);break}}},i.isSelectedRootElement=function(e){return!!(this.doc.selectedRoot||null!=e&&e.name)&&this.doc.selectedRoot===(-1!==e.name.indexOf(":")?e.name.split(":")[1]:e.name)},i.parseXMLFieldFromDocument=function(e,n){var i,a,r=this.parseFieldFromDocument(e,n);if(null!=r&&(-1!==e.name.indexOf(":")&&(r.namespaceAlias=e.name.split(":")[0],r.name=e.name.split(":")[1]),r.isAttribute=-1!==r.path.indexOf("@"),e.fieldType===t.FieldType.COMPLEX)){var o=e;if(r.enumeration=o.enumeration,r.enumeration&&null!==(i=o.xmlEnumFields)&&void 0!==i&&i.xmlEnumField)for(var l,s=x(o.xmlEnumFields.xmlEnumField);!(l=s()).done;){var c=l.value,u=new w;u.name=c.name,u.ordinal=c.ordinal,r.enumValues.push(u)}if(null!==(a=o.xmlFields)&&void 0!==a&&a.xmlField.length)for(var p,d=x(o.xmlFields.xmlField);!(p=d()).done;)this.parseXMLFieldFromDocument(p.value,r)}},n}(ie),ve=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).url=t.cfg.initCfg.baseXMLInspectionServiceUrl+"inspect",t.options=new he(t.cfg,t.doc),t}return N(t,e),t}(ae),he=function(e){function t(){var t;return(t=e.apply(this,arguments)||this).json={XmlInspectionRequest:{jsonType:"io.atlasmap.xml.v2.XmlInspectionRequest",type:t.doc.inspectionType,xmlData:t.doc.inspectionSource}},t}return N(t,e),t}(re),Ee=function(){this.sourceType=t.FieldType.STRING,this.targetType=t.FieldType.STRING},ye=function(){function e(){this.lookupEntry=[],this.name=(new Date).getTime()+"-"+Math.floor(1e6*Math.random()).toString()}var t=e.prototype;return t.getInputOutputKey=function(){return this.sourceIdentifier+":"+this.targetIdentifier},t.getEntryForSource=function(e,t){for(var n,i=x(this.lookupEntry);!(n=i()).done;){var a=n.value;if(a.sourceValue===e)return a}if(t){var r=new Ee;return r.sourceValue=e,this.lookupEntry.push(r),r}return null},t.toString=function(){var e="Lookup Table, name: "+this.name+", entries: "+this.lookupEntry.length;e+="\nsourceIdentifier: "+this.sourceIdentifier,e+="\n\targetIdentifier: "+this.targetIdentifier;for(var t,n=0,i=x(this.lookupEntry);!(t=i()).done;){var a=t.value;e+="\n\tEntry #"+n+": "+a.sourceValue+" => "+a.targetValue,n+=1}return e},e}();(K=t.TransitionMode||(t.TransitionMode={})).ONE_TO_ONE="ONE_TO_ONE",K.ONE_TO_MANY="ONE_TO_MANY",K.ENUM="ENUM",K.MANY_TO_ONE="MANY_TO_ONE",K.FOR_EACH="FOR_EACH",K.EXPRESSION="EXPRESSION",(Z=t.TransitionDelimiter||(t.TransitionDelimiter={}))[Z.NONE=0]="NONE",Z[Z.AMPERSAND=1]="AMPERSAND",Z[Z.AT_SIGN=2]="AT_SIGN",Z[Z.BACKSLASH=3]="BACKSLASH",Z[Z.COLON=4]="COLON",Z[Z.COMMA=5]="COMMA",Z[Z.DASH=6]="DASH",Z[Z.EQUAL=7]="EQUAL",Z[Z.HASH=8]="HASH",Z[Z.PERIOD=9]="PERIOD",Z[Z.PIPE=10]="PIPE",Z[Z.SEMICOLON=11]="SEMICOLON",Z[Z.SLASH=12]="SLASH",Z[Z.SPACE=13]="SPACE",Z[Z.UNDERSCORE=14]="UNDERSCORE",Z[Z.USER_DEFINED=15]="USER_DEFINED";var be=function(e,n,i,a){this.delimiter=t.TransitionDelimiter.SPACE,this.serializedValue=null,this.prettyName=null,this.actualDelimiter="",this.delimiter=e,this.serializedValue=n,this.prettyName=i,this.actualDelimiter=a},Se=function(){function e(){this.mode=t.TransitionMode.ONE_TO_ONE,this.delimiter=t.TransitionDelimiter.SPACE,this.userDelimiter="",this.lookupTableName=null,this.enableExpression=!1,this.transitionFieldAction=null,e.initialize()}e.initialize=function(){if(0===e.delimiterModels.length){var n=[];n.push(new be(t.TransitionDelimiter.NONE,null,"[None]","")),n.push(new be(t.TransitionDelimiter.AMPERSAND,"Ampersand","Ampersand [&]","&")),n.push(new be(t.TransitionDelimiter.AT_SIGN,"AtSign","At Sign [@]","@")),n.push(new be(t.TransitionDelimiter.BACKSLASH,"Backslash","Backslash [\\]","\\")),n.push(new be(t.TransitionDelimiter.COLON,"Colon","Colon [:]",":")),n.push(new be(t.TransitionDelimiter.COMMA,"Comma","Comma [,]",",")),n.push(new be(t.TransitionDelimiter.DASH,"Dash","Dash [-]","-")),n.push(new be(t.TransitionDelimiter.EQUAL,"Equal","Equal [=]","=")),n.push(new be(t.TransitionDelimiter.HASH,"Hash","Hash [#]","#")),n.push(new be(t.TransitionDelimiter.PERIOD,"Period","Period [.]",".")),n.push(new be(t.TransitionDelimiter.PIPE,"Pipe","Pipe [|]","|")),n.push(new be(t.TransitionDelimiter.SEMICOLON,"Semicolon","Semicolon [;]",";")),n.push(new be(t.TransitionDelimiter.SLASH,"Slash","Slash [/]","/")),n.push(new be(t.TransitionDelimiter.SPACE,"Space","Space [ ]"," ")),n.push(new be(t.TransitionDelimiter.UNDERSCORE,"Underscore","Underscore [_]","_")),n.push(new be(t.TransitionDelimiter.USER_DEFINED,"User defined","User defined","\0")),e.delimiterModels=n}},e.delimiterToModel=function(t){return e.delimiterModels.filter((function(e){return e.actualDelimiter===t}))[0]},e.getMappingModeName=function(e){var n;switch(e){case t.TransitionMode.ONE_TO_ONE:n="One to One";break;case t.TransitionMode.MANY_TO_ONE:n="Many to One";break;case t.TransitionMode.ONE_TO_MANY:n="One to Many";break;case t.TransitionMode.ENUM:n="ENUM";break;case t.TransitionMode.FOR_EACH:n="For Each";break;case t.TransitionMode.EXPRESSION:n="Expression";break;default:n=""}return n};var n=e.prototype;return n.getPrettyName=function(){var n,i="";return this.transitionFieldAction&&(i=" ("+this.transitionFieldAction.name+")"),this.mode===t.TransitionMode.ONE_TO_MANY||this.mode===t.TransitionMode.MANY_TO_ONE?e.getMappingModeName(this.mode)+i:this.mode===t.TransitionMode.ENUM?"Enum (table: "+this.lookupTableName+")":this.mode===t.TransitionMode.EXPRESSION?"Expression ("+(null===(n=this.expression)||void 0===n?void 0:n.toText())+")":e.getMappingModeName(this.mode)},n.isOneToManyMode=function(){return this.mode===t.TransitionMode.ONE_TO_MANY},n.isOneToOneMode=function(){return this.mode===t.TransitionMode.ONE_TO_ONE},n.isManyToOneMode=function(){return this.mode===t.TransitionMode.MANY_TO_ONE},n.isForEachMode=function(){return this.mode===t.TransitionMode.FOR_EACH},n.isEnumerationMode=function(){return this.mode===t.TransitionMode.ENUM},n.isExpressionMode=function(){return this.mode===t.TransitionMode.EXPRESSION},e}();Se.delimiterModels=[];var Fe=function(){function e(){this.name=null,this.version=null,this.mappings=[],this.activeMapping=null,this.parsedDocs=[],this.templateText=null,this.tables=[],this.tablesBySourceTargetKey={},this.tablesByName={},this.name="UI.0"}var n=e.prototype;return n.templateExists=function(){return null!=this.templateText&&""!==this.templateText},n.addTable=function(e){this.tablesBySourceTargetKey[e.getInputOutputKey()]=e,this.tablesByName[e.name]=e,this.tables.push(e)},n.getTableByName=function(e){return this.tablesByName[e]},n.getTableBySourceTarget=function(e,t){return this.tablesBySourceTargetKey[e+":"+t]},n.getTables=function(){var e=[];for(var t in this.tablesByName)this.tablesByName.hasOwnProperty(t)&&e.push(this.tablesByName[t]);return e},n.removeTableByName=function(e){if(e){var t=this.tablesByName[e],n=t.getInputOutputKey();this.tablesByName[e]&&(delete this.tables[this.tables.indexOf(t)],delete this.tablesByName[e],delete this.tablesBySourceTargetKey[n])}},n.getAllMappings=function(e){var t=[].concat(this.mappings);if(e){if(null==this.activeMapping)return t;for(var n,i=x(t);!(n=i()).done;)if(n.value===this.activeMapping)return t;t.push(this.activeMapping)}return t},n.findMappingsForField=function(e){for(var t,n=[],i=x(this.mappings);!(t=i()).done;){var a=t.value;a.isFieldMapped(e)&&n.push(a)}return n},n.removeMapping=function(e){return e.transition.mode===t.TransitionMode.ENUM&&this.removeTableByName(e.transition.lookupTableName),P.removeItemFromArray(e,this.mappings)},e}(),Te=function(){function e(){this.actions=[]}e.sortMappedFieldsByPath=function(e){if(null==e||0===e.length)return[];for(var t,n={},i=[],a=x(e);!(t=a()).done;){var r=t.value;if(null!=r&&null!=r.field){var o=r.field.path;n[o]=r,i.push(o)}}i.sort();for(var l=[],s=0,c=i;s<c.length;s++)l.push(n[c[s]]);return l};var t=e.prototype;return t.isPadField=function(){return this.field instanceof U},t.isSource=function(){return!!this.field&&this.field.isSource()},t.removeAction=function(e){P.removeItemFromArray(e,this.actions)},e}(),Ce=function(){function e(){this.sourceFields=[],this.targetFields=[],this.referenceFields=[],this.transition=new Se,this.uuid="mapping."+Math.floor(1e6*Math.random()+1).toString(),this.cfg=J.getConfig()}var n=e.prototype;return n.getFirstCollectionField=function(e){for(var t,n=x(e?this.sourceFields:this.targetFields);!(t=n()).done;){var i=t.value;if(i.field&&i.field.isInCollection())return i.field}return null},n.isLookupMode=function(){for(var e,t=x(this.sourceFields.concat(this.targetFields));!(e=t()).done;){var n=e.value;if(n.field&&n.field.enumeration)return!0}return!1},n.addField=function(e,t){var n=this.getMappedFields(e.isSource());if(1===n.length){var i=n[0];if(!i.field)return i.field=e,i}var a=new Te;return a.field=e,t?n.unshift(a):n.push(a),a},n.removeField=function(e){var t=this.getMappedFields(e.isSource());P.removeItemFromArray(t.find((function(t){return t.field===e})),t)},n.getUserFieldCount=function(e){for(var t,n=0,i=x(this.getMappedFields(e.isSource()));!(t=i()).done;)t.value.isPadField()||n++;return n},n.hasMappedField=function(e){return e?this.sourceFields.length>0:this.targetFields.length>0},n.isEmpty=function(){return 0===this.sourceFields.length&&0===this.targetFields.length},n.isFullyMapped=function(){return this.sourceFields.length>0&&this.targetFields.length>0},n.addMappedField=function(e,t){this.getMappedFields(t).push(e)},n.removeMappedField=function(e){e&&e.field&&(e.field.isCollection&&this.removeReferenceField(e),P.removeItemFromArray(e,this.getMappedFields(e.field.isSource())),this.cfg.mappingService.notifyMappingUpdated())},n.getMappedFieldForField=function(e){if(!e||!e.isSource)return null;for(var t,n=x(this.getMappedFields(e.isSource()));!(t=n()).done;){var i=t.value;if(i.field===e)return i}return null},n.getMappedFieldByPath=function(e,t,n){if(!e)return null;for(var i=this.getMappedFields(t),a=0;a<i.length;a++){var r;if((null===(r=i[a].field)||void 0===r?void 0:r.path)===e){var o;if(!n)return i[a];if(n&&(null===(o=i[a].field)||void 0===o?void 0:o.docDef.id)===n)return i[a]}}return null},n.getMappedFieldForIndex=function(e,t){if(!e||0===e.length)return null;var n=this.getMappedFields(t);return+e-1>n.length-1?null:n[+e-1]},n.getIndexForMappedField=function(e){return e&&e.field?this.getMappedFields(e.field.isSource()).indexOf(e)+1:null},n.getField=function(e,t){var n=this.cfg.getDocForIdentifier(e,!0);n||(n=this.cfg.getDocForIdentifier(e,!1));var i=null;return n&&(i=R.getField(t,n.getAllFields())),i},n.createReferenceField=function(e){var t,n,i,a=null;return e?(null!==(t=e.documentField)&&void 0!==t&&t.status&&"SUPPORTED"!==(null===(n=e.documentField)||void 0===n?void 0:n.status)&&"CACHED"!==(null===(i=e.documentField)||void 0===i?void 0:i.status)||((a=new Te).field=e,this.referenceFields.push(a)),a):null},n.removeReferenceField=function(e){e&&P.removeItemFromArray(e,this.referenceFields)},n.referenceFieldExists=function(e,t){if(!e||!t)return!1;for(var n,i=x(this.getReferenceMappedFields());!(n=i()).done;){var a=n.value;if(a.field&&a.field.docDef.id===e&&a.field.path===t)return!0}return!1},n.getReferenceField=function(e,n){if(!e||!n)return null;for(var i,a=x(this.getReferenceMappedFields());!(i=a()).done;){var r=i.value;if(r.field&&r.field.docDef.id===e&&r.field.path===n)return r}var o=this.getField(e,n);return(null==o?void 0:o.type)===t.FieldType.COMPLEX?(this.transition.expression.hasComplexField=!0,this.createReferenceField(o)):null},n.getUserMappedFields=function(e){for(var t,n=e?this.sourceFields:this.targetFields,i=[new Te],a=x(n);!(t=a()).done;){var r=t.value;r.isPadField()||i.push(r)}return i.shift(),i},n.getReferenceMappedFields=function(){return this.referenceFields},n.getMappedFields=function(e){return e?this.sourceFields:this.targetFields},n.getLastMappedField=function(e){var t=this.getMappedFields(e);return null!=t&&t.length>0?t[t.length-1]:null},n.getFields=function(e){for(var t,n=[],i=x(this.getMappedFields(e));!(t=i()).done;){var a=t.value;null!=a.field&&n.push(a.field)}return n},n.getFieldNames=function(e){for(var t,n=[],i=x(this.getFields(e));!(t=i()).done;)n.push(t.value.name);return n},n.getFieldPaths=function(e){for(var t,n=[],i=x(this.getFields(e));!(t=i()).done;)n.push(t.value.path);return n},n.hasFieldActions=function(){for(var e,t=x(this.getAllMappedFields());!(e=t()).done;)if(e.value.actions.length>0)return!0;return!1},n.getAllFields=function(){return this.getFields(!0).concat(this.getFields(!1))},n.getAllMappedFields=function(){return this.getMappedFields(!0).concat(this.getMappedFields(!1))},n.isFieldMapped=function(e){return null!=this.getMappedFieldForField(e)},n.hasTransformation=function(){for(var e,t=x(this.getAllMappedFields());!(e=t()).done;)if(e.value.actions.length>0)return!0;return!1},n.getMappedTarget=function(e){var t=this.cfg.mappings.mappings;if(e.isSource())return null;for(var n,i=x(t);!(n=i()).done;){var a=n.value;if(0!==a.targetFields.length)for(var r,o=x(a.targetFields);!(r=o()).done;){var l,s,c=r.value;if((null===(l=c.field)||void 0===l?void 0:l.docDef)===e.docDef&&c.field.path===e.path&&a.isFieldMapped(e))return null===(s=a.sourceFields[0])||void 0===s?void 0:s.field.name}}return null},e}(),Me=function(){function e(){}return e.prototype.then=function(t,n){var i=new e,a=this.s;if(a){var r=1&a?t:n;if(r){try{Oe(i,1,r(this.v))}catch(e){Oe(i,2,e)}return i}return this}return this.o=function(e){try{var a=e.v;1&e.s?Oe(i,1,t?t(a):a):n?Oe(i,1,n(a)):Oe(i,2,a)}catch(e){Oe(i,2,e)}},i},e}();function Oe(e,t,n){if(!e.s){if(n instanceof Me){if(!n.s)return void(n.o=Oe.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(Oe.bind(null,e,t),Oe.bind(null,e,2));e.s=t,e.v=n;var i=e.o;i&&i(e)}}function Ae(e){return e instanceof Me&&1&e.s}var De="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Ne(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}"undefined"!=typeof Symbol&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));var Ie,xe,Pe=function(){function e(){}return e.fromDocumentDefinition=function(e,n){switch(n.type){case t.DocumentType.JAVA:return new ce(e,n);case t.DocumentType.JSON:return new de(e,n);case t.DocumentType.XSD:case t.DocumentType.XML:return new ge(e,n);case t.DocumentType.CSV:return new oe(e,n);default:throw new Error("Document type '"+n.type+"' is not supported for inspection")}},e.fromJavaProperties=function(n,i,a,r,o){void 0===r&&(r=t.CollectionType.NONE);var l=new B;l.id=i;var s=i.split(".").pop();l.name=s||"",l.type=t.DocumentType.JAVA,l.inspectionType=t.InspectionType.JAVA_CLASS,l.inspectionSource=i,l.inspectionParameters={"":""},l.isSource=a,l.collectionType=r,l.collectionClassName=o,l.description="Java document class "+i,r&&r!==t.CollectionType.NONE&&(l.description+=" collection type: "+r,o&&(l.description+=" collection class name: "+o)),e.removeDocumentIfAlreadyExists(n,l.id,a);var c=n.addDocument(l);return new ce(n,c)},e.fromNonJavaProperties=function(t,n,i,a,r,o,l,s){var c=new B;c.name=i,c.id=n,c.type=a,c.inspectionType=r,c.inspectionSource=o,c.inspectionParameters=s||{"":""},c.isSource=l,c.description=l?"Source document ":"Target document ",c.description+=i+" type: "+a,e.removeDocumentIfAlreadyExists(t,c.id,l);var u=t.addDocument(c);return this.fromDocumentDefinition(t,u)},e.removeDocumentIfAlreadyExists=function(e,t,n){var i=e.getDocForIdentifier(t,n);i&&P.removeItemFromArray(i,n?e.sourceDocs:e.targetDocs)},e}(),we=function(){function e(){}return e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},e}(),Re=function(){},_e=function(){function e(){}return e.populateMappingLookupTable=function(e,n){if(n.transition.mode===t.TransitionMode.ENUM&&!n.transition.lookupTableName&&1===n.getFields(!0).length&&1===n.getFields(!1).length){var i,a,r=n.getFields(!0)[0];r&&(i=r.name+"-"+r.docDef.id);var o=n.getFields(!0)[0];if(o&&(a=o.name+"-"+o.docDef.id),i&&a){var l=e.getTableBySourceTarget(i,a);l||((l=new ye).sourceIdentifier=i,l.targetIdentifier=a,e.addTable(l)),n.transition.lookupTableName=l.name}}},e.updateLookupTables=function(t){for(var n,i=x(t.getTables());!(n=i()).done;){var a=n.value;if(!a.sourceIdentifier||!a.targetIdentifier){var r=e.getFirstMappingForLookupTable(t,a.name);if(r&&r.transition.lookupTableName){if(!a.sourceIdentifier){var o=r.getFields(!0)[0];o&&(a.sourceIdentifier=o.classIdentifier)}if(!a.targetIdentifier){var l=r.getFields(!1)[0];l&&(a.targetIdentifier=l.classIdentifier)}}}}for(var s,c=x(t.mappings);!(s=c()).done;)e.populateMappingLookupTable(t,s.value)},e.getFirstMappingForLookupTable=function(e,t){return e.mappings.find((function(e){return e.transition.lookupTableName===t}))},e.errorNoTable=function(e,n){var i;e.errorService.addError(new G({message:"Could not find enumeration lookup table "+(null===(i=n.transition)||void 0===i?void 0:i.lookupTableName)+" for mapping.",scope:t.ErrorScope.MAPPING,type:t.ErrorType.INTERNAL,mapping:n}))},e.getEnumerationValues=function(t,n){var i;if(!t||!t.mappings||!n)return[];var a=n.getFields(!1)[0],r=[];r.push("[ None ]");for(var o,l=x(a.enumValues);!(o=l()).done;)r.push(o.value.name);var s=t.mappings.getTableByName(null===(i=n.transition)||void 0===i?void 0:i.lookupTableName);if(!s)return e.errorNoTable(t,n),[];for(var c,u=[],p=x(n.getFields(!0)[0].enumValues);!(c=p()).done;){var d=c.value,f=new Re;f.sourceEnumValue=d.name,f.targetEnumValues=r;var m=s.getEntryForSource(f.sourceEnumValue,!1);f.selectedTargetEnumValue=null==m?"[ None ]":m.targetValue,u.push(f)}return u},e.updateEnumerationValues=function(t,n,i){var a;if(t&&t.mappings&&n){var r=t.mappings.getTableByName(null===(a=n.transition)||void 0===a?void 0:a.lookupTableName);if(r){r.lookupEntry=[];for(var o,l=x(i);!(o=l()).done;){var s=o.value;if("[ None ]"!==s.selectedTargetEnumValue){var c=new Ee;c.sourceValue=s.sourceEnumValue,c.targetValue=s.selectedTargetEnumValue,r.lookupEntry.push(c)}}}else e.errorNoTable(t,n)}},e}(),je=function(){function e(){}return e.generateMappingDigest=function(e,t){var n={exportMappings:{value:""},exportMeta:[],exportBlockData:[]},i=JSON.stringify(t);i&&(n.exportMappings.value=P.sanitizeJSON(i));for(var a,r=x(e.getAllDocs());!(a=r()).done;){var o=a.value;o.isPropertyOrConstant||(n.exportMeta.push({name:o.name,dataSourceType:o.type,id:o.id,inspectionType:o.inspectionType,inspectionParameters:o.inspectionParameters,isSource:o.isSource}),n.exportBlockData.push({value:o.inspectionSource}))}return n},e}(),ke=function(){function e(){}return e.updateMappingsFromDocuments=function(t){for(var n,i=x(t.mappings.mappings);!(n=i()).done;){var a=n.value;e.updateMappedFieldsFromDocuments(a,t,!0),e.updateMappedFieldsFromDocuments(a,t,!1)}for(var r,o=x(t.getAllDocs());!(r=o()).done;){var l=r.value;null==l.id&&(l.id="DOC."+l.name+"."+Math.floor(1e6*Math.random()+1).toString())}},e.updateMappedFieldsFromDocuments=function(n,i,a){for(var r,o=n.getMappedFields(a),l=-1,s=x(o);!(r=s()).done;){var c=r.value,u=null;if(l+=1,!(c.field instanceof U||void 0===c.mappingField)){if(e.isPropertyField(c.mappingField))u=a?i.sourcePropertyDoc:i.targetPropertyDoc,c.mappingField.docId&&(u.id=c.mappingField.docId);else if(e.isConstantField(c.mappingField))u=i.constantDoc,c.mappingField.docId&&(u.id=c.mappingField.docId);else{if(null==c.mappingField.docId){i.errorService.addError(new G({message:"Could not find doc ID for mapped field "+c.mappingField.name,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL}));continue}if(null==(u=i.getDocForIdentifier(c.mappingField.docId,a))){null!=c.mappingField.name&&i.errorService.addError(new G({message:"Could not find document for mapped field '"+c.mappingField.name+"' with ID "+c.mappingField.docId,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL}));continue}u.id=c.mappingField.docId}if(c.mappingField.path){if(c.field=u.getField(c.mappingField.path),null==c.field)if(c.mappingField.path.indexOf("<0>")>=0)c.field=u.getField(c.mappingField.path.replace("<0>","<>"));else if(e.isConstantField(c.mappingField)&&c.mappingField.value&&c.mappingField.fieldType){var p=i.constantDoc.getField(c.mappingField.value);p||(p=new R),p.value=c.mappingField.value,p.type=c.mappingField.fieldType,p.displayName=p.value,p.name=p.value,p.path=p.value,p.userCreated=!0,c.field=p,u.addField(p)}else{if(!(e.isPropertyField(c.mappingField)&&c.mappingField.fieldType&&c.mappingField.name&&c.mappingField.path))return void i.errorService.addError(new G({message:"Could not find field from document '"+u.name+"' for mapped field '"+c.mappingField.name+"'",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:{mappedField:c,doc:u}}));var d=c.mappingField,f=u.getField(d.path);f||(f=new R);var m=d.name;f.type=d.fieldType,d.scope&&(f.scope=d.scope),f.displayName=m,f.name=m,f.path=d.path,f.userCreated=!0,c.field=f,u.addField(f)}var g=+c.mappingField.index;o=n.getMappedFields(a),g<=l?o[l]=c:i.mappingService.addPlaceholders(g-l,n,l,a)}}}},e.removeStaleMappings=function(e){for(var t,n=0,i=[],a=x(e.getDocs(!0));!(t=a()).done;)i=i.concat(R.getFieldPaths(t.value.getAllFields()));for(var r,o=[],l=x(e.getDocs(!1));!(r=l()).done;)o=o.concat(R.getFieldPaths(r.value.getAllFields()));for(;n<e.mappings.mappings.length;)this.isMappingStale(e.mappings.mappings[n],i,o)?e.mappings.mappings.splice(n,1):n++},e.isMappingStale=function(e,t,n){for(var i,a=x(e.getFields(!0));!(i=a()).done;){var r=i.value;if(!(r instanceof U)&&-1===t.indexOf(r.path))return!0}for(var o,l=x(e.getFields(!1));!(o=l()).done;){var s=o.value;if(!(s instanceof U)&&-1===n.indexOf(s.path))return!0}return!1},e.updateDocumentNamespacesFromMappings=function(e){for(var n,i=e.getDocs(!1),a=x(e.mappings.parsedDocs);!(n=a()).done;){var r=n.value;if(r&&!r.isSource&&0!==r.namespaces.length){var o=this.getDocById(r.id,i);null!=o?o.namespaces=[].concat(r.namespaces):e.errorService.addError(new G({message:"Could not find document with identifier '"+r.id+"' for namespace override.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:{identifier:r.id,parsedDoc:r,docs:i}}))}}},e.getDocById=function(e,t){if(null==e||null==t||!t.length)return null;for(var n,i=x(t);!(n=i()).done;){var a=n.value;if(a.id===e)return a}return null},e.activeMapping=function(e){var t;return!(null==e||null===(t=e.mappings)||void 0===t||!t.activeMapping)},e.hasFieldAction=function(e){for(var t,n=x(e);!(t=n()).done;)if(t.value.actions.length>0)return!0;return!1},e.hasMappedCollection=function(e,t){var n=e.getMappedFields(t);return e.isFullyMapped()&&n[0].field&&n[0].field.isInCollection()},e.isPropertyField=function(e){return"io.atlasmap.v2.PropertyField"===(null==e?void 0:e.jsonType)},e.isConstantField=function(e){return"io.atlasmap.v2.ConstantField"===(null==e?void 0:e.jsonType)},e}(),Le=function(){function e(){}return e.serializeMappings=function(n,i){void 0===i&&(i=!0);for(var a,r=n.mappings,o=[],l=x(r.mappings.filter((function(e){return e.isFullyMapped()})));!(a=l()).done;){var s=a.value;try{var c=e.serializeFieldMapping(n,s,s.uuid,i);c&&(o=o.concat(c))}catch(e){n.errorService.addError(new G({message:"Caught exception while attempting to serialize mapping, skipping. ",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:{input:{mapping:s,"mapping def":r},error:e}}))}}var u=e.serializeLookupTables(n.mappings),p=e.serializeConstants(n.constantDoc),d=e.serializeProperties(n.sourcePropertyDoc),f=e.serializeProperties(n.targetPropertyDoc);return{AtlasMapping:{jsonType:"io.atlasmap.v2.AtlasMapping",dataSource:e.serializeDocuments(n.sourceDocs.concat(n.targetDocs),r),mappings:{mapping:this.sortMappings(n,o)},name:n.mappings.name?n.mappings.name:void 0,version:n.mappings.version,lookupTables:{lookupTable:u},constants:{constant:p},properties:{property:d.concat(f)}}}},e.sortMappings=function(e,t){var n=[];if(t.length>0)for(var i=0;i<e.targetDocs[0].fieldPaths.length&&n.length<t.length;i++)!function(){var a=e.targetDocs[0].fieldPaths[i],r=t.find((function(e){return e.outputField[0].path===a}));r&&n.push(r)}();return n},e.serializeFieldMapping=function(n,i,a,r){void 0===r&&(r=!0);var o,l=e.serializeFields(i,!0,n,r),s=e.serializeFields(i,!1,n,r),c=n.expressionService.getMappingExpressionStr(!1,i);if(i.transition.isManyToOneMode()||i.transition.isForEachMode()||i.transition.isExpressionMode()){var u=[];i.transition.transitionFieldAction&&(u[0]=this.serializeAction(i.transition.transitionFieldAction,n));var p={jsonType:"io.atlasmap.v2.FieldGroup",actions:u,field:l};o=c.length>0?{jsonType:"io.atlasmap.v2.Mapping",id:a,expression:c,inputFieldGroup:p,outputField:s}:{jsonType:"io.atlasmap.v2.Mapping",id:a,inputFieldGroup:p,outputField:s}}else{if(i.transition.isOneToManyMode()&&i.transition.transitionFieldAction){var d=this.serializeAction(i.transition.transitionFieldAction,n);l[0].actions||(l[0].actions=[]),d&&l[0].actions.unshift(d)}var f;if(c.length>0)if(null!==(f=l[0].jsonType)&&void 0!==f&&f.includes("FieldGroup")){for(var m=l[0],g=1;g<l.length;g++){var v;if(null!==(v=l[g].jsonType)&&void 0!==v&&v.includes("FieldGroup")){var h,E=l[0],y=l[g];y.field&&E.field&&y.field[0].path===E.field[0].path&&(null===(h=m.field)||void 0===h||h.push(y.field[0]))}}o={jsonType:"io.atlasmap.v2.Mapping",id:a,expression:c,inputFieldGroup:m,outputField:s}}else o={jsonType:"io.atlasmap.v2.Mapping",id:a,expression:c,inputField:l,outputField:s};else o={jsonType:"io.atlasmap.v2.Mapping",id:a,inputField:l,outputField:s}}return i.transition.isEnumerationMode()&&(o.mappingType=t.MappingType.LOOKUP,i.transition.lookupTableName&&(o.lookupTableName=i.transition.lookupTableName)),o},e.extractCheckVersion=function(e,n){var i=n.initializationService.getUIVersion(),a=this.deserializeAtlasMappingVersion(e),r=a.split("."),o=i.split(".");(a.length>0&&(o.length<2||r.length<2)||+o[0]<+r[0]||+o[1]<+r[1])&&n.errorService.addError(new G({message:"Mappings file version mismatch.  Expected "+i+", detected "+a,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER})),n.mappings.version=i},e.deserializeMappingServiceJSON=function(t,n){try{for(var i,a=x(e.deserializeConstants(t));!(i=a()).done;)n.constantDoc.addField(i.value);for(var r,o=x(e.deserializeProperties(n,t,!0));!(r=o()).done;)n.sourcePropertyDoc.addField(r.value);for(var l,s=x(e.deserializeProperties(n,t,!1));!(l=s()).done;)n.targetPropertyDoc.addField(l.value);n.mappings||(n.mappings=new Fe),n.mappings.name=this.deserializeAtlasMappingName(t),this.extractCheckVersion(t,n),n.mappings.parsedDocs=n.mappings.parsedDocs.concat(e.deserializeDocs(t,n.mappings)),n.mappings.mappings=n.mappings.mappings.concat(e.deserializeMappings(t,n));for(var c,u=x(e.deserializeLookupTables(t));!(c=u()).done;)n.mappings.addTable(c.value);return Promise.resolve()}catch(e){return Promise.reject(e)}},e.deserializeAtlasMappingName=function(e){var t;return null!=e&&null!==(t=e.AtlasMapping)&&void 0!==t&&t.name?e.AtlasMapping.name:""},e.deserializeAtlasMappingVersion=function(e){var t;return null!=e&&null!==(t=e.AtlasMapping)&&void 0!==t&&t.version?e.AtlasMapping.version:""},e.addInputFieldGroupFields=function(t,n,i){for(var a,r=x(t);!(a=r()).done;){var o=a.value;"COMPLEX"===o.fieldType?e.addInputFieldGroupFields(o.field,n,i):e.deserializeMappedField(n,o,!0,i)}},e.deserializeFieldMapping=function(n,i){var a=new Ce;a.uuid=n.id,a.sourceFields=[],a.targetFields=[],a.referenceFields=[],a.transition.mode=t.TransitionMode.ONE_TO_ONE;var r="LOOKUP"===n.mappingType||null!=n.lookupTableName;if(n.mappingType&&n.mappingType!==t.MappingType.NONE)return this.deserializeFieldMappingFromType(a,n,i),a;if(n.inputFieldGroup)e.deserializeInputFieldGroup(n,a,i);else{var o,l=n.inputField;if(l)for(var s,c=x(l);!(s=c()).done;)e.deserializeMappedField(a,s.value,!0,i);null!==(o=n.outputField)&&void 0!==o&&o.length&&n.outputField.length>1&&(a.transition.mode=t.TransitionMode.ONE_TO_MANY),i.mappings&&ke.updateMappedFieldsFromDocuments(a,i,!0)}n.expression&&n.expression.length>0&&(a.transition.enableExpression=!0,a.transition.mode=t.TransitionMode.EXPRESSION,a.transition.expression=new $(a,i),a.transition.expression.insertText(n.expression));for(var u,p=x(n.outputField);!(u=p()).done;)e.deserializeMappedField(a,u.value,!1,i);return ke.updateMappedFieldsFromDocuments(a,i,!1),r&&(a.transition.lookupTableName=n.lookupTableName,a.transition.mode=t.TransitionMode.ENUM),a},e.deserializeInputFieldGroup=function(n,i,a){if(n.inputFieldGroup&&(n.expression&&n.inputFieldGroup.fieldType===t.FieldType.COMPLEX&&(i.transition.expression.hasComplexField=!0),i.transition.mode=t.TransitionMode.MANY_TO_ONE,e.addInputFieldGroupFields(n.inputFieldGroup.field,i,a),ke.updateMappedFieldsFromDocuments(i,a,!0),n.inputFieldGroup.actions)){var r,o,l;null!==(r=n.inputFieldGroup.actions[0])&&void 0!==r&&r.delimiter&&(i.transition.delimiter=null===(o=Se.delimiterToModel(null===(l=n.inputFieldGroup.actions[0])||void 0===l?void 0:l.delimiter))||void 0===o?void 0:o.delimiter);var s=n.inputFieldGroup.actions[0];if(s)if(s.Expression||"Expression"===s["@type"])i.transition.enableExpression=!0,i.transition.mode=t.TransitionMode.EXPRESSION,i.transition.expression=new $(i,a),i.transition.expression.insertText(s.Expression?s.Expression.expression:s.expression);else{i.transition.mode=t.TransitionMode.MANY_TO_ONE;var c=this.parseAction(s);c.definition=a.fieldActionService.getActionDefinitionForName(c.name,t.Multiplicity.MANY_TO_ONE),i.transition.transitionFieldAction=c}}},e.deserializeAudits=function(e,n){var i=[];if(null==e||!e.audit)return i;for(var a,r=x(e.audit);!(a=r()).done;){var o=a.value;i.push(new G({message:o.status+"["+o.path+"]: "+o.message,level:t.ErrorLevel[o.status],scope:t.ErrorScope.MAPPING,type:n,object:o.value}))}return i},e.createInputFieldGroup=function(e,n,i,a){var r={jsonType:"io.atlasmap.v2.FieldGroup",actions:[],docId:i,path:a,field:e};return n&&(r.fieldType=t.FieldType.COMPLEX),r},e.serializeDocuments=function(e,n){for(var i,a=[],r=x(e);!(i=r()).done;){var o=i.value,l={jsonType:"io.atlasmap.v2.DataSource",id:o.id,name:o.name,description:o.description,uri:o.uri,dataSourceType:o.isSource?t.DataSourceType.SOURCE:t.DataSourceType.TARGET};if(null!=o.characterEncoding&&(l.characterEncoding=o.characterEncoding),null!=o.locale&&(l.locale=o.locale),o.type===t.DocumentType.XML||o.type===t.DocumentType.XSD){var s=l;s.jsonType="io.atlasmap.xml.v2.XmlDataSource";for(var c,u=[],p=x(o.namespaces);!(c=p()).done;){var d=c.value;u.push({alias:d.alias,uri:d.uri,locationUri:d.locationUri,targetNamespace:d.isTarget})}!o.isSource&&n.templateText&&(s.template=n.templateText),s.xmlNamespaces={xmlNamespace:u}}else if(o.type===t.DocumentType.JSON){var f=l;!o.isSource&&n.templateText&&(f.template=n.templateText),f.jsonType="io.atlasmap.json.v2.JsonDataSource"}a.push(l)}return a},e.serializeConstants=function(e){for(var t,n=[],i=x(e.fields);!(t=i()).done;){var a=t.value;n.push({name:a.name,value:a.value,fieldType:a.type})}return n},e.serializeProperties=function(e){for(var n,i=[],a=x(e.fields);!(n=a()).done;){var r=n.value;i.push({name:r.name,fieldType:r.type,scope:r.scope,dataSourceType:e.isSource?t.DataSourceType.SOURCE:t.DataSourceType.TARGET})}return i},e.serializeLookupTables=function(e){var t=[],n=e.getTables();if(!n||!n.length)return t;for(var i,a=x(n);!(i=a()).done;){for(var r,o=i.value,l=[],s=x(o.lookupEntry);!(r=s()).done;){var c=r.value;l.push({sourceValue:c.sourceValue,sourceType:c.sourceType,targetValue:c.targetValue,targetType:c.targetType})}t.push({lookupEntry:l,name:o.name})}return t},e.processCollectionPreview=function(t,n,i){n.path=t.path.replace("<>","<0>");var a=e.createInputFieldGroup([n],!0,t.docDef.id,t.path);i.push(a)},e.processActionArguments=function(e,n){var i={};if(null===e)return i;for(var a,r=x(e.argumentValues);!(a=r()).done;){var o,l=a.value;if(null===(o=e.definition)||void 0===o||!o.isCustom||!["methodName","className","name"].includes(l.name)){i[l.name]=l.value;var s=e.definition.getArgumentForName(l.name);null!=s?"INTEGER"===s.type&&(i[l.name]=parseInt(l.value,10)):n.errorService.addError(new G({message:"Cannot find action argument "+l.name+": "+l.value,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:e}))}}return i},e.serializeFields=function(n,i,a,r){void 0===r&&(r=!1);for(var o,l=null,s=null,c=[],u=x(n.getMappedFields(i));!(o=u()).done;){var p,d=o.value;if(d.field&&!d.isPadField()){var f=d.field,m={jsonType:f.documentField.jsonType,name:f.name,path:f.path,fieldType:f.type,docId:f.docDef.id};null!==(p=f.documentField.jsonType)&&void 0!==p&&p.includes("io.atlasmap.xml.v2")&&(m.attribute=f.isAttribute),r&&!f.isConstant()||(m.value=f.value?f.value:""),f.docDef.type===t.DocumentType.XML||f.docDef.type===t.DocumentType.XSD?m.userCreated=f.userCreated:f.docDef.type!==t.DocumentType.JAVA||f.isPrimitive||(m.className=f.classIdentifier),f.isProperty()?(m.jsonType="io.atlasmap.v2.PropertyField",m.name=f.name,m.scope=f.scope,m.path=a.documentService.getPropertyPath(f.scope,f.name)):f.isConstant()?(m.jsonType="io.atlasmap.v2.ConstantField",m.name=f.name):f.enumeration&&(m.jsonType=f.docDef.type===t.DocumentType.JSON?"io.atlasmap.json.v2.JsonEnumField":f.docDef.type===t.DocumentType.XML||f.docDef.type===t.DocumentType.XSD?"io.atlasmap.xml.v2.XmlEnumField":"io.atlasmap.java.v2.JavaEnumField");var g=n.getMappedFields(i).length>1;if((g=g||n.transition.isExpressionMode()&&i)&&(m.index=n.getIndexForMappedField(d)-1),f.docDef.type===t.DocumentType.CSV&&(m.column=f.column),this.serializeActions(a,d,m),i&&f.isInCollection()){var v=f.getCollectionParentField();if(n.referenceFieldExists(v.docDef.id,v.path)){if(null!==s){s.field.push(m);continue}(s=e.createInputFieldGroup([m],!0,v.docDef.id,v.path)).fieldType=v.documentField.fieldType,r?c.push(s):(s.path=v.path.replace("<>","<0>"),null===l&&(l=e.createInputFieldGroup([s],!0,v.docDef.id,v.path),s.fieldType=v.documentField.fieldType,c.push(l)))}else r?(c.push(m),l=null):e.processCollectionPreview(f,m,c)}else c.push(m),l=null}}return c},e.serializeActions=function(e,t,n){if(t.actions.length){for(var i,a=[],r=x(t.actions);!(i=r()).done;){var o=this.serializeAction(i.value,e);o&&a.push(o)}a.length>0&&(n.actions=a)}},e.serializeAction=function(t,n){var i=e.processActionArguments(t,n);return i["@type"]=t.definition.name,i},e.deserializeDocs=function(e,t){var n=[];if(!e||!e.AtlasMapping||!e.AtlasMapping.dataSource)return null;for(var i,a=x(e.AtlasMapping.dataSource);!(i=a()).done;){var r=i.value,o=new V;o.isSource="SOURCE"===r.dataSourceType,o.uri=r.uri,o.id=r.id,o.name=r.name?r.name:"",o.description=r.description;var l=r;if(l.xmlNamespaces&&l.xmlNamespaces.xmlNamespace)for(var s,c=x(l.xmlNamespaces.xmlNamespace);!(s=c()).done;){var u=s.value,p=new L;p.alias=u.alias,p.uri=u.uri,p.locationUri=u.locationUri,p.isTarget=!!u.targetNamespace&&u.targetNamespace,p.createdByUser=!0,o.namespaces.push(p)}l.template&&(t.templateText=l.template),n.push(o)}return n},e.deserializeMappings=function(t,n){var i,a=[];if(null===(i=t.AtlasMapping.mappings)||void 0===i||!i.mapping)return a;for(var r,o=x(t.AtlasMapping.mappings.mapping);!(r=o()).done;){var l=r.value;if("io.atlasmap.v2.Collection"===l.jsonType)for(var s,c=x(l.mappings.mapping);!(s=c()).done;)a.push(e.deserializeFieldMapping(s.value,n));else a.push(e.deserializeFieldMapping(l,n))}return a},e.deserializeFieldMappingFromType=function(n,i,a){"SEPARATE"===i.mappingType?(n.transition.mode=t.TransitionMode.ONE_TO_MANY,n.transition.transitionFieldAction=ne.create(a.fieldActionService.getActionDefinitionForName("Split",t.Multiplicity.ONE_TO_MANY)),n.transition.transitionFieldAction.setArgumentValue("delimiter",i.delimiter)):"LOOKUP"===i.mappingType?(n.transition.mode=t.TransitionMode.ENUM,n.transition.lookupTableName=i.lookupTableName):"COMBINE"===i.mappingType?(n.transition.mode=t.TransitionMode.MANY_TO_ONE,n.transition.transitionFieldAction=ne.create(a.fieldActionService.getActionDefinitionForName("Concatenate",t.Multiplicity.MANY_TO_ONE)),n.transition.transitionFieldAction.setArgumentValue("delimiter",i.delimiter)):n.transition.mode=t.TransitionMode.ONE_TO_ONE;for(var r,o=x(i.inputField);!(r=o()).done;)e.deserializeMappedField(n,r.value,!0,a);for(var l,s=x(i.outputField);!(l=s()).done;)e.deserializeMappedField(n,l.value,!1,a);ke.updateMappedFieldsFromDocuments(n,a,!0)},e.deserializeConstants=function(e){var t,n,i=[];if(null==e||null===(t=e.AtlasMapping)||void 0===t||null===(n=t.constants)||void 0===n||!n.constant)return i;for(var a,r=x(e.AtlasMapping.constants.constant);!(a=r()).done;){var o=a.value,l=new R;l.name=o.name,l.path="/"+l.name,l.value=o.value,l.type=o.fieldType,l.userCreated=!0,l.isAttribute=!1,i.push(l)}return i},e.deserializeProperties=function(e,n,i){var a,r,o=[];if(null==n||null===(a=n.AtlasMapping)||void 0===a||null===(r=a.properties)||void 0===r||!r.property)return o;for(var l,s=x(n.AtlasMapping.properties.property);!(l=s()).done;){var c=l.value;if(!(i&&c.dataSourceType===t.DataSourceType.TARGET||!i&&c.dataSourceType!==t.DataSourceType.TARGET)){var u=new R;u.name=c.name,u.type=c.fieldType,u.scope=c.scope,u.path=e.documentService.getPropertyPath(u.scope,u.name),u.userCreated=!0,u.isAttribute=!1,o.push(u)}}return o},e.deserializeLookupTables=function(e){var t=[];if(!(e&&e.AtlasMapping&&e.AtlasMapping.lookupTables&&e.AtlasMapping.lookupTables.lookupTable))return t;for(var n,i=x(e.AtlasMapping.lookupTables.lookupTable);!(n=i()).done;){var a=n.value,r=new ye;r.name=a.name;for(var o,l=x(a.lookupEntry);!(o=l()).done;){var s=o.value,c=new Ee;c.sourceValue=s.sourceValue,c.sourceType=s.sourceType,c.targetValue=s.targetValue,c.targetType=s.targetType,r.lookupEntry.push(c)}t.push(r)}return t},e.deserializeFieldActions=function(e,n,i,a,r){if(e.actions)for(var o,l=x(e.actions);!(o=l()).done;){var s=o.value,c=this.parseAction(s);c.definition="CustomAction"===s.name?a.fieldActionService.getActionDefinitionForName(s.argumentValues[0].value,t.Multiplicity.ONE_TO_ONE):a.fieldActionService.getActionDefinitionForName(c.name),null!=c.definition?(c.definition.populateFieldAction(c),r&&(s.Expression||"Expression"===s["@type"])?(i.transition.enableExpression=!0,i.transition.expression=new $(i,a),i.transition.expression.insertText(s.Expression?s.Expression.expression:s.expression)):r&&c.definition&&[t.Multiplicity.ONE_TO_MANY,t.Multiplicity.MANY_TO_ONE].includes(c.definition.multiplicity)?(i.transition.transitionFieldAction&&a.logger.warn("Duplicated multiplicity transformations were detected:               "+i.transition.transitionFieldAction.name+" is being overwritten by "+c.name+" ..."),i.transition.transitionFieldAction=c):n.actions.push(c)):a.errorService.addError(new G({message:"Could not find field action definition for action '"+s.name+"'",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL}))}},e.deserializeMappedField=function(e,n,i,a){if(ke.isConstantField(n))n.docId?a.constantDoc.id=n.docId:n.docId=a.constantDoc.id;else if(ke.isPropertyField(n)){var r=i?a.sourcePropertyDoc:a.targetPropertyDoc;n.docId?r.id=n.docId:n.docId=r.id,n.path=a.documentService.getPropertyPath(n.scope,n.name)}else if(!n.docId)return a.errorService.addError(new G({message:"Parsed mapping field does not have document id, dropping.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:n})),null;var o=new Te;return o.mappingField=n,e.addMappedField(o,i),n.actions&&this.deserializeFieldActions(n,o,e,a,i),o},e.parseAction=function(t){return t["@type"]?e.parseNewAction(t):e.parseOldAction(t)},e.parseOldAction=function(e){for(var t=0,n=Object.keys(e);t<n.length;t++){var i=n[t];if(!e.hasOwnProperty(i))return null;var a=new ne;a.name=i;var r=e[i];if(r)for(var o=0,l=Object.keys(r);o<l.length;o++){var s=l[o];if(!r.hasOwnProperty(s))return null;var c=new ee;c.name=s;var u=r[s];u=null==u?null:u.toString(),c.value=u,a.argumentValues.push(c)}return a}return null},e.parseNewAction=function(e){var t=new ne;t.name=e["@type"];for(var n=0,i=Object.entries(e);n<i.length;n++){var a=i[n],r=a[0],o=a[1];if("@type"!==r){var l=new ee;l.name=r;var s=null==o?null:o.toString();l.value=s,t.argumentValues.push(l)}}return t},e}(),Ue=function(){function e(e){this.api=e,this.MAX_SEARCH_MATCH=1e4}var n=e.prototype;return n.initialize=function(){var e=this;this.mappingUpdatedSubscription=this.cfg.mappingService.mappingUpdated$.subscribe((function(){for(var t,n=x(e.cfg.getAllDocs());!(t=n()).done;){var i=t.value;i.initialized&&i.updateFromMappings(e.cfg.mappings)}}))},n.uninitialize=function(){this.mappingUpdatedSubscription.unsubscribe()},n.inspectDocuments=function(){var e=this;return new f.Observable((function(t){for(var n,i=function(){var i=n.value;if(i===e.cfg.sourcePropertyDoc||i===e.cfg.targetPropertyDoc||i===e.cfg.constantDoc)return i.initialized=!0,"continue";var a=Pe.fromDocumentDefinition(e.cfg,i);e.inspectDocument(a).then((function(){t.next(i)})).catch((function(e){t.error(e)}))},a=x(e.cfg.getAllDocs());!(n=a()).done;)i()}))},n.inspectDocument=function(e){var t=this;return new Promise((function(n,i){var a=e.doc;if(a.inspectionResult){var r=JSON.parse(a.inspectionResult);return e.parseResponse(r),a.initializeFromFields(),a.initialized=!0,void n(a)}if(!e.isOnlineInspectionCapable())return a.initialized=!0,a.errorOccurred=!0,void i(a);var o=e.request;t.cfg.logger.debug("Document Inspection Request: "+JSON.stringify(o.options.json)),t.api.post(o.url,o.options).json().then((function(i){t.cfg.logger.debug("Document Inspection Response: "+JSON.stringify(i)),e.parseResponse(i),a.initializeFromFields(),a.initialized=!0,n(a)})).catch((function(e){t.cfg.errorService.addBackendError("Failed to inspect Document: "+a.name+"("+a.id+")",e),a.errorOccurred=!0,i(e)}))}))},n.getLibraryClassNames=function(){var e=this;return new Promise((function(t,n){if(void 0!==e.cfg.initCfg.baseMappingServiceUrl){var i=e.cfg.initCfg.baseMappingServiceUrl+"library/list";e.cfg.logger.debug("Library Class List Service Request: "+i),e.api.get(i).json().then((function(n){e.cfg.logger.debug("Library Class List Service Response: "+JSON.stringify(n)),t(n.ArrayList)})).catch((function(i){204!==i.status?(e.cfg.errorService.addBackendError("Error occurred while accessing the user uploaded JARs from the runtime service.",i),n(i)):t([])}))}else t([])}))},n.importNonJavaDocument=function(e,n,i,a){var r=this;return new Promise((function(o){try{var l=!1,s=function(e){if(l)return e;var s=void 0;try{if(!(s=f))throw new Error(s)}catch(e){return r.handleError("Unrecognized document suffix ("+f+")"),void o(!1)}r.addNonJavaDocument(c,d+"-"+we.newGuid(),d,s,i?t.InspectionType.SCHEMA:t.InspectionType.INSTANCE,n,a).then((function(e){o(!!e)}))},c="",u=new FileReader;r.cfg.errorService.clearValidationErrors();var p=e.name.split("."),d=p.slice(0,-1).join("."),f=p[p.length-1].toUpperCase(),m=Ne((function(){return Promise.resolve(P.readFile(e,u)).then((function(e){c=e}))}),(function(e){r.cfg.errorService.addError(new G({message:"Unable to import the specified schema document.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER,object:e})),o(!1),l=!0}));return Promise.resolve(m&&m.then?m.then(s):s(m))}catch(e){return Promise.reject(e)}}))},n.importNonJavaDocumentFromEntaxyRegistry=function(e,n,i,a){var r=this;return new Promise((function(o){try{r.cfg.errorService.clearValidationErrors();var l=e.split("/").pop();if(!l)return r.cfg.errorService.addError(new G({message:"Invalid resource name.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER})),o(!1),Promise.resolve();var s=l.split("."),c=s.slice(0,-1).join("."),u=s[s.length-1].toUpperCase();return r.cfg.fileService.getFileContentFromRegistry(e).then((function(e){var l=void 0;try{if(!(l=u))throw new Error(l)}catch(e){return r.handleError("Unrecognized document suffix ("+u+")"),void o(!1)}r.addNonJavaDocument(e,c+"-"+we.newGuid(),c,l,i?t.InspectionType.SCHEMA:t.InspectionType.INSTANCE,n,a).then((function(e){o(!!e)}))})).catch((function(e){r.cfg.errorService.addError(new G({message:"Unable to import the specified schema document content from Entaxy registry.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER,object:e})),o(!1)})),Promise.resolve()}catch(e){return Promise.reject(e)}}))},n.createNonJavaInstance=function(e,n,i,a){var r=this;return new Promise((function(o){try{r.cfg.errorService.clearValidationErrors();var l=void 0;try{if(!(l=e.type))throw new Error(l)}catch(n){return r.handleError("Unrecognized document suffix ("+e.type+")"),o(!1),Promise.resolve()}var s=e.name;return r.addNonJavaDocument(e.text,s+"-"+we.newGuid(),s,l,i?t.InspectionType.SCHEMA:t.InspectionType.INSTANCE,n,a).then((function(e){o(!!e)})),Promise.resolve()}catch(e){return Promise.reject(e)}}))},n.importJavaDocument=function(e,n,i,a){return void 0===i&&(i=t.CollectionType.NONE),this.cfg.errorService.clearValidationErrors(),this.addJavaDocument(e,n,i,a)},n.addNonJavaDocument=function(e,t,n,i,a,r,o){var l=Pe.fromNonJavaProperties(this.cfg,t,n,i,a,e,r,o);return this.doAddDocument(l)},n.addJavaDocument=function(e,n,i,a){void 0===i&&(i=t.CollectionType.NONE);var r=Pe.fromJavaProperties(this.cfg,e,n,i,a);return this.doAddDocument(r)},n.addDocument=function(e,n,i,a,r,o,l){return a===t.DocumentType.JAVA?this.addJavaDocument(n,o):this.addNonJavaDocument(e,n,i,a,r,o,l)},n.doAddDocument=function(e){var t=this;return new Promise((function(n){try{var i=e.doc,a=i.isSource;return t.inspectDocument(e).then((function(e){try{return 0===e.fields.length&&P.removeItemFromArray(i,a?t.cfg.sourceDocs:t.cfg.targetDocs),i.updateFromMappings(t.cfg.mappings),n(!0),Promise.resolve()}catch(e){return Promise.reject(e)}})).catch((function(e){var a;null===(a=t.cfg.logger)||void 0===a||a.error("Failed to inspect Document "+i.name+"("+i.id+")",e),i.errorOccurred=!0,n(!1)})),Promise.resolve()}catch(e){return Promise.reject(e)}}))},n.handleError=function(e,n){this.cfg.errorService.addError(new G({message:e,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:n}))},n.filterDocumentFields=function(e,n){for(var i,a=J.getConfig(),r=void 0===e||""===e,o=r,l=x(a.getDocs(n));!(i=l()).done;){var s=i.value;s.visibleInCurrentDocumentSearch=o;for(var c,u=x(s.getAllFields());!(c=u()).done;)c.value.visibleInCurrentDocumentSearch=o;if(!r)for(var p,d=0,f=x(s.getAllFields());!(p=f()).done;){var m=p.value;if((!m.visibleInCurrentDocumentSearch||m.collapsed)&&(m.visibleInCurrentDocumentSearch=m.name.toLowerCase().includes(e.toLowerCase()),m.visibleInCurrentDocumentSearch)){s.visibleInCurrentDocumentSearch=!0;for(var g=m.parentField;null!=g&&!g.visibleInCurrentDocumentSearch;)g.visibleInCurrentDocumentSearch=!0,g.collapsed=!1,g=g.parentField,d++;try{this.markChildrenVisible(m)}catch(e){a.errorService.addError(new G({message:e.message,level:t.ErrorLevel.INFO,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER}));break}if(d++>=this.MAX_SEARCH_MATCH){a.errorService.addError(new G({message:"The maximum number of fields matching the specified search filter has beeen exceeded  Try using a longer field filter.",level:t.ErrorLevel.INFO,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER}));break}}}}a.mappingService.notifyLineRefresh()},n.markChildrenVisible=function(e){e.visibleInCurrentDocumentSearch=!0,e.collapsed=!1;for(var t,n=x(e.children);!(t=n()).done;)this.markChildrenVisible(t.value)},n.createConstant=function(e,n,i,a){var r=this.cfg.constantDoc.getField("/"+e);r||(r=new R),r.name=e,r.path="/"+e,r.value=n,r.type=t.FieldType[i],r.docDef=this.cfg.constantDoc,r.userCreated=!0,this.cfg.constantDoc.addField(r),a&&this.cfg.mappingService.addFieldToActiveMapping(r),this.cfg.mappingService.notifyMappingUpdated()},n.deleteConstant=function(e){var t,n,i=this.cfg.constantDoc.getField("/"+e);if(i){this.cfg.mappingService.removeFieldFromAllMappings(i),this.cfg.constantDoc.removeField(i);var a=null===(t=this.cfg.mappings)||void 0===t?void 0:t.activeMapping,r=null==a||null===(n=a.transition)||void 0===n?void 0:n.expression;a&&r&&r.updateFieldReference(a),this.cfg.mappingService.notifyMappingUpdated()}},n.editConstant=function(e,n,i,a){var r=this.cfg.constantDoc.getField("/"+(a||e));r&&(i.length>0&&(r.type=t.FieldType[i]),n.length>0&&(r.value=n),a&&a!==e&&(r.name=e,r.path="/"+e,this.cfg.constantDoc.updateField(r,"/"+e)),this.cfg.mappingService.notifyMappingUpdated())},n.getConstantType=function(e){var n=J.getConfig().constantDoc.getField("/"+e);return n?n.type:t.FieldType.NONE},n.getConstantTypeIndex=function(e){var t=J.getConfig().constantDoc.getField("/"+e);if(!t)return 0;for(var n=0;n<M.length;n++)if(M[n].includes(t.type))return n;return 0},n.createProperty=function(e,n,i,a,r){var o=J.getConfig(),l=this.getPropertyPath(i,e),s=a?o.sourcePropertyDoc.getField(l):o.targetPropertyDoc.getField(l);s||(s=new R),s.name=e,s.type=t.FieldType[n],s.scope=i,s.path=l,s.userCreated=!0,a?(s.docDef=o.sourcePropertyDoc,o.sourcePropertyDoc.addField(s)):(s.docDef=o.targetPropertyDoc,o.targetPropertyDoc.addField(s)),r&&this.cfg.mappingService.addFieldToActiveMapping(s),o.mappingService.notifyMappingUpdated()},n.deleteProperty=function(e,t,n){var i,a,r=this.getPropertyPath(t,e),o=n?this.cfg.sourcePropertyDoc.getField(r):this.cfg.targetPropertyDoc.getField(r);if(o){this.cfg.mappingService.removeFieldFromAllMappings(o),n?this.cfg.sourcePropertyDoc.removeField(o):this.cfg.targetPropertyDoc.removeField(o);var l=null===(i=this.cfg.mappings)||void 0===i?void 0:i.activeMapping,s=null==l||null===(a=l.transition)||void 0===a?void 0:a.expression;l&&s&&s.updateFieldReference(l),this.cfg.mappingService.notifyMappingUpdated()}},n.editProperty=function(e,n,i,a,r,o){var l=this.getPropertyPath(i,e),s=a?this.cfg.sourcePropertyDoc.getField(l):this.cfg.targetPropertyDoc.getField(l);s&&(r&&(s.name=r),o&&(s.scope=o),s.type=t.FieldType[n],s.path=this.getPropertyPath(s.scope,s.name),a?this.cfg.sourcePropertyDoc.updateField(s,l):this.cfg.targetPropertyDoc.updateField(s,l),this.cfg.mappingService.notifyMappingUpdated())},n.getPropertyType=function(e,n,i){var a=i?this.cfg.sourcePropertyDoc.getField(this.getPropertyPath(n,e)):this.cfg.targetPropertyDoc.getField(this.getPropertyPath(n,e));return a?a.type:t.FieldType.NONE},n.getPropertyTypeIndex=function(e,t,n){var i=n?this.cfg.sourcePropertyDoc.getField(this.getPropertyPath(t,e)):this.cfg.targetPropertyDoc.getField(this.getPropertyPath(t,e));if(!i)return 0;for(var a=0;a<O.length;a++)if(O[a].includes(i.type))return a;return 0},n.getPropertyPath=function(e,t){var n="/";return e&&e.length>0&&(n+=e+"/"),n+t},e}(),Ve=function(){function e(){this.errors=[],this.formErrors=[],this.errorUpdatedSource=new f.Subject}e.filterWith=function(e,t,n){return e&&0!==e.length?e.filter((function(e){return(!e.mapping||t&&e.mapping===t)&&(!n||!e.level||e.level===n)})):[]};var n=e.prototype;return n.addError=function(){for(var e=this,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];i.forEach((function(n){n.object&&n.object.message&&(n.message+="\n"+n.object.message);var i=t.ErrorScope.FORM===n.scope?e.formErrors:e.errors;i.find((function(e){return e.message===n.message}))&&n.level!==t.ErrorLevel.INFO||i.unshift(n)})),this.emitUpdatedEvent()},n.addBackendError=function(e,n){this.addError(new G(0===(null==n?void 0:n.status)?{message:"Fatal network error: Unable to connect to the AtlasMap design runtime service.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:n}:{message:e,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:n}))},n.getErrors=function(){return Object.assign([],this.errors)},n.removeError=function(e,n){n===t.ErrorScope.FORM&&this.formErrorUpdatedSource&&!this.formErrorUpdatedSource.closed?this.formErrors=this.excludeByIdentifier(this.formErrors,e):this.errors=this.excludeByIdentifier(this.errors,e),this.emitUpdatedEvent()},n.resetAll=function(){this.clearAllErrors(),this.formErrors=[],this.formErrorUpdatedSource&&!this.formErrorUpdatedSource.closed&&this.formErrorUpdatedSource.complete()},n.clearAllErrors=function(){this.errors=[],this.emitUpdatedEvent()},n.clearPreviewErrors=function(){this.errors=this.errors.filter((function(e){return e.type!==t.ErrorType.PREVIEW})),this.emitUpdatedEvent()},n.clearValidationErrors=function(e){this.errors=this.errors.filter((function(n){return!(n.type===t.ErrorType.VALIDATION||e&&n.mapping&&n.mapping===e)})),this.emitUpdatedEvent()},n.clearFieldErrors=function(){this.errors=this.errors.filter((function(e){return e.scope!==t.ErrorScope.FIELD})),this.emitUpdatedEvent()},n.clearFormErrors=function(){this.formErrors=[],this.emitUpdatedEvent(t.ErrorScope.FORM)},n.subscribe=function(e){return this.errorUpdatedSource.subscribe(e)},n.createFormErrorChannel=function(){var e=this;return this.formErrorUpdatedSource&&!this.formErrorUpdatedSource.closed&&this.formErrorUpdatedSource.complete(),this.formErrors=[],this.formErrorUpdatedSource=new f.Subject,this.formErrorUpdatedSource.subscribe({complete:function(){return e.formErrors=[]}}),this.formErrorUpdatedSource},n.isRequiredFieldValid=function(e,n){return null!=e&&""!==e||(this.addError(new G({message:n+" is required.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.FORM})),this.emitUpdatedEvent(t.ErrorScope.FORM),!1)},n.emitUpdatedEvent=function(e){t.ErrorScope.FORM===e?this.formErrorUpdatedSource&&!this.formErrorUpdatedSource.closed&&this.formErrorUpdatedSource.next(this.formErrors):this.errorUpdatedSource.next(this.errors)},n.excludeByIdentifier=function(e,t){return e.filter((function(e){return e.identifier!==t}))},e}(),ze=function(){function e(e){var n;this.api=e,this.cfg=J.getConfig(),this.actions=((n={})[t.Multiplicity.ONE_TO_ONE]=[],n[t.Multiplicity.ONE_TO_MANY]=[],n[t.Multiplicity.MANY_TO_ONE]=[],n[t.Multiplicity.ZERO_TO_ONE]=[],n[t.Multiplicity.MANY_TO_MANY]=[],n),this.isInitialized=!1,this.headers={"Content-Type":"applicaton/json; param1=application/octet-stream",Accept:"applicaton/json, application/octet-stream"}}var n=e.prototype;return n.fetchFieldActions=function(){try{var e=this;return Promise.resolve(new Promise((function(n){if(e.cfg.preloadedFieldActionMetadata){if(e.clearActionDefinitions(),e.cfg.preloadedFieldActionMetadata.ActionDetails)for(var i,a=x(e.cfg.preloadedFieldActionMetadata.ActionDetails.actionDetail);!(i=a()).done;){var r=e.extractFieldActionDefinition(i.value);r.multiplicity?"Expression"!==r.name&&e.actions[r.multiplicity].push(r):e.cfg.logger.info("Field action ("+r.name+") is missing multiplicity, ingoring")}return e.sortFieldActionDefinitions(),e.isInitialized=!0,void n(!0)}if(null==e.cfg.mappingService||null==e.cfg.initCfg.baseMappingServiceUrl)return e.cfg.errorService.addError(new G({message:"Mapping service URL is not provided. Field Actions will not be used.",level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL})),e.isInitialized=!0,void n(!1);e.doFetchFieldActions().then((function(t){1===t.length&&(e.cfg.logger.info("No field action was returned from backend"),n(!1)),e.clearActionDefinitions(),t.forEach((function(t){t.multiplicity?"Expression"!==t.name&&e.actions[t.multiplicity].push(t):e.cfg.logger.info("Field action  ("+t.name+") is missing multiplicity, ignoring")})),e.sortFieldActionDefinitions(),e.isInitialized=!0,n(!0)})).catch((function(t){e.cfg.errorService.addBackendError("Could not load field action configs: ("+t.message+")",t),n(!1)}))})))}catch(e){return Promise.reject(e)}},n.getActionDefinitionForName=function(e,t){if(!this.actions||!e)return null;var n=[];t?n=this.actions[t]:Object.values(this.actions).forEach((function(e){return n=n.concat(e)}));for(var i,a=x(n);!(i=a()).done;){var r=i.value;if(e===r.name)return r}return null},n.getActionsAppliesToField=function(e,n,i){var a=this;return void 0===n&&(n=!0),void 0===i&&(i=t.Multiplicity.ONE_TO_ONE),e&&this.actions?this.actions[i].filter((function(t){return a.appliesToField(t,e,n)})):[]},n.doFetchFieldActions=function(){var e=this;return new Promise((function(t,n){var i=[],a=e.cfg.initCfg.baseMappingServiceUrl+"fieldActions";e.cfg.logger.debug("Field Action Config Request"),e.api.get(a,{headers:e.headers}).json().then((function(n){var a,r;if(e.cfg.logger.debug("Field Action Config Response: "+JSON.stringify(n)),null!=n&&null!==(a=n.ActionDetails)&&void 0!==a&&null!==(r=a.actionDetail)&&void 0!==r&&r.length)for(var o,l=x(n.ActionDetails.actionDetail);!(o=l()).done;){var s=e.extractFieldActionDefinition(o.value);i.push(s)}t(i)})).catch((function(e){n(e)}))}))},n.extractFieldActionDefinition=function(e){this.cfg.logger.trace("Deserializing field action definition: "+JSON.stringify(e));var n=new te;if(n.name=e.name,n.isCustom=e.custom,n.sourceType=e.sourceType,n.targetType=e.targetType,n.method=e.method,n.multiplicity=e.multiplicity,n.serviceObject=e,e.actionSchema)for(var i=function(){var i=r[a],o=e.actionSchema.properties[i];if("@type"===i)return n.name=o.const,"continue";var l=o.type.toUpperCase(),s=l?t.FieldType[l]:t.FieldType.STRING,c=new Q;if(c.name=i,c.type=s,o.enum)c.values=o.enum;else if(o.getValuesFromParameters){var u,p,d=null===(u=e.parameters)||void 0===u||null===(p=u.parameter)||void 0===p?void 0:p.find((function(e){return e.name===i}));d&&d.values&&d.values.length>0&&(c.values=d.values)}c.serviceObject=o,n.arguments.push(c)},a=0,r=Object.keys(e.actionSchema.properties);a<r.length;a++)i();return n},n.sortFieldActionDefinitions=function(){var e=this;Object.keys(this.actions).forEach((function(t){var n=e.actions[t],i=[];if(null!=n&&0!==n.length){for(var a,r={},o=[],l=x(n);!(a=l()).done;){var s=a.value,c=s.name,u=r[c];u||(u=[],o.push(c)),u.push(s),r[c]=u}o.sort();for(var p=0,d=o;p<d.length;p++)for(var f,m=x(r[d[p]]);!(f=m()).done;)i.push(f.value);e.actions[t]=i}}))},n.appliesToField=function(e,t,n){if(null==t)return!1;var i=this.getActualField(t,!0),a=this.getActualField(t,!1);return!(n&&null==i||!n&&null==a)&&(n?this.appliesToSourceField(e,t,i):this.appliesToTargetField(e,t,a))},n.getActualField=function(e,t){return e.getFields(t).find((function(e){return"<padding field>"!==e.name}))},n.appliesToSourceField=function(e,t,n){return!!this.matchesDate(e.sourceType,n.type)||!!this.matchesNumeric(e.sourceType,n.type)||"ANY"===e.sourceType||n.type===e.sourceType},n.appliesToTargetField=function(e,n,i){return!(null==i||e.multiplicity!==t.Multiplicity.ONE_TO_ONE||!(this.matchesDate(e.sourceType,i.type)&&this.matchesDate(e.targetType,i.type)||this.matchesNumeric(e.sourceType,i.type)&&this.matchesNumeric(e.targetType,i.type))&&("ANY"!==e.sourceType&&e.sourceType!==i.type||"ANY"!==e.targetType&&i.type!==e.targetType))},n.matchesDate=function(e,t){return"ANY"===e||"ANY_DATE"===e&&-1!==["DATE","DATE_TIME","DATE_TIME_TZ","TIME"].indexOf(t)},n.matchesNumeric=function(e,t){return"ANY"===e||"NUMBER"===e&&-1!==["LONG","INTEGER","FLOAT","DOUBLE","SHORT","BYTE","DECIMAL","NUMBER"].indexOf(t)},n.clearActionDefinitions=function(){var e=this;Object.keys(t.Multiplicity).forEach((function(t){return e.actions[t]=[]}))},e}();(Ie=t.FileName||(t.FileName={})).DIGEST="Mapping digest file",Ie.ADM="ADM archive file",Ie.JAR="Jar file",(xe=t.FileType||(t.FileType={})).DIGEST="GZ",xe.ADM="ZIP",xe.JAR="JAR";var Be=function(){function e(e){this.api=e}var n=e.prototype;return n.findMappingFiles=function(e){var t=this;return new Promise((function(n,i){var a=t.cfg.initCfg.baseMappingServiceUrl+"mappings"+(null==e?"":"?filter="+e);t.cfg.logger.debug("Mapping List Request"),t.api.get(a).json().then((function(e){t.cfg.logger.debug("Mapping List Response: "+JSON.stringify(e)),n(e.StringMap.stringMapEntry.map((function(e){return e.name})))})).catch((function(e){204!==e.status&&(t.cfg.errorService.addBackendError("Error occurred while accessing the current mapping files from the runtime service.",e),i(e))}))}))},n.getCurrentMappingDigest=function(){var e=this;return new Promise((function(n,i){e.getCurrentFile(t.FileName.DIGEST,t.FileType.DIGEST).then((function(e){if(e){var t=m.inflate(e),i=(new v.TextDecoder).decode(t),a=P.objectize(i);n(a)}else n(null)})).catch((function(e){i(e)}))}))},n.getCurrentADMArchive=function(){return this.getCurrentFile(t.FileName.ADM,t.FileType.ADM)},n.getCurrentFile=function(e,t){var n=this;return new Promise((function(i,a){var r=n.cfg.initCfg.baseMappingServiceUrl+"mapping/"+t+"/";n.cfg.logger.debug("Get Current "+e+" Request: "+r),n.api.get(r,{headers:{"Content-Type":"application/octet-stream",Accept:"application/octet-stream","Response-Type":"application/octet-stream"}}).arrayBuffer().then((function(t){n.cfg.logger.debug("Get Current "+e+" Response: "+JSON.stringify(t)),i(t.byteLength?new Uint8Array(t):null)})).catch((function(t){204!==t.status&&(n.cfg.errorService.addBackendError("Error occurred while accessing the "+e+" from the runtime service.",t),a(t))}))}))},n.putFileIntoRegistry=function(e,t){var n=this;return new Promise((function(i,a){var r=encodeURIComponent(e),o=n.cfg.initCfg.baseMappingServiceUrl+"mapping/ntxregistry/"+r;n.cfg.logger.debug("Put file into Entaxy registry, Request: "+o),n.api.put(o,{headers:{"Content-Type":"application/octet-stream",Accept:"application/json","Response-Type":"application/json"},body:t}).arrayBuffer().then((function(e){n.cfg.logger.debug("Put file into Entaxy registry, Response: "+JSON.stringify(e)),i(!0)})).catch((function(e){204!==e.status&&(n.cfg.errorService.addBackendError("Error occurred while putting file into Entaxy registry.",e),a(e))}))}))},n.resetMappings=function(){var e=this;return new Promise((function(t){var n=e.cfg.initCfg.baseMappingServiceUrl+"mapping/RESET";e.cfg.logger.debug("Reset Mappings Request"),e.api.delete(n).arrayBuffer().then((function(n){return e.cfg.logger.debug("Reset Mappings Response: "+JSON.stringify(n)),t(!0),n})).catch((function(n){e.cfg.errorService.addBackendError("Error occurred while resetting mappings.",n),t(!1)}))}))},n.resetLibs=function(){var e=this;return new Promise((function(t){var n=e.cfg.initCfg.baseMappingServiceUrl+"mapping/resetLibs";e.cfg.logger.debug("Reset Libs Request"),e.api.delete(n).arrayBuffer().then((function(n){return e.cfg.logger.debug("Reset Libs Response: "+JSON.stringify(n)),t(!0),n})).catch((function(n){e.cfg.errorService.addBackendError("Error occurred while resetting user-defined JAR libraries.",n),t(!1)}))}))},n.resetAll=function(){var e=this;return new Promise((function(t){e.cfg.errorService.resetAll(),e.cfg.fileService.resetMappings().then((function(){try{return e.cfg.mappings=null,e.cfg.clearDocs(),J.getConfig().openedArchiveFileLocation=null,e.cfg.fileService.resetLibs().then((function(e){t(e)})).catch((function(n){e.cfg.errorService.addBackendError("Failed to remove jar files: "+n.message,n),t(!1)})),Promise.resolve()}catch(e){return Promise.reject(e)}})).catch((function(n){e.cfg.errorService.addBackendError("Failed to remove mappings: "+n.message,n),t(!1)}))}))},n.setMappingToService=function(e){var t=JSON.stringify(e);return this.setMappingStringToService(t)},n.setMappingStringToService=function(e){var t=this;return new Promise((function(n){var i=t.cfg.initCfg.baseMappingServiceUrl+"mapping/JSON";t.cfg.logger.debug("Set Mapping Request (set mapping): "+e),t.api.put(i,{headers:{"Content-Type":"application/json",Accept:"application/json","Response-Type":"application/json"},body:e}).arrayBuffer().then((function(e){t.cfg.logger.debug("Set Mapping Response: "+JSON.stringify(e)),n(!0)})).catch((function(e){t.cfg.errorService.addBackendError("Unable to update the mappings file to the AtlasMap design runtime service. "+e.status+" "+e.statusText,e),n(!1)}))}))},n.setMappingDigestToService=function(e){var n=this;return new Promise((function(i){var a,r=JSON.stringify(e),o=(new TextEncoder).encode(r);try{a=m.gzip(o)}catch(e){return n.cfg.errorService.addError(new G({message:"Unable to compress the current data mappings.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:e})),void i(!1)}var l=n.cfg.initCfg.baseMappingServiceUrl+"mapping/GZ/0",s=new Blob([a],{type:"application/octet-stream"});n.setBinaryFileToService(s,l,t.FileName.DIGEST).then((function(e){i(e)}))}))},n.setADMArchiveFileToService=function(e){var n=this.cfg.initCfg.baseMappingServiceUrl+"mapping/ZIP/",i=new Blob([e],{type:"application/octet-stream"});return this.setBinaryFileToService(i,n,t.FileName.ADM)},n.setBinaryFileToService=function(e,t,n){var i=this;return new Promise((function(a){i.cfg.logger.debug("Set "+n+" Request"),i.api.put(t,{body:e}).arrayBuffer().then((function(e){i.cfg.logger.debug("Set "+n+" Response: "+JSON.stringify(e)),a(!0)})).catch((function(e){i.cfg.errorService.addBackendError("Unable to update the "+n+" to the AtlasMap design runtime service.\n              "+e.status+" "+e.statusText,e),a(!1)}))}))},n.importJarFile=function(e){var n=this;return new Promise((function(i){try{var a=n.cfg.initCfg.baseMappingServiceUrl+"library",r=new Blob([e],{type:"application/octet-stream"});return Promise.resolve(n.setBinaryFileToService(r,a,t.FileName.JAR)).then((function(e){var t=function(){if(e&&n.cfg.mappingService)return n.cfg.mappingService.notifyMappingUpdated(),Promise.resolve(n.cfg.fieldActionService.fetchFieldActions()).then((function(){i(!0)}));i(!1)}();if(t&&t.then)return t.then((function(){}))}))}catch(e){return Promise.reject(e)}}))},n.updateDigestFile=function(){var e=this;return new Promise((function(n){try{var i=Ne((function(){function t(){var t=je.generateMappingDigest(e.cfg,i);e.setMappingDigestToService(t).then((function(e){n(e)}))}var i=void 0,a=function(){if(e.cfg.mappings)return Promise.resolve(e.getCurrentMappingJson()).then((function(e){i=e}))}();return a&&a.then?a.then(t):t()}),(function(i){e.cfg.errorService.addError(new G({message:"Unable to update mapping digest file.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:i})),n(!1)}));return Promise.resolve(i&&i.then?i.then((function(){})):void 0)}catch(e){return Promise.reject(e)}}))},n.exportADMArchive=function(e){var n=this;return new Promise((function(i){n.updateDigestFile().then((function(){n.getCurrentADMArchive().then((function(a){try{if(null===a)return i(!1),Promise.resolve();"adm"!==e.split(".").pop()&&(e=e.concat(".adm"));var r=new Blob([a],{type:"application/octet-stream"});return P.writeFile(r,e).then((function(e){i(e)})).catch((function(e){n.cfg.errorService.addError(new G({message:"Unable to save the current data mappings.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:e})),i(!1)})),Promise.resolve()}catch(e){return Promise.reject(e)}}))}))}))},n.exportADMArchiveIntoEntaxyRegistry=function(e){var n=this;return new Promise((function(i){n.updateDigestFile().then((function(){n.getCurrentADMArchive().then((function(a){try{if(null===a)return i(!1),Promise.resolve();if(null===e)return i(!1),n.cfg.errorService.addError(new G({message:"Unable to save the current data mappings.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER})),Promise.resolve();"adm"!==e.split(".").pop()&&(e=e.concat(".adm"));var r=a.buffer.slice(a.byteOffset,a.byteLength+a.byteOffset);return n.putFileIntoRegistry(e,r).then((function(a){J.getConfig().openedArchiveFileLocation=e,i(a),n.cfg.errorService.addError(new G({message:"Saving "+e+" is completed.",level:t.ErrorLevel.INFO,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.USER}))})).catch((function(e){n.cfg.errorService.addError(new G({message:"Unable to save the current data mappings.",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:e})),i(!1)})),Promise.resolve()}catch(e){return Promise.reject(e)}}))}))}))},n.importADMArchive=function(e){var n=this;return new Promise((function(i){n.resetAll().then((function(){var a=new FileReader;P.readBinaryFile(e,a).then((function(e){n.setADMArchiveFileToService(e).then((function(e){i(e)}))})).catch((function(a){n.cfg.errorService.addError(new G({message:"Unable to import the specified ADM file '"+e.name+"'",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:a})),i(!1)}))}))}))},n.getFileContentFromRegistry=function(e){var t=this;return new Promise((function(n,i){var a=encodeURIComponent(e),r=t.cfg.initCfg.baseMappingServiceUrl+"mapping/ntxregistry/content/"+a;t.cfg.logger.debug("Get file content from Entaxy registry "+e+", Request: "+r),t.api.get(r,{headers:{"Content-Type":"application/json",Accept:"application/json","Response-Type":"application/json"}}).text().then((function(i){t.cfg.logger.debug("Get file from Entaxy registry "+e+", Response: "+i),n(i)})).catch((function(e){204!==e.status&&(t.cfg.errorService.addBackendError("Error occurred while getting file from Entaxy registry.",e),i(e))}))}))},n.getFileFromRegistry=function(e){var t=this;return new Promise((function(n,i){var a=encodeURIComponent(e),r=t.cfg.initCfg.baseMappingServiceUrl+"mapping/ntxregistry/"+a;t.cfg.logger.debug("Get file from Entaxy registry "+e+", Request: "+r),t.api.get(r,{headers:{"Content-Type":"application/octet-stream",Accept:"application/octet-stream","Response-Type":"application/octet-stream"}}).arrayBuffer().then((function(i){t.cfg.logger.debug("Get file from Entaxy registry "+e+", Response: "+JSON.stringify(i)),n(i.byteLength?new Uint8Array(i):null)})).catch((function(e){204!==e.status&&(t.cfg.errorService.addBackendError("Error occurred while getting file from Entaxy registry.",e),i(e))}))}))},n.importADMArchiveFromEntaxyRegistry=function(e){var n=this;return new Promise((function(i){n.resetAll().then((function(){n.getFileFromRegistry(e).then((function(e){null!==e?n.setADMArchiveFileToService(e).then((function(e){i(e)})):i(!1)})).catch((function(a){n.cfg.errorService.addError(new G({message:"Unable to import the ADM file from Entaxy registry location "+e,level:t.ErrorLevel.ERROR,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL,object:a})),i(!1)}))}))}))},n.getCurrentMappingJson=function(){var e=this;return new Promise((function(t,n){if(null!==e.cfg.mappings){e.cfg.mappingFiles[0]=e.cfg.mappings.name;var i=e.cfg.initCfg.baseMappingServiceUrl+"mapping/JSON/";e.cfg.logger.debug("Get Current Mapping Request"),e.api.get(i).json().then((function(n){e.cfg.logger.debug("Get Current Mapping Response: "+JSON.stringify(n)),t(n)})).catch((function(i){204!==i.status?(e.cfg.errorService.addBackendError("Error occurred while accessing the current mappings from the backend service.",i),n(i)):t(void 0)}))}else n()}))},D(e,[{key:"cfg",get:function(){return this._cfg},set:function(e){this._cfg=e,this._cfg.logger||(this._cfg.logger=g.getLogger("file-management"))}}]),e}(),Je=function(){function e(){}var n=e.prototype;return n.willClearOutSourceFieldsOnTogglingExpression=function(){var e,t;return!(null===(e=this.cfg.mappings)||void 0===e||null===(t=e.activeMapping)||void 0===t||!t.transition.enableExpression)&&null!=this.cfg.mappings.activeMapping.getFirstCollectionField(!0)},n.isExpressionEnabledForActiveMapping=function(){var e,t,n;return!(null===(e=this.cfg.mappings)||void 0===e||null===(t=e.activeMapping)||void 0===t||null===(n=t.transition)||void 0===n||!n.enableExpression)},n.toggleExpressionMode=function(){var e=this;if(this.cfg.mappings&&this.cfg.mappings.activeMapping&&this.cfg.mappings.activeMapping.transition){var n,i=this.cfg.mappings.activeMapping;i.transition.mode!==t.TransitionMode.ONE_TO_MANY?(this.willClearOutSourceFieldsOnTogglingExpression()&&i.sourceFields.splice(0,i.sourceFields.length),i.transition.enableExpression=!i.transition.enableExpression,i.transition.enableExpression?(i.transition.mode=t.TransitionMode.EXPRESSION,i.transition.transitionFieldAction=null,this.mappingUpdatedSubscription=this.cfg.mappingService.mappingUpdated$.subscribe((function(){e.cfg&&e.cfg.mappings&&e.cfg.mappings.activeMapping&&e.cfg.mappings.activeMapping.isFullyMapped()&&e.updateExpression(e.cfg.mappings.activeMapping)})),i.transition.expression&&this.cfg.mappings.activeMapping.transition.expression.expressionUpdatedSource.next()):(null===(n=this.mappingUpdatedSubscription)||void 0===n||n.unsubscribe(),i.transition.mode=t.TransitionMode.ONE_TO_ONE,this.cfg.mappingService.updateActiveMappingTransition())):this.cfg.errorService.addError(new G({message:"Cannot establish a conditional mapping expression when multiple target fields are selected.\n        Please select only one target field and try again.",level:t.ErrorLevel.WARN,scope:t.ErrorScope.MAPPING,type:t.ErrorType.USER,mapping:i}))}else this.cfg.errorService.addError(new G({message:"Please select a mapping first.",level:t.ErrorLevel.INFO,scope:t.ErrorScope.MAPPING,type:t.ErrorType.USER}))},n.updateExpression=function(e,t,n){var i;null===(i=e.transition.expression)||void 0===i||i.updateFieldReference(e,t,n)},n.addFieldToExpression=function(e,t,n,i,a,r){var o,l=e.getMappedFieldByPath(n,!0,t);if(!l&&!(l=e.getReferenceField(t,n))){var s=this.cfg.getDocForIdentifier(t,!0),c=R.getField(n,null==s?void 0:s.getAllFields());if(c&&(this.updateExpression(e,i.getUuid(),r?i.toText().length:a),this.cfg.mappingService.addFieldToActiveMapping(c)),!(l=e.getMappedFieldByPath(n,!0,t)))return}null===(o=e.transition.expression)||void 0===o||o.addConditionalExpressionNode(l,i.getUuid(),r?i.str.length:a)},n.executeFieldSearch=function(e,n,i){var a=e.mappings.activeMapping;if(!a)return[];for(var r,o=[],l=x(e.getDocs(i));!(r=l()).done;)for(var s,c=r.value,u="",p=-1,d=x(c.getTerminalFields().concat(c.getComplexFields()));!(s=d()).done;){var f=s.value,m=[""],g=null==f?"":f.getFieldLabel(e.showTypes,!0);if(null==n||""===n||-1!==g.toLowerCase().indexOf(n.toLowerCase())){if(!e.mappingService.isFieldSelectable(a,f)&&f.type!==t.FieldType.COMPLEX)continue;if(u!==f.docDef.name){if(0===p){o.pop();continue}var v=[""];v[0]=u=f.docDef.name,v[1]=f.docDef.id,p=0,o.push(v)}g=P.extractDisplayPath(f.path,100),m[0]=f.docDef.id,m[1]=f.path,p++,o.push(m)}if(o.length>500){var h=[""];h[0]="** Displayable field limit reached **",h[1]="",p++,o.push(h);break}}return o},n.getMappingExpressionStr=function(e,t){if(!t&&!ke.activeMapping(this.cfg))return"";var n;if(t||(t=null===(n=this.cfg.mappings)||void 0===n?void 0:n.activeMapping),!t.transition.expression){if(!t.transition.enableExpression||!ke.hasFieldAction(t.sourceFields))return"";this.createMappingExpression(t)}return t.transition.expression&&t.transition.enableExpression?e?t.transition.expression.expressionHTML:t.transition.expression.toText(!0):""},n.createMappingExpression=function(e){var n,i,a,r,o="",l=e.getMappedFields(!0),s=ke.hasMappedCollection(e,!0),c=e.getMappedFields(!1),u=ke.hasMappedCollection(e,!1);return l.length>1||s&&(null===(n=e.transition.transitionFieldAction)||void 0===n||null===(i=n.definition)||void 0===i?void 0:i.multiplicity)===t.Multiplicity.MANY_TO_ONE?(o="Concatenate (",o+=this.fieldActionsToExpression(e),o+=", '"+Se.delimiterModels[e.transition.delimiter].actualDelimiter+"')"):(c.length>1||u)&&(null===(a=e.transition.transitionFieldAction)||void 0===a||null===(r=a.definition)||void 0===r?void 0:r.multiplicity)===t.Multiplicity.ONE_TO_MANY?(o="Split (",o+=this.fieldActionsToExpression(e),o+=")"):o+=this.fieldActionsToExpression(e),e.transition.expression=new $(e,this.cfg),e.transition.expression.insertText(o),o},n.qualifiedExpressionRef=function(e){var t,n,i,a;return null!==(null===(t=e.field)||void 0===t?void 0:t.path)?"${"+(null===(n=e.field)||void 0===n||null===(i=n.docDef)||void 0===i?void 0:i.id)+":"+(null===(a=e.field)||void 0===a?void 0:a.path)+"}":"null"},n.fieldActionArgumentToExpression=function(e,t){return"string"===t?"'"+e.value+"'":e.value},n.fieldActionToExpression=function(e,t){var n=e.actions[t],i=n.name+" (";if(t<e.actions.length-1?(t++,i+=this.fieldActionToExpression(e,t)):i+=this.qualifiedExpressionRef(e),n.argumentValues.length>0)for(var a=0;a<n.argumentValues.length;a++)i+=", "+this.fieldActionArgumentToExpression(n.argumentValues[a],n.definition.arguments[a].type);return i+")"},n.fieldActionsToExpression=function(e){for(var t,n="",i=0;i<e.sourceFields.length;i++)(t=e.sourceFields[i]).actions.length>0?n+=this.fieldActionToExpression(t,0):n+=this.qualifiedExpressionRef(t),i!==e.sourceFields.length-1&&(n+=", ");return n},e}(),Ge=function(){function e(e){this.api=e,this.lineRefreshSource=new f.Subject,this.lineRefresh$=this.lineRefreshSource.asObservable(),this.mappingUpdatedSource=new f.Subject,this.mappingUpdated$=this.mappingUpdatedSource.asObservable(),this.mappingSelectionRequiredSource=new f.Subject,this.mappingSelectionRequired$=this.mappingSelectionRequiredSource.asObservable(),this.lastValidation=Date.now()}var n=e.prototype;return n.fetchMappings=function(e,t){var n=this;return new Promise((function(e){n.cfg.fileService.getCurrentMappingJson().then((function(i){try{return i?(n.cfg.mappings=t,Le.deserializeMappingServiceJSON(i,n.cfg),n.updateMappingsTransition(),e(!0),Promise.resolve()):(e(!1),Promise.resolve())}catch(e){return Promise.reject(e)}})).catch((function(t){n.cfg.errorService.addBackendError("Failed to load mapping definition from backend:",t),e(!1)}))}))},n.updateMappingsTransition=function(){var e=this;this.cfg.mappings.getAllMappings(!0).forEach((function(t){return e.updateTransition(t)}))},n.updateActiveMappingTransition=function(){var e,t;null!==(e=this.cfg.mappings)&&void 0!==e&&e.activeMapping&&this.updateTransition(null===(t=this.cfg.mappings)||void 0===t?void 0:t.activeMapping)},n.removeMapping=function(e){try{var t=this;return Promise.resolve(new Promise((function(n){try{var i=function(){n(!0)},a=t.cfg.mappings.removeMapping(e),r=function(){if(a)return t.deselectMapping(),Promise.resolve(t.notifyMappingUpdated()).then((function(){}));t.deselectMapping()}();return Promise.resolve(r&&r.then?r.then(i):i())}catch(e){return Promise.reject(e)}})))}catch(e){return Promise.reject(e)}},n.removeAllMappings=function(){try{var e=this;return Promise.resolve(new Promise((function(t){try{for(var n,i=x(e.cfg.mappings.getAllMappings(!0));!(n=i()).done;)e.cfg.mappings.removeMapping(n.value),e.deselectMapping();return Promise.resolve(e.notifyMappingUpdated()).then((function(){t(!0)}))}catch(e){return Promise.reject(e)}})))}catch(e){return Promise.reject(e)}},n.updateMappedField=function(e){try{var t=this;return Promise.resolve(new Promise((function(n){try{return e.isEmpty()?(t.cfg.mappings.removeMapping(e),t.deselectMapping()):t.updateTransition(e),Promise.resolve(t.notifyMappingUpdated()).then((function(){n(!0)}))}catch(e){return Promise.reject(e)}})))}catch(e){return Promise.reject(e)}},n.moveMappedFieldTo=function(e,t,n){if(e&&t){var i=e.getMappedFields(t.isSource());i.splice(e.getIndexForMappedField(t)-1,1),i.splice(n-1,0,t),this.clearExtraPaddingFields(i,!0),this.notifyMappingUpdated()}},n.addPlaceholders=function(e,t,n,i){for(var a=null,r=0;r<e;r++)(a=new Te).field=new U(i),i?t.sourceFields.splice(n+r,0,a):t.targetFields.splice(n+r,0,a)},n.addFieldToActiveMapping=function(e){var n=this.cfg.mappings.activeMapping;if(n){var i=this.getFieldSelectionExclusionReason(n,e);null==i?(n.addField(e,!1),this.updateTransition(n),(n.sourceFields.length>0||n.targetFields.length>0)&&this.notifyMappingUpdated()):this.cfg.errorService.addError(new G({message:"The field '"+e.name+"' cannot be selected, "+i+".",level:t.ErrorLevel.ERROR,mapping:n,scope:t.ErrorScope.MAPPING,type:t.ErrorType.USER}))}else this.cfg.errorService.addError(new G({message:"No mapping is selected to add a field '"+e.name+"'",level:t.ErrorLevel.ERROR,scope:t.ErrorScope.MAPPING,type:t.ErrorType.USER}))},n.getFieldSelectionExclusionReason=function(e,t){if(!t.isTerminal())return"field is a parent field";if(0===e.getAllMappedFields().length)return null;var n=e.getMappedTarget(t);return null==n||t.isInCollection?e.isLookupMode()?t.enumeration?null:"only Enumeration fields are valid for this mapping":t.enumeration?"Enumeration fields are not valid for this mapping":e.transition.enableExpression&&!t.isSource()&&e.getMappedFields(!1).length>0?"cannot add multiple target fields when conditional mapping is enabled.":null:"it is already the target of another mapping ("+n+"). "},n.isFieldSelectable=function(e,t){return null==this.getFieldSelectionExclusionReason(e,t)},n.canAddToActiveMapping=function(e){var n,i=null===(n=this.cfg.mappings)||void 0===n?void 0:n.activeMapping;return!(!i||i.transition.mode===t.TransitionMode.ENUM&&i.sourceFields.length>0&&i.targetFields.length>0)&&(i.sourceFields.length<=1&&i.targetFields.length<=1||!(!e||!(i.targetFields.length<=1||0===i.sourceFields.length))||!e&&(i.sourceFields.length<=1||0===i.targetFields.length))},n.isFieldAddableToMapping=function(e,n){var i;return!(!e||!e.isTerminal()||e.type===t.FieldType.UNSUPPORTED||n&&n.transition.mode===t.TransitionMode.ENUM&&n.sourceFields.length>0&&n.targetFields.length>0)&&!!(e.isSource()||e.isCollection||e.isInCollection()||0===(null===(i=this.cfg.mappings)||void 0===i?void 0:i.findMappingsForField(e).length))&&(!n||(n.transition.mode===t.TransitionMode.EXPRESSION?e.isSource()||0===n.targetFields.length:!(e.isSource()&&n.sourceFields.find((function(t){return t.field===e}))||!e.isSource()&&n.targetFields.find((function(t){return t.field===e})))&&(e.isCollection||e.isInCollection()?e.isSource()?0===n.sourceFields.length:0===n.targetFields.length:e.isSource()?0===n.sourceFields.length||!n.sourceFields.find((function(e){var t,n;return(null===(t=e.field)||void 0===t?void 0:t.isCollection)||(null===(n=e.field)||void 0===n?void 0:n.isInCollection())}))&&n.targetFields.length<=1:0===n.targetFields.length||!n.targetFields.find((function(e){var t,n;return(null===(t=e.field)||void 0===t?void 0:t.isCollection)||(null===(n=e.field)||void 0===n?void 0:n.isInCollection())}))&&n.sourceFields.length<=1)))},n.isFieldAddableToActiveMapping=function(e){var t;return this.isFieldAddableToMapping(e,null===(t=this.cfg.mappings)||void 0===t?void 0:t.activeMapping)},n.isFieldDragAndDropAllowed=function(e,t){var n;if(!e||!t||e.isSource()&&t.isSource()||!e.isSource()&&!t.isSource())return!1;var i=e.isSource()?e:t,a=e.isSource()?t:e,r=null===(n=this.cfg.mappings)||void 0===n?void 0:n.activeMapping;if(r){if(r.isFieldMapped(i)&&r.isFieldMapped(a))return!1;if(r.isFieldMapped(i))return this.isFieldAddableToMapping(a,r);if(r.isFieldMapped(a))return this.isFieldAddableToMapping(i,r)}return this.isFieldAddableToMapping(i,null)&&this.isFieldAddableToMapping(a,null)},n.addNewMapping=function(e,t){t||this.deselectMapping();var n=new Ce;null!=e?(n.addField(e,!1),this.updateTransition(n),this.selectMapping(n),this.notifyMappingUpdated()):this.selectMapping(n)},n.newMapping=function(){this.deselectMapping();var e=new Ce;this.updateTransition(e),this.selectMapping(e),this.notifyMappingUpdated()},n.selectMapping=function(e){null!=e?(this.cfg.mappings.activeMapping=e,this.cfg.showMappingDetailTray=!0,this.mappingUpdatedSource.next()):this.deselectMapping()},n.deselectMapping=function(){this.cfg.showMappingDetailTray=!1,this.cfg.mappings.activeMapping=null,this.notifyMappingUpdated()},n.removeDocumentReferenceFromAllMappings=function(e){for(var t,n=x(this.cfg.mappings.getAllMappings(!0));!(t=n()).done;)for(var i,a=t.value,r=x(a.getAllFields());!(i=r()).done;){var o=i.value;o instanceof U||o.docDef.id!==e||(this.removeFieldFromAllMappings(o),0!==a.sourceFields.length&&0!==a.targetFields.length||(this.cfg.mappings.removeMapping(a),a===this.cfg.mappings.activeMapping&&this.cfg.mappingService.deselectMapping()))}},n.removeFieldFromAllMappings=function(e){for(var t,n=x(this.cfg.mappings.getAllMappings(!0));!(t=n()).done;){var i=t.value,a=i.getMappedFieldForField(e);null!=a&&(i.removeMappedField(a),i.isEmpty()&&this.cfg.mappings.removeMapping(i))}},n.validateMappings=function(e){try{var t=this;return Promise.resolve(new Promise((function(n){if(null!==t.cfg.initCfg.baseMappingServiceUrl&&null!==t.cfg.mappings){t.cfg.errorService.clearValidationErrors();var i=t.cfg.initCfg.baseMappingServiceUrl+"mapping/validate/"+t.cfg.mappingDefinitionId;t.cfg.logger.debug("Validation Service Request: "+JSON.stringify(e)+"\n");var a=Date.now();t.api.put(i,{json:e}).json().then((function(e){t.cfg.logger.debug("Validation Service Response: "+JSON.stringify(e)+"\n"),a>t.lastValidation?(t.lastValidation=a,t.processValidationResponse(e,n)):n(!1)})).catch((function(){t.cfg.logger.warn("Unable to fetch validation data."),n(!1)}))}else n(!1)})))}catch(e){return Promise.reject(e)}},n.processValidationResponse=function(e,n){var i,a=this;if(null!==this.cfg.mappings){var r=[];if(e&&e.Validations&&e.Validations.validation)for(var o,l=function(){var e=o.value,n=t.ErrorLevel[e.status?e.status:"ERROR"],i=t.ErrorScope[e.scope?e.scope:"MAPPING"],l=void 0;i&&i===t.ErrorScope.MAPPING&&e.id?(i=t.ErrorScope.MAPPING,a.cfg.mappings&&a.cfg.mappings.mappings&&(l=a.cfg.mappings.mappings.find((function(t){return t.uuid===e.id})))):i=t.ErrorScope.APPLICATION,r.push(new G({message:e.message,level:n,scope:i,mapping:l,type:t.ErrorType.VALIDATION}))},s=x(e.Validations.validation);!(o=s()).done;)l();(i=this.cfg.errorService).addError.apply(i,r),n(!0)}else n(!1)},n.notifyLineRefresh=function(){var e=this;setTimeout((function(){e.lineRefreshSource.next()}),1)},n.notifyMappingUpdated=function(){var e=this;return new Promise((function(t){try{var n=function(){e.mappingUpdatedSource.next(),e.notifyLineRefresh(),t(!0)},i=function(){if(e.cfg.mappings){var t=e.cfg.mappings.activeMapping;t&&-1===e.cfg.mappings.mappings.indexOf(t)&&e.cfg.mappings.mappings.push(t);var n=Le.serializeMappings(e.cfg);return Promise.resolve(e.validateMappings(n)).then((function(t){var i=function(){if(t)return Promise.resolve(e.cfg.fileService.setMappingToService(n)).then((function(){}))}();if(i&&i.then)return i.then((function(){}))}))}}();return Promise.resolve(i&&i.then?i.then(n):n())}catch(e){return Promise.reject(e)}}))},n.updateTransition=function(e){if(!e.transition.enableExpression){for(var n,i=x(e.getAllFields());!(n=i()).done;)if(n.value.enumeration)return e.transition.mode=t.TransitionMode.ENUM,void _e.populateMappingLookupTable(this.cfg.mappings,e);var a=e.getMappedFields(!0),r=ke.hasMappedCollection(e,!0),o=e.getMappedFields(!1),l=ke.hasMappedCollection(e,!1);if(r&&l)e.transition.mode=t.TransitionMode.FOR_EACH;else{if(a.length>1||r)return e.transition.mode=t.TransitionMode.MANY_TO_ONE,void(e.transition.transitionFieldAction&&e.transition.transitionFieldAction.definition&&e.transition.transitionFieldAction.definition.multiplicity===t.Multiplicity.MANY_TO_ONE||(e.transition.transitionFieldAction=ne.create(this.cfg.fieldActionService.getActionDefinitionForName("Concatenate",t.Multiplicity.MANY_TO_ONE)),e.transition.transitionFieldAction.setArgumentValue("delimiter"," "),e.transition.transitionFieldAction.setArgumentValue("delimitingEmptyValues","true")));var s;if(o.length>1||l)return e.transition.mode=t.TransitionMode.ONE_TO_MANY,void(e.transition.transitionFieldAction&&(null===(s=e.transition.transitionFieldAction.definition)||void 0===s?void 0:s.multiplicity)===t.Multiplicity.ONE_TO_MANY||(e.transition.transitionFieldAction=ne.create(this.cfg.fieldActionService.getActionDefinitionForName("Split",t.Multiplicity.ONE_TO_MANY)),e.transition.transitionFieldAction.setArgumentValue("delimiter"," "),e.transition.transitionFieldAction.setArgumentValue("collapseRepeatingDelimiters","false")));e.transition.mode=t.TransitionMode.ONE_TO_ONE,e.transition.transitionFieldAction=null}}},n.clearExtraPaddingFields=function(e,t){var n=0,i=null;for(n=e.length-1;n>=0;n--)if((i=e[n]).isPadField())P.removeItemFromArray(i,e);else if(t)break},n.getEnumerationValues=function(e,t){return _e.getEnumerationValues(e,t)},n.setEnumFieldValue=function(e,t){e.enumIndexValue=t},n.updateEnumerationValues=function(e,t,n){_e.updateEnumerationValues(e,t,n),this.notifyMappingUpdated()},n.isEnumerationMapping=function(e){return e.transition.mode===t.TransitionMode.ENUM},D(e,[{key:"cfg",get:function(){return this._cfg},set:function(e){var t=this;this._cfg=e,this._cfg.logger||(this._cfg.logger=g.getLogger("mapping-management")),this._cfg.logger.getLevel()<=this._cfg.logger.levels.DEBUG&&this.mappingUpdated$.subscribe((function(){t.cfg.mappings&&t.cfg.mappings&&t.cfg.mappings.activeMapping&&t.cfg.logger.info("mapping updated: "+JSON.stringify(Le.serializeMappings(t.cfg)))}))}}]),e}(),He=function(){function e(e){this.api=e,this.mappingPreviewInputSource=new f.Subject,this.mappingPreviewInput$=this.mappingPreviewInputSource.asObservable(),this.mappingPreviewOutputSource=new f.Subject,this.mappingPreviewOutput$=this.mappingPreviewOutputSource.asObservable(),this.mappingPreviewErrorSource=new f.Subject,this.mappingPreviewError$=this.mappingPreviewErrorSource.asObservable()}var n=e.prototype;return n.enableMappingPreview=function(){null!=this.cfg.initCfg.baseMappingServiceUrl&&(this.cfg.showMappingPreview=!0,this.mappingPreviewInputSubscription=this.createMappingPreviewSubscription(),this.mappingUpdatedSubscription=this.createMappingUpdatedSubscription())},n.createMappingPreviewSubscription=function(){var e=this;return this.mappingPreviewInput$.subscribe((function(n){if(n&&n.isFullyMapped()){for(var i,a=!1,r=x(n.getFields(!0));!(i=r()).done;)if(i.value.value){a=!0;break}if(!a)for(var o,l=x(n.getFields(!1));!(o=l()).done;)if(o.value.value){a=!0;break}if(a){var s=e.createPreviewRequestBody(n);e.cfg.logger.debug("Process Mapping Preview Request: "+JSON.stringify(s)),e.api.put(e.cfg.initCfg.baseMappingServiceUrl+"mapping/process",{json:s}).json().then((function(t){e.cfg.logger.debug("Process Mapping Preview Response: "+JSON.stringify(t)),e.processPreviewResponse(n,t)})).catch((function(i){e.cfg.mappings&&e.cfg.mappings.activeMapping&&e.cfg.mappings.activeMapping===n&&e.cfg.errorService.addError(new G({message:i,level:t.ErrorLevel.ERROR,mapping:n,scope:t.ErrorScope.MAPPING,type:t.ErrorType.PREVIEW})),e.mappingPreviewErrorSource.next([new G({message:i,level:t.ErrorLevel.ERROR})])}))}}}))},n.createPreviewRequestBody=function(e){return{ProcessMappingRequest:{jsonType:"io.atlasmap.v2.ProcessMappingRequest",mapping:Le.serializeFieldMapping(this.cfg,e,"preview",!1)}}},n.processPreviewResponse=function(e,n){for(var i,a=Le.deserializeFieldMapping(n.ProcessMappingResponse.mapping,this.cfg),r=x(e.targetFields);!(i=r()).done;)for(var o,l=i.value,s=x(a.targetFields);!(o=s()).done;){var c,u,p,d,f,m=o.value;if((null===(c=l.field)||void 0===c||null===(u=c.docDef)||void 0===u?void 0:u.id)===(null===(p=m.field)||void 0===p?void 0:p.docDef.id)&&(null===(d=l.field)||void 0===d?void 0:d.path)===(null===(f=m.field)||void 0===f?void 0:f.path)){var g;l.field.value=null===(g=m.mappingField)||void 0===g?void 0:g.value;var v=a.targetFields.indexOf(m);if(-1!==v){a.targetFields.splice(v,1);break}}}this.mappingPreviewOutputSource.next(a);var h,E=Le.deserializeAudits(n.ProcessMappingResponse.audits,t.ErrorType.PREVIEW);this.cfg.mappings.activeMapping===e&&(E.forEach((function(t){return t.mapping=e})),(h=this.cfg.errorService).addError.apply(h,E)),this.mappingPreviewErrorSource.next(E)},n.createMappingUpdatedSubscription=function(){var e=this;return this.cfg.mappingService.mappingUpdated$.subscribe((function(){e.cfg&&e.cfg.mappings&&e.cfg.mappings.activeMapping&&e.cfg.mappings.activeMapping.isFullyMapped()&&e.mappingPreviewInputSource.next(e.cfg.mappings.activeMapping)}))},n.disableMappingPreview=function(){var e,t,n=!1;if(this.cfg.showMappingPreview=!1,null!==(e=this.cfg.mappings)&&void 0!==e&&null!==(t=e.activeMapping)&&void 0!==t&&t.isFullyMapped())for(var i,a=x(this.cfg.mappings.getAllMappings(!0));!(i=a()).done;)for(var r,o=x(i.value.getAllFields());!(r=o()).done;){var l,s=r.value;(null===(l=s.value)||void 0===l?void 0:l.length)>0&&!s.isConstant()&&(s.value="",n=!0)}n&&this.cfg.mappingService.notifyMappingUpdated(),this.mappingUpdatedSubscription&&(this.mappingUpdatedSubscription.unsubscribe(),this.mappingUpdatedSubscription=void 0),this.mappingPreviewInputSubscription&&(this.mappingPreviewInputSubscription.unsubscribe(),this.mappingPreviewInputSubscription=void 0)},n.toggleMappingPreview=function(e){return e?this.enableMappingPreview():this.disableMappingPreview(),e},e}();g.setDefaultLevel(g.levels.WARN);var qe=function(){function e(e){this.api=e,this.cfg=J.getConfig(),this.systemInitializedSource=new f.Subject,this.systemInitialized$=this.systemInitializedSource.asObservable(),this.initializationStatusChangedSource=new f.Subject,this.initializationStatusChanged$=this.initializationStatusChangedSource.asObservable(),this.documentService=new Ue(this.api),this.mappingService=new Ge(this.api),this.errorService=new Ve,this.fieldActionService=new ze(this.api),this.fileService=new Be(this.api),this.previewService=new He(this.api),this.expressionService=new Je,this.resetConfig(),this.documentService.initialize()}var n=e.prototype;return n.resetConfig=function(){this.cfg=new J,this.cfg.documentService=this.documentService,this.cfg.documentService.cfg=this.cfg,this.cfg.mappingService=this.mappingService,this.cfg.mappingService.cfg=this.cfg,this.cfg.errorService=this.errorService,this.cfg.fieldActionService=this.fieldActionService,this.cfg.fieldActionService.cfg=this.cfg,this.cfg.fileService=this.fileService,this.cfg.fileService.cfg=this.cfg,this.cfg.previewService=this.previewService,this.cfg.previewService.cfg=this.cfg,this.cfg.expressionService=this.expressionService,this.cfg.expressionService.cfg=this.cfg,this.cfg.initializationService=this,this.cfg.logger=g.getLogger("config"),J.setConfig(this.cfg)},n.initialize=function(){var e=this;return new Promise((function(n){try{var i=!1,a=function(t){if(i)return t;e.updateLoadingStatus("Loading source/target documents.");var a=e.cfg.getAllDocs(),r=a[a.length-1];e.cfg.documentService.inspectDocuments().pipe(h.first((function(e){return e===r}))).subscribe({next:function(){var t=e.cfg.preloadedMappingJson;e.updateStatus(),e.systemInitializedSource.pipe(h.first()).subscribe((function(){if(t){var n=JSON.stringify(Le.serializeMappings(e.cfg));t!==n&&e.cfg.mappingService.notifyMappingUpdated()}}))}}),e.initializeWithMappingDigest().finally((function(){e.updateStatus()})),n(!0)};if(e.cfg.setConstantPropertyDocs(),e.cfg.errorService.resetAll(),e.cfg.fieldActionService.isInitialized=!1,e.cfg.initCfg.initialized=!1,e.cfg.initCfg.mappingInitialized=!1,null==e.cfg.mappingService?e.cfg.errorService.addError(new G({message:"Mapping service is not configured, validation service will not be used.",level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL})):null==e.cfg.initCfg.baseMappingServiceUrl&&e.cfg.errorService.addError(new G({message:"Mapping service URL is not configured, validation service will not be used.",level:t.ErrorLevel.WARN,scope:t.ErrorScope.APPLICATION,type:t.ErrorType.INTERNAL})),!e.cfg.fieldActionService)return e.handleError("FieldActionService is not configured"),n(!1),Promise.resolve();var r=Ne((function(){return Promise.resolve(e.runtimeServiceActive()).then((function(t){t||(e.handleError("The AtlasMap runtime service is not available."),n(!1),i=!0)}))}),(function(){e.handleError("The AtlasMap runtime service is not available."),n(!1),i=!0}));return Promise.resolve(r&&r.then?r.then(a):a(r))}catch(e){return Promise.reject(e)}}))},n.runtimeServiceActive=function(){var e=this;return new Promise((function(t,n){var i=e.cfg.initCfg.baseMappingServiceUrl+"ping";e.cfg.logger.debug("Runtime Service Ping Request"),e.api.get(i).json().then((function(n){e.cfg.logger.debug("Runtime Service Ping Response: "+n.String),t("pong"===(null==n?void 0:n.String))})).catch((function(e){n(e)}))}))},n.getRuntimeVersion=function(){var e=this,t=this.cfg.initCfg.baseMappingServiceUrl+"version";return new Promise((function(n,i){e.api.get(t).json().then((function(t){e.cfg.logger.debug("Runtime Service Version Response: "+t.String),n(t.String)})).catch((function(e){i(e)}))}))},n.getUIVersion=function(){return this.cfg.initCfg.dataMapperVersion},n.setUIVersion=function(e){this.cfg.initCfg.dataMapperVersion=e},n.initializeWithMappingDigest=function(){var e=this;return new Promise((function(t){e.cfg.fileService.getCurrentMappingDigest().then((function(n){try{var i=!1,a=function(a){return i?a:Promise.resolve(e.addDocumentsFromMappingDigest(n)).then((function(){if(n&&n.exportMappings){var i=Le.deserializeAtlasMappingName(P.objectize(n.exportMappings.value));e.cfg.fileService.findMappingFiles("UI").then((function(a){try{return Promise.resolve(e.cfg.fileService.setMappingDigestToService(n)).then((function(){return Promise.resolve(e.cfg.fieldActionService.fetchFieldActions()).then((function(){function r(){return Promise.resolve(e.cfg.fieldActionService.fetchFieldActions()).then((function(){e.fetchMappings().then((function(e){t(e)}))}))}var o=function(){if(i!==a[0])return Promise.resolve(e.cfg.fileService.setMappingStringToService(n.exportMappings.value)).then((function(){}))}();return o&&o.then?o.then(r):r()}))}))}catch(e){return Promise.reject(e)}})).catch((function(){t(!1)}))}else t(!1)}))},r=function(){if(!n)return null===e.cfg.mappings&&(e.cfg.mappings=new Fe),Promise.resolve(e.cfg.fieldActionService.fetchFieldActions()).then((function(){e.updateStatus(),t(!0),i=!0}))}();return Promise.resolve(r&&r.then?r.then(a):a(r))}catch(e){return Promise.reject(e)}})).catch((function(){t(!1)}))}))},n.addDocumentsFromMappingDigest=function(e){var t=this;return new Promise((function(n){try{var i=function(){t.cfg.mappingService.notifyMappingUpdated(),n(!0)};t.cfg.errorService.resetAll();var a=0,r=function(e,t,n){if("function"==typeof e[De]){var i,a,r,o=e[De]();if(function e(n){try{for(;!(i=o.next()).done;)if((n=t(i.value))&&n.then){if(!Ae(n))return void n.then(e,r||(r=Oe.bind(null,a=new Me,2)));n=n.v}a?Oe(a,1,n):a=n}catch(e){Oe(a||(a=new Me),2,e)}}(),o.return){var l=function(e){try{i.done||o.return()}catch(e){}return e};if(a&&a.then)return a.then(l,(function(e){throw l(e)}));l()}return a}if(!("length"in e))throw new TypeError("Object is not iterable");for(var s=[],c=0;c<e.length;c++)s.push(e[c]);return function(e,t,n){var i,a,r=-1;return function n(o){try{for(;++r<e.length;)if((o=t(r))&&o.then){if(!Ae(o))return void o.then(n,a||(a=Oe.bind(null,i=new Me,2)));o=o.v}i?Oe(i,1,o):i=o}catch(e){Oe(i||(i=new Me),2,e)}}(),i}(s,(function(e){return t(s[e])}))}(e.exportMeta,(function(n){var i,r=e.exportBlockData[a].value,o=n.id?n.id:n.name,l=n.dataSourceType?n.dataSourceType.toUpperCase():null===(i=n.documentType)||void 0===i?void 0:i.toUpperCase(),s="string"==typeof n.isSource?"true"===n.isSource.toLowerCase():n.isSource;return Promise.resolve(t.cfg.documentService.addDocument(r,o,n.name,l,n.inspectionType,s,n.inspectionParameters)).then((function(){t.updateStatus(),a++}))}));return Promise.resolve(r&&r.then?r.then(i):i())}catch(e){return Promise.reject(e)}}))},n.fetchMappings=function(){var e=this;return new Promise((function(t){try{var n=function(){0===i.length&&t(!1),e.cfg.mappingService.fetchMappings(i,e.cfg.mappings).then((function(){e.cfg.initCfg.mappingInitialized=!0,e.updateStatus(),e.cfg.mappingService.notifyMappingUpdated().then((function(){return t(!0)}))}))};if(null!=e.cfg.mappings)return t(!0),Promise.resolve();e.cfg.mappings=new Fe;var i=e.cfg.mappingFiles,a=function(){if(!e.cfg.mappingFiles||0===e.cfg.mappingFiles.length)return Promise.resolve(e.cfg.fileService.findMappingFiles("UI")).then((function(e){i=e}))}();return Promise.resolve(a&&a.then?a.then(n):n())}catch(e){return Promise.reject(e)}}))},n.updateStatus=function(){for(var e,t=this.cfg.getAllDocs().length,n=0,i=x(this.cfg.getAllDocs());!(e=i()).done;){var a=e.value;(a.initialized||a.errorOccurred)&&n++}if(t===n&&this.cfg.fieldActionService.isInitialized){if(this.cfg.preloadedMappingJson&&(Le.deserializeMappingServiceJSON(JSON.parse(this.cfg.preloadedMappingJson),this.cfg),this.cfg.preloadedMappingJson=null),this.cfg.mappings){_e.updateLookupTables(this.cfg.mappings),ke.updateDocumentNamespacesFromMappings(this.cfg),ke.updateMappingsFromDocuments(this.cfg);for(var r,o=x(this.cfg.getAllDocs());!(r=o()).done;)r.value.updateFromMappings(this.cfg.mappings);ke.removeStaleMappings(this.cfg),this.cfg.mappingService.updateMappingsTransition()}this.updateInitComplete()}},n.handleError=function(e,n){this.cfg.errorService.addError(new G({message:e="Data Mapper UI Initialization Error: "+e,scope:t.ErrorScope.APPLICATION,level:t.ErrorLevel.ERROR,type:t.ErrorType.INTERNAL,object:n})),this.updateLoadingStatus(e),this.cfg.initCfg.initializationErrorOccurred=!0,this.cfg.initCfg.initialized=!0,this.systemInitializedSource.next()},n.updateInitComplete=function(){this.updateLoadingStatus("Initialization complete."),this.cfg.initCfg.initialized=!0,this.systemInitializedSource.next()},n.updateLoadingStatus=function(e){this.cfg.initCfg.loadingStatus=e,this.initializationStatusChangedSource.next()},n.initializeWithADMArchiveFile=function(e){var t=this;return new Promise((function(n){t.updateLoadingStatus("Importing ADM archive file"),t.cfg.fileService.importADMArchive(e).then((function(){t.initialize().then((function(e){n(e)}))}))}))},n.initializeWithADMArchiveFileFromEntaxyRegistry=function(e){var t=this;return new Promise((function(n){t.updateLoadingStatus("Importing ADM archive file from Entaxy registry"),t.cfg.fileService.importADMArchiveFromEntaxyRegistry(e).then((function(){t.initialize().then((function(t){J.getConfig().openedArchiveFileLocation=e,n(t)}))}))}))},n.resetAtlasMap=function(){var e=this;return new Promise((function(t){e.cfg.fileService.resetAll().then((function(n){e.initialize().then((function(e){t(n&&e)}))}))}))},e}();t.ATLAS_MAPPING_JSON_TYPE="io.atlasmap.v2.AtlasMapping",t.COLLECTION_JSON_TYPE="io.atlasmap.v2.Collection",t.CONSTANT_FIELD_JSON_TYPE="io.atlasmap.v2.ConstantField",t.CommonUtil=P,t.ConfigModel=J,t.CsvInspectionModel=oe,t.CsvInspectionRequestModel=le,t.CsvInspectionRequestOptions=se,t.DATA_SOURCE_JSON_TYPE="io.atlasmap.v2.DataSource",t.DataMapperInitializationModel=z,t.DocumentDefinition=V,t.DocumentInitializationModel=B,t.DocumentInspectionModel=ie,t.DocumentInspectionRequestModel=ae,t.DocumentInspectionRequestOptions=re,t.DocumentInspectionUtil=Pe,t.DocumentManagementService=Ue,t.EnumValue=w,t.ErrorHandlerService=Ve,t.ErrorInfo=G,t.Examples=H,t.ExpressionModel=$,t.ExpressionNode=Y,t.ExpressionUpdatedEvent=q,t.FIELD_GROUP_JSON_TYPE="io.atlasmap.v2.FieldGroup",t.FIELD_PATH_SEPARATOR="/",t.Field=R,t.FieldAction=ne,t.FieldActionArgument=Q,t.FieldActionArgumentValue=ee,t.FieldActionDefinition=te,t.FieldActionService=ze,t.FieldNode=W,t.FileManagementService=Be,t.Guid=we,t.HTTP_STATUS_NO_CONTENT=204,t.HTTP_STATUS_OK=200,t.InitializationService=qe,t.JAVA_CLASS_JSON_TYPE="io.atlasmap.java.v2.JavaClass",t.JAVA_ENUM_FIELD_JSON_TYPE="io.atlasmap.java.v2.JavaEnumField",t.JAVA_INSPECTION_REQUEST_JSON_TYPE="io.atlasmap.java.v2.ClassInspectionRequest",t.JAVA_MODEL_PACKAGE_PREFIX="io.atlasmap.java.v2",t.JSON_DATA_SOURCE_JSON_TYPE="io.atlasmap.json.v2.JsonDataSource",t.JSON_ENUM_FIELD_JSON_TYPE="io.atlasmap.json.v2.JsonEnumField",t.JSON_INSPECTION_REQUEST_JSON_TYPE="io.atlasmap.json.v2.JsonInspectionRequest",t.JSON_MODEL_PACKAGE_PREFIX="io.atlasmap.json.v2",t.JavaInspectionModel=ce,t.JavaInspectionRequestModel=ue,t.JavaInspectionRequestOptions=pe,t.JsonInspectionModel=de,t.JsonInspectionRequestModel=fe,t.JsonInspectionRequestOptions=me,t.LookupTable=ye,t.LookupTableData=Re,t.LookupTableEntry=Ee,t.LookupTableUtil=_e,t.MAPPING_JSON_TYPE="io.atlasmap.v2.Mapping",t.MODEL_PACKAGE_PREFIX="io.atlasmap.v2",t.MappedField=Te,t.MappingDefinition=Fe,t.MappingDigestUtil=je,t.MappingExpressionService=Je,t.MappingManagementService=Ge,t.MappingModel=Ce,t.MappingSerializer=Le,t.MappingUtil=ke,t.NamespaceModel=L,t.PROCESS_MAPPING_REQUEST_JSON_TYPE="io.atlasmap.v2.ProcessMappingRequest",t.PROPERTY_FIELD_JSON_TYPE="io.atlasmap.v2.PropertyField",t.PaddingField=U,t.TextNode=X,t.TransitionDelimiterModel=be,t.TransitionModel=Se,t.XML_DATA_SOURCE_JSON_TYPE="io.atlasmap.xml.v2.XmlDataSource",t.XML_ENUM_FIELD_JSON_TYPE="io.atlasmap.xml.v2.XmlEnumField",t.XML_INSPECTION_REQUEST_JSON_TYPE="io.atlasmap.xml.v2.XmlInspectionRequest",t.XML_MODEL_PACKAGE_PREFIX="io.atlasmap.xml.v2",t.XmlInspectionModel=ge,t.XmlInspectionRequestModel=ve,t.XmlInspectionRequestOptions=he,t.collectionTypes=C,t.constantTypes=M,t.getCsvParameterOptions=function(){return[{name:"format",label:"CSV File Format",value:"Default",options:[{label:"Default",value:"Default"},{label:"Excel",value:"Excel"},{label:"InformixUnload",value:"InformixUnload"},{label:"InformixUnloadCsv",value:"InformixUnloadCsv"},{label:"MongoDBCsv",value:"MongoDBCsv"},{label:"MongoDBTsv",value:"MongoDBTsv"},{label:"MySQL",value:"MySQL"},{label:"Oracle",value:"Oracle"},{label:"PostgreSQLCsv",value:"PostgreSQLCsv"},{label:"PostgreSQLText",value:"PostgreSQLText"},{label:"RFC4180",value:"RFC4180"},{label:"TDF",value:"TDF"}],required:!0},{name:"allowDuplicateHeaderNames",label:"Allow Duplicate Header Names",value:"true",boolean:!0,required:!1},{name:"allowMissingColumnNames",label:"Allow Missing Column Names",value:"true",boolean:!0,required:!1},{name:"commentMarker",label:"Comment Marker",value:"",required:!1},{name:"delimiter",label:"Delimiter",value:"",required:!1},{name:"escape",label:"Escape",value:"",required:!1},{name:"firstRecordAsHeader",label:"First Record As Header",value:"true",boolean:!0,required:!1},{name:"headers",label:"Headers",value:"",required:!1},{name:"ignoreEmptyLines",label:"Ignore Empty Lines",value:"true",boolean:!0,required:!1},{name:"ignoreHeaderCase",label:"Ignore Header Case",value:"true",boolean:!0,required:!1},{name:"ignoreSurroundingSpaces",label:"Ignore Surrounding Spaces",value:"true",boolean:!0,required:!1},{name:"nullString",label:"Null String",value:"",required:!1},{name:"skipHeaderRecord",label:"Skip Header Record",value:"true",boolean:!0,required:!1}]},t.propertyTypes=O},596:function(e,t,n){"use strict";n.r(t);n(360),Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));var i=n(705),a=n(686),r=n(15),o=n(9),l=n(350),s=n(0),c=n.n(s),u=n(687),p=n(341),d=n(1),f=n(185),m=n(623),g=n(695),v=n(625),h=n(75),E=n(630),y=n(631),b=n(632),S=n(624),F=n(701),T=n(109),C=n(692),M=n(633),O=n(702),A=n(108),D=n(124),N=n(173),I=n(689),x=n(24),P=n(634),w=n(635),R=n(636),_=n(345),j=n(638),k=n(639),L=n(640),U=n(641),V=n(642),z=(n(643),n(338)),B=n(221),J=n(647),G=n(648),H=n(649),q=n(356),Y=n(650),X=n(651),W=n(18),K=n(696),Z=n(655),$=n(656),Q=n(657),ee=n(658),te=n(703),ne=n(699),ie=n(700),ae=n(622),re=n(619),oe=n(29),le=n(671),se=n(672),ce=n(675),ue=n(676),pe=n(684),de=n(685),fe=n(704),me=n(626),ge=n(335),ve=n(637),he=n(226),Ee=n(145),ye=n(644),be=n(645),Se=n(652),Fe=n(653),Te=n(179),Ce=n(654),Me=n(266),Oe=n(659),Ae=n(660),De=n(661),Ne=n(662),Ie=n(663),xe=n(664),Pe=n(665),we=n(346),Re=n(666),_e=n(667),je=n(668),ke=n(669),Le=n(670),Ue=n(673),Ve=n(677),ze=n(678),Be=n(679),Je=n(680),Ge=n(681),He=n(682),qe=n(683),Ye=n(272),Xe=n(627),We=n(628),Ke=n(690),Ze=n(691),$e=n(351),Qe=n(330),et=n(352),tt=n(47),nt=n.n(tt),it=n(646),at=n(44),rt=n.n(at),ot=n(349),lt=n(268),st=n(688),ct=n(697),ut=n(693),pt=n(674),dt=n(280);function ft(){return(ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function mt(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,gt(e,t)}function gt(e,t){return(gt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vt(e,t){if(null==e)return{};var n,i,a={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(a[n]=e[n]);return a}function ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Et(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"===typeof e)return ht(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ht(e,t):void 0}}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var yt=function(e,t,n,i,a){try{return Promise.resolve(new Promise((function(r){try{return t.initCfg.initialized=!1,t.initializationService.updateLoadingStatus("Creating instance or schema"),t.documentService.createNonJavaInstance(e,n,i,a).then((function(){t.fileService.updateDigestFile().finally((function(){t.initializationService.updateStatus(),t.errorService.addError(new o.ErrorInfo({message:"Schema creation complete.",level:o.ErrorLevel.INFO,scope:o.ErrorScope.APPLICATION,type:o.ErrorType.USER})),r(!0)}))})),Promise.resolve()}catch(l){return Promise.reject(l)}})))}catch(r){return Promise.reject(r)}},bt=function(e,t,n,i,a){try{return Promise.resolve(new Promise((function(r){try{return t.initCfg.initialized=!1,t.initializationService.updateLoadingStatus("Importing Document from Entaxy registry location "+e),t.documentService.importNonJavaDocumentFromEntaxyRegistry(e,n,i,a).then((function(){t.fileService.updateDigestFile().finally((function(){t.initializationService.updateStatus(),t.errorService.addError(new o.ErrorInfo({message:e+" import complete.",level:o.ErrorLevel.INFO,scope:o.ErrorScope.APPLICATION,type:o.ErrorType.USER})),r(!0)}))})),Promise.resolve()}catch(l){return Promise.reject(l)}})))}catch(r){return Promise.reject(r)}},St=function(e,t,n,i,a){try{return Promise.resolve(new Promise((function(r){try{return t.initCfg.initialized=!1,t.initializationService.updateLoadingStatus("Importing Document "+e.name),t.documentService.importNonJavaDocument(e,n,i,a).then((function(){t.fileService.updateDigestFile().finally((function(){t.initializationService.updateStatus(),t.errorService.addError(new o.ErrorInfo({message:e.name+" import complete.",level:o.ErrorLevel.INFO,scope:o.ErrorScope.APPLICATION,type:o.ErrorType.USER})),r(!0)}))})),Promise.resolve()}catch(l){return Promise.reject(l)}})))}catch(r){return Promise.reject(r)}},Ft=function(e,t,n){try{var i=o.ConfigModel.getConfig();return Ot(e,i,n).name=t,Promise.resolve(i.mappingService.notifyMappingUpdated()).then((function(){return Promise.resolve(i.fileService.updateDigestFile()).then((function(){}))}))}catch(a){return Promise.reject(a)}};function Tt(e,t,n,i,a){var r=o.ConfigModel.getConfig(),l=At(e,r,!0),s={alias:t,uri:n,locationUri:i,createdByUser:!0,isTarget:a,getPrettyLabel:function(){return t+" ["+n+"]"},copy:function(){return Object.assign({},s)},copyFrom:function(e){return Object.assign(s,e)}};l.namespaces.push(s),r.mappingService.notifyMappingUpdated()}function Ct(e,t,n,i,a,r){var l=o.ConfigModel.getConfig(),s=At(e,l,!0).getNamespaceForAlias(t);s.alias=n,s.uri=i,s.locationUri=a,s.isTarget=r,l.mappingService.notifyMappingUpdated()}function Mt(e,t){var n=o.ConfigModel.getConfig(),i=At(e,n,!0);i.namespaces=i.namespaces.filter((function(e){return e.alias!==t})),n.mappingService.notifyMappingUpdated()}function Ot(e,t,n){for(var i,a=Et(t.getDocs(n));!(i=a()).done;){var r=i.value;if(r.id.match(Dt(e)))return r}return null}function At(e,t,n){for(var i,a=Et(t.getDocs(n));!(i=a()).done;){var r=i.value;if((r.getName(!1)+"."+r.type.toLowerCase()).match(Dt(e)))return r}return null}function Dt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Nt(e,t,n,i){return new Promise((function(a){e.initCfg.initialized=!1,e.initializationService.updateLoadingStatus("Importing Document "+t),e.documentService.importJavaDocument(t,i,n).then((function(){e.fileService.updateDigestFile().finally((function(){e.initializationService.updateStatus(),a(!0)}))}))}))}function It(e){for(var t,n=o.ConfigModel.getConfig(),i=[{label:"Current Message Header",value:"current"},{label:"Camel Exchange Property",value:"camelExchangeProperty"}],a=Et(e?n.sourceDocs:n.targetDocs);!(t=a()).done;){var r=t.value;i.push({value:r.id,label:r.name})}return i}function xt(){var e,t=o.ConfigModel.getConfig();return!(null===t||void 0===t||null===(e=t.mappings)||void 0===e||!e.activeMapping)}var Pt=function(){function e(t){this.uuid=t+e.sequence++}return e.prototype.getUuid=function(){return this.uuid},e}();function wt(){var e,t,n,i=o.ConfigModel.getConfig();return xt()&&(null!==(e=i.mappings)&&void 0!==e&&null!==(t=e.activeMapping)&&void 0!==t&&null!==(n=t.transition)&&void 0!==n&&n.expression||function(){var e,t=o.ConfigModel.getConfig();if(!xt()||null===(e=t.mappings)||void 0===e||!e.activeMapping)return null;var n=t.mappings.activeMapping,i=n.transition.expression;return i?n.transition.expression&&n.transition.expression.setConfigModel(t):(n.transition.expression=new o.ExpressionModel(n,t),(i=n.transition.expression).generateInitialExpression(),i.updateFieldReference(n)),n.transition.expression}())&&i.mappings.activeMapping.transition.expression&&i.mappings.activeMapping.transition.enableExpression?i.mappings.activeMapping.transition.expression.toHTML():""}Pt.sequence=0,(function(e){function t(n){var i;return(i=e.call(this,t.PREFIX)||this).str=n,i}mt(t,e);var n=t.prototype;return n.toText=function(){return this.str},n.toHTML=function(){return'<span id="'+this.uuid+'">'+this.str.replace(/ /g,"&nbsp;")+"</span>"},t}(Pt)).PREFIX="expression-text-",(function(e){function t(n,i,a){var r;return(r=e.call(this,t.PREFIX)||this).mapping=n,r.mfield=i,!i&&a&&(r.field=n.getMappedFieldForIndex((a+1).toString(),!0)),r}mt(t,e);var n=t.prototype;return n.toText=function(){return this.mapping&&this.field?"${"+(this.mapping.getIndexForMappedField(this.field)-1)+"}":""},n.toHTML=function(){return this.field?this.field&&this.field.field?'<span contenteditable="false" id="'+this.uuid+'" title="'+this.field.field.docDef.name+":"+this.field.field.path+'"\n        class="expressionFieldLabel label label-default">'+this.field.field.name+"</span>":'<span contenteditable="false" id="'+this.uuid+'"\n        title="Field index \''+(this.mapping.getIndexForMappedField(this.field)-1)+'\' is not available"\n        class="expressionFieldLabel label label-danger">N/A</span>':""},t}(Pt)).PREFIX="expression-field-";var Rt=l.a.create({headers:{"ATLASMAP-XSRF-TOKEN":"awesome"}});var _t=new o.InitializationService(Rt),jt=_t.cfg;function kt(e){var t,n=o.ConfigModel.getConfig(),i=e.partOfMapping;return(i?n.showMappedFields:n.showUnmappedFields&&e.visibleInCurrentDocumentSearch)?{id:(e.docDef.uri||e.docDef.type+"-"+e.scope)+":"+(e.docDef.isSource?"source":"target")+":"+e.path,name:e.getFieldLabel(!1,!1),type:e.type,path:e.path,scope:e.scope?e.scope:"",value:e.value,amField:e,mappings:(null===(t=n.mappings)||void 0===t?void 0:t.findMappingsForField(e).map(qt).filter((function(e){return e})))||[],hasTransformations:e.partOfTransformation,isAttribute:e.isAttribute,isCollection:e.isCollection,isInCollection:e.isInCollection(),isConnected:i,isDisabled:"UNSUPPORTED"===e.type||"COMPLEX"===e.type&&!e.enumeration,enumeration:e.enumeration}:null}function Lt(e){return e.children.length>0?function(e){var t=e.children.map(Lt).filter((function(e){return e}));return t.length>0&&e.visibleInCurrentDocumentSearch?{id:(e.docDef.uri||e.docDef.type+"-"+e.scope)+":"+(e.docDef.isSource?"source":"target")+":"+e.path,name:e.name,type:e.type,isCollection:e.isCollection,isInCollection:e.isInCollection(),fields:t,amField:e}:null}(e):kt(e)}function Ut(e){return{alias:e.alias,uri:e.uri,locationUri:e.locationUri,isTarget:e.isTarget}}function Vt(e){if(!e||!e.fields||0===e.fields.length)return null;var t=e.fields.map(Lt).filter((function(e){return e})),n=e.namespaces.map(Ut).filter((function(e){return e}));return e.visibleInCurrentDocumentSearch&&t.length>0?{id:e.id,fields:t,name:e.name,type:e.type,namespaces:n}:null}function zt(e){var t;return e.field&&e.field.docDef?{id:(e.field.docDef.uri||e.field.docDef.type+"-"+e.field.scope)+":"+(e.field.docDef.isSource?"source":"target")+":"+e.field.path,name:e.field.getFieldLabel(!1,!1),type:e.field.type,path:e.field.path,scope:null!==(t=e.field)&&void 0!==t&&t.scope?e.field.scope:"",value:e.field.value,hasTransformations:!1,mappings:[],isAttribute:!1,isCollection:!1,isInCollection:!1,isConnected:!1,isDisabled:!1,enumeration:!1,amField:e.field,transformations:e.actions.map((function(t){return{name:t.name,options:nn(e.isSource()).map((function(e){return{name:o.CommonUtil.toDisplayable(e.name),value:e.name}})),arguments:t.definition.arguments.map((function(e,n){var i,a;return{label:(null===(i=e.serviceObject)||void 0===i||null===(a=i.title)||void 0===a?void 0:a.length)>0?e.serviceObject.title:o.CommonUtil.toDisplayable(e.name),type:e.type,name:e.name,value:t.argumentValues[n].value,options:e.values?e.values.map((function(e){return{name:e,value:e}})):void 0}}))}}))}:null}function Bt(e){switch(e){case o.ErrorLevel.INFO:return"info";case o.ErrorLevel.WARN:return"warning";case o.ErrorLevel.ERROR:return"danger";default:return"default"}}function Jt(e){switch(Object(r.a)(e)){case"string":return e;default:return(null===e||void 0===e?void 0:e.message)||JSON.stringify(e)}}function Gt(e){switch(e){case o.ErrorType.INTERNAL:return"Internal";case o.ErrorType.USER:return"User";case o.ErrorType.VALIDATION:return"Validation";case o.ErrorType.PREVIEW:return"Preview";case o.ErrorType.FORM:return"Form"}}function Ht(e){var t;return{variant:Bt(e.level),title:e.mapping&&e.type!==o.ErrorType.PREVIEW?Gt(e.type)+': "'+e.mapping.transition.getPrettyName()+'"':Gt(e.type),description:Jt(e.message),id:e.identifier,mappingId:null===(t=e.mapping)||void 0===t?void 0:t.uuid}}function qt(e){return e?{id:e.uuid,name:e.transition.getPrettyName(),sourceFields:e.getUserMappedFields(!0).map(zt).filter((function(e){return e})),targetFields:e.getUserMappedFields(!1).map(zt).filter((function(e){return e})),mapping:e}:null}function Yt(e,t){return _t.cfg.expressionService.executeFieldSearch(_t.cfg,e,t)}function Xt(e,t,n,i,a){var r=_t.cfg.mappings.activeMapping;r&&e&&t&&(jt.expressionService.addFieldToExpression(r,e,t,n,i,a),_t.cfg.mappingService.notifyMappingUpdated())}function Wt(){if(_t.cfg.mappings&&_t.cfg.mappings.activeMapping){var e=_t.cfg.mappings.activeMapping;e.getMappedFields(!0).filter((function(e){return e.isPadField()})).forEach((function(t){return e.removeMappedField(t)})),e.transition.expression?e.transition.expression.setConfigModel(_t.cfg):(e.transition.expression=new o.ExpressionModel(e,_t.cfg),e.transition.expression.generateInitialExpression()),e.transition.expression.updateFieldReference(e)}}function Kt(e,t,n){var i=_t.cfg.mappings.activeMapping.transition.expression.clearText(e,t,n);return _t.cfg.mappingService.notifyMappingUpdated(),i}function Zt(e,t,n){_t.cfg.mappings.activeMapping.transition.expression.insertText(e,t,n),_t.cfg.mappingService.notifyMappingUpdated()}function $t(){var e,t,n;return null!==(e=_t.cfg.mappings)&&void 0!==e&&null!==(t=e.activeMapping)&&void 0!==t&&null!==(n=t.transition)&&void 0!==n&&n.expression?_t.cfg.mappings.activeMapping.transition.expression.expressionUpdated$:null}function Qt(e,t,n){_t.cfg.mappings.activeMapping.transition.expression.removeToken(e,t,n),_t.cfg.mappingService.notifyMappingUpdated()}function en(e,t){e.amField.value=t,_t.cfg.mappingService.notifyMappingUpdated()}function tn(){_t.cfg.expressionService.toggleExpressionMode(),_t.cfg.mappingService.notifyMappingUpdated()}function nn(e){return _t.cfg.fieldActionService.getActionsAppliesToField(_t.cfg.mappings.activeMapping,e,o.Multiplicity.ONE_TO_ONE)}function an(e){return e.transition.mode===o.TransitionMode.ONE_TO_MANY?_t.cfg.fieldActionService.getActionsAppliesToField(e,!0,o.Multiplicity.ONE_TO_MANY):e.transition.mode===o.TransitionMode.MANY_TO_ONE?_t.cfg.fieldActionService.getActionsAppliesToField(e,!0,o.Multiplicity.MANY_TO_ONE):[]}function rn(){return o.TransitionModel.delimiterModels}function on(e,t){if(e.argumentValues=[],t.populateFieldAction(e),e.argumentValues.values()&&e.argumentValues.length>0&&t.arguments[0]&&t.arguments[0].values&&t.arguments[0].values.length>0)for(var n=0;n<e.argumentValues.length;n++)e.argumentValues[n].value=t.arguments[n].values[n];_t.cfg.mappingService.notifyMappingUpdated()}function ln(e,t,n){var i,a=o.ConfigModel.getConfig(),r=null===(i=a.mappings)||void 0===i?void 0:i.activeMapping;if(r){var l=r.getMappedFieldForIndex(""+(t+1),e);if(l){var s=0;if("number"===typeof n){if(s=n,n<=0||!r)return;var c=r.getMappedFields(e),u=c.length;n>u&&a.mappingService.addPlaceholders(n-c.length,r,u,e)}else{var p=r.getMappedFieldForField(n);if(!p)return;s=r.getIndexForMappedField(p)}a.mappingService.moveMappedFieldTo(r,l,s)}}}function sn(e,t){var n,i=o.ConfigModel.getConfig(),a=null===(n=i.mappings)||void 0===n?void 0:n.activeMapping;if(a){var r=a.getMappedFieldForIndex(""+(t+1),e);if(r){var l=new o.FieldAction;nn(e)[0].populateFieldAction(l),r.actions.push(l),i.mappingService.notifyMappingUpdated()}}}function cn(e,t,n,i){var a,r=o.ConfigModel.getConfig(),l=null===(a=r.mappings)||void 0===a?void 0:a.activeMapping;if(l){var s=l.getMappedFieldForIndex(""+(t+1),e);if(s){var c=s.actions[n],u=nn(e).find((function(e){return e.name===i}));if(c&&u){if(c.argumentValues=[],u.populateFieldAction(c),c.argumentValues.values()&&c.argumentValues.length>0&&u.arguments[0]){var p=u.arguments.filter((function(e){return null!==e.values}));if(u.arguments[0].values&&u.arguments[0].values.length>0&&u.arguments.length==p.length)for(var d=0;d<c.argumentValues.length;d++)c.argumentValues[d].value=u.arguments[d].values[d];else if(u.arguments.length!=p.length)for(var f=0;f<c.argumentValues.length;f++)u.arguments[f]&&u.arguments[f].values&&u.arguments[f].values.length>0&&(c.argumentValues[f].value=u.arguments[f].values[f])}r.mappingService.notifyMappingUpdated()}}}}function un(e,t,n,i,a){var r,l=o.ConfigModel.getConfig(),s=null===(r=l.mappings)||void 0===r?void 0:r.activeMapping;if(s){var c=s.getMappedFieldForIndex(""+(t+1),e);if(c){var u=c.actions[n];u&&(u.setArgumentValue(i,a),l.mappingService.notifyMappingUpdated())}}}function pn(e,t,n){var i,a=o.ConfigModel.getConfig(),r=null===(i=a.mappings)||void 0===i?void 0:i.activeMapping;if(r){var l=r.getMappedFieldForIndex(""+(t+1),e);if(l){var s=l.actions[n];s&&(o.CommonUtil.removeItemFromArray(s,l.actions),a.mappingService.notifyMappingUpdated())}}}function dn(e,t){var n,i=null===(n=o.ConfigModel.getConfig().mappings)||void 0===n?void 0:n.activeMapping;if(i){var a=an(i).find((function(e){return e.name===t}));if(e&&a){if(e.argumentValues=[],a.populateFieldAction(e),e.argumentValues.values()&&e.argumentValues.length>0&&a.arguments[0]&&a.arguments[0].values&&a.arguments[0].values.length>0)for(var r=0;r<e.argumentValues.length;r++)e.argumentValues[r].value=a.arguments[r].values[r];_t.cfg.mappingService.notifyMappingUpdated()}}}function fn(e,t,n){var i=o.ConfigModel.getConfig();e.setArgumentValue(t,n),i.mappingService.notifyMappingUpdated()}function mn(e){_t.cfg.mappingService.selectMapping(e.mapping)}function gn(){_t.cfg.mappingService.deselectMapping()}function vn(e,t,n,i){o.ConfigModel.getConfig().documentService.createConstant(e,t,n,i)}function hn(e){o.ConfigModel.getConfig().documentService.deleteConstant(e)}function En(e,t,n,i){o.ConfigModel.getConfig().documentService.editConstant(e,t,n,i)}function yn(e,t,n,i,a){o.ConfigModel.getConfig().documentService.createProperty(e,t,n,i,a)}function bn(e,t,n){o.ConfigModel.getConfig().documentService.deleteProperty(e,t,n)}function Sn(e,t,n,i,a,r){o.ConfigModel.getConfig().documentService.editProperty(e,t,n,i,a,r)}function Fn(e,t,n){return o.ConfigModel.getConfig().documentService.getPropertyType(e,t,n)}function Tn(e,t){var n,i=o.ConfigModel.getConfig(),a=_t.cfg.mappingService;if(t&&(e&&null!==(n=i.mappings)&&void 0!==n&&n.activeMapping&&(e.partOfMapping||t.partOfMapping))){var r,l,s,c=null;if(e.partOfMapping)c=a.getFieldSelectionExclusionReason(null===(r=i.mappings)||void 0===r?void 0:r.activeMapping,t);else c=a.getFieldSelectionExclusionReason(null===(l=i.mappings)||void 0===l?void 0:l.activeMapping,e);if(null!==c)return void i.errorService.addError(new o.ErrorInfo({message:"The field '"+t.name+"' cannot be selected, "+c+".",level:o.ErrorLevel.ERROR,mapping:null===(s=i.mappings)||void 0===s?void 0:s.activeMapping,scope:o.ErrorScope.MAPPING,type:o.ErrorType.USER}));if(t.partOfMapping&&i.mappings.activeMapping.targetFields[0].field.path===t.path)return void On(e);if(e.partOfMapping&&i.mappings.activeMapping.sourceFields[0].field.path===e.path)return void On(t)}e?i.mappingService.addNewMapping(e,!1):i.mappingService.newMapping(),t&&On(t)}function Cn(){o.ConfigModel.getConfig().mappingService.newMapping()}function Mn(e){o.ConfigModel.getConfig().mappingService.removeMapping(e)}function On(e){o.ConfigModel.getConfig().mappingService.addFieldToActiveMapping(e)}function An(e){var t,n=o.ConfigModel.getConfig(),i=null===(t=n.mappings)||void 0===t?void 0:t.activeMapping;if(i){var a=i.getMappedFieldForField(e);a&&(i.removeMappedField(a),n.mappingService.updateMappedField(i))}}function Dn(e){var t,n=o.ConfigModel.getConfig(),i=null===(t=n.mappings)||void 0===t?void 0:t.activeMapping;i&&e&&(i.removeMappedField(e),n.mappingService.updateMappedField(i))}function Nn(){var e,t=o.ConfigModel.getConfig(),n=null===(e=t.mappings)||void 0===e?void 0:e.activeMapping;return n?_t.cfg.mappingService.getEnumerationValues(t,n):[]}function In(e){var t,n=_t.cfg.mappings.activeMapping.transition.expression.getNode(e);return n&&null!==(t=n.mappedField)&&void 0!==t&&t.field.enumeration?n.mappedField.field.enumValues:[]}function xn(e,t){var n,i=_t.cfg.mappings.activeMapping,a=i.transition.expression.getNode(e);a&&null!==(n=a.mappedField)&&void 0!==n&&n.field.enumeration&&(_t.cfg.mappingService.setEnumFieldValue(a.mappedField.field,t),i.transition.expression.updateFieldReference(i),_t.cfg.mappingService.notifyMappingUpdated())}function Pn(){var e,t=o.ConfigModel.getConfig();return _t.cfg.mappingService.isEnumerationMapping(null===(e=t.mappings)||void 0===e?void 0:e.activeMapping)}var wn=function(e,t){try{var n=o.ConfigModel.getConfig(),i=Ot(e,n,t);return Promise.resolve(function(e,t){try{return Promise.resolve(new Promise((function(n){try{return t.mappingService.removeDocumentReferenceFromAllMappings(e.id),e.isSource?o.CommonUtil.removeItemFromArray(e,t.sourceDocs):o.CommonUtil.removeItemFromArray(e,t.targetDocs),Promise.resolve(t.mappingService.notifyMappingUpdated()).then((function(){return Promise.resolve(t.fileService.updateDigestFile()).then((function(){n(!0)}))}))}catch(i){return Promise.reject(i)}})))}catch(n){return Promise.reject(n)}}(i,n)).then((function(){n.initializationService.updateInitComplete()}))}catch(a){return Promise.reject(a)}};function Rn(e,t){return!!At(e,o.ConfigModel.getConfig(),t)}function _n(e){return o.ConfigModel.getConfig().fileService.exportADMArchive(e)}function jn(){var e=o.ConfigModel.getConfig(),t=e.openedArchiveFileLocation;return e.fileService.exportADMArchiveIntoEntaxyRegistry(t)}function kn(e){return o.ConfigModel.getConfig().fileService.exportADMArchiveIntoEntaxyRegistry(e)}function Ln(){return o.ConfigModel.getConfig().initializationService.getRuntimeVersion()}function Un(){return"2.5.2"}function Vn(e){return o.ConfigModel.getConfig().previewService.toggleMappingPreview(e)}function zn(e){var t=o.ConfigModel.getConfig();return t.showMappedFields=e,t.initializationService.systemInitializedSource.next(),e}function Bn(e){var t=o.ConfigModel.getConfig();return t.showUnmappedFields=e,t.initializationService.systemInitializedSource.next(),e}function Jn(e,t){var n=Object(s.useState)(e),i=n[0],a=n[1];Object(s.useEffect)((function(){return a(e)}),[e]);var r=Object(s.useCallback)((function(){try{var e=function(e){a(e)};return Promise.resolve(t?Promise.resolve(t(!i)).then(e):e(!i))}catch(n){return Promise.reject(n)}}),[t,i]),o=Object(s.useCallback)((function(){return a(!1)}),[]),l=Object(s.useCallback)((function(){return a(!0)}),[]);return{state:i,toggle:r,toggleOff:o,toggleOn:l,setToggle:a}}var Gn=Object(s.createContext)(null),Hn=function(e){var t=e.children,n=e.allowPanning,i=void 0!==n&&n,a=e.initialWidth,r=void 0===a?0:a,o=e.initialHeight,l=void 0===o?0:o,u=e.initialZoom,d=void 0===u?1:u,f=e.initialPanX,m=void 0===f?0:f,g=e.initialPanY,v=void 0===g?0:g,h=Object(s.useState)({width:0,height:0,offsetLeft:0,offsetTop:0}),E=h[0],y=h[1],b=Object(s.useRef)([]),S=Object(s.useCallback)((function(e){b.current=b.current.filter((function(t){return t.id!==e}))}),[]),F=Object(s.useCallback)((function(e){S(e.id),b.current=[].concat(b.current,[e])}),[S]),T=Object(s.useCallback)((function(){return b.current}),[]),C=Object(s.useRef)([]),M=Object(s.useCallback)((function(e){C.current=[].concat(C.current,[e])}),[]),O=Object(s.useCallback)((function(e){C.current=C.current.filter((function(t){return t!==e}))}),[]);Object(s.useEffect)((function(){var e=requestAnimationFrame((function t(){e=requestAnimationFrame(t);for(var n=0,i=C.current.length;n<i;n++)C.current[n]()}));return function(){cancelAnimationFrame(e)}}),[]);var A=Object(s.useState)({x:m,y:v}),D=A[0],N=D.x,I=D.y,x=A[1],P=Object(s.useState)(d),w=P[0],R=P[1],_=Object(s.useCallback)((function(e){R((function(t){return Math.max(.2,Math.min(2,t+e))}))}),[R]),j=Object(s.useCallback)((function(){return R(1)}),[R]),k=Object(s.useCallback)((function(){return x({x:0,y:0})}),[x]),L=Object(s.useState)(!1),U=L[0],V=L[1],z=Object(p.a)({onDrag:function(e){var t=e.movement,n=t[0],i=t[1],a=e.first,r=e.last,o=e.memo,l=void 0===o?[N,I]:o;return a&&V(!0),r&&V(!1),x({x:n+l[0],y:i+l[1]}),l},onWheel:function(e){var t=e.delta;_(-.001*t[1])}},{drag:{delay:!0},enabled:i});return c.a.createElement(Gn.Provider,{value:{initialWidth:r,initialHeight:l,dimensions:E,setDimension:y,panX:N,panY:I,addRedrawListener:M,removeRedrawListener:O,addRect:F,removeRect:S,getRects:T,zoom:w,updateZoom:_,resetZoom:j,pan:{x:N,y:I},setPan:x,resetPan:k,allowPanning:i,isPanning:U,bindCanvas:z}},t)};function qn(){var e=Object(s.useContext)(Gn);if(!e)throw new Error("A CanvasProvider wrapper is required to use this hook.");var t=e.dimensions,n=t.width,i=t.height,a=e.zoom;return ft({},e,{xDomain:Object(s.useMemo)((function(){return Object(u.a)().range([0,n]).domain([0,n*a])}),[n,a]),yDomain:Object(s.useMemo)((function(){return Object(u.a)().range([i,0]).domain([i*a,0])}),[i,a])})}var Yn=function(e){var t=e.children,n=qn(),i=n.panX,a=n.panY,r=n.zoom;return c.a.createElement("g",{transform:"\n        translate("+i+" "+a+")\n        scale("+r+")\n      "},t)},Xn="Canvas-module_canvasWrapper__2zUnn",Wn="Canvas-module_svg__21OUU",Kn="Canvas-module_panning__3mi51",Zn={width:0,height:0,top:0,left:0,x:0,y:0,right:0,bottom:0};function $n(e){var t=(void 0===e?{}:e).liveMeasure,n=void 0===t||t,i=Object(s.useRef)(Zn),a=Object(s.useState)(Zn),r=a[0],o=a[1],l=Object(s.useRef)(null),c=Object(s.useCallback)((function(){if(l.current){var e=l.current.getBoundingClientRect();t=e,n=i.current,(t.width!==n.width||t.height!==n.height||t.top!==n.top||t.left!==n.left||t.x!==n.x||t.y!==n.y||t.right!==n.right||t.bottom!==n.bottom)&&(o(e),i.current=e)}var t,n}),[o]);return Object(s.useLayoutEffect)((function(){return c(),n&&(window.addEventListener("resize",c),window.addEventListener("scroll",c)),function(){n&&(window.removeEventListener("resize",c),window.removeEventListener("scroll",c))}}),[n,c]),[l,r,c]}var Qn=function(e){var t=e.children,n=e.className,i=e.style,a=e.isFilled,r=void 0===a||a,o=vt(e,["children","className","style","isFilled"]),l=qn(),u=l.initialWidth,p=l.initialHeight,f=l.setDimension,m=l.addRedrawListener,g=l.removeRedrawListener,v=$n(),h=v[0],E=v[1],y=v[2];Object(s.useEffect)((function(){f({width:E.width,height:E.height,offsetLeft:E.left,offsetTop:E.top})}),[E,f]),Object(s.useEffect)((function(){return m(y),function(){return g(y)}}),[m,y,g]);var b=qn(),S=b.allowPanning,F=b.isPanning,T=b.zoom,C=b.bindCanvas,M=Object(s.useMemo)((function(){return ft({cursor:S?F?"grabbing":"grab":void 0,userSelect:S&&F?"none":"auto",backgroundSize:30*T+"px "+30*T+"px",width:u||"100%",height:p||"100%"},i)}),[S,p,u,F,i,T]);return c.a.createElement("div",{ref:h,className:Object(d.a)(r&&Xn)},c.a.createElement("svg",Object.assign({},o,{className:Object(d.a)(Wn,S&&Kn,n),style:M},C()),c.a.createElement(Yn,null,t)))},ei="HTMLObject-module_foreignObject__2v8cW",ti=Object(s.forwardRef)((function(e,t){var n=e.children,i=e.width,a=e.height,r=e.x,o=e.y,l=e.className,s=vt(e,["children","width","height","x","y","className"]);return c.a.createElement("foreignObject",Object.assign({width:i,height:a,x:r,y:o,className:Object(d.a)(ei,l)},s,{ref:t}),n)})),ni="Arc-module_clickable__25tnx",ii=function(e){var t=e.start,n=e.end,i=e.type,a=void 0===i?"horizontal":i,r=e.color,o=void 0===r?"grey":r,l=e.hoveredColor,u=void 0===l?o:l,p=e.strokeWidth,m=void 0===p?2:p,g=e.children,v=vt(e,["start","end","type","color","hoveredColor","strokeWidth","startSideSize","endSideSize","sideStrokeWidth","className","children"]),h=Jn(!1),E=h.state,y=h.toggleOn,b=h.toggleOff,S=m,F=E?u:o,T=Object(s.useMemo)((function(){return("horizontal"===a?f.a:f.c)().context(null).source((function(e){return e.start})).target((function(e){return e.end})).x((function(e){return e.x})).y((function(e){return e.y}))}),[a])({start:t,end:n});return T?c.a.createElement("g",{onMouseEnter:y,onMouseLeave:b,style:{pointerEvents:"all"}},c.a.createElement("path",{d:T,stroke:F,strokeWidth:S,fill:"none"}),c.a.createElement("path",Object.assign({d:T,stroke:"transparent",strokeWidth:20,fill:"none",className:Object(d.a)(v.onClick&&ni)},v)),g):null};var ai=Object(s.createContext)(null),ri=function(e){var t=e.children,n=Object(s.useRef)({});return c.a.createElement(ai.Provider,{value:{nodes:n,setRef:function(e){for(var t=e.id,i=vt(e,["id"]),a=t+"-"+Date.now(),r=Array.isArray(t)?t:[t],o=0;o<r.length;o++){r[o]&&(n.current[r[o]]=ft({},i,{key:a}))}return a},unsetRef:function(e,t){for(var i=Array.isArray(e)?e:[e],a=0;a<i.length;a++){var r,o=i[a];o&&(null===(r=n.current[o])||void 0===r?void 0:r.key)===t&&delete n.current[o]}}}},t)};function oi(){var e=Object(s.useContext)(ai),t=function(){var e=qn(),t=e.xDomain,n=e.yDomain,i=e.dimensions,a=i.offsetLeft,r=i.offsetTop,o=e.panX,l=e.panY,c=Object(s.useCallback)((function(e){return t(e-a-o)}),[a,o,t]),u=Object(s.useCallback)((function(e){return n(e-r-l)}),[r,l,n]),p=Object(s.useCallback)((function(e){return{x:c(e.x),y:u(e.y),width:t(e.width),height:n(e.height),top:u(e.top),right:c(e.right),bottom:u(e.bottom),left:c(e.left)}}),[c,u,t,n]);return{getBoundingCanvasRect:Object(s.useCallback)((function(e){var t=e.getBoundingClientRect();return p(t)}),[p]),convertDOMRectToCanvasRect:p,convertClientX:c,convertClientY:u}}().getBoundingCanvasRect,n=Object(s.useCallback)((function(i){if(!e)return null;var a=e.nodes.current[i],r=a?a.ref.current:void 0;if(r){var o,l=t(r);if(0===l.height&&a.parentId)return n(a.parentId);if(a.boundaryId&&(o=n(a.boundaryId))){var s=a.overrideWidth?n(a.overrideWidth):void 0,c=a.overrideHeight?n(a.overrideHeight):void 0,u=(null===s||void 0===s?void 0:s.width)||l.width,p=(null===c||void 0===c?void 0:c.height)||l.height,d=Math.min(Math.max((null===s||void 0===s?void 0:s.left)||l.left,o.left),o.width+o.left-l.width),f=d!==((null===s||void 0===s?void 0:s.x)||l.x),m=Math.min(Math.max((null===c||void 0===c?void 0:c.top)||l.top+l.height/2,o.top),o.height+o.top),g=m===o.top||m===o.height+o.top;return{width:u,height:p,x:d,y:m,left:d,top:m,right:d+u,bottom:m+p,toJSON:function(){return""},clipped:f||g}}return l}return null}),[e,t]);return n}var li=Object(s.forwardRef)((function(e,t){var n=e.children,i=vt(e,["children"]),a=s.Children.only(n),r=Object(s.useRef)(null);!function(e){var t=Object(s.useContext)(ai);Object(s.useEffect)((function(){if(t&&e.id){var n=t.setRef,i=t.unsetRef,a=n(e);return function(){return i(e.id,a)}}}),[t,e])}(ft({},i,{ref:r}));return Object(s.isValidElement)(a)?Object(s.cloneElement)(a,{ref:function(e){t&&(t.current=e),r.current=e}}):null}));function si(e){return{x:e.left,y:e.y}}function ci(e){return{x:e.right,y:e.y}}function ui(e){return{x:e.x,y:e.bottom}}var pi=function(e){var t=e.start,n=e.end,i=e.color,a=vt(e,["start","end","color"]),r=qn(),o=r.addRedrawListener,l=r.removeRedrawListener,u=oi(),p=Object(s.useState)(null),d=p[0],f=p[1],m=Object(s.useState)("horizontal"),g=m[0],v=m[1],h=Object(s.useCallback)((function(){var e,i=u(t),a=u(n);if(i&&a){var r=i.width<a.width?[i,a]:[a,i],o=r[0],l=r[1];if(o.left>l.left&&o.left<l.right||o.right<l.right&&o.right>l.left){var s=i.top>a.top?[t,n]:[n,t],c=s[1],p=u(s[0]),d=u(c);p&&d?(f({start:(e=p,{x:e.x,y:e.top}),end:ui(d),startSideSize:p.clipped?0:p.width,endSideSize:d.clipped?0:d.width}),v("vertical")):f(null)}else{var m=i.left>a.left?[t,n]:[n,t],g=m[1],h=u(m[0]),E=u(g);h&&E?(f({start:si(h),end:ci(E),startSideSize:h.clipped?0:h.height,endSideSize:E.clipped?0:E.height}),v("horizontal")):f(null)}}else f(null)}),[n,t,u]);return Object(s.useEffect)((function(){return o(h),function(){l(h)}}),[o,l,h]),d?c.a.createElement(ii,Object.assign({start:d.start,end:d.end,type:g,startSideSize:d.startSideSize,endSideSize:d.endSideSize,color:i||(0===(d.startSideSize&&d.endSideSize)?"var(--pf-global--Color--light-300)":"var(--pf-global--Color--dark-200)")},a)):null},di="Column-module_column__1sNi2",fi="Column-module_hidden__rsQTt",mi=function(e){var t=e.totalColumns,n=void 0===t?1:t,i=e.visible,a=void 0===i||i,r=e.children,o=vt(e,["totalColumns","visible","children"]),l=Object(s.useMemo)((function(){return{flex:"0 0 "+100/n+"%"}}),[n]);return c.a.createElement("div",Object.assign({className:Object(d.a)(di,!a&&fi),style:l},o),r)},gi="ColumnBody-module_body__2hALu",vi=Object(s.forwardRef)((function(e,t){var n=e.children;return c.a.createElement("div",{className:gi,ref:t},n)})),hi="Actions-module_toolbar__TsQ-9",Ei="Actions-module_toolbarItem__3_5IA",yi=function(e){var t=e.children;return c.a.createElement("div",{className:hi},s.Children.map(t,(function(e,t){return c.a.createElement("div",{className:Ei,key:t},e)})))},bi="ColumnHeader-module_header__V1RS7",Si="ColumnHeader-module_plain__2oPqT",Fi="ColumnHeader-module_toolbar__30am1",Ti="ColumnHeader-module_title__2ysEf",Ci=function(e){var t=e.title,n=e.actions,i=e.variant,a=e.children;return c.a.createElement("div",{className:bi},c.a.createElement("div",{className:Object(d.a)(Fi,"plain"===i&&Si)},c.a.createElement("div",{className:Ti},c.a.createElement(m.a,{headingLevel:"h2",size:"lg"},t)),c.a.createElement(yi,null,null===n||void 0===n?void 0:n.filter((function(e){return e})))),a)},Mi="ColumnMapper-module_canvas__MPzdp",Oi=function(e){var t=e.className,n=e.children,i=vt(e,["className","children"]);return c.a.createElement(Qn,Object.assign({},i,{className:Object(d.a)(Mi,t)}),n)},Ai="Columns-module_wrapper__3eMnz",Di=function(e){var t=e.children,n=qn().dimensions,i=n.width,a=n.height;return c.a.createElement(ti,{width:i,height:a,x:0,y:0},c.a.createElement("div",{className:Ai},t))},Ni=function(e){var t=e.title,n=e.actions,i=void 0===n?[]:n,a=e.onSearch,r=Object(s.useRef)(null);return c.a.createElement(Ci,{title:t,actions:[c.a.createElement("form",{onSubmit:function(e){return r.current&&a(r.current.value),e.preventDefault(),!1},key:"search-form"},c.a.createElement(g.a,null,c.a.createElement(v.a,{name:"search",id:"search-"+t,type:"search","aria-label":"Search fields",onChange:a,ref:r,"data-testid":"search-"+t+"-fields-input-field"}),c.a.createElement(h.a,{type:"submit","aria-label":"Search","data-testid":"run-search-"+t+"-button",variant:"control"},c.a.createElement(me.a,null))))].concat(i)})},Ii=window.matchMedia&&(window.matchMedia("(pointer: none)").matches||window.matchMedia("(pointer: coarse)").matches)&&window.matchMedia("(hover: none)").matches,xi=function(e){var t=e.children;return c.a.createElement(Xe.a,{backend:et.a,options:{enableMouseEvents:!0}},t)},Pi=function(e){var t=e.children;return c.a.createElement(Xe.a,{backend:$e.a},t)},wi=Object(s.createContext)(null),Ri=function(e){var t=e.children,n=Object(s.useRef)(null),i=Ii?xi:Pi;return c.a.createElement(i,null,c.a.createElement(wi.Provider,{value:{getHoveredTarget:function(){return n.current},setHoveredTarget:function(e){return n.current=e}}},t))};function _i(){var e=Object(s.useContext)(wi);if(!e)throw new Error("A FieldsDndProvider wrapper is required to use this hook.");return e}var ji,ki,Li,Ui,Vi,zi=function(e){var t=e.children,n=_i().getHoveredTarget,i=Object(We.a)((function(e){return{draggedField:e.getItem(),currentOffset:e.getClientOffset(),isDragging:e.isDragging()}})),a=i.isDragging,r=i.draggedField;return t({isDragging:a,currentOffset:i.currentOffset,draggedField:r,getHoveredTarget:n})},Bi=Object(s.forwardRef)((function(e,t){var n=e.field,i=e.onDrop,a=e.as,r=void 0===a?"div":a,o=e.children,l=vt(e,["field","onDrop","as","children"]),u=Object(Ke.a)({type:n.type,item:n,collect:function(e){return{isDragging:e.isDragging()}},end:function(e,t){t.didDrop()&&i(n,t.getDropResult())}}),p=u[0].isDragging,d=u[1],f=u[2];Object(s.useEffect)((function(){f(Object(Qe.a)(),{captureDraggingState:!0})}),[f]);return c.a.createElement(r,Object.assign({ref:function(e){t&&(t.current=e),d(e)}},l),o({isDragging:p}))})),Ji=Object(s.forwardRef)((function(e,t){var n=e.accept,i=e.target,a=e.canDrop,r=e.as,o=void 0===r?"div":r,l=e.children,u=vt(e,["accept","target","canDrop","as","children"]),p=_i().setHoveredTarget,d=Object(Ze.a)({accept:n,collect:function(e){return{isOver:e.isOver(),isDroppable:e.canDrop(),isTarget:e.isOver()&&e.canDrop(),field:e.getItem()}},canDrop:function(e,t){return a(t.getItem())},drop:function(){return i}}),f=d[0],m=f.isOver,g=f.isDroppable,v=f.isTarget,h=f.field,E=d[1],y=Object(s.useRef)(!1),b=Object(s.useRef)(!1);return Object(s.useEffect)((function(){m===y.current&&v===b.current||(v?p(i):m||p(null),y.current=m,b.current=v)}),[m,v,p,i]),c.a.createElement(o,Object.assign({ref:function(e){t&&(t.current=e),E(e)}},u),l({isDroppable:g,isOver:m,isTarget:v,field:h}))})),Gi="FieldDragLayer-module_canvasObject__2cI4m",Hi="FieldDragLayer-module_canvasInner__3HxGR",qi=function(){var e=$n(),t=e[0],n=e[1],i=e[2];return Object(s.useEffect)(i),c.a.createElement(zi,null,(function(e){var i=e.isDragging,a=e.currentOffset,r=e.draggedField;return i&&a&&r?c.a.createElement("div",{style:{position:"absolute",zIndex:1e3,width:n.width,height:n.height,left:a.x-n.width/2,top:a.y-n.height},className:Gi},c.a.createElement("div",{ref:t,className:Hi},c.a.createElement(E.a,null,r.name))):null}))},Yi="AddFieldTypeahead-module_select__2irTI",Xi="AddFieldTypeahead-module_field__H5L5M",Wi=function(e){var t=e.fields,n=e.ariaLabelTypeAhead,i=e.placeholderText,a=e.isSource,r=Object(s.useCallback)((function(e,n){var i=e.split("\\"),a=t.find((function(e){return e.label===i[1]&&e.group===i[0]}));a&&a.onAdd()}),[t]),o={label:i,group:"",onAdd:function(){}};return c.a.createElement("div",null,c.a.createElement(S.a,{"aria-label":n,className:Yi,"data-testid":"mapping-details-add-field",id:n,onChange:r,placeholder:i},function(e,t){e.unshift(t);var n=e.reduce((function(t,n){var i=n.group+"\\"+n.label;return t[n.group]=[].concat(t[n.group]||[],[c.a.createElement(y.a,{isPlaceholder:0===n.group.length,isDisabled:!1,label:n.label,key:i+(a?"-source":"-target")+e.indexOf(n),value:i,"data-testid":"add-field-option-"+i,className:Xi},n.label)]),t}),{});return Object.entries(n).map((function(e){var t=e[0],n=e[1];return c.a.createElement(b.a,{label:t,key:t},n)}))}(t,o)))},Ki=function(e){var t=e.toggle,n=vt(e,["toggle"]),i=Jn(!1),a=i.state,r=i.toggle;return c.a.createElement(F.a,Object.assign({},n,{isOpen:a,onSelect:r,toggle:t({isOpen:a,toggleOpen:r})}))},Zi="ExpressionEnumSelect-module_document__20xcs",$i="ExpressionEnumSelect-module_field__iFvbJ",Qi="",ea=function(e){var t=e.selectedNodeId,n=e.enumCandidates,i=e.clearEnumSelect,a=e.onEnumSelect,r="expr-enum-select-"+Qi,o=Jn(!0,p),l=o.state,s=o.toggle,u=o.toggleOff;function p(e){e||(n=[],i())}return c.a.createElement("div",{"aria-label":"Expression Enumeration",className:"enumSelectMenu","data-testid":"expression-enumeration-select"},c.a.createElement(C.a,{onToggle:s,isOpen:l,value:Qi,id:r,onSelect:function(e,n,i){Qi=n,a(t,e.currentTarget.id.split("-").pop()),p(!1),u()},"data-testid":r},n.map((function(e,t){return function(e,t){return 0===e[1].length?c.a.createElement(T.a,{isDisabled:!0,label:e,value:e,key:t,className:Zi}):c.a.createElement(T.a,{label:e,value:e,key:t,className:$i})}(e.name,t)}))))},ta="ExpressionFieldSearch-module_document__LXQJd",na="ExpressionFieldSearch-module_field__2pam4",ia="ExpressionFieldSearch-module_searchMenu__ZA0PV",aa="",ra=function(e){var t=e.clearSearchMode,n=e.insertSelectedField,i=e.mappedFieldCandidates;function a(e){e||(i=[],t(!0),r=null)}var r,o="expr-field-search-"+aa,l=Jn(!0,a),s=l.state,u=l.toggle,p=l.toggleOff;function d(e){e.srcElement&&(r=e.srcElement)}function f(e){r&&e&&(r.style.backgroundColor="white",e.focus(),(r=e).style.backgroundColor="lightblue")}function m(e,t,n){}return c.a.createElement("div",{"aria-label":"Expression Field Search",className:ia,"data-testid":"expression-field-search"},c.a.createElement(C.a,{onToggle:u,isOpen:s,value:aa,id:o,onKeyDown:function(e){"Enter"===e.key?e.preventDefault():"ArrowDown"===e.key?(e.preventDefault(),d(e),r&&f(r.nextElementSibling)):"ArrowUp"===e.key?(e.preventDefault(),d(e),r&&f(r.previousElementSibling)):"Tab"===e.key&&(!r&&e.srcElement?(r=e.srcElement.nextElementSibling.firstElementChild).style.backgroundColor="lightblue":r&&r.nextElementSibling&&(e.preventDefault(),f(r.nextElementSibling)))},onSelect:function(e,t,i){if(!i){var r=e.target.getAttribute("label");n(r,aa=t)}a(!1),p()},"data-testid":o},i.map((function(e,t){return function(e,t){return"/"!==e[1][0]?c.a.createElement(T.a,{label:e[0],value:e[0],key:t,index:t,className:ta,isPlaceholder:!0}):c.a.createElement(T.a,{label:e[0],value:e[1],key:t,keyHandler:m,index:t,className:na})}(e,t)}))))},oa=-1,la=[],sa=null,ca=[],ua=null,pa="",da=!1,fa="",ma="",ga="";function va(e){if(ua)if(e)ua.innerHTML=ma;else{var t=Li();ua.innerHTML=t+ma}}function ha(){if(ua&&0!==ga.length){var e,t=ua.querySelector("#"+ga);if(t)window.getSelection().rangeCount>0?e=window.getSelection().getRangeAt(0):(e=document.createRange(),window.getSelection().addRange(e)),e.selectNode(t.childNodes[0]),e.setStart(t.childNodes[0],0),e.collapse(!0)}}function Ea(e){if(ua&&e&&e.node){for(var t=0;t<ua.childNodes.length;t++){var n=ua.childNodes[t];if(n.id===e.node.uuid){var i=window.getSelection();if(i&&i.rangeCount){var a=i.getRangeAt(0),r=n.childNodes[0]?n.childNodes[0]:n;a.selectNode(r),e.offset<=r.length&&a.setStart(r,e.offset),a.collapse(!0)}return}}ha()}}function ya(){Ui();var e=Vi();e&&(ki=e.subscribe((function(e){sa=e}))),va(),sa?(Ea(sa),sa=null):ha()}var ba=function(e){var t,n,i,a,r,o=e.executeFieldSearch,l=e.getFieldEnums,u=e.mappingExpressionAddField,p=e.mappingExpressionClearText,f=e.isMappingExpressionEmpty,m=e.mappingExpressionInit,E=e.mappingExpressionInsertText,y=e.mappingExpressionObservable,b=e.mappingExpressionRemoveField,S=e.mappingExpression,F=e.trailerId,T=e.disabled,C=e.onToggle,D=e.setSelectedEnumValue,N=Jn(!1),I=N.state,x=N.toggleOn,P=N.toggleOff;function w(e){var t,n,i=window.getSelection();if(i&&ua)if(i.rangeCount){n=!(e||!i.focusNode||i.focusNode.nodeType!==i.focusNode.TEXT_NODE||i.focusOffset!==(null===(t=i.focusNode.textContent)||void 0===t?void 0:t.length));var a=i.getRangeAt(0),r=a.startContainer,o=a.startOffset;if(r===ua)return 0===o?void(e||f||b(_(),0)):void(e&&!f&&b());if(_(r)===ga)return e&&b(),void ha();b(_(),e?o-1:o,n),_()===ga&&ha()}else _()===ga&&e&&(b(),ha())}function R(e){if(-1===oa)return null;var t=oa,i=t+pa.length+1;return e===ga?n():n(e,t,i)}function _(e){var t,n,i=window.getSelection();if(!e){if(!i||0===i.rangeCount)return ga;e=i.getRangeAt(0).startContainer}return e.nodeType===(null===i||void 0===i||null===(t=i.focusNode)||void 0===t?void 0:t.TEXT_NODE)?e.parentElement.getAttribute("id"):null===(n=e.firstChild)||void 0===n?void 0:n.getAttribute("id")}function j(e){e&&R(_(ji)),oa=-1,ji=void 0,da=!1,pa="",ca=[]}function k(){0===pa.length?(ca=[],da=!1):(pa=pa.substr(0,pa.length-1),ca=i(pa,!0))}function L(){fa="",la=[],P()}var U=Object(s.useCallback)((function(){ya()}),[]);t=u,n=p,i=o,a=l,r=D,Li=function(){return S||""},Ui=m,Vi=y,ma='<span id="'+(ga=F)+'">&nbsp;</span>';return Object(s.useEffect)((function(){if(void 0!==S)return U(),function(){ki&&ki.unsubscribe()}}),[S,U]),c.a.createElement(c.a.Fragment,null,c.a.createElement(M.a,null,c.a.createElement(O.a,{fieldId:"expressionContent"},c.a.createElement(g.a,null,c.a.createElement(A.a,{content:"Enable/ Disable conditional mapping expression.",enableFlip:!0,entryDelay:750,exitDelay:100,position:"left"},c.a.createElement(h.a,{variant:"control","aria-label":"Enable/ Disable conditional mapping expression",tabIndex:-1,onClick:C,"data-testid":"enable-disable-conditional-mapping-expression-button",isDisabled:T},c.a.createElement("i",null,"f",c.a.createElement("small",{style:{position:"relative",bottom:-3}},"(x)")))),T||void 0===S?c.a.createElement(v.a,{isDisabled:!0,"aria-label":"Expression content"}):c.a.createElement(A.a,{content:"Enter text or '@' for source\xa0fields menu.",enableFlip:!0,entryDelay:750,exitDelay:100,position:"left"},c.a.createElement("div",{id:"expressionMarkup",key:"expressionMarkup-div","aria-label":"Expression Content",contentEditable:!0,className:Object(d.a)(nt.a.formControl,"ExpressionFieldSearch"),suppressContentEditableWarning:!0,onChange:function(e){f&&U(),ki&&ki.unsubscribe(),ki=Vi().subscribe((function(e){va(),Ea(e)})),va()},onKeyDown:function(e){"Backspace"===e.key?(e.preventDefault(),w(!0),da&&k()):"Delete"===e.key&&(e.preventDefault(),w(!1),da&&k())},onKeyPress:function(e){e.ctrlKey||e.metaKey||e.altKey||e.key.length>1||(e.preventDefault(),f&&ya(),da?e.key.match(/[a-z0-9]/i)&&(pa+=e.key,ca=i(pa,!0)):(da="@"===e.key)&&(ji=window.getSelection().getRangeAt(0).startContainer,oa=window.getSelection().getRangeAt(0).startOffset,ca=i(pa="",!0)),function(e){var t=window.getSelection().getRangeAt(0),n=t.startContainer,i=t.startOffset;if(ua&&n===ua)if(0===i){var a=n.childNodes[0];E(e,a.getAttribute("id"),0)}else E(e);else{var r=_();r===ga?E(e):E(e,r,i)}}(e.key))},onPaste:function(e){if(e&&e.clipboardData){e.preventDefault();var t=e.clipboardData.getData("text/plain");E(t)}},onClick:function(e){fa=_(),(la=a(fa)).length>0&&(e.preventDefault(),x())},ref:function(e){return ua=e},tabIndex:-1,style:{paddingLeft:8}}))))),c.a.createElement("div",null,ca.length>0&&c.a.createElement("span",null,c.a.createElement(ra,{clearSearchMode:j,insertSelectedField:function(e,n){var i=R(_(ji));if(null!==i){var a=_(ji)===ga;t(e,n,i,oa,a),j(!1),ua.focus()}},mappedFieldCandidates:ca})),I&&c.a.createElement("span",null,c.a.createElement(ea,{selectedNodeId:fa,enumCandidates:la,clearEnumSelect:L,onEnumSelect:function(e,t){r(e,t),L()}}))))},Sa="ConditionalExpressionInput-module_toolbarItem__1SRmf",Fa=function(e){var t=e.executeFieldSearch,n=e.getFieldEnums,i=e.mappingExpressionAddField,a=e.mappingExpressionClearText,r=e.isMappingExpressionEmpty,o=e.mappingExpressionInit,l=e.mappingExpressionInsertText,s=e.mappingExpressionObservable,u=e.mappingExpressionRemoveField,p=e.mappingExpression,d=e.trailerId,f=e.disabled,m=e.onToggle,g=e.setSelectedEnumValue;return c.a.createElement(D.a,{variant:"filter-group",className:Sa,role:"form"},c.a.createElement(N.a,{className:Sa},c.a.createElement(ba,{disabled:f,executeFieldSearch:t,getFieldEnums:n,mappingExpressionAddField:i,mappingExpressionClearText:a,isMappingExpressionEmpty:r,mappingExpressionInit:o,mappingExpressionInsertText:l,mappingExpressionObservable:s,mappingExpressionRemoveField:u,mappingExpression:p,trailerId:d,onToggle:m,setSelectedEnumValue:g})))},Ta=function(e){var t=e.title,n=e.onClose,i=e.isOpen,a=e.uiVersion,r=e.runtimeVersion;return c.a.createElement(I.a,{variant:"small",title:t,isOpen:i,onClose:n,actions:[c.a.createElement(h.a,{key:"close",variant:"primary",onClick:n,"aria-label":"Close","data-testid":"about-dialog-close-button",isDisabled:!n},"Close")]},c.a.createElement("div",null,"UI Version: ",a),c.a.createElement("div",null,"Runtime Version: ",r))},Ca=function(e){var t=e.title,n=e.description,i=e.dataTestid,a=e.onCancel,r=e.onConfirm,o=e.isOpen,l=e.children;return c.a.createElement(I.a,{variant:"small",title:t,description:n,"data-testid":i,isOpen:o,onClose:a,actions:[c.a.createElement(h.a,{key:"confirm",variant:"primary",onClick:r,"aria-label":"Confirm","data-testid":"confirmation-dialog-confirm-button",isDisabled:!r},"Confirm"),c.a.createElement(h.a,{key:"cancel",variant:"link",onClick:a,"aria-label":"Cancel","data-testid":"confirmation-dialog-cancel-button"},"Cancel")]},l)},Ma=function(e){var t=e.title,n=e.name,i=void 0===n?"":n,a=e.value,r=void 0===a?"":a,o=e.valueType,l=void 0===o?"":o,u=e.valueTypeOptions,p=e.isOpen,d=e.onCancel,f=e.onConfirm,m=e.onValidation,g=Object(s.useState)(i),h=g[0],E=g[1],b=Object(s.useState)(r),F=b[0],T=b[1],C=Object(s.useState)(l),D=C[0],N=C[1],I=Object(s.useState)(!0),P=I[0],w=I[1],R=Object(s.useState)(!1),_=R[0],j=R[1],k=Object(s.useState)(x.d.default),L=k[0],U=k[1],V=Object(s.useCallback)((function(){E(i),T(r),N(l),j(!1),U(x.d.default),w(!0)}),[i,r,l]),z=Object(s.useCallback)((function(){f({name:h,value:F,valueType:D}),V()}),[f,V,h,F,D]),B=Object(s.useCallback)((function(){d(),V()}),[d,V]);function J(e){G(e,F),E(e)}function G(e,t){if(!e||0===e.length)return U(x.d.default),j(!1),!1;if(!/^[a-zA-Z0-9_@-]+$/.test(e))return U(x.d.error),!1;U(x.d.success);var n=m(e,t);return j(t.length>0&&n),w(n),n}return Object(s.useEffect)(V,[V]),c.a.createElement(Ca,{title:t,onCancel:B,onConfirm:_?z:void 0,isOpen:p},c.a.createElement(M.a,null,c.a.createElement(O.a,{label:"Name",fieldId:"name",isRequired:!0},P?c.a.createElement(v.a,{value:h,onChange:J,id:"name",autoFocus:!0,isRequired:!0,"data-testid":"constant-name-text-input",validated:L}):c.a.createElement(A.a,{content:c.a.createElement("div",null,"A constant with this name already exists"),entryDelay:750,exitDelay:100},c.a.createElement(v.a,{value:h,onChange:J,id:"name",autoFocus:!0,isRequired:!0,"data-testid":"constant-name-text-input-tooltip",style:{color:"red"}}))),c.a.createElement(O.a,{label:"Value",fieldId:"constvalue",isRequired:!0},c.a.createElement(v.a,{value:F,onChange:function(e){G(h,e),T(e)},id:"constvalue",autoFocus:!0,isRequired:!0,"data-testid":"constant-value-text-input"})),c.a.createElement(O.a,{label:"Value type",fieldId:"valueType"},c.a.createElement(S.a,{value:D,"aria-label":"Select value type",onChange:N,"data-testid":"constant-type-form-select"},u.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,value:i,label:n})}))))))},Oa=function(e){var t=e.title,n=e.customClassName,i=void 0===n?"":n,a=e.customClassNames,r=e.collectionType,o=void 0===r?"":r,l=e.collectionTypeOptions,u=e.isOpen,p=e.onCancel,d=e.onConfirm,f=Object(s.useState)(i),m=f[0],g=f[1],v=Object(s.useState)(o),h=v[0],E=v[1],b=Object(s.useCallback)((function(){g(i),E(o)}),[i,o]),F=Object(s.useCallback)((function(){d({customClassName:m,collectionType:h}),b()}),[d,b,m,h]),T=Object(s.useCallback)((function(){p(),b()}),[p,b]);return Object(s.useEffect)(b,[b]),c.a.createElement(Ca,{title:t,onCancel:T,onConfirm:m.length>0?F:void 0,isOpen:u},c.a.createElement(M.a,null,c.a.createElement(O.a,{label:"Custom class name",fieldId:"custom-class-name",isRequired:!0},c.a.createElement(S.a,{value:m,"aria-label":"Select class name",autoFocus:!0,onChange:g,"data-testid":"custom-class-name-form-select"},u&&a&&a.map((function(e,t){return c.a.createElement(y.a,{key:t,value:e,label:e})})))),c.a.createElement(O.a,{label:"Collection type",fieldId:"valueType"},c.a.createElement(S.a,{value:h,"aria-label":"Select value type",onChange:E,"data-testid":"collection-type-form-select"},l.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,value:i,label:n})}))))))},Aa=function(e){var t=e.id,n=e.name,i=void 0===n?"":n,a=e.isSource,r=e.isOpen,o=e.onCancel,l=e.onConfirm,u=Object(s.useState)(i),p=u[0],d=u[1],f=Object(s.useCallback)((function(){d(i)}),[i]),m=Object(s.useCallback)((function(){t&&void 0!==a&&l({id:t,name:p,isSource:a}),f()}),[p,t,a,l,f]),g=Object(s.useCallback)((function(){o(),f()}),[o,f]);return Object(s.useEffect)(f,[f]),c.a.createElement(Ca,{title:"Change selected document name?",onCancel:g,onConfirm:m,isOpen:r},c.a.createElement(v.a,{value:p,onChange:function(e){d(e)},id:t,name:p,"data-testid":t+"-parameter-text-input"}))},Da=function(e){var t=e.isOpen,n=e.onCancel,i=e.onConfirm,a=Object(s.useState)("atlasmap-mapping"),r=a[0],o=a[1],l=r.length>0?function(){return i(r)}:void 0;return c.a.createElement(Ca,{title:"Export Mappings and Documents.",onCancel:n,onConfirm:l,isOpen:t,dataTestid:"export-catalog-dialog"},c.a.createElement(M.a,null,c.a.createElement(O.a,{label:"Please enter a name for your exported catalog file",fieldId:"filename",isRequired:!0},c.a.createElement(g.a,null,c.a.createElement(v.a,{value:r,onChange:o,id:"filename",isRequired:!0,autoFocus:!0,"data-testid":"export-catalog-dialog-text-input"}),c.a.createElement(P.a,null,".adm")))))},Na="LookupTableDialog-module_iGroup__HpFO3",Ia="LookupTableDialog-module_iSelectBody__2sDE3",xa="LookupTableDialog-module_iSelectLabel__k9YCw",Pa=function(e){var t=e.enumerationValue,n=e.sourceKey,i=e.isOpen,a=Object(s.useState)(t.selectedTargetEnumValue),r=a[0],o=a[1];return c.a.createElement(M.a,null,c.a.createElement(O.a,{className:Na,fieldId:"lookup-table-row"},c.a.createElement(E.a,{className:xa},t.sourceEnumValue),c.a.createElement(S.a,{className:Ia,value:r,"aria-label":"enum-map",autoFocus:!0,onChange:function(e,n){o(e),t.selectedTargetEnumValue=e},"data-testid":"enum-map-select",key:r+"-"+n},i&&t.targetEnumValues&&t.targetEnumValues.map((function(e,t){return c.a.createElement(y.a,{key:"tgtenum-"+t,value:e,label:e})})))))},wa=function(e){var t=e.title,n=e.alias,i=void 0===n?"":n,a=e.uri,r=void 0===a?"":a,o=e.locationUri,l=void 0===o?"":o,u=e.targetNamespace,p=void 0!==u&&u,d=e.isOpen,f=e.onCancel,m=e.onConfirm,g=Object(s.useState)(i),h=g[0],E=g[1],y=Object(s.useState)(r),b=y[0],S=y[1],F=Object(s.useState)(l),T=F[0],C=F[1],A=Object(s.useState)(p),D=A[0],N=A[1],I=Object(s.useCallback)((function(){E(i),S(r),C(l),N(p)}),[i,l,p,r]),x=Object(s.useCallback)((function(){m({alias:h,uri:b,locationUri:T,targetNamespace:D}),I()}),[h,T,m,I,D,b]),P=Object(s.useCallback)((function(){f(),I()}),[f,I]);return Object(s.useEffect)(I,[I]),c.a.createElement(Ca,{title:t,onCancel:P,onConfirm:h.length>0?x:void 0,isOpen:d},c.a.createElement(M.a,null,c.a.createElement(O.a,{label:"Alias",fieldId:"alias",isRequired:!0},c.a.createElement(v.a,{value:h,onChange:E,id:"alias",autoFocus:!0,isRequired:!0})),c.a.createElement(O.a,{label:"URI",fieldId:"uri"},c.a.createElement(v.a,{value:b,onChange:S,id:"uri"})),c.a.createElement(O.a,{label:"Location URI",fieldId:"locationUri"},c.a.createElement(v.a,{value:T,onChange:C,id:"locationUri"})),c.a.createElement(O.a,{fieldId:"targetNamespace"},c.a.createElement(w.a,{isChecked:D,onChange:N,id:"targetNamespace",label:"Target namespace"}))))},Ra=function(e){var t=e.title,n=e.name,i=void 0===n?"":n,a=e.valueType,r=void 0===a?"":a,o=e.valueTypeOptions,l=e.scope,u=void 0===l?"":l,p=e.scopeOptions,d=e.isOpen,f=e.onCancel,m=e.onConfirm,g=e.onValidation,h=Object(s.useState)(i),E=h[0],b=h[1],F=Object(s.useState)(r),T=F[0],C=F[1],D=Object(s.useState)(u),N=D[0],I=D[1],P=Object(s.useState)(!1),w=P[0],R=P[1],_=Object(s.useState)(x.d.default),j=_[0],k=_[1],L=Object(s.useState)(!1),U=L[0],V=L[1],z=Object(s.useCallback)((function(){b(i),C(r),I(u),R(!1),k(x.d.default),V(!1)}),[i,r,u]),B=Object(s.useCallback)((function(){m({name:E,valueType:T,scope:N}),z()}),[E,m,z,T,N]),J=Object(s.useCallback)((function(){f(),z()}),[f,z]);function G(e){q(e,N),b(e)}function H(e){q(E,e)&&I(e)}function q(e,t){if(!e||0===e.length)return k(x.d.default),R(!1),!1;if(!/^[a-zA-Z0-9_@]+$/.test(e))return k(x.d.error),!1;k(x.d.success);var n=g(e,t);return V(n),R(e.length>0&&n),n}return Object(s.useEffect)(z,[z]),c.a.createElement(Ca,{title:t,onCancel:J,onConfirm:w?B:void 0,isOpen:d},c.a.createElement(M.a,null,c.a.createElement(O.a,{label:"Name",fieldId:"name",isRequired:!0},U?c.a.createElement(v.a,{value:E,onChange:G,id:"name",autoFocus:!0,isRequired:!0,"data-testid":"property-name-text-input",validated:j}):c.a.createElement(A.a,{content:c.a.createElement("div",null,"A property with this name and scope already exists"),entryDelay:750,exitDelay:100},c.a.createElement(v.a,{value:E,onChange:G,id:"name",autoFocus:!0,isRequired:!0,"data-testid":"property-name-text-input-tooltip",style:{color:"red"}}))),c.a.createElement(O.a,{label:"Value type",fieldId:"valueType"},c.a.createElement(S.a,{value:T,"aria-label":"Select value type",onChange:C,"data-testid":"property-type-form-select"},o.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,value:i,label:n})})))),c.a.createElement(O.a,{label:"Scope",fieldId:"scope"},U?c.a.createElement(S.a,{value:N,"aria-label":"Select property scope",onChange:H,"data-testid":"property-scope-form-select"},p.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,label:n,value:i})}))):c.a.createElement(A.a,{content:c.a.createElement("div",null,"A property with this name and scope already exists"),entryDelay:750,exitDelay:100},c.a.createElement(S.a,{value:N,"aria-label":"Select property scope",onChange:H,"data-testid":"property-scope-form-select",style:{color:"red"}},p.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,label:n,value:i})})))))))},_a=function(e){var t=e.title,n=e.parameters,i=void 0===n?[]:n,a=e.initialParameters,r=e.isOpen,o=e.onCancel,l=e.onConfirm,u=Object(s.useState)([]),p=u[0],d=u[1],f=i.filter((function(e){return!p.map((function(e){return e.name})).includes(e.name)})),m=Object(s.useCallback)((function(){d(a||[])}),[a]),E=Object(s.useCallback)((function(){l(p)}),[p,l]),b=Object(s.useCallback)((function(){o(),m()}),[o,m]),F=Object(s.useCallback)((function(){d(p.concat(ft({},f[0])))}),[p,f]),T=Object(s.useCallback)((function(e){d(p.filter((function(t){return t!==e})))}),[p]),C=Object(s.useCallback)((function(e,t){var n=[].concat(p),i=ft({},n[e],{value:t});n[e]=i,d(n)}),[p]),A=Object(s.useCallback)((function(e,t){if(0!==t){var n=[].concat(p),i=ft({},f[t-1]);n[e]=i,d(n)}}),[p,f]),D={"--pf-c-form__label--FontSize":"large","--pf-c-form--m-horizontal--md__group--GridTemplateColumns":"140px 1fr",marginBottom:"1.0rem"},N={"--pf-c-form--m-horizontal__group-label--md--GridColumnWidth":"380px","--pf-c-form--m-horizontal__group-label--md--PaddingTop":"0rem"};return Object(s.useEffect)(m,[m]),c.a.createElement(Ca,{title:t,onCancel:b,onConfirm:(null===p||void 0===p?void 0:p.length)>0?E:void 0,isOpen:r},c.a.createElement(M.a,{isHorizontal:!0,style:{"--pf-c-form--m-horizontal--md__group--GridTemplateColumns":"340px 1fr","--pf-c-form--GridGap":"0.5rem"}},p.map((function(e,t){return c.a.createElement(O.a,{fieldId:t+"-parameter",key:t,style:e.required?D:N,label:e.required?c.a.createElement("span",null,e.label):c.a.createElement(S.a,{id:"selected-paramater",value:"0",label:e.label,style:{display:"flex",marginLeft:"auto"},onChange:function(e){return A(t,e)}},[e].concat(f).map((function(e,t){return c.a.createElement(y.a,{key:t,value:t,label:e.label})})))},c.a.createElement(g.a,null,e.boolean?c.a.createElement("span",{style:{paddingTop:5,display:"inline",marginLeft:"auto",float:"right"}},c.a.createElement(R.a,{id:e.name,name:e.name,isChecked:"true"===e.value,onChange:function(e){C(t,String(e))}})):e.options&&e.options.length>0?c.a.createElement(S.a,{value:e.value,onChange:function(e){return C(t,e)},id:e.name,name:e.name,"data-testid":e.name+"-parameter-form-select"},e.options.map((function(e,t){var n=e.label,i=e.value;return c.a.createElement(y.a,{key:t,value:i,label:n})}))):c.a.createElement(v.a,{value:e.value,onChange:function(e){return C(t,e)},id:e.name,name:e.name,"data-testid":e.name+"-parameter-text-input"}),!e.required&&c.a.createElement(h.a,{variant:"plain","aria-label":"Action",onClick:function(t){return T(e)},style:{display:"inline",marginLeft:"0",float:"right"}},c.a.createElement(ge.a,null))))})),c.a.createElement("span",null,c.a.createElement(h.a,{style:{display:"inline",float:"left",marginTop:"1.0rem",width:"40"},isDisabled:!f||0===f.length,onClick:F,variant:"link",icon:c.a.createElement(ve.a,null)},"Add parameter"))))},ja=function(e){var t=e.value,n=e.delay,i=void 0===n?1e3:n,a=e.children,r=Object(s.useState)(t),o=r[0],l=r[1];return Object(s.useEffect)((function(){var e=setTimeout((function(){return l(t)}),i);return function(){return clearTimeout(e)}}),[i,t]),a(o)},ka="TruncatedString-module_fieldName__3A5S8",La=function(e){var t=e.title,n=e.children;return c.a.createElement("span",{className:ka,"data-title":t||("string"===typeof n?n:void 0)},n)},Ua="Document-module_card__RGn2a",Va="Document-module_stacked__1U8tH",za="Document-module_head__2cUCh",Ba="Document-module_header__K5DRL",Ja="Document-module_actions__TDpqD",Ga="Document-module_headerButton__3FK4r",Ha="Document-module_bodyNoPadding__1QmMP",qa="Document-module_bodyWithPadding__6CL6F",Ya="Document-module_hidden__3sH12",Xa="Document-module_noShadows__1O9rB",Wa="Document-module_dropTarget__3JRG3",Ka="Document-module_dropAccepted__2mBxm",Za=Object(s.forwardRef)((function(e,t){var n=e.title,i=e.actions,a=e.footer,r=e.selected,o=void 0!==r&&r,l=e.dropTarget,u=void 0!==l&&l,p=e.dropAccepted,f=void 0!==p&&p,g=e.stacked,v=void 0===g||g,E=e.selectable,y=void 0!==E&&E,b=e.noPadding,S=void 0!==b&&b,F=e.noShadows,T=void 0!==F&&F,C=e.startExpanded,M=e.onSelect,O=e.onDeselect,A=e.children,D=vt(e,["id","title","actions","footer","selected","dropTarget","dropAccepted","stacked","selectable","scrollIntoView","noPadding","noShadows","startExpanded","onSelect","onDeselect","children"]),N=Jn(C),I=N.state,x=N.toggle,P=Object(s.useCallback)((function(e){e.stopPropagation(),M&&M()}),[M]),w=Object(s.useCallback)((function(e){switch(e.key){case"Enter":case"Space":M&&M();break;case"Escape":O&&O()}}),[O,M]),R=o||u||f;return c.a.createElement("div",Object.assign({className:Object(d.a)(v&&Va),onClick:P,onKeyDown:w,ref:t},D),c.a.createElement(_.a,{isCompact:!0,className:Object(d.a)(Ua,T&&Xa,f&&!u&&Ka,u&&Wa),isSelected:R,isSelectable:R||y,"aria-label":n},(n||i)&&c.a.createElement(j.a,{"data-codemods":"true",className:Object(d.a)(za)},c.a.createElement(k.a,{className:Object(d.a)(Ja)},null===i||void 0===i?void 0:i.filter((function(e){return e}))),n&&c.a.createElement(L.a,{className:Object(d.a)(Ba)},c.a.createElement(h.a,{variant:"plain",onClick:x,"aria-label":"Expand/collapse this card","data-testid":"expand-collapse-"+n+"-button",className:Object(d.a)(Ga)},c.a.createElement(m.a,{size:"lg",headingLevel:"h2","aria-label":n},c.a.createElement(La,{title:n},I?c.a.createElement(he.a,null):c.a.createElement(Ee.a,null)," ",n))))),c.a.createElement(U.a,{className:Object(d.a)(S?Ha:qa,!I&&Ya)},A),a))})),$a="DocumentField-module_element__3UquT",Qa="DocumentField-module_row__42UJ1",er="DocumentField-module_nameWrapper__29uxt",tr="DocumentField-module_nameIcon__1WpQQ",nr="DocumentField-module_statusIcons__1beBv",ir="DocumentField-module_isDragging__bRkvB",ar="DocumentField-module_isSelected__228o4",rr="DocumentField-module_isDisabled__X2vKl",or="DocumentField-module_actions__Y02bP",lr=Object(s.forwardRef)((function(e,t){var n=e.name,i=e.type,a=e.scope,r=e.icon,o=e.statusIcons,l=e.actions,s=e.showType,u=void 0!==s&&s,p=e.isDragging,f=void 0!==p&&p,m=e.isFocused,g=void 0!==m&&m,v=e.isSelected,h=void 0!==v&&v,E=e.isDisabled,y=void 0!==E&&E,b=e.children,S=Jn(!1),F=S.state,T=S.toggleOff,C=S.toggleOn;return c.a.createElement("div",{ref:t,className:Object(d.a)($a,f&&ir,h&&ar,y&&rr),onMouseEnter:y?void 0:C,onMouseLeave:y?void 0:T},c.a.createElement("div",{className:Qa},r&&c.a.createElement("div",{className:tr},r),c.a.createElement(A.a,{key:""+n,position:"auto",enableFlip:!0,content:a?n+" <"+a+">":""+n,entryDelay:750,exitDelay:100},c.a.createElement("div",{className:er,"data-testid":"document-"+n+"-field"},c.a.createElement(La,null,n),c.a.createElement("span",null,u&&" ("+i+")"),c.a.createElement("span",{className:nr},o&&(null===o||void 0===o?void 0:o.filter((function(e){return e})))))),(F||g)&&l&&!y&&c.a.createElement("div",{className:or},null===l||void 0===l?void 0:l.filter((function(e){return e})))),b)})),sr="DocumentFieldPreview-module_form__MOqh2",cr=function(e){var t=e.id,n=e.value,i=e.onChange,a=Object(it.a)(i,200);return c.a.createElement(M.a,{className:sr,onClick:function(e){return e.stopPropagation()}},c.a.createElement(O.a,{label:"Mapping preview",fieldId:t},c.a.createElement(v.a,{id:t,type:"text",onChange:a,defaultValue:n||"","aria-label":"Type sample data here",placeholder:"Type sample data here","data-testid":"input-document-mapping-preview-"+t+"-field"})))},ur="DocumentFieldPreviewResults-module_form__2yX2v",pr=function(e){var t=e.id,n=e.value;return c.a.createElement(M.a,{className:ur},c.a.createElement(O.a,{label:"Preview results",fieldId:t},c.a.createElement(v.a,{id:t,type:"text",value:void 0===n?"":n,"aria-label":"Mapping results preview",placeholder:"Results will be displayed here",isDisabled:!0,"data-testid":"results-document-mapping-preview-"+t+"-field"})))},dr="DocumentFooter-module_footer__2iOjg",fr=function(e){var t=e.children;return c.a.createElement(J.a,{className:dr},t)},mr="DocumentGroup-module_buttonContent__2XWy9",gr="DocumentGroup-module_buttonIcon__-gWtf",vr="DocumentGroup-module_icon__3vO1x",hr=Object(s.forwardRef)((function(e,t){var n=e.name,i=e.type,a=e.icon,r=e.iconTooltip,o=e.showType,l=void 0!==o&&o,u=e.expanded,p=Object(s.useRef)(null);return c.a.createElement("span",{className:mr,ref:function(e){p.current=e,t&&("function"===typeof t?t(e):t.current=e)},"data-testid":"field-group-"+n+"-expanded-"+u+"-field"},c.a.createElement("span",{className:gr},u?c.a.createElement(ye.a,null):c.a.createElement(be.a,null)),n,l&&" ("+i+")",a&&c.a.createElement(A.a,{enableFlip:!0,content:r},c.a.createElement("span",{className:vr},a)))})),Er=function(){return c.a.createElement(G.a,{variant:G.b.full},c.a.createElement(H.a,{variant:"container",component:q.a}),c.a.createElement(m.a,{headingLevel:"h2",size:"lg"},"Loading"))},yr="MappingTransformation-module_transArgs__1bfr5",br={"--pf-c-form-control--FontSize":"small","--pf-c-form--GridGap":"0",marginTop:"0.4rem"},Sr={"--pf-c-form-control--FontSize":"small",marginTop:"1.0rem"},Fr={"--pf-c-form-control--FontSize":"small",marginTop:"0rem"},Tr=function(e){var t=e.name,n=e.transformationsOptions,i=e.transformationsArguments,a=void 0===i?[]:i,r=e.disableTransformation,l=e.onTransformationArgumentChange,u=e.onTransformationChange,p=e.onRemoveTransformation,f=function(e){var t,n,i,a,r=e.argId,o=e.arg,l=e.disableTransformation,u=e.onTransformationArgumentChange,p=function(e){return"User defined"===(null===e||void 0===e?void 0:e.name)},d=null===(t=o.options)||void 0===t?void 0:t.find((function(e){return p(e)})),f=null===(n=o.options)||void 0===n?void 0:n.find((function(e){return e.value===o.value}));f||(o.value?f=d:o.options&&(f=o.options[1],o.value=o.options[1].value));var m="";p(f)&&(m=o.value);var g=Object(s.useState)(!1),h=g[0],E=g[1],y=Object(s.useState)(f),b=y[0],S=y[1],F=Object(s.useState)(m),M=F[0],O=F[1];return(null===b||void 0===b?void 0:b.value)!==(null===(i=f)||void 0===i?void 0:i.value)&&S(f),c.a.createElement(Y.a,null,c.a.createElement(X.a,null,c.a.createElement(C.a,{variant:W.e.single,"aria-label":o.label,onSelect:function(e,t,n){E(!1);var i=o.options.find((function(e){return e.value===t}));i&&(S(i),o.value=p(i)?M||"":t.toString(),u(o.name,o.value))},selections:null===b||void 0===b?void 0:b.value,onToggle:function(e){E(e)},isOpen:h,placeholderText:"[None]",id:r,isDisabled:l,"data-testid":o.name,style:br},null===(a=o.options)||void 0===a?void 0:a.map((function(e,t){return c.a.createElement(T.a,{value:e.value,key:t},e.name)})))),p(b)&&c.a.createElement(X.a,null,c.a.createElement(v.a,{id:"userDefined",type:"text",name:"userDefined",value:M,onChange:function(e){O(e),o.value=e,u(o.name,e)},style:Fr,"data-testid":"userDefined",autoFocus:!0})))},m="user-field-action-"+t;return c.a.createElement(c.a.Fragment,null,c.a.createElement(O.a,{fieldId:m+"-transformation"},c.a.createElement(g.a,{style:{background:"transparent"}},c.a.createElement(S.a,{value:t,id:m,isDisabled:r,onChange:u,"data-testid":m,style:br},n.map((function(e,t){return c.a.createElement(y.a,{label:e.name,value:e.value,key:t})}))),p&&c.a.createElement(h.a,{variant:"plain",onClick:p,"data-testid":"close-transformation-"+t+"-button","aria-label":"Remove the transformation"},c.a.createElement(ge.a,null)))),a.map((function(e,t){var n=m+"-transformation-"+t;switch(e.type){case o.FieldType.BOOLEAN:return function(e,t){return c.a.createElement(w.a,{className:Object(d.a)(yr),id:e,"data-testid":e+"-checkbox",key:e,label:t.label,"aria-label":t.label,isChecked:"true"===t.value,onChange:function(e){return l(t.name,e.toString())}})}(n,e);default:return c.a.createElement(O.a,{className:Object(d.a)(yr),fieldId:n,label:e.label,key:t,style:Sr},e.options?c.a.createElement(f,{argId:n,arg:e,disableTransformation:r,onTransformationArgumentChange:l}):function(e,t){return c.a.createElement(v.a,{id:e,type:"text",name:t.name,isDisabled:r,value:t.value,onChange:function(e){return l(t.name,e)},"data-testid":"insert-transformation-parameter-"+t.name+"-input-field",style:Fr})}(n,e))}})))},Cr="MappingField-module_field__U8VrI",Mr="MappingField-module_title__2hRMD",Or="MappingField-module_fieldIndex__3Xgxl",Ar="MappingField-module_fieldName__17AfY",Dr="MappingField-module_link__3EapV",Nr="MappingField-module_transformationsWrapper__14gGs",Ir="MappingField-module_transformations__iIDte",xr={"--pf-c-form-control--FontSize":"small"},Pr=function(e){var t=e.field,n=e.name,i=e.info,a=e.index,r=e.canShowIndex,o=e.mappingExpressionEnabled,l=e.hasTransformations,u=e.onDelete,p=e.onIndexChange,f=e.onNewTransformation,E=e.children,y="mapping-field-"+n;return c.a.createElement(Ji,{key:t?t.id:n,target:{id:t.id,name:t.name,type:"mapping",payload:t},canDrop:function(){return!0},accept:["mapping"]},(function(e){var b=e.isTarget;return c.a.createElement(Bi,{field:{type:"mapping",id:t.id,name:t.name,payload:t},onDrop:function(e,t){p&&p(t.payload)}},(function(e){var S=e.isDragging;return c.a.createElement(li,{id:[t.id,S?"dnd-start":void 0,b?"dnd-target-field":void 0]},c.a.createElement("div",{className:Cr,"aria-labelledby":y,"data-testid":y},c.a.createElement(Y.a,null,c.a.createElement(X.a,{isFilled:!0},c.a.createElement(m.a,{headingLevel:"h6",size:"md",id:y,className:Mr},r&&c.a.createElement(A.a,{position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,"Edit the index for this element by selecting the arrows or by dragging and dropping the element to the desired position. Placeholders may be automatically inserted to account for any gaps in the indexing.")},c.a.createElement(g.a,{className:Or},c.a.createElement(P.a,null,"#"),c.a.createElement(v.a,{type:"number",value:a,id:"index",onChange:p,"data-testid":"change-"+n+"-input-index",isDisabled:!p,style:xr}))),c.a.createElement(A.a,{position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,i)},c.a.createElement("div",{className:Ar},n," ",c.a.createElement(Se.a,null))))),!o&&f&&c.a.createElement(X.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:"Add a new transformation."},c.a.createElement(h.a,{variant:"plain",onClick:f,className:Dr,"data-testid":"add-transformation-to-"+n+"-field-button"},c.a.createElement(Fe.a,null)))),c.a.createElement(X.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:"Delete this field from the mapping."},c.a.createElement(h.a,{variant:"plain",onClick:u,className:Dr,"data-testid":"remove-"+n+"-from-mapping-button"},c.a.createElement(ge.a,null))))),!o&&l&&E&&s.Children.count(E)>0&&c.a.createElement("div",{className:Object(d.a)(Nr)},c.a.createElement(m.a,{headingLevel:"h6",size:"md"},"Transformations"),c.a.createElement("div",{className:Ir},E))))}))}))},wr="MappingFields-module_wrapper__1N9IY",Rr=function(e){var t=e.title,n=e.isSource,i=e.onCreateConstant,a=e.onCreateProperty,r=e.canAddToSelectedMapping,o=e.children,l=Jn(!0),s=l.state,u=l.toggle;return c.a.createElement("div",{className:wr},c.a.createElement(h.a,{key:"expandable",variant:"plain","aria-label":"Ok",onClick:u,"data-testid":"mapping-fields-detail-"+t+"-toggle",style:{display:"inline",marginLeft:"auto"}},s?c.a.createElement(Te.a,null):c.a.createElement(Ce.a,null)),t,c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create and map a property."),key:"create-property",entryDelay:750,exitDelay:100},c.a.createElement(h.a,{key:"create-prop",variant:"plain","aria-label":"Add Property",isDisabled:!r(n),onClick:function(){return a(n,null)},"data-testid":"mapping-details-add-property-button-test",style:{display:"inline",marginLeft:"auto",float:"right"}},c.a.createElement(Me.a,null))),n&&c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create and map a source constant."),key:"create-constant",entryDelay:750,exitDelay:100},c.a.createElement(h.a,{key:"create-const",variant:"plain","aria-label":"Add Constant",isDisabled:!r(n),onClick:i,"data-testid":"mapping-details-add-constant-button-test",style:{display:"inline",marginLeft:"auto",float:"right"}},c.a.createElement(ve.a,null))),s&&o)},_r=function(e){var t=e.variant,n=e.title,i=e.children,a=e.onTimeout,r=e.onClose,o=Object(s.useState)(8e3),l=o[0],u=o[1],p=Jn(!1),d=p.state,f=p.toggleOn,m=p.toggleOff;return Object(s.useEffect)((function(){var e=void 0;return l<=0?a():d||e?u(8e3):e=setInterval((function(){u((function(e){return e-100}))}),100),function(){return e&&clearTimeout(e)}}),[l,d,a]),c.a.createElement(K.a,{isLiveRegion:!0,variant:t,title:n,actionClose:c.a.createElement(Z.a,{title:n,variantLabel:t+" alert",onClose:r}),onMouseEnter:f,onMouseLeave:m},i)},jr=Object(s.createContext)(null),kr=function(e){var t=e.children,n=Object(s.useState)(null),i=n[0],a=n[1];return c.a.createElement(jr.Provider,{value:{focusedItem:i,setFocusedItem:a}},t)},Lr=function(e){var t=e.ref,n=e.isExpandable,i=void 0!==n&&n,a=e.isExpanded,r=void 0!==a&&a,o=e.collapseTreeitem,l=e.expandTreeitem,c=Object(s.useContext)(jr);if(!c)throw new Error("useTreeFocus can be used only inside a Tree component");var u=c.focusedItem,p=c.setFocusedItem,d=function(e){var t;return Array.from((null===(t=e.closest("[role=tree]"))||void 0===t?void 0:t.querySelectorAll("[role=treeitem]"))||[]).filter((function(e){var t,n=null===(t=e.parentElement)||void 0===t?void 0:t.closest("[aria-expanded]");return!n||"true"===n.getAttribute("aria-expanded")}))},f=function(e,t){t.forEach((function(e){return e.setAttribute("tabindex","-1")})),t[e].setAttribute("tabindex","0"),t[e].focus()},m=function(){if(t.current){var e=d(t.current),n=null===e||void 0===e?void 0:e.indexOf(t.current);n<e.length-1&&f(n+1,e)}};return{focused:u&&u===t.current,handlers:{onKeyDown:function(e){if(e.target===t.current&&!(e.altKey||e.ctrlKey||e.metaKey))switch(e.key){case" ":case"Enter":e.target===t.current&&(e.target.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0})),p(t.current));break;case"Escape":p(null),e.preventDefault();break;case"ArrowUp":!function(){if(t.current){var e=d(t.current),n=null===e||void 0===e?void 0:e.indexOf(t.current);n>0&&f(n-1,e)}}();break;case"ArrowDown":m();break;case"ArrowRight":i&&(r?m():l&&l());break;case"ArrowLeft":i&&r&&o&&o();break;case"Home":!function(){if(t.current){var e=d(t.current);f(0,e)}}();break;case"End":!function(){if(t.current){var e=d(t.current);f(e.length-1,e)}}()}},onClick:function(e){if(t.current)if(i&&r)e.stopPropagation();else{var n=d(t.current),a=null===n||void 0===n?void 0:n.indexOf(t.current);f(a,n),p(t.current)}},onBlur:function(e){var n,i;(null===(n=e.relatedTarget)||void 0===n?void 0:n.closest("[role=tree]"))!==(null===(i=t.current)||void 0===i?void 0:i.closest("[role=tree]"))&&p(null)}}}},Ur="Tree-module_accordion__3FmHH",Vr=function(e){var t=e.children,n=Object(s.useRef)(null);return Object(s.useLayoutEffect)((function(){if(n.current&&!n.current.querySelector('[role=treeitem][tabindex="0"]')){var e=n.current.querySelector("[role=treeitem]");e&&e.setAttribute("tabindex","0")}})),c.a.createElement(kr,null,c.a.createElement("div",{ref:n},c.a.createElement($.a,{asDefinitionList:!1,className:Ur,role:"tree"},t)))},zr="TreeGroup-module_button__J0cG0",Br="TreeGroup-module_content__36sz6",Jr="TreeGroup-module_hiddenContent__35KLm",Gr=Object(s.forwardRef)((function(e,t){var n=e.id,i=e.expanded,a=e.level,r=e.setSize,o=e.position,l=e.renderLabel,u=e.children,p=Object(s.useRef)(null),f=Object(s.useState)(!1),m=f[0],g=f[1],v=Object(s.useCallback)((function(){g(!m)}),[m]),h=Object(s.useCallback)((function(e){e.stopPropagation(),v()}),[v]),E=Object(s.useCallback)((function(){return g(!0)}),[]),y=Object(s.useCallback)((function(){return g(!1)}),[]);Object(s.useEffect)((function(){void 0!==i&&g(i)}),[i]);var b=Lr({ref:p,isExpandable:!0,isExpanded:m,collapseTreeitem:y,expandTreeitem:E}),S=b.focused,F=b.handlers;return c.a.createElement("div",Object.assign({ref:function(e){p.current=e,t&&("function"===typeof t?t(e):t.current=e)},role:"treeitem","aria-level":a,"aria-setsize":r,"aria-posinset":o,"aria-expanded":m},F,{onClick:function(e){F.onClick(e),e.isPropagationStopped()||v()}}),c.a.createElement(Q.a,null,c.a.createElement(ee.a,{isExpanded:m,id:n+"-toggle","data-testid":n+"-toggle",className:zr,tabIndex:-1,component:function(e){var t=e.children;return c.a.createElement("span",{role:"heading","aria-level":a+2},t)},onClick:h},l({expanded:m,focused:S||!1})),c.a.createElement(te.a,{isHidden:!m,className:Object(d.a)(Br,!m&&Jr),role:"group"},u({expanded:m,focused:S||!1}))))})),Hr=Object(s.forwardRef)((function(e,t){var n=e.level,i=e.setSize,a=e.position,r=e.children,o=vt(e,["level","setSize","position","children"]),l=Object(s.useRef)(null),u=Lr({ref:l}),p=u.focused,d=u.handlers;return c.a.createElement("div",Object.assign({ref:function(e){l.current=e,t&&("function"===typeof t?t(e):t.current=e)},role:"treeitem","aria-level":n,"aria-setsize":i,"aria-posinset":a},d,o),r({focused:p||!1}))}));var qr="Toolbar-module_toolbar__3-hXm",Yr="Toolbar-module_toolbarContent__18Jxq",Xr=function(e){var t=e.children;return c.a.createElement(ne.a,{id:"data-toolbar",className:Object(d.a)(qr),role:"complementary"},c.a.createElement(ie.a,{className:Object(d.a)(Yr)},t))},Wr=function(e){var t=e.children;return c.a.createElement(ne.a,{className:Object(d.a)(qr)},c.a.createElement(ie.a,{className:Object(d.a)(Yr)},t))},Kr="MainContent-module_wrapper__1yI76",Zr=function(e){var t=e.children;return c.a.createElement("div",{className:Kr,role:"main"},t)},$r="Sidebar-module_sidebar___WsR3",Qr=function(e){var t=e.show,n=e.children;return c.a.createElement(ot.a,{show:t,className:$r},t&&n())},eo="MainLayout-module_view__1QIGw",to=Object(s.memo)((function(e){var t=e.loading,n=e.showSidebar,i=e.renderSidebar,a=e.contextToolbar,r=e.expressionToolbar,o=e.controlBar,l=e.children,s=c.a.createElement(Qr,{show:n},i),u="pf-topology-container"+(s?" pf-topology-container__with-sidebar":"")+(n?" pf-topology-container__with-sidebar--open":"");return t?c.a.createElement(Er,null):c.a.createElement(ae.a,{className:eo},a&&c.a.createElement(re.a,{isFilled:!1},a),r&&c.a.createElement(re.a,{isFilled:!1},r),c.a.createElement(re.a,{isFilled:!0,className:u},c.a.createElement("div",{className:"pf-topology-content"},l,o&&c.a.createElement("span",{className:"pf-topology-control-bar"},o)),s))})),no="MappingDetailsSidebar-module_content__qShUk",io=function(e){var t=e.onDelete,n=e.onClose,i=e.onEditEnum,a=e.isEnumMapping,r=e.children;return c.a.createElement(ae.a,{"data-testid":"column-mapping-details-area"},c.a.createElement(re.a,null,c.a.createElement(Ci,{title:"Mapping Details",variant:"plain",actions:[c.a.createElement(h.a,{onClick:n,variant:"plain","aria-label":"Close the mapping details panel","data-testid":"close-mapping-detail-button",key:"close"},c.a.createElement(Oe.a,null)),c.a.createElement(A.a,{key:"edit-enum",position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Edit the enumeration mappings"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:i,"aria-label":"Edit the enumeration mappings","data-testid":"edit-enum-mapping-button",isDisabled:!a()},c.a.createElement(Ae.a,null))),c.a.createElement(A.a,{key:"remove",position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Remove the current mapping"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:t,"aria-label":"Remove the current mapping","data-testid":"remove-current-mapping-button"},c.a.createElement(ge.a,null)))]})),c.a.createElement(re.a,{isFilled:!0,className:no},r))},ao=function(e){var t=e.id,n=e.onClick;return c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Capture Document ID to clipboard")},c.a.createElement(h.a,{variant:"plain",onClick:n,"aria-label":"Capture Document ID to clipboard","data-testid":"capture-"+t+"-name-button"},c.a.createElement(De.a,null)))},ro=function(e){var t=e.id,n=e.onClick;return c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Change document name")},c.a.createElement(h.a,{variant:"plain",onClick:n,"aria-label":"Change document name","data-testid":"change-"+t+"-name-button"},c.a.createElement(Ae.a,null)))},oo=function(e){var t=e.id,n=e.onClick;return c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Remove instance or schema file")},c.a.createElement(h.a,{variant:"plain",onClick:n,"aria-label":"Remove instance or schema file","data-testid":"remove-"+t+"-instance-or-schema-file-button"},c.a.createElement(ge.a,null)))},lo=function(e){var t=e.id,n=e.onClick;return c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Modify CSV Parameters")},c.a.createElement(h.a,{variant:"plain",onClick:n,"aria-label":"Modify CSV parameters","data-testid":"modify-csv-params-"+t+"-button"},c.a.createElement(Ae.a,null)))},so=function(e){var t=e.isSource,n=e.onImport,i=e.onImportFromEntaxyRegistry,a=e.onCreateInstance,r=Jn(!1),o=r.state,l=r.toggle,s=r.toggleOff,u=function(e){return function(){e.apply(void 0,arguments),s()}},p=t?oe.d.left:oe.d.right,d=[n&&c.a.createElement(co,{onFile:u(n),key:"import-catalog"}),i&&c.a.createElement(uo,{onRegistryLocation:u(i),key:"import-catalog"}),a&&c.a.createElement(po,{onContent:u(a),key:"import-catalog"})].filter((function(e){return e}));return c.a.createElement(F.a,{position:p,toggle:c.a.createElement(V.a,{id:"atlasmap-toggle",onToggle:l,toggleIndicator:null},c.a.createElement(Ie.a,null)),isOpen:o,dropdownItems:d,isPlain:!0})},co=function(e){var t=e.onFile,n=Object(lt.useFilePicker)({maxFileSize:1}),i=n.files,a=n.onClick,r=n.HiddenFileInput,o=Object(s.useRef)(null);return Object(s.useEffect)((function(){o.current!==i&&(o.current=i,1===(null===i||void 0===i?void 0:i.length)&&(o.current=null,t(i[0])))}),[i,t]),c.a.createElement(z.a,{onClick:a},"Import instance or schema file",c.a.createElement(r,{accept:".json, .xml, .xsd, .csv",multiple:!1}))},uo=function(e){var t=e.onRegistryLocation;function n(e){e.origin===window.origin&&e.data&&"importInstanceOrSchema"===e.data.type&&e.data.content&&t(e.data.content)}return Object(s.useEffect)((function(){return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}})),c.a.createElement(z.a,{onClick:function(){window.top.postMessage("openRegistryViewerForImportInstanceOrSchemaFile",window.top.origin)}},"Open instance or schema file from Entaxy registry")},po=function(e){var t=e.onContent;function n(e){e.origin===window.origin&&e.data&&"createInstanceOrSchema"===e.data.type&&e.data.content&&t(e.data.content)}return Object(s.useEffect)((function(){return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}})),c.a.createElement(z.a,{onClick:function(){window.top.postMessage("openCreateInstanceOrSchemaModal",window.top.origin)}},"Create instance or schema")},fo=function(e){var t=e.fieldId,n=e.group,i=e.showTypes,a=e.boundaryId,r=e.overrideWidth,o=e.parentId,l=e.acceptDropType,s=e.draggableType,u=e.level,p=void 0===u?1:u,d=e.position,f=void 0===d?1:d,m=e.setSize,g=void 0===m?1:m,v=e.children;return c.a.createElement(Ji,{key:t,target:{id:n.id,name:n.name,type:s},canDrop:function(){return!1},accept:[l]},(function(e){var l=e.isOver;return c.a.createElement(ja,{value:l},(function(e){return c.a.createElement(li,{id:t,parentId:o,boundaryId:a,overrideWidth:r},c.a.createElement(Gr,{id:t,level:p,position:f,setSize:g,expanded:!0===e||void 0,renderLabel:function(t){var a=t.expanded;return c.a.createElement(hr,{name:n.name,type:n.type,showType:i,icon:n.isCollection?c.a.createElement(xe.a,null):void 0,iconTooltip:n.isCollection?"This object is a collection":void 0,expanded:e||a})}},v))}))}))},mo=function(e){var t=e.fieldId,n=e.field,i=e.showTypes,a=e.boundaryId,r=e.overrideWidth,o=e.parentId,l=e.acceptDropType,s=e.draggableType,u=e.level,p=void 0===u?1:u,d=e.position,f=void 0===d?1:d,m=e.setSize,g=void 0===m?1:m,v=e.canDrop,E=e.onDrop,y=e.renderActions,b=void 0===y?function(){return[]}:y,S=e.renderPreview,F=S&&S(n);return c.a.createElement(Ji,{key:t,target:{id:n.id,name:n.name,type:s,payload:n},canDrop:function(e){return v(n,e)},accept:[l]},(function(e){var l=e.isDroppable,u=e.isTarget;return c.a.createElement(Bi,{field:{type:s,id:n.id,name:n.name,payload:n},onDrop:function(e,t){return E(n,t)}},(function(e){var s=e.isDragging;return c.a.createElement(li,{id:[t,s?"dnd-start":void 0,u?"dnd-target-field":void 0],parentId:o,boundaryId:a,overrideWidth:r},c.a.createElement(Hr,{level:p,position:f,setSize:g},(function(e){var t=e.focused;return c.a.createElement(c.a.Fragment,null,c.a.createElement(lr,{name:n.name,icon:l||u?c.a.createElement(h.a,{variant:u?"link":"plain",tabIndex:-1,"aria-label":"Drop target",isDisabled:!l,"data-testid":"is-droppable-"+n.name+"-button"},c.a.createElement(Pe.a,{size:"sm"})):c.a.createElement(h.a,{variant:"plain",tabIndex:-1,"aria-hidden":!0,"data-testid":"grip-"+n.name+"-button"},c.a.createElement(we.a,null)),type:n.enumeration?"ENUM":n.type,scope:n.scope,showType:i,isDragging:s,isFocused:t,isSelected:!!F,isDisabled:n.isDisabled,statusIcons:[n.isConnected?c.a.createElement(A.a,{key:"connected",position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,"This field is connected")},c.a.createElement(Re.a,{label:"This field is connected",size:"sm",tabIndex:-1})):null,n.isCollection?c.a.createElement(A.a,{key:"collection",position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,"This field is a collection")},c.a.createElement(xe.a,{label:"This field is a collection",size:"sm",tabIndex:-1})):null,n.hasTransformations?c.a.createElement(A.a,{key:"transformations",position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,"This field has transformations")},c.a.createElement(Fe.a,{label:"This field has transformations",size:"sm",tabIndex:-1})):null,n.isAttribute?c.a.createElement(A.a,{key:"attribute",position:"auto",enableFlip:!0,entryDelay:750,exitDelay:100,content:c.a.createElement("div",null,"This field is an attribute")},c.a.createElement(_e.a,{label:"This field is an attribute",size:"sm",tabIndex:-1})):null],actions:b(n)},F))})))}))}))};function go(e,t){return e.reduce((function(e,n){return[].concat(e,[""+t+n.id],n.fields?go(n.fields,t):[])}),[])}var vo=function(e){var t=e.fields,n=e.idPrefix,i=e.isVisible,a=void 0===i||i,r=vt(e,["fields","idPrefix","isVisible"]);return a?c.a.createElement(c.a.Fragment,null,t.map((function(e,i){return c.a.createElement(ho,Object.assign({key:i,field:e,idPrefix:n,setSize:t.length,position:i+1,isVisible:a},r))}))):c.a.createElement(li,{id:go(t,n),boundaryId:r.boundaryId,parentId:r.parentId},c.a.createElement("div",null,"\xa0"))},ho=function(e){var t=e.field,n=e.idPrefix,i=e.level,a=void 0===i?1:i,r=vt(e,["field","idPrefix","level"]),o=""+n+t.id,l=t,s=t;return l.fields?c.a.createElement(fo,Object.assign({fieldId:o,group:l,level:a},r),(function(e){var t=e.expanded;return c.a.createElement(vo,Object.assign({},r,{fields:l.fields,parentId:o,level:a+1,idPrefix:n,isVisible:t}))})):c.a.createElement(mo,Object.assign({fieldId:o,field:s,level:a},r))};function Eo(e){var t=e.connectedMappings,n=e.onShowMappingDetails,i=e.canAddFieldToSelectedMapping,a=e.onAddToSelectedMapping,r=e.canRemoveFromSelectedMapping,o=e.onRemoveFromSelectedMapping,l=e.canStartMapping,s=e.onStartMapping;return[c.a.createElement(A.a,{key:"select-mapping",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Show mapping details")},t.length>1?c.a.createElement(Ki,{toggle:function(e){var t=e.toggleOpen;return c.a.createElement(V.a,{toggleIndicator:null,"aria-label":"Show mapping details",onToggle:t},c.a.createElement(Ne.a,null))},isPlain:!0,position:"right",dropdownItems:t.map((function(e){return c.a.createElement(z.a,{key:e.id,onClick:function(){return n(e)}},c.a.createElement(m.a,{headingLevel:"h2",size:"lg"},e.name),c.a.createElement(Y.a,{hasGutter:!0},c.a.createElement(X.a,null,c.a.createElement(m.a,{headingLevel:"h2",size:"md"},"Sources"),e.sourceFields.map((function(e){return c.a.createElement("div",{key:e.id},e.name)}))),c.a.createElement(X.a,null,c.a.createElement(m.a,{headingLevel:"h2",size:"md"},"Targets"),e.targetFields.map((function(e){return c.a.createElement("div",{key:e.id},e.name)})))))})),disabled:0===t.length}):c.a.createElement(h.a,{variant:"plain",onClick:function(){return n(t[0])},"aria-label":"Show mapping details",tabIndex:0,isDisabled:0===t.length,"data-testid":"show-mapping-details-button"},c.a.createElement(Ne.a,null))),r?c.a.createElement(A.a,{key:"quick-remove",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Disconnect from the selected mapping")},c.a.createElement(h.a,{variant:"plain",onClick:o,"aria-label":"Disconnect from the selected mapping","data-testid":"disconnect-from-the-selected-mapping-button",tabIndex:0},c.a.createElement(je.a,null))):c.a.createElement(A.a,{key:"quick-add",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Connect to the selected mapping")},c.a.createElement(h.a,{variant:"plain",onClick:a,"aria-label":"Connect to the selected mapping",tabIndex:0,isDisabled:!i,"data-testid":"connect-to-the-selected-mapping-button"},c.a.createElement(ke.a,null))),c.a.createElement(A.a,{key:"add",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create new mapping")},c.a.createElement(h.a,{variant:"plain",onClick:s,"aria-label":"Create new mapping",tabIndex:0,isDisabled:!l,"data-testid":"create-new-mapping-button"},c.a.createElement(Le.a,null)))]}var yo=function(e){var t=e.fields,n=e.onDrop,i=e.canDrop,a=e.onShowMappingDetails,r=e.canAddFieldToSelectedMapping,o=e.onAddToSelectedMapping,l=e.canRemoveFromSelectedMapping,s=e.onRemoveFromSelectedMapping,u=e.onEditConstant,p=e.onDeleteConstant,d=e.canStartMapping,f=e.onStartMapping,m=e.renderPreview;return c.a.createElement(Vr,null,c.a.createElement(vo,{fields:t,showTypes:!1,parentId:"sources-constants",boundaryId:"sources-height",overrideWidth:"sources-width",idPrefix:"sources-field-",acceptDropType:"target",draggableType:"source",onDrop:n,canDrop:i,renderActions:function(e){return[].concat(Eo({connectedMappings:e.mappings,onShowMappingDetails:a,canAddFieldToSelectedMapping:r(e),onAddToSelectedMapping:function(){return o(e)},canRemoveFromSelectedMapping:l(e),onRemoveFromSelectedMapping:function(){return s(e)},canStartMapping:d(e),onStartMapping:function(){return f(e)}}),[c.a.createElement(A.a,{key:"edit",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Edit constant"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:function(){return u(e.name,e.value)},"aria-label":"Edit constant",tabIndex:0,"data-testid":"edit-constant-"+e.name+"-button"},c.a.createElement(Ae.a,null))),c.a.createElement(A.a,{key:"delete",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Remove constant"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:function(){return p(e.name)},"aria-label":"Remove constant",tabIndex:0,"data-testid":"remove-constant-"+e.name+"-button"},c.a.createElement(ge.a,null)))])},renderPreview:m}))},bo=function(e){var t=e.acceptDropType,n=e.draggableType,i=e.isSource,a=e.fields,r=e.showTypes,o=e.onDrop,l=e.canDrop,s=e.onShowMappingDetails,u=e.canAddFieldToSelectedMapping,p=e.onAddToSelectedMapping,d=e.canRemoveFromSelectedMapping,f=e.onRemoveFromSelectedMapping,m=e.onEditProperty,g=e.onDeleteProperty,v=e.canStartMapping,E=e.onStartMapping,y=e.renderPreview;return c.a.createElement(Vr,null,c.a.createElement(vo,{fields:a,showTypes:r,parentId:i?"sources-properties":"targets-properties",boundaryId:i?"sources-height":"targets-height",overrideWidth:i?"sources-width":"targets-width",idPrefix:i?"sources-field-":"targets-field-",acceptDropType:t,draggableType:n,onDrop:o,canDrop:l,renderActions:function(e){return[].concat(Eo({connectedMappings:e.mappings,onShowMappingDetails:s,canAddFieldToSelectedMapping:u(e),onAddToSelectedMapping:function(){return p(e)},canRemoveFromSelectedMapping:d(e),onRemoveFromSelectedMapping:function(){return f(e)},canStartMapping:v(e),onStartMapping:function(){return E(e)}}),[c.a.createElement(A.a,{key:"edit",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Edit property"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:function(){return m(e.name,e.scope,i)},"aria-label":"Edit property",tabIndex:0,"data-testid":"edit-property-"+e.name+"-button"},c.a.createElement(Ae.a,null))),c.a.createElement(A.a,{key:"delete",position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Remove property"),entryDelay:750,exitDelay:100},c.a.createElement(h.a,{variant:"plain",onClick:function(){return g(e.name,e.scope,i)},"aria-label":"Remove property",tabIndex:0,"data-testid":"remove-property-"+e.name+"-button"},c.a.createElement(ge.a,null)))])},renderPreview:y}))},So=function(e){var t=e.acceptDropType,n=e.draggableType,i=e.isSource,a=e.onCreateConstant,r=e.onEditConstant,l=e.onDeleteConstant,u=e.onCreateProperty,p=e.onEditProperty,d=e.onDeleteProperty,f=e.onImportDocument,m=e.onImportDocumentFromEntaxyRegistry,g=e.onCreateInstance,v=e.onDeleteDocument,E=e.onCaptureDocumentID,y=e.onChangeDocumentName,b=e.onEditCSVParams,S=e.onSearch,F=e.canDrop,T=e.onDrop,C=e.onShowMappingDetails,M=e.canAddFieldToSelectedMapping,O=e.onAddToSelectedMapping,D=e.canRemoveFromSelectedMapping,N=e.onRemoveFromSelectedMapping,I=e.canStartMapping,x=e.onStartMapping,P=e.shouldShowMappingPreviewForField,w=e.onFieldPreviewChange,R=e.sourceProperties,_=e.constants,j=e.sources,k=e.showTypes,L=Object(s.useCallback)((function(e){return P(e)&&c.a.createElement(cr,{id:e.id,value:e.value,onChange:function(t){return w(e,t)}})}),[w,P]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(Ni,{title:"Source",onSearch:S,actions:[f&&m&&g&&c.a.createElement(so,{isSource:!0,onImport:f,onImportFromEntaxyRegistry:m,onCreateInstance:g,key:"import"})]}),c.a.createElement(li,{id:"sources-height"},c.a.createElement(vi,null,c.a.createElement(li,{id:"sources-width"},c.a.createElement("div",null,c.a.createElement(li,{id:"sources-properties",boundaryId:"sources-height",overrideWidth:"sources-width"},c.a.createElement(Za,{title:"Properties",startExpanded:!!R,actions:[c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create a source property for use in mapping"),key:"create-property",entryDelay:750,exitDelay:100},c.a.createElement(h.a,{onClick:function(){return u(i)},variant:"plain","aria-label":"Create a source property for use in mapping","data-testid":"create-source-property-button"},c.a.createElement(ve.a,null)))],noPadding:!!R},R?c.a.createElement(bo,{acceptDropType:t,draggableType:n,isSource:i,onEditProperty:p,onDeleteProperty:d,canDrop:F,onDrop:T,onShowMappingDetails:C,canAddFieldToSelectedMapping:M,onAddToSelectedMapping:O,canRemoveFromSelectedMapping:D,onRemoveFromSelectedMapping:N,canStartMapping:I,onStartMapping:x,fields:R.fields,showTypes:k,renderPreview:L}):"No source properties")),c.a.createElement(li,{id:"sources-constants",boundaryId:"sources-height",overrideWidth:"sources-width"},c.a.createElement(Za,{title:"Constants",startExpanded:!!_,actions:[c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create a constant for use in mapping"),key:"create-constant",entryDelay:750,exitDelay:100},c.a.createElement(h.a,{onClick:a,variant:"plain","aria-label":"Create a constant for use in mapping","data-testid":"create-constant-button"},c.a.createElement(ve.a,null)))],noPadding:!!_},_?c.a.createElement(yo,{onEditConstant:r,onDeleteConstant:l,canDrop:F,onDrop:T,onShowMappingDetails:C,canAddFieldToSelectedMapping:M,onAddToSelectedMapping:O,canRemoveFromSelectedMapping:D,onRemoveFromSelectedMapping:N,canStartMapping:I,onStartMapping:x,fields:_.fields,renderPreview:L}):c.a.createElement("p",null,"No constants"))),j.map((function(e){var i="sources-document-"+e.id;return c.a.createElement(li,{key:e.id,id:i,boundaryId:"sources-height",overrideWidth:"sources-width"},c.a.createElement(Za,{title:e.name,startExpanded:!0,footer:k?c.a.createElement(fr,null,"Source document type: ",e.type):void 0,actions:e.type===o.DocumentType.CSV?[E&&c.a.createElement(ao,{id:i,onClick:function(){return E(e.id)},key:"capture-document-id"}),b&&c.a.createElement(lo,{id:i,onClick:function(){return b(e.id,!0)},key:"on-edit-csv-params"}),v&&c.a.createElement(oo,{id:i,onClick:function(){return v(e.id)},key:"delete-document"})]:[E&&c.a.createElement(ao,{id:i,onClick:function(){return E(e.id)},key:"capture-document-id"}),y&&c.a.createElement(ro,{id:i,onClick:function(){return y(e.id,e.name)},key:"change-document-name"}),v&&c.a.createElement(oo,{id:i,onClick:function(){return v(e.id)},key:"delete-document"})],noPadding:!0},c.a.createElement(Vr,null,c.a.createElement(vo,{fields:e.fields,showTypes:k,boundaryId:"sources-height",overrideWidth:"sources-width",parentId:i,idPrefix:"sources-field-",acceptDropType:t,draggableType:n,onDrop:T,canDrop:F,renderActions:function(e){return Eo({connectedMappings:e.mappings,onShowMappingDetails:C,canAddFieldToSelectedMapping:M(e),onAddToSelectedMapping:function(){return O(e)},canRemoveFromSelectedMapping:D(e),onRemoveFromSelectedMapping:function(){return N(e)},canStartMapping:I(e),onStartMapping:function(){return x(e)}})},renderPreview:L}))))})))))))},Fo=function(e){var t=e.acceptDropType,n=e.draggableType,i=e.isSource,a=e.onSearch,r=e.onImportDocument,l=e.onImportDocumentFromEntaxyRegistry,u=e.onCreateInstance,p=e.onDeleteDocument,d=e.onCaptureDocumentID,f=e.onChangeDocumentName,m=e.onCreateProperty,g=e.onEditCSVParams,v=e.onEditProperty,E=e.onDeleteProperty,y=e.onDrop,b=e.canDrop,S=e.onShowMappingDetails,F=e.canAddFieldToSelectedMapping,T=e.onAddToSelectedMapping,C=e.canRemoveFromSelectedMapping,M=e.onRemoveFromSelectedMapping,O=e.canStartMapping,D=e.onStartMapping,N=e.shouldShowMappingPreviewForField,I=e.targets,x=e.showTypes,P=e.targetProperties,w=Object(s.useCallback)((function(e){return N(e)&&c.a.createElement(pr,{id:e.id,value:e.value})}),[N]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(Ni,{title:"Target",onSearch:a,actions:[r&&l&&u&&c.a.createElement(so,{isSource:!1,onImport:r,onImportFromEntaxyRegistry:l,onCreateInstance:u,key:"import"})]}),c.a.createElement(li,{id:"targets-height"},c.a.createElement(vi,null,c.a.createElement(li,{id:"targets-width"},c.a.createElement("div",null,c.a.createElement(li,{id:"targets-properties",boundaryId:"targets-height",overrideWidth:"targets-width"},c.a.createElement(Za,{title:"Properties",startExpanded:!!P,actions:[c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create a target property for use in mapping"),key:"create-target-property",entryDelay:750,exitDelay:100},c.a.createElement(h.a,{onClick:function(){return m(i)},variant:"plain","aria-label":"Create a target property for use in mapping","data-testid":"create-target-property-button"},c.a.createElement(ve.a,null)))],noPadding:!!P},P?c.a.createElement(bo,{acceptDropType:t,draggableType:n,isSource:i,onEditProperty:v,onDeleteProperty:E,canDrop:b,onDrop:y,onShowMappingDetails:S,canAddFieldToSelectedMapping:F,onAddToSelectedMapping:T,canRemoveFromSelectedMapping:C,onRemoveFromSelectedMapping:M,canStartMapping:O,onStartMapping:D,fields:P.fields,showTypes:x,renderPreview:w}):"No target properties")),I.map((function(e){var i="targets-document-"+e.id;return c.a.createElement(li,{key:e.id,id:i,boundaryId:"targets-height",overrideWidth:"targets-width"},c.a.createElement(Za,{title:e.name,startExpanded:!0,footer:x?c.a.createElement(fr,null,"Target document type: ",e.type):void 0,actions:e.type===o.DocumentType.CSV?[d&&c.a.createElement(ao,{id:i,onClick:function(){return d(e.id)},key:"capture-tgt-csv-document-id"}),g&&c.a.createElement(lo,{id:i,onClick:function(){return g(e.id,!1)},key:"on-edit-tgt-csv-params"}),p&&c.a.createElement(oo,{id:i,onClick:function(){return p(e.id)},key:"delete-tgt-csv-document"})]:[d&&c.a.createElement(ao,{id:i,onClick:function(){return d(e.id)},key:"capture-tgt-document-id"}),f&&c.a.createElement(ro,{id:i,onClick:function(){return f(e.id,e.name)},key:"change-tgt-document-name"}),p&&c.a.createElement(oo,{id:i,onClick:function(){return p(e.id)},key:"delete-tgt-documents"})],noPadding:!0},c.a.createElement(Vr,null,c.a.createElement(vo,{fields:e.fields,showTypes:x,boundaryId:"targets-height",overrideWidth:"targets-width",parentId:i,idPrefix:"targets-field-",acceptDropType:t,draggableType:n,onDrop:y,canDrop:b,renderActions:function(e){return Eo({connectedMappings:e.mappings,onShowMappingDetails:S,canAddFieldToSelectedMapping:F(e),onAddToSelectedMapping:function(){return T(e)},canRemoveFromSelectedMapping:C(e),onRemoveFromSelectedMapping:function(){return M(e)},canStartMapping:O(e),onStartMapping:function(){return D(e)}})},renderPreview:w}))))})))))))},To="SourceTargetLinks-module_arc__2q0aJ",Co=function(e){var t=e.mappings,n=e.selectedMappingId,i=e.onSelectMapping,a=Object(s.useMemo)((function(){return t.sort((function(e){return e.id===n?1:-1}))}),[t,n]);return c.a.createElement("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none"}},a.map((function(e){return c.a.createElement(Mo,{mapping:e,onClick:function(){return i(e)},isSelected:e.id===n,key:e.id})})),c.a.createElement(pi,{start:"dnd-start",end:"dnd-target-field",color:"var(--pf-global--active-color--400)"}))},Mo=function(e){var t=e.mapping,n=e.isSelected,i=e.onClick,a=Jn(!1),r=a.state,o=a.toggleOn,l=a.toggleOff,s=function(e){i(),e.stopPropagation()},u=n?"var(--pf-global--active-color--100)":void 0,p=n?void 0:"var(--pf-global--active-color--400)",d=t.sourceFields.reduce((function(e,n){var i=t.targetFields.map((function(e){return c.a.createElement(pi,{key:""+n.id+e.id,start:"sources-field-"+n.id,end:"targets-field-"+e.id,color:r?p:u,onClick:s,onMouseEnter:o,onMouseLeave:l,className:To})}));return[].concat(e,i)}),[]);return c.a.createElement("g",{className:"group"},d)},Oo=function(e){var t=e.notifications,n=e.sources,i=e.targets,a=e.addableSources,r=e.addableTargets,o=e.showSourcesIndex,l=e.showTargetsIndex,s=e.onClose,u=e.mappingExpressionEnabled,p=e.onRemoveMapping,d=e.onRemoveMappedField,f=e.onIndexChange,m=e.onNewTransformation,g=e.onTransformationChange,v=e.onTransformationArgumentChange,h=e.onRemoveTransformation,E=e.onAddFieldToMapping,y=e.onNotificationRead,b=e.onEditEnum,S=e.isEnumMapping,F=e.onCreateConstant,T=e.onCreateProperty,C=e.canAddToSelectedMapping,M=e.multiplicity,O={"--pf-c-form--GridGap":"0",marginTop:"1.0rem"},A=M&&c.a.createElement(Tr,{name:M.name,disableTransformation:u,transformationsOptions:M.transformationsOptions,transformationsArguments:M.transformationsArguments,onTransformationChange:M.onChange,onTransformationArgumentChange:M.onArgumentChange}),D={id:"",name:"Padding field",value:"",type:"",scope:"current",path:"",mappings:[],hasTransformations:!1,isAttribute:!1,isCollection:!1,isConnected:!1,isInCollection:!1,isDisabled:!1,amField:{},enumeration:!1},N=function(e,t,n,i){return n?c.a.createElement(Pr,{key:n.id,field:n,name:n.name,info:n.scope?n.path+" <"+n.scope+"> ("+n.type+")":n.path+" ("+n.type+")",mappingExpressionEnabled:u,hasTransformations:n.transformations.length>0,onDelete:function(){return d(e,i)},onIndexChange:function(t){return f(e,i,"string"===typeof t?parseInt(t,10):t.amField)},onNewTransformation:function(){return m(e,i)},index:i+1,canShowIndex:t},c.a.createElement("div",{className:"pf-c-form",style:O},n.transformations.map((function(t,n){return c.a.createElement(Tr,{key:n,name:t.name,transformationsOptions:t.options,transformationsArguments:t.arguments,disableTransformation:u,onTransformationChange:function(t){return g(e,i,n,t)},onTransformationArgumentChange:function(t,a){return v(e,i,n,t,a)},onRemoveTransformation:function(){h(e,i,n)}})})))):c.a.createElement(Pr,{field:D,key:i,name:"Padding field",info:"This padding field has been automatically added",mappingExpressionEnabled:u,hasTransformations:!1,onDelete:function(){return d(e,i)},index:i+1,canShowIndex:o})},I=t.filter((function(e){return"danger"===e.variant})),x=t.filter((function(e){return"warning"===e.variant})),P=t.filter((function(e){return"warning"!==e.variant&&"danger"!==e.variant}));return c.a.createElement(io,{onClose:s,onDelete:p,onEditEnum:b,isEnumMapping:S},I.length>0&&c.a.createElement(Ao,{notifications:I,title:"Errors",onNotificationRead:y}),x.length>0&&c.a.createElement(Ao,{notifications:x,title:"Warnings",onNotificationRead:y}),P.length>0&&c.a.createElement(Ao,{notifications:P,title:"Messages",onNotificationRead:y}),c.a.createElement("div",{className:"pf-c-form",style:O},A,c.a.createElement(Rr,{isSource:!0,title:"Sources",onCreateConstant:F,onCreateProperty:T,canAddToSelectedMapping:C},n.map((function(e,t){return N(!0,o,e,t)})),i.length<=1&&c.a.createElement(Wi,{ariaLabelTypeAhead:"Select source to add to the mapping",placeholderText:"Select source to add to the mapping",isSource:!0,fields:a.map((function(e){return{label:e.amField.isPropertyOrConstant()?e.name:e.path,group:e.amField.docDef.name,onAdd:function(){return E(!0,e)}}})),"data-testid":"add-source-to-mapping"})),c.a.createElement(Rr,{isSource:!1,title:"Targets",onCreateConstant:F,onCreateProperty:T,canAddToSelectedMapping:C},i.map((function(e,t){return N(!1,l,e,t)})),n.length<=1&&c.a.createElement(Wi,{ariaLabelTypeAhead:"Select target to add to the mapping",placeholderText:"Select target to add to the mapping",isSource:!1,fields:r.map((function(e){return{label:e.amField.isProperty()?e.name:e.path,group:e.amField.docDef.name,onAdd:function(){return E(!1,e)}}})),"data-testid":"add-target-to-mapping"}))))},Ao=function(e){var t=e.title,n=e.notifications,i=e.onNotificationRead;return c.a.createElement(Za,{title:t,noShadows:!0,noPadding:!0,actions:[c.a.createElement(le.a,{key:1},n.length)]},c.a.createElement("div",{style:{maxHeight:200,overflow:"auto"}},n.map((function(e,t){return c.a.createElement(K.a,{key:t,variant:e.variant,title:e.description,isInline:!0,actionClose:c.a.createElement(Z.a,{title:e.title,variantLabel:e.variant+" alert",onClose:function(){return i(e.id)},"data-testid":"dismiss-mapping-notification-"+e.id})})}))))},Do="MappingTableView-module_title__1BqLH",No=[{heightAuto:!0,cells:[{props:{colSpan:8},title:c.a.createElement(se.a,null,c.a.createElement(G.a,{variant:G.b.small},c.a.createElement(H.a,{icon:Ue.a}),c.a.createElement(m.a,{headingLevel:"h2",size:"lg"},"No mappings found")))}]}],Io=function(e){var t=e.mappings,n=e.onSelectMapping,i=e.shouldShowMappingPreview,a=e.onFieldPreviewChange,r=0===t.length?No:t.map((function(e){var t=e.sourceFields.map((function(t,n){var r=t,o=r.name;return c.a.createElement("div",{key:n},o,i(e)&&c.a.createElement(cr,{id:r.id,value:r.value,onChange:function(e){return a(r,e)}}))})),n=e.targetFields.map((function(t,n){var a=t,r=a.name;return c.a.createElement("div",{key:n},r,i(e)&&c.a.createElement(pr,{id:a.id,value:a.value}))}));return{cells:[{title:t,data:e.id},{title:n},{title:e.name}]}}));return c.a.createElement(Zr,null,c.a.createElement(m.a,{size:"lg",headingLevel:"h1",className:Do},"Mappings"),c.a.createElement(st.a,{"aria-label":"Mappings",cells:["Sources","Targets","Types"],rows:r},c.a.createElement(ct.a,null),c.a.createElement(ut.a,{onRowClick:function(e,i){var a=t.find((function(e){var t;return(null===(t=i.cells)||void 0===t?void 0:t[0].data)===e.id}));a&&n(a)}})))},xo="NamespaceTableView-module_title__2TUGW",Po=function(e){var t=e.sources,n=e.onCreateNamespace,i=e.onEditNamespace,a=e.onDeleteNamespace,r=["Alias","URI","Location URI",{title:"Target Namespace",transforms:[pt.a],cellTransforms:[pt.a]}],o=t.reduce((function(e,t){if("XML"!==t.type)return e;var o=t.namespaces&&0!==t.namespaces.length?t.namespaces.map((function(e){return{cells:[{title:e.alias},{title:e.uri},{title:e.locationUri},{title:e.isTarget?"\u2713":""}]}})):[{cells:["<None>"]}],l=[{title:"Edit",onClick:function(e,n,a,r){var o,l,s,c;i(t.name,null===(o=a.cells)||void 0===o?void 0:o[0].title,null===(l=a.cells)||void 0===l?void 0:l[1].title,null===(s=a.cells)||void 0===s?void 0:s[2].title,(null===(c=a.cells)||void 0===c?void 0:c[3].title.length)>0)}},{title:"Remove",onClick:function(e,n,i,r){return a(t.name,i.alias.title)}}];return[].concat(e,[c.a.createElement(ce.a,{key:"level"},c.a.createElement(ue.a,{key:"title"},c.a.createElement(m.a,{size:"lg",headingLevel:"h1",className:xo},"Namespaces for ",t.name)),c.a.createElement(ue.a,{key:"actions"},c.a.createElement(yi,null,c.a.createElement(A.a,{position:"top",enableFlip:!0,content:c.a.createElement("div",null,"Create a namespace"),key:"create-namespace"},c.a.createElement(h.a,{onClick:function(){return n(t.name)},variant:"plain","aria-label":"Create a namespace","data-testid":"create-namespace-button"},c.a.createElement(ve.a,null)))))),c.a.createElement(st.a,{key:"table","aria-label":"Namespaces",cells:r,rows:o,actions:t.namespaces&&t.namespaces.length>0?l:void 0},c.a.createElement(ct.a,null),c.a.createElement(ut.a,null))])}),[]);return 0===o.length?c.a.createElement(se.a,null,c.a.createElement(G.a,{variant:G.b.small},c.a.createElement(H.a,{icon:Ue.a}),c.a.createElement(m.a,{headingLevel:"h2",size:"lg"},"No XML sources found"))):c.a.createElement(Zr,null,o)},wo=function(e){var t=e.sourceProperties,n=e.targetProperties,i=e.constants,a=e.sources,r=e.mappings,o=e.targets,l=e.showMappingPreview,s=e.showTypes,u=e.selectedMappingId,p=e.onSelectMapping,d=e.sourceEvents,f=e.targetEvents;return c.a.createElement(c.a.Fragment,null,c.a.createElement(ri,null,c.a.createElement(Oi,{role:"main"},c.a.createElement(Di,null,c.a.createElement(mi,{"data-testid":"column-source-area",totalColumns:2},c.a.createElement(So,Object.assign({sourceProperties:t,constants:i,sources:a,showTypes:s},d))),c.a.createElement(mi,{"data-testid":"column-target-area",totalColumns:2},c.a.createElement(Fo,Object.assign({targetProperties:n,showMappingPreview:l,showTypes:s,targets:o},f))))),c.a.createElement(Co,{mappings:r,selectedMappingId:u,onSelectMapping:p})))},Ro="toolbarItems-module_toggled__HUrZH",_o=function(e){var t=e.showImportAtlasFileToolbarItem,n=e.showImportAtlasFileFromEntaxyRegistryToolbarItem,i=e.showExportAtlasFileToolbarItem,a=e.showSaveAtlasFileIntoEntaxyRegistryToolbarItem,r=e.disableSaveAtlasFileIntoEntaxyRegistryToolbarItem,o=e.showExportAtlasFileIntoEntaxyRegistryToolbarItem,l=e.showResetToolbarItem,s=e.onImportAtlasFile,u=e.onImportAtlasFileFromEntaxyRegistry,p=e.onExportAtlasFile,d=e.onSaveAtlasFileIntoEntaxyRegistry,f=e.onExportAtlasFileIntoEntaxyRegistry,m=e.onResetAtlasmap,g=Jn(!1),v=g.state,h=g.toggle,E=g.toggleOff,y=function(e){return function(){e.apply(void 0,arguments),E()}},b=[t&&c.a.createElement(jo,{onFile:y(s),key:"import-catalog"}),n&&c.a.createElement(ko,{onRegistryLocation:y(u),key:"import-catalog"}),(t||n)&&c.a.createElement(B.a,{key:"import-separator"}),i&&c.a.createElement(Lo,{onClick:y(p),key:"export-catalog"}),a&&c.a.createElement(Uo,{onClick:y(d),disabled:r,key:"export-catalog"}),o&&c.a.createElement(Vo,{onRegistryLocation:y(f),key:"export-catalog"}),(i||o)&&c.a.createElement(B.a,{key:"export-separator"}),l&&c.a.createElement(zo,{onClick:y(m),key:"reset-catalog"})].filter((function(e){return e}));return c.a.createElement(N.a,null,c.a.createElement(F.a,{toggle:c.a.createElement(V.a,{id:"atlasmap-toggle",onToggle:h,toggleIndicator:Te.a,"data-testid":"atlasmap-menu-button"},"Entaxy Transformation"),isOpen:v,dropdownItems:b,isPlain:!0}))},jo=function(e){var t=e.onFile,n=Object(lt.useFilePicker)({maxFileSize:1}),i=n.files,a=n.onClick,r=n.HiddenFileInput,o=Object(s.useRef)(null);return Object(s.useEffect)((function(){o.current!==i&&(o.current=i,1===(null===i||void 0===i?void 0:i.length)&&(o.current=null,t(i[0])))}),[i,t]),c.a.createElement(z.a,{icon:c.a.createElement(Ie.a,null),onClick:a,"data-testid":"import-mappings-button"},"Import (.adm)",c.a.createElement(r,{accept:".adm",multiple:!1}))},ko=function(e){var t=e.onRegistryLocation;function n(e){e.origin===window.origin&&e.data&&"importMapping"===e.data.type&&e.data.content&&t(e.data.content)}return Object(s.useEffect)((function(){return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}})),c.a.createElement(z.a,{icon:c.a.createElement(Ie.a,null),onClick:function(){window.top.postMessage("openRegistryViewerForImport",window.top.origin)}},"Open")},Lo=function(e){var t=e.onClick;return c.a.createElement(z.a,{icon:c.a.createElement(Ve.a,null),onClick:t,"data-testid":"export-mappings-button"},"Download")},Uo=function(e){var t=e.onClick,n=e.disabled;return c.a.createElement(z.a,{icon:c.a.createElement(Ve.a,null),onClick:t,isDisabled:n,"data-testid":"export-mappings-button"},"Save")},Vo=function(e){var t=e.onRegistryLocation;function n(e){e.origin===window.origin&&e.data&&"exportMapping"===e.data.type&&e.data.content&&t(e.data.content)}return Object(s.useEffect)((function(){return window.addEventListener("message",n),function(){window.removeEventListener("message",n)}})),c.a.createElement(z.a,{icon:c.a.createElement(Ve.a,null),onClick:function(){window.top.postMessage("openRegistryViewerForExport",window.top.origin)},"data-testid":"export-mappings-button"},"Save as")},zo=function(e){var t=e.onClick;return c.a.createElement(z.a,{icon:c.a.createElement(ge.a,null),onClick:t,"data-testid":"reset-all-button"},"Reset all")},Bo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show column mapper")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show column mapper",onClick:a,isDisabled:i,className:Object(d.a)(t&&Ro),"data-testid":"show-column-mapper-button"},c.a.createElement(ze.a,null))))},Jo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show mapping table")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide mapping table",onClick:a,isDisabled:i,className:Object(d.a)(t&&Ro),"data-testid":"show-hide-mapping-table-button"},c.a.createElement(Ue.a,null))))},Go=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show namespace table")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide namespace table",onClick:a,isDisabled:i,className:Object(d.a)(t&&Ro),"data-testid":"show-hide-namespace-table-button"},c.a.createElement(Be.a,null))))},Ho=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show/hide mapping preview")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide mapping preview",onClick:a,isDisabled:i,className:Object(d.a)(t&&Ro),"data-testid":"show-hide-mapping-preview-button"},c.a.createElement(Je.a,null))))},qo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show/hide types")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide types",onClick:a,isDisabled:i,className:Object(d.a)(t&&Ro),"data-testid":"show-hide-types-button"},c.a.createElement(Ge.a,null))))},Yo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show/hide mapped fields")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide mapped fields",onClick:a,isDisabled:i,className:Object(d.a)(t&&Ro),"data-testid":"show-hide-mapped-fields-button"},c.a.createElement(He.a,null))))},Xo=function(e){var t=e.toggled,n=e.disabled,i=void 0!==n&&n,a=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Show/hide unmapped fields")},c.a.createElement(h.a,{variant:"plain","aria-label":"Show/hide unmapped fields",onClick:a,isDisabled:i,className:Object(d.a)(t&&Ro),"data-testid":"show-hide-unmapped-fields-button"},c.a.createElement(qe.a,null))))},Wo=function(e){var t=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"Add a new mapping")},c.a.createElement(h.a,{variant:"plain","aria-label":"Add a new mapping",onClick:t,"data-testid":"add-new-mapping-button"},c.a.createElement(ve.a,null))))},Ko=function(e){var t=e.onClick;return c.a.createElement(N.a,null,c.a.createElement(A.a,{position:"auto",enableFlip:!0,content:c.a.createElement("div",null,"About AtlasMap")},c.a.createElement(h.a,{variant:"plain","aria-label":"About AtlasMap",onClick:t,"data-testid":"about-button"},c.a.createElement(Ye.a,null))))};function Zo(){return{pending:!1,error:!1,sourceProperties:null,targetProperties:null,constants:null,sources:[],targets:[],mappings:[],selectedMapping:null,flatSources:[],flatTargets:[]}}function $o(e,t){switch(t.type){case"reset":return{pending:!1,error:!1,sourceProperties:null,targetProperties:null,constants:null,sources:[],targets:[],mappings:[],selectedMapping:null,flatSources:[],flatTargets:[]};case"loading":return ft({},e,{pending:!0,error:!1});case"update":return ft({},e,t.payload);case"error":return ft({},{pending:!1,error:!1,sourceProperties:null,targetProperties:null,constants:null,sources:[],targets:[],mappings:[],selectedMapping:null,flatSources:[],flatTargets:[]});default:return e}}function Qo(){return{notifications:[]}}function el(e,t){switch(t.type){case"reset":return{notifications:[]};case"update":return{notifications:t.payload.notifications.map((function(t){var n;return ft({},t,{isRead:null===(n=e.notifications.find((function(e){return e.id===t.id})))||void 0===n?void 0:n.isRead})}))};case"dismiss":return{notifications:e.notifications.map((function(e){return e.id===t.payload.id?ft({},e,{isRead:!0}):e}))};default:return e}}var tl=Object(s.createContext)(null),nl=function(e){var t=e.baseJavaInspectionServiceUrl,n=e.baseXMLInspectionServiceUrl,i=e.baseJSONInspectionServiceUrl,a=e.baseCSVInspectionServiceUrl,r=e.baseMappingServiceUrl,l=e.externalDocument,u=e.onMappingChange,p=e.logLevel,d=e.children,f=Object(s.useReducer)($o,{},Zo),m=f[0],g=f[1],v=Object(s.useReducer)(el,{},Qo),h=v[0],E=v[1],y=function(){g({type:"reset"}),E({type:"reset"})},b=function(){g({type:"loading"})};Object(s.useEffect)((function(){var e;y(),_t.resetConfig();var s=_t.cfg;if(null===(e=s.logger)||void 0===e||e.setLevel(p),s.initCfg.dataMapperVersion="2.5.2",s.initCfg.baseMappingServiceUrl=r,s.initCfg.baseJavaInspectionServiceUrl=t,s.initCfg.baseXMLInspectionServiceUrl=n,s.initCfg.baseJSONInspectionServiceUrl=i,s.initCfg.baseCSVInspectionServiceUrl=a,l){l.inputDocuments.forEach((function(e){var t=new o.DocumentInitializationModel;t.type=e.documentType,t.inspectionType=e.inspectionType,t.inspectionSource=e.inspectionSource,t.inspectionParameters=e.inspectionParameters,t.inspectionResult=e.inspectionResult,t.id=e.id,t.name=e.name,t.description=e.description,t.isSource=!0,t.showFields=e.showFields,s.addDocument(t)}));var c=new o.DocumentInitializationModel;c.type=l.outputDocument.documentType,c.inspectionType=l.outputDocument.inspectionType,c.inspectionSource=l.outputDocument.inspectionSource,c.inspectionParameters=l.outputDocument.inspectionParameters,c.inspectionResult=l.outputDocument.inspectionResult,c.id=l.outputDocument.id,c.name=l.outputDocument.name,c.description=l.outputDocument.description,c.isSource=!1,c.showFields=l.outputDocument.showFields,s.addDocument(c),l.initialMappings&&(s.preloadedMappingJson=l.initialMappings)}var u=new URLSearchParams(window.top.location.search).get("location");u?_t.initializeWithADMArchiveFileFromEntaxyRegistry(u):_t.resetAtlasMap(),b()}),[a,i,t,r,n,l,p]);var S=_t.cfg,F=Object(s.useCallback)((function(){return S.sourceDocs.map(Vt).filter((function(e){return e}))}),[S]),T=Object(s.useCallback)((function(){return Vt(S.constantDoc)}),[S]),C=Object(s.useCallback)((function(){return Vt(S.sourcePropertyDoc)}),[S]),M=Object(s.useCallback)((function(){return Vt(S.targetPropertyDoc)}),[S]),O=Object(s.useCallback)((function(){return S.targetDocs.map(Vt).filter((function(e){return e}))}),[S]),A=Object(s.useCallback)((function(){return(e=S.mappings)?e.mappings.map(qt).filter((function(e){return e})):[];var e}),[S]),D=Object(s.useCallback)((function(){var e;return qt(null===(e=S.mappings)||void 0===e?void 0:e.activeMapping)}),[S]),N=Object(s.useCallback)((function(){return S.sourceDocs.flatMap((function(e){return e.getAllFields().flatMap((function(e){var t=kt(e);return t?[t]:[]}))}))}),[S]),I=Object(s.useCallback)((function(){return S.targetDocs.flatMap((function(e){return e.getAllFields().flatMap((function(e){var t=kt(e);return t?[t]:[]}))}))}),[S]),x=Object(s.useCallback)((function(e){var t;t={pending:!S.initCfg.initialized,error:S.initCfg.initializationErrorOccurred,sources:F(),constants:T(),sourceProperties:C(),targets:O(),targetProperties:M(),mappings:A(),selectedMapping:D(),flatSources:N(),flatTargets:I()},g({type:"update",payload:t}),E({type:"update",payload:{notifications:S.errorService.getErrors().reverse().filter((function(e){return"DEBUG"!==e.level})).map(Ht)}})}),[S,T,A,D,F,C,N,O,M,I]);return Object(s.useEffect)((function(){var e=m.pending?1e3:50,t=_t.systemInitializedSource.pipe(Object(dt.a)(e)),n=S.mappingService.lineRefreshSource.pipe(Object(dt.a)(e)),i=S.mappingService.mappingUpdatedSource.pipe(Object(dt.a)(e)),a=S.previewService.mappingPreviewOutput$.pipe(Object(dt.a)(e)),r=[t.subscribe((function(){return x("initializationObservable")})),i.subscribe((function(){return x("mappingUpdatedSource")})),a.subscribe((function(){return x("mappingPreviewOutput$")})),n.subscribe((function(){return x("lineRefreshObservable")})),S.errorService.subscribe((function(){return x("errorService")}))];return function(){r.forEach((function(e){return e.unsubscribe()}))}}),[t,n,i,a,r,S,m.pending,m.selectedMapping,x]),Object(s.useEffect)((function(){u&&S.mappingService.mappingUpdatedSource.subscribe((function(){S.initCfg.initialized&&u(JSON.stringify(o.MappingSerializer.serializeMappings(S)))}))}),[S,u]),c.a.createElement(tl.Provider,{value:ft({},m,h,{onLoading:b,onReset:y,markNotificationRead:function(e){return E({type:"dismiss",payload:{id:e}})}})},d)};function il(){var e,t,n,i,a,r=Object(s.useContext)(tl);if(!r)throw new Error("useAtlasmap must be used inside an AtlasmapProvider component");var l=_t.cfg,c=r.onReset,u=vt(r,["onLoading","onReset"]),p=Object(s.useCallback)((function(e){return l.documentService.filterDocumentFields(e,!0)}),[l]),d=Object(s.useCallback)((function(e){return l.documentService.filterDocumentFields(e,!1)}),[l]),f=Object(s.useCallback)((function(e){var t;t=e,l.initializationService.initializeWithADMArchiveFile(t)}),[l]),m=Object(s.useCallback)((function(e){!function(e,t){t.initializationService.initializeWithADMArchiveFileFromEntaxyRegistry(e)}(e,l)}),[l]),g=Object(s.useCallback)((function(){c(),o.ConfigModel.getConfig().initializationService.resetAtlasMap()}),[c]),v=Object(s.useCallback)((function(e){On(e.amField)}),[]),h=Object(s.useCallback)((function(e){An(e.amField)}),[]),E=Object(s.useCallback)((function(e,t){Tn(null===e||void 0===e?void 0:e.amField,null===t||void 0===t?void 0:t.amField)}),[]),y=0===(null===(e=l.mappings)||void 0===e||null===(t=e.activeMapping)||void 0===t||null===(n=t.transition)||void 0===n||null===(i=n.expression)||void 0===i?void 0:i.nodes.length),b=Object(s.useCallback)((function(){return l.expressionService.willClearOutSourceFieldsOnTogglingExpression()}),[l]),S=Object(s.useCallback)((function(e){return l.mappingService.canAddToActiveMapping(e)}),[l]),F=Object(s.useCallback)((function(e,t){return l.mappingService.isFieldAddableToActiveMapping(t.amField)}),[l]),T=Object(s.useCallback)((function(e,t){return l.mappingService.isFieldDragAndDropAllowed(e.amField,t.amField)}),[l]),C=Object(s.useCallback)((function(e,t){return!!r.selectedMapping&&!!r.selectedMapping["source"===e?"sourceFields":"targetFields"].find((function(e){return e.id===t.id}))}),[r.selectedMapping]);return ft({},u,{selectMapping:mn,deselectMapping:gn,deleteAtlasFile:wn,exportADMArchiveFile:_n,saveADMArchiveFileIntoEntaxyRegistry:jn,exportADMArchiveFileIntoEntaxyRegistry:kn,importADMArchiveFile:f,importADMArchiveFileFromEntaxyRegistry:m,resetAtlasmap:g,getUIVersion:Un,getRuntimeVersion:Ln,mappingExpressionClearText:Kt,isMappingExpressionEmpty:y,executeFieldSearch:Yt,getFieldEnums:In,setSelectedEnumValue:xn,mappingExpressionAddField:Xt,mappingExpressionInit:Wt,mappingExpressionInsertText:Zt,mappingExpressionObservable:$t,mappingExpressionRemoveField:Qt,mappingHasSourceCollection:b,mappingExpressionEnabled:l.expressionService.isExpressionEnabledForActiveMapping(),currentMappingExpression:l.expressionService.getMappingExpressionStr(!0,null===(a=l.mappings)||void 0===a?void 0:a.activeMapping),getMappingExpression:wt,toggleExpressionMode:tn,toggleMappingPreview:Vn,toggleShowMappedFields:zn,toggleShowUnmappedFields:Bn,onFieldPreviewChange:en,addToCurrentMapping:On,removeFromCurrentMapping:An,removeMappedFieldFromCurrentMapping:Dn,fromMappedFieldToIMappingField:zt,createMapping:Tn,newMapping:Cn,removeMapping:Mn,documentExists:Rn,getMappingActions:nn,getMultiplicityActions:an,getMultiplicityActionDelimiters:rn,handleActionChange:on,handleIndexChange:ln,handleNewTransformation:sn,handleRemoveTransformation:pn,handleTransformationChange:cn,handleTransformationArgumentChange:un,handleMultiplicityChange:dn,handleMultiplicityArgumentChange:fn,createConstant:vn,deleteConstant:hn,editConstant:En,createProperty:yn,deleteProperty:bn,editProperty:Sn,trailerId:"expression-trailer",canAddToSelectedMapping:S,isFieldAddableToSelection:F,isFieldDragAndDropAllowed:T,isFieldRemovableFromSelection:C,searchSources:p,searchTargets:d,importInstanceSchema:St,importInstanceSchemaFromEntaxyRegistry:bt,createInstanceSchema:yt,enableCustomClass:Nt,createNamespace:Tt,editNamespace:Ct,deleteNamespace:Mt,onAddToMapping:v,onRemoveFromMapping:h,onCreateMapping:E,changeDocumentName:Ft,getEnumerationValues:Nn,isEnumerationMapping:Pn,configModel:l})}function al(e,t){var n=Jn(!1),i=n.state,a=n.toggleOn,r=n.toggleOff,o=Object(s.useRef)(null);return[c.a.createElement(Ca,{key:"confirmation-dialog-"+e,title:e,onCancel:r,onConfirm:function(){o.current&&o.current(),r()},isOpen:i},c.a.createElement(pe.a,null,t)),function(e){o.current=e,a()}]}function rl(e){var t=Object(s.useState)(null),n=t[0],i=t[1],a=Object(s.useState)({name:"",value:"",valueType:o.constantTypes[0][0]}),r=a[0],l=a[1],u=Object(s.useState)(null),p=u[0],d=u[1],f=Jn(!1),m=f.state,g=f.toggleOn,v=f.toggleOff,h=Object(s.useCallback)((function(e){n&&((null===r||void 0===r?void 0:r.name)!==e.name?n(e,null===r||void 0===r?void 0:r.name):n(e),v())}),[r,n,v]);return[c.a.createElement(Ma,Object.assign({title:e,isOpen:m,valueTypeOptions:o.constantTypes.map((function(e){return{value:e[0],label:e[1]}})),onCancel:v,onConfirm:h,onValidation:function(e){var t=!1;return p&&(t=p.fields.filter((function(t){return t.name===e})).length>0),e===(null===r||void 0===r?void 0:r.name)||!t}},r||{})),Object(s.useCallback)((function(e,t,n){i((function(){return e})),n&&l(n),t&&d(t),g()}),[g])]}function ol(e){var t=Object(s.useState)(null),n=t[0],i=t[1],a=Object(s.useState)(null),r=a[0],l=a[1],u=Object(s.useState)([]),p=u[0],d=u[1],f=Jn(!1),m=f.state,g=f.toggleOn,v=f.toggleOff,h=Object(s.useCallback)((function(e){n&&(n(e),v())}),[n,v]),E=function(){try{return Promise.resolve(function(){try{return Promise.resolve(new Promise((function(e,t){try{return o.ConfigModel.getConfig().documentService.getLibraryClassNames().then((function(t){e(t)})).catch((function(){t()})),Promise.resolve()}catch(n){return Promise.reject(n)}})))}catch(e){return Promise.reject(e)}}()).then((function(e){d(e)}))}catch(e){return Promise.reject(e)}};return[c.a.createElement(Oa,Object.assign({title:e,isOpen:m,customClassName:p?p[0]:"",customClassNames:p,collectionTypeOptions:o.collectionTypes.map((function(e){return{value:e[0],label:e[1]}})),onCancel:v,onConfirm:h},r||{collectionType:"NONE"})),Object(s.useCallback)((function(e,t){i((function(){return e})),t&&l(t),E(),g()}),[g])]}var ll="";function sl(){var e=function(){var e=Jn(!1),t=e.state,n=e.toggleOn,i=e.toggleOff,a=Object(s.useRef)(null),r=function(){i()},o="Document ID "+ll+" copied to clipboard.",l=c.a.createElement(_r,{variant:"info",title:"Capture Document ID",key:ll,onClose:r,onTimeout:r},o);return t?a.current&&a.current():l=c.a.createElement("span",null),[l,function(e){a.current=e,n()}]}(),t=e[0],n=e[1];return[t,Object(s.useCallback)((function(e){ll=e,n((function(){return function(e){var t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select();try{document.execCommand("copy")}catch(n){o.ConfigModel.getConfig().errorService.addError(new o.ErrorInfo({message:"Error copying "+e+" to clipboard",level:o.ErrorLevel.ERROR,scope:o.ErrorScope.APPLICATION,type:o.ErrorType.INTERNAL}))}document.body.removeChild(t)}(e)}))}),[n])]}function cl(e){var t=Object(s.useState)(null),n=t[0],i=t[1],a=Object(s.useState)([]),r=a[0],o=a[1],l=Jn(!1),u=l.state,p=l.toggleOn,d=l.toggleOff,f=Object(s.useCallback)((function(){o([])}),[]),m=Object(s.useCallback)((function(e){n&&(n(e),d())}),[n,d]),g=c.a.createElement(_a,{title:e,isOpen:u,onCancel:d,onConfirm:m,parameters:r,initialParameters:r.filter((function(e){return e.required||e.enabled}))}),v=Object(s.useCallback)((function(e,t){i((function(){return e})),t&&o(t),p()}),[p]);return Object(s.useEffect)(f,[f]),[g,v]}function ul(e){var t=Jn(!1),n=Jn(e),i=Object(s.useRef)(null),a=function(){i.current&&i.current(n.state),t.toggleOff()};return[c.a.createElement(I.a,{key:"specify-instance-schema-dialog",variant:"small",title:"Specify Instance/ Schema",description:"Distinguish between instance and schema imported file formats.",isOpen:t.state,onClose:t.toggleOff,actions:[c.a.createElement(h.a,{key:"confirm",variant:"primary",onClick:a,"aria-label":"Ok","data-testid":"specify-instance-schema-dialog-ok-button-test",isDisabled:!a,style:{display:"flex",marginLeft:"auto"}},"OK")]},c.a.createElement(c.a.Fragment,null,c.a.createElement(de.a,{isChecked:!n.state,name:"instance",onChange:function(){n.toggleOff()},label:"Instance",id:"instance-radio","data-testid":"instance-radio-button-test"}),c.a.createElement(de.a,{isChecked:n.state,name:"schema",onChange:function(){n.toggleOn()},label:"Schema",id:"schema-radio","data-testid":"schema-radio-button-test"}))),function(a){i.current=a,e?n.toggleOn():n.toggleOff(),t.toggleOn()}]}function pl(e){var t=Object(s.useState)(null),n=t[0],i=t[1],a=Object(s.useState)(null),r=a[0],o=a[1],l=Jn(!1),u=l.state,p=l.toggleOn,d=l.toggleOff,f=Object(s.useCallback)((function(e){n&&(n(e),d())}),[n,d]);return[c.a.createElement(wa,Object.assign({title:e,isOpen:u,onCancel:d,onConfirm:f},r||{})),Object(s.useCallback)((function(e,t){i((function(){return e})),t&&o(t),p()}),[p])]}function dl(e,t){var n=Object(s.useState)(null),i=n[0],a=n[1],r=Object(s.useState)({name:"",valueType:o.propertyTypes[0][0],scope:t[0].value}),l=r[0],u=r[1],p=Object(s.useState)(null),d=p[0],f=p[1],m=Jn(!1),g=m.state,v=m.toggleOn,h=m.toggleOff,E=Object(s.useCallback)((function(e){i&&(i(e),h())}),[i,h]);return[c.a.createElement(Ra,Object.assign({title:e,valueTypeOptions:o.propertyTypes.map((function(e){return{value:e[0],label:e[1]}})),scopeOptions:t,isOpen:g,onCancel:h,onConfirm:E,onValidation:function(e,t){var n=!1;return d&&(n=d.fields.filter((function(n){return n.name===e&&n.amField.scope===t})).length>0),e===(null===l||void 0===l?void 0:l.name)&&t===l.scope||!n}},l||{})),Object(s.useCallback)((function(e,t,n){a((function(){return e})),n&&u(n),f(t),v()}),[v])]}function fl(){var e=Jn(!1),t=e.state,n=e.toggleOn,i=e.toggleOff,a=Object(s.useState)([]),r=a[0],l=a[1],u=Object(s.useCallback)((function(){!function(e){var t,n=o.ConfigModel.getConfig(),i=null===(t=n.mappings)||void 0===t?void 0:t.activeMapping;i&&_t.cfg.mappingService.updateEnumerationValues(n,i,e)}(r),i()}),[r,i]);return[c.a.createElement(Ca,{title:"Map Enumeration Values",description:"Map enumeration source values to target values.",onCancel:i,onConfirm:u,isOpen:t},t&&r&&r.map((function(e,n){return c.a.createElement("div",{key:n},c.a.createElement(Pa,{enumerationValue:e,sourceKey:n,isOpen:t}))}))),Object(s.useCallback)((function(){l(Nn()),n()}),[n])]}function ml(e){var t=e.modalContainer,n=il(),i=n.configModel,a=n.selectedMapping,r=n.createConstant,l=n.editConstant,u=n.createProperty,p=n.editProperty,d=n.createNamespace,f=n.editNamespace,m=n.deleteNamespace,g=n.changeDocumentName,v=rl("Create Constant"),h=v[0],E=v[1],y=Object(s.useCallback)((function(e,t){E((function(e){var n=e.name,i=e.value,a=e.valueType;r(n,i,a,t)}),e)}),[r,E]),b=rl("Edit Constant"),S=b[0],F=b[1],T=Object(s.useCallback)((function(e,t){F((function(e,t){var n=e.name,i=e.value,a=e.valueType;l(n,i,a,t)}),t,e)}),[l,F]),C=function(){var e=il().deleteConstant,t=al("Delete constant?","Are you sure you want to delete the selected constant and remove any associated mapping references?"),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(t){return i((function(){return e(t)}))}),[e,i])]}(),M=C[0],O=C[1],A=Object(s.useState)(It(!0)),D=A[0],N=A[1],I=dl("Create Property",D),x=I[0],P=I[1],w=Object(s.useCallback)((function(e,t,n){N(It(e)),P((function(t){var i=t.name,a=t.valueType,r=t.scope;u(i,a,r,e,n)}),t)}),[u,P]),R=dl("Edit Property",D),_=R[0],j=R[1],k=Object(s.useCallback)((function(e,t,n){N(It(t)),j((function(n){var i=n.name,a=n.valueType,r=n.scope;p(e.name,a,e.scope,t,i,r)}),n,e)}),[p,j]),L=function(){var e=il().deleteProperty,t=al("Delete property?","Are you sure you want to delete the selected property and remove any associated mapping references?"),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(t,n,a){return i((function(){return e(t,n,a)}))}),[e,i])]}(),U=L[0],V=L[1],z=function(){var e=il().importADMArchiveFile,t=al("Import ADM archive file?","Importing a new ADM archive file will discard all unsaved changes. To save the current mappings, use the Export feature."),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(t){return i((function(){return e(t)}))}),[e,i])]}(),B=z[0],J=z[1],G=function(){var e=il().importADMArchiveFileFromEntaxyRegistry,t=al("Import ADM archive file?","Importing a new ADM archive file will discard all unsaved changes. To save the current mappings, use the Export feature."),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(t){return i((function(){return e(t)}))}),[e,i])]}(),H=G[0],q=G[1],Y=function(){var e=Jn(!1),t=e.state,n=e.toggleOn,i=e.toggleOff,a=il().exportADMArchiveFile,r=Object(s.useCallback)((function(e){a(e),i()}),[a,i]);return[c.a.createElement(Da,{isOpen:t,onCancel:i,onConfirm:r}),n]}(),X=Y[0],W=Y[1],K=Jn(!1).toggleOff,Z=il().exportADMArchiveFileIntoEntaxyRegistry,$=Object(s.useCallback)((function(e){Z(e),K()}),[Z,K]),Q=function(){var e=il().resetAtlasmap,t=al("Reset All Mappings and Imports?","Are you sure you want to reset all mappings and clear all imported documents?"),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(){return i(e)}),[i,e])]}(),ee=Q[0],te=Q[1],ne=function(){var e=il(),t=e.getRuntimeVersion,n=e.getUIVersion,i=Object(s.useState)("0.0"),a=i[0],r=i[1],o=Jn(!1),l=o.state,u=o.toggleOn,p=o.toggleOff;return[c.a.createElement(Ta,{title:"AtlasMap Data Mapper",isOpen:l,onClose:p,uiVersion:n(),runtimeVersion:a}),Object(s.useCallback)((function(){t().then((function(e){r(e),u()})).catch((function(e){r(e),u()}))}),[u,t])]}(),ie=ne[0],ae=ne[1],re=function(){var e=il(),t=e.mappingHasSourceCollection,n=e.toggleExpressionMode,i=al("Disable Expression?","If you disable an expression with a source collection, all source fields will be removed from the mapping.  Proceed with expression disable?"),a=i[0],r=i[1];return[a,Object(s.useCallback)((function(){t()?r(n):n()}),[t,r,n])]}(),oe=re[0],le=re[1],se=function(){var e=il(),t=e.configModel,n=e.documentExists,i=e.importInstanceSchema,a=e.importInstanceSchemaFromEntaxyRegistry,r=e.createInstanceSchema,l=al("Confirm document import","A document with the selected name has already been imported into the specified panel. It will appear in addition to the pre-existing document."),u=l[0],p=l[1],d=cl("Select CSV Processing Parameters"),f=d[0],m=d[1],g=Object(s.useState)(!1),v=g[0],h=g[1],E=ul(v),y=E[0],b=E[1],S=Object(s.useCallback)((function(e,n){if(e.name){var a=e.name.split("."),r=a[a.length-1].toUpperCase();if("CSV"===r)return void m((function(a){for(var r,o={},l=Et(a);!(r=l()).done;){var s=r.value;o[s.name]=s.value}i(e,t,n,!1,o)}),Object(o.getCsvParameterOptions)());h("XSD"===r),b((function(a){i(e,t,n,a)}))}}),[t,i,m,b]),F=Object(s.useCallback)((function(e,n){var i=e.split("/").pop();if(i){var r=i.split("."),l=r[r.length-1].toUpperCase();if("CSV"===l)return void m((function(i){for(var r,o={},l=Et(i);!(r=l()).done;){var s=r.value;o[s.name]=s.value}a(e,t,n,!1,o)}),Object(o.getCsvParameterOptions)());h("XSD"===l),b((function(i){a(e,t,n,i)}))}}),[t,a,m,b]),T=Object(s.useCallback)((function(e,t){n(e.name,t)?p((function(){return S(e,t)})):S(e,t)}),[n,S,p]),C=Object(s.useCallback)((function(e,t){var i=e.split("/").pop();i&&n(i,t)?p((function(){return F(e,t)})):F(e,t)}),[n,F,p]),M=Object(s.useCallback)((function(e,n){"CSV"!==e.type?(h("XSD"===e.type),b((function(i){r(e,t,n,i)}))):m((function(i){for(var a,o={},l=Et(i);!(a=l()).done;){var s=a.value;o[s.name]=s.value}r(e,t,n,!1,o)}),Object(o.getCsvParameterOptions)())}),[t,r,b]),O=Object(s.useCallback)((function(e,t){e.name&&n(e.name,t)?p((function(){return M(e,t)})):M(e,t)}),[M]);return[c.a.createElement(c.a.Fragment,null,u,f,y),T,C,O]}(),ce=se[0],ue=se[1],pe=se[2],de=se[3],fe=function(){var e=il().deleteAtlasFile,t=al("Delete selected document?","Are you sure you want to delete the selected document and remove any associated mappings?"),n=t[0],i=t[1];return[n,Object(s.useCallback)((function(t,n){return i((function(){return e(t,n)}))}),[e,i])]}(),me=fe[0],ge=fe[1],ve=sl(),he=ve[0],Ee=ve[1],ye=function(){var e=Object(s.useState)(null),t=e[0],n=e[1],i=Object(s.useState)({id:"",name:"",isSource:!1}),a=i[0],r=i[1],o=Jn(!1),l=o.state,u=o.toggleOn,p=o.toggleOff,d=Object(s.useCallback)((function(e){t&&(t(e),p())}),[t,p]);return[c.a.createElement(Aa,Object.assign({isOpen:l,onCancel:p,onConfirm:d},a||{})),Object(s.useCallback)((function(e,t){n((function(){return e})),r(t),u()}),[u])]}(),be=ye[0],Se=ye[1],Fe=Object(s.useCallback)((function(e){Se((function(e){var t=e.id,n=e.name,i=e.isSource;g(t,n,i)}),e)}),[g,Se]),Te=pl("Create namespace"),Ce=Te[0],Me=Te[1],Oe=Object(s.useCallback)((function(e){Me((function(t){var n=t.alias,i=t.uri,a=t.locationUri,r=t.targetNamespace;return d(e,n,i,a,r)}))}),[d,Me]),Ae=pl("Edit namespace"),De=Ae[0],Ne=Ae[1],Ie=Object(s.useCallback)((function(e,t){Ne((function(n){var i=n.alias,a=n.uri,r=n.locationUri,o=n.targetNamespace;return f(e,t.alias,i,a,r,o)}),t)}),[f,Ne]),xe=function(){var e=al("Remove field?","Are you sure you want to remove this field?"),t=e[0],n=e[1];return[t,Object(s.useCallback)((function(e){return n(e)}),[n])]}(),Pe=xe[0],we=xe[1],Re=function(){var e=il(),t=e.removeMapping,n=e.deselectMapping,i=al("Remove Mapping?","Are you sure you want to remove the current mapping?"),a=i[0],r=i[1];return[a,Object(s.useCallback)((function(e){r((function(){t(e.mapping),n()}))}),[n,r,t])]}(),_e=Re[0],je=Re[1],ke=Object(s.useCallback)((function(){a&&je(a)}),[je,a]),Le=fl(),Ue=Le[0],Ve=Le[1],ze=ol("Load Java Document From Custom Class"),Be=ze[0],Je=ze[1],Ge=Object(s.useCallback)((function(e){Je((function(t){var n=t.customClassName,a=t.collectionType;return Nt(i,n,a,e)}))}),[i,Je]),He=cl("Edit CSV Processing Parameters"),qe=He[0],Ye=He[1];function Xe(e,t){for(var n,i=function(e,t){var n=Ot(e,o.ConfigModel.getConfig(),t);return null===n||void 0===n?void 0:n.inspectionParameters}(e,t),a=Object(o.getCsvParameterOptions)(),r=Object.keys(i).map((function(e){return e})),l=Object.values(i).map((function(e){return e})),s=Et(a.map((function(e,t){return{index:t,value:e}})));!(n=s()).done;)for(var c,u=n.value.index,p=Et(r.map((function(e,t){return{pindex:t,pvalue:e}})));!(c=p()).done;){var d=c.value,f=d.pvalue,m=d.pindex;if(a[u].name===f){a[u].value=l[m],a[u].enabled=!0;break}}return a}var We=Object(s.useCallback)((function(e,t){Ye((function(n){for(var i,a={},r=Et(n);!(i=r()).done;){var l=i.value;a[l.name]=l.value}!function(e,t,n){try{var i=o.ConfigModel.getConfig();Ot(e,i,t).inspectionParameters=n,Promise.resolve(i.mappingService.notifyMappingUpdated()).then((function(){return Promise.resolve(i.fileService.updateDigestFile()).then((function(){}))}))}catch(a){return Promise.reject(a)}}(e,t,a)}),Xe(e,t))}),[Ye]),Ke=ul(!1),Ze=Ke[0],$e=Ke[1],Qe=Object(s.useMemo)((function(){return Object(at.createPortal)(c.a.createElement(c.a.Fragment,null,B,H,X,ce,me,Ze,he,be,h,M,S,x,U,_,ee,ie,Pe,_e,Be,Ce,De,oe,Ue,qe),t)}),[h,Be,Ce,x,M,me,he,be,_e,U,S,De,_,X,B,H,ce,Ze,t,Pe,ee,ie,oe,Ue,qe]);return{handlers:{onImportADMArchive:J,onImportADMArchiveFromEntaxyRegistry:q,onExportADMArchive:W,onExportADMArchiveIntoEntaxyRegistry:$,onCreateConstant:y,onDeleteConstant:O,onEditConstant:T,onCreateProperty:w,onDeleteProperty:V,onEditProperty:k,onResetAtlasmap:te,onAbout:ae,onImportDocument:ue,onImportDocumentFromEntaxyRegistry:pe,onCreateInstance:de,onDeleteDocument:ge,onSpecifyInstanceSchema:$e,onCaptureDocumentID:Ee,onChangeDocumentName:Fe,onRemoveMappedField:we,onDeleteMapping:je,onDeleteSelectedMapping:ke,onEnableCustomClass:Ge,onCreateNamespace:Oe,onEditNamespace:Ie,deleteNamespace:m,onToggleExpressionMode:le,onEditMappingEnumeration:Ve,onEditCSVParams:We},dialogs:Qe}}var gl=function(e){var t=e.allowImport,n=void 0===t||t,i=e.allowExport,a=void 0===i||i,r=e.allowReset,l=void 0===r||r,u=e.allowDelete,p=void 0===u||u,d=e.allowCustomJavaClasses,f=void 0===d||d,m=e.modalsContainerId,g=void 0===m?"modals":m,v=e.toolbarOptions,h=il(),E=h.pending,y=h.notifications,b=h.markNotificationRead,S=h.sourceProperties,F=h.targetProperties,T=h.constants,C=h.sources,M=h.targets,O=h.mappings,A=h.selectedMapping,N=h.selectMapping,I=h.onFieldPreviewChange,x=h.searchSources,P=h.searchTargets,w=h.currentMappingExpression,R=h.executeFieldSearch,_=h.getFieldEnums,j=h.setSelectedEnumValue,k=h.mappingExpressionAddField,L=h.mappingExpressionClearText,U=h.mappingExpressionInit,V=h.mappingExpressionInsertText,z=h.mappingExpressionObservable,B=h.mappingExpressionRemoveField,J=h.mappingExpressionEnabled,G=h.isMappingExpressionEmpty,H=h.trailerId,q=h.canAddToSelectedMapping,Y=h.isFieldAddableToSelection,X=h.isFieldDragAndDropAllowed,W=h.isFieldRemovableFromSelection,K=h.onAddToMapping,Z=h.onRemoveFromMapping,$=h.onCreateMapping,Q=h.isEnumerationMapping,ee=h.saveADMArchiveFileIntoEntaxyRegistry,te=h.exportADMArchiveFileIntoEntaxyRegistry,ne=o.ConfigModel.getConfig(),ie=null===ne.openedArchiveFileLocation,ae=!0;ne.hideImport&&(ae=!ne.hideImport),ne.hideExport&&(a=!ne.hideExport);var re=ml({modalContainer:document.getElementById(g)}),oe=re.handlers,le=re.dialogs,se=function(e){var t=e.showImportAtlasFileToolbarItem,n=void 0===t||t,i=e.showImportAtlasFileFromEntaxyRegistryToolbarItem,a=void 0===i||i,r=e.showExportAtlasFileToolbarItem,o=void 0===r||r,l=e.showSaveAtlasFileIntoEntaxyRegistryToolbarItem,u=void 0===l||l,p=e.disableSaveAtlasFileIntoEntaxyRegistryToolbarItem,d=void 0===p||p,f=e.showExportAtlasFileIntoEntaxyRegistryToolbarItem,m=void 0===f||f,g=e.showResetToolbarItem,v=void 0===g||g,h=e.showColumnMapperViewToolbarItem,E=void 0===h||h,y=e.showMappingTableViewToolbarItem,b=void 0===y||y,S=e.showNamespaceTableViewToolbarItem,F=void 0===S||S,T=e.showToggleMappingPreviewToolbarItem,C=void 0===T||T,M=e.showToggleTypesToolbarItem,O=void 0===M||M,A=e.showToggleMappedFieldsToolbarItem,N=void 0===A||A,I=e.showToggleUnmappedFieldsToolbarItem,x=void 0===I||I,P=e.showAddNewMappingToolbarItem,w=void 0===P||P,R=e.onImportADMArchiveFile,_=e.onImportADMArchiveFileFromEntaxyRegistry,j=e.onExportAtlasFile,k=e.onSaveAtlasFileIntoEntaxyRegistry,L=e.onExportAtlasFileIntoEntaxyRegistry,U=e.onResetAtlasmap,V=e.onAbout,z=il(),B=z.toggleMappingPreview,J=z.toggleShowMappedFields,G=z.toggleShowUnmappedFields,H=z.newMapping,q=Object(s.useState)("ColumnMapper"),Y=q[0],X=q[1],W=Jn(!1,B),K=W.state,Z=W.toggle,$=Jn(!0),Q=$.state,ee=$.toggle,te=Jn(!0,J),ne=te.state,ie=te.toggle,ae=Jn(!0,G),re=ae.state,oe=ae.toggle,le=Object(s.useMemo)((function(){return c.a.createElement(Xr,null,(n||a||o||u||m||v)&&c.a.createElement(D.a,{variant:"button-group",spacer:{default:"spacerMd"}},c.a.createElement(_o,{showImportAtlasFileToolbarItem:n,showImportAtlasFileFromEntaxyRegistryToolbarItem:a,showExportAtlasFileToolbarItem:o,showSaveAtlasFileIntoEntaxyRegistryToolbarItem:u,disableSaveAtlasFileIntoEntaxyRegistryToolbarItem:d,showExportAtlasFileIntoEntaxyRegistryToolbarItem:m,showResetToolbarItem:v,onImportAtlasFile:R,onImportAtlasFileFromEntaxyRegistry:_,onExportAtlasFile:j,onSaveAtlasFileIntoEntaxyRegistry:k,onExportAtlasFileIntoEntaxyRegistry:L,onResetAtlasmap:U})),(E||b||F)&&c.a.createElement(D.a,{variant:"icon-button-group",spacer:{default:"spacerMd"}},E&&c.a.createElement(Bo,{toggled:"ColumnMapper"===Y,onClick:function(){return X("ColumnMapper")}}),b&&c.a.createElement(Jo,{toggled:"MappingTable"===Y,onClick:function(){return X("MappingTable")}}),F&&c.a.createElement(Go,{toggled:"NamespaceTable"===Y,onClick:function(){return X("NamespaceTable")}})),c.a.createElement(D.a,{variant:"icon-button-group"},C&&("ColumnMapper"===Y||"MappingTable"===Y)&&c.a.createElement(Ho,{toggled:K,onClick:Z}),O&&("ColumnMapper"===Y||"MappingTable"===Y)&&c.a.createElement(qo,{toggled:Q,onClick:ee}),N&&"ColumnMapper"===Y&&c.a.createElement(Yo,{toggled:ne,onClick:ie}),x&&"ColumnMapper"===Y&&c.a.createElement(Xo,{toggled:re,onClick:oe}),w&&("ColumnMapper"===Y||"MappingTable"===Y)&&c.a.createElement(Wo,{onClick:H}),w&&("ColumnMapper"===Y||"MappingTable"===Y)&&c.a.createElement(Ko,{onClick:V})))}),[n,a,o,u,d,m,v,R,_,j,k,L,U,V,E,b,F,Y,C,K,Z,O,Q,ee,N,ne,ie,x,re,oe,w,H]);return{activeView:Y,showMappingPreview:K,showTypes:Q,showMappedFields:ne,showUnmappedFields:re,contextToolbar:le}}(ft({showImportAtlasFileToolbarItem:n&&ae,showImportAtlasFileFromEntaxyRegistryToolbarItem:n&&ae,showExportAtlasFileToolbarItem:a,showSaveAtlasFileIntoEntaxyRegistryToolbarItem:a,disableSaveAtlasFileIntoEntaxyRegistryToolbarItem:ie,showExportAtlasFileIntoEntaxyRegistryToolbarItem:a,showResetToolbarItem:l},v,{onImportADMArchiveFile:oe.onImportADMArchive,onImportADMArchiveFileFromEntaxyRegistry:oe.onImportADMArchiveFromEntaxyRegistry,onExportAtlasFile:oe.onExportADMArchive,onSaveAtlasFileIntoEntaxyRegistry:ee,onExportAtlasFileIntoEntaxyRegistry:oe.onExportADMArchiveIntoEntaxyRegistry,onResetAtlasmap:oe.onResetAtlasmap,onAbout:oe.onAbout})),ce=se.activeView,ue=se.showMappingPreview,pe=se.showTypes,de=se.contextToolbar,me=Object(s.useCallback)((function(e){return ue&&!!A&&e.isConnected&&!!e.mappings.find((function(e){return e.id===A.id}))}),[A,ue]),ge=Object(s.useCallback)((function(e){return ue&&!!A&&e.id===A.id}),[A,ue]),ve=c.a.createElement(Wr,null,c.a.createElement(Fa,{mappingExpression:J?w:void 0,executeFieldSearch:R,getFieldEnums:_,mappingExpressionAddField:k,mappingExpressionClearText:L,isMappingExpressionEmpty:G,mappingExpressionInit:U,mappingExpressionInsertText:V,mappingExpressionObservable:z,mappingExpressionRemoveField:B,trailerId:H,disabled:!A,onToggle:oe.onToggleExpressionMode,setSelectedEnumValue:j})),he=Object(s.useMemo)((function(){return{isSource:!0,acceptDropType:"target",draggableType:"source",canDrop:function(e,t){return X(t.payload,e)},onDrop:function(e,t){return $(e,null===t||void 0===t?void 0:t.payload)},onShowMappingDetails:N,onAddToSelectedMapping:K,canAddToSelectedMapping:q,canAddFieldToSelectedMapping:function(e){return Y("source",e)},onAddFieldToSelectedMapping:K,canRemoveFromSelectedMapping:function(e){return W("source",e)},onRemoveFromSelectedMapping:Z,onCreateConstant:function(){return oe.onCreateConstant(T)},onEditConstant:function(e,t){var n=e,i=t,a=function(e){return o.ConfigModel.getConfig().documentService.getConstantType(e)}(n);oe.onEditConstant({name:n,value:i,valueType:a},T)},onDeleteConstant:oe.onDeleteConstant,onCreateProperty:function(e){oe.onCreateProperty(e,S)},onEditProperty:function(e,t,n){var i=e.split(" ")[0],a=Fn(i,t,n);oe.onEditProperty({name:i,valueType:a,scope:t},!0,S)},onDeleteProperty:oe.onDeleteProperty,onDeleteDocument:p?function(e){return oe.onDeleteDocument(e,!0)}:void 0,onCaptureDocumentID:function(e){return oe.onCaptureDocumentID(e)},onChangeDocumentName:function(e,t){return oe.onChangeDocumentName({id:e,name:t,isSource:!0})},onCustomClassSearch:f?function(e){return oe.onEnableCustomClass(e)}:void 0,onImportDocument:n?function(e){return oe.onImportDocument(e,!0)}:void 0,onImportDocumentFromEntaxyRegistry:n?function(e){return oe.onImportDocumentFromEntaxyRegistry(e,!0)}:void 0,onCreateInstance:n?function(e){return oe.onCreateInstance(e,!0)}:void 0,onSearch:x,shouldShowMappingPreviewForField:me,onFieldPreviewChange:I,canStartMapping:function(){return!0},onStartMapping:function(e){return $(e,void 0)},onEditCSVParams:function(e,t){oe.onEditCSVParams(e,t)}}}),[N,K,Z,oe,T,p,f,n,x,me,I,$,q,Y,X,W,S]),Ee=Object(s.useMemo)((function(){return{isSource:!1,acceptDropType:"source",draggableType:"target",canDrop:function(e,t){return X(t.payload,e)},onDrop:function(e,t){return $(null===t||void 0===t?void 0:t.payload,e)},canAddToSelectedMapping:q,canAddFieldToSelectedMapping:function(e){return Y("target",e)},onShowMappingDetails:N,onAddToSelectedMapping:K,canRemoveFromSelectedMapping:function(e){return W("target",e)},onRemoveFromSelectedMapping:Z,onCreateProperty:function(e){oe.onCreateProperty(e,F)},onEditProperty:function(e,t,n){var i=e.split(" ")[0],a=Fn(i,t,n);oe.onEditProperty({name:i,valueType:a,scope:t},!1,F)},onDeleteProperty:oe.onDeleteProperty,onDeleteDocument:p?function(e){return oe.onDeleteDocument(e,!1)}:void 0,onCaptureDocumentID:function(e){return oe.onCaptureDocumentID(e)},onChangeDocumentName:function(e,t){return oe.onChangeDocumentName({id:e,name:t,isSource:!1})},onCustomClassSearch:f?function(e){return oe.onEnableCustomClass(e)}:void 0,onImportDocument:n?function(e){return oe.onImportDocument(e,!1)}:void 0,onImportDocumentFromEntaxyRegistry:n?function(e){return oe.onImportDocumentFromEntaxyRegistry(e,!1)}:void 0,onCreateInstance:n?function(e){return oe.onCreateInstance(e,!1)}:void 0,onSearch:P,shouldShowMappingPreviewForField:me,onFieldPreviewChange:I,canStartMapping:function(e){return!e.isConnected},onStartMapping:function(e){return $(void 0,e)},onEditCSVParams:function(e,t){oe.onEditCSVParams(e,t)}}}),[N,K,Z,oe,p,f,n,P,me,I,$,q,Y,X,W,F]),ye=Object(s.useMemo)((function(){switch(ce){case"ColumnMapper":return c.a.createElement(wo,{sourceProperties:S,targetProperties:F,constants:T,sources:C,mappings:O,targets:M,selectedMappingId:null===A||void 0===A?void 0:A.id,onSelectMapping:N,showMappingPreview:ue,showTypes:pe,sourceEvents:he,targetEvents:Ee});case"MappingTable":return c.a.createElement(Io,{mappings:O,onSelectMapping:N,shouldShowMappingPreview:ge,onFieldPreviewChange:I});case"NamespaceTable":return c.a.createElement(Po,{sources:C,onCreateNamespace:oe.onCreateNamespace,onEditNamespace:function(e,t,n,i,a){return oe.onEditNamespace(e,{alias:t,uri:n,locationUri:i,targetNamespace:a})},onDeleteNamespace:oe.deleteNamespace});default:return c.a.createElement(c.a.Fragment,null,"TODO")}}),[ce,T,oe,O,I,S,F,N,A,ge,ue,pe,he,C,Ee,M]),be=function(e){var t=e.onCreateConstant,n=e.onCreateProperty,i=e.onRemoveMapping,a=e.onEditEnum,r=e.isEnumMapping,l=il(),u=l.selectedMapping,p=l.deselectMapping,d=l.removeMappedFieldFromCurrentMapping,f=l.fromMappedFieldToIMappingField,m=l.flatSources,g=l.flatTargets,v=l.constants,h=l.sourceProperties,E=l.targetProperties,y=l.canAddToSelectedMapping,b=l.isFieldAddableToSelection,S=l.addToCurrentMapping,F=l.notifications,T=l.markNotificationRead,C=l.mappingExpressionEnabled,M=l.getMultiplicityActions,O=l.getMultiplicityActionDelimiters,A=l.handleIndexChange,D=l.handleNewTransformation,N=l.handleRemoveTransformation,I=l.handleTransformationChange,x=l.handleTransformationArgumentChange,P=l.handleMultiplicityChange,w=l.handleMultiplicityArgumentChange;return Object(s.useCallback)((function(){if(u){var e=u.mapping,l=e.getMappedFields(!0).map(f),s=e.getMappedFields(!1).map(f),R=l.length>1&&e.transition.isManyToOneMode()&&!e.transition.enableExpression,_=s.length>1&&e.transition.isOneToManyMode()&&!e.transition.enableExpression,j=e.transition.transitionFieldAction,k=void 0;if(j){var L=M(e).map((function(e){return{label:o.CommonUtil.toDisplayable(e.name),name:e.name,value:e.name}})),U=O().map((function(e){return{name:e.prettyName,value:e.actualDelimiter}}));k={name:j.name,transformationsOptions:L,transformationsArguments:j.argumentValues.map((function(e){var t,n;return{label:o.CommonUtil.toDisplayable(e.name),name:e.name,type:null===(t=j.definition)||void 0===t||null===(n=t.arguments.find((function(t){return t.name===e.name})))||void 0===n?void 0:n.type,value:e.value,options:"delimiter"===e.name?U:void 0}})),onChange:function(e){return P(j,e)},onArgumentChange:function(e,t){return w(j,e,t)}}}var V=[null===v||void 0===v?void 0:v.fields,null===h||void 0===h?void 0:h.fields,m].flatMap((function(e){return e||[]})).filter((function(e){return b("source",e)})),z=[null===E||void 0===E?void 0:E.fields,g].flatMap((function(e){return e||[]})).filter((function(e){return b("target",e)}));return c.a.createElement(Oo,{notifications:F.filter((function(e){return e.mappingId===u.id&&!e.isRead})),sources:l,targets:s,addableSources:V,addableTargets:z,onClose:p,onRemoveMapping:i,onRemoveMappedField:function(e,t){var n=u.mapping.getMappedFieldForIndex(""+(t+1),e);n&&d(n)},showSourcesIndex:R,showTargetsIndex:_,mappingExpressionEnabled:C,multiplicity:k,onIndexChange:A,onNewTransformation:D,onRemoveTransformation:N,onTransformationChange:I,onTransformationArgumentChange:x,onAddFieldToMapping:function(e,t){return S(t.amField)},onNotificationRead:T,onEditEnum:a,isEnumMapping:r,onCreateConstant:t,onCreateProperty:function(e){n(e,e?h:E,!0)},canAddToSelectedMapping:y})}return c.a.createElement(c.a.Fragment,null,"TODO: error")}),[u,f,v,h,E,m,g,F,p,i,a,r,A,D,N,I,x,T,M,O,P,w,d,b,S,C,t,n,y])}({onCreateConstant:function(){oe.onCreateConstant(T,!0)},onCreateProperty:function(e){e?oe.onCreateProperty(e,S,!0):oe.onCreateProperty(e,F,!0)},onRemoveMapping:oe.onDeleteSelectedMapping,onEditEnum:oe.onEditMappingEnumeration,isEnumMapping:Q});function Se(e){if(e.origin===window.origin&&e.data&&"init"===e.data.type){var t=o.ConfigModel.getConfig();e.data.hideImport&&(t.hideImport=e.data.hideImport),e.data.hideExport&&(t.hideExport=e.data.hideExport),e.data.waitForSaving&&(window.saveIntoRegistryFn=ee,window.saveIntoRegistryAsFn=function(e){te(e).then((function(e){window.top.postMessage({type:"savingComplete",result:e},window.top.origin)}))})}}return Object(s.useEffect)((function(){return window.top.postMessage("readyForInitData",window.top.origin),window.addEventListener("message",Se),function(){window.removeEventListener("message",Se)}}),[]),c.a.createElement(Ri,null,c.a.createElement(Hn,null,c.a.createElement(to,{loading:E,contextToolbar:de,expressionToolbar:"NamespaceTable"!==ce&&ve,showSidebar:!!A,renderSidebar:be},ye),c.a.createElement(qi,null),c.a.createElement(fe.a,{isToast:!0},y.filter((function(e){return!e.isRead&&!e.mappingId})).slice(0,5).map((function(e){var t=e.id,n=e.variant,i=e.title,a=e.description;return c.a.createElement(_r,{variant:n,title:i,key:t,onClose:function(){return b(t)},onTimeout:function(){return b(t)}},a)}))),le))},vl=function(){return c.a.createElement(i.a,null,c.a.createElement(a.a,{variant:"light",padding:{default:"noPadding"},isFilled:!0},c.a.createElement(gl,null)))};rt.a.render(c.a.createElement(nl,{baseJavaInspectionServiceUrl:window.top.origin+"/cxf/atlas/java/",baseXMLInspectionServiceUrl:window.top.origin+"/cxf/atlas/xml/",baseJSONInspectionServiceUrl:window.top.origin+"/cxf/atlas/json/",baseCSVInspectionServiceUrl:window.top.origin+"/cxf/atlas/csv/",baseMappingServiceUrl:window.top.origin+"/cxf/atlas/",logLevel:"info"},c.a.createElement(vl,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))},9:function(e,t,n){"use strict";e.exports=n(361)}},[[359,1,2]]]);
//# sourceMappingURL=main.ad5ba31c.chunk.js.map
