From ebbf19732f443fa3baa8971882b8fb590aee1875 Mon Sep 17 00:00:00 2001 From: John Mackey Date: Thu, 8 Aug 2024 16:34:12 +0100 Subject: [PATCH 1/8] Changed API routes for preservation and AtoM to fit new fastapi backend, fixed an error in configs modal and added better network error feedback --- src/css/vanitizer-css.css | 6 +- src/js/core/CustomPreservationConfigs.js | 270 +++++++++++-------- src/js/vanitizer/PreservationConfigsPopup.js | 103 ++++--- src/js/web-components/atom-connector.js | 4 +- src/js/web-components/atom-search.js | 2 +- 5 files changed, 230 insertions(+), 155 deletions(-) diff --git a/src/css/vanitizer-css.css b/src/css/vanitizer-css.css index 4e478a3..8577158 100644 --- a/src/css/vanitizer-css.css +++ b/src/css/vanitizer-css.css @@ -10,6 +10,10 @@ .ajxp_node_collection:has(span.metadata_chunk.metadata_chunk_standard.metadata_chunk_bytesize) .mdi-folder::before { content: "\F0254" !important; } +/**hide additional ingest dropdown**/ +.action-branding_custom_12{ + display: none !important; +} /**icon for linked AtoM tag**/ .metadata_chunk.metadata_chunk_other.metadata_chunk_usermeta-atom-linked-description::before { content: "\F0337" " Linked Description:"; /* Unicode for the desired icon and custom text */ @@ -719,7 +723,7 @@ line { background: var(--customerColourPrimary); width: 102%; border: none; - height: 10%; + height: 3em !important; transition: all 0.3s ease; } .config-save-button:hover{ diff --git a/src/js/core/CustomPreservationConfigs.js b/src/js/core/CustomPreservationConfigs.js index 85a8434..31b87bd 100644 --- a/src/js/core/CustomPreservationConfigs.js +++ b/src/js/core/CustomPreservationConfigs.js @@ -5,19 +5,6 @@ path: Curate.workspaces.getOpenWorkspace() + n._path, slug: n._metadata.get("usermeta-atom-linked-description") || "" })); - const config = JSON.parse(sessionStorage.getItem("preservationConfigs")).find(obj => obj.id == configId) - console.log("here's tha config boiiiiii", config) - if (config["dip_enabled"] == 1) { - const dipWithoutSlugs = pydio._dataModel._selectedNodes.filter(n=>!n._metadata.get("usermeta-atom-linked-description")) - if (dipWithoutSlugs?.length > 0) { - const resolveDips = Curate.ui.modals.curatePopup({title:"Search for an AtoM Description"}, {"afterLoaded":c=>{ - const s = document.createElement("dip-slug-resolver") - c.querySelector(".config-main-options-container").appendChild(s) - s.setNodes(dipWithoutSlugs) - }}) - resolveDips.fire() - } - } const bodyData = JSON.stringify({ "Paths": paths, "JobParameters": { "ConfigId": configId.toString() } }) const headers = { "accept": "application/json", @@ -53,10 +40,12 @@ }); } + // Retrieves saved preservation configs from the server at route GET /api/preservation + // Stores the configs in sessionStorage under the key "preservationConfigs" async function getPreservationConfigs() { - const url = `${window.location.protocol}//${window.location.hostname}:6900/get_data`; + const url = `${window.location.protocol}//${window.location.hostname}/api/preservation`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); - return fetch(url, {headers: {"Authorization": `Bearer ${token}`}}) + return fetch(url, {headers: {"Authorization": `Bearer ${token}`}, method: "GET"}) .then(response => { if (!response.ok) { throw new Error(`HTTP error! Status: ${response.status}`); @@ -248,7 +237,7 @@ const titleElement = document.createElement('div'); titleElement.textContent = title; titleElement.classList.add('config-popup-title'); - + // Add title to modal content modalContent.appendChild(titleElement); // add main controls container @@ -286,8 +275,8 @@ input.dispatchEvent(new CustomEvent('change', { bubbles: true })) input.dispatchEvent(new CustomEvent('input', { bubbles: true })) }) - - + + }) modalScrollContainer.appendChild(clearButton) const optionsContainer = document.createElement('div') @@ -300,7 +289,7 @@ modifyTitle.style = "padding-bottom: 1em !important" optionsContainer.appendChild(modifyTitle) optionsContainer.appendChild(modalScrollContainer) - + const savedScrollContainer = document.createElement('div') savedScrollContainer.classList.add('config-modal-scroll-container') //create and append save button to config options area @@ -311,7 +300,7 @@ //validate save const curConfigs = JSON.parse(sessionStorage.getItem("preservationConfigs")) const saveName = optionsContainer.querySelector("#name").value - + // Flatten the input labels const inputIds = inputs.flatMap(category => { return category.inputs.map(input => input.name) @@ -323,9 +312,9 @@ })); }); const curConfig = {} - const matchingObj = curConfigs.find(obj => obj.name == saveName); + const matchingObj = curConfigs?.find(obj => obj.name == saveName); if (matchingObj) { - curConfig["id"] = matchingObj.id; + curConfig["id"] = matchingObj.id; // we're editing an already saved config } else { curConfig["user"] = pydio.user.id //created user is this one } @@ -334,6 +323,9 @@ if (!input) { return } + if (input.type == "submit") { //do not add "go to atom config" button + return + } if (input.disabled) { curConfig[id.toLowerCase()] = false } @@ -355,7 +347,10 @@ } } }) - setPreservationConfig(curConfig) + if (matchingObj){ //edit existing config + editPreservationConfig(curConfig) + }else{ + setPreservationConfig(curConfig) //save new config .then(r => { if (r) { const curConfigs = JSON.parse(sessionStorage.getItem("preservationConfigs")) @@ -372,6 +367,8 @@ }) } }) + } + }) optionsContainer.appendChild(saveConfig) mainOptionsContainer.appendChild(optionsContainer) @@ -390,6 +387,7 @@ //create and add the saved configs area const savedConfigsContainer = document.createElement('div') savedConfigsContainer.classList.add('config-options-container') + savedConfigsContainer.id = "savedConfigsContainer" savedConfigsContainer.style = "display:flex;align-items:center;justify-content:flex-start;flex-direction:column;" //create and add title to saved configs area const savedTitle = document.createElement('div') @@ -398,7 +396,7 @@ savedTitle.textContent = "Saved Configs" savedConfigsContainer.appendChild(savedTitle) const savedConfigs = JSON.parse(sessionStorage.getItem("preservationConfigs")) - createConfigsBox(savedScrollContainer, savedConfigs) + createConfigsBox(savedScrollContainer, savedConfigsContainer, savedConfigs) savedConfigsContainer.appendChild(savedScrollContainer) mainOptionsContainer.appendChild(savedConfigsContainer); // Append modal container to the body @@ -417,10 +415,11 @@ document.body.appendChild(modalContainer); // Display the modal modalContainer.style.display = 'flex'; - + } - function createConfigsBox(target, configs) { - configs.forEach(config => { + + function createConfigsBox(target, container, configs) { + configs?.forEach(config => { const configItem = document.createElement('div') configItem.id = "config-" + config.id configItem.classList.add('saved-config-item') @@ -442,7 +441,7 @@ // Construct the input field ID using the object property key var inputFieldId = '#' + prop; // Assuming the input IDs have a "#" prefix var inputField = document.querySelector(inputFieldId); - + // Check if an input field with the corresponding ID exists if (inputField) { if (inputField.type == "checkbox") { @@ -470,7 +469,7 @@ configLabel.style.marginBottom = "0" const configDetails = document.createElement('label') configDetails.classList.add('config-text-label') - + const configDescription = document.createElement('div') const descriptionLabel = document.createElement('label') descriptionLabel.for = "config-description-" + config.id @@ -480,8 +479,8 @@ descriptionText.id = "config-description-" + config.id configDescription.appendChild(descriptionLabel) configDescription.appendChild(descriptionText) - - + + const configCreatedDate = document.createElement('div') const createdLabel = document.createElement('label') createdLabel.for = "config-created-date-" + config.id @@ -491,7 +490,7 @@ createdText.textContent = config.created configCreatedDate.appendChild(createdLabel) configCreatedDate.appendChild(createdText) - + const configModified = document.createElement('div') const modifiedLabel = document.createElement('label') modifiedLabel.for = "config-modified-date-" + config.id @@ -501,7 +500,7 @@ modifiedText.textContent = config.modified configModified.appendChild(modifiedLabel) configModified.appendChild(modifiedText) - + const configUser = document.createElement('div') const userLabel = document.createElement('label') userLabel.id = "config-user-" + config.id @@ -511,12 +510,12 @@ userText.textContent = config.user configUser.appendChild(userLabel) configUser.appendChild(userText) - + configDetails.appendChild(configDescription) configDetails.appendChild(configCreatedDate) configDetails.appendChild(configModified) configDetails.appendChild(configUser) - + configInfo.appendChild(configLabel) configInfo.appendChild(configDetails) const configDelete = document.createElement('button') @@ -593,15 +592,30 @@ target.appendChild(configItem) }) const savedItems = target.querySelectorAll(".saved-config-item") - savedItems.forEach((el, index) => el.style.animationDelay = `${(index * 0.55) / savedItems.length}s`); - savedItems.forEach((el, index, array) => { + savedItems?.forEach((el, index) => el.style.animationDelay = `${(index * 0.55) / savedItems.length}s`); + savedItems?.forEach((el, index, array) => { const delay = 0.05 * (index + 1); const duration = 1.0 - delay; el.style.animationDelay = `${delay}s`; el.style.animationDuration = `${duration}s`; }); - - + if (!configs || configs?.length == 0) { + + const noConfigs = document.createElement("div") + noConfigs.textContent = "No Saved Preservation Configs Found" + noConfigs.style.margin = "3em"; + noConfigs.style.width = "80%"; + noConfigs.style.height = "10%"; + noConfigs.style.textAlign = "center"; + noConfigs.style.display = "flex"; + noConfigs.style.color = "white"; + noConfigs.style.background = "var(--md-sys-color-outline-variant-50)"; + noConfigs.style.justifyContent = "center"; + noConfigs.style.alignItems = "center"; + noConfigs.style.borderRadius = "1.5em"; + container.appendChild(noConfigs) + } + } function createInput(input, target) { const inputContainer = document.createElement('div'); @@ -747,7 +761,7 @@ } } async function deletePreservationConfig(id) { - const url = `${window.location.protocol}//${window.location.hostname}:6900/delete_data/${id}`; + const url = `${window.location.protocol}//${window.location.hostname}/preservation/${id}`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "DELETE", @@ -757,24 +771,59 @@ 'Authorization': `Bearer ${token}` } }) - .then(response => { - if (!response.ok) { - throw new Error(`HTTP error! Status: ${response.status}`); - } - return response.json(); - }) - .then(data => { - // Check if the delete was successful based on the response data or status - if (data) { - getPreservationConfigs() - return data; // Return the response data - } else { - throw new Error('Delete operation failed.'); - } - }) + .then(response => { + if (!response.ok) { + throw new Error(`HTTP error! Status: ${response.status}`); + } + return response.json(); + }) + .then(data => { + // Check if the delete was successful based on the response data or status + if (data) { + getPreservationConfigs() + return data; // Return the response data + } else { + throw new Error('Delete operation failed.'); + } + }) + .catch(error => { + console.error('Fetch error:', error); + Curate.ui.modals.curatePopup({"title": "Error", "type": "error","content": "There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire() + }); } + // Saves the given preservation config to the server at route POST /preservation async function setPreservationConfig(config) { - const url = `${window.location.protocol}//${window.location.hostname}:6900/set_data`; + const url = `${window.location.protocol}//${window.location.hostname}/preservation`; + const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); + return fetch(url, { + method: "POST", + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + 'Authorization': `Bearer ${token}` + }, + body: JSON.stringify(config) + }) + .then(response => { + if (!response.ok) { + throw new Error(`HTTP error! Status: ${response.status}`); + } else if (response.status == 200) { + //save configs to session + console.info("config saved successfully") + return response.json(); + } + }) + .catch(error => { + console.error('Fetch error:', error); + Curate.ui.modals.curatePopup({"title": "Error", "type": "error","content": "There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire() + }); + } + function flattenAndReplaceSpaces(input) { + if (!input || typeof input !== "string") return ""; + return input.replaceAll(" ", "_"); + } + async function editPreservationConfig(config) { + const url = `${window.location.protocol}//${window.location.hostname}/api/preservation/${config.id}`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "POST", @@ -787,8 +836,8 @@ }) .then(response => { if (!response.ok) { - throw new Error(`HTTP error! Status: ${response.status}`); - } else if (response.status == 200) { + throw new Error(`HTTP error while updating config, Status: ${response.status}`); + }else if (response.status == 200) { //save configs to session console.info("config saved successfully") return response.json(); @@ -796,62 +845,61 @@ }) .catch(error => { console.error('Fetch error:', error); + Curate.ui.modals.curatePopup({"title": "Error", "type": "error","content": "There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire() }); - } - function flattenAndReplaceSpaces(input) { - if (!input || typeof input !== "string") return ""; - return input.replaceAll(" ", "_"); - } - // Example usage: + } + + // inputs for preservation config fields const inputs = [ - { - category: "Details", inputs: [ - { label: "Config Name", name: "name", type: "text" }, - { label: "Config Description", name: "description", type: "text" } - ] - }, - { - category: "Normalisation", inputs: [ - { - label: "Normalise Objects", name: "normalize", type: "toggle", suboptions: [ - { label: "Image Normalisation Format", name: "image_normalization_tiff", type: "dropdown", options: ["TIFF", "JPEG2000"] }, - ] - }, - ] - }, - { - category: "Packaging and Compression", inputs: [ - { label: "AIP Packaging Type", name: "process_type", type: "dropdown", options: ["standard", "eark"] }, - { - label: "Compress AIPs", name: "compress_aip", type: "toggle", suboptions: [ - { label: "Warning", name: "compression_warning", type: "info", text: "Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace." }, - { - label: "Compression Algorithm", name: "compression_algorithm", type: "dropdown", options: [ - "tar", - "tar_bzip2", - "tar_gzip", - "s7_copy ", - "s7_bzip2", - "s7_lzma", - ] - }, - { label: "Compression Level", name: "compression_level", type: "slider", min: 1, range: 9, step: 1 }, - ] - }, - ] - }, - { - category: "Transfer Options", inputs: [ - { label: "Generate Transfer Structure Report", name: "gen_transfer_struct_report", type: "toggle" }, - { label: "Document Empty Directories", name: "document_empty_directories", type: "toggle" }, - { - label: "Extract Packages", name: "extract_packages", type: "toggle", suboptions: [ - { label: "Delete Packages After Extraction", name: "delete_packages_after_extraction", type: "toggle" } - ] - } + { category: "Details", inputs: [ + { label: "Config Name", name: "name", type: "text" }, + { label: "Config Description", name: "description", type: "text" } + ]}, + { category: "Normalisation", inputs: [ + { label: "Normalise Objects", name: "normalize",type: "toggle", suboptions:[ + { label: "Image Normalisation Format", name: "image_normalization_tiff",type: "dropdown", options:["TIFF", "JPEG2000"] }, + ]}, + ]}, + // I am removing this for now because we are not using it, instead we are inferring DIP requirement from presence of an AtoM link on an object. I think we will need to go back to this later to enable reingest. + /**{ category: "Dissemination", inputs: [ + { label: "Create Dissemination Package", name: "dip_enabled", type:"toggle", suboptions: [ + { label: "Dissemination Information", name: "dip_info", type:"info", text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."}, + { label: "Go to AtoM Configuration", name: "atom_config", type:"button", text:"Go to AtoM Configuration", onclick:e => { + const p = Curate.ui.modals.curatePopup({"title": "Connect to Your AtoM Instance"},{ + "afterLoaded":(c)=>{ + const t = document.createElement("connect-to-atom") + c.querySelector(".config-main-options-container").appendChild(t) + } + }) + p.fire() + }}, ] - } - ]; + }] + },**/ + { category: "Packaging and Compression", inputs: [ + { label: "AIP Packaging Type", name: "process_type", type:"dropdown", options:["standard", "eark"] }, + { label: "Compress AIPs", name: "compress_aip",type:"toggle", suboptions:[ + { label: "Warning", name: "compression_warning", type:"info", text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."}, + { label:"Compression Algorithm", name: "compression_algorithm",type:"dropdown", options:[ + "tar", + "tar_bzip2", + "tar_gzip", + "s7_copy ", + "s7_bzip2", + "s7_lzma", + ] + }, + { label:"Compression Level", name: "compression_level",type:"slider", min:1,range:9, step:1}, + ]}, + ]}, + { category: "Transfer Options", inputs: [ + { label:"Generate Transfer Structure Report", name: "gen_transfer_struct_report", type:"toggle"}, + { label:"Document Empty Directories", name: "document_empty_directories", type:"toggle"}, + { label:"Extract Packages", name: "extract_packages", type:"toggle", suboptions:[ + { label:"Delete Packages After Extraction", name: "delete_packages_after_extraction", type:"toggle"} + ]} + ]} + ]; document.addEventListener("dynamicScriptLoaded", e => { (async function() { diff --git a/src/js/vanitizer/PreservationConfigsPopup.js b/src/js/vanitizer/PreservationConfigsPopup.js index 8956986..4830886 100644 --- a/src/js/vanitizer/PreservationConfigsPopup.js +++ b/src/js/vanitizer/PreservationConfigsPopup.js @@ -86,7 +86,7 @@ function createCuratePopup(title, inputs) { })); }); const curConfig = {} - const matchingObj = curConfigs.find(obj => obj.name == saveName); + const matchingObj = curConfigs?.find(obj => obj.name == saveName); if (matchingObj) { curConfig["id"] = matchingObj.id; // we're editing an already saved config } else { @@ -161,6 +161,7 @@ function createCuratePopup(title, inputs) { //create and add the saved configs area const savedConfigsContainer = document.createElement('div') savedConfigsContainer.classList.add('config-options-container') + savedConfigsContainer.id = "savedConfigsContainer" savedConfigsContainer.style = "display:flex;align-items:center;justify-content:flex-start;flex-direction:column;" //create and add title to saved configs area const savedTitle = document.createElement('div') @@ -169,7 +170,7 @@ function createCuratePopup(title, inputs) { savedTitle.textContent = "Saved Configs" savedConfigsContainer.appendChild(savedTitle) const savedConfigs = JSON.parse(sessionStorage.getItem("preservationConfigs")) - createConfigsBox(savedScrollContainer, savedConfigs) + createConfigsBox(savedScrollContainer, savedConfigsContainer, savedConfigs) savedConfigsContainer.appendChild(savedScrollContainer) mainOptionsContainer.appendChild(savedConfigsContainer); // Append modal container to the body @@ -191,7 +192,7 @@ function createCuratePopup(title, inputs) { } async function getPreservationConfigs() { - const url = `${window.location.origin}:6900/preservation`; + const url = `${window.location.protocol}//${window.location.hostname}/api/preservation`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: 'GET', @@ -214,7 +215,7 @@ async function getPreservationConfigs() { }); } async function editPreservationConfig(config) { - const url = `${window.location.origin}:6900/preservation/${config.id}`; + const url = `${window.location.protocol}//${window.location.hostname}/api/preservation/${config.id}`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "POST", @@ -236,10 +237,11 @@ async function editPreservationConfig(config) { }) .catch(error => { console.error('Fetch error:', error); + Curate.ui.modals.curatePopup({"title": "Error", "type": "error","content": "There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire() }); } async function setPreservationConfig(config) { - const url = `${window.location.origin}:6900/preservation`; + const url = `${window.location.protocol}//${window.location.hostname}/api/preservation`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "POST", @@ -250,21 +252,22 @@ async function setPreservationConfig(config) { }, body: JSON.stringify(config) }) - .then(response => { - if (!response.ok) { - throw new Error(`HTTP error while creating config, Status: ${response.status}`); - } else if (response.status == 200) { - //save configs to session - console.info("config saved successfully") - return response.json(); - } - }) - .catch(error => { - console.error('Fetch error:', error); - }); + .then(response => { + if (!response.ok) { + throw new Error(`HTTP error while creating config, Status: ${response.status}`); + } else if (response.status == 200) { + //save configs to session + console.info("config saved successfully") + return response.json(); + } + }) + .catch(error => { + console.error('Fetch error:', error); + Curate.ui.modals.curatePopup({"title": "Error", "type": "error","content": "There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire() + }); } async function deletePreservationConfig(id) { - const url = `${window.location.origin}:6900/preservation/${id}`; + const url = `${window.location.protocol}//${window.location.hostname}/api/preservation/${id}`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "DELETE", @@ -274,24 +277,28 @@ async function deletePreservationConfig(id) { 'Authorization': `Bearer ${token}` } }) - .then(response => { - if (!response.ok) { - throw new Error(`HTTP error! Status: ${response.status}`); - } - return response.json(); - }) - .then(data => { - // Check if the delete was successful based on the response data or status - if (data) { - getPreservationConfigs() - return data; // Return the response data - } else { - throw new Error('Delete operation failed.'); - } - }) + .then(response => { + if (!response.ok) { + throw new Error(`HTTP error! Status: ${response.status}`); + } + return response.json(); + }) + .then(data => { + // Check if the delete was successful based on the response data or status + if (data) { + getPreservationConfigs() + return data; // Return the response data + } else { + throw new Error('Delete operation failed.'); + } + }) + .catch(error => { + console.error('Fetch error:', error); + Curate.ui.modals.curatePopup({"title": "Error", "type": "error","content": "There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire() + }); } -function createConfigsBox(target, configs) { - configs.forEach(config => { +function createConfigsBox(target, container, configs) { + configs?.forEach(config => { const configItem = document.createElement('div') configItem.id = "config-" + config.id configItem.classList.add('saved-config-item') @@ -464,14 +471,29 @@ function createConfigsBox(target, configs) { target.appendChild(configItem) }) const savedItems = target.querySelectorAll(".saved-config-item") - savedItems.forEach((el, index) => el.style.animationDelay = `${(index * 0.55) / savedItems.length}s`); - savedItems.forEach((el, index, array) => { + savedItems?.forEach((el, index) => el.style.animationDelay = `${(index * 0.55) / savedItems.length}s`); + savedItems?.forEach((el, index, array) => { const delay = 0.05 * (index + 1); const duration = 1.0 - delay; el.style.animationDelay = `${delay}s`; el.style.animationDuration = `${duration}s`; }); + if (!configs || configs?.length == 0) { + const noConfigs = document.createElement("div") + noConfigs.textContent = "No Saved Preservation Configs Found" + noConfigs.style.margin = "3em"; + noConfigs.style.width = "80%"; + noConfigs.style.height = "10%"; + noConfigs.style.textAlign = "center"; + noConfigs.style.display = "flex"; + noConfigs.style.color = "white"; + noConfigs.style.background = "var(--md-sys-color-outline-variant-50)"; + noConfigs.style.justifyContent = "center"; + noConfigs.style.alignItems = "center"; + noConfigs.style.borderRadius = "1.5em"; + container.appendChild(noConfigs) + } } function createInput(input, target) { @@ -630,7 +652,7 @@ function createInput(input, target) { } } -// Example usage: + const inputs = [ { category: "Details", inputs: [ { label: "Config Name", name: "name", type: "text" }, @@ -641,7 +663,8 @@ const inputs = [ { label: "Image Normalisation Format", name: "image_normalization_tiff",type: "dropdown", options:["TIFF", "JPEG2000"] }, ]}, ]}, -{ category: "Dissemination", inputs: [ +// I am removing this for now because we are not using it, instead we are inferring DIP requirement from presence of an AtoM link on an object. I think we will need to go back to this later to enable reingest. +/**{ category: "Dissemination", inputs: [ { label: "Create Dissemination Package", name: "dip_enabled", type:"toggle", suboptions: [ { label: "Dissemination Information", name: "dip_info", type:"info", text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."}, { label: "Go to AtoM Configuration", name: "atom_config", type:"button", text:"Go to AtoM Configuration", onclick:e => { @@ -655,7 +678,7 @@ const inputs = [ }}, ] }] -}, +},**/ { category: "Packaging and Compression", inputs: [ { label: "AIP Packaging Type", name: "process_type", type:"dropdown", options:["standard", "eark"] }, { label: "Compress AIPs", name: "compress_aip",type:"toggle", suboptions:[ diff --git a/src/js/web-components/atom-connector.js b/src/js/web-components/atom-connector.js index 403a18e..459210a 100644 --- a/src/js/web-components/atom-connector.js +++ b/src/js/web-components/atom-connector.js @@ -12,7 +12,7 @@ class ConnectToAtom extends HTMLElement { async retrieveDetails() { try { - const response = await Curate.api.fetchCurate(':6900/atom', 'GET'); + const response = await Curate.api.fetchCurate('/api/atom', 'GET'); this.apiKey = response.atom_api_key; this.atomUrl = response.atom_url; this.username = response.atom_username; @@ -25,7 +25,7 @@ class ConnectToAtom extends HTMLElement { saveDetails(e) { e.preventDefault(); - Curate.api.fetchCurate('/atom/config', 'PUT', { + Curate.api.fetchCurate('/api/atom', 'POST', { apiKey: this.apiKey, atomUrl: this.atomUrl, username: this.username, diff --git a/src/js/web-components/atom-search.js b/src/js/web-components/atom-search.js index 6567ff5..744df8e 100644 --- a/src/js/web-components/atom-search.js +++ b/src/js/web-components/atom-search.js @@ -64,7 +64,7 @@ class AtoMSearchInterface extends HTMLElement { // No need to append 'limit' as it's fixed on the API side try { - const url = `${window.location.protocol}//${window.location.hostname}:6900/atom/search`; + const url = `${window.location.protocol}//${window.location.hostname}/api/search`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); const response = await fetch(`${url}?${params.toString()}`, { headers: { From b48d36256616562c0142fb88df9d63817bb21898 Mon Sep 17 00:00:00 2001 From: John Mackey Date: Thu, 8 Aug 2024 16:35:01 +0100 Subject: [PATCH 2/8] build --- dist/4.4.1/main_4.4.1.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/4.4.1/main_4.4.1.js b/dist/4.4.1/main_4.4.1.js index 5c8e1fd..bfd8ca8 100644 --- a/dist/4.4.1/main_4.4.1.js +++ b/dist/4.4.1/main_4.4.1.js @@ -1 +1 @@ -(()=>{var e={125:()=>{async function e(){const e=`${window.location.protocol}//${window.location.hostname}:6900/get_data`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.parse(sessionStorage.getItem("preservationConfigs")).find((t=>t.id==e));if(console.log("here's tha config boiiiiii",i),1==i.dip_enabled){const e=pydio._dataModel._selectedNodes.filter((e=>!e._metadata.get("usermeta-atom-linked-description")));e?.length>0&&Curate.ui.modals.curatePopup({title:"Search for an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("dip-slug-resolver");t.querySelector(".config-main-options-container").appendChild(n),n.setNodes(e)}}).fire()}const a=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:a}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),async function(e){const t=`${window.location.protocol}//${window.location.hostname}:6900/set_data`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e)}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n){n.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.for="config-created-date-"+n.id,p.textContent="Created: ";const u=document.createElement("span");u.id="config-created-date-"+n.id,u.textContent=n.created,c.appendChild(p),c.appendChild(u);const m=document.createElement("div"),h=document.createElement("label");h.for="config-modified-date-"+n.id,h.textContent="Modified: ";const g=document.createElement("span");g.id="config-modified-date-"+n.id,g.textContent=n.modified,m.appendChild(h),m.appendChild(g);const f=document.createElement("div"),y=document.createElement("label");y.id="config-user-"+n.id,y.textContent="User: ";const b=document.createElement("span");b.id="config-user-"+n.id,b.textContent=n.user,f.appendChild(y),f.appendChild(b),r.appendChild(s),r.appendChild(c),r.appendChild(m),r.appendChild(f),i.appendChild(a),i.appendChild(r);const v=document.createElement("button");v.classList.add("saved-config-delete"),v.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",v.style.backgroundColor="#ff2c2c"})),v.addEventListener("mouseleave",(e=>{v.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),v.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.protocol}//${window.location.hostname}:6900/delete_data/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),v.textContent="Delete Config";const x=document.createElement("div");x.classList.add("config-bookmark-container"),x.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const w=document.createElement("span"),C=JSON.parse(localStorage.getItem(n.id.toString()));C&&C.bookmarked?w.classList.add("mdi-star"):w.classList.add("mdi-star-outline"),x.appendChild(w),o.appendChild(x),o.appendChild(i),o.appendChild(v),t.appendChild(o)}));const o=t.querySelectorAll(".saved-config-item");o.forEach(((e,t)=>e.style.animationDelay=.55*t/o.length+"s")),o.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`}))}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(!(pydio._dataModel._selectedNodes.length>1)&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate(":6900/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/atom/config","PUT",{apiKey:this.apiKey,atomUrl:this.atomUrl,username:this.username,password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}:6900/atom/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file +(()=>{var e={125:()=>{async function e(){const e=`${window.location.protocol}//${window.location.hostname}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.protocol}//${window.location.hostname}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.protocol}//${window.location.hostname}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.for="config-created-date-"+n.id,p.textContent="Created: ";const u=document.createElement("span");u.id="config-created-date-"+n.id,u.textContent=n.created,c.appendChild(p),c.appendChild(u);const m=document.createElement("div"),h=document.createElement("label");h.for="config-modified-date-"+n.id,h.textContent="Modified: ";const g=document.createElement("span");g.id="config-modified-date-"+n.id,g.textContent=n.modified,m.appendChild(h),m.appendChild(g);const f=document.createElement("div"),y=document.createElement("label");y.id="config-user-"+n.id,y.textContent="User: ";const b=document.createElement("span");b.id="config-user-"+n.id,b.textContent=n.user,f.appendChild(y),f.appendChild(b),r.appendChild(s),r.appendChild(c),r.appendChild(m),r.appendChild(f),i.appendChild(a),i.appendChild(r);const v=document.createElement("button");v.classList.add("saved-config-delete"),v.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",v.style.backgroundColor="#ff2c2c"})),v.addEventListener("mouseleave",(e=>{v.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),v.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.protocol}//${window.location.hostname}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),v.textContent="Delete Config";const x=document.createElement("div");x.classList.add("config-bookmark-container"),x.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const w=document.createElement("span"),C=JSON.parse(localStorage.getItem(n.id.toString()));C&&C.bookmarked?w.classList.add("mdi-star"):w.classList.add("mdi-star-outline"),x.appendChild(w),o.appendChild(x),o.appendChild(i),o.appendChild(v),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(!(pydio._dataModel._selectedNodes.length>1)&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{apiKey:this.apiKey,atomUrl:this.atomUrl,username:this.username,password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file From 00b55996147cf6f5387e863712774650f60c110c Mon Sep 17 00:00:00 2001 From: John Mackey Date: Fri, 9 Aug 2024 15:33:09 +0100 Subject: [PATCH 3/8] additional fixes to routes, small bugfix in OAI enabler --- dist/4.4.1/main_4.4.1.js | 2 +- src/css/vanitizer-css.css | 1 + src/js/core/CustomPreservationConfigs.js | 26 ++------ src/js/core/PassOaiToChildren.js | 3 +- src/js/vanitizer/PreservationConfigsPopup.js | 63 ++++++++++---------- src/js/web-components/atom-connector.js | 4 +- 6 files changed, 42 insertions(+), 57 deletions(-) diff --git a/dist/4.4.1/main_4.4.1.js b/dist/4.4.1/main_4.4.1.js index bfd8ca8..fbf52be 100644 --- a/dist/4.4.1/main_4.4.1.js +++ b/dist/4.4.1/main_4.4.1.js @@ -1 +1 @@ -(()=>{var e={125:()=>{async function e(){const e=`${window.location.protocol}//${window.location.hostname}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.protocol}//${window.location.hostname}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.protocol}//${window.location.hostname}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.for="config-created-date-"+n.id,p.textContent="Created: ";const u=document.createElement("span");u.id="config-created-date-"+n.id,u.textContent=n.created,c.appendChild(p),c.appendChild(u);const m=document.createElement("div"),h=document.createElement("label");h.for="config-modified-date-"+n.id,h.textContent="Modified: ";const g=document.createElement("span");g.id="config-modified-date-"+n.id,g.textContent=n.modified,m.appendChild(h),m.appendChild(g);const f=document.createElement("div"),y=document.createElement("label");y.id="config-user-"+n.id,y.textContent="User: ";const b=document.createElement("span");b.id="config-user-"+n.id,b.textContent=n.user,f.appendChild(y),f.appendChild(b),r.appendChild(s),r.appendChild(c),r.appendChild(m),r.appendChild(f),i.appendChild(a),i.appendChild(r);const v=document.createElement("button");v.classList.add("saved-config-delete"),v.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",v.style.backgroundColor="#ff2c2c"})),v.addEventListener("mouseleave",(e=>{v.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),v.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.protocol}//${window.location.hostname}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),v.textContent="Delete Config";const x=document.createElement("div");x.classList.add("config-bookmark-container"),x.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const w=document.createElement("span"),C=JSON.parse(localStorage.getItem(n.id.toString()));C&&C.bookmarked?w.classList.add("mdi-star"):w.classList.add("mdi-star-outline"),x.appendChild(w),o.appendChild(x),o.appendChild(i),o.appendChild(v),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(!(pydio._dataModel._selectedNodes.length>1)&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{apiKey:this.apiKey,atomUrl:this.atomUrl,username:this.username,password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file +(()=>{var e={125:()=>{async function e(){const e=`${window.location.protocol}//${window.location.hostname}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.protocol}//${window.location.hostname}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.protocol}//${window.location.hostname}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.protocol}//${window.location.hostname}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&!e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{api_key:this.apiKey,atom_url:this.atomUrl,username:this.username,password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file diff --git a/src/css/vanitizer-css.css b/src/css/vanitizer-css.css index 8577158..5aebff1 100644 --- a/src/css/vanitizer-css.css +++ b/src/css/vanitizer-css.css @@ -652,6 +652,7 @@ line { margin-top: 1em !important; margin-bottom: 1em !important; overflow-y: scroll; + max-height: 69vh; } /* Styling for each configuration item */ .saved-config-item { diff --git a/src/js/core/CustomPreservationConfigs.js b/src/js/core/CustomPreservationConfigs.js index 31b87bd..eb2f0cc 100644 --- a/src/js/core/CustomPreservationConfigs.js +++ b/src/js/core/CustomPreservationConfigs.js @@ -419,6 +419,7 @@ } function createConfigsBox(target, container, configs) { + console.log(configs) configs?.forEach(config => { const configItem = document.createElement('div') configItem.id = "config-" + config.id @@ -481,25 +482,7 @@ configDescription.appendChild(descriptionText) - const configCreatedDate = document.createElement('div') - const createdLabel = document.createElement('label') - createdLabel.for = "config-created-date-" + config.id - createdLabel.textContent = "Created: " - const createdText = document.createElement('span') - createdText.id = "config-created-date-" + config.id - createdText.textContent = config.created - configCreatedDate.appendChild(createdLabel) - configCreatedDate.appendChild(createdText) - - const configModified = document.createElement('div') - const modifiedLabel = document.createElement('label') - modifiedLabel.for = "config-modified-date-" + config.id - modifiedLabel.textContent = "Modified: " - const modifiedText = document.createElement('span') - modifiedText.id = "config-modified-date-" + config.id - modifiedText.textContent = config.modified - configModified.appendChild(modifiedLabel) - configModified.appendChild(modifiedText) + const configUser = document.createElement('div') const userLabel = document.createElement('label') @@ -512,8 +495,7 @@ configUser.appendChild(userText) configDetails.appendChild(configDescription) - configDetails.appendChild(configCreatedDate) - configDetails.appendChild(configModified) + configDetails.appendChild(configUser) configInfo.appendChild(configLabel) @@ -807,7 +789,7 @@ .then(response => { if (!response.ok) { throw new Error(`HTTP error! Status: ${response.status}`); - } else if (response.status == 200) { + } else { //save configs to session console.info("config saved successfully") return response.json(); diff --git a/src/js/core/PassOaiToChildren.js b/src/js/core/PassOaiToChildren.js index 7170dc4..22882d8 100644 --- a/src/js/core/PassOaiToChildren.js +++ b/src/js/core/PassOaiToChildren.js @@ -121,7 +121,8 @@ const updateMetaObject = (uuids, enabled) => { const splitArray = (arr, size) => Array.from({length: Math.ceil(arr.length / size)}, (_, i) => arr.slice(i * size, i * size + size)); document.addEventListener('change', function(event) { // Checking if the event target is a checkbox - if (pydio._dataModel._selectedNodes.length > 1) return + if (pydio._dataModel._selectedNodes.length !== 1) return + if (event.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")) return if (event.target.type === 'checkbox') { // Logging the checkbox's id (or name if id is not available) and its new checked state const siblingText = event.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting") diff --git a/src/js/vanitizer/PreservationConfigsPopup.js b/src/js/vanitizer/PreservationConfigsPopup.js index 4830886..c0c94a9 100644 --- a/src/js/vanitizer/PreservationConfigsPopup.js +++ b/src/js/vanitizer/PreservationConfigsPopup.js @@ -85,12 +85,12 @@ function createCuratePopup(title, inputs) { return []; })); }); - const curConfig = {} + const curConfig = { + user: pydio.user.id + } const matchingObj = curConfigs?.find(obj => obj.name == saveName); if (matchingObj) { curConfig["id"] = matchingObj.id; // we're editing an already saved config - } else { - curConfig["user"] = pydio.user.id //created user is this one } inputIds.forEach(id => { const input = document.querySelector("#" + id) @@ -122,23 +122,42 @@ function createCuratePopup(title, inputs) { } }) if (matchingObj){ //edit existing config - editPreservationConfig(curConfig) - }else{ - setPreservationConfig(curConfig) //save new config - .then(r => { + editPreservationConfig(curConfig).then(r => { + console.log(r) if (r) { const curConfigs = JSON.parse(sessionStorage.getItem("preservationConfigs")) getPreservationConfigs() .then(r => { const newConfigs = JSON.parse(sessionStorage.getItem("preservationConfigs")) + console.log(newConfigs) if (curConfig.id) { document.querySelector("#config-" + curConfig.id).remove() - createConfigsBox(savedScrollContainer, [newConfigs.find(obj => obj.id === curConfig.id)]) + createConfigsBox(savedScrollContainer, savedConfigsContainer,[newConfigs.find(obj => obj.id === curConfig.id)]) } else { const newObject = newConfigs.find(newObj => !curConfigs.some(curObj => curObj.id === newObj.id)); - createConfigsBox(savedScrollContainer, [newObject]) + createConfigsBox(savedScrollContainer, savedConfigsContainer,[newObject]) } }) + saveConfig.style.display = "none" + } + }) + }else{ + console.log("saving new config") + setPreservationConfig(curConfig) //save new config + .then(r => { + console.log(r) + if (r) { + console.log("saved new config") + const curConfigs = JSON.parse(sessionStorage.getItem("preservationConfigs")) + getPreservationConfigs() + .then(r => { + const newConfigs = JSON.parse(sessionStorage.getItem("preservationConfigs")) + console.log(newConfigs) + + const newObject = newConfigs.find(newObj => !curConfigs.some(curObj => curObj.id === newObj.id)); + createConfigsBox(savedScrollContainer,savedConfigsContainer, [newObject]) + + }) } }) } @@ -255,7 +274,7 @@ async function setPreservationConfig(config) { .then(response => { if (!response.ok) { throw new Error(`HTTP error while creating config, Status: ${response.status}`); - } else if (response.status == 200) { + } else { //save configs to session console.info("config saved successfully") return response.json(); @@ -298,6 +317,7 @@ async function deletePreservationConfig(id) { }); } function createConfigsBox(target, container, configs) { + console.log(configs) configs?.forEach(config => { const configItem = document.createElement('div') configItem.id = "config-" + config.id @@ -360,25 +380,7 @@ function createConfigsBox(target, container, configs) { configDescription.appendChild(descriptionText) - const configCreatedDate = document.createElement('div') - const createdLabel = document.createElement('label') - createdLabel.for = "config-created-date-" + config.id - createdLabel.textContent = "Created: " - const createdText = document.createElement('span') - createdText.id = "config-created-date-" + config.id - createdText.textContent = config.created - configCreatedDate.appendChild(createdLabel) - configCreatedDate.appendChild(createdText) - - const configModified = document.createElement('div') - const modifiedLabel = document.createElement('label') - modifiedLabel.for = "config-modified-date-" + config.id - modifiedLabel.textContent = "Modified: " - const modifiedText = document.createElement('span') - modifiedText.id = "config-modified-date-" + config.id - modifiedText.textContent = config.modified - configModified.appendChild(modifiedLabel) - configModified.appendChild(modifiedText) + const configUser = document.createElement('div') const userLabel = document.createElement('label') @@ -391,8 +393,7 @@ function createConfigsBox(target, container, configs) { configUser.appendChild(userText) configDetails.appendChild(configDescription) - configDetails.appendChild(configCreatedDate) - configDetails.appendChild(configModified) + configDetails.appendChild(configUser) configInfo.appendChild(configLabel) diff --git a/src/js/web-components/atom-connector.js b/src/js/web-components/atom-connector.js index 459210a..229c540 100644 --- a/src/js/web-components/atom-connector.js +++ b/src/js/web-components/atom-connector.js @@ -26,8 +26,8 @@ class ConnectToAtom extends HTMLElement { saveDetails(e) { e.preventDefault(); Curate.api.fetchCurate('/api/atom', 'POST', { - apiKey: this.apiKey, - atomUrl: this.atomUrl, + api_key: this.apiKey, + atom_url: this.atomUrl, username: this.username, password: this.password }) From 393ecbe808a75dd165c636fd8dd32fe04e881a41 Mon Sep 17 00:00:00 2001 From: John Mackey Date: Fri, 9 Aug 2024 15:40:03 +0100 Subject: [PATCH 4/8] missing bang --- dist/4.4.1/main_4.4.1.js | 2 +- src/js/core/PassOaiToChildren.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/4.4.1/main_4.4.1.js b/dist/4.4.1/main_4.4.1.js index fbf52be..5a51a7d 100644 --- a/dist/4.4.1/main_4.4.1.js +++ b/dist/4.4.1/main_4.4.1.js @@ -1 +1 @@ -(()=>{var e={125:()=>{async function e(){const e=`${window.location.protocol}//${window.location.hostname}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.protocol}//${window.location.hostname}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.protocol}//${window.location.hostname}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.protocol}//${window.location.hostname}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&!e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{api_key:this.apiKey,atom_url:this.atomUrl,username:this.username,password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file +(()=>{var e={125:()=>{async function e(){const e=`${window.location.protocol}//${window.location.hostname}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.protocol}//${window.location.hostname}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.protocol}//${window.location.hostname}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.protocol}//${window.location.hostname}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{api_key:this.apiKey,atom_url:this.atomUrl,username:this.username,password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file diff --git a/src/js/core/PassOaiToChildren.js b/src/js/core/PassOaiToChildren.js index 22882d8..bc1ee04 100644 --- a/src/js/core/PassOaiToChildren.js +++ b/src/js/core/PassOaiToChildren.js @@ -122,7 +122,7 @@ const splitArray = (arr, size) => Array.from({length: Math.ceil(arr.length / siz document.addEventListener('change', function(event) { // Checking if the event target is a checkbox if (pydio._dataModel._selectedNodes.length !== 1) return - if (event.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")) return + if (!event.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")) return if (event.target.type === 'checkbox') { // Logging the checkbox's id (or name if id is not available) and its new checked state const siblingText = event.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting") From f3c5f956f38bf98232e3eb8d91d1771c61a56c47 Mon Sep 17 00:00:00 2001 From: John Mackey Date: Mon, 12 Aug 2024 16:40:36 +0100 Subject: [PATCH 5/8] uncommented render in connect to atom & readded dips to pres configs --- dist/4.4.1/main_4.4.1.js | 2 +- src/js/core/CustomPreservationConfigs.js | 5 ++--- src/js/vanitizer/PreservationConfigsPopup.js | 5 ++--- src/js/web-components/atom-connector.js | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dist/4.4.1/main_4.4.1.js b/dist/4.4.1/main_4.4.1.js index 5a51a7d..2424c5f 100644 --- a/dist/4.4.1/main_4.4.1.js +++ b/dist/4.4.1/main_4.4.1.js @@ -1 +1 @@ -(()=>{var e={125:()=>{async function e(){const e=`${window.location.protocol}//${window.location.hostname}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.protocol}//${window.location.hostname}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.protocol}//${window.location.hostname}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.protocol}//${window.location.hostname}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{api_key:this.apiKey,atom_url:this.atomUrl,username:this.username,password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file +(()=>{var e={125:()=>{async function e(){const e=`${window.location.protocol}//${window.location.hostname}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.protocol}//${window.location.hostname}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.protocol}//${window.location.hostname}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.protocol}//${window.location.hostname}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Dissemination",inputs:[{label:"Create Dissemination Package",name:"dip_enabled",type:"toggle",suboptions:[{label:"Dissemination Information",name:"dip_info",type:"info",text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."},{label:"Go to AtoM Configuration",name:"atom_config",type:"button",text:"Go to AtoM Configuration",onclick:e=>{Curate.ui.modals.curatePopup({title:"Connect to Your AtoM Instance"},{afterLoaded:e=>{const t=document.createElement("connect-to-atom");e.querySelector(".config-main-options-container").appendChild(t)}}).fire()}}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails(),this.render()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{api_key:this.apiKey,atom_url:this.atomUrl,username:this.username,password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file diff --git a/src/js/core/CustomPreservationConfigs.js b/src/js/core/CustomPreservationConfigs.js index eb2f0cc..514ec08 100644 --- a/src/js/core/CustomPreservationConfigs.js +++ b/src/js/core/CustomPreservationConfigs.js @@ -842,8 +842,7 @@ { label: "Image Normalisation Format", name: "image_normalization_tiff",type: "dropdown", options:["TIFF", "JPEG2000"] }, ]}, ]}, - // I am removing this for now because we are not using it, instead we are inferring DIP requirement from presence of an AtoM link on an object. I think we will need to go back to this later to enable reingest. - /**{ category: "Dissemination", inputs: [ + { category: "Dissemination", inputs: [ { label: "Create Dissemination Package", name: "dip_enabled", type:"toggle", suboptions: [ { label: "Dissemination Information", name: "dip_info", type:"info", text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."}, { label: "Go to AtoM Configuration", name: "atom_config", type:"button", text:"Go to AtoM Configuration", onclick:e => { @@ -857,7 +856,7 @@ }}, ] }] - },**/ + }, { category: "Packaging and Compression", inputs: [ { label: "AIP Packaging Type", name: "process_type", type:"dropdown", options:["standard", "eark"] }, { label: "Compress AIPs", name: "compress_aip",type:"toggle", suboptions:[ diff --git a/src/js/vanitizer/PreservationConfigsPopup.js b/src/js/vanitizer/PreservationConfigsPopup.js index c0c94a9..b1b8f20 100644 --- a/src/js/vanitizer/PreservationConfigsPopup.js +++ b/src/js/vanitizer/PreservationConfigsPopup.js @@ -664,8 +664,7 @@ const inputs = [ { label: "Image Normalisation Format", name: "image_normalization_tiff",type: "dropdown", options:["TIFF", "JPEG2000"] }, ]}, ]}, -// I am removing this for now because we are not using it, instead we are inferring DIP requirement from presence of an AtoM link on an object. I think we will need to go back to this later to enable reingest. -/**{ category: "Dissemination", inputs: [ +{ category: "Dissemination", inputs: [ { label: "Create Dissemination Package", name: "dip_enabled", type:"toggle", suboptions: [ { label: "Dissemination Information", name: "dip_info", type:"info", text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."}, { label: "Go to AtoM Configuration", name: "atom_config", type:"button", text:"Go to AtoM Configuration", onclick:e => { @@ -679,7 +678,7 @@ const inputs = [ }}, ] }] -},**/ +}, { category: "Packaging and Compression", inputs: [ { label: "AIP Packaging Type", name: "process_type", type:"dropdown", options:["standard", "eark"] }, { label: "Compress AIPs", name: "compress_aip",type:"toggle", suboptions:[ diff --git a/src/js/web-components/atom-connector.js b/src/js/web-components/atom-connector.js index 229c540..0d605fa 100644 --- a/src/js/web-components/atom-connector.js +++ b/src/js/web-components/atom-connector.js @@ -7,7 +7,7 @@ class ConnectToAtom extends HTMLElement { this.username = ''; this.password = ''; this.retrieveDetails(); - //this.render(); + this.render(); } async retrieveDetails() { From 04562cf1ca0415da0391045ddb0a10c936ca4e41 Mon Sep 17 00:00:00 2001 From: John Mackey Date: Wed, 14 Aug 2024 14:26:16 +0100 Subject: [PATCH 6/8] fix wrong atom config fetch body keynames --- dist/4.4.1/main_4.4.1.js | 2 +- src/js/core/CustomPreservationConfigs.js | 10 +++++----- src/js/vanitizer/PreservationConfigsPopup.js | 8 ++++---- src/js/web-components/atom-connector.js | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dist/4.4.1/main_4.4.1.js b/dist/4.4.1/main_4.4.1.js index 2424c5f..c9d009b 100644 --- a/dist/4.4.1/main_4.4.1.js +++ b/dist/4.4.1/main_4.4.1.js @@ -1 +1 @@ -(()=>{var e={125:()=>{async function e(){const e=`${window.location.protocol}//${window.location.hostname}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.protocol}//${window.location.hostname}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.protocol}//${window.location.hostname}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.protocol}//${window.location.hostname}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Dissemination",inputs:[{label:"Create Dissemination Package",name:"dip_enabled",type:"toggle",suboptions:[{label:"Dissemination Information",name:"dip_info",type:"info",text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."},{label:"Go to AtoM Configuration",name:"atom_config",type:"button",text:"Go to AtoM Configuration",onclick:e=>{Curate.ui.modals.curatePopup({title:"Connect to Your AtoM Instance"},{afterLoaded:e=>{const t=document.createElement("connect-to-atom");e.querySelector(".config-main-options-container").appendChild(t)}}).fire()}}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails(),this.render()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{api_key:this.apiKey,atom_url:this.atomUrl,username:this.username,password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file +(()=>{var e={125:()=>{async function e(){const e=`${window.location.origin}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.origin}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.origin}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.origin}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.origin}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Dissemination",inputs:[{label:"Create Dissemination Package",name:"dip_enabled",type:"toggle",suboptions:[{label:"Dissemination Information",name:"dip_info",type:"info",text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."},{label:"Go to AtoM Configuration",name:"atom_config",type:"button",text:"Go to AtoM Configuration",onclick:e=>{Curate.ui.modals.curatePopup({title:"Connect to Your AtoM Instance"},{afterLoaded:e=>{const t=document.createElement("connect-to-atom");e.querySelector(".config-main-options-container").appendChild(t)}}).fire()}}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails(),this.render()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{atom_api_key:this.apiKey,atom_url:this.atomUrl,atom_username:this.username,atom_password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file diff --git a/src/js/core/CustomPreservationConfigs.js b/src/js/core/CustomPreservationConfigs.js index 514ec08..3b02a92 100644 --- a/src/js/core/CustomPreservationConfigs.js +++ b/src/js/core/CustomPreservationConfigs.js @@ -1,6 +1,6 @@ async function submitPreservationRequest(configId) { const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); - const url = `${window.location.protocol}//${window.location.hostname}/a/scheduler/hooks/a3m-transfer`; + const url = `${window.location.origin}/a/scheduler/hooks/a3m-transfer`; const paths = pydio._dataModel._selectedNodes.map(n => ({ path: Curate.workspaces.getOpenWorkspace() + n._path, slug: n._metadata.get("usermeta-atom-linked-description") || "" @@ -43,7 +43,7 @@ // Retrieves saved preservation configs from the server at route GET /api/preservation // Stores the configs in sessionStorage under the key "preservationConfigs" async function getPreservationConfigs() { - const url = `${window.location.protocol}//${window.location.hostname}/api/preservation`; + const url = `${window.location.origin}/api/preservation`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, {headers: {"Authorization": `Bearer ${token}`}, method: "GET"}) .then(response => { @@ -743,7 +743,7 @@ } } async function deletePreservationConfig(id) { - const url = `${window.location.protocol}//${window.location.hostname}/preservation/${id}`; + const url = `${window.location.origin}/preservation/${id}`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "DELETE", @@ -775,7 +775,7 @@ } // Saves the given preservation config to the server at route POST /preservation async function setPreservationConfig(config) { - const url = `${window.location.protocol}//${window.location.hostname}/preservation`; + const url = `${window.location.origin}/preservation`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "POST", @@ -805,7 +805,7 @@ return input.replaceAll(" ", "_"); } async function editPreservationConfig(config) { - const url = `${window.location.protocol}//${window.location.hostname}/api/preservation/${config.id}`; + const url = `${window.location.origin}/api/preservation/${config.id}`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "POST", diff --git a/src/js/vanitizer/PreservationConfigsPopup.js b/src/js/vanitizer/PreservationConfigsPopup.js index b1b8f20..df955e8 100644 --- a/src/js/vanitizer/PreservationConfigsPopup.js +++ b/src/js/vanitizer/PreservationConfigsPopup.js @@ -211,7 +211,7 @@ function createCuratePopup(title, inputs) { } async function getPreservationConfigs() { - const url = `${window.location.protocol}//${window.location.hostname}/api/preservation`; + const url = `${window.location.origin}/api/preservation`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: 'GET', @@ -234,7 +234,7 @@ async function getPreservationConfigs() { }); } async function editPreservationConfig(config) { - const url = `${window.location.protocol}//${window.location.hostname}/api/preservation/${config.id}`; + const url = `${window.location.origin}/api/preservation/${config.id}`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "POST", @@ -260,7 +260,7 @@ async function editPreservationConfig(config) { }); } async function setPreservationConfig(config) { - const url = `${window.location.protocol}//${window.location.hostname}/api/preservation`; + const url = `${window.location.origin}/api/preservation`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "POST", @@ -286,7 +286,7 @@ async function setPreservationConfig(config) { }); } async function deletePreservationConfig(id) { - const url = `${window.location.protocol}//${window.location.hostname}/api/preservation/${id}`; + const url = `${window.location.origin}/api/preservation/${id}`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); return fetch(url, { method: "DELETE", diff --git a/src/js/web-components/atom-connector.js b/src/js/web-components/atom-connector.js index 0d605fa..5ebddb8 100644 --- a/src/js/web-components/atom-connector.js +++ b/src/js/web-components/atom-connector.js @@ -26,10 +26,10 @@ class ConnectToAtom extends HTMLElement { saveDetails(e) { e.preventDefault(); Curate.api.fetchCurate('/api/atom', 'POST', { - api_key: this.apiKey, + atom_api_key: this.apiKey, atom_url: this.atomUrl, - username: this.username, - password: this.password + atom_username: this.username, + atom_password: this.password }) .then(response => { console.log('Saved Atom details:', response); From 84f5f52a4991b2ac9d80b32b5a0395e8c152d2bc Mon Sep 17 00:00:00 2001 From: John Mackey Date: Wed, 14 Aug 2024 16:20:55 +0100 Subject: [PATCH 7/8] fixed route in atom search --- dist/4.4.1/main_4.4.1.js | 2 +- src/js/web-components/atom-search.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/4.4.1/main_4.4.1.js b/dist/4.4.1/main_4.4.1.js index c9d009b..b8d2b5f 100644 --- a/dist/4.4.1/main_4.4.1.js +++ b/dist/4.4.1/main_4.4.1.js @@ -1 +1 @@ -(()=>{var e={125:()=>{async function e(){const e=`${window.location.origin}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.origin}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.origin}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.origin}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.origin}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Dissemination",inputs:[{label:"Create Dissemination Package",name:"dip_enabled",type:"toggle",suboptions:[{label:"Dissemination Information",name:"dip_info",type:"info",text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."},{label:"Go to AtoM Configuration",name:"atom_config",type:"button",text:"Go to AtoM Configuration",onclick:e=>{Curate.ui.modals.curatePopup({title:"Connect to Your AtoM Instance"},{afterLoaded:e=>{const t=document.createElement("connect-to-atom");e.querySelector(".config-main-options-container").appendChild(t)}}).fire()}}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails(),this.render()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{atom_api_key:this.apiKey,atom_url:this.atomUrl,atom_username:this.username,atom_password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file +(()=>{var e={125:()=>{async function e(){const e=`${window.location.origin}/api/preservation`,t=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(e,{headers:{Authorization:`Bearer ${t}`},method:"GET"}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{sessionStorage.setItem("preservationConfigs",JSON.stringify(e))})).catch((e=>{console.error("Fetch error:",e)}))}function t(t,n,o){const s=document.createElement("div");s.id="preservationConfigsSubMenu",s.style.maxHeight="8em",s.style.overflowY="scroll",s.innerHTML=n,o.forEach((e=>{let t=document.createElement("div");const n=JSON.parse(localStorage.getItem(e.id));if(t.style.transition="0.3s ease all",t.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),t.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),t.addEventListener("click",(t=>{t.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!0})),t.target.classList.remove("mdi-star-outline"),t.target.classList.add("mdi-star"),s.remove()):t.target.classList.contains("mdi-star")?(console.info("un-bookmarked!"),localStorage.setItem(e.id,JSON.stringify({name:e.name,bookmarked:!1})),t.target.classList.remove("mdi-star"),t.target.classList.add("mdi-star-outline"),s.remove()):(!async function(e){const t=await PydioApi._PydioRestClient.getOrUpdateJwt(),n=`${window.location.origin}/a/scheduler/hooks/a3m-transfer`,o=pydio._dataModel._selectedNodes.map((e=>({path:Curate.workspaces.getOpenWorkspace()+e._path,slug:e._metadata.get("usermeta-atom-linked-description")||""}))),i=JSON.stringify({Paths:o,JobParameters:{ConfigId:e.toString()}});fetch(n,{method:"POST",mode:"cors",headers:{accept:"application/json","accept-language":"en-GB,en-US;q=0.9,en;q=0.8",authorization:`Bearer ${t}`,"cache-control":"no-cache","content-type":"application/json",pragma:"no-cache","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":"en-us"},body:i}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((e=>{console.info("Preservation config initiated successfully")})).catch((e=>{console.error("Fetch error:",e)}))}(e.id),s.remove())})),t.innerHTML='
Source Editor
',t.querySelector('[role="menuLabel"]').innerText=e.name,s.querySelector('[role="menu"]').appendChild(t),n&&n.bookmarked){let e=t.querySelector(".mdi-star-outline");e.classList.remove("mdi-star-outline"),e.classList.add("mdi-star")}}));const l=document.createElement("div");l.innerHTML='
Source Editor
',l.querySelector('[role="menuLabel"]').innerText="Create New",l.style.transition="0.3s ease all",l.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),l.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),l.addEventListener("click",(t=>{document.querySelector("#preservationConfigsSubMenu").remove(),function(t,n){const o=document.createElement("div");o.classList.add("config-modal-container");const r=document.createElement("div");r.classList.add("config-modal-scroll-container");const s=document.createElement("div");s.classList.add("config-modal-content");const l=document.createElement("div");l.textContent=t,l.classList.add("config-popup-title"),s.appendChild(l);const d=document.createElement("div");d.classList.add("config-main-options-container"),s.appendChild(d),n.forEach((e=>{const t=document.createElement("div");t.classList.add("config-input-category"),t.id=e.category.replaceAll(" ","_");const n=document.createElement("div");n.classList.add("config-text-label"),n.textContent=e.category,t.appendChild(n),e.inputs.forEach((e=>{a(e,t)})),r.appendChild(t)}));const c=document.createElement("button");c.classList.add("config-clear-form"),c.textContent="Clear Form",c.addEventListener("click",(e=>{r.querySelectorAll("input").forEach((e=>{"text"==e.type?e.value="":"checkbox"==e.type?e.checked=!1:e.value=0,e.dispatchEvent(new CustomEvent("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("input",{bubbles:!0}))}))})),r.appendChild(c);const p=document.createElement("div");p.classList.add("config-options-container"),p.style="display: flex;align-items: center;flex-wrap: nowrap;flex-direction: column;";const u=document.createElement("div");u.classList.add("config-text-label"),u.textContent="Create or Edit Configs",u.style="padding-bottom: 1em !important",p.appendChild(u),p.appendChild(r);const m=document.createElement("div");m.classList.add("config-modal-scroll-container");const h=document.createElement("button");h.classList.add("config-save-button"),h.textContent="Save Config",h.addEventListener("click",(t=>{const o=JSON.parse(sessionStorage.getItem("preservationConfigs")),a=p.querySelector("#name").value,r=n.flatMap((e=>e.inputs.map((e=>e.name)).concat(e.inputs.flatMap((e=>e.suboptions?e.suboptions.map((e=>e.name)):[]))))),s={},l=o?.find((e=>e.name==a));l?s.id=l.id:s.user=pydio.user.id,r.forEach((e=>{const t=document.querySelector("#"+e);t&&"submit"!=t.type&&(t.disabled&&(s[e.toLowerCase()]=!1),"checkbox"==t.type?s[e.toLowerCase()]=+t.checked:t.querySelector("input[type='range']")?s[e.toLowerCase()]=t.querySelector("input[type='range']").value:"name"==e?s.name=t.value:"image_normalization_tiff"==e?s[e.toLowerCase()]="TIFF"===t.value?1:0:"string"==typeof t.value?s[e.toLowerCase()]=t.value.toLowerCase():s[e.toLowerCase()]=t.value)})),l?async function(e){const t=`${window.location.origin}/api/preservation/${e.id}`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(!e.ok)throw new Error(`HTTP error while updating config, Status: ${e.status}`);if(200==e.status)return console.info("config saved successfully"),e.json()})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your modified configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s):async function(e){const t=`${window.location.origin}/preservation`,n=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(t,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(e)}).then((e=>{if(e.ok)return console.info("config saved successfully"),e.json();throw new Error(`HTTP error! Status: ${e.status}`)})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error saving your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(s).then((t=>{if(t){const t=JSON.parse(sessionStorage.getItem("preservationConfigs"));e().then((e=>{const n=JSON.parse(sessionStorage.getItem("preservationConfigs"));if(s.id)document.querySelector("#config-"+s.id).remove(),i(m,[n.find((e=>e.id===s.id))]);else{const e=n.find((e=>!t.some((t=>t.id===e.id))));i(m,[e])}}))}}))})),p.appendChild(h),d.appendChild(p),p.addEventListener("input",(e=>{let t=p.querySelector("#name").value;0==t.length?h.style.display="none":t.trim().length<3?(h.textContent="Add a name 3 characters or longer",h.style.display="block"):(h.textContent="Save Config",h.style.display="block")}));const g=document.createElement("div");g.classList.add("config-options-container"),g.id="savedConfigsContainer",g.style="display:flex;align-items:center;justify-content:flex-start;flex-direction:column;";const f=document.createElement("div");f.classList.add("config-text-label"),f.style="padding-bottom: 1em; !important",f.textContent="Saved Configs",g.appendChild(f);const y=JSON.parse(sessionStorage.getItem("preservationConfigs"));i(m,g,y),g.appendChild(m),d.appendChild(g),o.appendChild(s);const b=document.createElement("div");b.classList.add("action-buttons");const v=document.createElement("button");v.classList.add("config-modal-close-button"),v.textContent="Close",v.addEventListener("click",(()=>{document.body.removeChild(o)})),b.appendChild(v),s.appendChild(b),document.body.appendChild(o),o.style.display="flex"}("Preservation Configs",r)})),s.querySelector('[role="menu"]').appendChild(l),document.body.appendChild(s);const d=s.firstChild.getBoundingClientRect(),c=t.getBoundingClientRect(),p=c.left,u=window.innerWidth-c.right;var m;return pu?(m=c.top,newRight=window.innerWidth-c.left+d.width,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`):(m=c.top,newRight=window.innerWidth-c.right,s.style.position="absolute",s.style.top=`${m}px`,s.style.right=`${newRight}px`),s}function n(e,t,n="16px",o="5px"){const i=document.createElement("div");return i.style.transition="0.3s ease all",i.style.maxWidth="20em",i.addEventListener("mouseenter",(e=>{e.target.style.background="var(--md-sys-color-outline-variant-50)"})),i.addEventListener("mouseleave",(e=>{e.target.style.background="none"})),i.id="preservationConfigDropdown",i.innerHTML='
'+e+"
",i}function o(e){const o=JSON.parse(sessionStorage.getItem("preservationConfigs"));setTimeout((()=>{for(const i of e.querySelectorAll("div")){if("Preserve"==i.innerText){const a=n("Preservation Configs","mdi-menu-right","24px","0px");e.insertBefore(a,i.nextSibling);const r=document.querySelector("#preservationConfigDropdown"),s=[1,3];return document.addEventListener("mousedown",(e=>{}),{once:!0}),r.addEventListener("click",(e=>{const n=t(r,'
',o);setTimeout((()=>{document.addEventListener("mousedown",(e=>{s.includes(e.which)&&(n.contains(e.target)||n.remove())}),{once:!0})}),100)})),void o.forEach((t=>{const o=JSON.parse(localStorage.getItem(t.id.toString()));if(o&&o.bookmarked){const o=n(t.name,"mdi-console");e.insertBefore(o,i.nextSibling)}}))}document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}}),10)}function i(t,n,o){console.log(o),o?.forEach((n=>{const o=document.createElement("div");o.id="config-"+n.id,o.classList.add("saved-config-item"),o.style.opacity="0",o.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-outline-variant)"})),o.addEventListener("mouseleave",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),o.addEventListener("click",(e=>{if(!["saved-config-delete","config-bookmark-container","mdi-star","mdi-star-outline"].includes(e.target.className))for(var t in n)if(n.hasOwnProperty(t)){var o="#"+t,i=document.querySelector(o);i&&("checkbox"==i.type?i.checked=!!n[t]:"select-one"==i.type?"image_normalization_tiff"==i.id&&(i.value=1===n[t]?"TIFF":"JPEG2000"):"range"==i.type?(i.value=n[t],i.dispatchEvent(new CustomEvent("input",{bubbles:!0}))):i.value=n[t],i.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}}));const i=document.createElement("div");i.classList.add("saved-config-information");const a=document.createElement("label");a.textContent=n.name,a.style.fontWeight="500",a.style.marginBottom="0";const r=document.createElement("label");r.classList.add("config-text-label");const s=document.createElement("div"),l=document.createElement("label");l.for="config-description-"+n.id,l.textContent="Description: ";const d=document.createElement("span");d.textContent=n.description,d.id="config-description-"+n.id,s.appendChild(l),s.appendChild(d);const c=document.createElement("div"),p=document.createElement("label");p.id="config-user-"+n.id,p.textContent="User: ";const u=document.createElement("span");u.id="config-user-"+n.id,u.textContent=n.user,c.appendChild(p),c.appendChild(u),r.appendChild(s),r.appendChild(c),i.appendChild(a),i.appendChild(r);const m=document.createElement("button");m.classList.add("saved-config-delete"),m.addEventListener("mouseenter",(e=>{o.style.backgroundColor="var(--md-sys-color-on-secondary)",m.style.backgroundColor="#ff2c2c"})),m.addEventListener("mouseleave",(e=>{m.style.backgroundColor="var(--md-sys-color-error-container)",e.toElement==o||e.toElement==o.querySelector(".saved-config-information")?o.style.backgroundColor="var(--md-sys-color-outline-variant)":o.style.backgroundColor="var(--md-sys-color-on-secondary)"})),m.addEventListener("click",(t=>{confirm("Deleting a config is permanent and cannot be reverted, do you wish to continue?")&&(o.style.opacity="1",async function(t){const n=`${window.location.origin}/preservation/${t}`,o=await PydioApi._PydioRestClient.getOrUpdateJwt();return fetch(n,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${o}`}}).then((e=>{if(!e.ok)throw new Error(`HTTP error! Status: ${e.status}`);return e.json()})).then((t=>{if(t)return e(),t;throw new Error("Delete operation failed.")})).catch((e=>{console.error("Fetch error:",e),Curate.ui.modals.curatePopup({title:"Error",type:"error",content:"There was an error deleting your configuration. Please try again, or contact support if the problem persists."}).fire()}))}(n.id).then((e=>{console.info("Delete successful:",e),o.style.animation="none",o.offsetWidth,o.style.animation="config-slide-and-fade-in 0.4s forwards reverse",setTimeout((e=>{o.remove()}),400)})).catch((e=>{o.style.animation="delete-failed-shake-animation 0.5s 0s infinite";const t=o.style.backgroundColor;o.style.backgroundColor="red",console.error("Delete failed:",e),setTimeout((()=>{o.style.animation="none",o.style.backgroundColor=t}),500)})))})),m.textContent="Delete Config";const h=document.createElement("div");h.classList.add("config-bookmark-container"),h.addEventListener("click",(e=>{e.target.classList.contains("mdi-star-outline")?(console.info("bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!0})),e.target.classList.remove("mdi-star-outline"),e.target.classList.add("mdi-star")):e.target.classList.contains("mdi-star")&&(console.info("un-bookmarked!"),localStorage.setItem(n.id,JSON.stringify({name:n.name,bookmarked:!1})),e.target.classList.remove("mdi-star"),e.target.classList.add("mdi-star-outline"))}));const g=document.createElement("span"),f=JSON.parse(localStorage.getItem(n.id.toString()));f&&f.bookmarked?g.classList.add("mdi-star"):g.classList.add("mdi-star-outline"),h.appendChild(g),o.appendChild(h),o.appendChild(i),o.appendChild(m),t.appendChild(o)}));const i=t.querySelectorAll(".saved-config-item");if(i?.forEach(((e,t)=>e.style.animationDelay=.55*t/i.length+"s")),i?.forEach(((e,t,n)=>{const o=.05*(t+1),i=1-o;e.style.animationDelay=`${o}s`,e.style.animationDuration=`${i}s`})),!o||0==o?.length){const e=document.createElement("div");e.textContent="No Saved Preservation Configs Found",e.style.margin="3em",e.style.width="80%",e.style.height="10%",e.style.textAlign="center",e.style.display="flex",e.style.color="white",e.style.background="var(--md-sys-color-outline-variant-50)",e.style.justifyContent="center",e.style.alignItems="center",e.style.borderRadius="1.5em",n.appendChild(e)}}function a(e,t){const n=document.createElement("div");if(n.classList.add("input-container"),"info"===e.type){const t=document.createElement("div");t.classList.add("config-info"),t.textContent=e.text,n.appendChild(t)}if("text"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.id=e.name,o.setAttribute("type","text"),o.classList.add("config-text-input"),n.appendChild(t),n.appendChild(o)}else if("toggle"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("input");o.setAttribute("type","checkbox"),o.classList.add("tgl"),o.classList.add("tgl-light"),o.id=e.name;const i=document.createElement("label");i.classList.add("tgl-btn"),i.htmlFor=e.name,n.appendChild(t),n.appendChild(o),n.appendChild(i)}else if("dropdown"===e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const o=document.createElement("select");o.id=e.name,o.classList.add("config-dropdown-select"),e.options.forEach((e=>{const t=document.createElement("option");t.value=e,t.textContent=e,o.appendChild(t)})),n.appendChild(t),n.appendChild(o)}else if("slider"==e.type){const t=document.createElement("label");t.textContent=e.label,t.classList.add("config-text-label");const i=document.createElement("div");i.classList.add("config-slider-container");const a=document.createElement("div");a.classList.add("config-slider-value"),a.textContent=e.min;const r=document.createElement("input");r.id=e.name,r.setAttribute("type","range"),r.classList.add("config-slider"),r.setAttribute("min",e.min),r.setAttribute("max",e.range),r.setAttribute("step",e.step),r.setAttribute("value",e.min);const s=document.createElement("div");s.classList.add("config-slider-minmax-container");const l=document.createElement("span");l.classList.add("config-slider-minmax"),l.textContent=e.min;const d=document.createElement("span");d.classList.add("config-slider-minmax"),d.textContent=e.range,r.addEventListener("input",(()=>{const e=r.value;a.textContent=e})),s.appendChild(l);for(var o=0;o{const n=e.name;t.target.id==n&&(t.target.checked?e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!1,document.querySelector(t).parentElement.style.opacity="1"})):e.suboptions.forEach((e=>{if("info"==e.type)return;const t="#"+e.name;document.querySelector(t).disabled=!0,document.querySelector(t).checked=!1,document.querySelector(t).parentElement.style.opacity="0.3"})))})),t.appendChild(n),e.suboptions&&e.suboptions.forEach((e=>{a(e,n),setTimeout((t=>{if("info"==e.type)return;const n="#"+e.name;document.querySelector(n).disabled=!0,document.querySelector(n).parentElement.style.opacity="0.3"}),50)}))}const r=[{category:"Details",inputs:[{label:"Config Name",name:"name",type:"text"},{label:"Config Description",name:"description",type:"text"}]},{category:"Normalisation",inputs:[{label:"Normalise Objects",name:"normalize",type:"toggle",suboptions:[{label:"Image Normalisation Format",name:"image_normalization_tiff",type:"dropdown",options:["TIFF","JPEG2000"]}]}]},{category:"Dissemination",inputs:[{label:"Create Dissemination Package",name:"dip_enabled",type:"toggle",suboptions:[{label:"Dissemination Information",name:"dip_info",type:"info",text:"Create dissemination packages from AIPs generated by this config. Created DIPs will automatically be connected to the linked description of the source data. For this option to work, you must configure a connected AtoM instance."},{label:"Go to AtoM Configuration",name:"atom_config",type:"button",text:"Go to AtoM Configuration",onclick:e=>{Curate.ui.modals.curatePopup({title:"Connect to Your AtoM Instance"},{afterLoaded:e=>{const t=document.createElement("connect-to-atom");e.querySelector(".config-main-options-container").appendChild(t)}}).fire()}}]}]},{category:"Packaging and Compression",inputs:[{label:"AIP Packaging Type",name:"process_type",type:"dropdown",options:["standard","eark"]},{label:"Compress AIPs",name:"compress_aip",type:"toggle",suboptions:[{label:"Warning",name:"compression_warning",type:"info",text:"Compressing AIPs will make their contents unsearchable and prevent descriptive metadata from being reassociated with output objects. You can compress your AIPs for distribution or deep-storage while conserving the uncompressed AIP by right-clicking an AIP in a workspace."},{label:"Compression Algorithm",name:"compression_algorithm",type:"dropdown",options:["tar","tar_bzip2","tar_gzip","s7_copy ","s7_bzip2","s7_lzma"]},{label:"Compression Level",name:"compression_level",type:"slider",min:1,range:9,step:1}]}]},{category:"Transfer Options",inputs:[{label:"Generate Transfer Structure Report",name:"gen_transfer_struct_report",type:"toggle"},{label:"Document Empty Directories",name:"document_empty_directories",type:"toggle"},{label:"Extract Packages",name:"extract_packages",type:"toggle",suboptions:[{label:"Delete Packages After Extraction",name:"delete_packages_after_extraction",type:"toggle"}]}]}];document.addEventListener("dynamicScriptLoaded",(t=>{!async function(){try{await((e,t=50)=>new Promise((n=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),n(window[e]))}),t)})))("PydioApi");e()}catch(e){console.error("An error occurred:",e)}}(),setTimeout((()=>{document.addEventListener("mousedown",(e=>{document.querySelector('.context-menu [role="menu"]')&&document.querySelector('.context-menu [role="menu"]').contains(e.target)||document.querySelector(".main-files-list")&&(3==e.which&&document.querySelector(".main-files-list").contains(e.target)?document.querySelector('.context-menu [role="menu"]')&&!document.querySelector("#preservationConfigDropdown")?setTimeout((()=>{o(document.querySelector('.context-menu [role="menu"]'))}),100):function(e){if(document.querySelector("#\\/recycle_bin")&&document.querySelector("#\\/recycle_bin").contains(e.target))return void(document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove());const t=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{if(e.nodeType===Node.ELEMENT_NODE){const n=e.querySelector('.context-menu [role="menu"]');n&&(o(n),t.disconnect())}}))}))}));t.observe(document.body,{childList:!0,subtree:!0,once:!0})}(e):document.querySelector("#preservationConfigDropdown")&&setTimeout((()=>{document.querySelector("#preservationConfigDropdown")&&document.querySelector("#preservationConfigDropdown").remove()}),150))}),150)}))}))},627:()=>{document.addEventListener("change",(function(e){if(1===pydio._dataModel._selectedNodes.length&&e.target.nextElementSibling?.textContent.includes("Enable OAI Harvesting")&&"checkbox"===e.target.type){const t=e.target.nextElementSibling?.textContent.includes("Enable OAI-PMH Harvesting"),n=pydio._dataModel._selectedNodes[0],o=!n._isLeaf;t&&o&&Curate.ui.modals.curatePopup({title:"Send Update to Children",buttonType:"okCancel"},{afterLoaded:e=>{e.querySelector(".config-main-options-container").appendChild(function(){const e=document.createElement("div");e.style="margin: 12px 0px 6px;";const t=document.createElement("div");t.style="cursor: pointer; position: relative; overflow: visible; display: table; height: 52px; width: 100%; background-color: var(--md-sys-color-surface-variant); border-radius: 4px; margin-top: 8px; font-size: 15px; padding: 15px 10px 4px;";const n=document.createElement("input");n.type="checkbox",n.id="inheritValues",n.checked=!1,n.style="position: absolute; cursor: inherit; pointer-events: all; opacity: 0; width: 100%; height: 100%; z-index: 2; left: 0px; box-sizing: border-box; padding: 0px; margin: 0px;";const o=document.createElement("div");o.style="display: flex; width: 100%; height: 100%;";const i=document.createElement("div");i.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; float: left; position: relative; display: block; flex-shrink: 0; width: 36px; margin-right: 8px; margin-left: 0px; padding: 4px 0px 6px 2px;";const a=document.createElement("div");a.style="transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; width: 100%; height: 14px; border-radius: 30px; background-color: var(--md-sys-color-outline-variant);";const r=document.createElement("div");r.style="color: rgb(25, 28, 30); background-color: var(--md-sys-color-primary); transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; box-sizing: border-box; font-family: Roboto, sans-serif; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 6px, rgba(0, 0, 0, 0.12) 0px 1px 4px; border-radius: 50%; position: absolute; top: 1px; left: 100%; width: 20px; height: 20px; line-height: 24px; margin-left: -20px;";const s=document.createElement("label");return s.style="float: left; position: relative; display: block; width: calc(100% - 46px); line-height: 24px; color: rgb(25, 28, 30); font-family: Roboto, sans-serif;",s.textContent="Update Children With New Value ",i.appendChild(a),i.appendChild(r),o.appendChild(i),o.appendChild(s),t.appendChild(n),t.appendChild(o),e.appendChild(t),n.addEventListener("change",(function(){n.checked?(a.style.backgroundColor="rgba(0, 102, 137, 0.5)",r.style.left="100%",s.textContent="Update Children With New Value (yes)"):(r.style.left="55%",a.style.backgroundColor="var(--md-sys-color-outline-variant)",s.textContent="Update Direct Descendant Files With New Value (no)")})),n.dispatchEvent(new Event("change")),e}())},onOk:()=>{const t=this.querySelector("#inheritValues[type='checkbox']");if(t&&t.checked){(async function(e,t=100){const n=async(e,n=0)=>{const o={NodePaths:[e+"/*"],Limit:t.toString(),Offset:n.toString()};return await Curate.api.fetchCurate("/a/tree/stats","POST",o)};let o=[],i=0,a=!0;for(;a;){const r=(await n(e,i)).Nodes||[];o=o.concat(r),a=r.length===t,i+=r.length}return o})(Curate.workspaces.getOpenWorkspace()+"/"+n._path).then((t=>{const n=[];t.forEach((e=>"LEAF"===e.Type?n.push(e.Uuid):null));var o,i;(o=n,i=50,Array.from({length:Math.ceil(o.length/i)},((e,t)=>o.slice(t*i,t*i+i)))).forEach((t=>{const n=((e,t)=>({MetaDatas:e.map((e=>({NodeUuid:e,Namespace:"usermeta-export-oai-harvest-enabled",JsonValue:t.toString(),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}))),Operation:"PUT"}))(t,e.target.checked);Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}))})).catch((e=>{console.error("Error retrieving nodes:",e)}))}}}).fire()}}))},93:()=>{const e={upload:{enforceWorkspaceUpload:{event:"drop",target:document,description:"enforce workspace upload permissions for standard users",handler:e=>{pydio.user.getIdmUser().then((t=>{if(!["quarantine","personal-files","common files"].includes(Curate.workspaces.getOpenWorkspace())&&!t.Roles.find((e=>e.Label="Admin"))&&e.dataTransfer?.files.length>0){e.stopImmediatePropagation();const t="
\n

