aiware-js 2.14.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.css +46 -46
- package/index.esm.js +1 -1
- package/index.html +1 -1
- package/js-core.esm.js +243 -35
- package/js-core.esm10.js +1 -1
- package/js-core.esm11.js +1 -1
- package/js-core.esm12.js +1 -1
- package/js-core.esm13.js +1 -1
- package/js-core.esm14.js +1 -1
- package/js-core.esm15.js +1 -23
- package/js-core.esm16.js +1 -1
- package/js-core.esm17.js +1 -595
- package/js-core.esm18.js +230 -1
- package/js-core.esm19.js +60 -1
- package/js-core.esm2.js +1 -1
- package/js-core.esm20.js +1 -1
- package/js-core.esm21.js +1 -1
- package/js-core.esm22.js +1 -1
- package/js-core.esm23.js +1 -1
- package/js-core.esm24.js +1 -1
- package/js-core.esm25.js +1 -1
- package/js-core.esm26.js +1 -1
- package/js-core.esm27.js +10 -226
- package/js-core.esm28.js +10 -58
- package/js-core.esm29.js +54 -1
- package/js-core.esm30.js +1 -1
- package/js-core.esm31.js +88 -1
- package/js-core.esm32.js +211 -1
- package/js-core.esm33.js +35 -1
- package/js-core.esm34.js +1 -1
- package/js-core.esm35.js +1 -14
- package/js-core.esm36.js +1 -12
- package/js-core.esm37.js +1 -54
- package/js-core.esm38.js +31 -1
- package/js-core.esm39.js +1 -88
- package/js-core.esm4.js +1 -1
- package/js-core.esm40.js +38 -213
- package/js-core.esm41.js +1 -35
- package/js-core.esm42.js +29 -1
- package/js-core.esm43.js +73 -1
- package/js-core.esm5.js +23 -1
- package/js-core.esm6.js +1 -20
- package/js-core.esm7.js +568 -109
- package/js-core.esm8.js +1 -1
- package/js-core.esm9.js +1 -1
- package/js-core.umd.css +92 -92
- package/js-core.umd.js +279 -136
- package/lib/rate-limiter.d.ts +6 -0
- package/lib/widgetHandler.d.ts +17 -4
- package/locales/en.json +1 -1
- package/locales/es.json +1 -1
- package/locales/fr.json +1 -1
- package/package.json +4 -2
- package/js-core.esm44.js +0 -1
- package/js-core.esm45.js +0 -1
- package/js-core.esm46.js +0 -31
- package/js-core.esm47.js +0 -1
- package/js-core.esm48.js +0 -1
- package/js-core.esm49.js +0 -1
- package/js-core.esm50.js +0 -29
package/js-core.esm43.js
CHANGED
|
@@ -1 +1,73 @@
|
|
|
1
|
-
import{p as createSvgIcon,q as interopRequireDefault,j as jsxRuntime,bO as createSlice,aM as createAction,dB as combineReducers,aX as createSelector,bT as rootApiSelector,aF as graphEndpointSelector,a9 as sessionTokenSelector,eU as channel,m as makeStyles,eV as VideoCamera,eW as Image,eX as Sound,eY as Description,d1 as CacheProvider,d2 as muiCache,O as AIWareThemeProvider,Q as lib,A as AIWareIntlProvider,H as useSelector,bR as preferredLanguageSelector,gU as initialConfigSelector,G as useDispatch,r as react,W as classnames,bh as Box,bI as Alert,T as Typography,X as Tooltip$1,V as IconButton$1,dC as Close,as as all,F as FormattedMessage,a3 as List,bK as Grid,ar as Button$1,am as Dialog,an as DialogTitle,ao as DialogContent,ap as DialogContentText,aq as DialogActions,gV as ConfirmationModal,dl as Hide,Z as Avatar,gz as FolderOpen,gW as EnumHelpers,dm as showMessage,dn as MessageSeverity,f8 as guid,L as mountPanel,bL as TextField,au as takeLatest$1,aw as takeEvery$1,ax as take,az as put,f0 as UnknownDocument,a4 as ListItem,bk as ListItemAvatar,a5 as ListItemText,gX as formatBytes,fT as ListItemSecondaryAction,dK as Edit,dM as Delete,gY as NotInterested,a6 as Divider,cD as AIWareFormatMessage,gZ as mountPanelForResponse,s as store,aE as select,aB as call,f1 as sdkEventManager,f2 as SdkEvents,f3 as SdkError,fV as panelsSelector,av as hidePanel,dP as baseGraphQLApiWithError}from"./js-core.esm.js";import{selectors,actions as actions$4}from"./js-core.esm39.js";import{d as default_1$4}from"./js-core.esm44.js";import{C as Card}from"./js-core.esm19.js";import{C as Chip$1}from"./js-core.esm33.js";import{L as LinearProgress}from"./js-core.esm37.js";import"./js-core.esm32.js";import"./js-core.esm40.js";import"./js-core.esm41.js";import"./js-core.esm8.js";import"./js-core.esm18.js";import"./js-core.esm30.js";import"./js-core.esm42.js";import"./js-core.esm11.js";import"./js-core.esm12.js";import"./js-core.esm5.js";import"./js-core.esm22.js";import"./js-core.esm25.js";import"./js-core.esm24.js";import"./js-core.esm9.js";var LoadingStatus,ImporterView,FileItemTypeNames,MimeType,AddCircleOutline={},_interopRequireDefault$3=interopRequireDefault.exports,default_1$3=(Object.defineProperty(AddCircleOutline,"__esModule",{value:!0}),AddCircleOutline.default=void 0),_createSvgIcon$3=_interopRequireDefault$3(createSvgIcon),_jsxRuntime$3=jsxRuntime.exports,_default$3=(0,_createSvgIcon$3.default)((0,_jsxRuntime$3.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4V7zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"}),"AddCircleOutline"),default_1$3=AddCircleOutline.default=_default$3,ErrorOutline={},_interopRequireDefault$2=interopRequireDefault.exports,default_1$2=(Object.defineProperty(ErrorOutline,"__esModule",{value:!0}),ErrorOutline.default=void 0),_createSvgIcon$2=_interopRequireDefault$2(createSvgIcon),_jsxRuntime$2=jsxRuntime.exports,_default$2=(0,_createSvgIcon$2.default)((0,_jsxRuntime$2.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),default_1$2=ErrorOutline.default=_default$2,RefreshOutlined={},_interopRequireDefault$1=interopRequireDefault.exports,default_1$1=(Object.defineProperty(RefreshOutlined,"__esModule",{value:!0}),RefreshOutlined.default=void 0),_createSvgIcon$1=_interopRequireDefault$1(createSvgIcon),_jsxRuntime$1=jsxRuntime.exports,_default$1=(0,_createSvgIcon$1.default)((0,_jsxRuntime$1.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"RefreshOutlined"),default_1$1=RefreshOutlined.default=_default$1,CloudUploadOutlined={},_interopRequireDefault=interopRequireDefault.exports,default_1=(Object.defineProperty(CloudUploadOutlined,"__esModule",{value:!0}),CloudUploadOutlined.default=void 0),_createSvgIcon=_interopRequireDefault(createSvgIcon),_jsxRuntime=jsxRuntime.exports,_default=(0,_createSvgIcon.default)((0,_jsxRuntime.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM19 18H6c-2.21 0-4-1.79-4-4 0-2.05 1.53-3.76 3.56-3.97l1.07-.11.5-.95C8.08 7.14 9.94 6 12 6c2.62 0 4.88 1.86 5.39 4.43l.3 1.5 1.53.11c1.56.1 2.78 1.41 2.78 2.96 0 1.65-1.35 3-3 3zM8 13h2.55v3h2.9v-3H16l-4-4z"}),"CloudUploadOutlined"),default_1=CloudUploadOutlined.default=_default;!function(){var e={};try{if(process)return process.env=Object.assign({},process.env),Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}}();const SLICE_NAME="dataCenterImporter",DEFAULT_ACCEPTABLE_FILE_TYPES=(!function(e){e.Failed="failed",e.Idle="idle",e.Pending="pending"}(LoadingStatus=LoadingStatus||{}),!function(e){e[e.browseFiles=0]="browseFiles",e[e.filesSelected=1]="filesSelected",e[e.folders=2]="folders"}(ImporterView=ImporterView||{}),!function(e){e.Image="image",e.Video="video",e.Audio="audio",e.Text="text"}(FileItemTypeNames=FileItemTypeNames||{}),!function(e){e.ApplicationJson="application/json",e.ApplicationMsWord="application/msword",e.ApplicationPdf="application/pdf",e.ApplicationRtf="application/rtf",e.ApplicationSmil="application/smil+xml",e.ApplicationTtml="application/ttml+xml",e.ApplicationVeritoneAion="application/vnd.veritone.aion+json",e.ApplicationMsOutlook="application/vnd.ms-outlook",e.ApplicationMsPowerpoint="application/vnd.ms-powerpoint",e.ApplicationDocument="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.ApplicationSpreadsheet="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",e.ApplicationPresentation="application/vnd.openxmlformats-officedocument.presentationml.presentation",e.ApplicationOasisDoc="application/vnd.oasis.opendocument.text",e.ApplicationOasisSpreadsheet="application/vnd.oasis.opendocument.spreadsheet",e.ApplicationXFlv="application/x-flv",e.ApplicationXml="application/xml",e.ApplicationFormUrlEncoded="application/x-www-form-urlencoded",e.ImageJpeg="image/jpeg",e.ImagePng="image/png",e.ImageTiff="image/tiff",e.ImageGig="image/gif",e.TextPlain="text/plain",e.TextHtml="text/html",e.TextCsv="text/csv",e.TextPlainCharset="text/plain; charset=utf-8",e.AudioAac="audio/aac",e.AudioFlac="audio/flac",e.AudioMidi="audio/midi",e.AudioMp4="audio/mp4",e.AudioMpeg="audio/mpeg",e.AudioWav="audio/wav",e.AudioXWav="audio/x-wav",e.AudioWebm="audio/webm",e.VideoMp4="video/mp4",e.VideoMpeg="video/mpeg",e.VideoOgg="video/ogg",e.VideoQuicktime="video/quicktime",e.VideoWebm="video/webm",e.VideoM4v="video/x-m4v",e.VideoMsWmv="video/x-ms-wmv",e.VideoMsvideo="video/x-msvideo",e.Message="message/rfc822"}(MimeType=MimeType||{}),[{name:"Image",type:FileItemTypeNames.Image,extensions:[MimeType.ImageJpeg,MimeType.ImagePng,MimeType.ImageTiff,MimeType.ImageGig]},{name:"Video",type:FileItemTypeNames.Video,extensions:[MimeType.VideoMp4,MimeType.VideoMpeg,MimeType.VideoOgg,MimeType.VideoQuicktime,MimeType.VideoWebm,MimeType.VideoM4v,MimeType.VideoMsWmv,MimeType.VideoMsvideo]},{name:"Audio",type:FileItemTypeNames.Audio,extensions:[MimeType.AudioAac,MimeType.AudioFlac,MimeType.AudioMidi,MimeType.AudioMp4,MimeType.AudioMpeg,MimeType.AudioWav,MimeType.AudioXWav,MimeType.AudioWebm]},{name:"Documents",type:FileItemTypeNames.Text,extensions:[MimeType.TextPlain,MimeType.TextHtml,MimeType.TextCsv,MimeType.TextPlainCharset,MimeType.ApplicationJson,MimeType.ApplicationMsWord,MimeType.ApplicationPdf,MimeType.ApplicationRtf,MimeType.ApplicationSmil,MimeType.ApplicationTtml,MimeType.ApplicationVeritoneAion,MimeType.ApplicationMsOutlook,MimeType.ApplicationMsPowerpoint,MimeType.ApplicationDocument,MimeType.ApplicationSpreadsheet,MimeType.ApplicationPresentation,MimeType.ApplicationOasisDoc,MimeType.ApplicationOasisSpreadsheet,MimeType.ApplicationXFlv,MimeType.ApplicationXml,MimeType.ApplicationFormUrlEncoded,MimeType.Message]}]),namespace$3="uiState",initialState$2={status:LoadingStatus.Idle,currentView:ImporterView.browseFiles},slice$2=createSlice({name:SLICE_NAME+"/"+namespace$3,initialState:initialState$2,reducers:{setCurrentView(e,{payload:t}){e.currentView=t},fileUploadFailed(e){e.status=LoadingStatus.Failed},fileUploadSucceed(e){e.status=LoadingStatus.Idle},fileUploadStart(e){e.status=LoadingStatus.Pending},fileUploadAbortFailed(e){e.status=LoadingStatus.Failed},tdoCreateStart(e,{payload:t}){e.status=LoadingStatus.Pending,console.log("Starting to create TDOs for: ",t.filesSelected.map(e=>e.id).join("\n"))},tdoCreateSucceed(e){e.status=LoadingStatus.Idle},tdoCreateFailed(e){e.status=LoadingStatus.Failed},retryTDOCreateForFiles(e,{payload:t}){e.status=LoadingStatus.Pending,console.log("Retrying to create TDOs for: ",t.filesSelected.map(e=>e.id).join("\n"))},fileMetaSaveSucceeded(e){e.status=LoadingStatus.Idle},fileMetaSaveFailed(e){e.status=LoadingStatus.Failed},fileMetaSaveIsProcessing(e){e.status=LoadingStatus.Pending}}}),actions$3=slice$2.actions;var uiState=slice$2.reducer;const namespace$2="filesSelectedState",initialState$1={files:[]},slice$1=createSlice({name:SLICE_NAME+"/"+namespace$2,initialState:initialState$1,reducers:{setFilesSelected(e,{payload:t}){e.files=[...e.files,...t.filesSelected]},deleteFileSelected(e,{payload:t}){var a=e.files.filter(e=>e.id!==t.id);e.files=a},deleteFailedFiles(e){var t=e.files.filter(e=>e.status!==LoadingStatus.Failed);e.files=t},updateFile(t,{payload:a}){const i=t.files.findIndex(e=>e.id===a.id);-1!==i&&Object.keys(a).forEach(e=>{t.files[i][e]=a[e]})},retryFileUpload(e,{payload:t}){console.log("Retrying the files:",t.filesSelected.map(e=>e.id).join("/n"))},abortFileUpload(e,t){},addMetadataAction(e,t){console.log("nothing")},addMetadataToSelectedFile(e,t){const{id:a,meta:i}=t.payload;e.files.forEach(e=>{e.id===a&&(e.meta=i)})}}}),actions$2=slice$1.actions;var filesSelectedState=slice$1.reducer;const namespace$1="rootFolderState",initialState={rootFolder:null,status:LoadingStatus.Idle},slice=createSlice({name:SLICE_NAME+"/"+namespace$1,initialState:initialState,reducers:{startRootFolderFetch(e){e.status=LoadingStatus.Pending},rootFolderFetchSucceed(e,{payload:t}){e.rootFolder=t.rootFolder,e.status=LoadingStatus.Idle},rootFolderFetchFailed(e){e.status=LoadingStatus.Failed},updateRootFolder(e,{payload:t}){e.rootFolder=t.activeFolder}},extraReducers:e=>{e.addCase(createAction("DATA_CENTER_FOLDERS_AND_FILES_RESPONSE"),(e,{payload:t})=>{e.rootFolder=t.folder})}}),actions$1=slice.actions;var rootFolderState=slice.reducer;const namespace=SLICE_NAME,actions={[namespace$3]:actions$3,[namespace$2]:actions$2,[namespace$1]:actions$1},rootReducer=combineReducers({[namespace$3]:uiState,[namespace$2]:filesSelectedState,[namespace$1]:rootFolderState});function __awaiter(e,r,n,l){return new(n=n||Promise)(function(a,t){function i(e){try{o(l.next(e))}catch(e){t(e)}}function s(e){try{o(l.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?a(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(i,s)}o((l=l.apply(e,r||[])).next())})}function getSignedWritableUrls(t,a){return __awaiter(this,void 0,void 0,function*(){var e="getSignedWritableUrls";return(yield baseGraphQLApiWithError(Object.assign({query:"query getSignedWritableUrls($count: Int!) {\n getSignedWritableUrls(number: $count) {\n bucket,\n expiresInSeconds,\n getUrl,\n key,\n unsignedUrl,\n url,\n }\n }",variables:{count:a},operationName:e},t)))[e]})}function uploadFileToS3(i,s,{onProgress:o,onError:r,onAbort:n,onUpload:l}){return __awaiter(this,void 0,void 0,function*(){const e=new XMLHttpRequest,t=(e.upload.onload=()=>{l&&l(`The upload is completed: ${e.status} `+e.response)},e.upload.onerror=()=>{r&&r("Upload failed.")},e.upload.onabort=()=>{n&&n("Upload cancelled.")},e.upload.onprogress=e=>{o&&o(e.loaded/e.total*100)},e.open("PUT",i.url,!0),e.setRequestHeader("Content-Type",s.type),yield fetch(s.fileUrl));var a=yield t.blob();return e.send(a),e})}function getOrgCmsRootFolder(a){var i;return __awaiter(this,void 0,void 0,function*(){var e="getOrgCmsRootFolder",t="createRootFolders",e=yield baseGraphQLApiWithError(Object.assign({query:"mutation getOrgCmsRootFolder{\n createRootFolders(rootFolderType: cms) {\n id\n name\n modifiedDateTime\n treeObjectId\n ownerId\n }\n }\n ",operationName:e},a));return{orgRootFolder:null==(i=e[t])?void 0:i.find(e=>!e.ownerId),errors:e.errors||null}})}function createTDOWithAsset(i,s){var o,r,n,l,d,c;return __awaiter(this,void 0,void 0,function*(){try{var e="createTDOWithAsset",t={input:Object.assign(Object.assign({addToIndex:!0,contentType:s.contentType,name:s.name,uri:s.uri,parentFolderId:s.parentFolderId,startDateTime:null!=(o=null==s?void 0:s.meta)&&o.startDateTime?null==(r=null==s?void 0:s.meta)?void 0:r.startDateTime:s.startDateTime,assetType:"media"},null!=(n=null==s?void 0:s.meta)&&n.thumbnailUrl?{thumbnailUrl:null==(l=null==s?void 0:s.meta)?void 0:l.thumbnailUrl}:{}),{details:{veritoneFile:{filename:null==(d=null==s?void 0:s.meta)?void 0:d.fileName,mimetype:s.contentType,size:s.size},tags:null==(c=null==s?void 0:s.meta)?void 0:c.tags}})},a=yield baseGraphQLApiWithError(Object.assign({query:'mutation ($input: CreateTDOWithAsset!) {\n createTDOWithAsset(input: $input) {\n id\n name\n details\n modifiedDateTime\n primaryAsset(assetType: "media") {\n contentType\n signedUri\n }\n folders{\n folderPath{\n name\n id\n }\n }\n sourceData {\n source {\n id\n sourceTypeId\n }\n }\n thumbnailUrl\n }\n }\n ',variables:t},i));return{data:a[e],errors:a.errors||null}}catch(e){return{data:null,errors:e.message||"Unable to create TDO"}}})}const THUMBNAIL_ENGINE_ID="fd891cb5-ff80-48ae-b5cd-ac3c7d190d55";function createThumbnailJob(i,s){var o;return __awaiter(this,void 0,void 0,function*(){var e="createThumbailJob",t="createJob",a={input:{targetId:s,tasks:[{engineId:THUMBNAIL_ENGINE_ID}]}},a=yield baseGraphQLApiWithError(Object.assign({query:"\n mutation createThumbailJob($input: CreateJob) {\n createJob(input: $input) {\n id\n }\n }\n ",variables:a,operationName:e},i));return null==(o=a[t])?void 0:o.id})}const selectUIStateStatus=e=>e[namespace].uiState.status,selectCurrentView=e=>e[namespace].uiState.currentView,rootFolderSelector=e=>e[namespace].rootFolderState.rootFolder,selectSelectedFiles=e=>e[namespace].filesSelectedState.files,selectApiConfigs=createSelector([rootApiSelector,graphEndpointSelector,sessionTokenSelector],(e,t,a)=>({apiRoot:e,graphQLEndpoint:t,token:a}));function*rootFolderFetch(){var e,t=yield select(selectApiConfigs),a=yield select(preferredLanguageSelector);const i=AIWareFormatMessage(a);try{const{orgRootFolder:s,errors:o}=yield call(getOrgCmsRootFolder,t);s&&(s.isRoot=!0,yield put(actions.rootFolderState.rootFolderFetchSucceed({rootFolder:s}))),o&&(e=Array.isArray(o)?null===o||void 0===o?void 0:o.map(e=>e.message).join("\n"):i({id:"os-data-center-importer.snackbar.locationFolderFetchError",defaultMessage:[{type:0,value:"Error during the root folder fetch!"}]}),yield put(showMessage({content:e,severity:MessageSeverity.Error})),yield put(actions.rootFolderState.rootFolderFetchFailed()))}catch(e){yield put(actions.rootFolderState.rootFolderFetchFailed())}}function*watchFetchRootFolder(){yield takeLatest$1(actions.rootFolderState.startRootFolderFetch.type,rootFolderFetch)}function*createTDOs(e){var t;const o=yield select(selectApiConfigs),a=yield select(rootFolderSelector),i=e.payload.filesSelected,r=(e,t,a)=>(put(actions.filesSelectedState.updateFile(Object.assign({id:e},t))),{values:t,data:a});try{var s=i.reduce((e,t)=>(t.status===LoadingStatus.Idle&&(e[t.id]=call(createTDOWithAsset,o,{contentType:t.type,name:t.name,uri:t.unsignedUrl,parentFolderId:a.id,startDateTime:(new Date).toISOString(),size:t.size,meta:null==t?void 0:t.meta})),e),{});const d=yield all(s);var n=Object.keys(d).map(e=>{var t=null==(t=null==(t=d[e])?void 0:t.data)?void 0:t.id;const a=null==(i=d[e])?void 0:i.data;var i=d[e].errors;if(null!==a&&void 0!==a&&a.details&&(a.name=(null==(s=null==(s=a.details)?void 0:s.veritoneFile)?void 0:s.filename)||(null==(s=null==(s=a.details)?void 0:s.veritoneFile)?void 0:s.fileName)||a.name),!t||i)return sdkEventManager.dispatch(SdkEvents.tdoCreated,new SdkError(i||"TDO creation failed!"),{fileId:e,tdoId:t}),r(e,{tdoStatus:LoadingStatus.Failed});var s=t;try{createThumbnailJob(o,s)}catch(e){console.log("Error while launching thumbnail generation job",e)}return sdkEventManager.dispatch(SdkEvents.tdoCreated,null,{fileId:e,tdoId:t}),r(e,{tdoId:t,tdoStatus:LoadingStatus.Idle},a)}),l=yield all(n);for(let e=0;e<l.length;e++)l[e].values.tdoStatus===LoadingStatus.Idle&&(yield put(actions$4.viewMyFiles.addTdoFolder({folderId:a.id,tdoId:l[e].values.tdoId})),yield put(actions$4.entities.addTdoImported({file:null==(t=l[e])?void 0:t.data})));yield put(actions.uiState.tdoCreateSucceed())}catch(e){console.log(e),yield put(actions.uiState.tdoCreateFailed())}}function*closeImporterPanel(){const e=yield select(panelsSelector);var t=e.find(e=>"DATA_CENTER_IMPORTER"===e.microFrontend.name);t&&t.panelId&&(t=t["panelId"],yield put(hidePanel(t)))}function*getUrlBuckets(e){var t=yield select(selectApiConfigs);return yield call(getSignedWritableUrls,t,e)}function*closeFileMetadataPanel(){const e=yield select(panelsSelector);var t=e.find(e=>"EDIT_FILE_METADATA"===e.microFrontend.name);t&&t.panelId&&(t=t["panelId"],yield put(hidePanel(t)))}function*addMetadataToFile(e){var t=yield select(preferredLanguageSelector),e=e["payload"];const{id:a,meta:i}=e,s=AIWareFormatMessage(t);try{var[o]=yield call(getUrlBuckets,1);yield put(actions.uiState.fileMetaSaveIsProcessing()),i.thumbnailImg&&(yield call(handleMetaFileS3Upload,i.thumbnailImg,o)),i.thumbnailUrl=o.unsignedUrl,i.runTime&&i.runDate&&(i.startDateTime=new Date(i.runDate+" "+i.runTime).toISOString()),yield put(actions.filesSelectedState.addMetadataToSelectedFile({id:a,meta:i})),yield put(actions.uiState.fileMetaSaveSucceeded())}catch(e){yield put(showMessage({content:s({id:"os-data-center-importer.snackbar.fileMetaError",defaultMessage:[{type:0,value:"Something went wrong while saving your changes."}]}),severity:MessageSeverity.Error}))}}function*handleMetaFileS3Upload(e,t){yield uploadFileToS3(t,Object.assign(Object.assign({},e),{getUrl:t.getUrl,expiresInSeconds:t.expiresInSeconds,key:t.key,unsignedUrl:t.unsignedUrl,url:t.url}),{})}function*watchSetFileMetadata(){yield takeLatest$1(actions.filesSelectedState.addMetadataAction.type,addMetadataToFile)}function*watchFileMetadataSuccess(){yield takeEvery$1(actions.uiState.fileMetaSaveSucceeded.type,closeFileMetadataPanel)}function*watchTDOCreateStart(){yield takeLatest$1(actions.uiState.tdoCreateStart.type,createTDOs)}function*watchRetryTDOCreation(){yield takeEvery$1(actions.uiState.retryTDOCreateForFiles.type,createTDOs)}function*watchTdoCreateSuccess(){yield takeEvery$1(actions.uiState.tdoCreateSucceed.type,closeImporterPanel)}const root="undefined"!=typeof window?window:global,fileUploadChannel=(root.xhrInstances={},channel());function*filesSelected(t){var a=t.payload.filesSelected,i=t.payload.sdkFiles;try{yield put(actions.uiState.fileUploadStart());var s=yield call(getUrlBuckets,a.length);let e=0;for(const r of s){const n=a[e],l=(e++,yield put(actions.filesSelectedState.updateFile({id:n.id,status:LoadingStatus.Pending,percentComplete:0,expiresInSeconds:r.expiresInSeconds,getUrl:r.getUrl,key:r.key,unsignedUrl:r.unsignedUrl,url:r.url})),Object.assign(Object.assign({},i),{expiresInSeconds:r.expiresInSeconds,getUrl:r.getUrl,key:r.key,unsignedUrl:r.unsignedUrl,url:r.url})),d=e=>{fileUploadChannel.put(actions.filesSelectedState.updateFile(Object.assign({id:n.id},e)))};var o=yield uploadFileToS3(r,n,{onProgress:e=>{d({percentComplete:e}),sdkEventManager.dispatch(SdkEvents.fileUploadProgress,null,e)},onAbort:e=>{d({status:LoadingStatus.Idle}),sdkEventManager.dispatch(SdkEvents.fileUpload,new SdkError(e,"abort"),l)},onError:e=>{d({status:LoadingStatus.Failed}),sdkEventManager.dispatch(SdkEvents.fileUpload,new SdkError(e),l)},onUpload:e=>{d({status:LoadingStatus.Idle}),sdkEventManager.dispatch(SdkEvents.fileUpload,null,l)}});root.xhrInstances[n.id]=o,yield put(actions.uiState.fileUploadSucceed())}}catch(e){t=(null==e?void 0:e.message)||"";console.error(t),yield put(actions.uiState.fileUploadFailed())}}function*abortFileUpload({payload:e}){try{var t=null==e?void 0:e.id;const a=root.xhrInstances[t];null!==a&&void 0!==a&&a.abort(),yield put(actions.filesSelectedState.deleteFileSelected({id:t}))}catch(e){yield put(actions.uiState.fileUploadAbortFailed())}}function*watchFilesSelected(){yield takeEvery$1(actions.filesSelectedState.setFilesSelected.type,filesSelected)}function*watchRetryFileUpload(){yield takeEvery$1(actions.filesSelectedState.retryFileUpload.type,filesSelected)}function*watchProgressChannel(){for(;;){var e=yield take(fileUploadChannel);yield put(e)}}function*watchFileAbort(){yield takeEvery$1(actions.filesSelectedState.abortFileUpload.type,abortFileUpload)}function*rootSaga(){yield all([watchFilesSelected(),watchProgressChannel(),watchRetryFileUpload(),watchFileAbort(),watchFetchRootFolder(),watchTDOCreateStart(),watchRetryTDOCreation(),watchTdoCreateSuccess(),watchSetFileMetadata(),watchFileMetadataSuccess()])}function getDataCenterImporterModule(){return{id:SLICE_NAME,reducerMap:{[SLICE_NAME]:rootReducer},sagas:[rootSaga],initialActions:[]}}const useStyles$a=makeStyles()(e=>({buttonContainer:{position:"relative",margin:"16px"},fileButton:{border:"1px solid #1871E8!important",borderRadius:e.shape.borderRadius,fontWeight:600,fontSize:"12px!important",background:e.palette.background.paper,color:"#1871E8!important",padding:"6px 15px!important"},hiddenFileButton:{visibility:"hidden",position:"absolute",left:0,width:"100%",height:"100%"}})),UploadButton=({id:e,labelCss:t,onUpload:a,render:i,imageOnly:s=!1,isUploadEnabled:o=!0})=>{const r=react.exports.useRef();var n=useStyles$a()["classes"];return react.exports.useEffect(()=>{o||(r.current.value=null)},[r,o]),jsxRuntime.exports.jsxs("label",Object.assign({htmlFor:"upload-file-input-"+e,className:t,onClick:e=>{o||e.preventDefault()}},{children:[i&&i({handleButtonClick:()=>{o&&r.current.click()}}),jsxRuntime.exports.jsx("input",{id:"upload-file-input-"+e,"data-test":"data-center-importer-local-upload-file-input-"+e,type:"file",multiple:!0,accept:s?"image/*":"",className:n.hiddenFileButton,onChange:a,ref:e=>r.current=e})]}))},useStyles$9=makeStyles()(e=>({progress:{width:"117px",height:"10px",borderRadius:8,backgroundColor:"#F2F7FE",display:"inline-block"},listItem:{padding:e.spacing(3,1)},avatar:{backgroundColor:"#FAFAFA",color:e.palette.secondary.main},errorIcon:{backgroundColor:"#FEF2F2","& svg:hover":{color:e.palette.error.main}},secondaryAction:{right:"0"},filename:{width:"330px",overflow:"hidden",whiteSpace:"nowrap",userSelect:"none"},caption:{userSelect:"none"}})),icons={video:jsxRuntime.exports.jsx(VideoCamera,{}),image:jsxRuntime.exports.jsx(Image,{}),audio:jsxRuntime.exports.jsx(Sound,{}),text:jsxRuntime.exports.jsx(Description,{}),application:jsxRuntime.exports.jsx(Description,{})},FileItemIcon=({filetype:e})=>{var[e]=e.split("/");return e&&icons[e]?icons[e]:jsxRuntime.exports.jsx(UnknownDocument,{})};function FileItem({item:e,onDelete:t,onRetry:a,onAbort:i,onEdit:s,showDivider:o=!0,uiStateStatus:r}){const{id:n,percentComplete:l,status:d,tdoStatus:c,size:p,type:u,meta:m}=e;let x=e["name"];m&&m.fileName&&(x=m.fileName);var g=useStyles$9()["classes"],f=[d,c].includes(LoadingStatus.Failed);return jsxRuntime.exports.jsxs(react.exports.Fragment,{children:[jsxRuntime.exports.jsxs(ListItem,Object.assign({className:g.listItem},{children:[jsxRuntime.exports.jsx(ListItemAvatar,{children:f?jsxRuntime.exports.jsx(Avatar,Object.assign({"data-test":"file-item-failed-icon",className:g.errorIcon},{children:jsxRuntime.exports.jsx(default_1$2,{color:"error"})})):jsxRuntime.exports.jsx(Avatar,Object.assign({"data-test":"file-item-avatar",className:g.avatar},{children:jsxRuntime.exports.jsx(FileItemIcon,{filetype:u})}))}),jsxRuntime.exports.jsx(ListItemText,{primary:jsxRuntime.exports.jsx(Tooltip$1,Object.assign({title:30<x.length?x:"",placement:"bottom-end"},{children:jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"file-item-title",className:g.filename,variant:"body1"},{children:30<x.length?x.substring(0,30)+"...":x}))})),secondary:jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"file-item-size",variant:"caption",className:g.caption},{children:formatBytes(p)}))}),jsxRuntime.exports.jsxs(ListItemSecondaryAction,Object.assign({className:g.secondaryAction},{children:[f&&jsxRuntime.exports.jsx(Tooltip$1,Object.assign({title:"Retry uploading"},{children:jsxRuntime.exports.jsx(IconButton$1,Object.assign({"data-test":"file-item-retry",onClick:()=>a(e),size:"large"},{children:jsxRuntime.exports.jsx(default_1$1,{})}))})),d===LoadingStatus.Idle&&jsxRuntime.exports.jsx(IconButton$1,Object.assign({"data-test":"file-item-edit",onClick:()=>s(e),size:"large"},{children:jsxRuntime.exports.jsx(Edit,{})})),([LoadingStatus.Failed,LoadingStatus.Idle].includes(d)||r===LoadingStatus.Failed)&&jsxRuntime.exports.jsx(IconButton$1,Object.assign({"data-test":"file-item-delete",onClick:()=>t(n),size:"large"},{children:jsxRuntime.exports.jsx(Delete,{})})),d===LoadingStatus.Pending&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(LinearProgress,{"data-test":"file-item-progress",className:g.progress,variant:"determinate",value:l}),jsxRuntime.exports.jsx(IconButton$1,Object.assign({"data-test":"file-item-abort",title:"Cancel Import",onClick:()=>i(e),size:"large"},{children:jsxRuntime.exports.jsx(NotInterested,{})}))]})]}))]})),o&&jsxRuntime.exports.jsx(Divider,{})]})}const useStyles$8=makeStyles()(e=>({fileItemListContainer:{paddingLeft:e.spacing(4),paddingRight:e.spacing(4),height:300,overflowY:"scroll",marginRight:5,marginTop:5,"&::-webkit-scrollbar":{width:3},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"#D5DFE9",padding:5,borderRadius:50},"&::-webkit-scrollbar-thumb:hover":{background:"#919ca8"}},shadowGradient:{display:"block",position:"absolute",top:-1,left:0,width:"100%",height:28,background:"linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #FFFFFF 100%)",transform:"translateY(-100%)"},footerWrapper:{borderTop:"0.5px solid #D5DFE9",position:"relative",padding:"13px 30px"},viewFormatsBtn:{cursor:"pointer",color:"#6098D1",fontSize:14,"&:hover":{color:e.palette.primary.main}},retryButton:{border:"1px solid",borderColor:e.palette.secondary.main,borderRadius:e.shape.borderRadius,fontWeight:600,fontSize:"12px!important",background:e.palette.background.paper,color:e.palette.secondary.main,padding:"6px 15px!important"},refreshIcon:{marginRight:e.spacing(2),color:e.palette.secondary.main,"&:hover":{color:e.palette.secondary.main}},addFilesIcon:{marginRight:e.spacing(2),color:e.palette.primary.main,"&:hover":{color:e.palette.primary.main}},addFilesBtn:{paddingLeft:0,paddingRight:0},addFilesLabel:{alignItems:"center",display:"flex",cursor:"pointer",paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},addIcon:{display:"block",marginRight:e.spacing(1)},filePickerInput:{display:"none"}})),FileItemList=({onUpload:t,fileItems:a,onDelete:i,onRetryFailedsClick:e,onRetry:s,onAbort:o,onEdit:r,uiStateStatus:n})=>{const l=useStyles$8()["classes"],d=useStyles$a()["classes"];var c=a.some(e=>e.status===LoadingStatus.Failed);return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h2",color:"textPrimary","data-test":"data-center-file-item-list-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.eAju+6",defaultMessage:"Local Machine",description:"Title of a list of files that user is uploading from their local machine"})})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body2",color:"textSecondary","data-test":"data-center-file-item-list-subheader"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.Khv+RJ",defaultMessage:"Choose files from your computer to import into your account",description:"A short description of local machine upload"})})),jsxRuntime.exports.jsxs(Box,Object.assign({mt:6,borderRadius:"4px",border:"0.5px solid #D5DFE9"},{children:[jsxRuntime.exports.jsx(List,Object.assign({disablePadding:!0,className:l.fileItemListContainer,"data-test":"data-center-file-item-list-wrapper"},{children:null==a?void 0:a.map((e,t)=>jsxRuntime.exports.jsx(FileItem,{item:e,showDivider:t!==a.length-1,onDelete:i,onRetry:s,onAbort:o,onEdit:r,uiStateStatus:n},t))})),jsxRuntime.exports.jsxs(Grid,Object.assign({direction:"row",justifyContent:"flex-end",alignItems:"center",item:!0,container:!0,className:l.footerWrapper},{children:[jsxRuntime.exports.jsx("span",{className:l.shadowGradient}),c&&jsxRuntime.exports.jsxs(Button$1,Object.assign({"data-test":"data-center-importer-local-retry-button",variant:"outlined",className:l.retryButton,onClick:e},{children:[jsxRuntime.exports.jsx(default_1$1,{fontSize:"small",className:l.refreshIcon}),jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.nJrtcz",defaultMessage:"Retry Failed Items",description:"Text of the label `Retry Failed Items`"})]})),jsxRuntime.exports.jsx(UploadButton,{onUpload:e=>{e=Array.from(e.target.files);t(e)},id:"file-item-list-upload-button",render:({handleButtonClick:e})=>jsxRuntime.exports.jsxs(Button$1,Object.assign({id:"file-item-list-upload-button",variant:"outlined",className:d.fileButton,onClick:e},{children:[jsxRuntime.exports.jsx(default_1$3,{fontSize:"small",className:l.addFilesIcon}),jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.ydDseD",defaultMessage:"Add Files",description:"Text of the label `Add Files`"})]}))})]}))]}))]})},useStyles$7=makeStyles()(e=>({footer:{position:"absolute",right:e.spacing(6),bottom:e.spacing(6)},closeButton:{marginRight:e.spacing(2),color:e.palette.text.primary},dialogTitle:{padding:`${e.spacing(6)} ${e.spacing(6)} ${e.spacing(1)}px !important `},dialogContent:{padding:`${e.spacing(1)} ${e.spacing(6)} !important `},dialogTitleText:{fontWeight:600},dialogAction:{padding:e.spacing(4)+" !important"}})),Footer=({fileItems:e,onClosePanel:t,onImportFiles:a,onIgnoreAndContinue:i,onRetry:s,uiStateStatus:o})=>{const[r,n]=react.exports.useState(!1),[l,d]=react.exports.useState(!1);var c=useStyles$7()["classes"],p=e.some(e=>e.status===LoadingStatus.Pending);const u=()=>{n(!1)};react.exports.useEffect(()=>{u()},[s,i]);p=0===e.length||p||[LoadingStatus.Pending,LoadingStatus.Failed].includes(o);return jsxRuntime.exports.jsxs("div",Object.assign({className:c.footer},{children:[jsxRuntime.exports.jsx(Button$1,Object.assign({onClick:()=>{e.length?d(!0):t()},variant:"text",size:"large",className:c.closeButton,"data-test":"data-center-importer-cancel-btn"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.0EGcHs",defaultMessage:"Close",description:"Close Panel"})})),jsxRuntime.exports.jsx(Button$1,Object.assign({onClick:()=>{e.some(e=>e.status===LoadingStatus.Failed)?n(!0):a()},disabled:p,size:"large",variant:"contained",color:"primary","data-test":"data-center-importer-import-btn"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.pcbRZH",defaultMessage:"Import",description:"Import uploaded files"})})),jsxRuntime.exports.jsxs(Dialog,Object.assign({open:r,maxWidth:"xs",onClose:u,"aria-labelledby":"dialog-title","aria-describedby":"dialog-description"},{children:[jsxRuntime.exports.jsx(DialogTitle,Object.assign({id:"dialog-title","data-test":"data-center-importer-dialog-title",className:c.dialogTitle},{children:jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h2",className:c.dialogTitleText},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.cl4DGP",defaultMessage:"Errors Detected",description:"title for Error Detected Dialog"})}))})),jsxRuntime.exports.jsx(DialogContent,Object.assign({className:c.dialogContent},{children:jsxRuntime.exports.jsx(DialogContentText,Object.assign({id:"dialog-description"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.N9Drr+",defaultMessage:"Some of your files have errors, would you like to fix these errors or continue?",description:"description for Error Detected Dialog"})}))})),jsxRuntime.exports.jsxs(DialogActions,Object.assign({className:c.dialogAction},{children:[jsxRuntime.exports.jsx(Button$1,Object.assign({onClick:s,variant:"text",size:"large","data-test":"data-center-importer-dialog-cancel-btn"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.7+A+C3",defaultMessage:"Retry Errors",description:"button text for retry failed files"})})),jsxRuntime.exports.jsx(Button$1,Object.assign({onClick:i,size:"large",variant:"contained",color:"primary","data-test":"data-center-importer-dialog-confirm-btn"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.E9hwYl",defaultMessage:"Ignore Errors and Continue",description:"button text for ignore failed files and kick of the importing progress"})}))]}))]})),jsxRuntime.exports.jsx(ConfirmationModal,{showConfirmationModal:l,closeConfirmationModal:()=>{d(!1)},onClosePanel:t,classes:c})]}))},useStyles$6=makeStyles()(e=>({root:{width:"720px",height:"auto"},configurationContainer:{minHeight:"650px"},mainContainer:{margin:e.spacing(6)},spacer:{marginTop:e.spacing(6)},header:{alignItems:"center",borderBottom:"0.5px solid "+e.palette.divider,backgroundColor:"#FAFAFA !important",display:"flex",height:64,padding:e.spacing(2)},headerTitle:{paddingLeft:e.spacing(4)},headerActionContainer:{alignItems:"center",display:"flex",flexGrow:1,height:"100%",justifyContent:"flex-end"},alert:{color:e.palette.error.main,userSelect:"none","& svg, & svg:hover":{color:e.palette.error.main}}})),visuallyHidden={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};var visuallyHidden$1=visuallyHidden;const SHARED_TEXT={panelHeaderTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.UQliO+",defaultMessage:"Local Machine Importer",description:"Local Machine Importer"}),closePanel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.kOsSpC",defaultMessage:"Close Panel",description:"Close Panel"}),locationFolderTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.UR2j6X",defaultMessage:"Location Folder",description:"Location Folder"}),locationFolderSubheader:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.zEHvrp",defaultMessage:"Choose the Data Center folder location where this content will be stored.",description:"Choose the Data Center folder location where this content will be stored."}),locationFolderLabel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.UR2j6Z",defaultMessage:"Folder",description:"Folder"}),locationFolderReselect:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.gtjP09",defaultMessage:"Change",description:"Change"}),editFileMetadataHeader:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.WUHjl4",defaultMessage:"Edit Metadata",description:"Edit Metadata"}),editFileMetadataCancelBtn:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.6PdOcy",defaultMessage:"Cancel",description:"Cancel"}),editFileMetadataSaveBtn:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.kxBKrN",defaultMessage:"Save Changes",description:"Save file metadata changes"}),editFileMetadataAddBtn:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.rntBSe",defaultMessage:"Add",description:"Add tags to metadata"}),editFileMetadataTagsHeading:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.fXL811",defaultMessage:"Tags",description:"Tags heading"}),editFileMetadataTagsSubHeading:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.WFj+x5",defaultMessage:"Add searchable tags to better organize this data. Separate each tag with a comma.",description:"Tags sub heading"}),editFileMetadataDisplayTimeHeading:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.8aqtJF",defaultMessage:"Media Display Time",description:"Media Display Time heading"}),editFileMetadataDisplayTimeSubHeading:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.mhUvxM",defaultMessage:"The actual time the content occurred.",description:"Media Display Time sub heading"}),supportedFilesTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.1riZqU",defaultMessage:"Supported File Types",description:"The title for the container of supported files"})},Header=({onPanelClose:e})=>{var t=useStyles$6()["classes"];return jsxRuntime.exports.jsxs("div",Object.assign({className:t.header,"data-test":"data-center-importer-header"},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({className:t.headerTitle,variant:"h1",color:"secondary","data-test":"data-center-importer-title"},{children:SHARED_TEXT.panelHeaderTitle()})),jsxRuntime.exports.jsxs("div",Object.assign({className:t.headerActionContainer},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({style:visuallyHidden$1,id:"data-center-importer-close-panel"},{children:SHARED_TEXT.closePanel()})),jsxRuntime.exports.jsx(Tooltip$1,Object.assign({title:SHARED_TEXT.closePanel()},{children:jsxRuntime.exports.jsx(IconButton$1,Object.assign({onClick:e,"aria-labelledby":"data-center-importer-close-panel","data-test":"data-center-importer-close-panel",size:"large"},{children:jsxRuntime.exports.jsx(Hide,{})}))}))]}))]}))},useStyles$5=makeStyles()(e=>({title:{userSelect:"none"},description:{fontWeight:400,marginBlockStart:"16px",userSelect:"none"},card:{border:"0.5px solid #D5DFE9!important",boxShadow:"none!important",borderRadius:"4px!important",display:"flex",flexDirection:"column",alignItems:"center",padding:32},focusedCard:{backgroundColor:"#D5DFE9",border:"0.5px solid #D5DFE9!important",boxShadow:"none!important",borderRadius:"4px!important",display:"flex",flexDirection:"column",alignItems:"center",padding:32},uploadIcon:{fontSize:"30px","&:hover":{color:"inherit"}},iconCircle:{color:e.palette.secondary.main,backgroundColor:"#ffffff !important",fontSize:"30px !important",width:"70px !important",height:"70px !important",border:"6px solid #E8E8E8"},selectMessage:{fontWeight:600,marginBlockStart:"12px"},subtitle:{fontSize:"12px",fontWeight:400},fileFormatsButton:{color:"#6098D1",fontSize:"10px",marginTop:10}})),LocalFileUpload=({onUpload:t,onViewSupportedFiles:e})=>{const[a,i]=react.exports.useState(!1),s=react.exports.useRef();var o=useStyles$5()["classes"];const r=useStyles$a()["classes"];react.exports.useEffect(()=>{const e=e=>{e.preventDefault(),t(Array.from(e.dataTransfer.files)),i(!1)};return window.addEventListener("drop",e),()=>{window.removeEventListener("drop",e)}},[i,t]),react.exports.useEffect(()=>{const e=e=>{e.preventDefault(),i(!0)},t=e=>{e.preventDefault(),i(!1)};return s.current&&(s.current.addEventListener("dragover",e),s.current.addEventListener("dragleave",t)),()=>{s.current.removeEventListener("dragover",e),s.current.removeEventListener("dragleave",t)}},[i]);return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"data-center-importer-local-upload-title",variant:"h2",className:o.title},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.ylbMu5",defaultMessage:"Local Machine",description:"Import files into the Data Center from your computer"})})),jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"data-center-importer-local-upload-description",variant:"body2",paragraph:!0,className:o.description},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.OcKW8X",defaultMessage:"Choose files from your computer to import and process within your aiWARE account.",description:"Choose files from your computer to import and process within your aiWARE account."})})),jsxRuntime.exports.jsxs(Card,Object.assign({"data-test":"data-center-importer-local-upload-card",className:a?o.focusedCard:o.card,ref:e=>s.current=e},{children:[jsxRuntime.exports.jsx(Avatar,Object.assign({className:o.iconCircle},{children:jsxRuntime.exports.jsx(default_1,{fontSize:"inherit",className:o.uploadIcon})})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1",className:o.selectMessage},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.vKgOOW",defaultMessage:"Select a file from your computer",description:"Local Machine File Importer: Select a file from your computer to be uploaded into the Data Center"})})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body2",className:o.subtitle},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.9cCClM",defaultMessage:"or drag and drop an image here",description:"Local Machine File Importer: files can be dragged and dropped here to upload them"})})),jsxRuntime.exports.jsx(UploadButton,{id:"local-file-upload-upload-btn",onUpload:e=>{t(Array.from(e.target.files))},render:({handleButtonClick:e})=>jsxRuntime.exports.jsx(Button$1,Object.assign({"data-test":"data-center-importer-local-upload-button",variant:"outlined",className:r.fileButton,style:{marginTop:"15px"},onClick:e},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.261ANF",defaultMessage:"Browse Files",description:"Local Machine File Importer: Click here to select the files to upload"})}))}),jsxRuntime.exports.jsx(Button$1,Object.assign({variant:"text",className:o.fileFormatsButton,onClick:e},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.OVCv+Y",defaultMessage:"View Supported File Formats",description:"Local Machine File Importer: View a list of all the File Formats that can be uploaded"})}))]}))]})},useStyles$4=makeStyles()(e=>({title:{userSelect:"none"},subheader:{userSelect:"none"},locationFolderWrapper:{width:"100%",marginTop:e.spacing(4),padding:e.spacing(2),border:"1px solid #D5DFE9",borderRadius:4,display:"flex",alignItems:"center",position:"relative"},locationFolderWrapperDisabled:{opacity:.7,pointerEvents:"none",userSelect:"none"},spacer:{display:"block",flex:1},folderIcon:{marginRight:e.spacing(2)},folderLabel:{fontFamily:"Nunito",display:"block",color:"#5C6269",fontSize:12,position:"absolute",top:-10,left:e.spacing(1),paddingLeft:e.spacing(1),paddingRight:e.spacing(1),background:"#fff"},folderInputLabel:{fontFamily:"Nunito",cursor:"pointer",color:"#6098D1",fontSize:14,"&:hover":{color:"#1871E8"}}})),LocationFolder=({folder:e,onChangeBtnClick:t,disabled:a=!1})=>{var i=useStyles$4()["classes"];return e?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h2",color:"textPrimary","data-test":"data-center-location-folder-title",className:i.title},{children:SHARED_TEXT.locationFolderTitle()})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body2",color:"textSecondary","data-test":"data-center-location-folder-subheader",className:i.subheader},{children:SHARED_TEXT.locationFolderSubheader()})),jsxRuntime.exports.jsxs("div",Object.assign({"data-test":"data-center-location-folder",className:classnames(i.locationFolderWrapper,a?i.locationFolderWrapperDisabled:null)},{children:[jsxRuntime.exports.jsx("span",Object.assign({className:i.folderLabel,"data-test":"data-center-location-folder-label"},{children:SHARED_TEXT.locationFolderLabel()})),jsxRuntime.exports.jsx(FolderOpen,{className:i.folderIcon}),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"body1",color:"textPrimary","data-test":"data-center-location-folder-path"},{children:null!=e&&e.isRoot?"Home":null==e?void 0:e.name})),jsxRuntime.exports.jsx("span",{className:i.spacer}),jsxRuntime.exports.jsx("span",Object.assign({className:i.folderInputLabel,onClick:t,role:"button","data-test":"data-center-location-select-btn"},{children:SHARED_TEXT.locationFolderReselect()}))]}))]}):null},validateMimeTypes=(e,t)=>{const a=new Set;return null!=e&&e.forEach(e=>{e.type?t.includes(e.type)||a.add(e.type):a.add(e.name.split(".").pop())}),Array.from(a.values())},DEFAULT_MAX_FILE_COUNT=100,MAX_VERITONE_FILE_COUNT_ALLOWED=1e3,MainLayout=({hidePanel:e,activeFolder:t,fileLimit:s=DEFAULT_MAX_FILE_COUNT})=>{var a=useStyles$6()["classes"],i=useSelector(preferredLanguageSelector);const o=useSelector(initialConfigSelector),r=useSelector(selectors.uiState.selectIsFullScreen),n=useSelector(selectSelectedFiles);var l=useSelector(selectUIStateStatus),d=useSelector(selectCurrentView),c=useSelector(rootFolderSelector);const p=useDispatch(),u=react.exports.useCallback(()=>{e&&e()},[e]),m=AIWareFormatMessage(i);react.exports.useEffect(()=>{n&&n.length?p(actions.uiState.setCurrentView(ImporterView.filesSelected)):p(actions.uiState.setCurrentView(ImporterView.browseFiles))},[p,n]),react.exports.useEffect(()=>{o.baseUrl&&(t&&t.id?p(actions.rootFolderState.updateRootFolder({activeFolder:t})):p(actions.rootFolderState.startRootFolderFetch()))},[o,t,p]);var i=e=>{let t=e;var a=EnumHelpers.getNames(MimeType);const i=validateMimeTypes(e,a);0<(null===i||void 0===i?void 0:i.length)&&(p(showMessage({content:m({id:"os-data-center-importer.snackbar.disallowedFilesMessage",defaultMessage:[{type:0,value:"The following file types are not allowed: "},{type:1,value:"disallowedFiles"}]},{disallowedFiles:Array.from(i.values()).join(",")}),severity:MessageSeverity.Warning})),t=e.filter(e=>e.type&&!i.includes(e.type))),e.length>s?(p(showMessage({content:m({id:"os-data-center-importer.snackbar.fileLimitError",defaultMessage:[{type:0,value:"You can only upload files up to "},{type:1,value:"fileLimit"},{type:0,value:" files at once! Only the first "},{type:1,value:"fileLimit"},{type:0,value:" files will be uploaded."}]},{fileLimit:""+s}),severity:MessageSeverity.Warning})),t=e.slice(0,s)):e.length>MAX_VERITONE_FILE_COUNT_ALLOWED&&(p(showMessage({content:m({id:"os-data-center-importer.snackbar.fileCountError",defaultMessage:[{type:0,value:"You have exceeded the maxium allowable files per upload. Only the first "},{type:1,value:"maxFileCount"},{type:0,value:" files will be uploaded."}]},{maxFileCount:""+MAX_VERITONE_FILE_COUNT_ALLOWED}),severity:MessageSeverity.Warning})),t=e.slice(0,MAX_VERITONE_FILE_COUNT_ALLOWED));a=t.map(e=>{var t=URL.createObjectURL(e);return{id:guid(),fileUrl:t,name:e.name,size:e.size,type:e.type,percentComplete:0}});p(actions.filesSelectedState.setFilesSelected({filesSelected:a,sdkFiles:t}))},x=()=>{var e=n.filter(e=>e.status===LoadingStatus.Failed);p(actions.filesSelectedState.retryFileUpload({filesSelected:e}))};const g=()=>{p(actions.uiState.tdoCreateStart({filesSelected:n}))};return jsxRuntime.exports.jsxs("div",Object.assign({role:"presentation","data-test":"data-center-importer-widget",className:classnames(a.root)},{children:[jsxRuntime.exports.jsx(Header,{onPanelClose:u}),jsxRuntime.exports.jsxs("div",Object.assign({className:a.mainContainer},{children:[l===LoadingStatus.Failed&&jsxRuntime.exports.jsx(Box,Object.assign({mb:4},{children:jsxRuntime.exports.jsx(Alert,Object.assign({variant:"outlined",severity:"error",className:a.alert},{children:"Error while uploading your file(s)."}))})),d===ImporterView.browseFiles&&jsxRuntime.exports.jsx(LocalFileUpload,{onViewSupportedFiles:()=>{var e={name:"SUPPORTED_FILE_TYPES",config:{name:"Local Importer",fileTypes:DEFAULT_ACCEPTABLE_FILE_TYPES}},t={type:"APP_BAR_PANEL_TEMPLATE",marginTop:r?0:55,marginStart:r?0:80,size:"medium",zIndex:r?1011:1002,parentPanelId:"DATA_CENTER_IMPORTER",dimmed:0,dimmedStatus:"dimParent"};p(mountPanel({panelId:"SUPPORTED_FILE_TYPES_PANEL",microFrontend:e,panelConfig:t}))},onUpload:i}),d===ImporterView.filesSelected&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(FileItemList,{onUpload:i,fileItems:n,onDelete:e=>{p(actions.filesSelectedState.deleteFileSelected({id:e}))},onRetryFailedsClick:x,onRetry:e=>{e.status===LoadingStatus.Failed?p(actions.filesSelectedState.retryFileUpload({filesSelected:[e]})):e.tdoStatus===LoadingStatus.Failed&&p(actions.uiState.retryTDOCreateForFiles({filesSelected:[e]}))},onAbort:e=>{p(actions.filesSelectedState.abortFileUpload(e))},onEdit:e=>{var e={name:"EDIT_FILE_METADATA",config:{name:"Local Importer",file:e=e}},t={type:"APP_BAR_PANEL_TEMPLATE",marginTop:r?0:55,marginStart:r?0:80,size:"small",zIndex:r?1011:1002,parentPanelId:"DATA_CENTER_IMPORTER",dimmed:0,dimmedStatus:"dimParent"};p(mountPanel({panelId:"EDIT_FILE_METADATA",microFrontend:e,panelConfig:t}))},uiStateStatus:l}),jsxRuntime.exports.jsx("div",{className:a.spacer}),jsxRuntime.exports.jsx(LocationFolder,{folder:c,onChangeBtnClick:()=>__awaiter(void 0,void 0,void 0,function*(){try{yield mountPanelForResponse({panelId:"DATA_CENTER_FOLDERS_AND_FILES",microFrontend:{name:"DATA_CENTER_FOLDERS_AND_FILES",config:{viewType:"folders"}},panelConfig:{panelId:"DATA_CENTER_FOLDERS_AND_FILES",disableHide:!1,parentPanelId:"DATA_CENTER_IMPORTER",type:"APP_BAR_PANEL_TEMPLATE",size:"small",marginTop:r?0:55,marginStart:r?0:80,height:600,header:{title:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.headerTitle.chooseLocation",defaultMessage:"Choose a Location",description:"The title for the choose location panel"})},dimmed:0,zIndex:r?1011:1002,dimmedStatus:"dimParent"}},store)}catch(e){console.log(e)}})})]}),jsxRuntime.exports.jsx(Footer,{uiStateStatus:l,fileItems:n,onClosePanel:()=>{if(n.length)for(const e of n)e.status===LoadingStatus.Pending&&p(actions.filesSelectedState.abortFileUpload(e));u()},onImportFiles:g,onIgnoreAndContinue:()=>{p(actions.filesSelectedState.deleteFailedFiles()),g()},onRetry:x})]}))]}))},DataCenterImporter=e=>jsxRuntime.exports.jsx(CacheProvider,Object.assign({value:muiCache},{children:jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(lib.DynamicModuleLoader,Object.assign({modules:[getDataCenterImporterModule()]},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(MainLayout,Object.assign({},e))})}))})})),useStyles$3=makeStyles()(e=>({supportedFilesTypeHeader:{display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"space-between",padding:"0px 10px",marginBottom:20},supportedFilesTypeWrapper:{padding:"8px 20px 20px 20px"},fileTypeItem:{border:"1px solid #D5DFE9",borderRadius:5,marginBottom:20,overflow:"hidden"},fileTypeItemHeader:{padding:18,borderBottom:"1px solid #D5DFE9",background:"#FAFAFA",display:"flex",alignItems:"center"},fileTypeItemBody:{display:"flex",alignItems:"center",padding:"26px 0",flexWrap:"wrap"},fileTypeItemExtension:{width:"50%",padding:"4px 0 4px 54px"},fileTypeItemExtensionFullWidth:{width:"100%"},fileItemTypeName:{marginLeft:12}})),FileTypeItem=({fileItemType:a})=>{var e;const i=useStyles$3()["classes"];return jsxRuntime.exports.jsxs("div",Object.assign({className:i.fileTypeItem,"data-test":"data-center-importer-supported-file-item"},{children:[jsxRuntime.exports.jsxs("header",Object.assign({className:i.fileTypeItemHeader},{children:[jsxRuntime.exports.jsx("span",Object.assign({"data-test":"data-center-importer-file-item-icon"},{children:jsxRuntime.exports.jsx(FileItemIcon,{filetype:a.type})})),jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h2",color:"textPrimary",className:i.fileItemTypeName,"data-test":"data-center-importer-file-type-name"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-browse.fileTypes.${name}",defaultMessage:"{name}",description:"Label for {name} type",values:{name:a.name}})}))]})),jsxRuntime.exports.jsx("div",Object.assign({className:i.fileTypeItemBody,"data-test":"data-center-importer-extension-list"},{children:null==(e=null==a?void 0:a.extensions)?void 0:e.map((e,t)=>jsxRuntime.exports.jsxs(Typography,Object.assign({variant:"body2",color:"textPrimary",className:classnames(i.fileTypeItemExtension,{[i.fileTypeItemExtensionFullWidth]:a.type===FileItemTypeNames.Text})},{children:[".",e]}),t))}))]}))},SupportedFileTypesContent=({fileTypes:e,hidePanel:t})=>{var a=useStyles$3()["classes"];return jsxRuntime.exports.jsxs("div",Object.assign({className:a.supportedFilesTypeWrapper},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:a.supportedFilesTypeHeader},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({variant:"h1",color:"secondary","data-test":"data-center-importer-supported-files-title"},{children:SHARED_TEXT.supportedFilesTitle()})),jsxRuntime.exports.jsx(Tooltip$1,Object.assign({title:SHARED_TEXT.closePanel()},{children:jsxRuntime.exports.jsx(IconButton$1,Object.assign({onClick:t,"aria-labelledby":"data-center-importer-close-panel","data-test":"data-center-importer-close-panel",size:"large"},{children:jsxRuntime.exports.jsx(Close,{})}))}))]})),e.map((e,t)=>jsxRuntime.exports.jsx(FileTypeItem,{fileItemType:e},t))]}))},SupportedFileTypes=e=>jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(CacheProvider,Object.assign({value:muiCache},{children:jsxRuntime.exports.jsx(SupportedFileTypesContent,{hidePanel:e.hidePanel,fileTypes:e.fileTypes})}))})}),inputFieldBorderColor="#D5DFE9",useStyles$2=makeStyles()(e=>({editMetadataContainer:{padding:"5px 30px"},avatarImage:{display:"flex",justifyContent:"center",alignItems:"center",width:"135px",height:"119px",marginRight:"10px"},coverImage:{flexGrow:1,display:"flex",justifyContent:"center",alignItems:"center",height:"119px"},inputFieldBorder:{border:"1px solid "+inputFieldBorderColor},fileName:{width:"100%",border:"1px solid "+inputFieldBorderColor,height:"52px",borderRadius:"4px",boxSizing:"border-box",padding:"15px"},tagInput:{marginRight:"10px",flexGrow:1},tags:{paddingLeft:"0px","& > li":{listStyleType:"none",display:"inline",marginRight:"5px"}},tag:{backgroundColor:"#D5DFE9",fontSize:"12px",marginBottom:"5px"},runDate:{marginRight:"5px"},runTime:{"& input":{padding:"18.5px 10px !important"}},cancelBtn:{marginRight:e.spacing(2)},header:{display:"flex",alignItems:"center",flexDirection:"row",justifyContent:"space-between",padding:"0px"},footer:{position:"absolute",right:"30px",bottom:e.spacing(6)},topMarginSm:{marginTop:"15px"},topMarginLg:{marginTop:"15px"},flex:{display:"flex"},flexFill:{flexGrow:1},heading:{color:"#2A323C",fontSize:"14px",fontWeight:600,lineHeight:"20px"},subHeading:{color:"#5C6269",fontSize:"14px",fontWeight:"normal",lineHeight:"20px"},closePanel:{transform:"translateX(15px)"}})),useStyles$1=makeStyles()(e=>({container:{position:"relative",borderRadius:"5px",zIndex:2}})),AddImageIcon=({id:e,color:t="black",size:a=55})=>{var i=useStyles$1()["classes"];return jsxRuntime.exports.jsx("div",Object.assign({id:"addImageIcon-"+e,className:i.container},{children:jsxRuntime.exports.jsx("svg",Object.assign({version:"1.2",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 500",width:a,height:a},{children:jsxRuntime.exports.jsx("path",{fill:t,fillRule:"evenodd",d:"M249.5 62c147.7 0 151.1 0 157.5 1.9 3.6 1.1 8.9 3.7 11.9 5.8 3 2.1 7.3 6.1 9.6 8.8 2.3 2.7 5.2 7.7 9 17l.3 101c.1 55.6.1 101.4-.2 102-.2.7-4.1.6-11.2-.3-6-.7-14-1-17.9-.7-3.9.3-8.4.8-13 1.6V104.5h-291v291H297l-.7 8c-.5 4.4-.8 9.8-.8 12 0 2.2.4 8.2 1.5 22.5h-97.3c-82.7 0-98.2-.3-104.2-1.5-3.8-.9-9-2.8-11.5-4.2-2.5-1.5-6-4.1-7.9-5.8-1.9-1.6-5.2-5.7-7.3-9-2.5-3.9-4.4-8.5-5.4-13-1.3-6.1-1.4-26.2-.9-309l2.4-6c1.4-3.3 4.3-8.3 6.6-11 2.3-2.8 6.6-6.7 9.6-8.8 3-2.1 8.1-4.6 11.4-5.7 5.8-1.8 11.6-1.9 157-2zm45.4 185c.3 0 12.2 15.8 52.6 70.3l-4 3.1c-2.2 1.7-7.7 6.7-12.3 11.1-4.6 4.4-10.6 11.3-18.7 22.5h-93.8c-90.2 0-93.7-.1-92.5-1.8.7-1 14.7-19 31-40 16.4-21 30-38.2 30.3-38.2.3 0 7.8 8.9 16.7 19.8 8.9 10.8 18.7 22.7 21.7 26.5 3.1 3.7 5.8 6.7 6.1 6.7.3-.1 14.4-18.1 31.4-40.1 17-21.9 31.2-39.9 31.5-39.9zm122.6 87.5c13.3.3 15.8.7 22 3 3.9 1.5 9.3 3.8 12 5.2 2.8 1.4 8.4 5.1 12.4 8.2 4.1 3.1 10 8.7 13.1 12.6 3 3.9 7.1 10.1 9.1 14 2 3.9 4.7 9.9 6 13.5 2.1 5.9 2.3 8.2 2.3 24.5s-.2 18.6-2.3 24.5c-1.3 3.6-4 9.6-6 13.5-2 3.9-6.1 10.1-9.1 14-3.1 3.9-9 9.5-13.1 12.5-4 3.1-9.6 6.7-12.4 8.2-2.7 1.5-8.1 3.9-12 5.4-6.8 2.7-7.6 2.8-26 2.8s-19.2-.1-26-2.8c-3.9-1.5-9.2-3.9-12-5.3-2.7-1.4-8.4-5.1-12.4-8.2-4.1-3.1-10-8.7-13.1-12.6-3-3.9-7.1-10.1-9.1-14-2-3.9-4.7-9.9-6-13.5-2.1-5.9-2.3-8.2-2.3-24.5s.2-18.6 2.3-24.5c1.3-3.6 4-9.6 6-13.5 2-3.9 6.1-10.1 9.1-14 3.1-3.9 9-9.5 13.1-12.5 4-3.1 9.7-6.7 12.4-8.2 2.8-1.4 7.5-3.6 10.5-4.8 3-1.2 8-2.6 11-3 3-.5 12.3-.7 20.5-.5zM390 355.6c-3.6 1.6-8.5 4-11 5.4-2.5 1.4-7.4 5.4-11 9-3.9 3.8-8.2 9.6-10.6 14-2.3 4.1-5 10-6 13-1.3 4.2-1.8 8.7-1.8 18.5s.5 14.3 1.8 18.5c1 3 3.7 8.9 5.9 13 2.7 4.8 6.8 10.1 11.3 14.5 5.2 5.1 9.3 8.1 15.5 11.1 4.6 2.3 10.2 4.7 12.4 5.5 2.5.8 8.8 1.3 17 1.3s14.5-.5 17-1.3c2.2-.8 7.8-3.2 12.4-5.5 6.5-3.1 10.2-5.9 16-11.7 5.8-5.7 8.6-9.6 11.8-16 2.3-4.6 4.7-10.2 5.4-12.4.7-2.4 1.3-9.3 1.3-17 0-7.7-.6-14.6-1.3-17-.7-2.2-3.1-7.8-5.4-12.4-3.2-6.4-6-10.3-11.8-16-5.6-5.7-9.6-8.6-15.5-11.5-4.3-2.1-9.7-4.5-11.9-5.3-2.2-.7-8.5-1.5-14-1.7-5.5-.3-12.5-.1-15.5.3s-8.4 2.1-12 3.7zm15 18.4h17v33h33v17h-33v33h-17v-33h-33v-17h33z"})}))}))},useStyles=makeStyles()(e=>({addImageBoxContainer:{display:"flex",justifyContent:"flex-start",flexDirection:"column"},addImageBoxTitle:{padding:"0px",margin:"0px",color:"rgb(92, 98, 105)",fontSize:"12px",fontWeight:400,textAlign:"left",paddingLeft:"5px",paddingBottom:"3px"},addImageBoxSizeAvatar:{width:"135px"},addImageBoxSizeCover:{width:"100%"},addImageBoxIconDiv:{height:"180px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #D5DFE9",overflow:"hidden",position:"relative",textAlign:"left",borderRadius:"4px"},addImageBoxBackground:{position:"absolute",height:"100%",width:"100%",top:0,left:0,backgroundSize:"cover"},addImageBoxShadow:{background:"rgba(0,0,0,0.35)",position:"absolute",width:"100%",height:"100%",zIndex:1},iconButtonContainer:{width:"100%",padding:0},deleteIconContainer:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"transparent",zIndex:10,display:"flex",justifyContent:"center",alignItems:"center"},deleteIcon:{color:"white",fontSize:"24px"}})),AddImageBox=({title:e,backgroundImgUrl:t="",aspectRatio:a="avatar",onClick:i,onDelete:s})=>{var o=useStyles()["classes"];const[r,n]=react.exports.useState(!1);var l=!!t,d=r&&t,c=r&&t,p=!t||r&&t,u=t?{backgroundImage:`url(${t})`}:{};return jsxRuntime.exports.jsxs("div",Object.assign({className:o.addImageBoxContainer},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({id:`file-item-meta-${a}-image-title`,variant:"body2",className:o.addImageBoxTitle,color:"secondary","data-test":`file-item-meta-${a}-image-title`},{children:e})),jsxRuntime.exports.jsx(Button$1,Object.assign({className:o.iconButtonContainer,onClick:i},{children:jsxRuntime.exports.jsxs("div",Object.assign({onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),className:o.addImageBoxIconDiv+" "+("avatar"===a?o.addImageBoxSizeAvatar:o.addImageBoxSizeCover)},{children:[p&&!c&&jsxRuntime.exports.jsx(AddImageIcon,{id:`add-${a}-img`,color:t?"#fff":"#2A323C",size:45}),c&&jsxRuntime.exports.jsx("div",Object.assign({className:o.deleteIconContainer,onClick:s},{children:jsxRuntime.exports.jsx(default_1$4,{style:{fontSize:42},className:o.deleteIcon,color:"inherit"})})),d&&jsxRuntime.exports.jsx("div",{className:o.addImageBoxShadow}),l&&jsxRuntime.exports.jsx("div",{className:o.addImageBoxBackground,style:u})]}))}))]}))},FileItemMeta=({file:t,onSave:a,onCancel:e,onClosePanel:i})=>{const s=useStyles$2()["classes"];var o=useSelector(preferredLanguageSelector);const[r,n]=react.exports.useState(null),[l,d]=react.exports.useState(""),[c,p]=react.exports.useState(""),[u,m]=react.exports.useState((()=>{var[e,t,a]=(new Date).toLocaleDateString("en-US",{year:"numeric",month:"2-digit",day:"2-digit"}).split("/");return a+`-${e}-`+t})()),[x,g]=react.exports.useState((()=>{const[e,t]=(new Date).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}).split(":");return e+":"+t.slice(0,2)})()),[f,j]=react.exports.useState([]),h=AIWareFormatMessage(o);react.exports.useEffect(()=>{var e;t&&(e=t["meta"],n(null==e?void 0:e.thumbnailImg),d(null!=e&&e.fileName?e.fileName:t.name),null!=e&&e.runDate&&m(null==e?void 0:e.runDate),null!=e&&e.runTime&&g(null==e?void 0:e.runTime),j((null==e?void 0:e.tags)||[]))},[t]);var o=react.exports.useCallback(()=>{var e;a&&(e={fileId:null==t?void 0:t.id,fileName:l,thumbnailImg:r,runDate:u,runTime:x,tags:f},a(e))},[a,l,u,x,f,r,t]),y=react.exports.useCallback(()=>{e&&(F(),e())},[e]),S=react.exports.useCallback(()=>{i&&(F(),i())},[i]);const v=react.exports.useCallback(()=>{if(c){const t=function(e){const t=e.includes(",")?e.split(","):[e],a=f.map(e=>e.value),i=[];return null===t||void 0===t||t.forEach(e=>{e=e.trim();""===e||a.includes(e)||(i.push({value:e}),a.push(e))}),i}(c);j(e=>[...e,...t]),p("")}},[c]),b=()=>{n(null)};return jsxRuntime.exports.jsxs("div",Object.assign({className:s.editMetadataContainer},{children:[jsxRuntime.exports.jsxs("header",Object.assign({className:s.header},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({id:"file-item-meta-title",variant:"h1",color:"secondary","data-test":"file-item-meta-title"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.WUHjl4",defaultMessage:"Edit Metadata",description:"Edit Metadata"})})),jsxRuntime.exports.jsx(Tooltip$1,Object.assign({title:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.kOsSpC",defaultMessage:"Close Panel",description:"Close Panel"})},{children:jsxRuntime.exports.jsx(IconButton$1,Object.assign({id:"file-item-meta-close-panel",onClick:S,"aria-labelledby":"file-item-meta-close-panel","data-test":"file-item-meta-close-panel",className:s.closePanel,size:"large"},{children:jsxRuntime.exports.jsx(Close,{})}))}))]})),jsxRuntime.exports.jsx("section",{children:jsxRuntime.exports.jsx(UploadButton,{id:"file-item-meta-avatar-image-upload",imageOnly:!0,onUpload:e=>{e=e.target.files[0],t=URL.createObjectURL(e);var t,e=t={id:guid(),fileUrl:t,name:e.name,size:e.size,type:e.type,percentComplete:0};n(e)},isUploadEnabled:!r,render:({handleButtonClick:e})=>jsxRuntime.exports.jsx(AddImageBox,{title:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.uK8+3P",defaultMessage:"Thumbnail Image",description:"Thumbnail Image"}),backgroundImgUrl:r?null===r||void 0===r?void 0:r.fileUrl:"",aspectRatio:"cover",onClick:e,onDelete:b})})}),jsxRuntime.exports.jsx("section",Object.assign({className:s.topMarginSm},{children:jsxRuntime.exports.jsx(TextField,{id:"file-item-meta-file-name",InputLabelProps:{shrink:!0},autoComplete:"off",label:h({id:"os-data-center-importer.label.fileName",defaultMessage:[{type:0,value:"File name"}]}),value:l,style:{width:"100%"},onChange:e=>{d(e.target.value)}})})),jsxRuntime.exports.jsxs("section",Object.assign({className:s.topMarginLg},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"file-item-meta-display-time-heading",variant:"subtitle1",color:"textSecondary",className:s.heading},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.8aqtJF",defaultMessage:"Media Display Time",description:"Media Display Time heading"})})),jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"file-item-meta-display-time-sub-heading",variant:"subtitle2",color:"textSecondary",className:s.subHeading},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.mhUvxM",defaultMessage:"The actual time the content occurred.",description:"Media Display Time sub heading"})})),jsxRuntime.exports.jsxs("div",Object.assign({className:s.topMarginSm+" "+s.flex},{children:[jsxRuntime.exports.jsx(TextField,{id:"file-item-meta-run-date",label:h({id:"os-data-center-importer.label.runDate",defaultMessage:[{type:0,value:"Run Date"}]}),type:"date",value:u,className:s.runDate,onChange:e=>m(e.target.value),InputLabelProps:{shrink:!0}}),jsxRuntime.exports.jsx(TextField,{id:"file-item-meta-run-time",label:h({id:"os-data-center-importer.label.runTime",defaultMessage:[{type:0,value:"Run Time"}]}),type:"time",value:x,onChange:e=>g(e.target.value),className:s.runTime,InputLabelProps:{shrink:!0}})]}))]})),jsxRuntime.exports.jsxs("section",Object.assign({className:s.topMarginLg},{children:[jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"file-item-meta-tags-heading",variant:"subtitle1",color:"textSecondary",className:s.heading},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.fXL811",defaultMessage:"Tags",description:"Tags heading"})})),jsxRuntime.exports.jsx(Typography,Object.assign({"data-test":"file-item-meta-tags-sub-heading",variant:"subtitle2",color:"textSecondary",className:s.subHeading},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.WFj+x5",defaultMessage:"Add searchable tags to better organize this data. Separate each tag with a comma.",description:"Tags sub heading"})})),jsxRuntime.exports.jsxs("div",Object.assign({className:s.topMarginSm+" "+s.flex},{children:[jsxRuntime.exports.jsx(TextField,{id:"file-item-meta-tags",autoComplete:"off",value:c,className:s.tagInput,onChange:e=>{p(e.target.value)},size:"small",onKeyPress:e=>{"Enter"===e.key&&v()}}),jsxRuntime.exports.jsx(Button$1,Object.assign({id:"file-item-meta-tags-addBtn",variant:"outlined",color:"primary",disabled:!c,onClick:v},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.rntBSe",defaultMessage:"Add",description:"Add tags to metadata"})}))]})),jsxRuntime.exports.jsx("ul",Object.assign({id:"tags",className:s.tags+" "+s.topMarginSm},{children:null===f||void 0===f?void 0:f.map(t=>jsxRuntime.exports.jsx("li",{children:jsxRuntime.exports.jsx(Chip$1,{id:guid(),label:t.value,size:"small",className:s.tag,onDelete:()=>{j(f.filter(e=>e.value!==t.value))}})},t.value))}))]})),jsxRuntime.exports.jsxs("footer",Object.assign({className:s.footer},{children:[jsxRuntime.exports.jsx(Button$1,Object.assign({id:"file-item-meta-cancel-btn",onClick:y,variant:"text",size:"large",className:s.cancelBtn,"data-test":"file-item-meta-cancel-btn"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.6PdOcy",defaultMessage:"Cancel",description:"Cancel"})})),jsxRuntime.exports.jsx(Button$1,Object.assign({id:"file-item-meta-save-btn",onClick:o,disabled:!1,size:"large",variant:"contained",color:"primary","data-test":"file-item-meta-save-btn"},{children:jsxRuntime.exports.jsx(FormattedMessage,{id:"os-data-center-importer.kxBKrN",defaultMessage:"Save Changes",description:"Save file metadata changes"})}))]}))]}));function F(){n(null),d(""),m("2021-12-22"),g("12:00"),j([])}},FileItemMetaContainer=({hidePanel:e,file:t})=>{const a=useDispatch();var i=useSelector(selectUIStateStatus);return jsxRuntime.exports.jsx(FileItemMeta,{file:t,status:i,onSave:function(e){e&&a(actions.filesSelectedState.addMetadataAction({id:null==t?void 0:t.id,meta:e}))},onCancel:function(){e()},onClosePanel:function(){e()}})},EditFileMetadata=e=>jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(CacheProvider,Object.assign({value:muiCache},{children:jsxRuntime.exports.jsx(FileItemMetaContainer,Object.assign({},e))}))})});export{DataCenterImporter,EditFileMetadata,SupportedFileTypes};
|
|
1
|
+
import{H as createSlice,cf as combineReducers,cg as createSelector,O as rootApiSelector,R as graphEndpointSelector,Q as sessionTokenSelector,m as makeStyles,i as useDispatch,r as react,j as jsxRuntime,bx as CacheProvider,by as muiCache,ci as AIWareThemeProvider,K as lib,A as AIWareIntlProvider,k as useSelector,B as Box$1,bE as CircularProgress$1,fB as img$r,T as Typography$1,at as Button$1,a2 as all,F as FormattedMessage,a8 as Tooltip,a9 as IconButton,gd as AddUser,cu as MoreVert,cj as Close,bV as Hide,cv as Menu,aW as MenuItem,cy as Delete,b0 as Tabs,b1 as Tab,af as takeLatest$1,ge as Modal,L as LoadingButton,w as TextField,aV as Select,ai as select,ah as put,M as preferredLanguageSelector,bW as showMessage,bX as MessageSeverity,v as FormControl,aq as FormControlLabel,ar as Checkbox,bI as Icon,cx as Upload,bP as FormHelperText,eo as hidePanel,b4 as AIWareFormatMessage,fi as selectApiConfigs$2,p as lodash,cD as baseGraphQLApiWithError}from"./js-core.esm.js";import{f as find_1}from"./js-core.esm14.js";import{d as default_1}from"./js-core.esm36.js";import{B as Box}from"./js-core.esm24.js";!function(){var e={};try{if(process)return process.env=Object.assign({},process.env),Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}}();var match,version,store,wmget,wmhas,wmset,set$1,get,has,STATE,LoadingStatus,ESourcePermission,commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},check=function(e){return e&&e.Math==Math&&e},global$o=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||function(){return this}()||Function("return this")(),objectGetOwnPropertyDescriptor={},fails$j=function(e){try{return!!e()}catch(e){return!0}},fails$i=fails$j,descriptors=!fails$j(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),fails$h=fails$j,functionBindNative=!fails$j(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),NATIVE_BIND$3=functionBindNative,call$j=Function.prototype.call,functionCall=NATIVE_BIND$3?call$j.bind(call$j):function(){return call$j.apply(call$j,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$3=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$3&&!$propertyIsEnumerable.call({1:2},1),createPropertyDescriptor$5=(objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){e=getOwnPropertyDescriptor$3(this,e);return!!e&&e.enumerable}:$propertyIsEnumerable,function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}),NATIVE_BIND$2=functionBindNative,FunctionPrototype$2=Function.prototype,bind$8=FunctionPrototype$2.bind,call$i=FunctionPrototype$2.call,uncurryThis$l=NATIVE_BIND$2&&bind$8.bind(call$i,call$i),functionUncurryThis=NATIVE_BIND$2?function(e){return e&&uncurryThis$l(e)}:function(e){return e&&function(){return call$i.apply(e,arguments)}},uncurryThis$k=functionUncurryThis,toString$6=uncurryThis$k({}.toString),stringSlice$5=uncurryThis$k("".slice),classofRaw$1=function(e){return stringSlice$5(toString$6(e),8,-1)},uncurryThis$j=functionUncurryThis,fails$g=fails$j,classof$8=classofRaw$1,$Object$4=Object,split$3=functionUncurryThis("".split),indexedObject=fails$g(function(){return!$Object$4("z").propertyIsEnumerable(0)})?function(e){return"String"==classof$8(e)?split$3(e,""):$Object$4(e)}:$Object$4,$TypeError$c=TypeError,requireObjectCoercible$4=function(e){if(null==e)throw $TypeError$c("Can't call method on "+e);return e},IndexedObject$1=indexedObject,requireObjectCoercible$3=requireObjectCoercible$4,toIndexedObject$5=function(e){return IndexedObject$1(requireObjectCoercible$3(e))},isCallable$m=function(e){return"function"==typeof e},isCallable$l=isCallable$m,isObject$9=function(e){return"object"==typeof e?null!==e:isCallable$l(e)},global$n=global$o,isCallable$k=isCallable$m,aFunction=function(e){return isCallable$k(e)?e:void 0},getBuiltIn$8=function(e,t){return arguments.length<2?aFunction(global$n[e]):global$n[e]&&global$n[e][t]},uncurryThis$i=functionUncurryThis,objectIsPrototypeOf=functionUncurryThis({}.isPrototypeOf),getBuiltIn$7=getBuiltIn$8,engineUserAgent=getBuiltIn$8("navigator","userAgent")||"",global$m=global$o,userAgent$3=engineUserAgent,process$4=global$m.process,Deno$1=global$m.Deno,versions=process$4&&process$4.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8,engineV8Version=version=!(version=v8?0<(match=v8.split("."))[0]&&match[0]<4?1:+(match[0]+match[1]):version)&&userAgent$3&&(!(match=userAgent$3.match(/Edge\/(\d+)/))||74<=match[1])&&(match=userAgent$3.match(/Chrome\/(\d+)/))?+match[1]:version,V8_VERSION$1=engineV8Version,fails$f=fails$j,nativeSymbol=!!Object.getOwnPropertySymbols&&!fails$f(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&V8_VERSION$1&&V8_VERSION$1<41}),NATIVE_SYMBOL$1=nativeSymbol,useSymbolAsUid=nativeSymbol&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,getBuiltIn$6=getBuiltIn$8,isCallable$j=isCallable$m,isPrototypeOf$2=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$3=Object,isSymbol$2=useSymbolAsUid?function(e){return"symbol"==typeof e}:function(e){var t=getBuiltIn$6("Symbol");return isCallable$j(t)&&isPrototypeOf$2(t.prototype,$Object$3(e))},$String$3=String,tryToString$4=function(e){try{return $String$3(e)}catch(e){return"Object"}},isCallable$i=isCallable$m,tryToString$3=tryToString$4,$TypeError$b=TypeError,aCallable$7=function(e){if(isCallable$i(e))return e;throw $TypeError$b(tryToString$3(e)+" is not a function")},aCallable$6=aCallable$7,getMethod$4=function(e,t){e=e[t];return null==e?void 0:aCallable$6(e)},call$h=functionCall,isCallable$h=isCallable$m,isObject$8=isObject$9,$TypeError$a=TypeError,ordinaryToPrimitive$1=function(e,t){var r,n;if("string"===t&&isCallable$h(r=e.toString)&&!isObject$8(n=call$h(r,e)))return n;if(isCallable$h(r=e.valueOf)&&!isObject$8(n=call$h(r,e)))return n;if("string"!==t&&isCallable$h(r=e.toString)&&!isObject$8(n=call$h(r,e)))return n;throw $TypeError$a("Can't convert object to primitive value")},shared$4={exports:{}},isPure=!1,global$l=global$o,defineProperty$6=Object.defineProperty,defineGlobalProperty$3=function(t,r){try{defineProperty$6(global$l,t,{value:r,configurable:!0,writable:!0})}catch(e){global$l[t]=r}return r},global$k=global$o,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$o[SHARED]||defineGlobalProperty$2(SHARED,{}),sharedStore=store$3,store$2=sharedStore,requireObjectCoercible$2=((shared$4.exports=function(e,t){return store$2[e]||(store$2[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.24.1",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.24.1/LICENSE",source:"https://github.com/zloirock/core-js"}),requireObjectCoercible$4),$Object$2=Object,toObject$4=function(e){return $Object$2(requireObjectCoercible$2(e))},uncurryThis$h=functionUncurryThis,toObject$3=toObject$4,hasOwnProperty=functionUncurryThis({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,t){return hasOwnProperty(toObject$3(e),t)},uncurryThis$g=functionUncurryThis,id=0,postfix=Math.random(),toString$5=uncurryThis$g(1..toString),uid$2=function(e){return"Symbol("+(void 0===e?"":e)+")_"+toString$5(++id+postfix,36)},global$j=global$o,shared$3=shared$4.exports,hasOwn$b=hasOwnProperty_1,uid$1=uid$2,NATIVE_SYMBOL=nativeSymbol,USE_SYMBOL_AS_UID=useSymbolAsUid,WellKnownSymbolsStore=shared$3("wks"),Symbol$1=global$j.Symbol,symbolFor=Symbol$1&&Symbol$1.for,createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$1:Symbol$1&&Symbol$1.withoutSetter||uid$1,wellKnownSymbol$i=function(e){var t;return hasOwn$b(WellKnownSymbolsStore,e)&&(NATIVE_SYMBOL||"string"==typeof WellKnownSymbolsStore[e])||(t="Symbol."+e,NATIVE_SYMBOL&&hasOwn$b(Symbol$1,e)?WellKnownSymbolsStore[e]=Symbol$1[e]:WellKnownSymbolsStore[e]=(USE_SYMBOL_AS_UID&&symbolFor?symbolFor:createWellKnownSymbol)(t)),WellKnownSymbolsStore[e]},call$g=functionCall,isObject$7=isObject$9,isSymbol$1=isSymbol$2,getMethod$3=getMethod$4,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$h=wellKnownSymbol$i,$TypeError$9=TypeError,TO_PRIMITIVE=wellKnownSymbol$i("toPrimitive"),toPrimitive$1=function(e,t){if(!isObject$7(e)||isSymbol$1(e))return e;var r=getMethod$3(e,TO_PRIMITIVE);if(r){if(r=call$g(r,e,t=void 0===t?"default":t),!isObject$7(r)||isSymbol$1(r))return r;throw $TypeError$9("Can't convert object to primitive value")}return ordinaryToPrimitive(e,t=void 0===t?"number":t)},toPrimitive=toPrimitive$1,isSymbol=isSymbol$2,toPropertyKey$3=function(e){e=toPrimitive(e,"string");return isSymbol(e)?e:e+""},global$i=global$o,isObject$6=isObject$9,document$3=global$o.document,EXISTS$1=isObject$6(document$3)&&isObject$6(document$3.createElement),documentCreateElement$2=function(e){return EXISTS$1?document$3.createElement(e):{}},DESCRIPTORS$c=descriptors,fails$e=fails$j,createElement$1=documentCreateElement$2,ie8DomDefine=!descriptors&&!fails$j(function(){return 7!=Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a}),DESCRIPTORS$b=descriptors,call$f=functionCall,propertyIsEnumerableModule$1=objectPropertyIsEnumerable,createPropertyDescriptor$4=createPropertyDescriptor$5,toIndexedObject$4=toIndexedObject$5,toPropertyKey$2=toPropertyKey$3,hasOwn$a=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,objectDefineProperty=(objectGetOwnPropertyDescriptor.f=DESCRIPTORS$b?$getOwnPropertyDescriptor$1:function(e,t){if(e=toIndexedObject$4(e),t=toPropertyKey$2(t),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$1(e,t)}catch(e){}if(hasOwn$a(e,t))return createPropertyDescriptor$4(!call$f(propertyIsEnumerableModule$1.f,e,t),e[t])},{}),DESCRIPTORS$a=descriptors,fails$d=fails$j,v8PrototypeDefineBug=descriptors&&fails$j(function(){return 42!=Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),isObject$5=isObject$9,$String$2=String,$TypeError$8=TypeError,anObject$f=function(e){if(isObject$5(e))return e;throw $TypeError$8($String$2(e)+" is not an object")},DESCRIPTORS$9=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$e=anObject$f,toPropertyKey$1=toPropertyKey$3,$TypeError$7=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable",DESCRIPTORS$8=(objectDefineProperty.f=DESCRIPTORS$9?V8_PROTOTYPE_DEFINE_BUG$1?function(e,t,r){var n;return anObject$e(e),t=toPropertyKey$1(t),anObject$e(r),"function"==typeof e&&"prototype"===t&&"value"in r&&WRITABLE in r&&!r[WRITABLE]&&((n=$getOwnPropertyDescriptor(e,t))&&n[WRITABLE]&&(e[t]=r.value,r={configurable:(CONFIGURABLE$1 in r?r:n)[CONFIGURABLE$1],enumerable:(ENUMERABLE in r?r:n)[ENUMERABLE],writable:!1})),$defineProperty(e,t,r)}:$defineProperty:function(e,t,r){if(anObject$e(e),t=toPropertyKey$1(t),anObject$e(r),IE8_DOM_DEFINE)try{return $defineProperty(e,t,r)}catch(e){}if("get"in r||"set"in r)throw $TypeError$7("Accessors not supported");return"value"in r&&(e[t]=r.value),e},descriptors),definePropertyModule$5=objectDefineProperty,createPropertyDescriptor$3=createPropertyDescriptor$5,createNonEnumerableProperty$5=DESCRIPTORS$8?function(e,t,r){return definePropertyModule$5.f(e,t,createPropertyDescriptor$3(1,r))}:function(e,t,r){return e[t]=r,e},makeBuiltIn$3={exports:{}},DESCRIPTORS$7=descriptors,hasOwn$9=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$7&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$9(FunctionPrototype$1,"name"),PROPER=EXISTS&&"something"===function(){}.name,CONFIGURABLE=EXISTS&&(!DESCRIPTORS$7||getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS:EXISTS,PROPER:PROPER,CONFIGURABLE:CONFIGURABLE},uncurryThis$f=functionUncurryThis,isCallable$g=isCallable$m,store$1=sharedStore,functionToString=functionUncurryThis(Function.toString),inspectSource$4=(isCallable$g(store$1.inspectSource)||(store$1.inspectSource=function(e){return functionToString(e)}),store$1.inspectSource),global$h=global$o,isCallable$f=isCallable$m,inspectSource$3=inspectSource$4,WeakMap$1=global$o.WeakMap,nativeWeakMap=isCallable$f(WeakMap$1)&&/native code/.test(inspectSource$3(WeakMap$1)),shared$2=shared$4.exports,uid=uid$2,keys=shared$2("keys"),sharedKey$3=function(e){return keys[e]||(keys[e]=uid(e))},hiddenKeys$4={},NATIVE_WEAK_MAP=nativeWeakMap,global$g=global$o,uncurryThis$e=functionUncurryThis,isObject$4=isObject$9,createNonEnumerableProperty$4=createNonEnumerableProperty$5,hasOwn$8=hasOwnProperty_1,shared$1=sharedStore,sharedKey$2=sharedKey$3,hiddenKeys$3=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$4=global$g.TypeError,WeakMap=global$g.WeakMap,enforce=function(e){return has(e)?get(e):set$1(e,{})},getterFor=function(t){return function(e){if(isObject$4(e)&&(e=get(e)).type===t)return e;throw TypeError$4("Incompatible receiver, "+t+" required")}},internalState=(has=NATIVE_WEAK_MAP||shared$1.state?(store=shared$1.state||(shared$1.state=new WeakMap),wmget=uncurryThis$e(store.get),wmhas=uncurryThis$e(store.has),wmset=uncurryThis$e(store.set),set$1=function(e,t){if(wmhas(store,e))throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);return t.facade=e,wmset(store,e,t),t},get=function(e){return wmget(store,e)||{}},function(e){return wmhas(store,e)}):(STATE=sharedKey$2("state"),hiddenKeys$3[STATE]=!0,set$1=function(e,t){if(hasOwn$8(e,STATE))throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);return t.facade=e,createNonEnumerableProperty$4(e,STATE,t),t},get=function(e){return hasOwn$8(e,STATE)?e[STATE]:{}},function(e){return hasOwn$8(e,STATE)}),{set:set$1,get:get,has:has,enforce:enforce,getterFor:getterFor}),fails$c=fails$j,isCallable$e=isCallable$m,hasOwn$7=hasOwnProperty_1,DESCRIPTORS$6=descriptors,CONFIGURABLE_FUNCTION_NAME$1=functionName.CONFIGURABLE,inspectSource$2=inspectSource$4,InternalStateModule$5=internalState,enforceInternalState=InternalStateModule$5.enforce,getInternalState$3=InternalStateModule$5.get,defineProperty$5=Object.defineProperty,CONFIGURABLE_LENGTH=DESCRIPTORS$6&&!fails$c(function(){return 8!==defineProperty$5(function(){},"length",{value:8}).length}),TEMPLATE=String(String).split("String"),makeBuiltIn$2=makeBuiltIn$3.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!hasOwn$7(e,"name")||CONFIGURABLE_FUNCTION_NAME$1&&e.name!==t)&&(DESCRIPTORS$6?defineProperty$5(e,"name",{value:t,configurable:!0}):e.name=t),CONFIGURABLE_LENGTH&&r&&hasOwn$7(r,"arity")&&e.length!==r.arity&&defineProperty$5(e,"length",{value:r.arity});try{r&&hasOwn$7(r,"constructor")&&r.constructor?DESCRIPTORS$6&&defineProperty$5(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}r=enforceInternalState(e);return hasOwn$7(r,"source")||(r.source=TEMPLATE.join("string"==typeof t?t:"")),e},isCallable$d=(Function.prototype.toString=makeBuiltIn$2(function(){return isCallable$e(this)&&getInternalState$3(this).source||inspectSource$2(this)},"toString"),isCallable$m),definePropertyModule$4=objectDefineProperty,makeBuiltIn$1=makeBuiltIn$3.exports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$9=function(e,t,r,n){var o=(n=n||{}).enumerable,i=void 0!==n.name?n.name:t;if(isCallable$d(r)&&makeBuiltIn$1(r,i,n),n.global)o?e[t]=r:defineGlobalProperty$1(t,r);else{try{n.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=r:definePropertyModule$4.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},objectGetOwnPropertyNames={},ceil=Math.ceil,floor$3=Math.floor,mathTrunc=Math.trunc||function(e){e=+e;return(0<e?floor$3:ceil)(e)},trunc=mathTrunc,toIntegerOrInfinity$3=function(e){e=+e;return e!=e||0==e?0:trunc(e)},toIntegerOrInfinity$2=toIntegerOrInfinity$3,max$1=Math.max,min$2=Math.min,toAbsoluteIndex$2=function(e,t){e=toIntegerOrInfinity$2(e);return e<0?max$1(e+t,0):min$2(e,t)},toIntegerOrInfinity$1=toIntegerOrInfinity$3,min$1=Math.min,toLength$2=function(e){return 0<e?min$1(toIntegerOrInfinity$1(e),9007199254740991):0},toLength$1=toLength$2,lengthOfArrayLike$4=function(e){return toLength$1(e.length)},toIndexedObject$3=toIndexedObject$5,toAbsoluteIndex$1=toAbsoluteIndex$2,lengthOfArrayLike$3=lengthOfArrayLike$4,createMethod$1=function(a){return function(e,t,r){var n,o=toIndexedObject$3(e),i=lengthOfArrayLike$3(o),s=toAbsoluteIndex$1(r,i);if(a&&t!=t){for(;s<i;)if((n=o[s++])!=n)return!0}else for(;s<i;s++)if((a||s in o)&&o[s]===t)return a||s||0;return!a&&-1}},arrayIncludes={includes:createMethod$1(!0),indexOf:createMethod$1(!1)},uncurryThis$d=functionUncurryThis,hasOwn$6=hasOwnProperty_1,toIndexedObject$2=toIndexedObject$5,indexOf$1=arrayIncludes.indexOf,hiddenKeys$2=hiddenKeys$4,push$4=uncurryThis$d([].push),objectKeysInternal=function(e,t){var r,n=toIndexedObject$2(e),o=0,i=[];for(r in n)!hasOwn$6(hiddenKeys$2,r)&&hasOwn$6(n,r)&&push$4(i,r);for(;t.length>o;)!hasOwn$6(n,r=t[o++])||~indexOf$1(i,r)||push$4(i,r);return i},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,hiddenKeys$1=enumBugKeys$3.concat("length","prototype"),objectGetOwnPropertySymbols=(objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys$1(e,hiddenKeys$1)},{}),getBuiltIn$5=(objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols,getBuiltIn$8),uncurryThis$c=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule$1=objectGetOwnPropertySymbols,anObject$d=anObject$f,concat$1=functionUncurryThis([].concat),ownKeys$1=getBuiltIn$5("Reflect","ownKeys")||function(e){var t=getOwnPropertyNamesModule.f(anObject$d(e)),r=getOwnPropertySymbolsModule$1.f;return r?concat$1(t,r(e)):t},hasOwn$5=hasOwnProperty_1,ownKeys=ownKeys$1,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule$3=objectDefineProperty,copyConstructorProperties$1=function(e,t,r){for(var n=ownKeys(t),o=definePropertyModule$3.f,i=getOwnPropertyDescriptorModule.f,s=0;s<n.length;s++){var a=n[s];hasOwn$5(e,a)||r&&hasOwn$5(r,a)||o(e,a,i(t,a))}},fails$b=fails$j,isCallable$c=isCallable$m,replacement=/#|\.prototype\./,isForced$2=function(e,t){e=data[normalize(e)];return e==POLYFILL||e!=NATIVE&&(isCallable$c(t)?fails$b(t):!!t)},normalize=isForced$2.normalize=function(e){return String(e).replace(replacement,".").toLowerCase()},data=isForced$2.data={},NATIVE=isForced$2.NATIVE="N",POLYFILL=isForced$2.POLYFILL="P",isForced_1=isForced$2,global$f=global$o,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$3=createNonEnumerableProperty$5,defineBuiltIn$8=defineBuiltIn$9,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties=copyConstructorProperties$1,isForced$1=isForced_1,_export=function(e,t){var r,n,o,i=e.target,s=e.global,a=e.stat,l=s?global$f:a?global$f[i]||defineGlobalProperty(i,{}):(global$f[i]||{}).prototype;if(l)for(r in t){if(n=t[r],o=e.dontCallGetSet?(o=getOwnPropertyDescriptor$2(l,r))&&o.value:l[r],!isForced$1(s?r:i+(a?".":"#")+r,e.forced)&&void 0!==o){if(typeof n==typeof o)continue;copyConstructorProperties(n,o)}(e.sham||o&&o.sham)&&createNonEnumerableProperty$3(n,"sham",!0),defineBuiltIn$8(l,r,n,e)}},internalObjectKeys=objectKeysInternal,enumBugKeys$1=enumBugKeys$3,objectKeys$2=Object.keys||function(e){return internalObjectKeys(e,enumBugKeys$1)},DESCRIPTORS$5=descriptors,uncurryThis$b=functionUncurryThis,call$e=functionCall,fails$a=fails$j,objectKeys$1=objectKeys$2,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,propertyIsEnumerableModule=objectPropertyIsEnumerable,toObject$2=toObject$4,IndexedObject=indexedObject,$assign=Object.assign,defineProperty$4=Object.defineProperty,concat=uncurryThis$b([].concat),objectAssign=!$assign||fails$a(function(){if(DESCRIPTORS$5&&1!==$assign({b:1},$assign(defineProperty$4({},"a",{enumerable:!0,get:function(){defineProperty$4(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol(),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!=$assign({},e)[r]||objectKeys$1($assign({},t)).join("")!=n})?function(e,t){for(var r=toObject$2(e),n=arguments.length,o=1,i=getOwnPropertySymbolsModule.f,s=propertyIsEnumerableModule.f;o<n;)for(var a,l=IndexedObject(arguments[o++]),c=i?concat(objectKeys$1(l),i(l)):objectKeys$1(l),u=c.length,d=0;d<u;)a=c[d++],DESCRIPTORS$5&&!call$e(s,l,a)||(r[a]=l[a]);return r}:$assign,$$a=_export,assign$1=objectAssign;_export({target:"Object",stat:!0,arity:2,forced:Object.assign!==assign$1},{assign:assign$1});const SLICE_NAME="processingCenter",namespace$2=(!function(e){e.Failed="failed",e.Idle="idle",e.Pending="pending",e.Complete="complete"}(LoadingStatus=LoadingStatus||{}),!function(e){e.Editor="editor",e.Viewer="viewer",e.Owner="owner"}(ESourcePermission=ESourcePermission||{}),"uiState"),initialState$1={status:LoadingStatus.Idle},slice$1=createSlice({name:SLICE_NAME+"/"+namespace$2,initialState:initialState$1,reducers:{init(e){e.status=LoadingStatus.Pending},initDone(e){e.status=LoadingStatus.Idle},initFailed(e){e.status=LoadingStatus.Failed}}}),actions$2=slice$1.actions;var uiState$1=slice$1.reducer;const namespace$1="sourceConfiguration",initialState={status:LoadingStatus.Pending,updateStatus:LoadingStatus.Pending,createStatus:LoadingStatus.Pending,newAvatar:null,source:void 0,deleteSourceStatus:null,canBeDeletedStatus:LoadingStatus.Pending,canBeDeleted:null,sourceTypesConfig:{}},slice=createSlice({name:SLICE_NAME+"/"+namespace$1,initialState:initialState,reducers:{fetchSourceStart(e,t){e.status=LoadingStatus.Pending},fetchSourceSuccess(e,t){e.status=LoadingStatus.Complete,e.source=t.payload},fetchSourceFailed(e){e.status=LoadingStatus.Failed},deleteSourceStart(e,t){e.deleteSourceStatus=LoadingStatus.Pending},deleteSourceSuccess(e){e.deleteSourceStatus=LoadingStatus.Complete},deleteSourceFailed(e){e.deleteSourceStatus=LoadingStatus.Failed},deleteSourceReset(e){e.deleteSourceStatus=null},checkCanBeDeletedStart(e,t){e.canBeDeletedStatus=LoadingStatus.Pending},checkCanBeDeletedSuccess(e,t){e.canBeDeletedStatus=LoadingStatus.Idle,e.canBeDeleted=t.payload},checkCanBeDeletedFailed(e,t){e.canBeDeletedStatus=LoadingStatus.Failed,e.canBeDeleted=!1},updateSourceStart(e,t){e.updateStatus=LoadingStatus.Pending},updateSourceSuccess(e,t){e.updateStatus=LoadingStatus.Complete,e.source=t.payload},updateSourceFailed(e){e.updateStatus=LoadingStatus.Failed},createSourceStart(e,t){e.createStatus=LoadingStatus.Pending},createSourceSuccess(e,t){e.createStatus=LoadingStatus.Complete,e.source=t.payload},createSourceFailed(e){e.createStatus=LoadingStatus.Failed},setNewAvatar(e,t){e.newAvatar=t.payload},getSourceTypes(e,t){console.log("getting source types")},setSourceTypes(e,t){var t=t.payload;const r={};null!=(t=null==t?void 0:t.records)&&t.forEach(e=>{var t;const n=(null==(t=null==(t=null==e?void 0:e.sourceSchema)?void 0:t.definition)?void 0:t.properties)||{},o=(null==(t=null==(t=null==e?void 0:e.sourceSchema)?void 0:t.definition)?void 0:t.required)||[],i={};Object.keys(n).forEach(t=>{const r=n[t];null!==o&&void 0!==o&&o.forEach(e=>{r.isRequired=t===e}),i[t]=Object.assign(Object.assign({},r),{id:t,title:r.title,type:getFieldType(r),allowMultiple:"array"===r.type,isValid:!0}),i[t].query=getQuery(r)}),null!=(t=Object.keys(i))&&t.forEach(t=>{var e;i[t].hasOwnProperty("peerEnumKey")&&(e=find_1(i,e=>e.id===i[t].peerEnumKey))&&(i[t].parentId=e.id,i[t].type="childSelect",i[t].options=[],i[t].parentValue=e.value)}),r[null==e?void 0:e.id]={id:e.id,name:e.name,organizationId:e.organizationId,fields:i}}),e.sourceTypesConfig=r}}}),actions$1=slice.actions;var configuration_slice=slice.reducer;function getFieldType(e){return e?"string"===e.type&&e.query||"array"===e.type?"select":e.type:""}function getQuery(e){var t;return e?e.query||(null!=(t=e.items)&&t.query?e.items.query:null):""}const namespace=SLICE_NAME,actions={[namespace$2]:actions$2,[namespace$1]:actions$1},rootReducer=combineReducers({[namespace$2]:uiState$1,[namespace$1]:configuration_slice}),selectUIStateStatus=e=>e[namespace].uiState.status;var uiState=Object.freeze({__proto__:null,selectUIStateStatus:selectUIStateStatus});const selectFetchSourceStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.status},selectUpdateSourceStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.updateStatus},selectCreateSourceStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.createStatus},selectDeleteSourceStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.deleteSourceStatus},selectCheckCanBeDeletedStatus=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.canBeDeletedStatus},selectCanBeDeleted=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.canBeDeleted},selectSource=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.source},selectSourceTypesConfig=e=>{return null==(e=null==(e=e[namespace])?void 0:e.sourceConfiguration)?void 0:e.sourceTypesConfig},selectSourceTypes=e=>{const t=selectSourceTypesConfig(e);let r={};return Object.keys(t).forEach(e=>{e={[t[e].id]:{id:t[e].id,name:t[e].name}};r=Object.assign(Object.assign({},r),e)}),r},selectNewAvatar=e=>e[namespace].sourceConfiguration.newAvatar;var configuration_selectors=Object.freeze({__proto__:null,selectFetchSourceStatus:selectFetchSourceStatus,selectUpdateSourceStatus:selectUpdateSourceStatus,selectCreateSourceStatus:selectCreateSourceStatus,selectDeleteSourceStatus:selectDeleteSourceStatus,selectCheckCanBeDeletedStatus:selectCheckCanBeDeletedStatus,selectCanBeDeleted:selectCanBeDeleted,selectSource:selectSource,selectSourceTypesConfig:selectSourceTypesConfig,selectSourceTypes:selectSourceTypes,selectNewAvatar:selectNewAvatar});const selectApiConfigs$1=createSelector([rootApiSelector,graphEndpointSelector,sessionTokenSelector],(e,t,r)=>({apiRoot:e,graphQLEndpoint:t,token:r}));var selectors=Object.freeze({__proto__:null,selectApiConfigs:selectApiConfigs$1,uiState:uiState,source:configuration_selectors});function __rest(e,t){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function __awaiter(e,s,a,l){return new(a=a||Promise)(function(r,t){function n(e){try{i(l.next(e))}catch(e){t(e)}}function o(e){try{i(l.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((l=l.apply(e,s||[])).next())})}const sourceFields=`
|
|
2
|
+
id
|
|
3
|
+
sourceType { id }
|
|
4
|
+
name
|
|
5
|
+
details
|
|
6
|
+
isPublic
|
|
7
|
+
organizationId
|
|
8
|
+
createdDateTime
|
|
9
|
+
modifiedDateTime
|
|
10
|
+
thumbnailUrl
|
|
11
|
+
contentTemplates {
|
|
12
|
+
id
|
|
13
|
+
sourceId
|
|
14
|
+
sdoId
|
|
15
|
+
sdo { id data }
|
|
16
|
+
schemaId
|
|
17
|
+
data
|
|
18
|
+
}
|
|
19
|
+
permission
|
|
20
|
+
state
|
|
21
|
+
`;function getSource(r,n){return __awaiter(this,void 0,void 0,function*(){var e="fetchSource",t=`
|
|
22
|
+
query ${e}($id: ID!){
|
|
23
|
+
source(id: $id) {
|
|
24
|
+
${sourceFields}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`;return(yield baseGraphQLApiWithError(Object.assign({query:t,operationName:e,variables:{id:n}},r))).source})}function checkSourceDeleteStatus(e,t){return __awaiter(this,void 0,void 0,function*(){return yield baseGraphQLApiWithError(Object.assign({query:`
|
|
28
|
+
query {
|
|
29
|
+
scheduledJobs: scheduledJobs (id: ${t}) {
|
|
30
|
+
records {
|
|
31
|
+
name
|
|
32
|
+
id
|
|
33
|
+
isActive
|
|
34
|
+
details
|
|
35
|
+
description
|
|
36
|
+
startDateTime
|
|
37
|
+
jobs {
|
|
38
|
+
records {
|
|
39
|
+
id
|
|
40
|
+
status
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
ingestionStatus
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
tdos: temporalDataObjects(sourceId: ${t}) {
|
|
47
|
+
records {
|
|
48
|
+
name
|
|
49
|
+
id
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
`,variables:{id:t}},e))})}function deleteSource(t,r){return __awaiter(this,void 0,void 0,function*(){var e="deleteSource";return yield baseGraphQLApiWithError(Object.assign({query:"\n mutation deleteSource ($id: ID!) {\n deleteSource(id: $id) {\n id\n }\n }\n ",operationName:e,variables:{id:r}},t))})}const getSourceTypes=(t,r)=>__awaiter(void 0,void 0,void 0,function*(){var e="getSourceTypes";return(yield baseGraphQLApiWithError(Object.assign({query:"\n query getSourceTypes($sourceTypeIds: [ID]) {\n sourceTypes(ids: $sourceTypeIds, limit: 30) {\n records {\n id\n name\n isPublic\n organizationId\n sourceSchema {\n id\n definition\n status\n majorVersion\n minorVersion\n validActions\n dataRegistryId\n }\n }\n }\n }\n ",operationName:e,variables:{ids:r}},t))).sourceTypes});var location,defer,channel,port,classof$7=classofRaw$1,global$e=global$o,engineIsNode="process"==classofRaw$1(global$o.process),isCallable$b=isCallable$m,$String$1=String,$TypeError$6=TypeError,aPossiblePrototype$1=function(e){if("object"==typeof e||isCallable$b(e))return e;throw $TypeError$6("Can't set "+$String$1(e)+" as a prototype")},uncurryThis$a=functionUncurryThis,anObject$c=anObject$f,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,e={};try{(r=uncurryThis$a(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),n=e instanceof Array}catch(e){}return function(e,t){return anObject$c(e),aPossiblePrototype(t),n?r(e,t):e.__proto__=t,e}}():void 0),defineProperty$3=objectDefineProperty.f,hasOwn$4=hasOwnProperty_1,wellKnownSymbol$g=wellKnownSymbol$i,TO_STRING_TAG$3=wellKnownSymbol$i("toStringTag"),setToStringTag$5=function(e,t,r){(e=e&&!r?e.prototype:e)&&!hasOwn$4(e,TO_STRING_TAG$3)&&defineProperty$3(e,TO_STRING_TAG$3,{configurable:!0,value:t})},getBuiltIn$4=getBuiltIn$8,definePropertyModule$2=objectDefineProperty,wellKnownSymbol$f=wellKnownSymbol$i,DESCRIPTORS$4=descriptors,SPECIES$3=wellKnownSymbol$i("species"),setSpecies$1=function(e){var e=getBuiltIn$4(e),t=definePropertyModule$2.f;DESCRIPTORS$4&&e&&!e[SPECIES$3]&&t(e,SPECIES$3,{configurable:!0,get:function(){return this}})},isPrototypeOf$1=objectIsPrototypeOf,$TypeError$5=TypeError,anInstance$3=function(e,t){if(isPrototypeOf$1(t,e))return e;throw $TypeError$5("Incorrect invocation")},wellKnownSymbol$e=wellKnownSymbol$i,TO_STRING_TAG$2=wellKnownSymbol$i("toStringTag"),test={},toStringTagSupport=(test[TO_STRING_TAG$2]="z","[object z]"===String(test)),TO_STRING_TAG_SUPPORT=toStringTagSupport,isCallable$a=isCallable$m,classofRaw=classofRaw$1,wellKnownSymbol$d=wellKnownSymbol$i,TO_STRING_TAG$1=wellKnownSymbol$i("toStringTag"),$Object$1=Object,CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof$6=TO_STRING_TAG_SUPPORT?classofRaw:function(e){var t;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=tryGet(e=$Object$1(e),TO_STRING_TAG$1))?t:CORRECT_ARGUMENTS?classofRaw(e):"Object"==(t=classofRaw(e))&&isCallable$a(e.callee)?"Arguments":t},uncurryThis$9=functionUncurryThis,fails$9=fails$j,isCallable$9=isCallable$m,classof$5=classof$6,getBuiltIn$3=getBuiltIn$8,inspectSource$1=inspectSource$4,noop=function(){},empty=[],construct=getBuiltIn$8("Reflect","construct"),constructorRegExp=/^\s*(?:class|function)\b/,exec$4=uncurryThis$9(constructorRegExp.exec),INCORRECT_TO_STRING=!constructorRegExp.exec(noop),isConstructorModern=function(e){if(!isCallable$9(e))return!1;try{return construct(noop,empty,e),!0}catch(e){return!1}},isConstructorLegacy=function(e){if(!isCallable$9(e))return!1;switch(classof$5(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return INCORRECT_TO_STRING||!!exec$4(constructorRegExp,inspectSource$1(e))}catch(e){return!0}},isConstructor$2=(isConstructorLegacy.sham=!0,!construct||fails$9(function(){var e;return isConstructorModern(isConstructorModern.call)||!isConstructorModern(Object)||!isConstructorModern(function(){e=!0})||e})?isConstructorLegacy:isConstructorModern),isConstructor$1=isConstructor$2,tryToString$2=tryToString$4,$TypeError$4=TypeError,aConstructor$1=function(e){if(isConstructor$1(e))return e;throw $TypeError$4(tryToString$2(e)+" is not a constructor")},anObject$b=anObject$f,aConstructor=aConstructor$1,wellKnownSymbol$c=wellKnownSymbol$i,SPECIES$2=wellKnownSymbol$i("species"),speciesConstructor$2=function(e,t){var e=anObject$b(e).constructor;return void 0===e||null==(e=anObject$b(e)[SPECIES$2])?t:aConstructor(e)},NATIVE_BIND$1=functionBindNative,FunctionPrototype=Function.prototype,apply$2=FunctionPrototype.apply,call$d=FunctionPrototype.call,functionApply="object"==typeof Reflect&&Reflect.apply||(NATIVE_BIND$1?call$d.bind(apply$2):function(){return call$d.apply(apply$2,arguments)}),uncurryThis$8=functionUncurryThis,aCallable$5=aCallable$7,NATIVE_BIND=functionBindNative,bind$7=functionUncurryThis(functionUncurryThis.bind),functionBindContext=function(e,t){return aCallable$5(e),void 0===t?e:NATIVE_BIND?bind$7(e,t):function(){return e.apply(t,arguments)}},getBuiltIn$2=getBuiltIn$8,html$2=getBuiltIn$8("document","documentElement"),uncurryThis$7=functionUncurryThis,arraySlice$4=functionUncurryThis([].slice),$TypeError$3=TypeError,validateArgumentsLength$3=function(e,t){if(e<t)throw $TypeError$3("Not enough arguments");return e},userAgent$2=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2),global$d=global$o,apply$1=functionApply,bind$6=functionBindContext,isCallable$8=isCallable$m,hasOwn$3=hasOwnProperty_1,fails$8=fails$j,html$1=html$2,arraySlice$3=arraySlice$4,createElement=documentCreateElement$2,validateArgumentsLength$2=validateArgumentsLength$3,IS_IOS$1=engineIsIos,IS_NODE$3=engineIsNode,set=global$d.setImmediate,clear=global$d.clearImmediate,process$3=global$d.process,Dispatch=global$d.Dispatch,Function$1=global$d.Function,MessageChannel=global$d.MessageChannel,String$1=global$d.String,counter=0,queue$1={},ONREADYSTATECHANGE="onreadystatechange";try{location=global$d.location}catch(e){}var flush,head,last,notify$1,toggle,node,promise,then,Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,run=function(e){var t;hasOwn$3(queue$1,e)&&(t=queue$1[e],delete queue$1[e],t())},runner=function(e){return function(){run(e)}},listener=function(e){run(e.data)},post=function(e){global$d.postMessage(String$1(e),location.protocol+"//"+location.host)},task$1=(set&&clear||(set=function(e){validateArgumentsLength$2(arguments.length,1);var t=isCallable$8(e)?e:Function$1(e),r=arraySlice$3(arguments,1);return queue$1[++counter]=function(){apply$1(t,void 0,r)},defer(counter),counter},clear=function(e){delete queue$1[e]},IS_NODE$3?defer=function(e){process$3.nextTick(runner(e))}:Dispatch&&Dispatch.now?defer=function(e){Dispatch.now(runner(e))}:MessageChannel&&!IS_IOS$1?(port=(channel=new MessageChannel).port2,channel.port1.onmessage=listener,defer=bind$6(port.postMessage,port)):global$d.addEventListener&&isCallable$8(global$d.postMessage)&&!global$d.importScripts&&location&&"file:"!==location.protocol&&!fails$8(post)?(defer=post,global$d.addEventListener("message",listener,!1)):defer=ONREADYSTATECHANGE in createElement("script")?function(e){html$1.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html$1.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)}),{set:set,clear:clear}),userAgent$1=engineUserAgent,global$c=global$o,engineIsIosPebble=/ipad|iphone|ipod/i.test(userAgent$1)&&void 0!==global$c.Pebble,userAgent=engineUserAgent,engineIsWebosWebkit=/web0s(?!.*chrome)/i.test(userAgent),global$b=global$o,bind$5=functionBindContext,getOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,macrotask=task$1.set,IS_IOS=engineIsIos,IS_IOS_PEBBLE=engineIsIosPebble,IS_WEBOS_WEBKIT=engineIsWebosWebkit,IS_NODE$2=engineIsNode,MutationObserver=global$b.MutationObserver||global$b.WebKitMutationObserver,document$2=global$b.document,process$2=global$b.process,Promise$1=global$b.Promise,queueMicrotaskDescriptor=getOwnPropertyDescriptor$1(global$b,"queueMicrotask"),queueMicrotask=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value,microtask$1=(queueMicrotask||(flush=function(){var e,t;for(IS_NODE$2&&(e=process$2.domain)&&e.exit();head;){t=head.fn,head=head.next;try{t()}catch(e){throw head?notify$1():last=void 0,e}}last=void 0,e&&e.enter()},notify$1=IS_IOS||IS_NODE$2||IS_WEBOS_WEBKIT||!MutationObserver||!document$2?!IS_IOS_PEBBLE&&Promise$1&&Promise$1.resolve?((promise=Promise$1.resolve(void 0)).constructor=Promise$1,then=bind$5(promise.then,promise),function(){then(flush)}):IS_NODE$2?function(){process$2.nextTick(flush)}:(macrotask=bind$5(macrotask,global$b),function(){macrotask(flush)}):(toggle=!0,node=document$2.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),function(){node.data=toggle=!toggle})),queueMicrotask||function(e){e={fn:e,next:void 0};last&&(last.next=e),head||(head=e,notify$1()),last=e}),global$a=global$o,hostReportErrors$1=function(e,t){var r=global$a.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},perform$3=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Queue$1=function(){this.head=null,this.tail=null},queue=(Queue$1.prototype={add:function(e){e={item:e,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},Queue$1),global$9=global$o,promiseNativeConstructor=global$o.Promise,engineIsDeno="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,IS_DENO$1=engineIsDeno,IS_NODE$1=engineIsNode,engineIsBrowser=!engineIsDeno&&!engineIsNode&&"object"==typeof window&&"object"==typeof document,global$8=global$o,NativePromiseConstructor$3=promiseNativeConstructor,isCallable$7=isCallable$m,isForced=isForced_1,inspectSource=inspectSource$4,wellKnownSymbol$b=wellKnownSymbol$i,IS_BROWSER=engineIsBrowser,IS_DENO=engineIsDeno,V8_VERSION=engineV8Version,SPECIES$1=(NativePromiseConstructor$3&&NativePromiseConstructor$3.prototype,wellKnownSymbol$b("species")),SUBCLASSING=!1,NATIVE_PROMISE_REJECTION_EVENT$1=isCallable$7(global$8.PromiseRejectionEvent),FORCED_PROMISE_CONSTRUCTOR$5=isForced("Promise",function(){var e=inspectSource(NativePromiseConstructor$3),t=e!==String(NativePromiseConstructor$3);if(!t&&66===V8_VERSION)return!0;if(!V8_VERSION||V8_VERSION<51||!/native code/.test(e)){function r(e){e(function(){},function(){})}e=new NativePromiseConstructor$3(function(e){e(1)});if((e.constructor={})[SPECIES$1]=r,!(SUBCLASSING=e.then(function(){})instanceof r))return!0}return!t&&(IS_BROWSER||IS_DENO)&&!NATIVE_PROMISE_REJECTION_EVENT$1}),promiseConstructorDetection={CONSTRUCTOR:FORCED_PROMISE_CONSTRUCTOR$5,REJECTION_EVENT:NATIVE_PROMISE_REJECTION_EVENT$1,SUBCLASSING:SUBCLASSING},newPromiseCapability$2={},aCallable$4=aCallable$7,PromiseCapability=function(e){var r,n;this.promise=new e(function(e,t){if(void 0!==r||void 0!==n)throw TypeError("Bad Promise constructor");r=e,n=t}),this.resolve=aCallable$4(r),this.reject=aCallable$4(n)},$$9=(newPromiseCapability$2.f=function(e){return new PromiseCapability(e)},_export),IS_NODE=engineIsNode,global$7=global$o,call$c=functionCall,defineBuiltIn$7=defineBuiltIn$9,setPrototypeOf$1=objectSetPrototypeOf,setToStringTag$4=setToStringTag$5,setSpecies=setSpecies$1,aCallable$3=aCallable$7,isCallable$6=isCallable$m,isObject$3=isObject$9,anInstance$2=anInstance$3,speciesConstructor$1=speciesConstructor$2,task=task$1.set,microtask=microtask$1,hostReportErrors=hostReportErrors$1,perform$2=perform$3,Queue=queue,InternalStateModule$4=internalState,NativePromiseConstructor$2=promiseNativeConstructor,PromiseConstructorDetection=promiseConstructorDetection,newPromiseCapabilityModule$3=newPromiseCapability$2,PROMISE="Promise",FORCED_PROMISE_CONSTRUCTOR$4=PromiseConstructorDetection.CONSTRUCTOR,NATIVE_PROMISE_REJECTION_EVENT=PromiseConstructorDetection.REJECTION_EVENT,NATIVE_PROMISE_SUBCLASSING=PromiseConstructorDetection.SUBCLASSING,getInternalPromiseState=InternalStateModule$4.getterFor(PROMISE),setInternalState$4=InternalStateModule$4.set,NativePromisePrototype$1=NativePromiseConstructor$2&&NativePromiseConstructor$2.prototype,PromiseConstructor=NativePromiseConstructor$2,PromisePrototype=NativePromisePrototype$1,TypeError$3=global$7.TypeError,document$1=global$7.document,process$1=global$7.process,newPromiseCapability$1=newPromiseCapabilityModule$3.f,newGenericPromiseCapability=newPromiseCapability$1,DISPATCH_EVENT=!!(document$1&&document$1.createEvent&&global$7.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,isThenable=function(e){var t;return!(!isObject$3(e)||!isCallable$6(t=e.then))&&t},callReaction=function(e,t){var r,n,o,i=t.value,s=t.state==FULFILLED,a=s?e.ok:e.fail,l=e.resolve,c=e.reject,u=e.domain;try{a?(s||(t.rejection===UNHANDLED&&onHandleUnhandled(t),t.rejection=HANDLED),!0===a?r=i:(u&&u.enter(),r=a(i),u&&(u.exit(),o=!0)),r===e.promise?c(TypeError$3("Promise-chain cycle")):(n=isThenable(r))?call$c(n,r,l,c):l(r)):c(i)}catch(e){u&&!o&&u.exit(),c(e)}},notify=function(r,n){r.notified||(r.notified=!0,microtask(function(){for(var e,t=r.reactions;e=t.get();)callReaction(e,r);r.notified=!1,n&&!r.rejection&&onUnhandled(r)}))},dispatchEvent=function(e,t,r){var n;DISPATCH_EVENT?((n=document$1.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),global$7.dispatchEvent(n)):n={promise:t,reason:r},!NATIVE_PROMISE_REJECTION_EVENT&&(t=global$7["on"+e])?t(n):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",r)},onUnhandled=function(n){call$c(task,global$7,function(){var e=n.facade,t=n.value,r=isUnhandled(n);if(r&&(r=perform$2(function(){IS_NODE?process$1.emit("unhandledRejection",t,e):dispatchEvent(UNHANDLED_REJECTION,e,t)}),n.rejection=IS_NODE||isUnhandled(n)?UNHANDLED:HANDLED,r.error))throw r.value})},isUnhandled=function(e){return e.rejection!==HANDLED&&!e.parent},onHandleUnhandled=function(t){call$c(task,global$7,function(){var e=t.facade;IS_NODE?process$1.emit("rejectionHandled",e):dispatchEvent(REJECTION_HANDLED,e,t.value)})},bind$4=function(t,r,n){return function(e){t(r,e,n)}},internalReject=function(e,t,r){e.done||(e.done=!0,(e=r?r:e).value=t,e.state=REJECTED,notify(e,!0))},internalResolve=function(r,e,t){if(!r.done){r.done=!0,t&&(r=t);try{if(r.facade===e)throw TypeError$3("Promise can't be resolved itself");var n=isThenable(e);n?microtask(function(){var t={done:!1};try{call$c(n,e,bind$4(internalResolve,t,r),bind$4(internalReject,t,r))}catch(e){internalReject(t,e,r)}}):(r.value=e,r.state=FULFILLED,notify(r,!1))}catch(e){internalReject({done:!1},e,r)}}};if(FORCED_PROMISE_CONSTRUCTOR$4&&(PromisePrototype=(PromiseConstructor=function(e){anInstance$2(this,PromisePrototype),aCallable$3(e),call$c(Internal,this);var t=getInternalPromiseState(this);try{e(bind$4(internalResolve,t),bind$4(internalReject,t))}catch(e){internalReject(t,e)}}).prototype,(Internal=function(e){setInternalState$4(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:new Queue,rejection:!1,state:PENDING,value:void 0})}).prototype=defineBuiltIn$7(PromisePrototype,"then",function(e,t){var r=getInternalPromiseState(this),n=newPromiseCapability$1(speciesConstructor$1(this,PromiseConstructor));return r.parent=!0,n.ok=!isCallable$6(e)||e,n.fail=isCallable$6(t)&&t,n.domain=IS_NODE?process$1.domain:void 0,r.state==PENDING?r.reactions.add(n):microtask(function(){callReaction(n,r)}),n.promise}),OwnPromiseCapability=function(){var e=new Internal,t=getInternalPromiseState(e);this.promise=e,this.resolve=bind$4(internalResolve,t),this.reject=bind$4(internalReject,t)},newPromiseCapabilityModule$3.f=newPromiseCapability$1=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)},isCallable$6(NativePromiseConstructor$2)&&NativePromisePrototype$1!==Object.prototype)){nativeThen=NativePromisePrototype$1.then,NATIVE_PROMISE_SUBCLASSING||defineBuiltIn$7(NativePromisePrototype$1,"then",function(e,t){var r=this;return new PromiseConstructor(function(e,t){call$c(nativeThen,r,e,t)}).then(e,t)},{unsafe:!0});try{delete NativePromisePrototype$1.constructor}catch(e){}setPrototypeOf$1&&setPrototypeOf$1(NativePromisePrototype$1,PromisePrototype)}$$9({global:!0,constructor:!0,wrap:!0,forced:FORCED_PROMISE_CONSTRUCTOR$4},{Promise:PromiseConstructor}),setToStringTag$4(PromiseConstructor,PROMISE,!1),setSpecies(PROMISE);var iterators={},wellKnownSymbol$a=wellKnownSymbol$i,Iterators$4=iterators,ITERATOR$7=wellKnownSymbol$i("iterator"),ArrayPrototype$1=Array.prototype,isArrayIteratorMethod$2=function(e){return void 0!==e&&(Iterators$4.Array===e||ArrayPrototype$1[ITERATOR$7]===e)},classof$4=classof$6,getMethod$2=getMethod$4,Iterators$3=iterators,wellKnownSymbol$9=wellKnownSymbol$i,ITERATOR$6=wellKnownSymbol$i("iterator"),getIteratorMethod$4=function(e){if(null!=e)return getMethod$2(e,ITERATOR$6)||getMethod$2(e,"@@iterator")||Iterators$3[classof$4(e)]},call$b=functionCall,aCallable$2=aCallable$7,anObject$a=anObject$f,tryToString$1=tryToString$4,getIteratorMethod$3=getIteratorMethod$4,$TypeError$2=TypeError,getIterator$3=function(e,t){var r=arguments.length<2?getIteratorMethod$3(e):t;if(aCallable$2(r))return anObject$a(call$b(r,e));throw $TypeError$2(tryToString$1(e)+" is not iterable")},call$a=functionCall,anObject$9=anObject$f,getMethod$1=getMethod$4,iteratorClose$2=function(e,t,r){var n,o;anObject$9(e);try{if(!(n=getMethod$1(e,"return"))){if("throw"===t)throw r;return r}n=call$a(n,e)}catch(e){o=!0,n=e}if("throw"===t)throw r;if(o)throw n;return anObject$9(n),r},bind$3=functionBindContext,call$9=functionCall,anObject$8=anObject$f,tryToString=tryToString$4,isArrayIteratorMethod$1=isArrayIteratorMethod$2,lengthOfArrayLike$2=lengthOfArrayLike$4,isPrototypeOf=objectIsPrototypeOf,getIterator$2=getIterator$3,getIteratorMethod$2=getIteratorMethod$4,iteratorClose$1=iteratorClose$2,$TypeError$1=TypeError,Result=function(e,t){this.stopped=e,this.result=t},ResultPrototype=Result.prototype,iterate$2=function(e,t,r){function n(e){return i&&iteratorClose$1(i,"normal",e),new Result(!0,e)}function o(e){return p?(anObject$8(e),f?h(e[0],e[1],n):h(e[0],e[1])):f?h(e,n):h(e)}var i,s,a,l,c,u,d=r&&r.that,p=!(!r||!r.AS_ENTRIES),$=!(!r||!r.IS_RECORD),g=!(!r||!r.IS_ITERATOR),f=!(!r||!r.INTERRUPTED),h=bind$3(t,d);if($)i=e.iterator;else if(g)i=e;else{if(!(r=getIteratorMethod$2(e)))throw $TypeError$1(tryToString(e)+" is not iterable");if(isArrayIteratorMethod$1(r)){for(s=0,a=lengthOfArrayLike$2(e);s<a;s++)if((l=o(e[s]))&&isPrototypeOf(ResultPrototype,l))return l;return new Result(!1)}i=getIterator$2(e,r)}for(c=($?e:i).next;!(u=call$9(c,i)).done;){try{l=o(u.value)}catch(e){iteratorClose$1(i,"throw",e)}if("object"==typeof l&&l&&isPrototypeOf(ResultPrototype,l))return l}return new Result(!1)},wellKnownSymbol$8=wellKnownSymbol$i,ITERATOR$5=wellKnownSymbol$i("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$5]=function(){return this},Array.from(iteratorWithReturn,function(){throw 2})}catch(e){}var method,checkCorrectnessOfIteration$1=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var n={};n[ITERATOR$5]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},NativePromiseConstructor$1=promiseNativeConstructor,checkCorrectnessOfIteration=checkCorrectnessOfIteration$1,FORCED_PROMISE_CONSTRUCTOR$3=promiseConstructorDetection.CONSTRUCTOR,promiseStaticsIncorrectIteration=FORCED_PROMISE_CONSTRUCTOR$3||!checkCorrectnessOfIteration(function(e){NativePromiseConstructor$1.all(e).then(void 0,function(){})}),$$8=_export,call$8=functionCall,aCallable$1=aCallable$7,newPromiseCapabilityModule$2=newPromiseCapability$2,perform$1=perform$3,iterate$1=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION$1=promiseStaticsIncorrectIteration,$$7=(_export({target:"Promise",stat:!0,forced:promiseStaticsIncorrectIteration},{all:function(e){var a=this,t=newPromiseCapabilityModule$2.f(a),l=t.resolve,c=t.reject,r=perform$1(function(){var n=aCallable$1(a.resolve),o=[],i=0,s=1;iterate$1(e,function(e){var t=i++,r=!1;s++,call$8(n,a,e).then(function(e){r||(r=!0,o[t]=e,--s||l(o))},c)}),--s||l(o)});return r.error&&c(r.value),t.promise}}),_export),FORCED_PROMISE_CONSTRUCTOR$2=promiseConstructorDetection.CONSTRUCTOR,NativePromiseConstructor=promiseNativeConstructor,getBuiltIn$1=getBuiltIn$8,isCallable$5=isCallable$m,defineBuiltIn$6=defineBuiltIn$9,NativePromisePrototype=NativePromiseConstructor&&NativePromiseConstructor.prototype,$$6=($$7({target:"Promise",proto:!0,forced:FORCED_PROMISE_CONSTRUCTOR$2,real:!0},{catch:function(e){return this.then(void 0,e)}}),isCallable$5(NativePromiseConstructor)&&(method=getBuiltIn$1("Promise").prototype.catch,NativePromisePrototype.catch!==method&&defineBuiltIn$6(NativePromisePrototype,"catch",method,{unsafe:!0})),_export),call$7=functionCall,aCallable=aCallable$7,newPromiseCapabilityModule$1=newPromiseCapability$2,perform=perform$3,iterate=iterate$2,PROMISE_STATICS_INCORRECT_ITERATION=promiseStaticsIncorrectIteration,$$5=(_export({target:"Promise",stat:!0,forced:promiseStaticsIncorrectIteration},{race:function(e){var r=this,n=newPromiseCapabilityModule$1.f(r),o=n.reject,t=perform(function(){var t=aCallable(r.resolve);iterate(e,function(e){call$7(t,r,e).then(n.resolve,o)})});return t.error&&o(t.value),n.promise}}),_export),call$6=functionCall,newPromiseCapabilityModule=newPromiseCapability$2,FORCED_PROMISE_CONSTRUCTOR$1=promiseConstructorDetection.CONSTRUCTOR,anObject$7=($$5({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR$1},{reject:function(e){var t=newPromiseCapabilityModule.f(this);return call$6(t.reject,void 0,e),t.promise}}),anObject$f),isObject$2=isObject$9,newPromiseCapability=newPromiseCapability$2,promiseResolve$1=function(e,t){if(anObject$7(e),isObject$2(t)&&t.constructor===e)return t;e=newPromiseCapability.f(e);return(0,e.resolve)(t),e.promise},$$4=_export,getBuiltIn=getBuiltIn$8,FORCED_PROMISE_CONSTRUCTOR=promiseConstructorDetection.CONSTRUCTOR,promiseResolve=promiseResolve$1;function getImageURL(n,o){return __awaiter(this,void 0,void 0,function*(){var e={name:o.name},{url:e,unsignedUrl:t}=(yield baseGraphQLApiWithError(Object.assign({query:`
|
|
54
|
+
query getUrl($name: String!){
|
|
55
|
+
getSignedWritableUrl(key: $name) {
|
|
56
|
+
url
|
|
57
|
+
unsignedUrl
|
|
58
|
+
getUrl
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`,operationName:"getUrl",variables:e},n))).getSignedWritableUrl,r={method:"PUT",headers:{"Content-Type":o.type,"X-Veritone-Application":"aiware-sdk"},body:o};try{return yield fetch(e,r),t}catch(e){return console.log(e),""}})}function updateSource(n,o){return __awaiter(this,void 0,void 0,function*(){var e="updateSource",t=`
|
|
62
|
+
mutation ${e}($source: UpdateSource!) {
|
|
63
|
+
updateSource(input: $source) {
|
|
64
|
+
${sourceFields}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
`,r=__rest(o,["sourceType","organizationId","createdDateTime","modifiedDateTime","permission"]);return(yield baseGraphQLApiWithError(Object.assign({query:t,operationName:e,variables:{source:r}},n))).updateSource})}function createSource(r,n){return __awaiter(this,void 0,void 0,function*(){var e="createSource",t=`
|
|
68
|
+
mutation ${e}($source: CreateSource!) {
|
|
69
|
+
createSource(input: $source) {
|
|
70
|
+
${sourceFields}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
`;return(yield baseGraphQLApiWithError(Object.assign({query:t,operationName:e,variables:{source:n}},r))).createSource})}function*getUpdatedImageForSource(e,t){const{hasImageChanged:r,newImage:n}=t,o=__rest(t,["hasImageChanged","newImage"]);return r&&(null===n?o.thumbnailUrl=null:(t=yield getImageURL(e,n),o.thumbnailUrl=t)),o}function*fetchSourceSaga(e){try{var t=yield getSource(yield select(selectApiConfigs$1),e.payload);yield put(actions$1.fetchSourceSuccess(t))}catch(e){yield put(actions$1.fetchSourceFailed()),console.log("Problem fetching source",e)}}function*updateSourceSaga(e){try{var t=yield select(selectApiConfigs$1),r=yield updateSource(t,yield getUpdatedImageForSource(t,e.payload));yield put(actions$1.updateSourceSuccess(r))}catch(e){yield put(actions$1.updateSourceFailed()),console.log("Problem updating source",e)}}function*createSourceSaga(e){try{var t=yield select(selectApiConfigs$1),r=yield createSource(t,yield getUpdatedImageForSource(t,e.payload));yield put(actions$1.createSourceSuccess(r))}catch(e){yield put(actions$1.createSourceFailed()),console.log("Problem creating source",e)}}function*getSourceTypesSaga(e){try{var t=yield select(selectApiConfigs$1),r=yield getSourceTypes(t,[""]);yield put(actions$1.setSourceTypes(r))}catch(e){yield put(actions$1.fetchSourceFailed()),console.log("An error occured while getting source types",e)}}function*deleteSourceSaga(e){var t=yield select(preferredLanguageSelector);const r=AIWareFormatMessage(t);try{yield deleteSource(yield select(selectApiConfigs$1),e.payload),yield put(actions$1.deleteSourceSuccess()),yield put(showMessage({content:r({id:"os-processing-center-sources.delete-source-success",defaultMessage:[{type:0,value:"The source was deleted."}]}),severity:MessageSeverity.Success}))}catch(e){yield put(actions$1.deleteSourceFailed()),yield put(showMessage({content:r({id:"os-processing-center-sources.delete-source-error",defaultMessage:[{type:0,value:"There was a problem deleting the source."}]}),severity:MessageSeverity.Error})),console.log("Problem deleting source",e)}}function*checkCanBeDeletedSaga(t){var r,n;try{var{scheduledJobs:o,tdos:i}=yield checkSourceDeleteStatus(yield select(selectApiConfigs$1),t.payload);let e=!0;(null!=(r=null==o?void 0:o.records)&&r.length||null!=(n=null==i?void 0:i.records)&&n.length)&&(e=!1),yield put(actions$1.checkCanBeDeletedSuccess(e))}catch(e){yield put(actions$1.checkCanBeDeletedFailed(t.payload))}}function*fetchSourceWatcher(){yield takeLatest$1(actions$1.fetchSourceStart,fetchSourceSaga),yield takeLatest$1(actions$1.updateSourceStart,updateSourceSaga),yield takeLatest$1(actions$1.createSourceStart,createSourceSaga),yield takeLatest$1(actions$1.getSourceTypes,getSourceTypesSaga)}function*deleteSourceWatcher(){yield takeLatest$1(actions$1.deleteSourceStart,deleteSourceSaga)}function*checkCanBeDeletedWatcher(){yield takeLatest$1(actions$1.checkCanBeDeletedStart,checkCanBeDeletedSaga)}getBuiltIn("Promise"),$$4({target:"Promise",stat:!0,forced:FORCED_PROMISE_CONSTRUCTOR},{resolve:function(e){return promiseResolve(this,e)}});const selectApiConfigs=selectors["selectApiConfigs"];function*initProcessingCenter(){var e=yield select(selectUIStateStatus);yield select(preferredLanguageSelector),yield select(selectApiConfigs),e===LoadingStatus.Pending&&(yield put(actions.uiState.initDone()))}function*watchProcessingCenterInit(){yield takeLatest$1(actions.uiState.init.type,initProcessingCenter)}function*rootSaga(){yield all([watchProcessingCenterInit(),fetchSourceWatcher(),deleteSourceWatcher(),checkCanBeDeletedWatcher()])}function getProcessingCenterSourcesModule(){return{id:SLICE_NAME,reducerMap:{[SLICE_NAME]:rootReducer},sagas:[rootSaga],initialActions:[]}}const useStyles$6=makeStyles()(e=>({sourceContainer:{height:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between"},emptyStateContainer:{display:"flex",flexDirection:"column",justifyContent:"flex-start",alignItems:"center",paddingTop:e.spacing(18),width:"100%"},emptyImage:{display:"flex",textAlign:"center",width:"235px",height:"235px",marginBottom:e.spacing(2)},message:{userSelect:"none",paddingBottom:e.spacing(2)}}));var activeXDocument,IteratorPrototype$2,PrototypeOfArrayIteratorPrototype,arrayIterator,objectDefineProperties={},DESCRIPTORS$3=descriptors,V8_PROTOTYPE_DEFINE_BUG=v8PrototypeDefineBug,definePropertyModule$1=objectDefineProperty,anObject$6=anObject$f,toIndexedObject$1=toIndexedObject$5,objectKeys=objectKeys$2,anObject$5=(objectDefineProperties.f=DESCRIPTORS$3&&!V8_PROTOTYPE_DEFINE_BUG?Object.defineProperties:function(e,t){anObject$6(e);for(var r,n=toIndexedObject$1(t),o=objectKeys(t),i=o.length,s=0;s<i;)definePropertyModule$1.f(e,r=o[s++],n[r]);return e},anObject$f),definePropertiesModule=objectDefineProperties,enumBugKeys=enumBugKeys$3,hiddenKeys=hiddenKeys$4,html=html$2,documentCreateElement$1=documentCreateElement$2,sharedKey$1=sharedKey$3,GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO$1=sharedKey$3("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e=documentCreateElement$1("iframe"),t="java"+SCRIPT+":";return e.style.display="none",html.appendChild(e),e.src=String(t),(t=e.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F},NullProtoObject=function(){try{activeXDocument=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"==typeof document||document.domain&&activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame();for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE][enumBugKeys[e]];return NullProtoObject()},objectCreate=(hiddenKeys[IE_PROTO$1]=!0,Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE]=anObject$5(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,r[IE_PROTO$1]=e):r=NullProtoObject(),void 0===t?r:definePropertiesModule.f(r,t)}),wellKnownSymbol$7=wellKnownSymbol$i,create$3=objectCreate,defineProperty$2=objectDefineProperty.f,UNSCOPABLES=wellKnownSymbol$7("unscopables"),ArrayPrototype=Array.prototype,addToUnscopables$1=(null==ArrayPrototype[UNSCOPABLES]&&defineProperty$2(ArrayPrototype,UNSCOPABLES,{configurable:!0,value:create$3(null)}),function(e){ArrayPrototype[UNSCOPABLES][e]=!0}),fails$7=fails$j,correctPrototypeGetter=!fails$j(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),hasOwn$2=hasOwnProperty_1,isCallable$4=isCallable$m,toObject$1=toObject$4,sharedKey=sharedKey$3,CORRECT_PROTOTYPE_GETTER=correctPrototypeGetter,IE_PROTO=sharedKey$3("IE_PROTO"),$Object=Object,ObjectPrototype=$Object.prototype,objectGetPrototypeOf=CORRECT_PROTOTYPE_GETTER?$Object.getPrototypeOf:function(e){e=toObject$1(e);if(hasOwn$2(e,IE_PROTO))return e[IE_PROTO];var t=e.constructor;return isCallable$4(t)&&e instanceof t?t.prototype:e instanceof $Object?ObjectPrototype:null},fails$6=fails$j,isCallable$3=isCallable$m,getPrototypeOf$1=objectGetPrototypeOf,defineBuiltIn$5=defineBuiltIn$9,wellKnownSymbol$6=wellKnownSymbol$i,ITERATOR$4=wellKnownSymbol$i("iterator"),BUGGY_SAFARI_ITERATORS$1=!1,NEW_ITERATOR_PROTOTYPE=([].keys&&("next"in(arrayIterator=[].keys())?(PrototypeOfArrayIteratorPrototype=getPrototypeOf$1(getPrototypeOf$1(arrayIterator)))!==Object.prototype&&(IteratorPrototype$2=PrototypeOfArrayIteratorPrototype):BUGGY_SAFARI_ITERATORS$1=!0),null==IteratorPrototype$2||fails$6(function(){var e={};return IteratorPrototype$2[ITERATOR$4].call(e)!==e})),iteratorsCore=(isCallable$3((IteratorPrototype$2=NEW_ITERATOR_PROTOTYPE?{}:IteratorPrototype$2)[ITERATOR$4])||defineBuiltIn$5(IteratorPrototype$2,ITERATOR$4,function(){return this}),{IteratorPrototype:IteratorPrototype$2,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS$1}),IteratorPrototype$1=iteratorsCore.IteratorPrototype,create$2=objectCreate,createPropertyDescriptor$2=createPropertyDescriptor$5,setToStringTag$3=setToStringTag$5,Iterators$2=iterators,returnThis$1=function(){return this},createIteratorConstructor$2=function(e,t,r,n){t+=" Iterator";return e.prototype=create$2(IteratorPrototype$1,{next:createPropertyDescriptor$2(+!n,r)}),setToStringTag$3(e,t,!1),Iterators$2[t]=returnThis$1,e},$$3=_export,call$5=functionCall,FunctionName=functionName,isCallable$2=isCallable$m,createIteratorConstructor$1=createIteratorConstructor$2,getPrototypeOf=objectGetPrototypeOf,setPrototypeOf=objectSetPrototypeOf,setToStringTag$2=setToStringTag$5,createNonEnumerableProperty$2=createNonEnumerableProperty$5,defineBuiltIn$4=defineBuiltIn$9,wellKnownSymbol$5=wellKnownSymbol$i,Iterators$1=iterators,IteratorsCore=iteratorsCore,PROPER_FUNCTION_NAME=FunctionName.PROPER,CONFIGURABLE_FUNCTION_NAME=FunctionName.CONFIGURABLE,IteratorPrototype=IteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS=IteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$3=wellKnownSymbol$5("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis=function(){return this},defineIterator$2=function(e,t,r,n,o,i,s){createIteratorConstructor$1(r,t,n);function a(e){if(e===o&&$)return $;if(!BUGGY_SAFARI_ITERATORS&&e in d)return d[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}}var l,c,n=t+" Iterator",u=!1,d=e.prototype,p=d[ITERATOR$3]||d["@@iterator"]||o&&d[o],$=!BUGGY_SAFARI_ITERATORS&&p||a(o),g="Array"==t&&d.entries||p;if(g&&(g=getPrototypeOf(g.call(new e)))!==Object.prototype&&g.next&&(getPrototypeOf(g)!==IteratorPrototype&&(setPrototypeOf?setPrototypeOf(g,IteratorPrototype):isCallable$2(g[ITERATOR$3])||defineBuiltIn$4(g,ITERATOR$3,returnThis)),setToStringTag$2(g,n,!0)),PROPER_FUNCTION_NAME&&o==VALUES&&p&&p.name!==VALUES&&(CONFIGURABLE_FUNCTION_NAME?createNonEnumerableProperty$2(d,"name",VALUES):(u=!0,$=function(){return call$5(p,this)})),o)if(l={values:a(VALUES),keys:i?$:a(KEYS),entries:a(ENTRIES)},s)for(c in l)!BUGGY_SAFARI_ITERATORS&&!u&&c in d||defineBuiltIn$4(d,c,l[c]);else $$3({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS||u},l);return d[ITERATOR$3]!==$&&defineBuiltIn$4(d,ITERATOR$3,$,{name:o}),Iterators$1[t]=$,l},toIndexedObject=toIndexedObject$5,addToUnscopables=addToUnscopables$1,Iterators=iterators,InternalStateModule$3=internalState,defineProperty$1=objectDefineProperty.f,defineIterator$1=defineIterator$2,DESCRIPTORS$2=descriptors,ARRAY_ITERATOR="Array Iterator",setInternalState$3=InternalStateModule$3.set,getInternalState$2=InternalStateModule$3.getterFor(ARRAY_ITERATOR),es_array_iterator=defineIterator$1(Array,"Array",function(e,t){setInternalState$3(this,{type:ARRAY_ITERATOR,target:toIndexedObject(e),index:0,kind:t})},function(){var e=getInternalState$2(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?{value:e.target=void 0,done:!0}:"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values"),values=Iterators.Arguments=Iterators.Array;if(addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries"),DESCRIPTORS$2&&"values"!==values.name)try{defineProperty$1(values,"name",{value:"values"})}catch(e){}var COLLECTION_NAME,domIterables={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},documentCreateElement=documentCreateElement$2,classList=documentCreateElement$2("span").classList,DOMTokenListPrototype$1=classList&&classList.constructor&&classList.constructor.prototype,domTokenListPrototype=DOMTokenListPrototype$1===Object.prototype?void 0:DOMTokenListPrototype$1,global$6=global$o,DOMIterables=domIterables,DOMTokenListPrototype=domTokenListPrototype,ArrayIteratorMethods=es_array_iterator,createNonEnumerableProperty$1=createNonEnumerableProperty$5,wellKnownSymbol$4=wellKnownSymbol$i,ITERATOR$2=wellKnownSymbol$4("iterator"),TO_STRING_TAG=wellKnownSymbol$4("toStringTag"),ArrayValues=ArrayIteratorMethods.values,handlePrototype=function(t,e){if(t){if(t[ITERATOR$2]!==ArrayValues)try{createNonEnumerableProperty$1(t,ITERATOR$2,ArrayValues)}catch(e){t[ITERATOR$2]=ArrayValues}if(t[TO_STRING_TAG]||createNonEnumerableProperty$1(t,TO_STRING_TAG,e),DOMIterables[e])for(var r in ArrayIteratorMethods)if(t[r]!==ArrayIteratorMethods[r])try{createNonEnumerableProperty$1(t,r,ArrayIteratorMethods[r])}catch(e){t[r]=ArrayIteratorMethods[r]}}};for(COLLECTION_NAME in DOMIterables)handlePrototype(global$6[COLLECTION_NAME]&&global$6[COLLECTION_NAME].prototype,COLLECTION_NAME);handlePrototype(DOMTokenListPrototype,"DOMTokenList");const useStyles$5=makeStyles()(e=>({headerContainer:{padding:e.spacing(2,2,2,2)},headerActionContainer:{alignItems:"center",display:"flex",flexGrow:1,height:"100%",justifyContent:"flex-end"},headerTitleRow:{alignItems:"center",display:"flex",justifyContent:"space-between",height:"54px",padding:e.spacing(0,0,0,6)},title:{color:"#2A323C"},headerSubtitleRow:{alignItems:"center",display:"flex",justifyContent:"flex-start",padding:e.spacing(0,0,1,6)},subtitle:{},menuList:{width:"auto"},menuItem:{borderRadius:4,padding:e.spacing(1),"& > svg":{marginRight:e.spacing(2)},textTransform:"none"},divider:{marginBottom:e.spacing(1.5),marginTop:e.spacing(1.5)}})),SHARED_TEXT={configurationLabel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.tabs.content-template",defaultMessage:"Configuration",description:"Configurations for source"}),contentTemplateLabel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.tabs.content-template",defaultMessage:"Content Templates",description:"Configurations for Content Templates"}),headerTitleSourceDetail:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.source.detail.title",defaultMessage:"Source detail",description:"Title for Source Detail Panel"}),headerTitleSourceCreation:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.source.creation.title",defaultMessage:"Source Creation",description:"Title for Source Creation Panel"}),headerSubTitleSourceDetail:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.source.detail.subtitle",defaultMessage:"View and modify configurations and settings for this source.",description:"Subtitle for Source Detail Panel"}),headerSubTitleSourceCreation:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.source.creation.subtitle",defaultMessage:"Follow the steps below to create a new source.",description:"subtitle for Source Creation Panel"}),headerPermissionsButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.permissions",defaultMessage:"Permissions",description:"button for permissions"}),headerMoreActionsButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.more.actions",defaultMessage:"More Actions",description:"button for more actions"}),headerCloseButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.close.button",defaultMessage:"Close",description:"button for Close / Hide Panel"}),headerDeleteSourceButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.header.delete.source.button",defaultMessage:"Delete",description:"button to delete source"}),sourceDetailsRetryButton:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.try.button",defaultMessage:"Try Again",description:"button to try to reload source"}),sourceDetailsErrorMessage:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.error.message",defaultMessage:"There was a problem loading the Source",description:"error message on source load"}),deleteModalButtonCancel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.button.cancel",defaultMessage:"Cancel",description:"Modal button cancel"}),deleteModalButtonDelete:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.button.delete",defaultMessage:"Delete",description:"Modal button delete"}),deleteModalTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.title",defaultMessage:"Delete Source",description:"Modal title for deleting source"}),deleteModalSimpleDescription:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.description-simple",defaultMessage:"Are you sure you want to delete this source?",description:"Modal simple description for deleting source"}),deleteModalDescription:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.description",defaultMessage:"Deleting this source will pause all Scheduled Jobs that are currently using this source. You will need to update each schedule with a new source.",description:"Modal description for deleting source"}),deleteModalTitleSourceInUse:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.title.source.in.use",defaultMessage:"Source In Use",description:"Modal title for deleting source, source in use"}),deleteModalDescriptionSourceInUse:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.delete.modal.description.source.in.use",defaultMessage:"This source is currently being used in scheduled jobs or ingested content exists from this Source. In order to delete this source, please update each schedule using this source and remove the content.",description:"Modal description for deleting source, source in use"}),imageFileTypeErrorMessage:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.image.type.error.message",defaultMessage:"Please Select a .png or .jpg file",description:"error message on file selection"}),basicInformationTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.basic.info.title",defaultMessage:"Basic Information",description:"Title for basic info section"}),basicInformationSubtitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.basic.info.subtitle",defaultMessage:"Provide basic information about this source",description:"Subtitle for basic info section"}),sourceAvatarTitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.avatar.title",defaultMessage:"Source Avatar",description:"Title for source avatar section"}),sourceAvatarSubtitle:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.avatar.subtitle",defaultMessage:"Recommended image size: 300x300 .png or .jpg",description:"Subtitle for source avatar section"}),sourceNameTextFieldLabel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.name.textfield.label",defaultMessage:"Source Name",description:"texfield label for source name"}),sourceDescriptionTextFieldLabel:()=>jsxRuntime.exports.jsx(FormattedMessage,{id:"processing-panel-sources.source.details.source.description.textfield.label",defaultMessage:"Source Description",description:"texfield label for source description"})},useStyles$4=makeStyles()(e=>({actionContainer:{padding:e.spacing(3,2,2,2),display:"flex",justifyContent:"flex-end","& button:last-of-type":{marginLeft:"10px"}}})),modalStyles={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",borderRadius:"5px",boxShadow:24,p:5},DeleteModal=({sourceId:e,onCancel:t,onPanelClose:r})=>{var n=useStyles$4()["classes"];const o=useSelector(selectDeleteSourceStatus);var i=o===LoadingStatus.Pending,s=useSelector(selectCheckCanBeDeletedStatus);const a=useSelector(selectCanBeDeleted);s=s===LoadingStatus.Pending;const l=useDispatch();return react.exports.useEffect(()=>{o===LoadingStatus.Idle&&(t(),r(),l(actions.sourceConfiguration.deleteSourceReset())),o===LoadingStatus.Failed&&(t(),l(actions.sourceConfiguration.deleteSourceReset()))},[o]),jsxRuntime.exports.jsx(Modal,Object.assign({open:!0,onClose:t},{children:jsxRuntime.exports.jsxs(Box,Object.assign({sx:modalStyles},{children:[s&&jsxRuntime.exports.jsx(Box,Object.assign({sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"150px"}},{children:jsxRuntime.exports.jsx(CircularProgress$1,{})})),!s&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Typography$1,Object.assign({id:"source-delete-modal-title",variant:"h4"},{children:a?jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:SHARED_TEXT.deleteModalTitle()}):jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:SHARED_TEXT.deleteModalTitleSourceInUse()})})),jsxRuntime.exports.jsx(Typography$1,Object.assign({id:"source-delete-modal-description",sx:{mt:2}},{children:a?jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:SHARED_TEXT.deleteModalSimpleDescription()}):jsxRuntime.exports.jsx(jsxRuntime.exports.Fragment,{children:SHARED_TEXT.deleteModalDescriptionSourceInUse()})})),jsxRuntime.exports.jsxs("div",Object.assign({className:n.actionContainer},{children:[a&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Button$1,Object.assign({onClick:t,disabled:i},{children:SHARED_TEXT.deleteModalButtonCancel()})),jsxRuntime.exports.jsx(LoadingButton,Object.assign({onClick:()=>{l(actions.sourceConfiguration.deleteSourceStart(e))},variant:"contained",disableElevation:!0,disableRipple:!0,loading:i},{children:SHARED_TEXT.deleteModalButtonDelete()}))]}),!a&&jsxRuntime.exports.jsx(Button$1,Object.assign({onClick:t},{children:"Okay"}))]}))]})]}))}))},Header=({onPanelClose:e,sourceId:t})=>{var r=useStyles$5()["classes"];const[n,o]=react.exports.useState(null),[i,s]=react.exports.useState(!1);var a=Boolean(n);const l=()=>{o(null)};return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:r.headerContainer},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:r.headerTitleRow,"data-testid":"-header-testid"},{children:[jsxRuntime.exports.jsx(Typography$1,Object.assign({variant:"h1","data-testid":"permissions-panel-header-title",className:r.title},{children:t?SHARED_TEXT.headerTitleSourceDetail():SHARED_TEXT.headerTitleSourceCreation()})),jsxRuntime.exports.jsxs("div",Object.assign({className:r.headerActionContainer},{children:[t&&jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx(Tooltip,Object.assign({title:SHARED_TEXT.headerPermissionsButton()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:()=>console.log("clicked permissions"),"aria-labelledby":"permissions-button","data-testid":"source-details-permissions-button",size:"large"},{children:jsxRuntime.exports.jsx(AddUser,{})}))})),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:SHARED_TEXT.headerMoreActionsButton()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:e=>{o(e.currentTarget),e.stopPropagation()},"aria-labelledby":"more-actions-button","data-testid":"source-details-more-actions-button",size:"large"},{children:jsxRuntime.exports.jsx(MoreVert,{})}))}))]}),jsxRuntime.exports.jsx(Tooltip,Object.assign({title:SHARED_TEXT.headerCloseButton()},{children:jsxRuntime.exports.jsx(IconButton,Object.assign({onClick:()=>e(),"aria-labelledby":"source-details-close-button","data-testid":"source-details-close-button",size:"large"},{children:t?jsxRuntime.exports.jsx(Close,{}):jsxRuntime.exports.jsx(Hide,{})}))}))]}))]})),jsxRuntime.exports.jsx("div",Object.assign({className:r.headerSubtitleRow},{children:jsxRuntime.exports.jsx(Typography$1,Object.assign({variant:"body2","data-testid":"permissions-panel-header-title",className:r.subtitle},{children:t?SHARED_TEXT.headerSubTitleSourceDetail():SHARED_TEXT.headerSubTitleSourceCreation()}))})),jsxRuntime.exports.jsx(Menu,Object.assign({onClick:e=>e.stopPropagation(),classes:{paper:r.menuList},"data-testid":"pc-sources-item-context-menu",open:a,anchorEl:n,onClose:l},{children:jsxRuntime.exports.jsxs(MenuItem,Object.assign({onClick:e=>{e.stopPropagation(),s(!0),l()},className:r.menuItem,"data-testid":"pc-sources-context-menu-delete-option"},{children:[jsxRuntime.exports.jsx(Delete,{fontSize:"small"}),SHARED_TEXT.headerDeleteSourceButton()]}))}))]})),t&&i&&jsxRuntime.exports.jsx(DeleteModal,{sourceId:t,onCancel:()=>s(!1),onPanelClose:e})]})},useStyles$3=makeStyles()(()=>({tabPanelContainer:{"&:not([hidden])":{overflow:"scroll",padding:"0px 30px",height:"calc(100vh - 210px)",display:"flex",flexDirection:"column",boxSizing:"border-box",justifyContent:"space-between"}},tabContainer:{"& .Sdk-Mui-selected":{color:"black"}}})),useStyles$2=makeStyles()(e=>({field:{width:"100%"},formControlWrapper:{marginTop:15},inputLabel:{fontFamily:"Nunito",fontWeight:300,display:"block",fontSize:14,color:"#5C6269",marginBottom:6},inputLabelError:{color:e.palette.error.main}})),DynamicTextField=({id:e,label:t,required:r,value:n,pattern:o,onChange:i,error:s=!1})=>{var a=useStyles$2()["classes"];return jsxRuntime.exports.jsx(TextField,{id:e,label:t,InputLabelProps:{shrink:!0},autoComplete:"off",required:r,value:n,className:a.field,onChange:i,size:"small",inputProps:{pattern:o},error:s})};var classof$3=classof$6,$String=String,toString$4=function(e){if("Symbol"===classof$3(e))throw TypeError("Cannot convert a Symbol value to a string");return $String(e)},anObject$4=anObject$f,regexpFlags$1=function(){var e=anObject$4(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},fails$5=fails$j,global$5=global$o,$RegExp$2=global$o.RegExp,UNSUPPORTED_Y$2=fails$5(function(){var e=$RegExp$2("a","y");return e.lastIndex=2,null!=e.exec("abcd")}),MISSED_STICKY=UNSUPPORTED_Y$2||fails$5(function(){return!$RegExp$2("a","y").sticky}),BROKEN_CARET=UNSUPPORTED_Y$2||fails$5(function(){var e=$RegExp$2("^r","gy");return e.lastIndex=2,null!=e.exec("str")}),regexpStickyHelpers={BROKEN_CARET:BROKEN_CARET,MISSED_STICKY:MISSED_STICKY,UNSUPPORTED_Y:UNSUPPORTED_Y$2},fails$4=fails$j,global$4=global$o,$RegExp$1=global$o.RegExp,regexpUnsupportedDotAll=fails$4(function(){var e=$RegExp$1(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}),fails$3=fails$j,global$3=global$o,$RegExp=global$o.RegExp,regexpUnsupportedNcg=fails$3(function(){var e=$RegExp("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}),call$4=functionCall,uncurryThis$6=functionUncurryThis,toString$3=toString$4,regexpFlags=regexpFlags$1,stickyHelpers$1=regexpStickyHelpers,shared=shared$4.exports,create$1=objectCreate,getInternalState$1=internalState.get,UNSUPPORTED_DOT_ALL=regexpUnsupportedDotAll,UNSUPPORTED_NCG=regexpUnsupportedNcg,nativeReplace=shared("native-string-replace",String.prototype.replace),nativeExec=RegExp.prototype.exec,patchedExec=nativeExec,charAt$5=uncurryThis$6("".charAt),indexOf=uncurryThis$6("".indexOf),replace$3=uncurryThis$6("".replace),stringSlice$4=uncurryThis$6("".slice),UPDATES_LAST_INDEX_WRONG=function(){var e=/a/,t=/b*/g;return call$4(nativeExec,e,"a"),call$4(nativeExec,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),UNSUPPORTED_Y$1=stickyHelpers$1.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y$1||UNSUPPORTED_DOT_ALL||UNSUPPORTED_NCG,regexpExec$3=patchedExec=PATCH?function(e){var t,r,n,o,i,s,a=this,l=getInternalState$1(a),e=toString$3(e),c=l.raw;if(c)return c.lastIndex=a.lastIndex,d=call$4(patchedExec,c,e),a.lastIndex=c.lastIndex,d;var u=l.groups,c=UNSUPPORTED_Y$1&&a.sticky,d=call$4(regexpFlags,a),l=a.source,p=0,$=e;if(c&&(d=replace$3(d,"y",""),-1===indexOf(d,"g")&&(d+="g"),$=stringSlice$4(e,a.lastIndex),0<a.lastIndex&&(!a.multiline||a.multiline&&"\n"!==charAt$5(e,a.lastIndex-1))&&(l="(?: "+l+")",$=" "+$,p++),t=new RegExp("^(?:"+l+")",d)),NPCG_INCLUDED&&(t=new RegExp("^"+l+"$(?!\\s)",d)),UPDATES_LAST_INDEX_WRONG&&(r=a.lastIndex),n=call$4(nativeExec,c?t:a,$),c?n?(n.input=stringSlice$4(n.input,p),n[0]=stringSlice$4(n[0],p),n.index=a.lastIndex,a.lastIndex+=n[0].length):a.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&n&&(a.lastIndex=a.global?n.index+n[0].length:r),NPCG_INCLUDED&&n&&1<n.length&&call$4(nativeReplace,n[0],t,function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)}),n&&u)for(n.groups=i=create$1(null),o=0;o<u.length;o++)i[(s=u[o])[0]]=n[s[1]];return n}:patchedExec,$$2=_export,exec$3=regexpExec$3,uncurryThis$5=(_export({target:"RegExp",proto:!0,forced:/./.exec!==exec$3},{exec:exec$3}),functionUncurryThis),defineBuiltIn$3=defineBuiltIn$9,regexpExec$2=regexpExec$3,fails$2=fails$j,wellKnownSymbol$3=wellKnownSymbol$i,createNonEnumerableProperty=createNonEnumerableProperty$5,SPECIES=wellKnownSymbol$3("species"),RegExpPrototype=RegExp.prototype,fixRegexpWellKnownSymbolLogic=function(r,e,t,n){var s,o=wellKnownSymbol$3(r),a=!fails$2(function(){var e={};return e[o]=function(){return 7},7!=""[r](e)}),i=a&&!fails$2(function(){var e=!1,t=/a/;return"split"===r&&((t={constructor:{}}).constructor[SPECIES]=function(){return t},t.flags="",t[o]=/./[o]),t.exec=function(){return e=!0,null},t[o](""),!e});a&&i&&!t||(s=uncurryThis$5(/./[o]),i=e(o,""[r],function(e,t,r,n,o){var e=uncurryThis$5(e),i=t.exec;return i===regexpExec$2||i===RegExpPrototype.exec?a&&!o?{done:!0,value:s(t,r,n)}:{done:!0,value:e(r,t,n)}:{done:!1}}),defineBuiltIn$3(String.prototype,r,i[0]),defineBuiltIn$3(RegExpPrototype,o,i[1])),n&&createNonEnumerableProperty(RegExpPrototype[o],"sham",!0)},isObject$1=isObject$9,classof$2=classofRaw$1,wellKnownSymbol$2=wellKnownSymbol$i,MATCH=wellKnownSymbol$i("match"),isRegexp=function(e){var t;return isObject$1(e)&&(void 0!==(t=e[MATCH])?!!t:"RegExp"==classof$2(e))},uncurryThis$4=functionUncurryThis,toIntegerOrInfinity=toIntegerOrInfinity$3,toString$2=toString$4,requireObjectCoercible$1=requireObjectCoercible$4,charAt$4=uncurryThis$4("".charAt),charCodeAt$1=uncurryThis$4("".charCodeAt),stringSlice$3=uncurryThis$4("".slice),createMethod=function(o){return function(e,t){var r,e=toString$2(requireObjectCoercible$1(e)),t=toIntegerOrInfinity(t),n=e.length;return t<0||n<=t?o?"":void 0:(r=charCodeAt$1(e,t))<55296||56319<r||t+1===n||(n=charCodeAt$1(e,t+1))<56320||57343<n?o?charAt$4(e,t):r:o?stringSlice$3(e,t,t+2):n-56320+(r-55296<<10)+65536}},stringMultibyte={codeAt:createMethod(!1),charAt:createMethod(!0)},charAt$3=stringMultibyte.charAt,advanceStringIndex$1=function(e,t,r){return t+(r?charAt$3(e,t).length:1)},toPropertyKey=toPropertyKey$3,definePropertyModule=objectDefineProperty,createPropertyDescriptor$1=createPropertyDescriptor$5,createProperty$2=function(e,t,r){t=toPropertyKey(t);t in e?definePropertyModule.f(e,t,createPropertyDescriptor$1(0,r)):e[t]=r},toAbsoluteIndex=toAbsoluteIndex$2,lengthOfArrayLike$1=lengthOfArrayLike$4,createProperty$1=createProperty$2,$Array$1=Array,max=Math.max,arraySliceSimple=function(e,t,r){for(var n=lengthOfArrayLike$1(e),o=toAbsoluteIndex(t,n),i=toAbsoluteIndex(void 0===r?n:r,n),s=$Array$1(max(i-o,0)),a=0;o<i;o++,a++)createProperty$1(s,a,e[o]);return s.length=a,s},call$3=functionCall,anObject$3=anObject$f,isCallable$1=isCallable$m,classof$1=classofRaw$1,regexpExec$1=regexpExec$3,$TypeError=TypeError,regexpExecAbstract=function(e,t){var r=e.exec;if(isCallable$1(r))return null!==(r=call$3(r,e,t))&&anObject$3(r),r;if("RegExp"===classof$1(e))return call$3(regexpExec$1,e,t);throw $TypeError("RegExp#exec called on incompatible receiver")},apply=functionApply,call$2=functionCall,uncurryThis$3=functionUncurryThis,fixRegExpWellKnownSymbolLogic=fixRegexpWellKnownSymbolLogic,isRegExp=isRegexp,anObject$2=anObject$f,requireObjectCoercible=requireObjectCoercible$4,speciesConstructor=speciesConstructor$2,advanceStringIndex=advanceStringIndex$1,toLength=toLength$2,toString$1=toString$4,getMethod=getMethod$4,arraySlice$2=arraySliceSimple,callRegExpExec=regexpExecAbstract,regexpExec=regexpExec$3,stickyHelpers=regexpStickyHelpers,fails$1=fails$j,UNSUPPORTED_Y=regexpStickyHelpers.UNSUPPORTED_Y,MAX_UINT32=4294967295,min=Math.min,$push=[].push,exec$2=uncurryThis$3(/./.exec),push$3=uncurryThis$3($push),stringSlice$2=uncurryThis$3("".slice),SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails$1(function(){var e=/(?:)/,t=e.exec,e=(e.exec=function(){return t.apply(this,arguments)},"ab".split(e));return 2!==e.length||"a"!==e[0]||"b"!==e[1]});fixRegExpWellKnownSymbolLogic("split",function(o,g,f){var h="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||1<".".split(/()()/).length||"".split(/.?/).length?function(e,t){var r=toString$1(requireObjectCoercible(this)),n=void 0===t?MAX_UINT32:t>>>0;if(0===n)return[];if(void 0===e)return[r];if(!isRegExp(e))return call$2(g,r,e,n);for(var o,i,s,a=[],t=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,c=new RegExp(e.source,t+"g");(o=call$2(regexpExec,c,r))&&!(l<(i=c.lastIndex)&&(push$3(a,stringSlice$2(r,l,o.index)),1<o.length&&o.index<r.length&&apply($push,a,arraySlice$2(o,1)),s=o[0].length,l=i,n<=a.length));)c.lastIndex===o.index&&c.lastIndex++;return l===r.length?!s&&exec$2(c,"")||push$3(a,""):push$3(a,stringSlice$2(r,l)),n<a.length?arraySlice$2(a,0,n):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:call$2(g,this,e,t)}:g;return[function(e,t){var r=requireObjectCoercible(this),n=null==e?void 0:getMethod(e,o);return n?call$2(n,e,r,t):call$2(h,toString$1(r),e,t)},function(e,t){var r=anObject$2(this),n=toString$1(e),e=f(h,r,n,t,h!==g);if(e.done)return e.value;var e=speciesConstructor(r,RegExp),o=r.unicode,i=(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.unicode?"u":"")+(UNSUPPORTED_Y?"g":"y"),s=new e(UNSUPPORTED_Y?"^(?:"+r.source+")":r,i),a=void 0===t?MAX_UINT32:t>>>0;if(0===a)return[];if(0===n.length)return null===callRegExpExec(s,n)?[n]:[];for(var l=0,c=0,u=[];c<n.length;){s.lastIndex=UNSUPPORTED_Y?0:c;var d,p=callRegExpExec(s,UNSUPPORTED_Y?stringSlice$2(n,c):n);if(null===p||(d=min(toLength(s.lastIndex+(UNSUPPORTED_Y?c:0)),n.length))===l)c=advanceStringIndex(n,c,o);else{if(push$3(u,stringSlice$2(n,l,c)),u.length===a)return u;for(var $=1;$<=p.length-1;$++)if(push$3(u,p[$]),u.length===a)return u;c=l=d}}return push$3(u,stringSlice$2(n,l)),u}]},!SPLIT_WORKS_WITH_OVERWRITTEN_EXEC,UNSUPPORTED_Y);const fetchOptions=(e,t,r)=>fetch(t.graphQLEndpoint,{method:"post",headers:{Authorization:"bearer "+t.token,"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({query:e,variables:r})}).then(e=>e.json()).then(e=>{var t;if(!lodash.exports.isEmpty(e.errors))throw new Error((null==(t=((null==e?void 0:e.errors)||[])[0])?void 0:t.message)||"Error");let r;return r=0<(null==(t=null==(t=null==e?void 0:e.data)?void 0:t.results)?void 0:t.length)?e.data.results:0<(null==(t=null==(t=null==(t=null==e?void 0:e.data)?void 0:t.results)?void 0:t.records)?void 0:t.length)?e.data.results.records:null==(t=null==(e=null==(t=null==(e=null==(t=null==e?void 0:e.data)?void 0:t.dataRegistries)?void 0:e.records[0])?void 0:t.publishedSchema)?void 0:e.structuredDataObjects)?void 0:t.records}),DynamicSelect=({id:e,label:t,required:r,value:n,allowMultiple:o=!1,query:i,onChange:s})=>{const[a,l]=react.exports.useState([]),c=useSelector(selectApiConfigs$2);return react.exports.useEffect(()=>{void 0!==a&&0!==(null===a||void 0===a?void 0:a.length)||fetchOptions(i,c,{}).then(e=>{e=function(e){e=null==e?void 0:e.map(e=>({id:e.id||e,name:e.name||e}));return e}(e);l(e)})},[i,c,a]),jsxRuntime.exports.jsx(Select,Object.assign({size:"small",id:e,label:t,variant:"outlined",multiple:o,sx:{width:"100%"},value:n,required:r,onChange:function(e){const t=e.target.value,r="string"==typeof t?t.split(","):t;s&&s(r,o)}},{children:null===a||void 0===a?void 0:a.map(e=>jsxRuntime.exports.jsx(MenuItem,Object.assign({value:e.id},{children:e.name}),e.id))}))},fieldType={string:"string",number:"number",boolean:"boolean",select:"select",childSelect:"childSelect"},DynamicChildSelect=({id:e,label:t,required:r,value:n,options:o,onChange:i})=>jsxRuntime.exports.jsx(Select,Object.assign({size:"small",id:e,label:t,variant:"outlined",sx:{width:"100%"},value:n,required:r,onChange:i},{children:null==o?void 0:o.map(e=>jsxRuntime.exports.jsx(MenuItem,Object.assign({value:e.name},{children:e.name}),e.id))})),DynamicLoader=({sourceDetails:s,sourceTypesConfig:t,selectedType:r,onChange:a,onSelectChange:l})=>{const c=useStyles$2()["classes"];return jsxRuntime.exports.jsx("div",{children:function(){const e=t[r],i=null==e?void 0:e.fields;return i?Object.keys(i).map(e=>{const r=i[e];var t="dynamicField-"+(null===r||void 0===r?void 0:r.id),n=e=>{a({fieldName:null===r||void 0===r?void 0:r.id,fieldValue:e.target.value})},o=s[null===r||void 0===r?void 0:r.id];switch(r.type){case fieldType.string:return jsxRuntime.exports.jsxs(FormControl,Object.assign({sx:{width:"100%"},className:c.formControlWrapper},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:t,className:""+c.inputLabel},{children:r.isRequired?`${null===r||void 0===r?void 0:r.title} *`:null===r||void 0===r?void 0:r.title})),jsxRuntime.exports.jsx(DynamicTextField,{id:t,required:null===r||void 0===r?void 0:r.isRequired,value:o,pattern:null===r||void 0===r?void 0:r.pattern,onChange:n})]}),e);case fieldType.boolean:return jsxRuntime.exports.jsx(FormControl,Object.assign({sx:{width:"100%"},className:c.formControlWrapper},{children:jsxRuntime.exports.jsx(FormControlLabel,{control:jsxRuntime.exports.jsx(Checkbox,{}),label:r.isRequired?`${null===r||void 0===r?void 0:r.title} *`:null===r||void 0===r?void 0:r.title,onChange:e=>{a({fieldName:null===r||void 0===r?void 0:r.id,fieldValue:e.target.checked})}})}),e);case fieldType.select:return jsxRuntime.exports.jsxs(FormControl,Object.assign({sx:{width:"100%"},className:c.formControlWrapper},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:t,className:""+c.inputLabel},{children:r.isRequired?`${null===r||void 0===r?void 0:r.title} *`:null===r||void 0===r?void 0:r.title})),jsxRuntime.exports.jsx(DynamicSelect,{id:t,required:null===r||void 0===r?void 0:r.isRequired,value:null!==r&&void 0!==r&&r.allowMultiple?s[null===r||void 0===r?void 0:r.id]||[]:s[null===r||void 0===r?void 0:r.id],allowMultiple:null===r||void 0===r?void 0:r.allowMultiple,onChange:(e,t)=>{l({fieldName:null===r||void 0===r?void 0:r.id,fieldValue:e},t)},query:null===r||void 0===r?void 0:r.query,label:null===r||void 0===r?void 0:r.title})]}),e);case fieldType.childSelect:return jsxRuntime.exports.jsxs(FormControl,Object.assign({sx:{width:"100%"},className:c.formControlWrapper},{children:[jsxRuntime.exports.jsx("label",Object.assign({htmlFor:t,className:""+c.inputLabel},{children:r.isRequired?`${null===r||void 0===r?void 0:r.title} *`:null===r||void 0===r?void 0:r.title})),jsxRuntime.exports.jsx(DynamicChildSelect,{id:t,required:null===r||void 0===r?void 0:r.isRequired,value:o,label:null===r||void 0===r?void 0:r.title,options:[{id:"",name:""}],onChange:n})]}),e);default:return null}}):null}()})},useStyles$1=makeStyles()(e=>({sectionContainer:{maxHeight:"90%",overflow:"scroll",marginTop:"10px",paddingRight:"10px"},wrapper:{padding:"24px"},mainContent:{display:"flex"},title:{marginBottom:"4px"},subtitle:{marginBottom:"24px"},sourceInfoContainer:{display:"flex",marginTop:"5px",flexDirection:"column",flexGrow:"1",alignItems:"flex-start"},sourceInputsContainer:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"5px",width:"100%"},sourceInput:{margin:"0 0 24px",width:"100%"},avatarContainer:{marginTop:"5px",width:"200px",padding:"0 24px"},buttons:{display:"flex",justifyContent:"flex-end",alignItems:"flex-end",padding:"16px",Button:{color:e.palette.grey[700]}},saveButtonEnabled:{color:e.palette.primary.contrastText+" !important"}}));var headersHas,headersSet,wrapRequestOptions,RequestConstructor,EOF,nativeCreateObjectURL,nativeRevokeObjectURL,charAt$2=stringMultibyte.charAt,toString=toString$4,InternalStateModule$2=internalState,defineIterator=defineIterator$2,STRING_ITERATOR="String Iterator",setInternalState$2=InternalStateModule$2.set,getInternalState=InternalStateModule$2.getterFor(STRING_ITERATOR),fails=(defineIterator(String,"String",function(e){setInternalState$2(this,{type:STRING_ITERATOR,string:toString(e),index:0})},function(){var e=getInternalState(this),t=e.string,r=e.index;return r>=t.length?{value:void 0,done:!0}:(t=charAt$2(t,r),e.index+=t.length,{value:t,done:!1})}),fails$j),wellKnownSymbol$1=wellKnownSymbol$i,IS_PURE=isPure,ITERATOR$1=wellKnownSymbol$i("iterator"),nativeUrl=!fails(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),r=e.searchParams,n="";return e.pathname="c%20d",r.forEach(function(e,t){r.delete("b"),n+=t+e}),IS_PURE&&!e.toJSON||!r.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[ITERATOR$1]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}),makeBuiltIn=makeBuiltIn$3.exports,defineProperty=objectDefineProperty,defineBuiltInAccessor$1=function(e,t,r){return r.get&&makeBuiltIn(r.get,t,{getter:!0}),r.set&&makeBuiltIn(r.set,t,{setter:!0}),defineProperty.f(e,t,r)},anObject$1=anObject$f,iteratorClose=iteratorClose$2,callWithSafeIterationClosing$1=function(t,e,r,n){try{return n?e(anObject$1(r)[0],r[1]):e(r)}catch(e){iteratorClose(t,"throw",e)}},bind$2=functionBindContext,call$1=functionCall,toObject=toObject$4,callWithSafeIterationClosing=callWithSafeIterationClosing$1,isArrayIteratorMethod=isArrayIteratorMethod$2,isConstructor=isConstructor$2,lengthOfArrayLike=lengthOfArrayLike$4,createProperty=createProperty$2,getIterator$1=getIterator$3,getIteratorMethod$1=getIteratorMethod$4,$Array=Array,arrayFrom$1=function(e){var t,r,n,o,i,s,a=toObject(e),l=isConstructor(this),c=arguments.length,u=1<c?arguments[1]:void 0,d=void 0!==u,c=(d&&(u=bind$2(u,2<c?arguments[2]:void 0)),getIteratorMethod$1(a)),p=0;if(!c||this===$Array&&isArrayIteratorMethod(c))for(t=lengthOfArrayLike(a),r=l?new this(t):$Array(t);p<t;p++)s=d?u(a[p],p):a[p],createProperty(r,p,s);else for(i=(o=getIterator$1(a,c)).next,r=l?new this:[];!(n=call$1(i,o)).done;p++)s=d?callWithSafeIterationClosing(o,u,[n.value,p],!0):n.value,createProperty(r,p,s);return r.length=p,r},uncurryThis$2=functionUncurryThis,maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexNonASCII=/[^\0-\u007E]/,regexSeparators=/[.\u3002\uFF0E\uFF61]/g,OVERFLOW_ERROR="Overflow: input needs wider integers to process",baseMinusTMin=base-tMin,$RangeError=RangeError,exec$1=uncurryThis$2(regexSeparators.exec),floor$2=Math.floor,fromCharCode=String.fromCharCode,charCodeAt=uncurryThis$2("".charCodeAt),join$2=uncurryThis$2([].join),push$2=uncurryThis$2([].push),replace$2=uncurryThis$2("".replace),split$2=uncurryThis$2("".split),toLowerCase$1=uncurryThis$2("".toLowerCase),ucs2decode=function(e){for(var t=[],r=0,n=e.length;r<n;){var o,i=charCodeAt(e,r++);55296<=i&&i<=56319&&r<n?56320==(64512&(o=charCodeAt(e,r++)))?push$2(t,((1023&i)<<10)+(1023&o)+65536):(push$2(t,i),r--):push$2(t,i)}return t},digitToBasic=function(e){return e+22+75*(e<26)},adapt=function(e,t,r){var n=0;for(e=r?floor$2(e/damp):e>>1,e+=floor$2(e/t);baseMinusTMin*tMax>>1<e;)e=floor$2(e/baseMinusTMin),n+=base;return floor$2(n+(baseMinusTMin+1)*e/(e+skew))},encode=function(e){var t,r=[],n=(e=ucs2decode(e)).length,o=initialN,i=0,s=initialBias;for(u=0;u<e.length;u++)(t=e[u])<128&&push$2(r,fromCharCode(t));var a=r.length,l=a;for(a&&push$2(r,delimiter);l<n;){for(var c=maxInt,u=0;u<e.length;u++)o<=(t=e[u])&&t<c&&(c=t);var d=l+1;if(c-o>floor$2((maxInt-i)/d))throw $RangeError(OVERFLOW_ERROR);for(i+=(c-o)*d,o=c,u=0;u<e.length;u++){if((t=e[u])<o&&++i>maxInt)throw $RangeError(OVERFLOW_ERROR);if(t==o){for(var p=i,$=base;;){var g=$<=s?tMin:s+tMax<=$?tMax:$-s;if(p<g)break;var f=p-g,h=base-g;push$2(r,fromCharCode(digitToBasic(g+f%h))),p=floor$2(f/h),$+=base}push$2(r,fromCharCode(digitToBasic(p))),s=adapt(i,d,l==a),i=0,l++}}i++,o++}return join$2(r,"")},stringPunycodeToAscii=function(e){for(var t,r=[],n=split$2(replace$2(toLowerCase$1(e),regexSeparators,"."),"."),o=0;o<n.length;o++)t=n[o],push$2(r,exec$1(regexNonASCII,t)?"xn--"+encode(t):t);return join$2(r,".")},defineBuiltIn$2=defineBuiltIn$9,defineBuiltIns$1=function(e,t,r){for(var n in t)defineBuiltIn$2(e,n,t[n],r);return e},arraySlice$1=arraySliceSimple,floor$1=Math.floor,mergeSort=function(e,t){var r=e.length,n=floor$1(r/2);return r<8?insertionSort(e,t):merge(e,mergeSort(arraySlice$1(e,0,n),t),mergeSort(arraySlice$1(e,n),t),t)},insertionSort=function(e,t){for(var r,n,o=e.length,i=1;i<o;){for(r=e[n=i];n&&0<t(e[n-1],r);)e[n]=e[--n];n!==i++&&(e[n]=r)}return e},merge=function(e,t,r,n){for(var o=t.length,i=r.length,s=0,a=0;s<o||a<i;)e[s+a]=s<o&&a<i?n(t[s],r[a])<=0?t[s++]:r[a++]:s<o?t[s++]:r[a++];return e},arraySort$1=mergeSort,$$1=_export,global$2=global$o,call=functionCall,uncurryThis$1=functionUncurryThis,DESCRIPTORS$1=descriptors,USE_NATIVE_URL$1=nativeUrl,defineBuiltIn$1=defineBuiltIn$9,defineBuiltIns=defineBuiltIns$1,setToStringTag$1=setToStringTag$5,createIteratorConstructor=createIteratorConstructor$2,InternalStateModule$1=internalState,anInstance$1=anInstance$3,isCallable=isCallable$m,hasOwn$1=hasOwnProperty_1,bind$1=functionBindContext,classof=classof$6,anObject=anObject$f,isObject=isObject$9,$toString$1=toString$4,create=objectCreate,createPropertyDescriptor=createPropertyDescriptor$5,getIterator=getIterator$3,getIteratorMethod=getIteratorMethod$4,validateArgumentsLength$1=validateArgumentsLength$3,wellKnownSymbol=wellKnownSymbol$i,arraySort=mergeSort,ITERATOR=wellKnownSymbol$i("iterator"),URL_SEARCH_PARAMS="URLSearchParams",URL_SEARCH_PARAMS_ITERATOR=URL_SEARCH_PARAMS+"Iterator",setInternalState$1=InternalStateModule$1.set,getInternalParamsState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS),getInternalIteratorState=InternalStateModule$1.getterFor(URL_SEARCH_PARAMS_ITERATOR),getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,safeGetBuiltIn=function(e){if(!DESCRIPTORS$1)return global$2[e];e=getOwnPropertyDescriptor(global$2,e);return e&&e.value},nativeFetch=safeGetBuiltIn("fetch"),NativeRequest=safeGetBuiltIn("Request"),Headers=safeGetBuiltIn("Headers"),RequestPrototype=NativeRequest&&NativeRequest.prototype,HeadersPrototype=Headers&&Headers.prototype,RegExp$1=global$2.RegExp,TypeError$2=global$2.TypeError,decodeURIComponent=global$2.decodeURIComponent,encodeURIComponent$1=global$2.encodeURIComponent,charAt$1=uncurryThis$1("".charAt),join$1=uncurryThis$1([].join),push$1=uncurryThis$1([].push),replace$1=uncurryThis$1("".replace),shift$1=uncurryThis$1([].shift),splice=uncurryThis$1([].splice),split$1=uncurryThis$1("".split),stringSlice$1=uncurryThis$1("".slice),plus=/\+/g,sequences=Array(4),percentSequence=function(e){return sequences[e-1]||(sequences[e-1]=RegExp$1("((?:%[\\da-f]{2}){"+e+"})","gi"))},percentDecode=function(t){try{return decodeURIComponent(t)}catch(e){return t}},deserialize=function(e){var t=replace$1(e,plus," "),r=4;try{return decodeURIComponent(t)}catch(e){for(;r;)t=replace$1(t,percentSequence(r--),percentDecode);return t}},find=/[!'()~]|%20/g,replacements={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},replacer=function(e){return replacements[e]},serialize=function(e){return replace$1(encodeURIComponent$1(e),find,replacer)},URLSearchParamsIterator=createIteratorConstructor(function(e,t){setInternalState$1(this,{type:URL_SEARCH_PARAMS_ITERATOR,iterator:getIterator(getInternalParamsState(e).entries),kind:t})},"Iterator",function(){var e=getInternalIteratorState(this),t=e.kind,e=e.iterator.next(),r=e.value;return e.done||(e.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),e},!0),URLSearchParamsState=function(e){this.entries=[],this.url=null,void 0!==e&&(isObject(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===charAt$1(e,0)?stringSlice$1(e,1):e:$toString$1(e)))},URLSearchParamsConstructor=(URLSearchParamsState.prototype={type:URL_SEARCH_PARAMS,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,i,s,a=getIteratorMethod(e);if(a)for(r=(t=getIterator(e,a)).next;!(n=call(r,t)).done;){if(o=(n=getIterator(anObject(n.value))).next,(i=call(o,n)).done||(s=call(o,n)).done||!call(o,n).done)throw TypeError$2("Expected sequence with length 2");push$1(this.entries,{key:$toString$1(i.value),value:$toString$1(s.value)})}else for(var l in e)hasOwn$1(e,l)&&push$1(this.entries,{key:l,value:$toString$1(e[l])})},parseQuery:function(e){if(e)for(var t,r=split$1(e,"&"),n=0;n<r.length;)(t=r[n++]).length&&(t=split$1(t,"="),push$1(this.entries,{key:deserialize(shift$1(t)),value:deserialize(join$1(t,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],push$1(r,serialize(e.key)+"="+serialize(e.value));return join$1(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}},function(){anInstance$1(this,URLSearchParamsPrototype),setInternalState$1(this,new URLSearchParamsState(0<arguments.length?arguments[0]:void 0))}),URLSearchParamsPrototype=URLSearchParamsConstructor.prototype,web_urlSearchParams_constructor=(defineBuiltIns(URLSearchParamsPrototype,{append:function(e,t){validateArgumentsLength$1(arguments.length,2);var r=getInternalParamsState(this);push$1(r.entries,{key:$toString$1(e),value:$toString$1(t)}),r.updateURL()},delete:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this),r=t.entries,n=$toString$1(e),o=0;o<r.length;)r[o].key===n?splice(r,o,1):o++;t.updateURL()},get:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=[],o=0;o<t.length;o++)t[o].key===r&&push$1(n,t[o].value);return n},has:function(e){validateArgumentsLength$1(arguments.length,1);for(var t=getInternalParamsState(this).entries,r=$toString$1(e),n=0;n<t.length;)if(t[n++].key===r)return!0;return!1},set:function(e,t){validateArgumentsLength$1(arguments.length,1);for(var r,n=getInternalParamsState(this),o=n.entries,i=!1,s=$toString$1(e),a=$toString$1(t),l=0;l<o.length;l++)(r=o[l]).key===s&&(i?splice(o,l--,1):(i=!0,r.value=a));i||push$1(o,{key:s,value:a}),n.updateURL()},sort:function(){var e=getInternalParamsState(this);arraySort(e.entries,function(e,t){return e.key>t.key?1:-1}),e.updateURL()},forEach:function(e){for(var t,r=getInternalParamsState(this).entries,n=bind$1(e,1<arguments.length?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new URLSearchParamsIterator(this,"keys")},values:function(){return new URLSearchParamsIterator(this,"values")},entries:function(){return new URLSearchParamsIterator(this,"entries")}},{enumerable:!0}),defineBuiltIn$1(URLSearchParamsPrototype,ITERATOR,URLSearchParamsPrototype.entries,{name:"entries"}),defineBuiltIn$1(URLSearchParamsPrototype,"toString",function(){return getInternalParamsState(this).serialize()},{enumerable:!0}),setToStringTag$1(URLSearchParamsConstructor,URL_SEARCH_PARAMS),$$1({global:!0,constructor:!0,forced:!USE_NATIVE_URL$1},{URLSearchParams:URLSearchParamsConstructor}),!USE_NATIVE_URL$1&&isCallable(Headers)&&(headersHas=uncurryThis$1(HeadersPrototype.has),headersSet=uncurryThis$1(HeadersPrototype.set),wrapRequestOptions=function(e){if(isObject(e)){var t,r=e.body;if(classof(r)===URL_SEARCH_PARAMS)return t=e.headers?new Headers(e.headers):new Headers,headersHas(t,"content-type")||headersSet(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),create(e,{body:createPropertyDescriptor(0,$toString$1(r)),headers:createPropertyDescriptor(0,t)})}return e},isCallable(nativeFetch)&&$$1({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return nativeFetch(e,1<arguments.length?wrapRequestOptions(arguments[1]):{})}}),isCallable(NativeRequest)&&((RequestPrototype.constructor=RequestConstructor=function(e){return anInstance$1(this,RequestPrototype),new NativeRequest(e,1<arguments.length?wrapRequestOptions(arguments[1]):{})}).prototype=RequestPrototype,$$1({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:RequestConstructor}))),{URLSearchParams:URLSearchParamsConstructor,getState:getInternalParamsState}),$=_export,DESCRIPTORS=descriptors,USE_NATIVE_URL=nativeUrl,global$1=global$o,bind=functionBindContext,uncurryThis=functionUncurryThis,defineBuiltIn=defineBuiltIn$9,defineBuiltInAccessor=defineBuiltInAccessor$1,anInstance=anInstance$3,hasOwn=hasOwnProperty_1,assign=objectAssign,arrayFrom=arrayFrom$1,arraySlice=arraySliceSimple,codeAt=stringMultibyte.codeAt,toASCII=stringPunycodeToAscii,$toString=toString$4,setToStringTag=setToStringTag$5,validateArgumentsLength=validateArgumentsLength$3,URLSearchParamsModule=web_urlSearchParams_constructor,InternalStateModule=internalState,setInternalState=InternalStateModule.set,getInternalURLState=InternalStateModule.getterFor("URL"),URLSearchParams$1=URLSearchParamsModule.URLSearchParams,getInternalSearchParamsState=URLSearchParamsModule.getState,NativeURL=global$1.URL,TypeError$1=global$1.TypeError,parseInt=global$1.parseInt,floor=Math.floor,pow=Math.pow,charAt=uncurryThis("".charAt),exec=uncurryThis(/./.exec),join=uncurryThis([].join),numberToString=uncurryThis(1..toString),pop=uncurryThis([].pop),push=uncurryThis([].push),replace=uncurryThis("".replace),shift=uncurryThis([].shift),split=uncurryThis("".split),stringSlice=uncurryThis("".slice),toLowerCase=uncurryThis("".toLowerCase),unshift=uncurryThis([].unshift),INVALID_AUTHORITY="Invalid authority",INVALID_SCHEME="Invalid scheme",INVALID_HOST="Invalid host",INVALID_PORT="Invalid port",ALPHA=/[a-z]/i,ALPHANUMERIC=/[\d+-.a-z]/i,DIGIT=/\d/,HEX_START=/^0x/i,OCT=/^[0-7]+$/,DEC=/^\d+$/,HEX=/^[\da-f]+$/i,FORBIDDEN_HOST_CODE_POINT=/[\0\t\n\r #%/:<>?@[\\\]^|]/,FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT=/[\0\t\n\r #/:<>?@[\\\]^|]/,LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,TAB_AND_NEW_LINE=/[\t\n\r]/g,parseIPv4=function(e){var t,r,n,o,i,s,a,l=split(e,".");if(l.length&&""==l[l.length-1]&&l.length--,4<(t=l.length))return e;for(r=[],n=0;n<t;n++){if(""==(o=l[n]))return e;if(i=10,1<o.length&&"0"==charAt(o,0)&&(i=exec(HEX_START,o)?16:8,o=stringSlice(o,8==i?1:2)),""===o)s=0;else{if(!exec(10==i?DEC:8==i?OCT:HEX,o))return e;s=parseInt(o,i)}push(r,s)}for(n=0;n<t;n++)if(s=r[n],n==t-1){if(s>=pow(256,5-t))return null}else if(255<s)return null;for(a=pop(r),n=0;n<r.length;n++)a+=r[n]*pow(256,3-n);return a},parseIPv6=function(e){function t(){return charAt(e,p)}var r,n,o,i,s,a,l,c=[0,0,0,0,0,0,0,0],u=0,d=null,p=0;if(":"==t()){if(":"!=charAt(e,1))return;p+=2,d=++u}for(;t();){if(8==u)return;if(":"==t()){if(null!==d)return;p++,d=++u}else{for(r=n=0;n<4&&exec(HEX,t());)r=16*r+parseInt(t(),16),p++,n++;if("."==t()){if(0==n)return;if(p-=n,6<u)return;for(o=0;t();){if(i=null,0<o){if(!("."==t()&&o<4))return;p++}if(!exec(DIGIT,t()))return;for(;exec(DIGIT,t());){if(s=parseInt(t(),10),null===i)i=s;else{if(0==i)return;i=10*i+s}if(255<i)return;p++}c[u]=256*c[u]+i,2!=++o&&4!=o||u++}if(4!=o)return;break}if(":"==t()){if(p++,!t())return}else if(t())return;c[u++]=r}}if(null!==d)for(a=u-d,u=7;0!=u&&0<a;)l=c[u],c[u--]=c[d+a-1],c[d+--a]=l;else if(8!=u)return;return c},findLongestZeroSequence=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(r<o&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return r<o&&(t=n,r=o),t},serializeHost=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)unshift(t,e%256),e=floor(e/256);return join(t,".")}if("object"!=typeof e)return e;for(t="",n=findLongestZeroSequence(e),r=0;r<8;r++)o&&0===e[r]||(o=o&&!1,n===r?(t+=r?":":"::",o=!0):(t+=numberToString(e[r],16),r<7&&(t+=":")));return"["+t+"]"},C0ControlPercentEncodeSet={},fragmentPercentEncodeSet=assign({},C0ControlPercentEncodeSet,{" ":1,'"':1,"<":1,">":1,"`":1}),pathPercentEncodeSet=assign({},fragmentPercentEncodeSet,{"#":1,"?":1,"{":1,"}":1}),userinfoPercentEncodeSet=assign({},pathPercentEncodeSet,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),percentEncode=function(e,t){var r=codeAt(e,0);return 32<r&&r<127&&!hasOwn(t,e)?e:encodeURIComponent(e)},specialSchemes={ftp:21,file:null,http:80,https:443,ws:80,wss:443},isWindowsDriveLetter=function(e,t){return 2==e.length&&exec(ALPHA,charAt(e,0))&&(":"==(e=charAt(e,1))||!t&&"|"==e)},startsWithWindowsDriveLetter=function(e){return 1<e.length&&isWindowsDriveLetter(stringSlice(e,0,2))&&(2==e.length||"/"===(e=charAt(e,2))||"\\"===e||"?"===e||"#"===e)},isSingleDot=function(e){return"."===e||"%2e"===toLowerCase(e)},isDoubleDot=function(e){return".."===(e=toLowerCase(e))||"%2e."===e||".%2e"===e||"%2e%2e"===e},SCHEME_START={},SCHEME={},NO_SCHEME={},SPECIAL_RELATIVE_OR_AUTHORITY={},PATH_OR_AUTHORITY={},RELATIVE={},RELATIVE_SLASH={},SPECIAL_AUTHORITY_SLASHES={},SPECIAL_AUTHORITY_IGNORE_SLASHES={},AUTHORITY={},HOST={},HOSTNAME={},PORT={},FILE={},FILE_SLASH={},FILE_HOST={},PATH_START={},PATH={},CANNOT_BE_A_BASE_URL_PATH={},QUERY={},FRAGMENT={},URLState=function(e,t,r){var n,o,e=$toString(e);if(t){if(o=this.parse(e))throw TypeError$1(o);this.searchParams=null}else{if(void 0!==r&&(n=new URLState(r,!0)),o=this.parse(e,null,n))throw TypeError$1(o);(t=getInternalSearchParamsState(new URLSearchParams$1)).bindURL(this),this.searchParams=t}},URLConstructor=(URLState.prototype={type:"URL",parse:function(e,t,r){var n,o,i,s=this,a=t||SCHEME_START,l=0,c="",u=!1,d=!1,p=!1;for(e=$toString(e),t||(s.scheme="",s.username="",s.password="",s.host=null,s.port=null,s.path=[],s.query=null,s.fragment=null,s.cannotBeABaseURL=!1,e=replace(e,LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE,"")),e=replace(e,TAB_AND_NEW_LINE,""),n=arrayFrom(e);l<=n.length;){switch(o=n[l],a){case SCHEME_START:if(!o||!exec(ALPHA,o)){if(t)return INVALID_SCHEME;a=NO_SCHEME;continue}c+=toLowerCase(o),a=SCHEME;break;case SCHEME:if(o&&(exec(ALPHANUMERIC,o)||"+"==o||"-"==o||"."==o))c+=toLowerCase(o);else{if(":"!=o){if(t)return INVALID_SCHEME;c="",a=NO_SCHEME,l=0;continue}if(t&&(s.isSpecial()!=hasOwn(specialSchemes,c)||"file"==c&&(s.includesCredentials()||null!==s.port)||"file"==s.scheme&&!s.host))return;if(s.scheme=c,t)return void(s.isSpecial()&&specialSchemes[s.scheme]==s.port&&(s.port=null));c="","file"==s.scheme?a=FILE:s.isSpecial()&&r&&r.scheme==s.scheme?a=SPECIAL_RELATIVE_OR_AUTHORITY:s.isSpecial()?a=SPECIAL_AUTHORITY_SLASHES:"/"==n[l+1]?(a=PATH_OR_AUTHORITY,l++):(s.cannotBeABaseURL=!0,push(s.path,""),a=CANNOT_BE_A_BASE_URL_PATH)}break;case NO_SCHEME:if(!r||r.cannotBeABaseURL&&"#"!=o)return INVALID_SCHEME;if(r.cannotBeABaseURL&&"#"==o){s.scheme=r.scheme,s.path=arraySlice(r.path),s.query=r.query,s.fragment="",s.cannotBeABaseURL=!0,a=FRAGMENT;break}a="file"==r.scheme?FILE:RELATIVE;continue;case SPECIAL_RELATIVE_OR_AUTHORITY:if("/"!=o||"/"!=n[l+1]){a=RELATIVE;continue}a=SPECIAL_AUTHORITY_IGNORE_SLASHES,l++;break;case PATH_OR_AUTHORITY:if("/"==o){a=AUTHORITY;break}a=PATH;continue;case RELATIVE:if(s.scheme=r.scheme,o==EOF)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice(r.path),s.query=r.query;else if("/"==o||"\\"==o&&s.isSpecial())a=RELATIVE_SLASH;else if("?"==o)s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice(r.path),s.query="",a=QUERY;else{if("#"!=o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice(r.path),s.path.length--,a=PATH;continue}s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,s.path=arraySlice(r.path),s.query=r.query,s.fragment="",a=FRAGMENT}break;case RELATIVE_SLASH:if(!s.isSpecial()||"/"!=o&&"\\"!=o){if("/"!=o){s.username=r.username,s.password=r.password,s.host=r.host,s.port=r.port,a=PATH;continue}a=AUTHORITY}else a=SPECIAL_AUTHORITY_IGNORE_SLASHES;break;case SPECIAL_AUTHORITY_SLASHES:if(a=SPECIAL_AUTHORITY_IGNORE_SLASHES,"/"!=o||"/"!=charAt(c,l+1))continue;l++;break;case SPECIAL_AUTHORITY_IGNORE_SLASHES:if("/"==o||"\\"==o)break;a=AUTHORITY;continue;case AUTHORITY:if("@"==o){u&&(c="%40"+c);for(var u=!0,$=arrayFrom(c),g=0;g<$.length;g++){var f=$[g];":"!=f||p?(f=percentEncode(f,userinfoPercentEncodeSet),p?s.password+=f:s.username+=f):p=!0}c=""}else if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()){if(u&&""==c)return INVALID_AUTHORITY;l-=arrayFrom(c).length+1,c="",a=HOST}else c+=o;break;case HOST:case HOSTNAME:if(t&&"file"==s.scheme){a=FILE_HOST;continue}if(":"!=o||d){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()){if(s.isSpecial()&&""==c)return INVALID_HOST;if(t&&""==c&&(s.includesCredentials()||null!==s.port))return;if(i=s.parseHost(c))return i;if(c="",a=PATH_START,t)return;continue}"["==o?d=!0:"]"==o&&(d=!1),c+=o}else{if(""==c)return INVALID_HOST;if(i=s.parseHost(c))return i;if(c="",a=PORT,t==HOSTNAME)return}break;case PORT:if(!exec(DIGIT,o)){if(o==EOF||"/"==o||"?"==o||"#"==o||"\\"==o&&s.isSpecial()||t){if(""!=c){var h=parseInt(c,10);if(65535<h)return INVALID_PORT;s.port=s.isSpecial()&&h===specialSchemes[s.scheme]?null:h,c=""}if(t)return;a=PATH_START;continue}return INVALID_PORT}c+=o;break;case FILE:if(s.scheme="file","/"==o||"\\"==o)a=FILE_SLASH;else{if(!r||"file"!=r.scheme){a=PATH;continue}if(o==EOF)s.host=r.host,s.path=arraySlice(r.path),s.query=r.query;else if("?"==o)s.host=r.host,s.path=arraySlice(r.path),s.query="",a=QUERY;else{if("#"!=o){startsWithWindowsDriveLetter(join(arraySlice(n,l),""))||(s.host=r.host,s.path=arraySlice(r.path),s.shortenPath()),a=PATH;continue}s.host=r.host,s.path=arraySlice(r.path),s.query=r.query,s.fragment="",a=FRAGMENT}}break;case FILE_SLASH:if("/"==o||"\\"==o){a=FILE_HOST;break}r&&"file"==r.scheme&&!startsWithWindowsDriveLetter(join(arraySlice(n,l),""))&&(isWindowsDriveLetter(r.path[0],!0)?push(s.path,r.path[0]):s.host=r.host),a=PATH;continue;case FILE_HOST:if(o==EOF||"/"==o||"\\"==o||"?"==o||"#"==o){if(!t&&isWindowsDriveLetter(c))a=PATH;else if(""==c){if(s.host="",t)return;a=PATH_START}else{if(i=s.parseHost(c))return i;if("localhost"==s.host&&(s.host=""),t)return;c="",a=PATH_START}continue}c+=o;break;case PATH_START:if(s.isSpecial()){if(a=PATH,"/"!=o&&"\\"!=o)continue}else if(t||"?"!=o)if(t||"#"!=o){if(o!=EOF&&(a=PATH,"/"!=o))continue}else s.fragment="",a=FRAGMENT;else s.query="",a=QUERY;break;case PATH:if(o==EOF||"/"==o||"\\"==o&&s.isSpecial()||!t&&("?"==o||"#"==o)){if(isDoubleDot(c)?(s.shortenPath(),"/"==o||"\\"==o&&s.isSpecial()||push(s.path,"")):isSingleDot(c)?"/"==o||"\\"==o&&s.isSpecial()||push(s.path,""):("file"==s.scheme&&!s.path.length&&isWindowsDriveLetter(c)&&(s.host&&(s.host=""),c=charAt(c,0)+":"),push(s.path,c)),c="","file"==s.scheme&&(o==EOF||"?"==o||"#"==o))for(;1<s.path.length&&""===s.path[0];)shift(s.path);"?"==o?(s.query="",a=QUERY):"#"==o&&(s.fragment="",a=FRAGMENT)}else c+=percentEncode(o,pathPercentEncodeSet);break;case CANNOT_BE_A_BASE_URL_PATH:"?"==o?(s.query="",a=QUERY):"#"==o?(s.fragment="",a=FRAGMENT):o!=EOF&&(s.path[0]+=percentEncode(o,C0ControlPercentEncodeSet));break;case QUERY:t||"#"!=o?o!=EOF&&("'"==o&&s.isSpecial()?s.query+="%27":s.query+="#"==o?"%23":percentEncode(o,C0ControlPercentEncodeSet)):(s.fragment="",a=FRAGMENT);break;case FRAGMENT:o!=EOF&&(s.fragment+=percentEncode(o,fragmentPercentEncodeSet))}l++}},parseHost:function(e){var t,r,n;if("["==charAt(e,0))return"]"==charAt(e,e.length-1)&&(t=parseIPv6(stringSlice(e,1,-1)))?void(this.host=t):INVALID_HOST;if(this.isSpecial())return e=toASCII(e),exec(FORBIDDEN_HOST_CODE_POINT,e)||null===(t=parseIPv4(e))?INVALID_HOST:void(this.host=t);if(exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT,e))return INVALID_HOST;for(t="",r=arrayFrom(e),n=0;n<r.length;n++)t+=percentEncode(r[n],C0ControlPercentEncodeSet);this.host=t},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return hasOwn(specialSchemes,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&isWindowsDriveLetter(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,s=e.path,a=e.query,l=e.fragment,c=t+":";return null!==o?(c+="//",e.includesCredentials()&&(c+=r+(n?":"+n:"")+"@"),c+=serializeHost(o),null!==i&&(c+=":"+i)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?s[0]:s.length?"/"+join(s,"/"):"",null!==a&&(c+="?"+a),null!==l&&(c+="#"+l),c},setHref:function(e){e=this.parse(e);if(e)throw TypeError$1(e);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new URLConstructor(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+serializeHost(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse($toString(e)+":",SCHEME_START)},getUsername:function(){return this.username},setUsername:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=percentEncode(t[r],userinfoPercentEncodeSet)}},getPassword:function(){return this.password},setPassword:function(e){var t=arrayFrom($toString(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=percentEncode(t[r],userinfoPercentEncodeSet)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?serializeHost(e):serializeHost(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,HOST)},getHostname:function(){var e=this.host;return null===e?"":serializeHost(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,HOSTNAME)},getPort:function(){var e=this.port;return null===e?"":$toString(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=$toString(e))?this.port=null:this.parse(e,PORT))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+join(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,PATH_START))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=$toString(e))?this.query=null:("?"==charAt(e,0)&&(e=stringSlice(e,1)),this.query="",this.parse(e,QUERY)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""==(e=$toString(e))?this.fragment=null:("#"==charAt(e,0)&&(e=stringSlice(e,1)),this.fragment="",this.parse(e,FRAGMENT))},update:function(){this.query=this.searchParams.serialize()||null}},function(e){var t=anInstance(this,URLPrototype),r=1<validateArgumentsLength(arguments.length,1)?arguments[1]:void 0,r=setInternalState(t,new URLState(e,!1,r));DESCRIPTORS||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())}),URLPrototype=URLConstructor.prototype,accessorDescriptor=function(e,t){return{get:function(){return getInternalURLState(this)[e]()},set:t&&function(e){return getInternalURLState(this)[t](e)},configurable:!0,enumerable:!0}};DESCRIPTORS&&(defineBuiltInAccessor(URLPrototype,"href",accessorDescriptor("serialize","setHref")),defineBuiltInAccessor(URLPrototype,"origin",accessorDescriptor("getOrigin")),defineBuiltInAccessor(URLPrototype,"protocol",accessorDescriptor("getProtocol","setProtocol")),defineBuiltInAccessor(URLPrototype,"username",accessorDescriptor("getUsername","setUsername")),defineBuiltInAccessor(URLPrototype,"password",accessorDescriptor("getPassword","setPassword")),defineBuiltInAccessor(URLPrototype,"host",accessorDescriptor("getHost","setHost")),defineBuiltInAccessor(URLPrototype,"hostname",accessorDescriptor("getHostname","setHostname")),defineBuiltInAccessor(URLPrototype,"port",accessorDescriptor("getPort","setPort")),defineBuiltInAccessor(URLPrototype,"pathname",accessorDescriptor("getPathname","setPathname")),defineBuiltInAccessor(URLPrototype,"search",accessorDescriptor("getSearch","setSearch")),defineBuiltInAccessor(URLPrototype,"searchParams",accessorDescriptor("getSearchParams")),defineBuiltInAccessor(URLPrototype,"hash",accessorDescriptor("getHash","setHash"))),defineBuiltIn(URLPrototype,"toJSON",function(){return getInternalURLState(this).serialize()},{enumerable:!0}),defineBuiltIn(URLPrototype,"toString",function(){return getInternalURLState(this).serialize()},{enumerable:!0}),NativeURL&&(nativeCreateObjectURL=NativeURL.createObjectURL,nativeRevokeObjectURL=NativeURL.revokeObjectURL,nativeCreateObjectURL&&defineBuiltIn(URLConstructor,"createObjectURL",bind(nativeCreateObjectURL,NativeURL)),nativeRevokeObjectURL&&defineBuiltIn(URLConstructor,"revokeObjectURL",bind(nativeRevokeObjectURL,NativeURL))),setToStringTag(URLConstructor,"URL"),$({global:!0,constructor:!0,forced:!USE_NATIVE_URL,sham:!DESCRIPTORS},{URL:URLConstructor});const useStyles=makeStyles()(e=>({inputContainer:{position:"relative"},fileInput:{position:"absolute",height:1,width:1,overflow:"hidden",clip:"rect(1px, 1px, 1px, 1px)"},imageWrapper:{position:"relative",alignItems:"center",borderRadius:4,border:"1px solid #ccc",boxSizing:"border-box",cursor:"pointer",display:"flex",width:150,height:150,justifyContent:"center",overflow:"hidden"},inputLogo:{position:"relative",height:150,width:150,objectFit:"contain"},removeBtn:{backgroundColor:"rgba(255, 255, 255, .7)",color:"#000",borderRadius:"25px",padding:8,position:"absolute",right:4,top:110}})),ImageInput=({logoUrl:e,onChange:r})=>{var t=useStyles()["classes"];const n=react.exports.useRef(null),[o,i]=react.exports.useState(e),[s,a]=react.exports.useState(!1),l=useDispatch();return jsxRuntime.exports.jsxs("div",Object.assign({className:t.inputContainer},{children:[jsxRuntime.exports.jsx("input",{ref:n,id:"logo-input",name:"logo-input",type:"file",accept:"image/jpeg, image/png",onChange:e=>{var t,e=lodash.exports.get(e,"target.files[0]",null);null!==n.current&&(n.current.value=""),(e=>{e=e.type;return["image/jpeg","image/png"].includes(e)})(e)?(t=URL.createObjectURL(e),l(actions$1.setNewAvatar(e)),a(!1),i(t),r()):a(!0)},className:t.fileInput,"aria-label":"Upload Logo"}),jsxRuntime.exports.jsx("div",Object.assign({className:t.imageWrapper,role:"button"},{children:o?jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsx("img",{"data-test":"processing-center-source-image-loaded",src:o,alt:"logo",className:t.inputLogo}),jsxRuntime.exports.jsx(Icon,{"data-test":"processing-center-source-remove-image","aria-label":"Remove Image",fontSize:"large",className:t.removeBtn,onClick:()=>{o&&URL.revokeObjectURL(o),i(null),l(actions$1.setNewAvatar(null)),r()},component:default_1})]}):jsxRuntime.exports.jsx(Icon,{onClick:()=>{null!==n.current&&n.current.click()},"data-test":"processing-center-source-upload-icon",fontSize:"large",component:Upload})})),jsxRuntime.exports.jsx(FormHelperText,Object.assign({"data-test":"processing-center-sourcelogo-upload-error",error:s},{children:s?SHARED_TEXT.imageFileTypeErrorMessage():""}))]}))},SourceConfiguration=({source:r})=>{const n=useDispatch(),o=useSelector(selectNewAvatar),[i,t]=react.exports.useState((null==r?void 0:r.name)||""),[s,a]=react.exports.useState((null==(e=null==r?void 0:r.details)?void 0:e.sourceDescription)||""),[l,c]=react.exports.useState((null==r?void 0:r.details)||{}),u=useSelector(selectSourceTypes);var e=useSelector(selectSourceTypesConfig);const[d,p]=react.exports.useState(""),[$,g]=react.exports.useState(!1),[f,h]=react.exports.useState(!1),S=useSelector(selectUpdateSourceStatus),y=useSelector(selectCreateSourceStatus);var m=useStyles$1()["classes"];const b=()=>{n(hidePanel("PROCESSING_CENTER_SOURCES"))};react.exports.useEffect(()=>{n(actions$1.getSourceTypes({sourceTypes:[""]}))},[]),react.exports.useEffect(()=>{r&&c(r.details)},[r]),react.exports.useEffect(()=>{var e;p((null==(e=null==r?void 0:r.sourceType)?void 0:e.id)||"")},[null==(T=null==r?void 0:r.sourceType)?void 0:T.id]),react.exports.useEffect(()=>{!f||S!==LoadingStatus.Complete&&y!==LoadingStatus.Complete||(console.log("Closing panel on successful save"),h(!1),b())},[b,y,f,S]);var T=d&&u[d]&&Object.keys(u[d].fields||{}).map(e=>u[d].fields[e]).every(e=>e.isValid);const I=!!i&&""!==i&&T;return jsxRuntime.exports.jsxs(jsxRuntime.exports.Fragment,{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:m.sectionContainer},{children:[jsxRuntime.exports.jsx("section",{children:jsxRuntime.exports.jsxs("div",Object.assign({className:m.mainContent},{children:[jsxRuntime.exports.jsxs("div",Object.assign({className:m.sourceInfoContainer},{children:[jsxRuntime.exports.jsx(Typography$1,Object.assign({variant:"h5",className:m.title},{children:SHARED_TEXT.basicInformationTitle()})),jsxRuntime.exports.jsx(Typography$1,Object.assign({variant:"caption",className:m.subtitle},{children:SHARED_TEXT.basicInformationSubtitle()})),jsxRuntime.exports.jsxs("div",Object.assign({className:m.sourceInputsContainer},{children:[jsxRuntime.exports.jsx(TextField,{className:m.sourceInput,value:i,onChange:e=>t(e.target.value),required:!0,label:SHARED_TEXT.sourceNameTextFieldLabel()}),jsxRuntime.exports.jsx(TextField,{className:m.sourceInput,value:s,onChange:e=>a(e.target.value),label:SHARED_TEXT.sourceDescriptionTextFieldLabel(),multiline:!0,rows:4,maxRows:4})]}))]})),jsxRuntime.exports.jsxs("div",Object.assign({className:m.avatarContainer},{children:[jsxRuntime.exports.jsx(Typography$1,Object.assign({variant:"h5",className:m.title},{children:SHARED_TEXT.sourceAvatarTitle()})),jsxRuntime.exports.jsx(Typography$1,Object.assign({variant:"caption",className:m.subtitle},{children:SHARED_TEXT.sourceAvatarSubtitle()})),jsxRuntime.exports.jsx(ImageInput,{logoUrl:null!=r&&r.thumbnailUrl?null==r?void 0:r.thumbnailUrl:null,onChange:()=>g(!0)})]}))]}))}),jsxRuntime.exports.jsxs("section",{children:[jsxRuntime.exports.jsx(Select,Object.assign({size:"small",id:"sourceType",variant:"outlined",sx:{width:"100%"},value:d,disabled:!0,onChange:e=>{p(e.target.value)}},{children:Object.keys(u).map(e=>{var t;return jsxRuntime.exports.jsx(MenuItem,Object.assign({value:e},{children:null==(t=u[e])?void 0:t.name}),e)})})),jsxRuntime.exports.jsx(DynamicLoader,{sourceDetails:l,selectedType:d,sourceTypesConfig:e,onSelectChange:(e,t)=>{if(t){t=l[null==e?void 0:e.fieldName]||[],t=Object.assign(Object.assign({},l),{[null==e?void 0:e.fieldName]:[...t,...null==e?void 0:e.fieldValue]});console.log("updatedSourceDetails: ",t),c(t)}else{const r=null==e?void 0:e.fieldValue;t=Object.assign(Object.assign({},l),{[null==e?void 0:e.fieldName]:r.join("")});c(t)}},onChange:e=>{l[null==e?void 0:e.fieldName]&&c(Object.assign(Object.assign({},l),{[null==e?void 0:e.fieldName]:null==e?void 0:e.fieldValue}))}})]})]})),jsxRuntime.exports.jsxs("div",Object.assign({className:m.buttons},{children:[jsxRuntime.exports.jsx(Button$1,Object.assign({variant:"text",size:"large",sx:{marginRight:"10px"},onClick:b},{children:"Cancel"})),jsxRuntime.exports.jsx(Button$1,Object.assign({variant:"contained",size:"large",disabled:!I,onClick:()=>{var e,t;I&&(e={name:i,details:Object.assign(Object.assign({},l),{sourceDescription:s}),hasImageChanged:$,newImage:o},r?(t=Object.assign(Object.assign({},r),e),n(actions$1.updateSourceStart(t))):(t=Object.assign(Object.assign({},e),{sourceTypeId:d}),n(actions$1.createSourceStart(t))),h(!0))},className:I?m.saveButtonEnabled:""},{children:"Save"}))]}))]})};function TabPanel(e){var{children:t,value:r,index:n}=e,e=__rest(e,["children","value","index"]),o=useStyles$3()["classes"];return jsxRuntime.exports.jsx("div",Object.assign({className:o.tabPanelContainer,role:"tabpanel",hidden:r!==n,id:"source-tabpanel-"+n,"aria-labelledby":"source-tab-"+n},e,{children:r===n&&t}))}function a11yProps(e){return{id:"source-tab-"+e,"aria-controls":"source-tabpanel-"+e}}const SourceTabs=({source:e})=>{const[t,r]=react.exports.useState(0);var n=useStyles$3()["classes"];return jsxRuntime.exports.jsxs(Box$1,Object.assign({sx:{width:"100%"}},{children:[jsxRuntime.exports.jsx(Box$1,Object.assign({sx:{paddingLeft:"15px",borderBottom:.5,borderColor:"#D5DFE9"},className:n.tabContainer},{children:jsxRuntime.exports.jsxs(Tabs,Object.assign({textColor:"primary",indicatorColor:"secondary",value:t,onChange:(e,t)=>{r(t)},"aria-label":"Source Tabs"},{children:[jsxRuntime.exports.jsx(Tab,Object.assign({label:SHARED_TEXT.configurationLabel()},a11yProps(0))),jsxRuntime.exports.jsx(Tab,Object.assign({label:SHARED_TEXT.contentTemplateLabel()},a11yProps(1)))]}))})),jsxRuntime.exports.jsx(TabPanel,Object.assign({value:t,index:0},{children:jsxRuntime.exports.jsx(SourceConfiguration,{source:e})})),jsxRuntime.exports.jsx(TabPanel,Object.assign({value:t,index:1},{children:"Content Template Component goes here!"}))]}))},SourceDetail=({hidePanel:e,sourceId:t})=>{var r=useStyles$6()["classes"],n=useSelector(selectFetchSourceStatus);const o=useDispatch();var i=useSelector(selectSource),s=react.exports.useCallback(()=>{e&&e()},[e]);return n===LoadingStatus.Pending?jsxRuntime.exports.jsxs("div",Object.assign({role:"presentation","data-test":"processing-center-sources-widget",className:r.sourceContainer},{children:[jsxRuntime.exports.jsx(Header,{sourceId:t,onPanelClose:s}),jsxRuntime.exports.jsx(Box$1,Object.assign({sx:{display:"flex",width:"100%",height:"400px",alignItems:"center",justifyContent:"center"}},{children:jsxRuntime.exports.jsx(CircularProgress$1,{})}))]})):n===LoadingStatus.Failed?jsxRuntime.exports.jsxs("div",Object.assign({role:"presentation","data-test":"processing-center-sources-widget",className:r.sourceContainer},{children:[jsxRuntime.exports.jsx(Header,{sourceId:t,onPanelClose:s}),jsxRuntime.exports.jsxs("div",Object.assign({className:r.emptyStateContainer,"data-test":"empty-state-container"},{children:[jsxRuntime.exports.jsx("img",{"data-test":"empty-state-image",alt:"Empty Source",className:r.emptyImage,src:img$r}),jsxRuntime.exports.jsx(Typography$1,Object.assign({"data-test":"empty-state-title",className:r.message,variant:"h2",color:"textPrimary"},{children:SHARED_TEXT.sourceDetailsErrorMessage()})),jsxRuntime.exports.jsx(Button$1,Object.assign({variant:"contained",onClick:()=>{t&&o(actions.sourceConfiguration.fetchSourceStart(t))}},{children:SHARED_TEXT.sourceDetailsRetryButton()}))]}))]})):jsxRuntime.exports.jsxs("div",Object.assign({role:"presentation","data-test":"processing-center-sources-widget",className:r.sourceContainer},{children:[jsxRuntime.exports.jsx(Header,{sourceId:t,onPanelClose:s}),jsxRuntime.exports.jsx(SourceTabs,{source:i})]}))},ProcessingCenterSources=e=>{const t=e["sourceId"],r=useDispatch();return react.exports.useEffect(()=>{t&&(r(actions.sourceConfiguration.fetchSourceStart(t)),r(actions.sourceConfiguration.checkCanBeDeletedStart(t)))},[r,t]),jsxRuntime.exports.jsx(CacheProvider,Object.assign({value:muiCache},{children:jsxRuntime.exports.jsx(AIWareThemeProvider,{children:jsxRuntime.exports.jsx(lib.DynamicModuleLoader,Object.assign({modules:[getProcessingCenterSourcesModule()]},{children:jsxRuntime.exports.jsx(AIWareIntlProvider,{children:jsxRuntime.exports.jsx(SourceDetail,Object.assign({},e))})}))})}))};export{ProcessingCenterSources};
|