Please upload your content to the Quarantine workspace instead. This will ensure your content is correctly scanned for malware before being released into the system.

\n

You can also upload your content to the Personal and Common Files workspaces, which is scanned for malware once but will not be quarantined and cannot be released into the system.

\n
";Curate.ui.modals.curatePopup({title:"You do not have permission to upload to this workspace",type:"warning",content:t}).fire()}}))}}},sharedSite:{enforceNoCustomActions:{event:"readystatechange",target:document,description:"enforce no custom actions for shared sites",handler:e=>{if(console.log("shared site enforce no custom actions"),window.location.pathname.includes("/public/"),window.location.pathname.includes("/public/")){const e=document.querySelector(".toolbars-button-menu.action-group_more_action"),t=Array.from(document.querySelector("#main-toolbar").children).find((e=>"button"===e.type&&e.querySelector(".action-local_toggle_theme"))),n=Array.from(document.querySelectorAll(".toolbars-button-menu")).find((e=>1==e.classList.length));e&&e.remove(),t&&t.remove(),n&&n.remove()}}}},move:{}};document.addEventListener("DOMContentLoaded",(t=>{var n;n=e,Object.entries(n).forEach((([e,t])=>{Object.entries(t).forEach((([t,{event:o,target:i,handler:a}])=>{console.log("attaching event handler",n[e][t]);try{i.addEventListener(o,a)}catch(o){console.error("could not attach: ",n[e][t])}}))}))}))},678:()=>{const e=e=>{try{return pydio._dataModel._selectedNodes[0]._metadata.get(e)||null}catch(e){return null}},t=(e,t,n,o)=>{const i=Curate.workspaces.getOpenWorkspace();return n&&"File has not been scanned"!=e||"quarantine"!=i||"Scan Limit Exceeded"===n?n&&"File has not been scanned"!=e||"quarantine"===i||"Scan Limit Exceeded"===n?"Quarantined"==n?`File in quarantine, current period: ${(e=>Math.floor((new Date-new Date(e))/864e5))(o)} days.`:"Scan Limit Exceeded"==n?"File is too large to be scanned.":"Passed"!=n||"personal-files"!=i&&"common files"!=i?"Passed"==n?"File has passed an initial scan but will not be scanned again, please move it into the Quarantine workspace.":"Released"==n?"File has been released from quarantine.":"Risk"==n?"File has not completed its quarantine period and is at risk.":void 0:`File has passed the ${i.replace("-"," ")} scan.`:"This file has not been scanned and is at risk. Please move it into the Quarantine workspace to be scanned.":"This file has not been scanned and is at risk."},n=(e,t)=>{const n=(e,t,n={})=>{const o=document.createElement("div");return o.className=e,o.textContent=t,Object.assign(o.style,n),o},o=n("infoPanelRow",null,{padding:"0px 16px 6px"}),i=n("infoPanelLabel",e,{fontWeight:"415"}),a=n("infoPanelValue",t);return o.appendChild(i),o.appendChild(a),o};function o(o){var i=e("files")?.[0]?.matches?.[0]?.id??"File has not been characterised",a=["usermeta-virus-scan-first","usermeta-virus-scan-second"].map((t=>e(t)||"File has not been scanned")),r=pydio._dataModel._selectedNodes[0]._metadata.get("etag");r.endsWith("-1")&&(r="Local hash");var s=e("mime");const l=e("usermeta-virus-scan"),d=e("usermeta-virus-scan-passed-date");var c=t(...a,l,d);setTimeout((function(){let e=document.createElement("div");e.style.marginTop="-11px",e.id="curateAdditionalInfo";let t=n("Pronom ID",i);"File has not been characterised"!==i&&(t.style.cursor="pointer",t.style.transition="all 0.2s ease-in-out",t.addEventListener("mouseenter",(e=>{t.style.textDecoration="underline",t.style.backgroundColor="rgba(153, 153, 153, 0.2)"})),t.addEventListener("mouseleave",(e=>{t.style.textDecoration="none",t.style.backgroundColor="transparent"})),t.addEventListener("click",(e=>{window.open(`https://www.nationalarchives.gov.uk/pronom/${i}`)})));let l=n("First virus scan result",a[0]),d=n("Second virus scan result",a[1]),p=(n("Mimetype",s),n("Status",c));o.querySelector(".panelContent").childNodes.forEach((e=>{e.innerText.includes("ETag")&&(e.firstChild.innerText="Checksum",e.querySelector(".infoPanelValue").innerText=r)}));let u=document.createElement("HR"),m=document.createElement("div"),h=document.createElement("div");h.style.marginBottom="5px",m.textContent="Quarantine Info",m.id="quarantineInfoLabel",m.style.color="rgb(77, 122, 143)",m.style.fontSize="14px",m.style.fontWeight="500",m.style.marginLeft="15px",m.style.marginBottom="10px",e.appendChild(t),e.appendChild(u),e.appendChild(m),e.appendChild(p),e.appendChild(l),e.appendChild(d),e.appendChild(h),o.querySelector("#curateAdditionalInfo")?(Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")))?.querySelector("#curateAdditionalInfo")?.remove(),o.appendChild(e)):o.appendChild(e)}),5)}const i=(e,t)=>{t=Array.from(document.querySelectorAll(".panelCard")).find((e=>e.textContent.includes("File Info")));e.memo._selectedNodes&&0!=e.memo._selectedNodes.length&&e.memo._selectedNodes[0]!=a&&t&&t.querySelector(".panelContent")&&(o(t),a=e.memo._selectedNodes[0])};var a;const r=e=>{if(e)return pydio._dataModel._observers.selection_changed.includes(i)||pydio._dataModel.observe("selection_changed",(e=>{i(e)})),e.firstElementChild.addEventListener("click",(t=>{e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-up")||e.querySelector('[class*="mdi-chevron-"]').classList.contains("mdi-chevron-down")})),function(e,t){if(!e||!e.parentElement)return void console.error("The element or its parent is not defined.");const n=new MutationObserver((o=>{for(let i of o)if(i.removedNodes.length)for(let o of i.removedNodes)if(o===e||o.contains(e))return t(),void n.disconnect()}));n.observe(e.parentElement,{childList:!0,subtree:!0})}(e.querySelector(".panelContent"),(()=>{e.querySelector("#curateAdditionalInfo").remove()})),void(e.querySelector(".panelContent")&&o(e))};new MutationObserver(((e,t)=>{for(const t of e)if("childList"===t.type)for(const e of t.addedNodes)e instanceof HTMLElement&&e.classList.contains("panelCard")&&e.innerText.includes("File Info")?r(e):e instanceof HTMLElement&&e.classList.contains("panelContent")&&e.parentElement.classList.contains("panelCard")&&e.parentElement.innerText.includes("File Info")&&r(e.parentElement)})).observe(document.documentElement,{childList:!0,subtree:!0})},887:()=>{function e(e){let t=document.createElement("div"),n=document.createElement("button"),o=document.createElement("span"),i=document.createElement("text"),a=document.createElement("hr");i.textContent=e,i.style.marginTop="1em",o.style.ariaHidden="true",o.innerHTML="×",n.style.ariaLabel="Close alert",n.style.type="button",n.style.backgroundColor="white",n.style.border="0",n.style.position="absolute",n.style.top="0",n.style.right="0",n.onclick=function(){this.parentNode.className="slideOut",setTimeout((function(){t.remove()}),1e3)},n.appendChild(o),t.style.backgroundColor="white",t.style.borderRadius="0.5em",t.style.width="16em",t.style.height="auto",t.style.padding="1.8em",t.style.paddingBottom="0em",t.style.margin="2em",t.style.position="absolute",t.style.bottom="5em",t.style.right="0",t.style.boxShadow="0 10px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)",t.className="slideIn",a.style.borderTop="1px solid black",a.style.marginTop="1em",a.className="lineLoad",n.appendChild(o),t.appendChild(n),t.appendChild(i),t.appendChild(a),document.querySelector("body").appendChild(t),setTimeout((function(){t.classList.remove("slideIn")}),1e3),setTimeout((function(){t.className="slideOut",setTimeout((function(){t.remove()}),1e3)}),6e3)}let t=e=>new Promise((t=>setTimeout(t,e)));function n(){setTimeout((function(){let e=["Generate mimetype report","Export Archivematica JSON"];for(let t=0;t{window.addEventListener("load",(function(){var t=Object.fromEntries(pydioBootstrap.parameters).i18nMessages;Object.entries(e).forEach((function(e){t[e[0]]=e[1]}))}));var e={"ajax_gui.tour.welcomemodal.title":"Welcome to Curate","ajax_gui.tour.welcomemodal.subtitle":"Drag'n'drop a photo of you for your profile! This quick tour will guide you through the web interface.","ajax_gui.tour.welcomemodal.start":"Start the tour","ajax_gui.tour.workspaces.1":"Workspaces are top-level folders that help you manage your archiving workflow and organise your data. The Personal Files workspace can only be accessed by you and the Quarantine, Appraisal and Archive workspaces are shared with your workgroup. The Package Templates workspace is common to all accounts and is read only.","ajax_gui.tour.workspaces.2":"You can upload into the Personal Files and Quarantine workspaces, move files to Appraisal to work on them and deposit packages in the Archive when you are finished.","ajax_gui.tour.globsearch.title":"Global Search","ajax_gui.tour.globsearch.1":"Use this search form to find files or folders in any workspace. Only the first 5 results are shown, enter a workspace to get more results, and more search options. Tip: you can use an asterisk as a wild card.","ajax_gui.tour.globsearch.2":"When no search is entered, the history of your recently accessed files and folder is displayed instead.","ajax_gui.tour.openworkspace.title":"Open a workspace","ajax_gui.tour.openworkspace":"At the first connection, your history is probably empty. Enter the Personal or Quarantine workspaces to start adding files. Tip: files are virus checked when they are uploaded and should be kept in Quarantine for 30 days, after which they are scanned again.","ajax_gui.tour.create-menu.title":"Add files","ajax_gui.tour.create-menu":"Start adding new files or folders to the current workspace.","ajax_gui.tour.display-bar.title":"Display Options","ajax_gui.tour.display-bar":"This toolbar allows you to change the display: switch to thumbnails or detail mode depending on your usage, and sort files by name, date, etc...","ajax_gui.tour.infopanel.title":"Info Panel","ajax_gui.tour.infopanel.1":"Here, you will find a preview and comprehensive information about your current selection: file information, virus scan status, metadata, etc.","ajax_gui.tour.infopanel.2":"You can close this panel by using the info button in the display toolbar","ajax_gui.tour.uwidget.title":"User Settings","ajax_gui.tour.uwidget.addressbook":"Directory of all the users accessing to the platform. Create your own users, and constitute teams that can be used to share resources","ajax_gui.tour.uwidget.alerts":"Alerts panel will inform you when a user with whom you shared some resources did access it. They can be sent to you directly by email.","ajax_gui.tour.uwidget.menu":"Access to other options : manage your profile and password, view all of the public links you have created, send a support message, configure the Archivematica Connector and sign out of the platform.","ajax_gui.tour.uwidget.home":"Go back to the welcome panel with this button"}},92:()=>{[{name:"he",url:"https://cdn.jsdelivr.net/npm/he@1.2.0/he.min.js"},{name:"swal",url:"https://cdn.jsdelivr.net/npm/sweetalert2@11"},{name:"papaparse",url:"https://cdn.jsdelivr.net/npm/papaparse@5.4.1/papaparse.min.js"},{name:"chart.js",url:"https://cdn.jsdelivr.net/npm/chart.js"},{name:"spark-md5",url:"https://cdnjs.cloudflare.com/ajax/libs/spark-md5/3.0.2/spark-md5.min.js"}].forEach((e=>{let t=document.createElement("script");t.src=e.url,t.onerror=function(){console.error("Failed to load external library: ",e.name,"please reload the page or contact your admin if the issue persists.")},document.head.appendChild(t)}))},380:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.apiKey="",this.atomUrl="",this.username="",this.password="",this.retrieveDetails(),this.render()}async retrieveDetails(){try{const e=await Curate.api.fetchCurate("/api/atom","GET");this.apiKey=e.atom_api_key,this.atomUrl=e.atom_url,this.username=e.atom_username,this.password=e.atom_password,this.render()}catch(e){console.error("Error retrieving details from Atom:",e)}}saveDetails(e){e.preventDefault(),Curate.api.fetchCurate("/api/atom","POST",{atom_api_key:this.apiKey,atom_url:this.atomUrl,atom_username:this.username,atom_password:this.password}).then((e=>{console.log("Saved Atom details:",e)})).catch((e=>{console.error("Error saving Atom details:",e)})),""!==this.apiKey&&(localStorage.setItem("atom_api_key",this.apiKey),console.log("Saving API Key:",this.apiKey)),""!==this.atomUrl&&(localStorage.setItem("atom_url",this.atomUrl),console.log("Saving Atom URL:",this.atomUrl)),""!==this.username&&(localStorage.setItem("atom_username",this.username),console.log("Saving Atom Username:",this.username)),""!==this.password&&(localStorage.setItem("atom_password",this.password),console.log("Saving Atom Password:",this.password)),this.render()}handleApiKeyChange(e){this.apiKey=e.target.value}handleUrlChange(e){this.atomUrl=e.target.value}handleUsernameChange(e){this.username=e.target.value}handlePasswordChange(e){this.password=e.target.value}togglePasswordVisibility(){const e=this.shadowRoot.querySelector("#password"),t=this.shadowRoot.querySelector("#toggle-password");"password"===e.type?(e.type="text",t.textContent="Hide"):(e.type="password",t.textContent="Show")}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n
\n Current API Key:\n ${"*".repeat(this.apiKey?.length)||"Not Set"}\n
\n
\n Current Atom URL:\n ${this.atomUrl||"Not Set"}\n
\n
\n Current Username:\n ${this.username||"Not Set"}\n
\n
\n Current Password:\n ${"*".repeat(this.password?.length)||"Not Set"}\n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n
\n
\n \n \n \n
\n \n
\n
\n `,this.shadowRoot.querySelector("#details-form").addEventListener("submit",(e=>this.saveDetails(e))),this.shadowRoot.querySelector("#api-key").addEventListener("input",(e=>this.handleApiKeyChange(e))),this.shadowRoot.querySelector("#atom-url").addEventListener("input",(e=>this.handleUrlChange(e))),this.shadowRoot.querySelector("#username").addEventListener("input",(e=>this.handleUsernameChange(e))),this.shadowRoot.querySelector("#password").addEventListener("input",(e=>this.handlePasswordChange(e))),this.shadowRoot.querySelector("#toggle-password").addEventListener("click",(()=>this.togglePasswordVisibility()))}}customElements.define("connect-to-atom",e)},543:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.atomUrl=null,this.criteria=[{id:0,query:"",field:"",operator:""}],this.results=[],this.criterionIndex=1,this.node=null,this.error=null,this.isLoading=!1,this.currentPage=1,this.totalResults=0,this.resultsPerPage=10,this.initialise(),this.render()}async initialise(){this.atomUrl=await this.getAtomUrl()}setNode(e){this.node=e,this.render()}addCriterion(){this.criteria.push({id:this.criterionIndex,query:"",field:"",operator:"and"}),this.criterionIndex++,this.render()}removeCriterion(e){this.criteria=this.criteria.filter((t=>t.id!==e)),this.render()}handleInputChange(e,t,n){this.criteria=this.criteria.map((o=>o.id===e?{...o,[t]:n}:o));const o=this.shadowRoot.querySelector(`[data-id="${e}"][data-field="${t}"]`);o&&(o.value=n)}async performSearch(e=1){this.isLoading=!0,this.error=null,this.currentPage=e,this.render();const t=new URLSearchParams;this.criteria.forEach(((e,n)=>{n>0&&t.append(`so${n}`,e.operator),t.append(`sq${n}`,e.query),t.append(`sf${n}`,e.field)})),t.append("topLod",0),t.append("skip",(e-1)*this.resultsPerPage);try{const e=`${window.location.protocol}//${window.location.hostname}/api/atom/search`,n=await PydioApi._PydioRestClient.getOrUpdateJwt(),o=await fetch(`${e}?${t.toString()}`,{headers:{Authorization:`Bearer ${n}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);const i=await o.json();console.log("Retrieved results:",i),this.results=i.results,this.totalResults=i.total}catch(e){console.error("Error performing search:",e),this.error=`An error occurred while searching: ${e.message}`}finally{this.isLoading=!1,this.render()}}handleResultClick(e){console.log("Result clicked:",e);var t=[];if(!this.node)throw new Error("No node set");console.log("node to link to:",this.node),t.push({NodeUuid:this.node._metadata.get("uuid"),JsonValue:JSON.stringify(e),Namespace:"usermeta-atom-linked-description",Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}),Curate.api.fetchCurate("/a/user-meta/update","PUT",{MetaDatas:t,Operation:"PUT"}),this.dispatchEvent(new CustomEvent("description-linked",{detail:e})),this.remove()}toggleAccordion(e){e.classList.toggle("collapsed");const t=e.nextElementSibling,n=e.querySelector(".chevron");t.classList.contains("show")?(t.classList.remove("show"),n.classList.remove("down"),localStorage.setItem("accordionState","true")):(t.classList.add("show"),n.classList.add("down"),localStorage.setItem("accordionState","false"))}renderPagination(){const e=Math.ceil(this.totalResults/this.resultsPerPage);let t="";if(e>1){t+='
',t+='
Showing results '+((this.currentPage-1)*this.resultsPerPage+1)+" - "+Math.min(this.currentPage*this.resultsPerPage,this.totalResults)+" of "+this.totalResults+"
",t+='",t+="
"}return t}getPageRange(e,t){let n=[];const o=e-2,i=e+2+1;for(let e=1;e<=t;e++)(1===e||e===t||e>=o&&e1===e||e===t||(!i[o-1]||i[o-1]+1===e||(n.splice(o,0,null),!0)))),n}async getAtomUrl(){return Curate.api.fetchCurate(":6900/atom","GET").then((e=>e.atom_url))}render(){this.shadowRoot.innerHTML=`\n \n
\n \n
\n
\n

This interface allows you to search for descriptions in your AtoM instance using a set of search criteria.

\n

You can add as many search criteria as you like, and then perform a search to find descriptions that match your criteria.

\n

Once you have found a description, you can link it to your selected node in Curate.

\n

Please note: only the top-level linked description will be considered when associating your dissemination package with AtoM.

\n

For example, if you create an AIP from a folder containing multiple files, only the folder itself will be checked for a linked description.

\n

AtoM automatically links the sub-files or folders as child level descendants of the top-level linked description.

\n
\n
\n
\n
\n
\n ${this.criteria.map(((e,t)=>`\n
\n ${t>0?`\n \n `:""}\n \n \n \n
\n `)).join("")}\n
\n \n \n\n ${this.isLoading?'
':""}\n \n ${this.error?`
${this.error}
`:""}\n\n
\n ${0!==this.results.length||this.isLoading||this.error?this.results.map((e=>`\n
\n
\n

${e.title}

\n

Reference code: ${e.reference_code}

\n

Level of description: ${e.level_of_description}

\n

URL: ${this.atomUrl}/${e.slug}

\n \n
\n ${e.thumbnail_url?`\n \n `:""}\n
\n `)).join(""):"

No results found. Please try a different search.

"}\n
\n ${this.renderPagination()}\n
\n \n `}}customElements.define("atom-search-interface",e)},738:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),console.log("connected help"),this.updateContent()}render(){this.shadowRoot.innerHTML='\n \n
\n '}updateContent(){const e=Curate.contextualHelp.context;this.shadowRoot.querySelector(".help-content").textContent=this.getHelpContent(e)}getHelpContent(e){const{page:t,lastRightClickedElement:n,selection:o}=e,i=o&&o.length>0;n&&n.tagName.toLowerCase();return!0===i?`You've selected ${o.length} item(s). This area allows you to perform actions on your selection.`:`You're on the ${t} page. Right-click on elements to see context-specific help.`}}customElements.define("contextual-help",e)},523:()=>{class e extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.processQueue=[],this.runningProcesses=new Map,this.maxConcurrent=5}connectedCallback(){this.render(),this.processQueueInterval=setInterval((()=>this.processQueuedItems()),1e3)}disconnectedCallback(){clearInterval(this.processQueueInterval)}render(){this.shadowRoot.innerHTML='\n \n
\n '}addToQueue(e){const t={id:this.generateUniqueId(e),node:e,status:"queued",title:`Queued: ${e._metadata.get("usermeta-import-oai-link-id")}`,details:`Repository: ${e._metadata.get("usermeta-import-oai-repo-url")}`,nodeTitle:e._label};this.processQueue.push(t),this.updateStatusCard(t)}async processQueuedItems(){for(;this.runningProcesses.size0;){const e=this.processQueue.shift();this.runningProcesses.set(e.id,e),this.initiateHarvest(e)}}async initiateHarvest(e){const{node:t,id:n}=e,o=t._metadata.get("usermeta-import-oai-repo-url"),i=t._metadata.get("usermeta-import-oai-link-id"),a=t._metadata.get("usermeta-import-oai-metadata-prefix");if(o&&i&&a){this.updateProcessStatus(n,"loading",`Harvesting ${i}`,`Repository: ${o}`,0);try{const e=await fetch("http://127.0.0.1:5000/harvest",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo_url:o,identifier:i,metadata_prefix:a})});if(!e.ok){const t=await e.json();throw{message:t.error,data:t.data}}const r=await e.json(),s=this.convertJson(r);await Curate.api.files.updateMetadata(t,s),this.updateProcessStatus(n,"success",`Harvested ${i}`,`Successfully processed data from ${o}${i}`,100)}catch(e){this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,`Error: ${e.message}: ${e.data?e.data:""}`,100)}finally{this.runningProcesses.delete(n)}}else this.updateProcessStatus(n,"error",`Failed to harvest ${i}`,"Repository, identifier, or metadata prefix not found",100)}updateProcessStatus(e,t,n,o,i){const a=this.runningProcesses.get(e)||this.processQueue.find((t=>t.id===e));a&&(Object.assign(a,{status:t,title:n,details:o,progress:i}),this.updateStatusCard(a))}updateStatusCard(e){const t=this.shadowRoot.querySelector(".status-container");let n=t.querySelector(`[data-id="${e.id}"]`);n||(n=document.createElement("div"),n.classList.add("status-item"),n.setAttribute("data-id",e.id),t.appendChild(n));const{status:o,title:i,details:a,progress:r,nodeTitle:s}=e;n.innerHTML=`\n
\n ${i}\n \n
\n
${a}
\n
Node: ${s}
\n ${"loading"===o?`\n
\n
\n
\n `:""}\n `}generateUniqueId(e){return`${e._metadata.get("uuid")}-${e._metadata.get("usermeta-import-oai-link-id")}`}convertJson(e){const t=e.schema,n=e.data;let o=[];for(const e in n)if(Array.isArray(n[e])){let t=n[e].join(", ");o.push({field:e,value:t})}let i={};return i[t]=o,i}processAllNodes(e){e.forEach((e=>this.addToQueue(e)))}}customElements.define("oai-harvest-status",e)},18:(e,t,n)=>{"use strict";e.exports=n.p+"01f67aeeb1b9bf70d182.js"}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,n),a.exports}n.m=e,n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var i=o.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=o[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,(()=>{"use strict";const e={fetchCurate:async function(e,t="POST",n){if(!e)throw new Error("No endpoint provided");try{const o=await PydioApi._PydioRestClient.getOrUpdateJwt(),i={method:t,headers:{accept:"application/json","accept-language":navigator.language+",en-GB,en-US;q=0.9,en;q=0.8",authorization:"Bearer "+o,"content-type":"application/json","sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","x-pydio-language":pydio.user.getPreference("lang")},referrer:window.location.href,referrerPolicy:"strict-origin-when-cross-origin",mode:"cors",credentials:"include"};["GET","HEAD"].includes(t)||(i.body=JSON.stringify(n));const a=await fetch(window.location.origin+e,i);if(!a.ok)throw new Error("Network response was not ok");return await a.json()}catch(e){throw console.error("Curate fetch error:",e),e}},files:{createFiles:async function(e){if(!e)throw new Error("No nodes provided");async function t(e,t){const n={MetaDatas:[],Operation:"PUT"};for(const o in e)"path"!==o&&e[o].forEach((e=>{const i=`usermeta-${o}-${e.field}`,a={NodeUuid:t,Namespace:i,JsonValue:JSON.stringify(e.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n}const n=e.nodes.map((async e=>{const t=e.path.split("/").pop(),n=(await Curate.api.fetchCurate("/a/tree/create","POST",{Nodes:[{Path:e.path,Type:"LEAF"}],TemplateUUID:""})).Children[0].Path;return{filename:t,uuid:(await Curate.api.fetchCurate("/a/meta/bulk/get","POST",{Limit:200,NodePaths:[n]})).Nodes[0].Uuid,node:e}})),o=await Promise.all(n);for(const{filename:e,uuid:n,node:i}of o){const e=await t(i,n);await Curate.api.fetchCurate("/a/user-meta/update","PUT",e)}},getFileData:async function(e,t="text"){if(!e)throw new Error("No node provided");try{await PydioApi._PydioRestClient.getOrUpdateJwt();const n=await pydio.ApiClient.buildPresignedGetUrl(e),o=await fetch(n);if(!o.ok)throw new Error("Network response was not ok");if("text"===t)data=await o.text();return data}catch(e){throw console.error("Error fetching object:",e),e}},updateMetadata:async function(e,t){if(!t)throw new Error("No metadata provided");if(!e)throw new Error("No node provided");const n=((e,t)=>{const n={MetaDatas:[],Operation:"PUT"};for(const o in t)t[o].forEach((t=>{const i=`usermeta-${o}-${t.field}`,a={NodeUuid:e._metadata.get("uuid"),Namespace:i,JsonValue:JSON.stringify(t.value),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]};n.MetaDatas.push(a)}));return n})(e,t);return await Curate.api.fetchCurate("/a/user-meta/update","PUT",n)}}},t={getOpenWorkspace:function(){return pydio._dataModel._rootNode._label.toLowerCase()==pydio.user.id.toLowerCase()?"personal-files":pydio._dataModel._rootNode._label.toLowerCase().replace(/^\d+\.\s*/,"")}},o={modals:{curatePopup:function(e,t){const n=e.title,o=e.message,i=e.type,a=e.content,r=e.buttonType||"close",s=t?.afterLoaded||function(){},l=t?.afterClosed||function(){},d=t?.onOk||function(){},c=t?.onCancel||function(){},p={warning:{color:"#FFA500",icon:"mdi-alert"},error:{color:"#FF0000",icon:"mdi-alert-circle"},success:{color:"#008000",icon:"mdi-check-circle"},info:{color:"#0000FF",icon:"mdi-information"}};return{fire:function(){const e=document.createElement("div");e.classList.add("config-modal-container"),e.style.display="flex",e.addEventListener("click",(function(t){y(t,e)}),{once:!0});const t=document.createElement("div");t.classList.add("config-modal-content"),i&&(t.style.borderTop=`4px solid ${p[i].color}`);const u=document.createElement("div");if(u.classList.add("config-popup-title"),i){const e=document.createElement("i");e.classList.add("mdi",p[i].icon),e.style.color=p[i].color,e.style.fontSize="24px",e.style.marginRight="10px",u.appendChild(e)}const m=document.createTextNode(n);u.appendChild(m);const h=document.createElement("div");if(h.classList.add("config-main-options-container"),h.style.width="100%",o){const e=document.createElement("div");e.classList.add("config-popup-message"),e.textContent=o,h.appendChild(e)}if(a){const e=document.createElement("div");e.innerHTML=a,h.appendChild(e)}const g=document.createElement("div");if(g.classList.add("action-buttons"),"okCancel"===r){const t=document.createElement("button");t.classList.add("config-modal-ok-button"),t.textContent="OK",t.addEventListener("click",(()=>{d(),f(e)}));const n=document.createElement("button");n.classList.add("config-modal-cancel-button"),n.textContent="Cancel",n.addEventListener("click",(()=>{c(),f(e)})),g.appendChild(t),g.appendChild(n)}else{const t=document.createElement("button");t.classList.add("config-modal-close-button"),t.textContent="Close",t.addEventListener("click",(()=>{f(e)})),g.appendChild(t)}function f(e){e.remove(),l()}function y(e,t){e.target===t?f(t):t.addEventListener("click",(function(e){y(e,t)}),{once:!0})}t.appendChild(u),t.appendChild(h),t.appendChild(g),e.appendChild(t),document.body.appendChild(e),e.addEventListener("keyup",(function(e){e.stopPropagation()})),s(e)}}}}},i=e=>{const t={"ISAD(G)":({},{sections:[{title:"Identity Statement",fields:["reference code(s)","title","date(s)","level of description","extent and medium of the unit of description"]},{title:"Context",fields:["name of creator(s)","administrative/biographical history","archival history","immediate source of acquisition or transfer"]},{title:"Content And Structure",fields:["scope and content","appraisal, destruction and scheduling information","accruals","system of arrangement"]},{title:"Conditions Of Access And Use",fields:["conditions governing access","conditions governing reproduction","language/scripts of material","physical characteristics and technical requirements","finding aids"]},{title:"Allied Materials",fields:["existence and location of originals","existence and location of copies","related units of description","publication note"]},{title:"Notes",fields:["note"]},{title:"Description Control",fields:["archivists note","rules or conventions","date(s) of descriptions"]}]}),DC:({},{fields:["contributor","coverage","creator","date","description","format","identifier","language","publisher","relation","rights","source","subject","title","type"]})};return e&&e in t?t[e]:e?void console.error("invalid schema"):t},a={schemas:{getSchemas:function(e){return i(e)}}};const r={context:{page:window.location.pathname,lastRightClickedElement:null,selection:null}};function s(e){2===e.button&&(r.context.lastRightClickedElement=e.target,r.context.page=window.location.pathname,r.context.selection=pydio?._dataModel._selectedNodes||null)}document.addEventListener("dynamicScriptLoaded",(()=>document.addEventListener("mousedown",s)));const l={api:e,workspaces:t,ui:o,metadata:a,contextualHelp:r};window.Curate=l;n(125),n(678),n(887),n(578);const d=class{constructor(){this.workerScriptUrl=new URL(n(18),n.b),this.taskQueue=[],this.isProcessing=!1,this.initWorker()}initWorker(){fetch(this.workerScriptUrl).then((e=>{if(!e.ok)throw new Error("Failed to load worker script.");return e.text()})).then((e=>{const t=new Blob([e],{type:"application/javascript"}),n=URL.createObjectURL(t);this.worker=new Worker(n),this.setupWorkerHandlers()})).catch((e=>{console.error("Worker initialization failed:",e)}))}setupWorkerHandlers(){this.worker.onmessage=e=>{"complete"===e.data.status&&this.currentResolve&&this.currentResolve({file:this.currentFile,hash:e.data.hash,name:this.currentFile.name}),this.processNextTask()},this.worker.onerror=e=>{this.currentReject&&this.currentReject("Worker error: "+e.message),this.processNextTask()}}generateChecksum(e){return new Promise(((t,n)=>{this.taskQueue.push({file:e,resolve:t,reject:n}),this.isProcessing||this.processNextTask()}))}processNextTask(){if(this.taskQueue.length>0){const e=this.taskQueue.shift();this.currentResolve=e.resolve,this.currentReject=e.reject,this.currentFile=e.file,this.isProcessing=!0,this.worker.postMessage({file:e.file,msg:"begin hash"})}else this.isProcessing=!1}};document.addEventListener("dynamicScriptLoaded",(()=>{(async()=>{for(;"undefined"==typeof UploaderModel;)await new Promise((e=>setTimeout(e,100)));const e=new d,t=UploaderModel.UploadItem.prototype.uploadPresigned;function n(e,t,i){Curate.api.fetchCurate("/a/tree/stats","POST",{NodePaths:[e]}).then((a=>{const r=a.Nodes.find((t=>t.Path===e));r?(console.log("Fetched node data:",r),function(e,t,i,a){const r=3;"temporary"===e.Etag&&a{n(i,t,a+1)}),2e3)):e.Etag===t?(console.log("Checksum validation passed."),o(e.Uuid,"usermeta-file-integrity","✓ Integrity verified")):(console.error("Checksum validation failed.","Expected:",t,"Received:",e.Etag),o(e.Uuid,"usermeta-file-integrity","X Integrity compromised"))}(r,t,e,i)):console.error("Node not found in response:",e)})).catch((e=>{console.error("Error fetching node stats:",e)}))}function o(e,t,n){const o={MetaDatas:[{NodeUuid:e,Namespace:t,JsonValue:JSON.stringify(n),Policies:[{Action:"READ",Effect:"allow",Subject:"*"},{Action:"WRITE",Effect:"allow",Subject:"*"}]}],Operation:"PUT"};Curate.api.fetchCurate("/a/user-meta/update","PUT",o)}UploaderModel.UploadItem.prototype.uploadPresigned=function(){console.log("Starting upload for:",this);const o=t.apply(this,arguments),i=t=>{console.log(t),"loaded"===t&&(this._observers.status.forEach(((e,t)=>{e===i&&this._observers.status.splice(t,1)})),e.generateChecksum(this._file).then((e=>{console.log("Generated checksum data:",e);const t=Math.min(5e3,Math.max(500,.01*this._file.size));setTimeout((()=>{const t=this._targetNode._path,o=t.endsWith("/")?"":"/",i=this._parent._label?`${this._parent._label}/`:"";n(`${Curate.workspaces.getOpenWorkspace()}${t}${o}${i}${this._label}`,e.hash,0)}),t)})).catch((e=>{console.error("Checksum generation failed:",e)})))};return this._observers.status.push(i),o}})()}));n(627),n(543),n(380);class c extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.nodes=[],this.render()}setNodes(e){this.nodes=e,this.render()}render(){this.shadowRoot.innerHTML=`\n \n
\n
\n The selected preservation configuration has DIP generation enabled. The following items do not have a linked AtoM description, which will cause DIP generation to fail.\n
\n
\n ${this.nodes.map((e=>`\n
\n ${e._path}\n \n
\n `)).join("")}\n
\n
\n `,this.shadowRoot.querySelectorAll(".link-button").forEach((e=>{e.addEventListener("click",(()=>{console.log(`Add description for ${e.getAttribute("data-path")}`),Curate.ui.modals.curatePopup({title:"Connect Selected Node to an AtoM Description"},{afterLoaded:t=>{const n=document.createElement("atom-search-interface");n.setNode(this.nodes.find((t=>t._path==e.getAttribute("data-path")))),t.querySelector(".config-main-options-container").appendChild(n),n.addEventListener("description-linked",(n=>{console.log("description linked"),t.remove();const o=document.createElement("div");o.innerHTML="
🔗
",e.parentElement.querySelector(".file-name").after(o),e.remove()}))},afterClosed:()=>{}}).fire()}))}))}}customElements.define("dip-slug-resolver",c);n(738),n(523),n(93),n(92)})()})(); \ No newline at end of file diff --git a/src/js/web-components/atom-search.js b/src/js/web-components/atom-search.js index 744df8e..6548531 100644 --- a/src/js/web-components/atom-search.js +++ b/src/js/web-components/atom-search.js @@ -64,7 +64,7 @@ class AtoMSearchInterface extends HTMLElement { // No need to append 'limit' as it's fixed on the API side try { - const url = `${window.location.protocol}//${window.location.hostname}/api/search`; + const url = `${window.location.protocol}//${window.location.hostname}/api/atom/search`; const token = await PydioApi._PydioRestClient.getOrUpdateJwt(); const response = await fetch(`${url}?${params.toString()}`, { headers: { From aa548a73a7a13f2651c702ae618d8db8c6678adb Mon Sep 17 00:00:00 2001 From: John Mackey Date: Wed, 28 Aug 2024 15:54:37 +0100 Subject: [PATCH 8/8] implemented fastapi routes in atom config --- src/css/vanitizer-css.css | 2 +- src/js/web-components/atom-search.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/css/vanitizer-css.css b/src/css/vanitizer-css.css index 5aebff1..856649e 100644 --- a/src/css/vanitizer-css.css +++ b/src/css/vanitizer-css.css @@ -8,7 +8,7 @@ } /**changes folder icon for folders with file content**/ .ajxp_node_collection:has(span.metadata_chunk.metadata_chunk_standard.metadata_chunk_bytesize) .mdi-folder::before { - content: "\F0254" !important; + content: "\F24F" !important; } /**hide additional ingest dropdown**/ .action-branding_custom_12{ diff --git a/src/js/web-components/atom-search.js b/src/js/web-components/atom-search.js index 6548531..173f903 100644 --- a/src/js/web-components/atom-search.js +++ b/src/js/web-components/atom-search.js @@ -316,7 +316,7 @@ class AtoMSearchInterface extends HTMLElement { min-width: 60vw; margin-bottom: 2em; text-align: left; - max-height: 25em; + max-height: 35em; overflow-y: scroll; } .info {