retold-remote 0.0.7 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -116,7 +116,7 @@ const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n),thi
116
116
  *
117
117
  * @license MIT
118
118
  */
119
- const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n)}_getRemote(){return this.pict.AppData.RetoldRemote}_getPanelView(){return this.pict.views["RetoldRemote-CollectionsPanel"]}_getToast(){return this.pict.providers["RetoldRemote-ToastNotification"]}fetchCollections(t){let e=this,n="function"==typeof t?t:()=>{};fetch("/api/collections").then(t=>t.json()).then(t=>{let i=e._getRemote();i.Collections=Array.isArray(t)?t:[];let o=e._getPanelView();return o&&i.CollectionsPanelOpen&&o.renderContent(),n(null,i.Collections)}).catch(t=>(e.log.error("Failed to fetch collections: "+t.message),n(t)))}fetchCollection(t,e){let n=this,i="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t)).then(t=>{if(!t.ok)throw new Error("Collection not found");return t.json()}).then(e=>{let o=n._getRemote();o.ActiveCollectionGUID=t,o.ActiveCollection=e;let r=n._getPanelView();return r&&r.renderContent(),i(null,e)}).catch(t=>(n.log.error("Failed to fetch collection: "+t.message),i(t)))}createCollection(t,e){let n=this,i="function"==typeof e?e:()=>{},o=this.fable.getUUID();fetch("/api/collections/"+encodeURIComponent(o),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Name:t||"Untitled Collection"})}).then(t=>t.json()).then(e=>{n._getRemote().LastUsedCollectionGUID=o,n.fetchCollections();let r=n._getToast();return r&&r.show("Collection created: "+(e.Name||t)),i(null,e)}).catch(t=>(n.log.error("Failed to create collection: "+t.message),i(t)))}updateCollection(t,e){let n=this,i="function"==typeof e?e:()=>{};if(!t||!t.GUID)return i(new Error("Collection must have a GUID"));fetch("/api/collections/"+encodeURIComponent(t.GUID),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(t=>t.json()).then(e=>{let o=n._getRemote();return o.ActiveCollectionGUID===t.GUID&&(o.ActiveCollection=e),n.fetchCollections(),i(null,e)}).catch(t=>(n.log.error("Failed to update collection: "+t.message),i(t)))}deleteCollection(t,e){let n=this,i="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t),{method:"DELETE"}).then(t=>t.json()).then(()=>{let e=n._getRemote();e.ActiveCollectionGUID===t&&(e.ActiveCollectionGUID=null,e.ActiveCollection=null,e.CollectionsPanelMode="list"),e.LastUsedCollectionGUID===t&&(e.LastUsedCollectionGUID=null),n.fetchCollections();let o=n._getToast();return o&&o.show("Collection deleted"),i(null)}).catch(t=>(n.log.error("Failed to delete collection: "+t.message),i(t)))}addItemsToCollection(t,e,n){let i=this,o="function"==typeof n?n:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Items:e})}).then(t=>t.json()).then(n=>{let r=i._getRemote();r.LastUsedCollectionGUID=t,r.ActiveCollectionGUID===t&&(r.ActiveCollection=n),i.fetchCollections();let s=i._getPanelView();s&&"detail"===r.CollectionsPanelMode&&r.ActiveCollectionGUID===t&&s.renderContent();let a=i._getToast();if(a){let t=n.Name||"collection";a.show("Added "+e.length+" item"+(e.length>1?"s":"")+" to "+t)}return o(null,n)}).catch(t=>(i.log.error("Failed to add items to collection: "+t.message),o(t)))}removeItemFromCollection(t,e,n){let i=this,o="function"==typeof n?n:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/items/"+encodeURIComponent(e),{method:"DELETE"}).then(t=>t.json()).then(e=>{let n=i._getRemote();n.ActiveCollectionGUID===t&&(n.ActiveCollection=e),i.fetchCollections();let r=i._getPanelView();return r&&"detail"===n.CollectionsPanelMode&&n.ActiveCollectionGUID===t&&r.renderContent(),o(null,e)}).catch(t=>(i.log.error("Failed to remove item from collection: "+t.message),o(t)))}reorderItems(t,e,n){let i=this,o="function"==typeof n?n:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/reorder",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({ItemOrder:e})}).then(t=>t.json()).then(e=>{let n=i._getRemote();n.ActiveCollectionGUID===t&&(n.ActiveCollection=e);let r=i._getPanelView();return r&&"detail"===n.CollectionsPanelMode&&r.renderContent(),o(null,e)}).catch(t=>(i.log.error("Failed to reorder items: "+t.message),o(t)))}copyItems(t,e,n,i){let o=this,r="function"==typeof i?i:()=>{};fetch("/api/collections/copy-items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({SourceGUID:t,TargetGUID:e,ItemIDs:n})}).then(t=>t.json()).then(t=>{o.fetchCollections();let e=o._getToast();return e&&e.show("Copied "+n.length+" item"+(n.length>1?"s":"")),r(null,t)}).catch(t=>(o.log.error("Failed to copy items: "+t.message),r(t)))}togglePanel(){let t=this._getRemote();t.CollectionsPanelOpen=!t.CollectionsPanelOpen;let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&(t.CollectionsPanelOpen?(e.classList.remove("collapsed"),t.CollectionsPanelWidth&&(e.style.width=t.CollectionsPanelWidth+"px"),this.fetchCollections()):e.classList.add("collapsed"));let n=this.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.updateCollectionsIcon&&n.updateCollectionsIcon(),this.pict.PictApplication.saveSettings();let i=this;setTimeout(()=>{let t=i.pict.providers["RetoldRemote-GalleryNavigation"];t&&"function"==typeof t.recalculateColumns&&t.recalculateColumns()},250)}openPanel(){this._getRemote().CollectionsPanelOpen||this.togglePanel()}closePanel(){this._getRemote().CollectionsPanelOpen&&this.togglePanel()}addCurrentFileToCollection(t){let e=this._getRemote(),n=this.pict.AppData.ContentEditor.CurrentFile;if(!n)return!1;let i=t||e.LastUsedCollectionGUID;if(!i)return!1;let o={Type:"file",Path:n,Label:"",Note:""},r=n.match(/^(.*?\.(zip|7z|rar|tar|tgz|cbz|cbr|tar\.gz|tar\.bz2|tar\.xz))\/(.*)/i);if(r&&(o.Type="subfile",o.ArchivePath=r[1]),"viewer"===e.ActiveMode&&"video"===e.CurrentViewerMediaType&&!e.VideoMenuActive){let t=document.getElementById("RetoldRemote-VideoPlayer");t&&!isNaN(t.currentTime)&&t.currentTime>0&&(o.Type="video-frame",o.FrameTimestamp=Math.round(100*t.currentTime)/100)}let s=this.pict.providers["RetoldRemote-Provider"];if(s){let t=s.getHashForPath(n);t&&(o.Hash=t)}return this.addItemsToCollection(i,[o]),!0}addVideoFrameToCollection(t){let e=this._getRemote(),n=t||e.LastUsedCollectionGUID;if(!n)return!1;let i=this.pict.views["RetoldRemote-VideoExplorer"];if(!i||!i._currentPath||!i._frameData)return!1;let o=i._selectedFrameIndex;o<0&&(o=0);let r=i._frameData.Frames[o];if(!r)return!1;let s={Type:"video-frame",Path:i._currentPath,FrameTimestamp:r.Timestamp,Label:r.TimestampFormatted||"",Note:""};return this.addItemsToCollection(n,[s]),!0}addVideoClipToCollection(t,e,n){let i=this._getRemote(),o=t||i.LastUsedCollectionGUID;if(!o)return!1;let r=i.CurrentViewerFile;if(!r)return!1;let s={Type:"video-clip",Path:r,VideoStart:e,VideoEnd:n,Label:this._formatTimestamp(e)+" - "+this._formatTimestamp(n),Note:""};return this.addItemsToCollection(o,[s]),!0}addAudioSnippetToCollection(t){let e=this._getRemote(),n=t||e.LastUsedCollectionGUID;if(!n)return!1;let i=this.pict.views["RetoldRemote-AudioExplorer"];if(!i||!i._currentPath||!i._waveformData)return!1;let o=i._waveformData.Duration||0;if(o<=0)return!1;let r=0,s=o;i._selectionStart>=0&&i._selectionEnd>=0&&(r=Math.round(i._selectionStart*o*100)/100,s=Math.round(i._selectionEnd*o*100)/100);let a={Type:"video-clip",Path:i._currentPath,VideoStart:r,VideoEnd:s,Label:this._formatTimestamp(r)+" - "+this._formatTimestamp(s),Note:""};return this.addItemsToCollection(n,[a]),!0}_formatTimestamp(t){if("number"!=typeof t||isNaN(t))return"0:00";let e=Math.floor(t),n=Math.floor(e/3600),i=Math.floor(e%3600/60),o=e%60;return n>0?n+":"+(i<10?"0":"")+i+":"+(o<10?"0":"")+o:i+":"+(o<10?"0":"")+o}addCurrentFolderToCollection(t,e){this._getRemote();let n=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";if(!n||!t)return;let i={Type:"contents"===e?"folder-contents":"folder",Path:n,Label:"",Note:""};this.addItemsToCollection(t,[i])}_sortItems(t,e,n){if(!Array.isArray(t)||t.length<2)return t;let i="desc"===n?-1:1;switch(e){case"name":t.sort((t,e)=>{let n=(t.Label||t.Path||"").toLowerCase(),o=(e.Label||e.Path||"").toLowerCase(),r=n.lastIndexOf("/"),s=o.lastIndexOf("/");return r>=0&&(n=n.substring(r+1)),s>=0&&(o=o.substring(s+1)),i*n.localeCompare(o)});break;case"type":t.sort((t,e)=>{let n=(t.Type||"").toLowerCase(),o=(e.Type||"").toLowerCase();return i*n.localeCompare(o)});break;case"modified":t.sort((t,e)=>{let n=t.AddedAt||"",o=e.AddedAt||"";return i*n.localeCompare(o)});break;default:t.sort((t,e)=>i*((t.SortOrder||0)-(e.SortOrder||0)))}return t}sortActiveCollection(t,e){let n=this._getRemote().ActiveCollection;if(!n)return;"string"==typeof t&&(n.SortMode=t),"string"==typeof e&&(n.SortDirection=e),this._sortItems(n.Items||[],n.SortMode,n.SortDirection);let i=this._getPanelView();i&&i.renderContent(),fetch("/api/collections/"+encodeURIComponent(n.GUID),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({GUID:n.GUID,SortMode:n.SortMode,SortDirection:n.SortDirection})}).catch(t=>{this.log.error("Failed to save sort preference: "+t.message)})}searchCollections(t){let e=this._getRemote(),n=(t||"").toLowerCase();return n?e.Collections.filter(t=>{let e=(t.Name||"").toLowerCase(),i=(t.Description||"").toLowerCase(),o=(t.Tags||[]).join(" ").toLowerCase();return e.indexOf(n)>=0||i.indexOf(n)>=0||o.indexOf(n)>=0}):e.Collections}createOperationPlan(t,e,n){let i=this,o="function"==typeof n?n:()=>{},r=this.fable.getUUID(),s={Name:t||"Sort Plan",CollectionType:"operation-plan",Items:e||[]};fetch("/api/collections/"+encodeURIComponent(r),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(t=>t.json()).then(e=>{let n=i._getRemote();if(n.ActiveCollectionGUID=r,n.ActiveCollection=e,n.CollectionsPanelMode="detail",n.CollectionsPanelOpen){let t=i._getPanelView();t&&t.renderContent()}else i.togglePanel();i.fetchCollections();let s=i._getToast();return s&&s.show("Sort plan created: "+(e.Name||t)),o(null,e)}).catch(t=>(i.log.error("Failed to create operation plan: "+t.message),o(t)))}executeCollectionOperations(t,e){let n=this,i="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}).then(t=>t.json()).then(e=>{let o=n._getRemote();e.Collection&&o.ActiveCollectionGUID===t&&(o.ActiveCollection=e.Collection);let r=n._getPanelView();r&&r.renderContent();let s=n._getToast();return s&&(e.TotalFailed>0?s.show("Moved "+e.TotalMoved+" files ("+e.TotalFailed+" failed)"):s.show("Successfully moved "+e.TotalMoved+" files")),i(null,e)}).catch(t=>{n.log.error("Failed to execute operations: "+t.message);let e=n._getToast();return e&&e.show("Failed to execute operations: "+t.message),i(t)})}undoCollectionOperations(t,e){let n=this,i="function"==typeof e?e:()=>{},o=this._getRemote().ActiveCollection;if(!o||!o.OperationBatchGUID){let t=n._getToast();return t&&t.show("No batch to undo"),i(new Error("No batch to undo"))}fetch("/api/files/undo-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({BatchGUID:o.OperationBatchGUID})}).then(t=>t.json()).then(t=>{if(o.Items)for(let t=0;t<o.Items.length;t++)"completed"===o.Items[t].OperationStatus&&(o.Items[t].OperationStatus="pending");o.OperationBatchGUID=null,n.updateCollection(o);let e=n._getPanelView();e&&e.renderContent();let r=n._getToast();return r&&r.show("Undo complete: "+t.TotalReversed+" files restored"),i(null,t)}).catch(t=>{n.log.error("Failed to undo operations: "+t.message);let e=n._getToast();return e&&e.show("Failed to undo: "+t.message),i(t)})}setItemDestination(t,e){let n=this._getRemote().ActiveCollection;if(n&&n.Items){for(let i=0;i<n.Items.length;i++)if(n.Items[i].ID===t){n.Items[i].DestinationPath=e;break}this.updateCollection(n)}}skipItemOperation(t){let e=this._getRemote().ActiveCollection;if(!e||!e.Items)return;for(let n=0;n<e.Items.length;n++)if(e.Items[n].ID===t){e.Items[n].OperationStatus="skipped";break}let n=this._getPanelView();n&&n.renderContent(),this.updateCollection(e)}}o.default_configuration={ProviderIdentifier:"RetoldRemote-CollectionManager",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=o},{"pict-provider":46}],117:[function(t,e,n){const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n),this.serviceType="RetoldRemoteProvider"}escapeHTML(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}formatFileSize(t){if(!t||0===t)return"0 B";let e=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(t)/Math.log(1024));return n>=e.length&&(n=e.length-1),(t/Math.pow(1024,n)).toFixed(0===n?0:1)+" "+e[n]}formatShortDate(t){if(!t)return"";let e=new Date(t);return isNaN(e.getTime())?"":e.getMonth()+1+"/"+e.getDate()+"/"+String(e.getFullYear()).slice(-2)}formatTimestamp(t,e){if(null==t||isNaN(t))return"--";let n,i=Math.floor(t/3600),o=Math.floor(t%3600/60),r=Math.floor(t%60);if(n=i>0?i+":"+String(o).padStart(2,"0")+":"+String(r).padStart(2,"0"):o+":"+String(r).padStart(2,"0"),e){n+="."+Math.floor(t%1*10)}return n}}o.default_configuration={ProviderIdentifier:"RetoldRemote-FormattingUtilities",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=o},{"pict-provider":46}],118:[function(t,e,n){const i=t("pict-provider"),o=t("../RetoldRemote-ExtensionMaps.js");class r extends i{constructor(t,e,n){super(t,e,n)}applyFilterSort(){let t=this.pict.AppData.RetoldRemote;if(!t)return;let e=(t.RawFileList||[]).slice();e=this._applySearch(e,t.SearchQuery);let n=t.FilterState||{};e=this._applyMediaTypeFilter(e,n.MediaType||"all"),e=this._applyExtensionFilter(e,n.Extensions||[]),e=this._applySizeFilter(e,n.SizeMin,n.SizeMax),e=this._applyDateFilter(e,n),e=this._sortItems(e,t.SortField||"folder-first",t.SortDirection||"asc"),t.GalleryItems=e;let i=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",o=t.FolderCursorHistory&&t.FolderCursorHistory[i];"number"==typeof o&&o<e.length?t.GalleryCursorIndex=o:t.GalleryCursorIndex=0;let r=this.pict.views["RetoldRemote-Gallery"];r&&r.renderGallery()}_applySearch(t,e){if(!e)return t;let n=this.pict.AppData.RetoldRemote,i=n.SearchCaseSensitive||!1;if(n.SearchRegex||!1){let o;try{o=new RegExp(e,i?"":"i")}catch(e){return n._searchRegexError=e.message,t}return n._searchRegexError=null,t.filter(t=>o.test(t.Name))}if(n._searchRegexError=null,i)return t.filter(t=>t.Name.includes(e));let o=e.toLowerCase();return t.filter(t=>t.Name.toLowerCase().includes(o))}_applyMediaTypeFilter(t,e){return"all"===e?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let n=this.getCategory((t.Extension||"").toLowerCase());return"images"===e?"image"===n:"video"===e?"video"===n:"audio"===e?"audio"===n:"documents"!==e||"document"===n})}_applyExtensionFilter(t,e){if(!e||0===e.length)return t;let n={};for(let t=0;t<e.length;t++)n[e[t].toLowerCase()]=!0;return t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let e=(t.Extension||"").replace(/^\./,"").toLowerCase();return!0===n[e]})}_applySizeFilter(t,e,n){return null===e&&null===n?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let i=t.Size||0;return!(null!==e&&i<e)&&!(null!==n&&i>n)})}_applyDateFilter(t,e){let n=e.DateModifiedAfter?new Date(e.DateModifiedAfter).getTime():null,i=e.DateModifiedBefore?new Date(e.DateModifiedBefore+"T23:59:59").getTime():null,o=e.DateCreatedAfter?new Date(e.DateCreatedAfter).getTime():null,r=e.DateCreatedBefore?new Date(e.DateCreatedBefore+"T23:59:59").getTime():null;return null===n&&null===i&&null===o&&null===r?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;if(null!==n||null!==i){let e=t.Modified?new Date(t.Modified).getTime():0;if(null!==n&&e<n)return!1;if(null!==i&&e>i)return!1}if(null!==o||null!==r){let e=t.Created?new Date(t.Created).getTime():0;if(null!==o&&e<o)return!1;if(null!==r&&e>r)return!1}return!0})}_sortItems(t,e,n){let i="desc"===n?-1:1;return t.slice().sort((t,n)=>{if("folder-first"===e){let e="folder"===t.Type||"archive"===t.Type,o="folder"===n.Type||"archive"===n.Type;if(e&&!o)return-1;if(!e&&o)return 1;let r=(t.Name||"").toLowerCase(),s=(n.Name||"").toLowerCase();return r<s?-1*i:r>s?1*i:0}if("name"===e){let e=(t.Name||"").toLowerCase(),o=(n.Name||"").toLowerCase();return e<o?-1*i:e>o?1*i:0}if("modified"===e){let e=t.Modified?new Date(t.Modified).getTime():0,o=n.Modified?new Date(n.Modified).getTime():0;if(e!==o)return(e-o)*i;let r=(t.Name||"").toLowerCase(),s=(n.Name||"").toLowerCase();return r<s?-1:r>s?1:0}if("created"===e){let e=t.Created?new Date(t.Created).getTime():0,o=n.Created?new Date(n.Created).getTime():0;if(e!==o)return(e-o)*i;let r=(t.Name||"").toLowerCase(),s=(n.Name||"").toLowerCase();return r<s?-1:r>s?1:0}return 0})}getCategory(t){return o.getCategory(t)}getAvailableExtensions(){let t=this.pict.AppData.RetoldRemote,e=t?t.RawFileList:[],n={};for(let t=0;t<e.length;t++){let i=e[t];if("folder"===i.Type||"archive"===i.Type)continue;let o=(i.Extension||"").replace(/^\./,"").toLowerCase();o&&(n[o]||(n[o]={ext:o,category:this.getCategory(o),count:0}),n[o].count++)}let i={image:0,video:1,audio:2,document:3,other:4},o=Object.values(n);return o.sort((t,e)=>{let n=i[t.category]||99,o=i[e.category]||99;return n!==o?n-o:t.ext<e.ext?-1:t.ext>e.ext?1:0}),o}getActiveFilterChips(){let t=this.pict.AppData.RetoldRemote;if(!t)return[];let e=[],n=t.FilterState||{};if(n.MediaType&&"all"!==n.MediaType){let t={images:"Images",video:"Video",audio:"Audio",documents:"Docs"};e.push({key:"mediaType",label:t[n.MediaType]||n.MediaType})}let i=n.Extensions||[];if(i.length>0)for(let t=0;t<i.length;t++)e.push({key:"ext:"+i[t],label:"."+i[t]});if(null!==n.SizeMin&&void 0!==n.SizeMin&&e.push({key:"sizeMin",label:"≥ "+this._formatSizeKB(n.SizeMin)}),null!==n.SizeMax&&void 0!==n.SizeMax&&e.push({key:"sizeMax",label:"≤ "+this._formatSizeKB(n.SizeMax)}),n.DateModifiedAfter&&e.push({key:"dateModifiedAfter",label:"Modified after "+n.DateModifiedAfter}),n.DateModifiedBefore&&e.push({key:"dateModifiedBefore",label:"Modified before "+n.DateModifiedBefore}),n.DateCreatedAfter&&e.push({key:"dateCreatedAfter",label:"Created after "+n.DateCreatedAfter}),n.DateCreatedBefore&&e.push({key:"dateCreatedBefore",label:"Created before "+n.DateCreatedBefore}),t.SearchQuery){let n='Search: "'+t.SearchQuery+'"',i=[];t.SearchCaseSensitive&&i.push("Aa"),t.SearchRegex&&i.push(".*"),i.length>0&&(n+=" ["+i.join(", ")+"]"),e.push({key:"search",label:n})}return e}_formatSizeKB(t){return t>=1048576?(t/1048576).toFixed(1)+" MB":Math.round(t/1024)+" KB"}removeFilter(t){let e=this.pict.AppData.RetoldRemote;if(!e)return;let n=e.FilterState;if("mediaType"===t)n.MediaType="all",e.GalleryFilter="all";else if(t.startsWith("ext:")){let e=t.substring(4);n.Extensions=(n.Extensions||[]).filter(t=>t!==e)}else"sizeMin"===t?n.SizeMin=null:"sizeMax"===t?n.SizeMax=null:"dateModifiedAfter"===t?n.DateModifiedAfter=null:"dateModifiedBefore"===t?n.DateModifiedBefore=null:"dateCreatedAfter"===t?n.DateCreatedAfter=null:"dateCreatedBefore"===t?n.DateCreatedBefore=null:"search"===t&&(e.SearchQuery="",e._searchRegexError=null)}clearAllFilters(){let t=this.pict.AppData.RetoldRemote;t&&(t.SearchQuery="",t.SearchCaseSensitive=!1,t.SearchRegex=!1,t._searchRegexError=null,t.GalleryFilter="all",t.FilterState={MediaType:"all",Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null})}savePreset(t){if(!t)return;let e=this.pict.AppData.RetoldRemote;if(!e)return;let n={Name:t,FilterState:JSON.parse(JSON.stringify(e.FilterState)),SortField:e.SortField,SortDirection:e.SortDirection};e.FilterPresets=e.FilterPresets||[],e.FilterPresets.push(n)}loadPreset(t){let e=this.pict.AppData.RetoldRemote;if(!e||!e.FilterPresets)return;let n=e.FilterPresets[t];n&&(e.FilterState=JSON.parse(JSON.stringify(n.FilterState)),e.GalleryFilter=e.FilterState.MediaType||"all",e.SortField=n.SortField||"folder-first",e.SortDirection=n.SortDirection||"asc")}deletePreset(t){let e=this.pict.AppData.RetoldRemote;e&&e.FilterPresets&&e.FilterPresets.splice(t,1)}}r.default_configuration={ProviderIdentifier:"RetoldRemote-GalleryFilterSort",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!1},e.exports=r},{"../RetoldRemote-ExtensionMaps.js":114,"pict-provider":46}],119:[function(t,e,n){const i=t("pict-provider"),o=t("./keyboard-handlers/KeyHandler-Gallery.js"),r=t("./keyboard-handlers/KeyHandler-Viewer.js"),s=t("./keyboard-handlers/KeyHandler-Sidebar.js"),a=t("./keyboard-handlers/KeyHandler-VideoExplorer.js"),l=t("./keyboard-handlers/KeyHandler-AudioExplorer.js");class d extends i{constructor(t,e,n){super(t,e,n),this._columnsPerRow=4,this._keydownBound=!1,this._helpPanelVisible=!1,this._sidebarFocused=!1,this._sidebarCursorIndex=0}recalculateColumns(){if("list"===this.pict.AppData.RetoldRemote.ViewMode)return void(this._columnsPerRow=1);let t=document.querySelectorAll(".retold-remote-tile");if(t.length<2)return void(this._columnsPerRow=Math.max(1,t.length));let e=t[0].offsetTop,n=1;for(let i=1;i<t.length&&t[i].offsetTop===e;i++)n++;this._columnsPerRow=n}bindKeyboardNavigation(){if(this._keydownBound)return;let t=this;this._keydownHandler=function(e){if("F1"===e.key)return e.preventDefault(),void t._toggleHelpPanel();if("F9"===e.key)return e.preventDefault(),void(t._sidebarFocused?t._blurSidebar():t._focusSidebar());if("/"===e.key){let n=document.getElementById("RetoldRemote-Gallery-Search");if(e.target===n)return e.preventDefault(),t._hideFilterBar(),void n.blur();if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable)return;return e.preventDefault(),void t._toggleFilterBar()}if("Escape"===e.key&&"RetoldRemote-Gallery-Search"===e.target.id)return e.preventDefault(),e.target.blur(),void t._hideFilterBar();if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable)return;if(t._helpPanelVisible&&"Escape"===e.key)return e.preventDefault(),void t._toggleHelpPanel();let n=t.pict.AppData.RetoldRemote.ActiveMode;"gallery"===n&&t._sidebarFocused?t._handleSidebarKey(e):"gallery"===n?t._handleGalleryKey(e):"video-explorer"===n?t._handleVideoExplorerKey(e):"audio-explorer"===n?t._handleAudioExplorerKey(e):"viewer"===n&&t._handleViewerKey(e)},document.addEventListener("keydown",this._keydownHandler),this._keydownBound=!0,this._setupDFSwipeGestures()}_setupDFSwipeGestures(){if(this._dfSwipeBound)return;let t=this,e=0,n=0,i=0,o=0;this._dfSwipeTouchStart=function(t){o=t.touches.length,1===o&&(n=t.touches[0].clientX,e=t.touches[0].clientY,i=e)},this._dfSwipeTouchEnd=function(r){if(1!==o)return;let s=r.changedTouches[0].clientX,a=r.changedTouches[0].clientY,l=s-n,d=a-e;if(Math.abs(d)<60||Math.abs(l)>Math.abs(d))return;let c=t.pict.AppData.RetoldRemote._distractionFreeMode||!1;(!c&&d<0&&i<=60||c&&d>0&&i<=40)&&t._toggleDistractionFree()},document.addEventListener("touchstart",this._dfSwipeTouchStart,{passive:!0}),document.addEventListener("touchend",this._dfSwipeTouchEnd,{passive:!0}),this._dfSwipeBound=!0}_handleGalleryKey(t){o(this,t)}_handleSidebarKey(t){s(this,t)}_focusSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t||t.classList.contains("collapsed"))return;this._sidebarFocused=!0,this._sidebarCursorIndex=0;let e=document.querySelector(".content-editor-sidebar-inner");e&&e.classList.add("keyboard-focused"),this._moveSidebarCursor(0)}_blurSidebar(){this._sidebarFocused=!1;let t=document.querySelector(".content-editor-sidebar-inner");t&&t.classList.remove("keyboard-focused");let e=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row");for(let t=0;t<e.length;t++)e[t].classList.remove("sidebar-focused")}_moveSidebarCursor(t){let e=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row");0!==e.length&&(this._sidebarCursorIndex<e.length&&e[this._sidebarCursorIndex].classList.remove("sidebar-focused"),this._sidebarCursorIndex=t,t<e.length&&(e[t].classList.add("sidebar-focused"),e[t].scrollIntoView({block:"nearest",behavior:"smooth"})))}_handleViewerKey(t){r(this,t)}_handleVideoExplorerKey(t){a(this,t)}_handleAudioExplorerKey(t){l(this,t)}moveCursor(t){let e=this.pict.AppData.RetoldRemote,n=e.GalleryCursorIndex||0;if(t===n)return;e.GalleryCursorIndex=t;let i=document.querySelector(`.retold-remote-tile[data-index="${n}"], .retold-remote-list-row[data-index="${n}"]`),o=document.querySelector(`.retold-remote-tile[data-index="${t}"], .retold-remote-list-row[data-index="${t}"]`);i&&i.classList.remove("selected"),o&&(o.classList.add("selected"),o.scrollIntoView({block:"nearest",behavior:"smooth"}));let r=this.pict.views["ContentEditor-TopBar"];r&&r.updateInfo()}openCurrent(){let t=this.pict.AppData.RetoldRemote,e=t.GalleryItems||[],n=t.GalleryCursorIndex||0;if(n>=e.length)return;let i=e[n];if("folder"===i.Type||"archive"===i.Type){let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";t.FolderCursorHistory[e]=n;let o=this.pict.PictApplication;o&&o.loadFileList&&o.loadFileList(i.Path)}else{let t=this.pict.PictApplication;t&&t.navigateToFile&&t.navigateToFile(i.Path)}}openCurrentAs(t){let e=this.pict.AppData.RetoldRemote,n=e.GalleryItems||[],i=e.GalleryCursorIndex||0;if(i>=n.length)return;let o=n[i];if("folder"===o.Type||"archive"===o.Type)return;let r=this.pict.PictApplication;r&&r.navigateToFileAs&&r.navigateToFileAs(o.Path,t)}switchViewerType(t){let e=this.pict.AppData.RetoldRemote.CurrentViewerFile;if(!e)return;let n=this.pict.views["RetoldRemote-MediaViewer"];n&&n.showMedia(e,t)}navigateUp(){let t=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";if(!t)return;let e=this.pict.AppData.RetoldRemote;e.FolderCursorHistory[t]=e.GalleryCursorIndex||0;let n=t.indexOf("/")>=0?t.replace(/\/[^/]+\/?$/,""):"",i=this.pict.PictApplication;i&&i.loadFileList&&i.loadFileList(n)}closeViewer(){let t=this.pict.AppData.RetoldRemote;t.ActiveMode="gallery",t.BrowsingCollection=!1,t.BrowsingCollectionIndex=-1;let e=document.getElementById("RetoldRemote-Gallery-Container"),n=document.getElementById("RetoldRemote-Viewer-Container");e&&(e.style.display=""),n&&(n.style.display="none");let i=this.pict.views["RetoldRemote-MediaViewer"];i&&(i._cleanupSwipe&&i._cleanupSwipe(),i._cleanupDFExitHotspot&&i._cleanupDFExitHotspot());let o=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",r=this.pict.providers["RetoldRemote-Provider"],s=r&&o?r.getFragmentIdentifier(o):o;window.location.hash=s?"#/browse/"+s:"#/browse/";let a=this.pict.views["RetoldRemote-Gallery"];a&&a.renderGallery()}nextFile(){let t=this.pict.AppData.RetoldRemote;if(t.BrowsingCollection&&t.ActiveCollection){let e=t.ActiveCollection.Items||[];for(let n=t.BrowsingCollectionIndex+1;n<e.length;n++){let i=e[n];if("file"===i.Type||"subfile"===i.Type||"image-crop"===i.Type||"video-clip"===i.Type||"video-frame"===i.Type){t.BrowsingCollectionIndex=n;let e=this.pict.PictApplication;return void(e&&e.navigateToFile&&e.navigateToFile(i.Path))}}return}let e=t.GalleryItems||[];for(let n=(t.GalleryCursorIndex||0)+1;n<e.length;n++)if("file"===e[n].Type){t.GalleryCursorIndex=n;let i=this.pict.PictApplication;return void(i&&i.navigateToFile&&i.navigateToFile(e[n].Path))}}prevFile(){let t=this.pict.AppData.RetoldRemote;if(t.BrowsingCollection&&t.ActiveCollection){let e=t.ActiveCollection.Items||[];for(let n=t.BrowsingCollectionIndex-1;n>=0;n--){let i=e[n];if("file"===i.Type||"subfile"===i.Type||"image-crop"===i.Type||"video-clip"===i.Type||"video-frame"===i.Type){t.BrowsingCollectionIndex=n;let e=this.pict.PictApplication;return void(e&&e.navigateToFile&&e.navigateToFile(i.Path))}}return}let e=t.GalleryItems||[];for(let n=(t.GalleryCursorIndex||0)-1;n>=0;n--)if("file"===e[n].Type){t.GalleryCursorIndex=n;let i=this.pict.PictApplication;return void(i&&i.navigateToFile&&i.navigateToFile(e[n].Path))}}_toggleViewMode(){let t=this.pict.AppData.RetoldRemote;t.ViewMode="gallery"===t.ViewMode?"list":"gallery";let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery();let n=this.pict.PictApplication;n&&"function"==typeof n.saveSettings&&n.saveSettings()}_focusSearch(){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()}_toggleFilterBar(){this.pict.AppData.RetoldRemote.FilterBarVisible?this._hideFilterBar():this._showFilterBar()}_showFilterBar(){let t=this.pict.AppData.RetoldRemote;if(t.FilterBarVisible){let t=document.getElementById("RetoldRemote-Gallery-Search");return void(t&&t.focus())}t.FilterBarVisible=!0;let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()},50)}_hideFilterBar(){let t=this.pict.AppData.RetoldRemote;t.FilterBarVisible=!1,t.FilterPanelOpen=!1;let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery()}_clearAllFilters(){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.clearAllFilters(),this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Filters cleared")}_toggleHelpPanel(){let t=document.getElementById("RetoldRemote-Help-Panel");if(t)return t.remove(),void(this._helpPanelVisible=!1);this._helpPanelVisible=!0;let e=document.createElement("div");e.id="RetoldRemote-Help-Panel",e.innerHTML=this._buildHelpPanelHTML(),(document.fullscreenElement||document.body).appendChild(e)}_buildHelpPanelHTML(){let t=this.pict.AppData.RetoldRemote.ActiveMode||"gallery",e='<div class="retold-remote-help-backdrop" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">';e+='<div class="retold-remote-help-flyout" onclick="event.stopPropagation()">',e+='<div class="retold-remote-help-header">',e+='<span class="retold-remote-help-title">Keyboard Shortcuts</span>',e+='<button class="retold-remote-help-close" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">&times;</button>',e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Gallery / File List</div>';let n=[["← → ↑ ↓","Navigate tiles"],["Enter","Open selected item"],["Escape","Go up one folder"],["F9","Toggle sidebar focus"],["Home / End","Jump to first / last"],["g","Toggle gallery / list view"],["/","Toggle filter bar &amp; search"],["f","Toggle advanced filter panel"],["s","Focus sort dropdown"],["x","Clear all filters"],["c","Settings / config panel"],["d","Distraction-free mode"],["e","Video explorer (on video files)"]];for(let t=0;t<n.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+n[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+n[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Sidebar (F9 to focus)</div>';let i=[["↑ / ↓","Navigate file list"],["Enter","Open selected item"],["Home / End","Jump to first / last"],["Escape / F9","Return to gallery"]];for(let t=0;t<i.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+i[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+i[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Media Viewer</div>';let o=[["← / k","Previous file"],["→ / j","Next file"],["Escape","Back to gallery"],["f","Toggle fullscreen"],["i","Toggle file info"],["Space","Play / pause media"],["Enter","Open video in VLC"],["z","Cycle fit mode"],["+ / -","Zoom in / out"],["0","Reset zoom"],["d","Distraction-free mode"]];for(let t=0;t<o.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+o[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+o[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Global</div>';let r=[["F1","Toggle this help panel"],["F9","Toggle sidebar focus"],["Escape","Close help panel"]];for(let t=0;t<r.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+r[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+r[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-row" style="justify-content: center; padding: 8px 0;">',e+='<a href="docs.html" target="_blank" style="color: var(--retold-accent, #569cd6); text-decoration: none; font-size: 0.9rem; cursor: pointer;">',e+="View Documentation &#x2197;</a>",e+="</div>",e+="</div>",e+='<div class="retold-remote-help-footer">';let s="Gallery";return"viewer"===t?s="Media Viewer":"video-explorer"===t?s="Video Explorer":"audio-explorer"===t&&(s="Audio Explorer"),e+="Current mode: <strong>"+s+"</strong>",e+="</div>",e+="</div>",e+="</div>",e}_toggleSettingsPanel(){let t=this.pict.views["ContentEditor-Layout"];if(!t)return;let e=document.querySelector(".content-editor-sidebar-wrap");if(!e)return;let n=e.classList.contains("collapsed"),i=document.querySelector('.content-editor-sidebar-tab[data-tab="settings"]'),o=i&&i.classList.contains("active");n?(t.toggleSidebar(),t.switchSidebarTab("settings")):o?t.switchSidebarTab("files"):t.switchSidebarTab("settings")}_toggleFilterPresets(){let t=this.pict.AppData.RetoldRemote,e=this.pict.views["RetoldRemote-Gallery"];"gallery"===t.ActiveMode&&(!t.FilterPanelOpen&&e&&e.toggleFilterPanel(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Filter-PresetSelect");if(t)t.focus(),t.click();else{let t=document.getElementById("RetoldRemote-Filter-PresetName");t&&t.focus()}},50))}_toggleDistractionFree(){let t=this.pict.AppData.RetoldRemote,e=document.getElementById("ContentEditor-TopBar-Container"),n=document.querySelector(".content-editor-sidebar-wrap");if(!e||!n)return;if(t._distractionFreeMode||!1){e.style.display="",n.style.display="",t._distractionFreeMode=!1;let i=document.querySelector(".retold-remote-viewer-header");i&&(i.style.display="")}else if(e.style.display="none",n.style.display="none",t._distractionFreeMode=!0,!t.DistractionFreeShowNav){let t=document.querySelector(".retold-remote-viewer-header");t&&(t.style.display="none")}let i=this.pict.views["RetoldRemote-MediaViewer"];i&&i._updateDFControls&&i._updateDFControls(),setTimeout(()=>this.recalculateColumns(),100)}_toggleFullscreen(){if(document.fullscreenElement)return void document.exitFullscreen();if("video"===this.pict.AppData.RetoldRemote.CurrentViewerMediaType){let t=document.getElementById("RetoldRemote-VideoPlayer");if(t)return void t.requestFullscreen()}let t=document.getElementById("RetoldRemote-Viewer-Container");t&&t.requestFullscreen()}_toggleFileInfo(){let t=document.getElementById("RetoldRemote-FileInfo-Overlay");if(t){let e="none"===window.getComputedStyle(t).display;t.style.display=e?"block":"none"}}_togglePlayPause(){let t=document.querySelector("#RetoldRemote-Viewer-Container video"),e=document.querySelector("#RetoldRemote-Viewer-Container audio"),n=t||e;n&&(n.paused?n.play():n.pause())}_zoomIn(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomIn&&t.zoomIn()}_zoomOut(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomOut&&t.zoomOut()}_zoomReset(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomReset&&t.zoomReset()}_cycleFitMode(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.cycleFitMode&&t.cycleFitMode()}_openWithVLC(){let t=this.pict.AppData.RetoldRemote;if("video"!==t.CurrentViewerMediaType)return;if(!(t.ServerCapabilities||{}).vlc)return;let e=t.CurrentViewerFile;e&&(this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Opening in VLC..."),fetch("/api/media/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}).then(t=>t.json()).then(t=>{t.Success||this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Failed to open: "+(t.Error||"Unknown error"))}).catch(t=>{this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Failed to open: "+t.message)}))}_streamWithVLC(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerMediaType;if("video"!==e&&"audio"!==e)return;let n=t.CurrentViewerFile;if(!n)return;let i=this.pict.providers["RetoldRemote-Provider"],o=i?i.getContentURL(n):"/content/"+encodeURIComponent(n),r=window.location.origin+o,s=/Windows/.test(navigator.userAgent)?"vlc://"+r:"vlc://"+encodeURIComponent(r);this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Opening VLC...");let a=document.createElement("a");a.href=s,a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)}}d.default_configuration={ProviderIdentifier:"RetoldRemote-GalleryNavigation",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=d},{"./keyboard-handlers/KeyHandler-AudioExplorer.js":124,"./keyboard-handlers/KeyHandler-Gallery.js":125,"./keyboard-handlers/KeyHandler-Sidebar.js":126,"./keyboard-handlers/KeyHandler-VideoExplorer.js":127,"./keyboard-handlers/KeyHandler-Viewer.js":128,"pict-provider":46}],120:[function(t,e,n){const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n),this._pathToHash={},this._hashToPath={}}fetchCapabilities(t){fetch("/api/media/capabilities").then(t=>t.json()).then(e=>e&&e.Capabilities?t(null,e.Capabilities):t(null,{})).catch(e=>t(e))}fetchRemoteSettings(t){fetch("/api/remote/settings").then(t=>t.json()).then(e=>t(null,e||{})).catch(e=>t(e))}registerHash(t,e){t&&e&&(this._pathToHash[t]=e,this._hashToPath[e]=t)}getHashForPath(t){return this._pathToHash[t]||null}getPathForHash(t){return this._hashToPath[t]||null}_getPathParam(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return e}return encodeURIComponent(t)}getFragmentIdentifier(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return e}return t}resolveFragmentIdentifier(t){if(t&&/^[a-f0-9]{10}$/.test(t)){let e=this.getPathForHash(t);if(null!==e)return e}return t}getContentURL(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return"/content-hashed/"+e}return"/content/"+t.split("/").map(t=>encodeURIComponent(t)).join("/")}getThumbnailURL(t,e,n){let i=this.pict.AppData.RetoldRemote.ServerCapabilities,o=t.replace(/^.*\./,"").toLowerCase(),r=this._isImageExtension(o);return i&&(i.sharp||i.imagemagick)?"/api/media/thumbnail?path="+this._getPathParam(t)+"&width="+(e||200)+"&height="+(n||200):r?this.getContentURL(t):null}fetchMediaProbe(t,e){fetch("/api/media/probe?path="+this._getPathParam(t)).then(t=>t.json()).then(t=>{t&&t.Hash&&t.Path&&this.registerHash(t.Path,t.Hash),e(null,t)}).catch(t=>e(t))}fetchFolderSummary(t,e){let n="/api/media/folder-summary";t&&(n+="?path="+this._getPathParam(t)),fetch(n).then(t=>t.json()).then(t=>e(null,t)).catch(t=>e(t))}_isImageExtension(t){return!!{png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0,tiff:!0,tif:!0}[t]}}o.default_configuration={ProviderIdentifier:"RetoldRemote-Provider",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=o},{"pict-provider":46}],121:[function(t,e,n){const i=t("pict-provider"),o={Primary:"#C0C0DD",Accent:"#66C2B8",Muted:"#6A6A8A",Light:"#2A2A4A",WarmBeige:"#2E2E4E",TealTint:"#1E3A3A",Lavender:"#2A2A48",AmberTint:"#3A3028",PdfFill:"#3A2028",PdfText:"#E06060"};let r;try{r=t("pict-section-filebrowser/source/providers/Pict-Provider-FileBrowserIcons.js").ExtensionMap}catch(t){r={}}const s=Object.keys(r).length>0?r:{".jpg":"file-image",".jpeg":"file-image",".png":"file-image",".gif":"file-image",".svg":"file-image",".webp":"file-image",".bmp":"file-image",".ico":"file-image",".tiff":"file-image",".tif":"file-image",".heic":"file-image",".heif":"file-image",".avif":"file-image",".raw":"file-image",".txt":"file-text",".md":"file-text",".rtf":"file-text",".doc":"file-text",".docx":"file-text",".pdf":"file-pdf",".xls":"file-spreadsheet",".xlsx":"file-spreadsheet",".csv":"file-spreadsheet",".ods":"file-spreadsheet",".js":"file-code",".ts":"file-code",".jsx":"file-code",".tsx":"file-code",".py":"file-code",".rb":"file-code",".java":"file-code",".c":"file-code",".cpp":"file-code",".h":"file-code",".go":"file-code",".rs":"file-code",".swift":"file-code",".kt":"file-code",".scala":"file-code",".sh":"file-code",".bash":"file-code",".zsh":"file-code",".php":"file-code",".lua":"file-code",".r":"file-code",".sql":"file-code",".pl":"file-code",".html":"file-web",".htm":"file-web",".css":"file-web",".scss":"file-web",".less":"file-web",".xml":"file-web",".json":"file-config",".yaml":"file-config",".yml":"file-config",".toml":"file-config",".ini":"file-config",".env":"file-config",".conf":"file-config",".cfg":"file-config",".zip":"file-archive",".tar":"file-archive",".gz":"file-archive",".rar":"file-archive",".7z":"file-archive",".bz2":"file-archive",".xz":"file-archive",".tgz":"file-archive",".cbz":"file-archive",".cbr":"file-archive",".mp3":"file-audio",".wav":"file-audio",".flac":"file-audio",".ogg":"file-audio",".aac":"file-audio",".wma":"file-audio",".m4a":"file-audio",".opus":"file-audio",".aiff":"file-audio",".mp4":"file-video",".avi":"file-video",".mov":"file-video",".mkv":"file-video",".webm":"file-video",".wmv":"file-video",".flv":"file-video",".m4v":"file-video",".epub":"file-text",".mobi":"file-text"};e.exports=class extends i{constructor(t,e,n){super(t,e,n),this._colors=Object.assign({},o),this._icons=this._buildIconSet(),this._customIcons={},this._extensionMap=Object.assign({},s),this._cssInjected=!1}_buildIconSet(){let t=this;return{folder:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 9H20.8" stroke="'+n.Primary+'" stroke-width="1" opacity="0.3" /></svg>'},"folder-open":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 10.2L5.8 17.8C6 18.4 6.6 18.9 7.2 18.9H19.8L22.1 11.2C22.3 10.6 21.8 10 21.2 10H5.2C4.6 10 4 10.4 3.8 11" stroke="'+n.Primary+'" stroke-width="1.5" fill="'+n.Light+'" stroke-linecap="round" stroke-linejoin="round" opacity="0.7" /></svg>'},file:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-text":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="12.8" x2="15.9" y2="12.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="15.8" x2="15.9" y2="15.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="18.8" x2="12.2" y2="18.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"file-code":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M8.5 13.2L6.8 15.1L8.6 16.8" stroke="'+n.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><path d="M15.5 13.2L17.2 15.1L15.4 16.8" stroke="'+n.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><line x1="12.8" y1="12" x2="11.2" y2="18" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"file-image":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3.1" y="3.2" width="17.8" height="17.7" rx="2" fill="'+n.Lavender+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="8.3" cy="8.7" r="1.8" fill="'+n.Accent+'" /><path d="M20.8 15.2L15.9 10.1L5.2 20.8" stroke="'+n.Primary+'" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-pdf":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.PdfFill+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><text x="8.2" y="16.8" font-family="sans-serif" font-weight="700" font-size="6.5" fill="'+n.PdfText+'" letter-spacing="-0.3">PDF</text></svg>'},"file-spreadsheet":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.TealTint+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="7.2" y="11.1" width="9.8" height="7.8" rx="0.5" fill="none" stroke="'+n.Accent+'" stroke-width="1.2" /><line x1="7.2" y1="13.7" x2="17" y2="13.7" stroke="'+n.Accent+'" stroke-width="1" /><line x1="7.2" y1="16.3" x2="17" y2="16.3" stroke="'+n.Accent+'" stroke-width="1" /><line x1="10.9" y1="11.1" x2="10.9" y2="18.9" stroke="'+n.Accent+'" stroke-width="1" /></svg>'},"file-archive":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="8.8" y="11.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /><rect x="8.8" y="14.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /><rect x="8.8" y="17.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /></svg>'},"file-audio":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.AmberTint+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="10.2" cy="16.8" r="2.1" fill="none" stroke="'+n.Accent+'" stroke-width="1.5" /><path d="M12.2 16.8V11.2L16.1 10.1" stroke="'+n.Accent+'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="15.3" r="1.4" fill="none" stroke="'+n.Accent+'" stroke-width="1.2" /></svg>'},"file-video":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Lavender+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M9.8 12.2V18.2L15.8 15.2L9.8 12.2Z" fill="'+n.Accent+'" stroke="'+n.Accent+'" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-web":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8.9" fill="'+n.TealTint+'" stroke="'+n.Primary+'" stroke-width="1.8" /><ellipse cx="12" cy="12" rx="4.1" ry="8.9" fill="none" stroke="'+n.Primary+'" stroke-width="1.2" /><line x1="3.1" y1="12" x2="20.9" y2="12" stroke="'+n.Primary+'" stroke-width="1" /><path d="M4.8 7.8C7 8.5 9.4 8.9 12 8.9C14.6 8.9 17 8.5 19.2 7.8" stroke="'+n.Primary+'" stroke-width="1" fill="none" /><path d="M4.8 16.2C7 15.5 9.4 15.1 12 15.1C14.6 15.1 17 15.5 19.2 16.2" stroke="'+n.Primary+'" stroke-width="1" fill="none" /></svg>'},"file-config":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="12" cy="15" r="2.8" fill="none" stroke="'+n.Muted+'" stroke-width="1.5" /><line x1="12" y1="11" x2="12" y2="12.2" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="12" y1="17.8" x2="12" y2="19" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="13.2" x2="15.8" y2="12.6" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="17" x2="9.2" y2="16.4" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="16.8" x2="15.8" y2="17.4" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="13" x2="9.2" y2="13.6" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /></svg>'},home:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.1 9.6L12 3.1L20.9 9.6V19.9C20.9 20.5 20.5 21 19.9 20.9H4.1C3.5 21 3 20.5 3.1 19.9V9.6Z" fill="'+n.TealTint+'" stroke="'+n.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="9.2" y="14.1" width="5.6" height="6.9" rx="0.5" fill="'+n.Accent+'" /></svg>'},"arrow-up":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12.1 19.1V5.1" stroke="'+n.Muted+'" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M5.2 11.9L12.1 5.1L18.9 11.9" stroke="'+n.Muted+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"chevron-right":e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M9.2 6.1L14.8 12.1L9.1 17.9" stroke="'+t._colors.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"chevron-down":e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6.1 9.2L12.1 14.8L17.9 9.1" stroke="'+t._colors.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',search:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="10.8" cy="10.8" r="6.8" stroke="'+n.Primary+'" stroke-width="1.8" /><line x1="15.9" y1="16.1" x2="20.8" y2="20.8" stroke="'+n.Primary+'" stroke-width="2" stroke-linecap="round" /></svg>'},"sort-asc":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+n.Primary+'" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+n.Muted+'" opacity="0.35" /></svg>'},"sort-desc":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+n.Muted+'" opacity="0.35" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+n.Primary+'" /></svg>'},sidebar:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3" y="3" width="18" height="18" rx="2" stroke="'+n.Primary+'" stroke-width="1.8" fill="none" /><line x1="9" y1="3" x2="9" y2="21" stroke="'+n.Primary+'" stroke-width="1.8" /><line x1="5" y1="7.5" x2="7.5" y2="7.5" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="5" y1="10.5" x2="7.5" y2="10.5" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="5" y1="13.5" x2="7.5" y2="13.5" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"music-note":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="8.2" cy="17.8" r="3.1" fill="'+n.AmberTint+'" stroke="'+n.Accent+'" stroke-width="1.8" /><path d="M11.2 17.8V5.2L19.1 3.1V14.8" stroke="'+n.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="14.8" r="2.4" fill="'+n.AmberTint+'" stroke="'+n.Accent+'" stroke-width="1.5" /></svg>'},"film-strip":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3" y="4" width="18" height="16" rx="2" stroke="'+n.Primary+'" stroke-width="1.8" fill="'+n.Lavender+'" /><path d="M9.5 8.5V15.5L16 12L9.5 8.5Z" fill="'+n.Accent+'" stroke="'+n.Accent+'" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"gallery-empty":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Muted+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="9" y1="11" x2="15" y2="17" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" opacity="0.5" /><line x1="15" y1="11" x2="9" y2="17" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" opacity="0.5" /></svg>'},"document-large":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="13" x2="15.9" y2="13" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="16" x2="15.9" y2="16" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="19" x2="12" y2="19" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},bookmark:e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6 4C6 3.45 6.45 3 7 3H17C17.55 3 18 3.45 18 4V21L12 17L6 21V4Z" stroke="'+t._colors.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none" /></svg>',"bookmark-filled":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6 4C6 3.45 6.45 3 7 3H17C17.55 3 18 3.45 18 4V21L12 17L6 21V4Z" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="'+n.Accent+'" /></svg>'},collection:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="4" y="8" width="16" height="12" rx="2" stroke="'+n.Primary+'" stroke-width="1.8" fill="'+n.Light+'" /><path d="M7 8V6C7 5.45 7.45 5 8 5H16C16.55 5 17 5.45 17 6V8" stroke="'+n.Primary+'" stroke-width="1.5" fill="none" /><path d="M9 5V3.5C9 3.22 9.22 3 9.5 3H14.5C14.78 3 15 3.22 15 3.5V5" stroke="'+n.Muted+'" stroke-width="1.2" fill="none" /></svg>'},"drag-handle":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="9" cy="7" r="1.5" fill="'+n.Muted+'" /><circle cx="15" cy="7" r="1.5" fill="'+n.Muted+'" /><circle cx="9" cy="12" r="1.5" fill="'+n.Muted+'" /><circle cx="15" cy="12" r="1.5" fill="'+n.Muted+'" /><circle cx="9" cy="17" r="1.5" fill="'+n.Muted+'" /><circle cx="15" cy="17" r="1.5" fill="'+n.Muted+'" /></svg>'}}}getIcon(t,e){let n=e||16,i=this._customIcons[t]||this._icons[t];return"function"==typeof i?i(n):""}getIconForEntry(t,e){if(!t)return"";if(t.Icon&&"string"==typeof t.Icon&&0===t.Icon.indexOf("<svg"))return t.Icon;let n=e||16;if("folder"===t.Type)return this.getIcon("folder",n);let i=(t.Extension||"").toLowerCase();return i&&this._extensionMap[i]?this.getIcon(this._extensionMap[i],n):this.getIcon("file",n)}getUIIcon(t,e){return this.getIcon(t,e||16)}registerIcon(t,e){return!(!t||"function"!=typeof e)&&(this._customIcons[t]=e,!0)}registerExtension(t,e){return!(!t||!e)&&(this._extensionMap[t.toLowerCase()]=e,!0)}setColors(t){t&&"object"==typeof t&&(Object.assign(this._colors,t),this._icons=this._buildIconSet())}getColors(){return Object.assign({},this._colors)}getIconNames(){let t=Object.keys(this._icons),e=Object.keys(this._customIcons);for(let n=0;n<e.length;n++)t.indexOf(e[n])<0&&t.push(e[n]);return t}getExtensionMap(){return Object.assign({},this._extensionMap)}injectCSS(){this._cssInjected||this.pict&&this.pict.CSSMap&&(this.pict.CSSMap.addCSS("RetoldRemoteIcons",".retold-remote-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }\n.retold-remote-icon svg { display: block; }\n.retold-remote-icon-sm svg { width: 16px; height: 16px; }\n.retold-remote-icon-md svg { width: 48px; height: 48px; }\n.retold-remote-icon-lg svg { width: 64px; height: 64px; }\n.retold-remote-icon-xl svg { width: 96px; height: 96px; }\n"),this._cssInjected=!0)}onAfterInitialize(){return this.injectCSS(),super.onAfterInitialize()}},e.exports.default_configuration={ProviderIdentifier:"RetoldRemote-Icons",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0},e.exports.DefaultColors=o},{"pict-provider":46,"pict-section-filebrowser/source/providers/Pict-Provider-FileBrowserIcons.js":56}],122:[function(t,e,n){const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n),this._themes={},this._themeOrder=[],this._currentTheme="twilight",this._buildThemes()}_buildThemes(){let t=this;t._addTheme("daylight",{Name:"Daylight",Category:"Grey",Description:"Bright white, dark text",Variables:{"--retold-bg-primary":"#FFFFFF","--retold-bg-secondary":"#F0F0F0","--retold-bg-tertiary":"#E8E8E8","--retold-bg-panel":"#F5F5F5","--retold-bg-viewer":"#FAFAFA","--retold-bg-hover":"#E0E0E0","--retold-bg-selected":"#C8C8C8","--retold-bg-thumb":"#F0F0F0","--retold-text-primary":"#1A1A1A","--retold-text-secondary":"#333333","--retold-text-muted":"#666666","--retold-text-dim":"#888888","--retold-text-placeholder":"#AAAAAA","--retold-accent":"#444444","--retold-accent-hover":"#222222","--retold-border":"#D0D0D0","--retold-border-light":"#E0E0E0","--retold-danger":"#CC0000","--retold-danger-muted":"#884444","--retold-scrollbar":"#C0C0C0","--retold-scrollbar-hover":"#A0A0A0","--retold-selection-bg":"rgba(68, 68, 68, 0.2)","--retold-focus-outline":"#444444","--retold-font-family":"'Segoe UI', system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#333333",Accent:"#444444",Muted:"#888888",Light:"#E8E8E8",WarmBeige:"#F0F0F0",TealTint:"#E0E0E0",Lavender:"#EBEBEB",AmberTint:"#F0EDE8",PdfFill:"#F0E0E0",PdfText:"#CC0000"}}),t._addTheme("afternoon",{Name:"Afternoon",Category:"Grey",Description:"Warm light grey, softer contrast",Variables:{"--retold-bg-primary":"#E8E4E0","--retold-bg-secondary":"#DAD6D2","--retold-bg-tertiary":"#D0CCC8","--retold-bg-panel":"#DDD9D5","--retold-bg-viewer":"#F0ECE8","--retold-bg-hover":"#CCC8C4","--retold-bg-selected":"#B8B4B0","--retold-bg-thumb":"#DAD6D2","--retold-text-primary":"#2A2A2A","--retold-text-secondary":"#404040","--retold-text-muted":"#707070","--retold-text-dim":"#909090","--retold-text-placeholder":"#B0B0B0","--retold-accent":"#555555","--retold-accent-hover":"#333333","--retold-border":"#C0BCB8","--retold-border-light":"#D0CCC8","--retold-danger":"#AA3333","--retold-danger-muted":"#886655","--retold-scrollbar":"#B8B4B0","--retold-scrollbar-hover":"#A0A09C","--retold-selection-bg":"rgba(85, 85, 85, 0.2)","--retold-focus-outline":"#555555","--retold-font-family":"Georgia, 'Times New Roman', serif","--retold-font-mono":"'Courier New', Courier, monospace"},IconColors:{Primary:"#404040",Accent:"#555555",Muted:"#909090",Light:"#D0CCC8",WarmBeige:"#DAD6D2",TealTint:"#CCC8C4",Lavender:"#D2D0CE",AmberTint:"#D8D2C8",PdfFill:"#D8C8C0",PdfText:"#AA3333"}}),t._addTheme("evening",{Name:"Evening",Category:"Grey",Description:"Medium grey, transitional",Variables:{"--retold-bg-primary":"#484848","--retold-bg-secondary":"#3C3C3C","--retold-bg-tertiary":"#424242","--retold-bg-panel":"#454545","--retold-bg-viewer":"#363636","--retold-bg-hover":"#525252","--retold-bg-selected":"#606060","--retold-bg-thumb":"#3C3C3C","--retold-text-primary":"#E0E0E0","--retold-text-secondary":"#D0D0D0","--retold-text-muted":"#A0A0A0","--retold-text-dim":"#888888","--retold-text-placeholder":"#707070","--retold-accent":"#C0C0C0","--retold-accent-hover":"#E0E0E0","--retold-border":"#585858","--retold-border-light":"#606060","--retold-danger":"#FF6666","--retold-danger-muted":"#AA6666","--retold-scrollbar":"#585858","--retold-scrollbar-hover":"#686868","--retold-selection-bg":"rgba(192, 192, 192, 0.25)","--retold-focus-outline":"#C0C0C0","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#D0D0D0",Accent:"#C0C0C0",Muted:"#888888",Light:"#424242",WarmBeige:"#484848",TealTint:"#3E3E3E",Lavender:"#444444",AmberTint:"#4A4640",PdfFill:"#4A3C3C",PdfText:"#FF6666"}}),t._addTheme("twilight",{Name:"Twilight",Category:"Grey",Description:"Dark grey, low light (default)",Variables:{"--retold-bg-primary":"#1E1E1E","--retold-bg-secondary":"#181818","--retold-bg-tertiary":"#252525","--retold-bg-panel":"#202020","--retold-bg-viewer":"#141414","--retold-bg-hover":"#2E2E2E","--retold-bg-selected":"#404040","--retold-bg-thumb":"#181818","--retold-text-primary":"#E0E0E0","--retold-text-secondary":"#C8C8C8","--retold-text-muted":"#909090","--retold-text-dim":"#707070","--retold-text-placeholder":"#585858","--retold-accent":"#A0A0A0","--retold-accent-hover":"#C0C0C0","--retold-border":"#333333","--retold-border-light":"#404040","--retold-danger":"#FF6666","--retold-danger-muted":"#AA6666","--retold-scrollbar":"#404040","--retold-scrollbar-hover":"#505050","--retold-selection-bg":"rgba(160, 160, 160, 0.25)","--retold-focus-outline":"#A0A0A0","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#C8C8C8",Accent:"#A0A0A0",Muted:"#707070",Light:"#252525",WarmBeige:"#2A2A2A",TealTint:"#222222",Lavender:"#282828",AmberTint:"#2E2A24",PdfFill:"#2E2224",PdfText:"#E06060"}}),t._addTheme("night",{Name:"Night",Category:"Grey",Description:"Near-black, minimal contrast",Variables:{"--retold-bg-primary":"#0A0A0A","--retold-bg-secondary":"#060606","--retold-bg-tertiary":"#0E0E0E","--retold-bg-panel":"#0C0C0C","--retold-bg-viewer":"#040404","--retold-bg-hover":"#161616","--retold-bg-selected":"#252525","--retold-bg-thumb":"#060606","--retold-text-primary":"#888888","--retold-text-secondary":"#707070","--retold-text-muted":"#555555","--retold-text-dim":"#444444","--retold-text-placeholder":"#333333","--retold-accent":"#666666","--retold-accent-hover":"#808080","--retold-border":"#1A1A1A","--retold-border-light":"#222222","--retold-danger":"#AA4444","--retold-danger-muted":"#663333","--retold-scrollbar":"#1A1A1A","--retold-scrollbar-hover":"#2A2A2A","--retold-selection-bg":"rgba(102, 102, 102, 0.2)","--retold-focus-outline":"#666666","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#707070",Accent:"#666666",Muted:"#444444",Light:"#0E0E0E",WarmBeige:"#121212",TealTint:"#0C0C0C",Lavender:"#101010",AmberTint:"#141210",PdfFill:"#141010",PdfText:"#AA4444"}}),t._addTheme("neo-tokyo",{Name:"Neo-Tokyo",Category:"Fun",Description:"Neon pink on dark navy",Variables:{"--retold-bg-primary":"#0D0D2B","--retold-bg-secondary":"#080820","--retold-bg-tertiary":"#121235","--retold-bg-panel":"#0F0F28","--retold-bg-viewer":"#060615","--retold-bg-hover":"#1A1A42","--retold-bg-selected":"#2A1845","--retold-bg-thumb":"#080820","--retold-text-primary":"#E8E0F0","--retold-text-secondary":"#D0C8E0","--retold-text-muted":"#9088A8","--retold-text-dim":"#6860A0","--retold-text-placeholder":"#504888","--retold-accent":"#FF2D8A","--retold-accent-hover":"#FF5AA0","--retold-border":"#2A2050","--retold-border-light":"#382868","--retold-danger":"#FF4466","--retold-danger-muted":"#AA3355","--retold-scrollbar":"#2A2050","--retold-scrollbar-hover":"#3A3068","--retold-selection-bg":"rgba(255, 45, 138, 0.25)","--retold-focus-outline":"#FF2D8A","--retold-font-family":"'Courier New', monospace","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#D0C8E0",Accent:"#FF2D8A",Muted:"#6860A0",Light:"#121235",WarmBeige:"#141438",TealTint:"#100E30",Lavender:"#141232",AmberTint:"#1A1228",PdfFill:"#1A1028",PdfText:"#FF4466"}}),t._addTheme("cyberpunk",{Name:"Cyberpunk",Category:"Fun",Description:"Electric green on black",Variables:{"--retold-bg-primary":"#0A0E0A","--retold-bg-secondary":"#060806","--retold-bg-tertiary":"#0E120E","--retold-bg-panel":"#0C100C","--retold-bg-viewer":"#040604","--retold-bg-hover":"#142014","--retold-bg-selected":"#1A3A1A","--retold-bg-thumb":"#060806","--retold-text-primary":"#C8FFC8","--retold-text-secondary":"#A0D8A0","--retold-text-muted":"#608860","--retold-text-dim":"#406040","--retold-text-placeholder":"#305030","--retold-accent":"#00FF41","--retold-accent-hover":"#44FF77","--retold-border":"#1A2A1A","--retold-border-light":"#224022","--retold-danger":"#FF3333","--retold-danger-muted":"#AA2222","--retold-scrollbar":"#1A2A1A","--retold-scrollbar-hover":"#2A4A2A","--retold-selection-bg":"rgba(0, 255, 65, 0.2)","--retold-focus-outline":"#00FF41","--retold-font-family":"'Lucida Console', 'Courier New', monospace","--retold-font-mono":"'Lucida Console', 'Courier New', monospace"},IconColors:{Primary:"#A0D8A0",Accent:"#00FF41",Muted:"#406040",Light:"#0E120E",WarmBeige:"#101610",TealTint:"#0C140C",Lavender:"#0E120E",AmberTint:"#141810",PdfFill:"#181010",PdfText:"#FF3333"}}),t._addTheme("hotdog",{Name:"Hotdog",Category:"Fun",Description:"Red and mustard yellow, garish",Variables:{"--retold-bg-primary":"#8B0000","--retold-bg-secondary":"#6B0000","--retold-bg-tertiary":"#7B0000","--retold-bg-panel":"#750000","--retold-bg-viewer":"#550000","--retold-bg-hover":"#AA1111","--retold-bg-selected":"#BB3300","--retold-bg-thumb":"#6B0000","--retold-text-primary":"#FFD700","--retold-text-secondary":"#FFC000","--retold-text-muted":"#CC9900","--retold-text-dim":"#AA7700","--retold-text-placeholder":"#886600","--retold-accent":"#FFD700","--retold-accent-hover":"#FFEE44","--retold-border":"#AA2222","--retold-border-light":"#BB3333","--retold-danger":"#FFFF00","--retold-danger-muted":"#CCCC00","--retold-scrollbar":"#AA2222","--retold-scrollbar-hover":"#CC3333","--retold-selection-bg":"rgba(255, 215, 0, 0.3)","--retold-focus-outline":"#FFD700","--retold-font-family":"Impact, 'Arial Black', sans-serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#FFC000",Accent:"#FFD700",Muted:"#AA7700",Light:"#7B0000",WarmBeige:"#800000",TealTint:"#6B0000",Lavender:"#780000",AmberTint:"#7A1000",PdfFill:"#6B0000",PdfText:"#FFFF00"}}),t._addTheme("1970s-console",{Name:"1970s Console",Category:"Fun",Description:"Amber phosphor on brown-black",Variables:{"--retold-bg-primary":"#1A1000","--retold-bg-secondary":"#140C00","--retold-bg-tertiary":"#1E1400","--retold-bg-panel":"#1C1200","--retold-bg-viewer":"#100A00","--retold-bg-hover":"#2A1C00","--retold-bg-selected":"#3A2800","--retold-bg-thumb":"#140C00","--retold-text-primary":"#FFAA00","--retold-text-secondary":"#DD8800","--retold-text-muted":"#AA6600","--retold-text-dim":"#884400","--retold-text-placeholder":"#663300","--retold-accent":"#FFCC00","--retold-accent-hover":"#FFDD44","--retold-border":"#2A1800","--retold-border-light":"#3A2200","--retold-danger":"#FF4400","--retold-danger-muted":"#AA3300","--retold-scrollbar":"#2A1800","--retold-scrollbar-hover":"#3A2800","--retold-selection-bg":"rgba(255, 204, 0, 0.2)","--retold-focus-outline":"#FFCC00","--retold-font-family":"'Courier New', 'Lucida Console', monospace","--retold-font-mono":"'Courier New', 'Lucida Console', monospace"},IconColors:{Primary:"#DD8800",Accent:"#FFCC00",Muted:"#884400",Light:"#1E1400",WarmBeige:"#201800",TealTint:"#1A1000",Lavender:"#1C1200",AmberTint:"#221800",PdfFill:"#201000",PdfText:"#FF4400"}}),t._addTheme("1980s-console",{Name:"1980s Console",Category:"Fun",Description:"Green phosphor on black",Variables:{"--retold-bg-primary":"#001200","--retold-bg-secondary":"#000E00","--retold-bg-tertiary":"#001600","--retold-bg-panel":"#001400","--retold-bg-viewer":"#000A00","--retold-bg-hover":"#002200","--retold-bg-selected":"#003800","--retold-bg-thumb":"#000E00","--retold-text-primary":"#00FF00","--retold-text-secondary":"#00CC00","--retold-text-muted":"#009900","--retold-text-dim":"#006600","--retold-text-placeholder":"#004400","--retold-accent":"#00FF66","--retold-accent-hover":"#44FF88","--retold-border":"#002A00","--retold-border-light":"#003A00","--retold-danger":"#FF0000","--retold-danger-muted":"#AA0000","--retold-scrollbar":"#002A00","--retold-scrollbar-hover":"#004400","--retold-selection-bg":"rgba(0, 255, 102, 0.2)","--retold-focus-outline":"#00FF66","--retold-font-family":"'Courier New', monospace","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#00CC00",Accent:"#00FF66",Muted:"#006600",Light:"#001600",WarmBeige:"#001A00",TealTint:"#001200",Lavender:"#001400",AmberTint:"#001800",PdfFill:"#140000",PdfText:"#FF0000"}}),t._addTheme("1990s-website",{Name:"1990s Web Site",Category:"Fun",Description:"Blue links on grey, beveled",Variables:{"--retold-bg-primary":"#C0C0C0","--retold-bg-secondary":"#B0B0B0","--retold-bg-tertiary":"#A8A8A8","--retold-bg-panel":"#B8B8B8","--retold-bg-viewer":"#D0D0D0","--retold-bg-hover":"#B8B8D0","--retold-bg-selected":"#000080","--retold-bg-thumb":"#B0B0B0","--retold-text-primary":"#000000","--retold-text-secondary":"#000080","--retold-text-muted":"#404040","--retold-text-dim":"#606060","--retold-text-placeholder":"#808080","--retold-accent":"#0000FF","--retold-accent-hover":"#0000CC","--retold-border":"#808080","--retold-border-light":"#A0A0A0","--retold-danger":"#FF0000","--retold-danger-muted":"#990000","--retold-scrollbar":"#808080","--retold-scrollbar-hover":"#606060","--retold-selection-bg":"rgba(0, 0, 128, 0.3)","--retold-focus-outline":"#0000FF","--retold-font-family":"'Times New Roman', Times, serif","--retold-font-mono":"'Courier New', Courier, monospace"},IconColors:{Primary:"#000080",Accent:"#0000FF",Muted:"#606060",Light:"#A8A8A8",WarmBeige:"#B0B0B0",TealTint:"#A0A0A0",Lavender:"#ABABD0",AmberTint:"#B8B0A0",PdfFill:"#C0A0A0",PdfText:"#FF0000"}}),t._addTheme("early-2000s",{Name:"Early 2000s Web",Category:"Fun",Description:"Teal and silver, Web 2.0",Variables:{"--retold-bg-primary":"#E8F4F8","--retold-bg-secondary":"#D0E8EE","--retold-bg-tertiary":"#C0DDE6","--retold-bg-panel":"#D8EEF2","--retold-bg-viewer":"#F0F8FA","--retold-bg-hover":"#B0D4E0","--retold-bg-selected":"#88C4D8","--retold-bg-thumb":"#D0E8EE","--retold-text-primary":"#1A3A4A","--retold-text-secondary":"#2A4A5A","--retold-text-muted":"#5A7A8A","--retold-text-dim":"#7A9AAA","--retold-text-placeholder":"#9ABACA","--retold-accent":"#0099CC","--retold-accent-hover":"#00AADD","--retold-border":"#A0C8D8","--retold-border-light":"#B8D8E4","--retold-danger":"#CC3300","--retold-danger-muted":"#994422","--retold-scrollbar":"#A0C8D8","--retold-scrollbar-hover":"#88B8CC","--retold-selection-bg":"rgba(0, 153, 204, 0.2)","--retold-focus-outline":"#0099CC","--retold-font-family":"Verdana, Geneva, Tahoma, sans-serif","--retold-font-mono":"'Lucida Console', Monaco, monospace"},IconColors:{Primary:"#2A4A5A",Accent:"#0099CC",Muted:"#7A9AAA",Light:"#C0DDE6",WarmBeige:"#D0E8EE",TealTint:"#B0D8E4",Lavender:"#C8DCE6",AmberTint:"#D8E0D0",PdfFill:"#E0C8C0",PdfText:"#CC3300"}}),t._addTheme("synthwave",{Name:"Synthwave",Category:"Fun",Description:"Purple and pink neon",Variables:{"--retold-bg-primary":"#1A0A2E","--retold-bg-secondary":"#140824","--retold-bg-tertiary":"#200E38","--retold-bg-panel":"#1C0C32","--retold-bg-viewer":"#100620","--retold-bg-hover":"#2A1848","--retold-bg-selected":"#3A2060","--retold-bg-thumb":"#140824","--retold-text-primary":"#E8C0F8","--retold-text-secondary":"#D0A8E8","--retold-text-muted":"#9878B8","--retold-text-dim":"#7858A8","--retold-text-placeholder":"#584088","--retold-accent":"#FF71CE","--retold-accent-hover":"#FF99DD","--retold-border":"#302050","--retold-border-light":"#402868","--retold-danger":"#FF4488","--retold-danger-muted":"#AA3366","--retold-scrollbar":"#302050","--retold-scrollbar-hover":"#402868","--retold-selection-bg":"rgba(255, 113, 206, 0.25)","--retold-focus-outline":"#FF71CE","--retold-font-family":"'Trebuchet MS', sans-serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#D0A8E8",Accent:"#FF71CE",Muted:"#7858A8",Light:"#200E38",WarmBeige:"#221040",TealTint:"#1A0C30",Lavender:"#1E0E36",AmberTint:"#241028",PdfFill:"#241020",PdfText:"#FF4488"}}),t._addTheme("solarized-dark",{Name:"Solarized Dark",Category:"Fun",Description:"Schoonover's classic palette",Variables:{"--retold-bg-primary":"#002B36","--retold-bg-secondary":"#073642","--retold-bg-tertiary":"#003B4A","--retold-bg-panel":"#00303C","--retold-bg-viewer":"#001E28","--retold-bg-hover":"#0A4858","--retold-bg-selected":"#155868","--retold-bg-thumb":"#073642","--retold-text-primary":"#FDF6E3","--retold-text-secondary":"#EEE8D5","--retold-text-muted":"#93A1A1","--retold-text-dim":"#839496","--retold-text-placeholder":"#657B83","--retold-accent":"#268BD2","--retold-accent-hover":"#45A0E0","--retold-border":"#0A4050","--retold-border-light":"#125868","--retold-danger":"#DC322F","--retold-danger-muted":"#AA2A28","--retold-scrollbar":"#0A4050","--retold-scrollbar-hover":"#125868","--retold-selection-bg":"rgba(38, 139, 210, 0.25)","--retold-focus-outline":"#268BD2","--retold-font-family":"'Source Code Pro', 'Fira Code', monospace","--retold-font-mono":"'Source Code Pro', 'Fira Code', monospace"},IconColors:{Primary:"#EEE8D5",Accent:"#268BD2",Muted:"#839496",Light:"#003B4A",WarmBeige:"#073642",TealTint:"#004050",Lavender:"#003848",AmberTint:"#0A3A30",PdfFill:"#0A3028",PdfText:"#DC322F"}}),t._addTheme("forest",{Name:"Forest",Category:"Fun",Description:"Deep greens and earth browns",Variables:{"--retold-bg-primary":"#1A2018","--retold-bg-secondary":"#141A12","--retold-bg-tertiary":"#1E2620","--retold-bg-panel":"#1C221A","--retold-bg-viewer":"#101410","--retold-bg-hover":"#283828","--retold-bg-selected":"#344834","--retold-bg-thumb":"#141A12","--retold-text-primary":"#D0DCC8","--retold-text-secondary":"#B0C4A8","--retold-text-muted":"#809878","--retold-text-dim":"#607858","--retold-text-placeholder":"#486040","--retold-accent":"#6AAF5C","--retold-accent-hover":"#88CC78","--retold-border":"#2A3A28","--retold-border-light":"#3A4A38","--retold-danger":"#CC4422","--retold-danger-muted":"#884422","--retold-scrollbar":"#2A3A28","--retold-scrollbar-hover":"#3A4A38","--retold-selection-bg":"rgba(106, 175, 92, 0.25)","--retold-focus-outline":"#6AAF5C","--retold-font-family":"'Palatino Linotype', 'Book Antiqua', Palatino, serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#B0C4A8",Accent:"#6AAF5C",Muted:"#607858",Light:"#1E2620",WarmBeige:"#22281E",TealTint:"#1A221A",Lavender:"#1E2420",AmberTint:"#262218",PdfFill:"#261A18",PdfText:"#CC4422"}})}_addTheme(t,e){this._themes[t]=e,this._themeOrder.push(t)}applyTheme(t){let e=this._themes[t];e||(e=this._themes.twilight,t="twilight"),this._currentTheme=t;let n=":root {\n",i=e.Variables,o=Object.keys(i);for(let t=0;t<o.length;t++)n+="\t"+o[t]+": "+i[o[t]]+";\n";if(n+="}\n","undefined"!=typeof document){let t=document.getElementById("retold-remote-theme");t||(t=document.createElement("style"),t.id="retold-remote-theme",document.head.appendChild(t)),t.textContent=n}let r=this.pict.providers["RetoldRemote-Icons"];r&&e.IconColors&&r.setColors(e.IconColors);let s=this.pict.AppData.RetoldRemote;return s&&(s.Theme=t),!0}getThemeList(){let t=[];for(let e=0;e<this._themeOrder.length;e++){let n=this._themeOrder[e],i=this._themes[n];t.push({key:n,name:i.Name,category:i.Category,description:i.Description})}return t}getCurrentTheme(){return this._currentTheme}getTheme(t){return this._themes[t]||null}}o.default_configuration={ProviderIdentifier:"RetoldRemote-Theme",AutoInitialize:!0,AutoInitializeOrdinal:0},e.exports=o},{"pict-provider":46}],123:[function(t,e,n){const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n),this.serviceType="RetoldRemoteProvider",this._overlayTimeout=null}showOverlayIndicator(t,e){let n=e||1500,i=document.getElementById("RetoldRemote-FitIndicator");if(!i){i=document.createElement("div"),i.id="RetoldRemote-FitIndicator",i.className="retold-remote-fit-indicator";let t=document.querySelector(".retold-remote-viewer-body");t&&t.appendChild(i)}i.textContent=t,i.classList.add("visible"),this._overlayTimeout&&clearTimeout(this._overlayTimeout),this._overlayTimeout=setTimeout(function(){i.classList.remove("visible")},n)}showToast(t,e){let n=e||2e3,i=document.querySelector(".retold-remote-toast");i&&i.remove();let o=document.createElement("div");o.className="retold-remote-toast",o.textContent=t,document.body.appendChild(o),setTimeout(function(){o.parentNode&&o.remove()},n)}}o.default_configuration={ProviderIdentifier:"RetoldRemote-ToastNotification",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=o},{"pict-provider":46}],124:[function(t,e,n){e.exports=function(t,e){let n=t.pict.views["RetoldRemote-AudioExplorer"];if(n)switch(e.key){case"Escape":e.preventDefault(),n._selectionStart>=0?n.clearSelection():n.goBack();break;case"+":case"=":e.preventDefault(),n.zoomIn();break;case"-":case"_":e.preventDefault(),n.zoomOut();break;case"0":e.preventDefault(),n.zoomToFit();break;case"z":case"Z":e.preventDefault(),n.zoomToSelection();break;case" ":e.preventDefault(),n.playSelection();break;case"a":e.preventDefault();{let e=t.pict.AppData.RetoldRemote,n=t.pict.providers["RetoldRemote-CollectionManager"];if(n)if(e.LastUsedCollectionGUID)n.addAudioSnippetToCollection(e.LastUsedCollectionGUID);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}}}},{}],125:[function(t,e,n){e.exports=function(t,e){let n=t.pict.AppData.RetoldRemote,i=n.GalleryItems||[],o=n.GalleryCursorIndex||0;switch(e.key){case"ArrowRight":e.preventDefault(),t.moveCursor(Math.min(o+1,i.length-1));break;case"ArrowLeft":e.preventDefault(),t.moveCursor(Math.max(o-1,0));break;case"ArrowDown":e.preventDefault(),t.moveCursor(Math.min(o+t._columnsPerRow,i.length-1));break;case"ArrowUp":e.preventDefault(),t.moveCursor(Math.max(o-t._columnsPerRow,0));break;case"Enter":e.preventDefault(),t.openCurrent();break;case"Escape":e.preventDefault(),t.navigateUp();break;case"g":e.preventDefault(),t._toggleViewMode();break;case"x":e.preventDefault(),t._clearAllFilters();break;case"Home":e.preventDefault(),t.moveCursor(0);break;case"End":e.preventDefault(),t.moveCursor(i.length-1);break;case"1":e.preventDefault(),t.openCurrentAs("image");break;case"2":e.preventDefault(),t.openCurrentAs("video");break;case"3":e.preventDefault(),t.openCurrentAs("audio");break;case"4":e.preventDefault(),t.openCurrentAs("text");break;case"f":e.preventDefault();{t._showFilterBar();let e=t.pict.views["RetoldRemote-Gallery"];e&&e.toggleFilterPanel()}break;case"s":e.preventDefault(),t._showFilterBar(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Sort");t&&t.focus()},50);break;case"c":e.preventDefault(),t._toggleSettingsPanel();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let r=i[o];if(r&&n.LastUsedCollectionGUID){let t={Type:"folder"===r.Type||"archive"===r.Type?"folder":"file",Path:r.Path||"",Hash:r.Hash||"",Label:""};e.addItemsToCollection(n.LastUsedCollectionGUID,[t])}else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"d":e.preventDefault(),t._toggleDistractionFree();break;case"e":e.preventDefault();{let e=i[o];if(e&&"folder"!==e.Type&&"archive"!==e.Type){let n=t.pict.providers["RetoldRemote-GalleryFilterSort"];if("video"===(n?n.getCategory(e.Extension):"")){let n=t.pict.views["RetoldRemote-VideoExplorer"];n&&n.showExplorer(e.Path)}}}}}},{}],126:[function(t,e,n){e.exports=function(t,e){let n=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row"),i=n.length;if(0!==i)switch(e.key){case"ArrowDown":e.preventDefault(),t._moveSidebarCursor(Math.min(t._sidebarCursorIndex+1,i-1));break;case"ArrowUp":e.preventDefault(),t._moveSidebarCursor(Math.max(t._sidebarCursorIndex-1,0));break;case"Home":e.preventDefault(),t._moveSidebarCursor(0);break;case"End":e.preventDefault(),t._moveSidebarCursor(i-1);break;case"Enter":e.preventDefault();{let e=n[t._sidebarCursorIndex];if(e){let t=e.getAttribute("ondblclick");t&&new Function(t).call(e)}}break;case"Escape":e.preventDefault(),t._blurSidebar()}else t._blurSidebar()}},{}],127:[function(t,e,n){e.exports=function(t,e){let n=t.pict.AppData.RetoldRemote;switch(e.key){case"Escape":e.preventDefault();let i=t.pict.views["RetoldRemote-VideoExplorer"];i&&i.goBack();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e)if(n.LastUsedCollectionGUID)e.addVideoFrameToCollection(n.LastUsedCollectionGUID);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}}}},{}],128:[function(t,e,n){e.exports=function(t,e){let n=t.pict.AppData.RetoldRemote;if(n.VideoMenuActive&&"video"===n.CurrentViewerMediaType)switch(e.key){case"Escape":return e.preventDefault(),void t.closeViewer();case"ArrowRight":case"j":return e.preventDefault(),void t.nextFile();case"ArrowLeft":case"k":return e.preventDefault(),void t.prevFile();case"e":e.preventDefault();let i=t.pict.views["RetoldRemote-VideoExplorer"];return void(i&&i.showExplorer(n.CurrentViewerFile));case" ":case"Enter":e.preventDefault();let o=t.pict.views["RetoldRemote-MediaViewer"];return void(o&&o.playVideo());case"t":e.preventDefault();let r=t.pict.views["RetoldRemote-MediaViewer"];return void(r&&r.loadVideoMenuFrame());case"v":return e.preventDefault(),void t._streamWithVLC()}else switch(e.key){case"Escape":e.preventDefault(),t.closeViewer();break;case"ArrowRight":case"j":e.preventDefault(),t.nextFile();break;case"ArrowLeft":case"k":e.preventDefault(),t.prevFile();break;case"f":e.preventDefault(),t._toggleFullscreen();break;case"i":e.preventDefault(),t._toggleFileInfo();break;case" ":e.preventDefault(),t._togglePlayPause();break;case"+":case"=":e.preventDefault(),t._zoomIn();break;case"-":e.preventDefault(),t._zoomOut();break;case"0":e.preventDefault(),t._zoomReset();break;case"z":e.preventDefault(),t._cycleFitMode();break;case"Enter":case"v":e.preventDefault(),t._streamWithVLC();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let n=t.pict.AppData.RetoldRemote;if(n.LastUsedCollectionGUID)e.addCurrentFileToCollection(n.LastUsedCollectionGUID);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"d":e.preventDefault(),t._toggleDistractionFree();break;case"1":e.preventDefault(),t.switchViewerType("image");break;case"2":e.preventDefault(),t.switchViewerType("video");break;case"3":e.preventDefault(),t.switchViewerType("audio");break;case"4":e.preventDefault(),t.switchViewerType("text")}}},{}],129:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-AudioExplorer",DefaultRenderable:"RetoldRemote-AudioExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:"\n\t\t.retold-remote-aex\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t}\n\t\t.retold-remote-aex-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tz-index: 5;\n\t\t}\n\t\t.retold-remote-aex-nav-btn\n\t\t{\n\t\t\tpadding: 4px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.8rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-aex-nav-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-aex-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-aex-info\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 16px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.retold-remote-aex-info-item\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.retold-remote-aex-info-label\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-aex-info-value\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-aex-controls\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.retold-remote-aex-controls label\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-aex-controls select,\n\t\t.retold-remote-aex-controls input\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 2px 6px;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-aex-btn\n\t\t{\n\t\t\tpadding: 3px 12px;\n\t\t\tborder: 1px solid var(--retold-accent);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-aex-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-primary);\n\t\t}\n\t\t.retold-remote-aex-btn:disabled\n\t\t{\n\t\t\topacity: 0.4;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.retold-remote-aex-btn:disabled:hover\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-aex-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\toverflow: hidden;\n\t\t\tposition: relative;\n\t\t}\n\t\t.retold-remote-aex-loading\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\theight: 100%;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t\t.retold-remote-aex-loading-spinner\n\t\t{\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tborder: 3px solid var(--retold-border);\n\t\t\tborder-top-color: var(--retold-accent);\n\t\t\tborder-radius: 50%;\n\t\t\tanimation: retold-aex-spin 0.8s linear infinite;\n\t\t\tmargin-bottom: 16px;\n\t\t}\n\t\t@keyframes retold-aex-spin\n\t\t{\n\t\t\tto { transform: rotate(360deg); }\n\t\t}\n\t\t.retold-remote-aex-canvas-wrap\n\t\t{\n\t\t\tflex: 1;\n\t\t\tposition: relative;\n\t\t\tmin-height: 150px;\n\t\t\tcursor: crosshair;\n\t\t}\n\t\t.retold-remote-aex-canvas-wrap canvas\n\t\t{\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: block;\n\t\t}\n\t\t.retold-remote-aex-overview-wrap\n\t\t{\n\t\t\theight: 48px;\n\t\t\tposition: relative;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.retold-remote-aex-overview-wrap canvas\n\t\t{\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: block;\n\t\t}\n\t\t.retold-remote-aex-overview-viewport\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\theight: 100%;\n\t\t\tbackground: rgba(255, 255, 255, 0.08);\n\t\t\tborder-left: 2px solid var(--retold-accent);\n\t\t\tborder-right: 2px solid var(--retold-accent);\n\t\t\tpointer-events: none;\n\t\t}\n\t\t/* Time display bar */\n\t\t.retold-remote-aex-time-bar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 6px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-family: var(--retold-font-mono, monospace);\n\t\t}\n\t\t.retold-remote-aex-time-label\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-aex-time-value\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-aex-time-selection\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t/* Playback bar */\n\t\t.retold-remote-aex-playback\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-aex-playback audio\n\t\t{\n\t\t\tflex: 1;\n\t\t\theight: 32px;\n\t\t\tmax-width: 400px;\n\t\t}\n\t\t.retold-remote-aex-playback-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t/* Error state */\n\t\t.retold-remote-aex-error\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\theight: 100%;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.85rem;\n\t\t\ttext-align: center;\n\t\t\tpadding: 40px;\n\t\t}\n\t\t.retold-remote-aex-error-message\n\t\t{\n\t\t\tcolor: #e06c75;\n\t\t\tmargin-bottom: 16px;\n\t\t}\n\t"};class r extends i{constructor(t,e,n){super(t,e,n),this._currentPath="",this._waveformData=null,this._peaks=[],this._viewStart=0,this._viewEnd=1,this._minZoom=.005,this._selectionStart=-1,this._selectionEnd=-1,this._isDragging=!1,this._dragStart=-1,this._cursorX=-1,this._segmentURL=null,this._mainCanvas=null,this._overviewCanvas=null,this._resizeObserver=null}showExplorer(t){this.pict.AppData.RetoldRemote.ActiveMode="audio-explorer",this._currentPath=t,this._waveformData=null,this._peaks=[],this._viewStart=0,this._viewEnd=1,this._selectionStart=-1,this._selectionEnd=-1,this._segmentURL=null;let e=this.pict.providers["RetoldRemote-Provider"],n=e?e.getFragmentIdentifier(t):t;window.location.hash="#/explore-audio/"+n;let i=document.getElementById("RetoldRemote-Gallery-Container"),o=document.getElementById("RetoldRemote-Viewer-Container");i&&(i.style.display="none"),o&&(o.style.display="block");let r=t.replace(/^.*\//,""),s='<div class="retold-remote-aex">';s+='<div class="retold-remote-aex-header">',s+='<button class="retold-remote-aex-nav-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].goBack()" title="Back to audio (Esc)">&larr; Back</button>',s+='<div class="retold-remote-aex-title">Audio Explorer &mdash; '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(r)+"</div>",s+="</div>",s+='<div class="retold-remote-aex-info" id="RetoldRemote-AEX-Info" style="display:none;"></div>',s+='<div class="retold-remote-aex-controls" id="RetoldRemote-AEX-Controls" style="display:none;">',s+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomIn()" title="Zoom In (+)">+ Zoom In</button>',s+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomOut()" title="Zoom Out (-)">- Zoom Out</button>',s+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomToFit()" title="Zoom to Fit (0)">Fit All</button>',s+='<button class="retold-remote-aex-btn" id="RetoldRemote-AEX-ZoomSelBtn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomToSelection()" title="Zoom to Selection (Z)" disabled>Zoom to Selection</button>',s+='<button class="retold-remote-aex-btn" id="RetoldRemote-AEX-PlaySelBtn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].playSelection()" title="Play Selection (Space)" disabled>&#9654; Play Selection</button>',s+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].clearSelection()" title="Clear Selection (Esc)">Clear Selection</button>',s+="</div>",s+='<div class="retold-remote-aex-body" id="RetoldRemote-AEX-Body">',s+='<div class="retold-remote-aex-loading">',s+='<div class="retold-remote-aex-loading-spinner"></div>',s+="Analyzing audio waveform...",s+="</div>",s+="</div>",s+='<div class="retold-remote-aex-time-bar" id="RetoldRemote-AEX-TimeBar" style="display:none;">',s+='<span class="retold-remote-aex-time-label">View:</span>',s+='<span class="retold-remote-aex-time-value" id="RetoldRemote-AEX-ViewRange">--</span>',s+='<span class="retold-remote-aex-time-label" style="margin-left: 12px;">Selection:</span>',s+='<span class="retold-remote-aex-time-selection" id="RetoldRemote-AEX-SelectionRange">None</span>',s+='<span class="retold-remote-aex-time-label" style="margin-left: 12px;">Cursor:</span>',s+='<span class="retold-remote-aex-time-value" id="RetoldRemote-AEX-CursorTime">--</span>',s+="</div>",s+='<div class="retold-remote-aex-playback" id="RetoldRemote-AEX-Playback" style="display:none;">',s+='<span class="retold-remote-aex-playback-label">Segment:</span>',s+='<audio controls id="RetoldRemote-AEX-Audio"></audio>',s+="</div>",s+="</div>",o&&(o.innerHTML=s);let a=this.pict.views["ContentEditor-TopBar"];a&&a.updateInfo(),this._fetchWaveform(t)}_fetchWaveform(t){let e=this,n=this.pict.providers["RetoldRemote-Provider"],i=n?n._getPathParam(t):encodeURIComponent(t);fetch("/api/media/audio-waveform?path="+i+"&peaks=2000").then(t=>t.json()).then(t=>{t&&t.Success?(e._waveformData=t,e._peaks=t.Peaks||[],e._renderWaveformUI()):e._showError(t?t.Error:"Unknown error")}).catch(t=>{e._showError(t.message)})}_renderWaveformUI(){let t=this._waveformData;if(!t)return;let e=document.getElementById("RetoldRemote-AEX-Info");if(e){let n="";n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Duration</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.DurationFormatted)+"</span></span>",t.SampleRate&&(n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Sample Rate</span> <span class="retold-remote-aex-info-value">'+(t.SampleRate/1e3).toFixed(1)+" kHz</span></span>"),t.Channels&&(n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Channels</span> <span class="retold-remote-aex-info-value">'+t.Channels+(t.ChannelLayout?" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.ChannelLayout)+")":"")+"</span></span>"),t.Codec&&(n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Codec</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Codec)+"</span></span>"),t.Bitrate&&(n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Bitrate</span> <span class="retold-remote-aex-info-value">'+Math.round(t.Bitrate/1e3)+" kbps</span></span>"),t.FileSize&&(n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Size</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(t.FileSize)+"</span></span>"),n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Peaks</span> <span class="retold-remote-aex-info-value">'+t.PeakCount+" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Method)+")</span></span>",e.innerHTML=n,e.style.display=""}let n=document.getElementById("RetoldRemote-AEX-Controls");n&&(n.style.display="");let i=document.getElementById("RetoldRemote-AEX-TimeBar");i&&(i.style.display="");let o=document.getElementById("RetoldRemote-AEX-Body");if(o){let t="";t+='<div class="retold-remote-aex-canvas-wrap" id="RetoldRemote-AEX-CanvasWrap">',t+='<canvas id="RetoldRemote-AEX-MainCanvas"></canvas>',t+="</div>",t+='<div class="retold-remote-aex-overview-wrap" id="RetoldRemote-AEX-OverviewWrap">',t+='<canvas id="RetoldRemote-AEX-OverviewCanvas"></canvas>',t+='<div class="retold-remote-aex-overview-viewport" id="RetoldRemote-AEX-OverviewViewport"></div>',t+="</div>",o.innerHTML=t}this._mainCanvas=document.getElementById("RetoldRemote-AEX-MainCanvas"),this._overviewCanvas=document.getElementById("RetoldRemote-AEX-OverviewCanvas"),this._bindCanvasEvents(),this._resizeCanvases(),this._drawAll(),this._updateTimeDisplay();let r=this;if("undefined"!=typeof ResizeObserver){this._resizeObserver=new ResizeObserver(()=>{r._resizeCanvases(),r._drawAll()});let t=document.getElementById("RetoldRemote-AEX-CanvasWrap");t&&this._resizeObserver.observe(t)}}_resizeCanvases(){if(this._mainCanvas){let t=this._mainCanvas.parentElement;if(t){let e=window.devicePixelRatio||1;this._mainCanvas.width=t.clientWidth*e,this._mainCanvas.height=t.clientHeight*e}}if(this._overviewCanvas){let t=this._overviewCanvas.parentElement;if(t){let e=window.devicePixelRatio||1;this._overviewCanvas.width=t.clientWidth*e,this._overviewCanvas.height=t.clientHeight*e}}}_drawAll(){this._drawMainWaveform(),this._drawOverviewWaveform(),this._updateOverviewViewport()}_drawMainWaveform(){if(!this._mainCanvas||0===this._peaks.length)return;let t=this._mainCanvas.getContext("2d"),e=this._mainCanvas.width,n=this._mainCanvas.height,i=window.devicePixelRatio||1;t.clearRect(0,0,e,n);let o=getComputedStyle(document.documentElement).getPropertyValue("--retold-bg-primary").trim()||"#1e1e2e";t.fillStyle=o,t.fillRect(0,0,e,n);let r=this._peaks,s=r.length,a=Math.floor(this._viewStart*s),l=Math.ceil(this._viewEnd*s)-a;if(l<=0)return;let d=n/2;if(this._selectionStart>=0&&this._selectionEnd>=0){let o=Math.min(this._selectionStart,this._selectionEnd),r=Math.max(this._selectionStart,this._selectionEnd),s=this._viewEnd-this._viewStart,a=(o-this._viewStart)/s*e,l=(r-this._viewStart)/s*e;if(a=Math.max(0,a),l=Math.min(e,l),l>a){let e=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa";t.fillStyle=e+"22",t.fillRect(a,0,l-a,n),t.strokeStyle=e,t.lineWidth=2*i,t.beginPath(),t.moveTo(a,0),t.lineTo(a,n),t.stroke(),t.beginPath(),t.moveTo(l,0),t.lineTo(l,n),t.stroke()}}let c=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-dim").trim()||"#585b70";t.strokeStyle=c,t.lineWidth=1,t.setLineDash([4,4]),t.beginPath(),t.moveTo(0,d),t.lineTo(e,d),t.stroke(),t.setLineDash([]);let p=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa",h=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-secondary").trim()||"#cdd6f4";for(let n=0;n<e;n++){let i=a+n/e*l,o=a+(n+1)/e*l,c=Math.floor(i),u=Math.ceil(o);c=Math.max(0,Math.min(c,s-1)),u=Math.max(c+1,Math.min(u,s));let m=0,f=0;for(let t=c;t<u;t++)r[t].Min<m&&(m=r[t].Min),r[t].Max>f&&(f=r[t].Max);let g=d-f*d*.9,v=d-m*d*.9,b=Math.max(1,v-g),y=this._viewStart+n/e*(this._viewEnd-this._viewStart),w=!1;if(this._selectionStart>=0&&this._selectionEnd>=0){let t=Math.min(this._selectionStart,this._selectionEnd),e=Math.max(this._selectionStart,this._selectionEnd);w=y>=t&&y<=e}t.fillStyle=w?p:h,t.fillRect(n,g,1,b)}this._cursorX>=0&&this._cursorX<e&&(t.strokeStyle="#ffffff44",t.lineWidth=1,t.beginPath(),t.moveTo(this._cursorX*i,0),t.lineTo(this._cursorX*i,n),t.stroke())}_drawOverviewWaveform(){if(!this._overviewCanvas||0===this._peaks.length)return;let t=this._overviewCanvas.getContext("2d"),e=this._overviewCanvas.width,n=this._overviewCanvas.height;t.clearRect(0,0,e,n);let i=getComputedStyle(document.documentElement).getPropertyValue("--retold-bg-tertiary").trim()||"#313244";t.fillStyle=i,t.fillRect(0,0,e,n);let o=this._peaks,r=o.length,s=n/2,a=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-muted").trim()||"#a6adc8";if(this._selectionStart>=0&&this._selectionEnd>=0){let i=Math.min(this._selectionStart,this._selectionEnd),o=Math.max(this._selectionStart,this._selectionEnd),r=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa";t.fillStyle=r+"33",t.fillRect(i*e,0,(o-i)*e,n)}for(let n=0;n<e;n++){let i=n/e*r,l=(n+1)/e*r,d=Math.floor(i),c=Math.ceil(l);d=Math.max(0,Math.min(d,r-1)),c=Math.max(d+1,Math.min(c,r));let p=0,h=0;for(let t=d;t<c;t++)o[t].Min<p&&(p=o[t].Min),o[t].Max>h&&(h=o[t].Max);let u=s-h*s*.85,m=s-p*s*.85,f=Math.max(1,m-u);t.fillStyle=a,t.fillRect(n,u,1,f)}}_updateOverviewViewport(){let t=document.getElementById("RetoldRemote-AEX-OverviewViewport");if(!t)return;let e=document.getElementById("RetoldRemote-AEX-OverviewWrap");if(!e)return;let n=e.clientWidth,i=this._viewStart*n,o=this._viewEnd*n;t.style.left=i+"px",t.style.width=o-i+"px"}_bindCanvasEvents(){let t=this,e=document.getElementById("RetoldRemote-AEX-CanvasWrap");if(!e)return;e.addEventListener("mousemove",n=>{let i=e.getBoundingClientRect();if(t._cursorX=n.clientX-i.left,t._isDragging){let e=t._viewStart+t._cursorX/i.width*(t._viewEnd-t._viewStart);e=Math.max(0,Math.min(1,e)),t._selectionEnd=e,t._drawMainWaveform(),t._drawOverviewWaveform(),t._updateSelectionButtons()}t._updateTimeDisplay(),t._drawMainWaveform()}),e.addEventListener("mouseleave",()=>{t._cursorX=-1,t._drawMainWaveform()}),e.addEventListener("mousedown",n=>{if(0!==n.button)return;let i=e.getBoundingClientRect(),o=t._viewStart+(n.clientX-i.left)/i.width*(t._viewEnd-t._viewStart);o=Math.max(0,Math.min(1,o)),t._isDragging=!0,t._selectionStart=o,t._selectionEnd=o,t._dragStart=o,t._segmentURL=null;let r=document.getElementById("RetoldRemote-AEX-Playback");r&&(r.style.display="none")}),window.addEventListener("mouseup",()=>{t._isDragging&&(t._isDragging=!1,Math.abs(t._selectionEnd-t._selectionStart)<.001&&(t._selectionStart=-1,t._selectionEnd=-1),t._updateSelectionButtons(),t._drawAll(),t._updateTimeDisplay())}),e.addEventListener("wheel",n=>{n.preventDefault();let i=e.getBoundingClientRect(),o=(n.clientX-i.left)/i.width,r=n.deltaY>0?1.2:.8;t._zoomAtPoint(o,r)},{passive:!1});let n=document.getElementById("RetoldRemote-AEX-OverviewWrap");n&&n.addEventListener("click",e=>{let i=n.getBoundingClientRect(),o=(e.clientX-i.left)/i.width;o=Math.max(0,Math.min(1,o));let r=t._viewEnd-t._viewStart,s=o-r/2;s=Math.max(0,Math.min(1-r,s)),t._viewStart=s,t._viewEnd=s+r,t._drawAll(),t._updateTimeDisplay()})}_zoomAtPoint(t,e){let n=this._viewEnd-this._viewStart,i=this._viewStart+t*n,o=n*e;o=Math.max(this._minZoom,Math.min(1,o));let r=i-t*o,s=r+o;r<0&&(r=0,s=o),s>1&&(s=1,r=1-o),this._viewStart=Math.max(0,r),this._viewEnd=Math.min(1,s),this._drawAll(),this._updateTimeDisplay()}_updateTimeDisplay(){if(!this._waveformData)return;let t=this._waveformData.Duration,e=document.getElementById("RetoldRemote-AEX-ViewRange");if(e){let n=this._viewStart*t,i=this._viewEnd*t;e.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(n,!0)+" - "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(i,!0)}let n=document.getElementById("RetoldRemote-AEX-SelectionRange");if(n)if(this._selectionStart>=0&&this._selectionEnd>=0){let e=Math.min(this._selectionStart,this._selectionEnd)*t,i=Math.max(this._selectionStart,this._selectionEnd)*t,o=i-e;n.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(e,!0)+" - "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(i,!0)+" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(o,!0)+")"}else n.textContent="None";let i=document.getElementById("RetoldRemote-AEX-CursorTime");if(i)if(this._cursorX>=0&&this._mainCanvas){let e=this._mainCanvas.parentElement;if(e){let n=this._viewStart+this._cursorX/e.clientWidth*(this._viewEnd-this._viewStart);i.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(n*t,!0)}}else i.textContent="--"}_updateSelectionButtons(){let t=this._selectionStart>=0&&this._selectionEnd>=0&&Math.abs(this._selectionEnd-this._selectionStart)>=.001,e=document.getElementById("RetoldRemote-AEX-ZoomSelBtn");e&&(e.disabled=!t);let n=document.getElementById("RetoldRemote-AEX-PlaySelBtn");n&&(n.disabled=!t)}zoomIn(){this._zoomAtPoint(.5,.5)}zoomOut(){this._zoomAtPoint(.5,2)}zoomToFit(){this._viewStart=0,this._viewEnd=1,this._drawAll(),this._updateTimeDisplay()}zoomToSelection(){if(this._selectionStart<0||this._selectionEnd<0)return;let t=Math.min(this._selectionStart,this._selectionEnd),e=Math.max(this._selectionStart,this._selectionEnd),n=.05*(e-t);this._viewStart=Math.max(0,t-n),this._viewEnd=Math.min(1,e+n),this._drawAll(),this._updateTimeDisplay()}clearSelection(){this._selectionStart=-1,this._selectionEnd=-1,this._segmentURL=null;let t=document.getElementById("RetoldRemote-AEX-Playback");t&&(t.style.display="none"),this._updateSelectionButtons(),this._drawAll(),this._updateTimeDisplay()}playSelection(){if(this._selectionStart<0||this._selectionEnd<0||!this._waveformData)return;let t=this._waveformData.Duration,e=Math.min(this._selectionStart,this._selectionEnd)*t,n=Math.max(this._selectionStart,this._selectionEnd)*t,i=this.pict.providers["RetoldRemote-Provider"],o="/api/media/audio-segment?path="+(i?i._getPathParam(this._currentPath):encodeURIComponent(this._currentPath))+"&start="+e.toFixed(3)+"&end="+n.toFixed(3)+"&format=mp3",r=document.getElementById("RetoldRemote-AEX-Playback");r&&(r.style.display="");let s=document.getElementById("RetoldRemote-AEX-Audio");s&&(s.src=o,s.load(),s.play().catch(()=>{})),this._segmentURL=o}goBack(){if(this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this._currentPath){let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"audio")}else{let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}}_showError(t){let e=document.getElementById("RetoldRemote-AEX-Body");e&&(e.innerHTML='<div class="retold-remote-aex-error"><div class="retold-remote-aex-error-message">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-aex-nav-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].goBack()">Back to Audio</button></div>')}}r.default_configuration=o,e.exports=r},{"pict-view":76}],130:[function(t,e,n){
119
+ const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n)}_getRemote(){return this.pict.AppData.RetoldRemote}_getPanelView(){return this.pict.views["RetoldRemote-CollectionsPanel"]}_getToast(){return this.pict.providers["RetoldRemote-ToastNotification"]}fetchCollections(t){let e=this,n="function"==typeof t?t:()=>{};fetch("/api/collections").then(t=>t.json()).then(t=>{let i=e._getRemote();i.Collections=Array.isArray(t)?t:[];let o=e._getPanelView();return o&&i.CollectionsPanelOpen&&o.renderContent(),n(null,i.Collections)}).catch(t=>(e.log.error("Failed to fetch collections: "+t.message),n(t)))}fetchCollection(t,e){let n=this,i="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t)).then(t=>{if(!t.ok)throw new Error("Collection not found");return t.json()}).then(e=>{let o=n._getRemote();o.ActiveCollectionGUID=t,o.ActiveCollection=e;let r=n._getPanelView();return r&&r.renderContent(),i(null,e)}).catch(t=>(n.log.error("Failed to fetch collection: "+t.message),i(t)))}createCollection(t,e){let n=this,i="function"==typeof e?e:()=>{},o=this.fable.getUUID();fetch("/api/collections/"+encodeURIComponent(o),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Name:t||"Untitled Collection"})}).then(t=>t.json()).then(e=>{n._getRemote().LastUsedCollectionGUID=o,n.fetchCollections();let r=n._getToast();return r&&r.show("Collection created: "+(e.Name||t)),i(null,e)}).catch(t=>(n.log.error("Failed to create collection: "+t.message),i(t)))}updateCollection(t,e){let n=this,i="function"==typeof e?e:()=>{};if(!t||!t.GUID)return i(new Error("Collection must have a GUID"));fetch("/api/collections/"+encodeURIComponent(t.GUID),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then(t=>t.json()).then(e=>{let o=n._getRemote();return o.ActiveCollectionGUID===t.GUID&&(o.ActiveCollection=e),n.fetchCollections(),i(null,e)}).catch(t=>(n.log.error("Failed to update collection: "+t.message),i(t)))}deleteCollection(t,e){let n=this,i="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t),{method:"DELETE"}).then(t=>t.json()).then(()=>{let e=n._getRemote();e.ActiveCollectionGUID===t&&(e.ActiveCollectionGUID=null,e.ActiveCollection=null,e.CollectionsPanelMode="list"),e.LastUsedCollectionGUID===t&&(e.LastUsedCollectionGUID=null),n.fetchCollections();let o=n._getToast();return o&&o.show("Collection deleted"),i(null)}).catch(t=>(n.log.error("Failed to delete collection: "+t.message),i(t)))}addItemsToCollection(t,e,n){let i=this,o="function"==typeof n?n:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Items:e})}).then(t=>t.json()).then(n=>{let r=i._getRemote();r.LastUsedCollectionGUID=t,r.ActiveCollectionGUID===t&&(r.ActiveCollection=n),i.fetchCollections();let s=i._getPanelView();s&&"detail"===r.CollectionsPanelMode&&r.ActiveCollectionGUID===t&&s.renderContent();let a=i._getToast();if(a){let t=n.Name||"collection";a.show("Added "+e.length+" item"+(e.length>1?"s":"")+" to "+t)}return o(null,n)}).catch(t=>(i.log.error("Failed to add items to collection: "+t.message),o(t)))}removeItemFromCollection(t,e,n){let i=this,o="function"==typeof n?n:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/items/"+encodeURIComponent(e),{method:"DELETE"}).then(t=>t.json()).then(e=>{let n=i._getRemote();n.ActiveCollectionGUID===t&&(n.ActiveCollection=e),i.fetchCollections();let r=i._getPanelView();return r&&"detail"===n.CollectionsPanelMode&&n.ActiveCollectionGUID===t&&r.renderContent(),o(null,e)}).catch(t=>(i.log.error("Failed to remove item from collection: "+t.message),o(t)))}reorderItems(t,e,n){let i=this,o="function"==typeof n?n:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/reorder",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({ItemOrder:e})}).then(t=>t.json()).then(e=>{let n=i._getRemote();n.ActiveCollectionGUID===t&&(n.ActiveCollection=e);let r=i._getPanelView();return r&&"detail"===n.CollectionsPanelMode&&r.renderContent(),o(null,e)}).catch(t=>(i.log.error("Failed to reorder items: "+t.message),o(t)))}copyItems(t,e,n,i){let o=this,r="function"==typeof i?i:()=>{};fetch("/api/collections/copy-items",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({SourceGUID:t,TargetGUID:e,ItemIDs:n})}).then(t=>t.json()).then(t=>{o.fetchCollections();let e=o._getToast();return e&&e.show("Copied "+n.length+" item"+(n.length>1?"s":"")),r(null,t)}).catch(t=>(o.log.error("Failed to copy items: "+t.message),r(t)))}togglePanel(){let t=this._getRemote();t.CollectionsPanelOpen=!t.CollectionsPanelOpen;let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&(t.CollectionsPanelOpen?(e.classList.remove("collapsed"),t.CollectionsPanelWidth&&(e.style.width=t.CollectionsPanelWidth+"px"),this.fetchCollections()):e.classList.add("collapsed"));let n=this.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.updateCollectionsIcon&&n.updateCollectionsIcon(),this.pict.PictApplication.saveSettings();let i=this;setTimeout(()=>{let t=i.pict.providers["RetoldRemote-GalleryNavigation"];t&&"function"==typeof t.recalculateColumns&&t.recalculateColumns()},250)}openPanel(){this._getRemote().CollectionsPanelOpen||this.togglePanel()}closePanel(){this._getRemote().CollectionsPanelOpen&&this.togglePanel()}addCurrentFileToCollection(t){let e=this._getRemote(),n=this.pict.AppData.ContentEditor.CurrentFile;if(!n)return!1;let i=t||e.LastUsedCollectionGUID;if(!i)return!1;let o={Type:"file",Path:n,Label:"",Note:""},r=n.match(/^(.*?\.(zip|7z|rar|tar|tgz|cbz|cbr|tar\.gz|tar\.bz2|tar\.xz))\/(.*)/i);if(r&&(o.Type="subfile",o.ArchivePath=r[1]),"viewer"===e.ActiveMode&&"video"===e.CurrentViewerMediaType&&!e.VideoMenuActive){let t=document.getElementById("RetoldRemote-VideoPlayer");t&&!isNaN(t.currentTime)&&t.currentTime>0&&(o.Type="video-frame",o.FrameTimestamp=Math.round(100*t.currentTime)/100)}let s=this.pict.providers["RetoldRemote-Provider"];if(s){let t=s.getHashForPath(n);t&&(o.Hash=t)}return this.addItemsToCollection(i,[o]),!0}addVideoFrameToCollection(t){let e=this._getRemote(),n=t||e.LastUsedCollectionGUID;if(!n)return!1;let i=this.pict.views["RetoldRemote-VideoExplorer"];if(!i||!i._currentPath||!i._frameData)return!1;let o=i._selectedFrameIndex;o<0&&(o=0);let r=i._frameData.Frames[o];if(!r)return!1;let s={Type:"video-frame",Path:i._currentPath,FrameTimestamp:r.Timestamp,Label:r.TimestampFormatted||"",Note:""};return this.addItemsToCollection(n,[s]),!0}addVideoClipToCollection(t,e,n){let i=this._getRemote(),o=t||i.LastUsedCollectionGUID;if(!o)return!1;let r=i.CurrentViewerFile;if(!r)return!1;let s={Type:"video-clip",Path:r,VideoStart:e,VideoEnd:n,Label:this._formatTimestamp(e)+" - "+this._formatTimestamp(n),Note:""};return this.addItemsToCollection(o,[s]),!0}addAudioSnippetToCollection(t){let e=this._getRemote(),n=t||e.LastUsedCollectionGUID;if(!n)return!1;let i=this.pict.views["RetoldRemote-AudioExplorer"];if(!i||!i._currentPath||!i._waveformData)return!1;let o=i._waveformData.Duration||0;if(o<=0)return!1;let r=0,s=o;i._selectionStart>=0&&i._selectionEnd>=0&&(r=Math.round(i._selectionStart*o*100)/100,s=Math.round(i._selectionEnd*o*100)/100);let a={Type:"video-clip",Path:i._currentPath,VideoStart:r,VideoEnd:s,Label:this._formatTimestamp(r)+" - "+this._formatTimestamp(s),Note:""};return this.addItemsToCollection(n,[a]),!0}_formatTimestamp(t){if("number"!=typeof t||isNaN(t))return"0:00";let e=Math.floor(t),n=Math.floor(e/3600),i=Math.floor(e%3600/60),o=e%60;return n>0?n+":"+(i<10?"0":"")+i+":"+(o<10?"0":"")+o:i+":"+(o<10?"0":"")+o}addCurrentFolderToCollection(t,e){this._getRemote();let n=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";if(!n||!t)return;let i={Type:"contents"===e?"folder-contents":"folder",Path:n,Label:"",Note:""};this.addItemsToCollection(t,[i])}_sortItems(t,e,n){if(!Array.isArray(t)||t.length<2)return t;let i="desc"===n?-1:1;switch(e){case"name":t.sort((t,e)=>{let n=(t.Label||t.Path||"").toLowerCase(),o=(e.Label||e.Path||"").toLowerCase(),r=n.lastIndexOf("/"),s=o.lastIndexOf("/");return r>=0&&(n=n.substring(r+1)),s>=0&&(o=o.substring(s+1)),i*n.localeCompare(o)});break;case"type":t.sort((t,e)=>{let n=(t.Type||"").toLowerCase(),o=(e.Type||"").toLowerCase();return i*n.localeCompare(o)});break;case"modified":t.sort((t,e)=>{let n=t.AddedAt||"",o=e.AddedAt||"";return i*n.localeCompare(o)});break;default:t.sort((t,e)=>i*((t.SortOrder||0)-(e.SortOrder||0)))}return t}sortActiveCollection(t,e){let n=this._getRemote().ActiveCollection;if(!n)return;"string"==typeof t&&(n.SortMode=t),"string"==typeof e&&(n.SortDirection=e),this._sortItems(n.Items||[],n.SortMode,n.SortDirection);let i=this._getPanelView();i&&i.renderContent(),fetch("/api/collections/"+encodeURIComponent(n.GUID),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({GUID:n.GUID,SortMode:n.SortMode,SortDirection:n.SortDirection})}).catch(t=>{this.log.error("Failed to save sort preference: "+t.message)})}searchCollections(t){let e=this._getRemote(),n=(t||"").toLowerCase();return n?e.Collections.filter(t=>{let e=(t.Name||"").toLowerCase(),i=(t.Description||"").toLowerCase(),o=(t.Tags||[]).join(" ").toLowerCase();return e.indexOf(n)>=0||i.indexOf(n)>=0||o.indexOf(n)>=0}):e.Collections}createOperationPlan(t,e,n){let i=this,o="function"==typeof n?n:()=>{},r=this.fable.getUUID(),s={Name:t||"Sort Plan",CollectionType:"operation-plan",Items:e||[]};fetch("/api/collections/"+encodeURIComponent(r),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}).then(t=>t.json()).then(e=>{let n=i._getRemote();if(n.ActiveCollectionGUID=r,n.ActiveCollection=e,n.CollectionsPanelMode="detail",n.CollectionsPanelOpen){let t=i._getPanelView();t&&t.renderContent()}else i.togglePanel();i.fetchCollections();let s=i._getToast();return s&&s.show("Sort plan created: "+(e.Name||t)),o(null,e)}).catch(t=>(i.log.error("Failed to create operation plan: "+t.message),o(t)))}executeCollectionOperations(t,e){let n=this,i="function"==typeof e?e:()=>{};fetch("/api/collections/"+encodeURIComponent(t)+"/execute",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})}).then(t=>t.json()).then(e=>{let o=n._getRemote();e.Collection&&o.ActiveCollectionGUID===t&&(o.ActiveCollection=e.Collection);let r=n._getPanelView();r&&r.renderContent();let s=n._getToast();return s&&(e.TotalFailed>0?s.show("Moved "+e.TotalMoved+" files ("+e.TotalFailed+" failed)"):s.show("Successfully moved "+e.TotalMoved+" files")),i(null,e)}).catch(t=>{n.log.error("Failed to execute operations: "+t.message);let e=n._getToast();return e&&e.show("Failed to execute operations: "+t.message),i(t)})}undoCollectionOperations(t,e){let n=this,i="function"==typeof e?e:()=>{},o=this._getRemote().ActiveCollection;if(!o||!o.OperationBatchGUID){let t=n._getToast();return t&&t.show("No batch to undo"),i(new Error("No batch to undo"))}fetch("/api/files/undo-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({BatchGUID:o.OperationBatchGUID})}).then(t=>t.json()).then(t=>{if(o.Items)for(let t=0;t<o.Items.length;t++)"completed"===o.Items[t].OperationStatus&&(o.Items[t].OperationStatus="pending");o.OperationBatchGUID=null,n.updateCollection(o);let e=n._getPanelView();e&&e.renderContent();let r=n._getToast();return r&&r.show("Undo complete: "+t.TotalReversed+" files restored"),i(null,t)}).catch(t=>{n.log.error("Failed to undo operations: "+t.message);let e=n._getToast();return e&&e.show("Failed to undo: "+t.message),i(t)})}setItemDestination(t,e){let n=this._getRemote().ActiveCollection;if(n&&n.Items){for(let i=0;i<n.Items.length;i++)if(n.Items[i].ID===t){n.Items[i].DestinationPath=e;break}this.updateCollection(n)}}skipItemOperation(t){let e=this._getRemote().ActiveCollection;if(!e||!e.Items)return;for(let n=0;n<e.Items.length;n++)if(e.Items[n].ID===t){e.Items[n].OperationStatus="skipped";break}let n=this._getPanelView();n&&n.renderContent(),this.updateCollection(e)}}o.default_configuration={ProviderIdentifier:"RetoldRemote-CollectionManager",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=o},{"pict-provider":46}],117:[function(t,e,n){const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n),this.serviceType="RetoldRemoteProvider"}escapeHTML(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}formatFileSize(t){if(!t||0===t)return"0 B";let e=["B","KB","MB","GB","TB"],n=Math.floor(Math.log(t)/Math.log(1024));return n>=e.length&&(n=e.length-1),(t/Math.pow(1024,n)).toFixed(0===n?0:1)+" "+e[n]}formatShortDate(t){if(!t)return"";let e=new Date(t);return isNaN(e.getTime())?"":e.getMonth()+1+"/"+e.getDate()+"/"+String(e.getFullYear()).slice(-2)}formatTimestamp(t,e){if(null==t||isNaN(t))return"--";let n,i=Math.floor(t/3600),o=Math.floor(t%3600/60),r=Math.floor(t%60);if(n=i>0?i+":"+String(o).padStart(2,"0")+":"+String(r).padStart(2,"0"):o+":"+String(r).padStart(2,"0"),e){n+="."+Math.floor(t%1*10)}return n}}o.default_configuration={ProviderIdentifier:"RetoldRemote-FormattingUtilities",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=o},{"pict-provider":46}],118:[function(t,e,n){const i=t("pict-provider"),o=t("../RetoldRemote-ExtensionMaps.js");class r extends i{constructor(t,e,n){super(t,e,n)}applyFilterSort(){let t=this.pict.AppData.RetoldRemote;if(!t)return;let e=(t.RawFileList||[]).slice();e=this._applySearch(e,t.SearchQuery);let n=t.FilterState||{};e=this._applyMediaTypeFilter(e,n.MediaType||"all"),e=this._applyExtensionFilter(e,n.Extensions||[]),e=this._applySizeFilter(e,n.SizeMin,n.SizeMax),e=this._applyDateFilter(e,n),e=this._sortItems(e,t.SortField||"folder-first",t.SortDirection||"asc"),t.GalleryItems=e;let i=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",o=t.FolderCursorHistory&&t.FolderCursorHistory[i];"number"==typeof o&&o<e.length?t.GalleryCursorIndex=o:t.GalleryCursorIndex=0;let r=this.pict.views["RetoldRemote-Gallery"];r&&r.renderGallery()}_applySearch(t,e){if(!e)return t;let n=this.pict.AppData.RetoldRemote,i=n.SearchCaseSensitive||!1;if(n.SearchRegex||!1){let o;try{o=new RegExp(e,i?"":"i")}catch(e){return n._searchRegexError=e.message,t}return n._searchRegexError=null,t.filter(t=>o.test(t.Name))}if(n._searchRegexError=null,i)return t.filter(t=>t.Name.includes(e));let o=e.toLowerCase();return t.filter(t=>t.Name.toLowerCase().includes(o))}_applyMediaTypeFilter(t,e){return"all"===e?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let n=this.getCategory((t.Extension||"").toLowerCase());return"images"===e?"image"===n:"video"===e?"video"===n:"audio"===e?"audio"===n:"documents"!==e||"document"===n})}_applyExtensionFilter(t,e){if(!e||0===e.length)return t;let n={};for(let t=0;t<e.length;t++)n[e[t].toLowerCase()]=!0;return t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let e=(t.Extension||"").replace(/^\./,"").toLowerCase();return!0===n[e]})}_applySizeFilter(t,e,n){return null===e&&null===n?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;let i=t.Size||0;return!(null!==e&&i<e)&&!(null!==n&&i>n)})}_applyDateFilter(t,e){let n=e.DateModifiedAfter?new Date(e.DateModifiedAfter).getTime():null,i=e.DateModifiedBefore?new Date(e.DateModifiedBefore+"T23:59:59").getTime():null,o=e.DateCreatedAfter?new Date(e.DateCreatedAfter).getTime():null,r=e.DateCreatedBefore?new Date(e.DateCreatedBefore+"T23:59:59").getTime():null;return null===n&&null===i&&null===o&&null===r?t:t.filter(t=>{if("folder"===t.Type||"archive"===t.Type)return!0;if(null!==n||null!==i){let e=t.Modified?new Date(t.Modified).getTime():0;if(null!==n&&e<n)return!1;if(null!==i&&e>i)return!1}if(null!==o||null!==r){let e=t.Created?new Date(t.Created).getTime():0;if(null!==o&&e<o)return!1;if(null!==r&&e>r)return!1}return!0})}_sortItems(t,e,n){let i="desc"===n?-1:1;return t.slice().sort((t,n)=>{if("folder-first"===e){let e="folder"===t.Type||"archive"===t.Type,o="folder"===n.Type||"archive"===n.Type;if(e&&!o)return-1;if(!e&&o)return 1;let r=(t.Name||"").toLowerCase(),s=(n.Name||"").toLowerCase();return r<s?-1*i:r>s?1*i:0}if("name"===e){let e=(t.Name||"").toLowerCase(),o=(n.Name||"").toLowerCase();return e<o?-1*i:e>o?1*i:0}if("modified"===e){let e=t.Modified?new Date(t.Modified).getTime():0,o=n.Modified?new Date(n.Modified).getTime():0;if(e!==o)return(e-o)*i;let r=(t.Name||"").toLowerCase(),s=(n.Name||"").toLowerCase();return r<s?-1:r>s?1:0}if("created"===e){let e=t.Created?new Date(t.Created).getTime():0,o=n.Created?new Date(n.Created).getTime():0;if(e!==o)return(e-o)*i;let r=(t.Name||"").toLowerCase(),s=(n.Name||"").toLowerCase();return r<s?-1:r>s?1:0}return 0})}getCategory(t){return o.getCategory(t)}getAvailableExtensions(){let t=this.pict.AppData.RetoldRemote,e=t?t.RawFileList:[],n={};for(let t=0;t<e.length;t++){let i=e[t];if("folder"===i.Type||"archive"===i.Type)continue;let o=(i.Extension||"").replace(/^\./,"").toLowerCase();o&&(n[o]||(n[o]={ext:o,category:this.getCategory(o),count:0}),n[o].count++)}let i={image:0,video:1,audio:2,document:3,other:4},o=Object.values(n);return o.sort((t,e)=>{let n=i[t.category]||99,o=i[e.category]||99;return n!==o?n-o:t.ext<e.ext?-1:t.ext>e.ext?1:0}),o}getActiveFilterChips(){let t=this.pict.AppData.RetoldRemote;if(!t)return[];let e=[],n=t.FilterState||{};if(n.MediaType&&"all"!==n.MediaType){let t={images:"Images",video:"Video",audio:"Audio",documents:"Docs"};e.push({key:"mediaType",label:t[n.MediaType]||n.MediaType})}let i=n.Extensions||[];if(i.length>0)for(let t=0;t<i.length;t++)e.push({key:"ext:"+i[t],label:"."+i[t]});if(null!==n.SizeMin&&void 0!==n.SizeMin&&e.push({key:"sizeMin",label:"≥ "+this._formatSizeKB(n.SizeMin)}),null!==n.SizeMax&&void 0!==n.SizeMax&&e.push({key:"sizeMax",label:"≤ "+this._formatSizeKB(n.SizeMax)}),n.DateModifiedAfter&&e.push({key:"dateModifiedAfter",label:"Modified after "+n.DateModifiedAfter}),n.DateModifiedBefore&&e.push({key:"dateModifiedBefore",label:"Modified before "+n.DateModifiedBefore}),n.DateCreatedAfter&&e.push({key:"dateCreatedAfter",label:"Created after "+n.DateCreatedAfter}),n.DateCreatedBefore&&e.push({key:"dateCreatedBefore",label:"Created before "+n.DateCreatedBefore}),t.SearchQuery){let n='Search: "'+t.SearchQuery+'"',i=[];t.SearchCaseSensitive&&i.push("Aa"),t.SearchRegex&&i.push(".*"),i.length>0&&(n+=" ["+i.join(", ")+"]"),e.push({key:"search",label:n})}return e}_formatSizeKB(t){return t>=1048576?(t/1048576).toFixed(1)+" MB":Math.round(t/1024)+" KB"}removeFilter(t){let e=this.pict.AppData.RetoldRemote;if(!e)return;let n=e.FilterState;if("mediaType"===t)n.MediaType="all",e.GalleryFilter="all";else if(t.startsWith("ext:")){let e=t.substring(4);n.Extensions=(n.Extensions||[]).filter(t=>t!==e)}else"sizeMin"===t?n.SizeMin=null:"sizeMax"===t?n.SizeMax=null:"dateModifiedAfter"===t?n.DateModifiedAfter=null:"dateModifiedBefore"===t?n.DateModifiedBefore=null:"dateCreatedAfter"===t?n.DateCreatedAfter=null:"dateCreatedBefore"===t?n.DateCreatedBefore=null:"search"===t&&(e.SearchQuery="",e._searchRegexError=null)}clearAllFilters(){let t=this.pict.AppData.RetoldRemote;t&&(t.SearchQuery="",t.SearchCaseSensitive=!1,t.SearchRegex=!1,t._searchRegexError=null,t.GalleryFilter="all",t.FilterState={MediaType:"all",Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null})}savePreset(t){if(!t)return;let e=this.pict.AppData.RetoldRemote;if(!e)return;let n={Name:t,FilterState:JSON.parse(JSON.stringify(e.FilterState)),SortField:e.SortField,SortDirection:e.SortDirection};e.FilterPresets=e.FilterPresets||[],e.FilterPresets.push(n)}loadPreset(t){let e=this.pict.AppData.RetoldRemote;if(!e||!e.FilterPresets)return;let n=e.FilterPresets[t];n&&(e.FilterState=JSON.parse(JSON.stringify(n.FilterState)),e.GalleryFilter=e.FilterState.MediaType||"all",e.SortField=n.SortField||"folder-first",e.SortDirection=n.SortDirection||"asc")}deletePreset(t){let e=this.pict.AppData.RetoldRemote;e&&e.FilterPresets&&e.FilterPresets.splice(t,1)}}r.default_configuration={ProviderIdentifier:"RetoldRemote-GalleryFilterSort",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!1},e.exports=r},{"../RetoldRemote-ExtensionMaps.js":114,"pict-provider":46}],119:[function(t,e,n){const i=t("pict-provider"),o=t("./keyboard-handlers/KeyHandler-Gallery.js"),r=t("./keyboard-handlers/KeyHandler-Viewer.js"),s=t("./keyboard-handlers/KeyHandler-Sidebar.js"),a=t("./keyboard-handlers/KeyHandler-VideoExplorer.js"),l=t("./keyboard-handlers/KeyHandler-AudioExplorer.js");class d extends i{constructor(t,e,n){super(t,e,n),this._columnsPerRow=4,this._keydownBound=!1,this._helpPanelVisible=!1,this._sidebarFocused=!1,this._sidebarCursorIndex=0}recalculateColumns(){if("list"===this.pict.AppData.RetoldRemote.ViewMode)return void(this._columnsPerRow=1);let t=document.querySelectorAll(".retold-remote-tile");if(t.length<2)return void(this._columnsPerRow=Math.max(1,t.length));let e=t[0].offsetTop,n=1;for(let i=1;i<t.length&&t[i].offsetTop===e;i++)n++;this._columnsPerRow=n}bindKeyboardNavigation(){if(this._keydownBound)return;let t=this;this._keydownHandler=function(e){if("F1"===e.key)return e.preventDefault(),void t._toggleHelpPanel();if("F9"===e.key)return e.preventDefault(),void(t._sidebarFocused?t._blurSidebar():t._focusSidebar());if("/"===e.key){let n=document.getElementById("RetoldRemote-Gallery-Search");if(e.target===n)return e.preventDefault(),t._hideFilterBar(),void n.blur();if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable)return;return e.preventDefault(),void t._toggleFilterBar()}if("Escape"===e.key&&"RetoldRemote-Gallery-Search"===e.target.id)return e.preventDefault(),e.target.blur(),void t._hideFilterBar();if("INPUT"===e.target.tagName||"TEXTAREA"===e.target.tagName||e.target.isContentEditable)return;if(t._helpPanelVisible&&"Escape"===e.key)return e.preventDefault(),void t._toggleHelpPanel();let n=t.pict.AppData.RetoldRemote.ActiveMode;"gallery"===n&&t._sidebarFocused?t._handleSidebarKey(e):"gallery"===n?t._handleGalleryKey(e):"video-explorer"===n?t._handleVideoExplorerKey(e):"audio-explorer"===n?t._handleAudioExplorerKey(e):"viewer"===n&&t._handleViewerKey(e)},document.addEventListener("keydown",this._keydownHandler),this._keydownBound=!0,this._setupDFSwipeGestures()}_setupDFSwipeGestures(){if(this._dfSwipeBound)return;let t=this,e=0,n=0,i=0,o=0;this._dfSwipeTouchStart=function(t){o=t.touches.length,1===o&&(n=t.touches[0].clientX,e=t.touches[0].clientY,i=e)},this._dfSwipeTouchEnd=function(r){if(1!==o)return;let s=r.changedTouches[0].clientX,a=r.changedTouches[0].clientY,l=s-n,d=a-e;if(Math.abs(d)<60||Math.abs(l)>Math.abs(d))return;let c=t.pict.AppData.RetoldRemote._distractionFreeMode||!1;(!c&&d<0&&i<=60||c&&d>0&&i<=40)&&t._toggleDistractionFree()},document.addEventListener("touchstart",this._dfSwipeTouchStart,{passive:!0}),document.addEventListener("touchend",this._dfSwipeTouchEnd,{passive:!0}),this._dfSwipeBound=!0}_handleGalleryKey(t){o(this,t)}_handleSidebarKey(t){s(this,t)}_focusSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t||t.classList.contains("collapsed"))return;this._sidebarFocused=!0,this._sidebarCursorIndex=0;let e=document.querySelector(".content-editor-sidebar-inner");e&&e.classList.add("keyboard-focused"),this._moveSidebarCursor(0)}_blurSidebar(){this._sidebarFocused=!1;let t=document.querySelector(".content-editor-sidebar-inner");t&&t.classList.remove("keyboard-focused");let e=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row");for(let t=0;t<e.length;t++)e[t].classList.remove("sidebar-focused")}_moveSidebarCursor(t){let e=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row");0!==e.length&&(this._sidebarCursorIndex<e.length&&e[this._sidebarCursorIndex].classList.remove("sidebar-focused"),this._sidebarCursorIndex=t,t<e.length&&(e[t].classList.add("sidebar-focused"),e[t].scrollIntoView({block:"nearest",behavior:"smooth"})))}_handleViewerKey(t){r(this,t)}_handleVideoExplorerKey(t){a(this,t)}_handleAudioExplorerKey(t){l(this,t)}moveCursor(t){let e=this.pict.AppData.RetoldRemote,n=e.GalleryCursorIndex||0;if(t===n)return;e.GalleryCursorIndex=t;let i=document.querySelector(`.retold-remote-tile[data-index="${n}"], .retold-remote-list-row[data-index="${n}"]`),o=document.querySelector(`.retold-remote-tile[data-index="${t}"], .retold-remote-list-row[data-index="${t}"]`);i&&i.classList.remove("selected"),o&&(o.classList.add("selected"),o.scrollIntoView({block:"nearest",behavior:"smooth"}));let r=this.pict.views["ContentEditor-TopBar"];r&&r.updateInfo()}openCurrent(){let t=this.pict.AppData.RetoldRemote,e=t.GalleryItems||[],n=t.GalleryCursorIndex||0;if(n>=e.length)return;let i=e[n];if("folder"===i.Type||"archive"===i.Type){let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";t.FolderCursorHistory[e]=n;let o=this.pict.PictApplication;o&&o.loadFileList&&o.loadFileList(i.Path)}else{let t=this.pict.PictApplication;t&&t.navigateToFile&&t.navigateToFile(i.Path)}}openCurrentAs(t){let e=this.pict.AppData.RetoldRemote,n=e.GalleryItems||[],i=e.GalleryCursorIndex||0;if(i>=n.length)return;let o=n[i];if("folder"===o.Type||"archive"===o.Type)return;let r=this.pict.PictApplication;r&&r.navigateToFileAs&&r.navigateToFileAs(o.Path,t)}switchViewerType(t){let e=this.pict.AppData.RetoldRemote.CurrentViewerFile;if(!e)return;let n=this.pict.views["RetoldRemote-MediaViewer"];n&&n.showMedia(e,t)}navigateUp(){let t=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";if(!t)return;let e=this.pict.AppData.RetoldRemote;e.FolderCursorHistory[t]=e.GalleryCursorIndex||0;let n=t.indexOf("/")>=0?t.replace(/\/[^/]+\/?$/,""):"",i=this.pict.PictApplication;i&&i.loadFileList&&i.loadFileList(n)}closeViewer(){let t=this.pict.AppData.RetoldRemote;t.ActiveMode="gallery",t.BrowsingCollection=!1,t.BrowsingCollectionIndex=-1;let e=document.getElementById("RetoldRemote-Gallery-Container"),n=document.getElementById("RetoldRemote-Viewer-Container");e&&(e.style.display=""),n&&(n.style.display="none");let i=this.pict.views["RetoldRemote-MediaViewer"];i&&(i._cleanupSwipe&&i._cleanupSwipe(),i._cleanupDFExitHotspot&&i._cleanupDFExitHotspot());let o=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",r=this.pict.providers["RetoldRemote-Provider"],s=r&&o?r.getFragmentIdentifier(o):o;window.location.hash=s?"#/browse/"+s:"#/browse/";let a=this.pict.views["RetoldRemote-Gallery"];a&&a.renderGallery()}nextFile(){let t=this.pict.AppData.RetoldRemote;if(t.BrowsingCollection&&t.ActiveCollection){let e=t.ActiveCollection.Items||[];for(let n=t.BrowsingCollectionIndex+1;n<e.length;n++){let i=e[n];if("file"===i.Type||"subfile"===i.Type||"image-crop"===i.Type||"video-clip"===i.Type||"video-frame"===i.Type){t.BrowsingCollectionIndex=n;let e=this.pict.PictApplication;return void(e&&e.navigateToFile&&e.navigateToFile(i.Path))}}return}let e=t.GalleryItems||[];for(let n=(t.GalleryCursorIndex||0)+1;n<e.length;n++)if("file"===e[n].Type){t.GalleryCursorIndex=n;let i=this.pict.PictApplication;return void(i&&i.navigateToFile&&i.navigateToFile(e[n].Path))}}prevFile(){let t=this.pict.AppData.RetoldRemote;if(t.BrowsingCollection&&t.ActiveCollection){let e=t.ActiveCollection.Items||[];for(let n=t.BrowsingCollectionIndex-1;n>=0;n--){let i=e[n];if("file"===i.Type||"subfile"===i.Type||"image-crop"===i.Type||"video-clip"===i.Type||"video-frame"===i.Type){t.BrowsingCollectionIndex=n;let e=this.pict.PictApplication;return void(e&&e.navigateToFile&&e.navigateToFile(i.Path))}}return}let e=t.GalleryItems||[];for(let n=(t.GalleryCursorIndex||0)-1;n>=0;n--)if("file"===e[n].Type){t.GalleryCursorIndex=n;let i=this.pict.PictApplication;return void(i&&i.navigateToFile&&i.navigateToFile(e[n].Path))}}_toggleViewMode(){let t=this.pict.AppData.RetoldRemote;t.ViewMode="gallery"===t.ViewMode?"list":"gallery";let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery();let n=this.pict.PictApplication;n&&"function"==typeof n.saveSettings&&n.saveSettings()}_focusSearch(){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()}_toggleFilterBar(){this.pict.AppData.RetoldRemote.FilterBarVisible?this._hideFilterBar():this._showFilterBar()}_showFilterBar(){let t=this.pict.AppData.RetoldRemote;if(t.FilterBarVisible){let t=document.getElementById("RetoldRemote-Gallery-Search");return void(t&&t.focus())}t.FilterBarVisible=!0;let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()},50)}_hideFilterBar(){let t=this.pict.AppData.RetoldRemote;t.FilterBarVisible=!1,t.FilterPanelOpen=!1;let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery()}_clearAllFilters(){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.clearAllFilters(),this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Filters cleared")}_toggleHelpPanel(){let t=document.getElementById("RetoldRemote-Help-Panel");if(t)return t.remove(),void(this._helpPanelVisible=!1);this._helpPanelVisible=!0;let e=document.createElement("div");e.id="RetoldRemote-Help-Panel",e.innerHTML=this._buildHelpPanelHTML(),(document.fullscreenElement||document.body).appendChild(e)}_buildHelpPanelHTML(){let t=this.pict.AppData.RetoldRemote.ActiveMode||"gallery",e='<div class="retold-remote-help-backdrop" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">';e+='<div class="retold-remote-help-flyout" onclick="event.stopPropagation()">',e+='<div class="retold-remote-help-header">',e+='<span class="retold-remote-help-title">Keyboard Shortcuts</span>',e+='<button class="retold-remote-help-close" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">&times;</button>',e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Gallery / File List</div>';let n=[["← → ↑ ↓","Navigate tiles"],["Enter","Open selected item"],["Escape","Go up one folder"],["F9","Toggle sidebar focus"],["Home / End","Jump to first / last"],["g","Toggle gallery / list view"],["/","Toggle filter bar &amp; search"],["f","Toggle advanced filter panel"],["s","Focus sort dropdown"],["x","Clear all filters"],["c","Settings / config panel"],["d","Distraction-free mode"],["e","Video explorer (on video files)"]];for(let t=0;t<n.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+n[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+n[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Sidebar (F9 to focus)</div>';let i=[["↑ / ↓","Navigate file list"],["Enter","Open selected item"],["Home / End","Jump to first / last"],["Escape / F9","Return to gallery"]];for(let t=0;t<i.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+i[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+i[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Media Viewer</div>';let o=[["← / k","Previous file"],["→ / j","Next file"],["Escape","Back to gallery"],["f","Toggle fullscreen"],["i","Toggle file info"],["Space","Play / pause media"],["Enter","Open video in VLC"],["z","Cycle fit mode"],["+ / -","Zoom in / out"],["0","Reset zoom"],["d","Distraction-free mode"]];for(let t=0;t<o.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+o[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+o[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-section-title">Global</div>';let r=[["F1","Toggle this help panel"],["F9","Toggle sidebar focus"],["Escape","Close help panel"]];for(let t=0;t<r.length;t++)e+='<div class="retold-remote-help-row">',e+='<kbd class="retold-remote-help-key">'+r[t][0]+"</kbd>",e+='<span class="retold-remote-help-desc">'+r[t][1]+"</span>",e+="</div>";e+="</div>",e+='<div class="retold-remote-help-section">',e+='<div class="retold-remote-help-row" style="justify-content: center; padding: 8px 0;">',e+='<a href="docs.html" target="_blank" style="color: var(--retold-accent, #569cd6); text-decoration: none; font-size: 0.9rem; cursor: pointer;">',e+="View Documentation &#x2197;</a>",e+="</div>",e+="</div>",e+='<div class="retold-remote-help-footer">';let s="Gallery";return"viewer"===t?s="Media Viewer":"video-explorer"===t?s="Video Explorer":"audio-explorer"===t&&(s="Audio Explorer"),e+="Current mode: <strong>"+s+"</strong>",e+="</div>",e+="</div>",e+="</div>",e}_toggleSettingsPanel(){let t=this.pict.views["ContentEditor-Layout"];if(!t)return;let e=document.querySelector(".content-editor-sidebar-wrap");if(!e)return;let n=e.classList.contains("collapsed"),i=document.querySelector('.content-editor-sidebar-tab[data-tab="settings"]'),o=i&&i.classList.contains("active");n?(t.toggleSidebar(),t.switchSidebarTab("settings")):o?t.switchSidebarTab("files"):t.switchSidebarTab("settings")}_toggleFilterPresets(){let t=this.pict.AppData.RetoldRemote,e=this.pict.views["RetoldRemote-Gallery"];"gallery"===t.ActiveMode&&(!t.FilterPanelOpen&&e&&e.toggleFilterPanel(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Filter-PresetSelect");if(t)t.focus(),t.click();else{let t=document.getElementById("RetoldRemote-Filter-PresetName");t&&t.focus()}},50))}_toggleDistractionFree(){let t=this.pict.AppData.RetoldRemote,e=document.getElementById("ContentEditor-TopBar-Container"),n=document.querySelector(".content-editor-sidebar-wrap");if(!e||!n)return;if(t._distractionFreeMode||!1){e.style.display="",n.style.display="",t._distractionFreeMode=!1;let i=document.querySelector(".retold-remote-viewer-header");i&&(i.style.display="")}else if(e.style.display="none",n.style.display="none",t._distractionFreeMode=!0,!t.DistractionFreeShowNav){let t=document.querySelector(".retold-remote-viewer-header");t&&(t.style.display="none")}let i=this.pict.views["RetoldRemote-MediaViewer"];i&&i._updateDFControls&&i._updateDFControls(),setTimeout(()=>this.recalculateColumns(),100)}_toggleFullscreen(){if(document.fullscreenElement)return void document.exitFullscreen();if("video"===this.pict.AppData.RetoldRemote.CurrentViewerMediaType){let t=document.getElementById("RetoldRemote-VideoPlayer");if(t)return void t.requestFullscreen()}let t=document.getElementById("RetoldRemote-Viewer-Container");t&&t.requestFullscreen()}_toggleFileInfo(){let t=document.getElementById("RetoldRemote-FileInfo-Overlay");if(t){let e="none"===window.getComputedStyle(t).display;t.style.display=e?"block":"none"}}_togglePlayPause(){let t=document.querySelector("#RetoldRemote-Viewer-Container video"),e=document.querySelector("#RetoldRemote-Viewer-Container audio"),n=t||e;n&&(n.paused?n.play():n.pause())}_zoomIn(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomIn&&t.zoomIn()}_zoomOut(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomOut&&t.zoomOut()}_zoomReset(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.zoomReset&&t.zoomReset()}_cycleFitMode(){let t=this.pict.views["RetoldRemote-ImageViewer"];t&&t.cycleFitMode&&t.cycleFitMode()}_openWithVLC(){let t=this.pict.AppData.RetoldRemote;if("video"!==t.CurrentViewerMediaType)return;if(!(t.ServerCapabilities||{}).vlc)return;let e=t.CurrentViewerFile;e&&(this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Opening in VLC..."),fetch("/api/media/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}).then(t=>t.json()).then(t=>{t.Success||this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Failed to open: "+(t.Error||"Unknown error"))}).catch(t=>{this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Failed to open: "+t.message)}))}_streamWithVLC(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerMediaType;if("video"!==e&&"audio"!==e)return;let n=t.CurrentViewerFile;if(!n)return;let i=this.pict.providers["RetoldRemote-Provider"],o=i?i.getContentURL(n):"/content/"+encodeURIComponent(n),r=window.location.origin+o,s=/Windows/.test(navigator.userAgent)?"vlc://"+r:"vlc://"+encodeURIComponent(r);this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator("Opening VLC...");let a=document.createElement("a");a.href=s,a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)}}d.default_configuration={ProviderIdentifier:"RetoldRemote-GalleryNavigation",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=d},{"./keyboard-handlers/KeyHandler-AudioExplorer.js":124,"./keyboard-handlers/KeyHandler-Gallery.js":125,"./keyboard-handlers/KeyHandler-Sidebar.js":126,"./keyboard-handlers/KeyHandler-VideoExplorer.js":127,"./keyboard-handlers/KeyHandler-Viewer.js":128,"pict-provider":46}],120:[function(t,e,n){const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n),this._pathToHash={},this._hashToPath={}}fetchCapabilities(t){fetch("/api/media/capabilities").then(t=>t.json()).then(e=>e&&e.Capabilities?t(null,e.Capabilities):t(null,{})).catch(e=>t(e))}fetchRemoteSettings(t){fetch("/api/remote/settings").then(t=>t.json()).then(e=>t(null,e||{})).catch(e=>t(e))}registerHash(t,e){t&&e&&(this._pathToHash[t]=e,this._hashToPath[e]=t)}getHashForPath(t){return this._pathToHash[t]||null}getPathForHash(t){return this._hashToPath[t]||null}_getPathParam(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return e}return encodeURIComponent(t)}getFragmentIdentifier(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return e}return t}resolveFragmentIdentifier(t){if(t&&/^[a-f0-9]{10}$/.test(t)){let e=this.getPathForHash(t);if(null!==e)return e}return t}getContentURL(t){if(this.pict.AppData.RetoldRemote.HashedFilenames){let e=this.getHashForPath(t);if(e)return"/content-hashed/"+e}return"/content/"+t.split("/").map(t=>encodeURIComponent(t)).join("/")}getThumbnailURL(t,e,n){let i=this.pict.AppData.RetoldRemote.ServerCapabilities,o=t.replace(/^.*\./,"").toLowerCase(),r=this._isImageExtension(o);return i&&(i.sharp||i.imagemagick)?"/api/media/thumbnail?path="+this._getPathParam(t)+"&width="+(e||200)+"&height="+(n||200):r?this.getContentURL(t):null}fetchMediaProbe(t,e){fetch("/api/media/probe?path="+this._getPathParam(t)).then(t=>t.json()).then(t=>{t&&t.Hash&&t.Path&&this.registerHash(t.Path,t.Hash),e(null,t)}).catch(t=>e(t))}fetchFolderSummary(t,e){let n="/api/media/folder-summary";t&&(n+="?path="+this._getPathParam(t)),fetch(n).then(t=>t.json()).then(t=>e(null,t)).catch(t=>e(t))}_isImageExtension(t){return!!{png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0,tiff:!0,tif:!0}[t]}}o.default_configuration={ProviderIdentifier:"RetoldRemote-Provider",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=o},{"pict-provider":46}],121:[function(t,e,n){const i=t("pict-provider"),o={Primary:"#C0C0DD",Accent:"#66C2B8",Muted:"#6A6A8A",Light:"#2A2A4A",WarmBeige:"#2E2E4E",TealTint:"#1E3A3A",Lavender:"#2A2A48",AmberTint:"#3A3028",PdfFill:"#3A2028",PdfText:"#E06060"};let r;try{r=t("pict-section-filebrowser/source/providers/Pict-Provider-FileBrowserIcons.js").ExtensionMap}catch(t){r={}}const s=Object.keys(r).length>0?r:{".jpg":"file-image",".jpeg":"file-image",".png":"file-image",".gif":"file-image",".svg":"file-image",".webp":"file-image",".bmp":"file-image",".ico":"file-image",".tiff":"file-image",".tif":"file-image",".heic":"file-image",".heif":"file-image",".avif":"file-image",".raw":"file-image",".txt":"file-text",".md":"file-text",".rtf":"file-text",".doc":"file-text",".docx":"file-text",".pdf":"file-pdf",".xls":"file-spreadsheet",".xlsx":"file-spreadsheet",".csv":"file-spreadsheet",".ods":"file-spreadsheet",".js":"file-code",".ts":"file-code",".jsx":"file-code",".tsx":"file-code",".py":"file-code",".rb":"file-code",".java":"file-code",".c":"file-code",".cpp":"file-code",".h":"file-code",".go":"file-code",".rs":"file-code",".swift":"file-code",".kt":"file-code",".scala":"file-code",".sh":"file-code",".bash":"file-code",".zsh":"file-code",".php":"file-code",".lua":"file-code",".r":"file-code",".sql":"file-code",".pl":"file-code",".html":"file-web",".htm":"file-web",".css":"file-web",".scss":"file-web",".less":"file-web",".xml":"file-web",".json":"file-config",".yaml":"file-config",".yml":"file-config",".toml":"file-config",".ini":"file-config",".env":"file-config",".conf":"file-config",".cfg":"file-config",".zip":"file-archive",".tar":"file-archive",".gz":"file-archive",".rar":"file-archive",".7z":"file-archive",".bz2":"file-archive",".xz":"file-archive",".tgz":"file-archive",".cbz":"file-archive",".cbr":"file-archive",".mp3":"file-audio",".wav":"file-audio",".flac":"file-audio",".ogg":"file-audio",".aac":"file-audio",".wma":"file-audio",".m4a":"file-audio",".opus":"file-audio",".aiff":"file-audio",".mp4":"file-video",".avi":"file-video",".mov":"file-video",".mkv":"file-video",".webm":"file-video",".wmv":"file-video",".flv":"file-video",".m4v":"file-video",".epub":"file-text",".mobi":"file-text"};e.exports=class extends i{constructor(t,e,n){super(t,e,n),this._colors=Object.assign({},o),this._icons=this._buildIconSet(),this._customIcons={},this._extensionMap=Object.assign({},s),this._cssInjected=!1}_buildIconSet(){let t=this;return{folder:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 9H20.8" stroke="'+n.Primary+'" stroke-width="1" opacity="0.3" /></svg>'},"folder-open":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 10.2L5.8 17.8C6 18.4 6.6 18.9 7.2 18.9H19.8L22.1 11.2C22.3 10.6 21.8 10 21.2 10H5.2C4.6 10 4 10.4 3.8 11" stroke="'+n.Primary+'" stroke-width="1.5" fill="'+n.Light+'" stroke-linecap="round" stroke-linejoin="round" opacity="0.7" /></svg>'},file:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-text":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="12.8" x2="15.9" y2="12.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="15.8" x2="15.9" y2="15.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="18.8" x2="12.2" y2="18.8" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"file-code":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M8.5 13.2L6.8 15.1L8.6 16.8" stroke="'+n.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><path d="M15.5 13.2L17.2 15.1L15.4 16.8" stroke="'+n.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><line x1="12.8" y1="12" x2="11.2" y2="18" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"file-image":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3.1" y="3.2" width="17.8" height="17.7" rx="2" fill="'+n.Lavender+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="8.3" cy="8.7" r="1.8" fill="'+n.Accent+'" /><path d="M20.8 15.2L15.9 10.1L5.2 20.8" stroke="'+n.Primary+'" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-pdf":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.PdfFill+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><text x="8.2" y="16.8" font-family="sans-serif" font-weight="700" font-size="6.5" fill="'+n.PdfText+'" letter-spacing="-0.3">PDF</text></svg>'},"file-spreadsheet":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.TealTint+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="7.2" y="11.1" width="9.8" height="7.8" rx="0.5" fill="none" stroke="'+n.Accent+'" stroke-width="1.2" /><line x1="7.2" y1="13.7" x2="17" y2="13.7" stroke="'+n.Accent+'" stroke-width="1" /><line x1="7.2" y1="16.3" x2="17" y2="16.3" stroke="'+n.Accent+'" stroke-width="1" /><line x1="10.9" y1="11.1" x2="10.9" y2="18.9" stroke="'+n.Accent+'" stroke-width="1" /></svg>'},"file-archive":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="8.8" y="11.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /><rect x="8.8" y="14.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /><rect x="8.8" y="17.2" width="2.5" height="2" rx="0.4" fill="'+n.Primary+'" /></svg>'},"file-audio":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.AmberTint+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="10.2" cy="16.8" r="2.1" fill="none" stroke="'+n.Accent+'" stroke-width="1.5" /><path d="M12.2 16.8V11.2L16.1 10.1" stroke="'+n.Accent+'" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="15.3" r="1.4" fill="none" stroke="'+n.Accent+'" stroke-width="1.2" /></svg>'},"file-video":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Lavender+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M9.8 12.2V18.2L15.8 15.2L9.8 12.2Z" fill="'+n.Accent+'" stroke="'+n.Accent+'" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-web":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8.9" fill="'+n.TealTint+'" stroke="'+n.Primary+'" stroke-width="1.8" /><ellipse cx="12" cy="12" rx="4.1" ry="8.9" fill="none" stroke="'+n.Primary+'" stroke-width="1.2" /><line x1="3.1" y1="12" x2="20.9" y2="12" stroke="'+n.Primary+'" stroke-width="1" /><path d="M4.8 7.8C7 8.5 9.4 8.9 12 8.9C14.6 8.9 17 8.5 19.2 7.8" stroke="'+n.Primary+'" stroke-width="1" fill="none" /><path d="M4.8 16.2C7 15.5 9.4 15.1 12 15.1C14.6 15.1 17 15.5 19.2 16.2" stroke="'+n.Primary+'" stroke-width="1" fill="none" /></svg>'},"file-config":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="12" cy="15" r="2.8" fill="none" stroke="'+n.Muted+'" stroke-width="1.5" /><line x1="12" y1="11" x2="12" y2="12.2" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="12" y1="17.8" x2="12" y2="19" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="13.2" x2="15.8" y2="12.6" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="17" x2="9.2" y2="16.4" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="16.8" x2="15.8" y2="17.4" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="13" x2="9.2" y2="13.6" stroke="'+n.Muted+'" stroke-width="1.3" stroke-linecap="round" /></svg>'},home:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.1 9.6L12 3.1L20.9 9.6V19.9C20.9 20.5 20.5 21 19.9 20.9H4.1C3.5 21 3 20.5 3.1 19.9V9.6Z" fill="'+n.TealTint+'" stroke="'+n.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><rect x="9.2" y="14.1" width="5.6" height="6.9" rx="0.5" fill="'+n.Accent+'" /></svg>'},"arrow-up":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12.1 19.1V5.1" stroke="'+n.Muted+'" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M5.2 11.9L12.1 5.1L18.9 11.9" stroke="'+n.Muted+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"chevron-right":e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M9.2 6.1L14.8 12.1L9.1 17.9" stroke="'+t._colors.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"chevron-down":e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6.1 9.2L12.1 14.8L17.9 9.1" stroke="'+t._colors.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',search:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="10.8" cy="10.8" r="6.8" stroke="'+n.Primary+'" stroke-width="1.8" /><line x1="15.9" y1="16.1" x2="20.8" y2="20.8" stroke="'+n.Primary+'" stroke-width="2" stroke-linecap="round" /></svg>'},"sort-asc":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+n.Primary+'" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+n.Muted+'" opacity="0.35" /></svg>'},"sort-desc":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+n.Muted+'" opacity="0.35" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+n.Primary+'" /></svg>'},sidebar:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3" y="3" width="18" height="18" rx="2" stroke="'+n.Primary+'" stroke-width="1.8" fill="none" /><line x1="9" y1="3" x2="9" y2="21" stroke="'+n.Primary+'" stroke-width="1.8" /><line x1="5" y1="7.5" x2="7.5" y2="7.5" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="5" y1="10.5" x2="7.5" y2="10.5" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="5" y1="13.5" x2="7.5" y2="13.5" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"music-note":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="8.2" cy="17.8" r="3.1" fill="'+n.AmberTint+'" stroke="'+n.Accent+'" stroke-width="1.8" /><path d="M11.2 17.8V5.2L19.1 3.1V14.8" stroke="'+n.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="14.8" r="2.4" fill="'+n.AmberTint+'" stroke="'+n.Accent+'" stroke-width="1.5" /></svg>'},"film-strip":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="3" y="4" width="18" height="16" rx="2" stroke="'+n.Primary+'" stroke-width="1.8" fill="'+n.Lavender+'" /><path d="M9.5 8.5V15.5L16 12L9.5 8.5Z" fill="'+n.Accent+'" stroke="'+n.Accent+'" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"gallery-empty":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M3.2 7.1V17.2C3.2 18.2 4 19.1 5.1 18.9L19.1 19.1C20 19.1 20.9 18.2 20.8 17.1V9.1C20.9 8 20.1 7.1 19 7.1H12.1L10.1 4.9H5.1C3.9 5 3.1 5.9 3.2 7.1Z" fill="'+n.WarmBeige+'" stroke="'+n.Muted+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="9" y1="11" x2="15" y2="17" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" opacity="0.5" /><line x1="15" y1="11" x2="9" y2="17" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" opacity="0.5" /></svg>'},"document-large":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M14.1 2.1H6.2C5 2.2 4.1 3 4.1 4.1V20.1C4 21.2 5 22 6.1 21.9H18C19.1 22 20 21.1 19.9 19.9V8.1L14.1 2.1Z" fill="'+n.Light+'" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="13" x2="15.9" y2="13" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="16" x2="15.9" y2="16" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="19" x2="12" y2="19" stroke="'+n.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},bookmark:e=>'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6 4C6 3.45 6.45 3 7 3H17C17.55 3 18 3.45 18 4V21L12 17L6 21V4Z" stroke="'+t._colors.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none" /></svg>',"bookmark-filled":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M6 4C6 3.45 6.45 3 7 3H17C17.55 3 18 3.45 18 4V21L12 17L6 21V4Z" stroke="'+n.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="'+n.Accent+'" /></svg>'},collection:e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><rect x="4" y="8" width="16" height="12" rx="2" stroke="'+n.Primary+'" stroke-width="1.8" fill="'+n.Light+'" /><path d="M7 8V6C7 5.45 7.45 5 8 5H16C16.55 5 17 5.45 17 6V8" stroke="'+n.Primary+'" stroke-width="1.5" fill="none" /><path d="M9 5V3.5C9 3.22 9.22 3 9.5 3H14.5C14.78 3 15 3.22 15 3.5V5" stroke="'+n.Muted+'" stroke-width="1.2" fill="none" /></svg>'},"drag-handle":e=>{let n=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="9" cy="7" r="1.5" fill="'+n.Muted+'" /><circle cx="15" cy="7" r="1.5" fill="'+n.Muted+'" /><circle cx="9" cy="12" r="1.5" fill="'+n.Muted+'" /><circle cx="15" cy="12" r="1.5" fill="'+n.Muted+'" /><circle cx="9" cy="17" r="1.5" fill="'+n.Muted+'" /><circle cx="15" cy="17" r="1.5" fill="'+n.Muted+'" /></svg>'}}}getIcon(t,e){let n=e||16,i=this._customIcons[t]||this._icons[t];return"function"==typeof i?i(n):""}getIconForEntry(t,e){if(!t)return"";if(t.Icon&&"string"==typeof t.Icon&&0===t.Icon.indexOf("<svg"))return t.Icon;let n=e||16;if("folder"===t.Type)return this.getIcon("folder",n);let i=(t.Extension||"").toLowerCase();return i&&this._extensionMap[i]?this.getIcon(this._extensionMap[i],n):this.getIcon("file",n)}getUIIcon(t,e){return this.getIcon(t,e||16)}registerIcon(t,e){return!(!t||"function"!=typeof e)&&(this._customIcons[t]=e,!0)}registerExtension(t,e){return!(!t||!e)&&(this._extensionMap[t.toLowerCase()]=e,!0)}setColors(t){t&&"object"==typeof t&&(Object.assign(this._colors,t),this._icons=this._buildIconSet())}getColors(){return Object.assign({},this._colors)}getIconNames(){let t=Object.keys(this._icons),e=Object.keys(this._customIcons);for(let n=0;n<e.length;n++)t.indexOf(e[n])<0&&t.push(e[n]);return t}getExtensionMap(){return Object.assign({},this._extensionMap)}injectCSS(){this._cssInjected||this.pict&&this.pict.CSSMap&&(this.pict.CSSMap.addCSS("RetoldRemoteIcons",".retold-remote-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }\n.retold-remote-icon svg { display: block; }\n.retold-remote-icon-sm svg { width: 16px; height: 16px; }\n.retold-remote-icon-md svg { width: 48px; height: 48px; }\n.retold-remote-icon-lg svg { width: 64px; height: 64px; }\n.retold-remote-icon-xl svg { width: 96px; height: 96px; }\n"),this._cssInjected=!0)}onAfterInitialize(){return this.injectCSS(),super.onAfterInitialize()}},e.exports.default_configuration={ProviderIdentifier:"RetoldRemote-Icons",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0},e.exports.DefaultColors=o},{"pict-provider":46,"pict-section-filebrowser/source/providers/Pict-Provider-FileBrowserIcons.js":56}],122:[function(t,e,n){const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n),this._themes={},this._themeOrder=[],this._currentTheme="twilight",this._buildThemes()}_buildThemes(){let t=this;t._addTheme("daylight",{Name:"Daylight",Category:"Grey",Description:"Bright white, dark text",Variables:{"--retold-bg-primary":"#FFFFFF","--retold-bg-secondary":"#F0F0F0","--retold-bg-tertiary":"#E8E8E8","--retold-bg-panel":"#F5F5F5","--retold-bg-viewer":"#FAFAFA","--retold-bg-hover":"#E0E0E0","--retold-bg-selected":"#C8C8C8","--retold-bg-thumb":"#F0F0F0","--retold-text-primary":"#1A1A1A","--retold-text-secondary":"#333333","--retold-text-muted":"#666666","--retold-text-dim":"#888888","--retold-text-placeholder":"#AAAAAA","--retold-accent":"#444444","--retold-accent-hover":"#222222","--retold-border":"#D0D0D0","--retold-border-light":"#E0E0E0","--retold-danger":"#CC0000","--retold-danger-muted":"#884444","--retold-scrollbar":"#C0C0C0","--retold-scrollbar-hover":"#A0A0A0","--retold-selection-bg":"rgba(68, 68, 68, 0.2)","--retold-focus-outline":"#444444","--retold-font-family":"'Segoe UI', system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#333333",Accent:"#444444",Muted:"#888888",Light:"#E8E8E8",WarmBeige:"#F0F0F0",TealTint:"#E0E0E0",Lavender:"#EBEBEB",AmberTint:"#F0EDE8",PdfFill:"#F0E0E0",PdfText:"#CC0000"}}),t._addTheme("afternoon",{Name:"Afternoon",Category:"Grey",Description:"Warm light grey, softer contrast",Variables:{"--retold-bg-primary":"#E8E4E0","--retold-bg-secondary":"#DAD6D2","--retold-bg-tertiary":"#D0CCC8","--retold-bg-panel":"#DDD9D5","--retold-bg-viewer":"#F0ECE8","--retold-bg-hover":"#CCC8C4","--retold-bg-selected":"#B8B4B0","--retold-bg-thumb":"#DAD6D2","--retold-text-primary":"#2A2A2A","--retold-text-secondary":"#404040","--retold-text-muted":"#707070","--retold-text-dim":"#909090","--retold-text-placeholder":"#B0B0B0","--retold-accent":"#555555","--retold-accent-hover":"#333333","--retold-border":"#C0BCB8","--retold-border-light":"#D0CCC8","--retold-danger":"#AA3333","--retold-danger-muted":"#886655","--retold-scrollbar":"#B8B4B0","--retold-scrollbar-hover":"#A0A09C","--retold-selection-bg":"rgba(85, 85, 85, 0.2)","--retold-focus-outline":"#555555","--retold-font-family":"Georgia, 'Times New Roman', serif","--retold-font-mono":"'Courier New', Courier, monospace"},IconColors:{Primary:"#404040",Accent:"#555555",Muted:"#909090",Light:"#D0CCC8",WarmBeige:"#DAD6D2",TealTint:"#CCC8C4",Lavender:"#D2D0CE",AmberTint:"#D8D2C8",PdfFill:"#D8C8C0",PdfText:"#AA3333"}}),t._addTheme("evening",{Name:"Evening",Category:"Grey",Description:"Medium grey, transitional",Variables:{"--retold-bg-primary":"#484848","--retold-bg-secondary":"#3C3C3C","--retold-bg-tertiary":"#424242","--retold-bg-panel":"#454545","--retold-bg-viewer":"#363636","--retold-bg-hover":"#525252","--retold-bg-selected":"#606060","--retold-bg-thumb":"#3C3C3C","--retold-text-primary":"#E0E0E0","--retold-text-secondary":"#D0D0D0","--retold-text-muted":"#A0A0A0","--retold-text-dim":"#888888","--retold-text-placeholder":"#707070","--retold-accent":"#C0C0C0","--retold-accent-hover":"#E0E0E0","--retold-border":"#585858","--retold-border-light":"#606060","--retold-danger":"#FF6666","--retold-danger-muted":"#AA6666","--retold-scrollbar":"#585858","--retold-scrollbar-hover":"#686868","--retold-selection-bg":"rgba(192, 192, 192, 0.25)","--retold-focus-outline":"#C0C0C0","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#D0D0D0",Accent:"#C0C0C0",Muted:"#888888",Light:"#424242",WarmBeige:"#484848",TealTint:"#3E3E3E",Lavender:"#444444",AmberTint:"#4A4640",PdfFill:"#4A3C3C",PdfText:"#FF6666"}}),t._addTheme("twilight",{Name:"Twilight",Category:"Grey",Description:"Dark grey, low light (default)",Variables:{"--retold-bg-primary":"#1E1E1E","--retold-bg-secondary":"#181818","--retold-bg-tertiary":"#252525","--retold-bg-panel":"#202020","--retold-bg-viewer":"#141414","--retold-bg-hover":"#2E2E2E","--retold-bg-selected":"#404040","--retold-bg-thumb":"#181818","--retold-text-primary":"#E0E0E0","--retold-text-secondary":"#C8C8C8","--retold-text-muted":"#909090","--retold-text-dim":"#707070","--retold-text-placeholder":"#585858","--retold-accent":"#A0A0A0","--retold-accent-hover":"#C0C0C0","--retold-border":"#333333","--retold-border-light":"#404040","--retold-danger":"#FF6666","--retold-danger-muted":"#AA6666","--retold-scrollbar":"#404040","--retold-scrollbar-hover":"#505050","--retold-selection-bg":"rgba(160, 160, 160, 0.25)","--retold-focus-outline":"#A0A0A0","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#C8C8C8",Accent:"#A0A0A0",Muted:"#707070",Light:"#252525",WarmBeige:"#2A2A2A",TealTint:"#222222",Lavender:"#282828",AmberTint:"#2E2A24",PdfFill:"#2E2224",PdfText:"#E06060"}}),t._addTheme("night",{Name:"Night",Category:"Grey",Description:"Near-black, minimal contrast",Variables:{"--retold-bg-primary":"#0A0A0A","--retold-bg-secondary":"#060606","--retold-bg-tertiary":"#0E0E0E","--retold-bg-panel":"#0C0C0C","--retold-bg-viewer":"#040404","--retold-bg-hover":"#161616","--retold-bg-selected":"#252525","--retold-bg-thumb":"#060606","--retold-text-primary":"#888888","--retold-text-secondary":"#707070","--retold-text-muted":"#555555","--retold-text-dim":"#444444","--retold-text-placeholder":"#333333","--retold-accent":"#666666","--retold-accent-hover":"#808080","--retold-border":"#1A1A1A","--retold-border-light":"#222222","--retold-danger":"#AA4444","--retold-danger-muted":"#663333","--retold-scrollbar":"#1A1A1A","--retold-scrollbar-hover":"#2A2A2A","--retold-selection-bg":"rgba(102, 102, 102, 0.2)","--retold-focus-outline":"#666666","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Fira Code', 'Consolas', monospace"},IconColors:{Primary:"#707070",Accent:"#666666",Muted:"#444444",Light:"#0E0E0E",WarmBeige:"#121212",TealTint:"#0C0C0C",Lavender:"#101010",AmberTint:"#141210",PdfFill:"#141010",PdfText:"#AA4444"}}),t._addTheme("neo-tokyo",{Name:"Neo-Tokyo",Category:"Fun",Description:"Neon pink on dark navy",Variables:{"--retold-bg-primary":"#0D0D2B","--retold-bg-secondary":"#080820","--retold-bg-tertiary":"#121235","--retold-bg-panel":"#0F0F28","--retold-bg-viewer":"#060615","--retold-bg-hover":"#1A1A42","--retold-bg-selected":"#2A1845","--retold-bg-thumb":"#080820","--retold-text-primary":"#E8E0F0","--retold-text-secondary":"#D0C8E0","--retold-text-muted":"#9088A8","--retold-text-dim":"#6860A0","--retold-text-placeholder":"#504888","--retold-accent":"#FF2D8A","--retold-accent-hover":"#FF5AA0","--retold-border":"#2A2050","--retold-border-light":"#382868","--retold-danger":"#FF4466","--retold-danger-muted":"#AA3355","--retold-scrollbar":"#2A2050","--retold-scrollbar-hover":"#3A3068","--retold-selection-bg":"rgba(255, 45, 138, 0.25)","--retold-focus-outline":"#FF2D8A","--retold-font-family":"'Courier New', monospace","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#D0C8E0",Accent:"#FF2D8A",Muted:"#6860A0",Light:"#121235",WarmBeige:"#141438",TealTint:"#100E30",Lavender:"#141232",AmberTint:"#1A1228",PdfFill:"#1A1028",PdfText:"#FF4466"}}),t._addTheme("cyberpunk",{Name:"Cyberpunk",Category:"Fun",Description:"Electric green on black",Variables:{"--retold-bg-primary":"#0A0E0A","--retold-bg-secondary":"#060806","--retold-bg-tertiary":"#0E120E","--retold-bg-panel":"#0C100C","--retold-bg-viewer":"#040604","--retold-bg-hover":"#142014","--retold-bg-selected":"#1A3A1A","--retold-bg-thumb":"#060806","--retold-text-primary":"#C8FFC8","--retold-text-secondary":"#A0D8A0","--retold-text-muted":"#608860","--retold-text-dim":"#406040","--retold-text-placeholder":"#305030","--retold-accent":"#00FF41","--retold-accent-hover":"#44FF77","--retold-border":"#1A2A1A","--retold-border-light":"#224022","--retold-danger":"#FF3333","--retold-danger-muted":"#AA2222","--retold-scrollbar":"#1A2A1A","--retold-scrollbar-hover":"#2A4A2A","--retold-selection-bg":"rgba(0, 255, 65, 0.2)","--retold-focus-outline":"#00FF41","--retold-font-family":"'Lucida Console', 'Courier New', monospace","--retold-font-mono":"'Lucida Console', 'Courier New', monospace"},IconColors:{Primary:"#A0D8A0",Accent:"#00FF41",Muted:"#406040",Light:"#0E120E",WarmBeige:"#101610",TealTint:"#0C140C",Lavender:"#0E120E",AmberTint:"#141810",PdfFill:"#181010",PdfText:"#FF3333"}}),t._addTheme("hotdog",{Name:"Hotdog",Category:"Fun",Description:"Red and mustard yellow, garish",Variables:{"--retold-bg-primary":"#8B0000","--retold-bg-secondary":"#6B0000","--retold-bg-tertiary":"#7B0000","--retold-bg-panel":"#750000","--retold-bg-viewer":"#550000","--retold-bg-hover":"#AA1111","--retold-bg-selected":"#BB3300","--retold-bg-thumb":"#6B0000","--retold-text-primary":"#FFD700","--retold-text-secondary":"#FFC000","--retold-text-muted":"#CC9900","--retold-text-dim":"#AA7700","--retold-text-placeholder":"#886600","--retold-accent":"#FFD700","--retold-accent-hover":"#FFEE44","--retold-border":"#AA2222","--retold-border-light":"#BB3333","--retold-danger":"#FFFF00","--retold-danger-muted":"#CCCC00","--retold-scrollbar":"#AA2222","--retold-scrollbar-hover":"#CC3333","--retold-selection-bg":"rgba(255, 215, 0, 0.3)","--retold-focus-outline":"#FFD700","--retold-font-family":"Impact, 'Arial Black', sans-serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#FFC000",Accent:"#FFD700",Muted:"#AA7700",Light:"#7B0000",WarmBeige:"#800000",TealTint:"#6B0000",Lavender:"#780000",AmberTint:"#7A1000",PdfFill:"#6B0000",PdfText:"#FFFF00"}}),t._addTheme("1970s-console",{Name:"1970s Console",Category:"Fun",Description:"Amber phosphor on brown-black",Variables:{"--retold-bg-primary":"#1A1000","--retold-bg-secondary":"#140C00","--retold-bg-tertiary":"#1E1400","--retold-bg-panel":"#1C1200","--retold-bg-viewer":"#100A00","--retold-bg-hover":"#2A1C00","--retold-bg-selected":"#3A2800","--retold-bg-thumb":"#140C00","--retold-text-primary":"#FFAA00","--retold-text-secondary":"#DD8800","--retold-text-muted":"#AA6600","--retold-text-dim":"#884400","--retold-text-placeholder":"#663300","--retold-accent":"#FFCC00","--retold-accent-hover":"#FFDD44","--retold-border":"#2A1800","--retold-border-light":"#3A2200","--retold-danger":"#FF4400","--retold-danger-muted":"#AA3300","--retold-scrollbar":"#2A1800","--retold-scrollbar-hover":"#3A2800","--retold-selection-bg":"rgba(255, 204, 0, 0.2)","--retold-focus-outline":"#FFCC00","--retold-font-family":"'Courier New', 'Lucida Console', monospace","--retold-font-mono":"'Courier New', 'Lucida Console', monospace"},IconColors:{Primary:"#DD8800",Accent:"#FFCC00",Muted:"#884400",Light:"#1E1400",WarmBeige:"#201800",TealTint:"#1A1000",Lavender:"#1C1200",AmberTint:"#221800",PdfFill:"#201000",PdfText:"#FF4400"}}),t._addTheme("1980s-console",{Name:"1980s Console",Category:"Fun",Description:"Green phosphor on black",Variables:{"--retold-bg-primary":"#001200","--retold-bg-secondary":"#000E00","--retold-bg-tertiary":"#001600","--retold-bg-panel":"#001400","--retold-bg-viewer":"#000A00","--retold-bg-hover":"#002200","--retold-bg-selected":"#003800","--retold-bg-thumb":"#000E00","--retold-text-primary":"#00FF00","--retold-text-secondary":"#00CC00","--retold-text-muted":"#009900","--retold-text-dim":"#006600","--retold-text-placeholder":"#004400","--retold-accent":"#00FF66","--retold-accent-hover":"#44FF88","--retold-border":"#002A00","--retold-border-light":"#003A00","--retold-danger":"#FF0000","--retold-danger-muted":"#AA0000","--retold-scrollbar":"#002A00","--retold-scrollbar-hover":"#004400","--retold-selection-bg":"rgba(0, 255, 102, 0.2)","--retold-focus-outline":"#00FF66","--retold-font-family":"'Courier New', monospace","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#00CC00",Accent:"#00FF66",Muted:"#006600",Light:"#001600",WarmBeige:"#001A00",TealTint:"#001200",Lavender:"#001400",AmberTint:"#001800",PdfFill:"#140000",PdfText:"#FF0000"}}),t._addTheme("1990s-website",{Name:"1990s Web Site",Category:"Fun",Description:"Blue links on grey, beveled",Variables:{"--retold-bg-primary":"#C0C0C0","--retold-bg-secondary":"#B0B0B0","--retold-bg-tertiary":"#A8A8A8","--retold-bg-panel":"#B8B8B8","--retold-bg-viewer":"#D0D0D0","--retold-bg-hover":"#B8B8D0","--retold-bg-selected":"#000080","--retold-bg-thumb":"#B0B0B0","--retold-text-primary":"#000000","--retold-text-secondary":"#000080","--retold-text-muted":"#404040","--retold-text-dim":"#606060","--retold-text-placeholder":"#808080","--retold-accent":"#0000FF","--retold-accent-hover":"#0000CC","--retold-border":"#808080","--retold-border-light":"#A0A0A0","--retold-danger":"#FF0000","--retold-danger-muted":"#990000","--retold-scrollbar":"#808080","--retold-scrollbar-hover":"#606060","--retold-selection-bg":"rgba(0, 0, 128, 0.3)","--retold-focus-outline":"#0000FF","--retold-font-family":"'Times New Roman', Times, serif","--retold-font-mono":"'Courier New', Courier, monospace"},IconColors:{Primary:"#000080",Accent:"#0000FF",Muted:"#606060",Light:"#A8A8A8",WarmBeige:"#B0B0B0",TealTint:"#A0A0A0",Lavender:"#ABABD0",AmberTint:"#B8B0A0",PdfFill:"#C0A0A0",PdfText:"#FF0000"}}),t._addTheme("early-2000s",{Name:"Early 2000s Web",Category:"Fun",Description:"Teal and silver, Web 2.0",Variables:{"--retold-bg-primary":"#E8F4F8","--retold-bg-secondary":"#D0E8EE","--retold-bg-tertiary":"#C0DDE6","--retold-bg-panel":"#D8EEF2","--retold-bg-viewer":"#F0F8FA","--retold-bg-hover":"#B0D4E0","--retold-bg-selected":"#88C4D8","--retold-bg-thumb":"#D0E8EE","--retold-text-primary":"#1A3A4A","--retold-text-secondary":"#2A4A5A","--retold-text-muted":"#5A7A8A","--retold-text-dim":"#7A9AAA","--retold-text-placeholder":"#9ABACA","--retold-accent":"#0099CC","--retold-accent-hover":"#00AADD","--retold-border":"#A0C8D8","--retold-border-light":"#B8D8E4","--retold-danger":"#CC3300","--retold-danger-muted":"#994422","--retold-scrollbar":"#A0C8D8","--retold-scrollbar-hover":"#88B8CC","--retold-selection-bg":"rgba(0, 153, 204, 0.2)","--retold-focus-outline":"#0099CC","--retold-font-family":"Verdana, Geneva, Tahoma, sans-serif","--retold-font-mono":"'Lucida Console', Monaco, monospace"},IconColors:{Primary:"#2A4A5A",Accent:"#0099CC",Muted:"#7A9AAA",Light:"#C0DDE6",WarmBeige:"#D0E8EE",TealTint:"#B0D8E4",Lavender:"#C8DCE6",AmberTint:"#D8E0D0",PdfFill:"#E0C8C0",PdfText:"#CC3300"}}),t._addTheme("synthwave",{Name:"Synthwave",Category:"Fun",Description:"Purple and pink neon",Variables:{"--retold-bg-primary":"#1A0A2E","--retold-bg-secondary":"#140824","--retold-bg-tertiary":"#200E38","--retold-bg-panel":"#1C0C32","--retold-bg-viewer":"#100620","--retold-bg-hover":"#2A1848","--retold-bg-selected":"#3A2060","--retold-bg-thumb":"#140824","--retold-text-primary":"#E8C0F8","--retold-text-secondary":"#D0A8E8","--retold-text-muted":"#9878B8","--retold-text-dim":"#7858A8","--retold-text-placeholder":"#584088","--retold-accent":"#FF71CE","--retold-accent-hover":"#FF99DD","--retold-border":"#302050","--retold-border-light":"#402868","--retold-danger":"#FF4488","--retold-danger-muted":"#AA3366","--retold-scrollbar":"#302050","--retold-scrollbar-hover":"#402868","--retold-selection-bg":"rgba(255, 113, 206, 0.25)","--retold-focus-outline":"#FF71CE","--retold-font-family":"'Trebuchet MS', sans-serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#D0A8E8",Accent:"#FF71CE",Muted:"#7858A8",Light:"#200E38",WarmBeige:"#221040",TealTint:"#1A0C30",Lavender:"#1E0E36",AmberTint:"#241028",PdfFill:"#241020",PdfText:"#FF4488"}}),t._addTheme("solarized-dark",{Name:"Solarized Dark",Category:"Fun",Description:"Schoonover's classic palette",Variables:{"--retold-bg-primary":"#002B36","--retold-bg-secondary":"#073642","--retold-bg-tertiary":"#003B4A","--retold-bg-panel":"#00303C","--retold-bg-viewer":"#001E28","--retold-bg-hover":"#0A4858","--retold-bg-selected":"#155868","--retold-bg-thumb":"#073642","--retold-text-primary":"#FDF6E3","--retold-text-secondary":"#EEE8D5","--retold-text-muted":"#93A1A1","--retold-text-dim":"#839496","--retold-text-placeholder":"#657B83","--retold-accent":"#268BD2","--retold-accent-hover":"#45A0E0","--retold-border":"#0A4050","--retold-border-light":"#125868","--retold-danger":"#DC322F","--retold-danger-muted":"#AA2A28","--retold-scrollbar":"#0A4050","--retold-scrollbar-hover":"#125868","--retold-selection-bg":"rgba(38, 139, 210, 0.25)","--retold-focus-outline":"#268BD2","--retold-font-family":"'Source Code Pro', 'Fira Code', monospace","--retold-font-mono":"'Source Code Pro', 'Fira Code', monospace"},IconColors:{Primary:"#EEE8D5",Accent:"#268BD2",Muted:"#839496",Light:"#003B4A",WarmBeige:"#073642",TealTint:"#004050",Lavender:"#003848",AmberTint:"#0A3A30",PdfFill:"#0A3028",PdfText:"#DC322F"}}),t._addTheme("forest",{Name:"Forest",Category:"Fun",Description:"Deep greens and earth browns",Variables:{"--retold-bg-primary":"#1A2018","--retold-bg-secondary":"#141A12","--retold-bg-tertiary":"#1E2620","--retold-bg-panel":"#1C221A","--retold-bg-viewer":"#101410","--retold-bg-hover":"#283828","--retold-bg-selected":"#344834","--retold-bg-thumb":"#141A12","--retold-text-primary":"#D0DCC8","--retold-text-secondary":"#B0C4A8","--retold-text-muted":"#809878","--retold-text-dim":"#607858","--retold-text-placeholder":"#486040","--retold-accent":"#6AAF5C","--retold-accent-hover":"#88CC78","--retold-border":"#2A3A28","--retold-border-light":"#3A4A38","--retold-danger":"#CC4422","--retold-danger-muted":"#884422","--retold-scrollbar":"#2A3A28","--retold-scrollbar-hover":"#3A4A38","--retold-selection-bg":"rgba(106, 175, 92, 0.25)","--retold-focus-outline":"#6AAF5C","--retold-font-family":"'Palatino Linotype', 'Book Antiqua', Palatino, serif","--retold-font-mono":"'Courier New', monospace"},IconColors:{Primary:"#B0C4A8",Accent:"#6AAF5C",Muted:"#607858",Light:"#1E2620",WarmBeige:"#22281E",TealTint:"#1A221A",Lavender:"#1E2420",AmberTint:"#262218",PdfFill:"#261A18",PdfText:"#CC4422"}}),t._addTheme("mobile-debug",{Name:"Mobile Container Debug",Category:"Debug",Description:"Unique color per container for layout debugging",Variables:{"--retold-bg-primary":"#FF0000","--retold-bg-secondary":"#00CCCC","--retold-bg-tertiary":"#00AA00","--retold-bg-panel":"#FFAA00","--retold-bg-viewer":"#333333","--retold-bg-hover":"rgba(255, 255, 255, 0.2)","--retold-bg-selected":"rgba(255, 255, 255, 0.3)","--retold-bg-thumb":"#AA00AA","--retold-text-primary":"#FFFFFF","--retold-text-secondary":"#EEEEEE","--retold-text-muted":"#CCCCCC","--retold-text-dim":"#AAAAAA","--retold-text-placeholder":"#888888","--retold-accent":"#FFFF00","--retold-accent-hover":"#FFFF88","--retold-border":"#FFFFFF","--retold-border-light":"#CCCCCC","--retold-danger":"#FF0000","--retold-danger-muted":"#CC4444","--retold-scrollbar":"#888888","--retold-scrollbar-hover":"#AAAAAA","--retold-selection-bg":"rgba(255, 255, 0, 0.3)","--retold-focus-outline":"#FFFF00","--retold-font-family":"system-ui, -apple-system, sans-serif","--retold-font-mono":"'SF Mono', 'Consolas', monospace"},IconColors:{Primary:"#FFFFFF",Accent:"#FFFF00",Muted:"#CCCCCC",Light:"#333333",WarmBeige:"#FFAA00",TealTint:"#00CCCC",Lavender:"#AA00AA",AmberTint:"#FFAA00",PdfFill:"#FF4444",PdfText:"#FFFFFF"}})}_addTheme(t,e){this._themes[t]=e,this._themeOrder.push(t)}applyTheme(t){let e=this._themes[t];e||(e=this._themes.twilight,t="twilight"),this._currentTheme=t;let n=":root {\n",i=e.Variables,o=Object.keys(i);for(let t=0;t<o.length;t++)n+="\t"+o[t]+": "+i[o[t]]+";\n";if(n+="}\n","undefined"!=typeof document){let t=document.getElementById("retold-remote-theme");t||(t=document.createElement("style"),t.id="retold-remote-theme",document.head.appendChild(t)),t.textContent=n}let r=this.pict.providers["RetoldRemote-Icons"];r&&e.IconColors&&r.setColors(e.IconColors);let s=this.pict.AppData.RetoldRemote;return s&&(s.Theme=t),!0}getThemeList(){let t=[];for(let e=0;e<this._themeOrder.length;e++){let n=this._themeOrder[e],i=this._themes[n];t.push({key:n,name:i.Name,category:i.Category,description:i.Description})}return t}getCurrentTheme(){return this._currentTheme}getTheme(t){return this._themes[t]||null}}o.default_configuration={ProviderIdentifier:"RetoldRemote-Theme",AutoInitialize:!0,AutoInitializeOrdinal:0},e.exports=o},{"pict-provider":46}],123:[function(t,e,n){const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n),this.serviceType="RetoldRemoteProvider",this._overlayTimeout=null}showOverlayIndicator(t,e){let n=e||1500,i=document.getElementById("RetoldRemote-FitIndicator");if(!i){i=document.createElement("div"),i.id="RetoldRemote-FitIndicator",i.className="retold-remote-fit-indicator";let t=document.querySelector(".retold-remote-viewer-body");t&&t.appendChild(i)}i.textContent=t,i.classList.add("visible"),this._overlayTimeout&&clearTimeout(this._overlayTimeout),this._overlayTimeout=setTimeout(function(){i.classList.remove("visible")},n)}showToast(t,e){let n=e||2e3,i=document.querySelector(".retold-remote-toast");i&&i.remove();let o=document.createElement("div");o.className="retold-remote-toast",o.textContent=t,document.body.appendChild(o),setTimeout(function(){o.parentNode&&o.remove()},n)}}o.default_configuration={ProviderIdentifier:"RetoldRemote-ToastNotification",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=o},{"pict-provider":46}],124:[function(t,e,n){e.exports=function(t,e){let n=t.pict.views["RetoldRemote-AudioExplorer"];if(n)switch(e.key){case"Escape":e.preventDefault(),n._selectionStart>=0?n.clearSelection():n.goBack();break;case"+":case"=":e.preventDefault(),n.zoomIn();break;case"-":case"_":e.preventDefault(),n.zoomOut();break;case"0":e.preventDefault(),n.zoomToFit();break;case"z":case"Z":e.preventDefault(),n.zoomToSelection();break;case" ":e.preventDefault(),n.playSelection();break;case"a":e.preventDefault();{let e=t.pict.AppData.RetoldRemote,n=t.pict.providers["RetoldRemote-CollectionManager"];if(n)if(e.LastUsedCollectionGUID)n.addAudioSnippetToCollection(e.LastUsedCollectionGUID);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}}}},{}],125:[function(t,e,n){e.exports=function(t,e){let n=t.pict.AppData.RetoldRemote,i=n.GalleryItems||[],o=n.GalleryCursorIndex||0;switch(e.key){case"ArrowRight":e.preventDefault(),t.moveCursor(Math.min(o+1,i.length-1));break;case"ArrowLeft":e.preventDefault(),t.moveCursor(Math.max(o-1,0));break;case"ArrowDown":e.preventDefault(),t.moveCursor(Math.min(o+t._columnsPerRow,i.length-1));break;case"ArrowUp":e.preventDefault(),t.moveCursor(Math.max(o-t._columnsPerRow,0));break;case"Enter":e.preventDefault(),t.openCurrent();break;case"Escape":e.preventDefault(),t.navigateUp();break;case"g":e.preventDefault(),t._toggleViewMode();break;case"x":e.preventDefault(),t._clearAllFilters();break;case"Home":e.preventDefault(),t.moveCursor(0);break;case"End":e.preventDefault(),t.moveCursor(i.length-1);break;case"1":e.preventDefault(),t.openCurrentAs("image");break;case"2":e.preventDefault(),t.openCurrentAs("video");break;case"3":e.preventDefault(),t.openCurrentAs("audio");break;case"4":e.preventDefault(),t.openCurrentAs("text");break;case"f":e.preventDefault();{t._showFilterBar();let e=t.pict.views["RetoldRemote-Gallery"];e&&e.toggleFilterPanel()}break;case"s":e.preventDefault(),t._showFilterBar(),setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Sort");t&&t.focus()},50);break;case"c":e.preventDefault(),t._toggleSettingsPanel();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let r=i[o];if(r&&n.LastUsedCollectionGUID){let t={Type:"folder"===r.Type||"archive"===r.Type?"folder":"file",Path:r.Path||"",Hash:r.Hash||"",Label:""};e.addItemsToCollection(n.LastUsedCollectionGUID,[t])}else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"d":e.preventDefault(),t._toggleDistractionFree();break;case"e":e.preventDefault();{let e=i[o];if(e&&"folder"!==e.Type&&"archive"!==e.Type){let n=t.pict.providers["RetoldRemote-GalleryFilterSort"];if("video"===(n?n.getCategory(e.Extension):"")){let n=t.pict.views["RetoldRemote-VideoExplorer"];n&&n.showExplorer(e.Path)}}}}}},{}],126:[function(t,e,n){e.exports=function(t,e){let n=document.querySelectorAll("#Pict-FileBrowser-DetailRows .pict-fb-detail-row"),i=n.length;if(0!==i)switch(e.key){case"ArrowDown":e.preventDefault(),t._moveSidebarCursor(Math.min(t._sidebarCursorIndex+1,i-1));break;case"ArrowUp":e.preventDefault(),t._moveSidebarCursor(Math.max(t._sidebarCursorIndex-1,0));break;case"Home":e.preventDefault(),t._moveSidebarCursor(0);break;case"End":e.preventDefault(),t._moveSidebarCursor(i-1);break;case"Enter":e.preventDefault();{let e=n[t._sidebarCursorIndex];if(e){let t=e.getAttribute("ondblclick");t&&new Function(t).call(e)}}break;case"Escape":e.preventDefault(),t._blurSidebar()}else t._blurSidebar()}},{}],127:[function(t,e,n){e.exports=function(t,e){let n=t.pict.AppData.RetoldRemote;switch(e.key){case"Escape":e.preventDefault();let i=t.pict.views["RetoldRemote-VideoExplorer"];i&&i.goBack();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e)if(n.LastUsedCollectionGUID)e.addVideoFrameToCollection(n.LastUsedCollectionGUID);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}}}},{}],128:[function(t,e,n){e.exports=function(t,e){let n=t.pict.AppData.RetoldRemote;if(n.VideoMenuActive&&"video"===n.CurrentViewerMediaType)switch(e.key){case"Escape":return e.preventDefault(),void t.closeViewer();case"ArrowRight":case"j":return e.preventDefault(),void t.nextFile();case"ArrowLeft":case"k":return e.preventDefault(),void t.prevFile();case"e":e.preventDefault();let i=t.pict.views["RetoldRemote-VideoExplorer"];return void(i&&i.showExplorer(n.CurrentViewerFile));case" ":case"Enter":e.preventDefault();let o=t.pict.views["RetoldRemote-MediaViewer"];return void(o&&o.playVideo());case"t":e.preventDefault();let r=t.pict.views["RetoldRemote-MediaViewer"];return void(r&&r.loadVideoMenuFrame());case"v":return e.preventDefault(),void t._streamWithVLC()}else switch(e.key){case"Escape":e.preventDefault(),t.closeViewer();break;case"ArrowRight":case"j":e.preventDefault(),t.nextFile();break;case"ArrowLeft":case"k":e.preventDefault(),t.prevFile();break;case"f":e.preventDefault(),t._toggleFullscreen();break;case"i":e.preventDefault(),t._toggleFileInfo();break;case" ":e.preventDefault(),t._togglePlayPause();break;case"+":case"=":e.preventDefault(),t._zoomIn();break;case"-":e.preventDefault(),t._zoomOut();break;case"0":e.preventDefault(),t._zoomReset();break;case"z":e.preventDefault(),t._cycleFitMode();break;case"Enter":case"v":e.preventDefault(),t._streamWithVLC();break;case"a":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];if(e){let n=t.pict.AppData.RetoldRemote;if(n.LastUsedCollectionGUID)e.addCurrentFileToCollection(n.LastUsedCollectionGUID);else{let e=t.pict.views["ContentEditor-TopBar"];e&&"function"==typeof e.showAddToCollectionDropdown&&e.showAddToCollectionDropdown()}}}break;case"b":e.preventDefault();{let e=t.pict.providers["RetoldRemote-CollectionManager"];e&&e.togglePanel()}break;case"d":e.preventDefault(),t._toggleDistractionFree();break;case"1":e.preventDefault(),t.switchViewerType("image");break;case"2":e.preventDefault(),t.switchViewerType("video");break;case"3":e.preventDefault(),t.switchViewerType("audio");break;case"4":e.preventDefault(),t.switchViewerType("text")}}},{}],129:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-AudioExplorer",DefaultRenderable:"RetoldRemote-AudioExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:"\n\t\t.retold-remote-aex\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t}\n\t\t.retold-remote-aex-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tz-index: 5;\n\t\t}\n\t\t.retold-remote-aex-nav-btn\n\t\t{\n\t\t\tpadding: 4px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.8rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-aex-nav-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-aex-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-aex-info\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 16px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.retold-remote-aex-info-item\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.retold-remote-aex-info-label\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-aex-info-value\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-aex-controls\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.retold-remote-aex-controls label\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-aex-controls select,\n\t\t.retold-remote-aex-controls input\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 2px 6px;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-aex-btn\n\t\t{\n\t\t\tpadding: 3px 12px;\n\t\t\tborder: 1px solid var(--retold-accent);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-aex-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-primary);\n\t\t}\n\t\t.retold-remote-aex-btn:disabled\n\t\t{\n\t\t\topacity: 0.4;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.retold-remote-aex-btn:disabled:hover\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-aex-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\toverflow: hidden;\n\t\t\tposition: relative;\n\t\t}\n\t\t.retold-remote-aex-loading\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\theight: 100%;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t\t.retold-remote-aex-loading-spinner\n\t\t{\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tborder: 3px solid var(--retold-border);\n\t\t\tborder-top-color: var(--retold-accent);\n\t\t\tborder-radius: 50%;\n\t\t\tanimation: retold-aex-spin 0.8s linear infinite;\n\t\t\tmargin-bottom: 16px;\n\t\t}\n\t\t@keyframes retold-aex-spin\n\t\t{\n\t\t\tto { transform: rotate(360deg); }\n\t\t}\n\t\t.retold-remote-aex-canvas-wrap\n\t\t{\n\t\t\tflex: 1;\n\t\t\tposition: relative;\n\t\t\tmin-height: 150px;\n\t\t\tcursor: crosshair;\n\t\t}\n\t\t.retold-remote-aex-canvas-wrap canvas\n\t\t{\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: block;\n\t\t}\n\t\t.retold-remote-aex-overview-wrap\n\t\t{\n\t\t\theight: 48px;\n\t\t\tposition: relative;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.retold-remote-aex-overview-wrap canvas\n\t\t{\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tdisplay: block;\n\t\t}\n\t\t.retold-remote-aex-overview-viewport\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\theight: 100%;\n\t\t\tbackground: rgba(255, 255, 255, 0.08);\n\t\t\tborder-left: 2px solid var(--retold-accent);\n\t\t\tborder-right: 2px solid var(--retold-accent);\n\t\t\tpointer-events: none;\n\t\t}\n\t\t/* Time display bar */\n\t\t.retold-remote-aex-time-bar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 6px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-family: var(--retold-font-mono, monospace);\n\t\t}\n\t\t.retold-remote-aex-time-label\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-aex-time-value\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-aex-time-selection\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t/* Playback bar */\n\t\t.retold-remote-aex-playback\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-aex-playback audio\n\t\t{\n\t\t\tflex: 1;\n\t\t\theight: 32px;\n\t\t\tmax-width: 400px;\n\t\t}\n\t\t.retold-remote-aex-playback-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t/* Error state */\n\t\t.retold-remote-aex-error\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\theight: 100%;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.85rem;\n\t\t\ttext-align: center;\n\t\t\tpadding: 40px;\n\t\t}\n\t\t.retold-remote-aex-error-message\n\t\t{\n\t\t\tcolor: #e06c75;\n\t\t\tmargin-bottom: 16px;\n\t\t}\n\t"};class r extends i{constructor(t,e,n){super(t,e,n),this._currentPath="",this._waveformData=null,this._peaks=[],this._viewStart=0,this._viewEnd=1,this._minZoom=.005,this._selectionStart=-1,this._selectionEnd=-1,this._isDragging=!1,this._dragStart=-1,this._cursorX=-1,this._segmentURL=null,this._mainCanvas=null,this._overviewCanvas=null,this._resizeObserver=null}showExplorer(t){this.pict.AppData.RetoldRemote.ActiveMode="audio-explorer",this._currentPath=t,this._waveformData=null,this._peaks=[],this._viewStart=0,this._viewEnd=1,this._selectionStart=-1,this._selectionEnd=-1,this._segmentURL=null;let e=this.pict.providers["RetoldRemote-Provider"],n=e?e.getFragmentIdentifier(t):t;window.location.hash="#/explore-audio/"+n;let i=document.getElementById("RetoldRemote-Gallery-Container"),o=document.getElementById("RetoldRemote-Viewer-Container");i&&(i.style.display="none"),o&&(o.style.display="block");let r=t.replace(/^.*\//,""),s='<div class="retold-remote-aex">';s+='<div class="retold-remote-aex-header">',s+='<button class="retold-remote-aex-nav-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].goBack()" title="Back to audio (Esc)">&larr; Back</button>',s+='<div class="retold-remote-aex-title">Audio Explorer &mdash; '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(r)+"</div>",s+="</div>",s+='<div class="retold-remote-aex-info" id="RetoldRemote-AEX-Info" style="display:none;"></div>',s+='<div class="retold-remote-aex-controls" id="RetoldRemote-AEX-Controls" style="display:none;">',s+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomIn()" title="Zoom In (+)">+ Zoom In</button>',s+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomOut()" title="Zoom Out (-)">- Zoom Out</button>',s+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomToFit()" title="Zoom to Fit (0)">Fit All</button>',s+='<button class="retold-remote-aex-btn" id="RetoldRemote-AEX-ZoomSelBtn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].zoomToSelection()" title="Zoom to Selection (Z)" disabled>Zoom to Selection</button>',s+='<button class="retold-remote-aex-btn" id="RetoldRemote-AEX-PlaySelBtn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].playSelection()" title="Play Selection (Space)" disabled>&#9654; Play Selection</button>',s+='<button class="retold-remote-aex-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].clearSelection()" title="Clear Selection (Esc)">Clear Selection</button>',s+="</div>",s+='<div class="retold-remote-aex-body" id="RetoldRemote-AEX-Body">',s+='<div class="retold-remote-aex-loading">',s+='<div class="retold-remote-aex-loading-spinner"></div>',s+="Analyzing audio waveform...",s+="</div>",s+="</div>",s+='<div class="retold-remote-aex-time-bar" id="RetoldRemote-AEX-TimeBar" style="display:none;">',s+='<span class="retold-remote-aex-time-label">View:</span>',s+='<span class="retold-remote-aex-time-value" id="RetoldRemote-AEX-ViewRange">--</span>',s+='<span class="retold-remote-aex-time-label" style="margin-left: 12px;">Selection:</span>',s+='<span class="retold-remote-aex-time-selection" id="RetoldRemote-AEX-SelectionRange">None</span>',s+='<span class="retold-remote-aex-time-label" style="margin-left: 12px;">Cursor:</span>',s+='<span class="retold-remote-aex-time-value" id="RetoldRemote-AEX-CursorTime">--</span>',s+="</div>",s+='<div class="retold-remote-aex-playback" id="RetoldRemote-AEX-Playback" style="display:none;">',s+='<span class="retold-remote-aex-playback-label">Segment:</span>',s+='<audio controls id="RetoldRemote-AEX-Audio"></audio>',s+="</div>",s+="</div>",o&&(o.innerHTML=s);let a=this.pict.views["ContentEditor-TopBar"];a&&a.updateInfo(),this._fetchWaveform(t)}_fetchWaveform(t){let e=this,n=this.pict.providers["RetoldRemote-Provider"],i=n?n._getPathParam(t):encodeURIComponent(t);fetch("/api/media/audio-waveform?path="+i+"&peaks=2000").then(t=>t.json()).then(t=>{t&&t.Success?(e._waveformData=t,e._peaks=t.Peaks||[],e._renderWaveformUI()):e._showError(t?t.Error:"Unknown error")}).catch(t=>{e._showError(t.message)})}_renderWaveformUI(){let t=this._waveformData;if(!t)return;let e=document.getElementById("RetoldRemote-AEX-Info");if(e){let n="";n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Duration</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.DurationFormatted)+"</span></span>",t.SampleRate&&(n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Sample Rate</span> <span class="retold-remote-aex-info-value">'+(t.SampleRate/1e3).toFixed(1)+" kHz</span></span>"),t.Channels&&(n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Channels</span> <span class="retold-remote-aex-info-value">'+t.Channels+(t.ChannelLayout?" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.ChannelLayout)+")":"")+"</span></span>"),t.Codec&&(n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Codec</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Codec)+"</span></span>"),t.Bitrate&&(n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Bitrate</span> <span class="retold-remote-aex-info-value">'+Math.round(t.Bitrate/1e3)+" kbps</span></span>"),t.FileSize&&(n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Size</span> <span class="retold-remote-aex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(t.FileSize)+"</span></span>"),n+='<span class="retold-remote-aex-info-item"><span class="retold-remote-aex-info-label">Peaks</span> <span class="retold-remote-aex-info-value">'+t.PeakCount+" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Method)+")</span></span>",e.innerHTML=n,e.style.display=""}let n=document.getElementById("RetoldRemote-AEX-Controls");n&&(n.style.display="");let i=document.getElementById("RetoldRemote-AEX-TimeBar");i&&(i.style.display="");let o=document.getElementById("RetoldRemote-AEX-Body");if(o){let t="";t+='<div class="retold-remote-aex-canvas-wrap" id="RetoldRemote-AEX-CanvasWrap">',t+='<canvas id="RetoldRemote-AEX-MainCanvas"></canvas>',t+="</div>",t+='<div class="retold-remote-aex-overview-wrap" id="RetoldRemote-AEX-OverviewWrap">',t+='<canvas id="RetoldRemote-AEX-OverviewCanvas"></canvas>',t+='<div class="retold-remote-aex-overview-viewport" id="RetoldRemote-AEX-OverviewViewport"></div>',t+="</div>",o.innerHTML=t}this._mainCanvas=document.getElementById("RetoldRemote-AEX-MainCanvas"),this._overviewCanvas=document.getElementById("RetoldRemote-AEX-OverviewCanvas"),this._bindCanvasEvents(),this._resizeCanvases(),this._drawAll(),this._updateTimeDisplay();let r=this;if("undefined"!=typeof ResizeObserver){this._resizeObserver=new ResizeObserver(()=>{r._resizeCanvases(),r._drawAll()});let t=document.getElementById("RetoldRemote-AEX-CanvasWrap");t&&this._resizeObserver.observe(t)}}_resizeCanvases(){if(this._mainCanvas){let t=this._mainCanvas.parentElement;if(t){let e=window.devicePixelRatio||1;this._mainCanvas.width=t.clientWidth*e,this._mainCanvas.height=t.clientHeight*e}}if(this._overviewCanvas){let t=this._overviewCanvas.parentElement;if(t){let e=window.devicePixelRatio||1;this._overviewCanvas.width=t.clientWidth*e,this._overviewCanvas.height=t.clientHeight*e}}}_drawAll(){this._drawMainWaveform(),this._drawOverviewWaveform(),this._updateOverviewViewport()}_drawMainWaveform(){if(!this._mainCanvas||0===this._peaks.length)return;let t=this._mainCanvas.getContext("2d"),e=this._mainCanvas.width,n=this._mainCanvas.height,i=window.devicePixelRatio||1;t.clearRect(0,0,e,n);let o=getComputedStyle(document.documentElement).getPropertyValue("--retold-bg-primary").trim()||"#1e1e2e";t.fillStyle=o,t.fillRect(0,0,e,n);let r=this._peaks,s=r.length,a=Math.floor(this._viewStart*s),l=Math.ceil(this._viewEnd*s)-a;if(l<=0)return;let d=n/2;if(this._selectionStart>=0&&this._selectionEnd>=0){let o=Math.min(this._selectionStart,this._selectionEnd),r=Math.max(this._selectionStart,this._selectionEnd),s=this._viewEnd-this._viewStart,a=(o-this._viewStart)/s*e,l=(r-this._viewStart)/s*e;if(a=Math.max(0,a),l=Math.min(e,l),l>a){let e=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa";t.fillStyle=e+"22",t.fillRect(a,0,l-a,n),t.strokeStyle=e,t.lineWidth=2*i,t.beginPath(),t.moveTo(a,0),t.lineTo(a,n),t.stroke(),t.beginPath(),t.moveTo(l,0),t.lineTo(l,n),t.stroke()}}let c=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-dim").trim()||"#585b70";t.strokeStyle=c,t.lineWidth=1,t.setLineDash([4,4]),t.beginPath(),t.moveTo(0,d),t.lineTo(e,d),t.stroke(),t.setLineDash([]);let p=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa",h=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-secondary").trim()||"#cdd6f4";for(let n=0;n<e;n++){let i=a+n/e*l,o=a+(n+1)/e*l,c=Math.floor(i),u=Math.ceil(o);c=Math.max(0,Math.min(c,s-1)),u=Math.max(c+1,Math.min(u,s));let m=0,f=0;for(let t=c;t<u;t++)r[t].Min<m&&(m=r[t].Min),r[t].Max>f&&(f=r[t].Max);let g=d-f*d*.9,v=d-m*d*.9,b=Math.max(1,v-g),y=this._viewStart+n/e*(this._viewEnd-this._viewStart),w=!1;if(this._selectionStart>=0&&this._selectionEnd>=0){let t=Math.min(this._selectionStart,this._selectionEnd),e=Math.max(this._selectionStart,this._selectionEnd);w=y>=t&&y<=e}t.fillStyle=w?p:h,t.fillRect(n,g,1,b)}this._cursorX>=0&&this._cursorX<e&&(t.strokeStyle="#ffffff44",t.lineWidth=1,t.beginPath(),t.moveTo(this._cursorX*i,0),t.lineTo(this._cursorX*i,n),t.stroke())}_drawOverviewWaveform(){if(!this._overviewCanvas||0===this._peaks.length)return;let t=this._overviewCanvas.getContext("2d"),e=this._overviewCanvas.width,n=this._overviewCanvas.height;t.clearRect(0,0,e,n);let i=getComputedStyle(document.documentElement).getPropertyValue("--retold-bg-tertiary").trim()||"#313244";t.fillStyle=i,t.fillRect(0,0,e,n);let o=this._peaks,r=o.length,s=n/2,a=getComputedStyle(document.documentElement).getPropertyValue("--retold-text-muted").trim()||"#a6adc8";if(this._selectionStart>=0&&this._selectionEnd>=0){let i=Math.min(this._selectionStart,this._selectionEnd),o=Math.max(this._selectionStart,this._selectionEnd),r=getComputedStyle(document.documentElement).getPropertyValue("--retold-accent").trim()||"#89b4fa";t.fillStyle=r+"33",t.fillRect(i*e,0,(o-i)*e,n)}for(let n=0;n<e;n++){let i=n/e*r,l=(n+1)/e*r,d=Math.floor(i),c=Math.ceil(l);d=Math.max(0,Math.min(d,r-1)),c=Math.max(d+1,Math.min(c,r));let p=0,h=0;for(let t=d;t<c;t++)o[t].Min<p&&(p=o[t].Min),o[t].Max>h&&(h=o[t].Max);let u=s-h*s*.85,m=s-p*s*.85,f=Math.max(1,m-u);t.fillStyle=a,t.fillRect(n,u,1,f)}}_updateOverviewViewport(){let t=document.getElementById("RetoldRemote-AEX-OverviewViewport");if(!t)return;let e=document.getElementById("RetoldRemote-AEX-OverviewWrap");if(!e)return;let n=e.clientWidth,i=this._viewStart*n,o=this._viewEnd*n;t.style.left=i+"px",t.style.width=o-i+"px"}_bindCanvasEvents(){let t=this,e=document.getElementById("RetoldRemote-AEX-CanvasWrap");if(!e)return;e.addEventListener("mousemove",n=>{let i=e.getBoundingClientRect();if(t._cursorX=n.clientX-i.left,t._isDragging){let e=t._viewStart+t._cursorX/i.width*(t._viewEnd-t._viewStart);e=Math.max(0,Math.min(1,e)),t._selectionEnd=e,t._drawMainWaveform(),t._drawOverviewWaveform(),t._updateSelectionButtons()}t._updateTimeDisplay(),t._drawMainWaveform()}),e.addEventListener("mouseleave",()=>{t._cursorX=-1,t._drawMainWaveform()}),e.addEventListener("mousedown",n=>{if(0!==n.button)return;let i=e.getBoundingClientRect(),o=t._viewStart+(n.clientX-i.left)/i.width*(t._viewEnd-t._viewStart);o=Math.max(0,Math.min(1,o)),t._isDragging=!0,t._selectionStart=o,t._selectionEnd=o,t._dragStart=o,t._segmentURL=null;let r=document.getElementById("RetoldRemote-AEX-Playback");r&&(r.style.display="none")}),window.addEventListener("mouseup",()=>{t._isDragging&&(t._isDragging=!1,Math.abs(t._selectionEnd-t._selectionStart)<.001&&(t._selectionStart=-1,t._selectionEnd=-1),t._updateSelectionButtons(),t._drawAll(),t._updateTimeDisplay())}),e.addEventListener("wheel",n=>{n.preventDefault();let i=e.getBoundingClientRect(),o=(n.clientX-i.left)/i.width,r=n.deltaY>0?1.2:.8;t._zoomAtPoint(o,r)},{passive:!1});let n=document.getElementById("RetoldRemote-AEX-OverviewWrap");n&&n.addEventListener("click",e=>{let i=n.getBoundingClientRect(),o=(e.clientX-i.left)/i.width;o=Math.max(0,Math.min(1,o));let r=t._viewEnd-t._viewStart,s=o-r/2;s=Math.max(0,Math.min(1-r,s)),t._viewStart=s,t._viewEnd=s+r,t._drawAll(),t._updateTimeDisplay()})}_zoomAtPoint(t,e){let n=this._viewEnd-this._viewStart,i=this._viewStart+t*n,o=n*e;o=Math.max(this._minZoom,Math.min(1,o));let r=i-t*o,s=r+o;r<0&&(r=0,s=o),s>1&&(s=1,r=1-o),this._viewStart=Math.max(0,r),this._viewEnd=Math.min(1,s),this._drawAll(),this._updateTimeDisplay()}_updateTimeDisplay(){if(!this._waveformData)return;let t=this._waveformData.Duration,e=document.getElementById("RetoldRemote-AEX-ViewRange");if(e){let n=this._viewStart*t,i=this._viewEnd*t;e.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(n,!0)+" - "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(i,!0)}let n=document.getElementById("RetoldRemote-AEX-SelectionRange");if(n)if(this._selectionStart>=0&&this._selectionEnd>=0){let e=Math.min(this._selectionStart,this._selectionEnd)*t,i=Math.max(this._selectionStart,this._selectionEnd)*t,o=i-e;n.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(e,!0)+" - "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(i,!0)+" ("+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(o,!0)+")"}else n.textContent="None";let i=document.getElementById("RetoldRemote-AEX-CursorTime");if(i)if(this._cursorX>=0&&this._mainCanvas){let e=this._mainCanvas.parentElement;if(e){let n=this._viewStart+this._cursorX/e.clientWidth*(this._viewEnd-this._viewStart);i.textContent=this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(n*t,!0)}}else i.textContent="--"}_updateSelectionButtons(){let t=this._selectionStart>=0&&this._selectionEnd>=0&&Math.abs(this._selectionEnd-this._selectionStart)>=.001,e=document.getElementById("RetoldRemote-AEX-ZoomSelBtn");e&&(e.disabled=!t);let n=document.getElementById("RetoldRemote-AEX-PlaySelBtn");n&&(n.disabled=!t)}zoomIn(){this._zoomAtPoint(.5,.5)}zoomOut(){this._zoomAtPoint(.5,2)}zoomToFit(){this._viewStart=0,this._viewEnd=1,this._drawAll(),this._updateTimeDisplay()}zoomToSelection(){if(this._selectionStart<0||this._selectionEnd<0)return;let t=Math.min(this._selectionStart,this._selectionEnd),e=Math.max(this._selectionStart,this._selectionEnd),n=.05*(e-t);this._viewStart=Math.max(0,t-n),this._viewEnd=Math.min(1,e+n),this._drawAll(),this._updateTimeDisplay()}clearSelection(){this._selectionStart=-1,this._selectionEnd=-1,this._segmentURL=null;let t=document.getElementById("RetoldRemote-AEX-Playback");t&&(t.style.display="none"),this._updateSelectionButtons(),this._drawAll(),this._updateTimeDisplay()}playSelection(){if(this._selectionStart<0||this._selectionEnd<0||!this._waveformData)return;let t=this._waveformData.Duration,e=Math.min(this._selectionStart,this._selectionEnd)*t,n=Math.max(this._selectionStart,this._selectionEnd)*t,i=this.pict.providers["RetoldRemote-Provider"],o="/api/media/audio-segment?path="+(i?i._getPathParam(this._currentPath):encodeURIComponent(this._currentPath))+"&start="+e.toFixed(3)+"&end="+n.toFixed(3)+"&format=mp3",r=document.getElementById("RetoldRemote-AEX-Playback");r&&(r.style.display="");let s=document.getElementById("RetoldRemote-AEX-Audio");s&&(s.src=o,s.load(),s.play().catch(()=>{})),this._segmentURL=o}goBack(){if(this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),this._currentPath){let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"audio")}else{let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}}_showError(t){let e=document.getElementById("RetoldRemote-AEX-Body");e&&(e.innerHTML='<div class="retold-remote-aex-error"><div class="retold-remote-aex-error-message">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-aex-nav-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].goBack()">Back to Audio</button></div>')}}r.default_configuration=o,e.exports=r},{"pict-view":76}],130:[function(t,e,n){
120
120
  /**
121
121
  * Retold Remote -- Collections Panel View
122
122
  *
@@ -132,5 +132,5 @@ const i=t("pict-provider");class o extends i{constructor(t,e,n){super(t,e,n)}_ge
132
132
  *
133
133
  * @license MIT
134
134
  */
135
- const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-CollectionsPanel",DefaultRenderable:"RetoldRemote-CollectionsPanel",DefaultDestinationAddress:"#RetoldRemote-Collections-Container",AutoRender:!1,CSS:"\n\t\t/* ---- Collections Panel Container ---- */\n\t\t.retold-remote-collections-panel\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.retold-remote-collections-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 8px 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-collections-header-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.retold-remote-collections-header-btn\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 26px;\n\t\t\theight: 26px;\n\t\t\tpadding: 0;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.82rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-collections-header-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t/* ---- Search ---- */\n\t\t.retold-remote-collections-search\n\t\t{\n\t\t\tpadding: 6px 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-collections-search input\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t\toutline: none;\n\t\t}\n\t\t.retold-remote-collections-search input:focus\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t/* ---- Collection List ---- */\n\t\t.retold-remote-collections-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t}\n\t\t.retold-remote-collections-empty\n\t\t{\n\t\t\tpadding: 24px 16px;\n\t\t\ttext-align: center;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-collection-card\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t\tpadding: 10px 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s;\n\t\t}\n\t\t.retold-remote-collection-card:hover\n\t\t{\n\t\t\tbackground: rgba(128, 128, 128, 0.08);\n\t\t}\n\t\t.retold-remote-collection-card-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-size: 1rem;\n\t\t}\n\t\t.retold-remote-collection-card-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.retold-remote-collection-card-name\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.retold-remote-collection-card-meta\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-top: 2px;\n\t\t}\n\t\t/* ---- Detail mode ---- */\n\t\t.retold-remote-collections-detail-controls\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t\tpadding: 6px 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-collections-sort-select\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-family: inherit;\n\t\t\tflex: 1;\n\t\t}\n\t\t.retold-remote-collections-sort-dir\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-collections-sort-dir:hover\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t/* ---- Item rows ---- */\n\t\t.retold-remote-collection-item\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 6px 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s;\n\t\t\tposition: relative;\n\t\t}\n\t\t.retold-remote-collection-item:hover\n\t\t{\n\t\t\tbackground: rgba(128, 128, 128, 0.08);\n\t\t}\n\t\t.retold-remote-collection-item-drag\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 16px;\n\t\t\tcursor: grab;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.68rem;\n\t\t\ttext-align: center;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.retold-remote-collection-item-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 24px;\n\t\t\theight: 24px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.82rem;\n\t\t}\n\t\t.retold-remote-collection-item-icon img\n\t\t{\n\t\t\twidth: 24px;\n\t\t\theight: 24px;\n\t\t\tobject-fit: cover;\n\t\t\tborder-radius: 2px;\n\t\t}\n\t\t.retold-remote-collection-item-name\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.retold-remote-collection-item-type\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.62rem;\n\t\t\tpadding: 1px 4px;\n\t\t\tborder-radius: 2px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\ttext-transform: uppercase;\n\t\t}\n\t\t.retold-remote-collection-item-remove\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: none;\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder: none;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.82rem;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.retold-remote-collection-item:hover .retold-remote-collection-item-remove\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.retold-remote-collection-item-remove:hover\n\t\t{\n\t\t\tcolor: var(--retold-danger-muted, #e55);\n\t\t\tbackground: rgba(200, 50, 50, 0.1);\n\t\t}\n\t\t/* ---- Operation Plan mode ---- */\n\t\t.retold-remote-collections-op-controls\n\t\t{\n\t\t\tflex-direction: column;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.retold-remote-collections-op-summary\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tpadding: 4px 0;\n\t\t}\n\t\t.retold-remote-collections-op-buttons\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.retold-remote-collections-op-execute-btn\n\t\t{\n\t\t\tflex: 1;\n\t\t\tpadding: 6px 12px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-accent, #4a90d9);\n\t\t\tcolor: #fff;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.retold-remote-collections-op-execute-btn:hover\n\t\t{\n\t\t\topacity: 0.9;\n\t\t}\n\t\t.retold-remote-collections-op-execute-btn:disabled\n\t\t{\n\t\t\topacity: 0.5;\n\t\t\tcursor: default;\n\t\t}\n\t\t.retold-remote-collections-op-undo-btn\n\t\t{\n\t\t\tpadding: 6px 12px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.retold-remote-collections-op-undo-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t}\n\t\t.retold-remote-collection-op-item\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tpadding: 6px 8px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tfont-size: 0.75rem;\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.retold-remote-collection-op-item.op-status-completed\n\t\t{\n\t\t\topacity: 0.6;\n\t\t}\n\t\t.retold-remote-collection-op-item.op-status-skipped\n\t\t{\n\t\t\topacity: 0.4;\n\t\t\ttext-decoration: line-through;\n\t\t}\n\t\t.retold-remote-collection-op-item.op-status-failed\n\t\t{\n\t\t\tbackground: rgba(200, 50, 50, 0.05);\n\t\t}\n\t\t.retold-remote-collection-op-status\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 16px;\n\t\t\ttext-align: center;\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\t\t.op-status-completed .retold-remote-collection-op-status\n\t\t{\n\t\t\tcolor: var(--retold-success, #4a4);\n\t\t}\n\t\t.op-status-failed .retold-remote-collection-op-status\n\t\t{\n\t\t\tcolor: var(--retold-danger-muted, #e55);\n\t\t}\n\t\t.op-status-pending .retold-remote-collection-op-status\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-collection-op-source\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-collection-op-arrow\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tpadding: 0 2px;\n\t\t}\n\t\t.retold-remote-collection-op-dest\n\t\t{\n\t\t\tflex: 2;\n\t\t\tmin-width: 0;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-collection-op-dest-input\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder: 1px solid var(--retold-accent);\n\t\t\tborder-radius: 2px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.retold-remote-collection-op-badge\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.6rem;\n\t\t\tpadding: 1px 4px;\n\t\t\tborder-radius: 2px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\ttext-transform: uppercase;\n\t\t\tfont-weight: 600;\n\t\t\tletter-spacing: 0.3px;\n\t\t}\n\t\t.retold-remote-collection-op-error\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-danger-muted, #e55);\n\t\t\tpadding: 2px 0 0 20px;\n\t\t}\n\t\t/* ---- Edit mode ---- */\n\t\t.retold-remote-collections-edit\n\t\t{\n\t\t\tpadding: 12px;\n\t\t}\n\t\t.retold-remote-collections-edit-group\n\t\t{\n\t\t\tmargin-bottom: 12px;\n\t\t}\n\t\t.retold-remote-collections-edit-label\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-bottom: 4px;\n\t\t}\n\t\t.retold-remote-collections-edit-input\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tpadding: 6px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.retold-remote-collections-edit-input:focus\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\toutline: none;\n\t\t}\n\t\t.retold-remote-collections-edit-textarea\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tmin-height: 80px;\n\t\t\tpadding: 6px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t\tresize: vertical;\n\t\t}\n\t\t.retold-remote-collections-edit-textarea:focus\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\toutline: none;\n\t\t}\n\t\t.retold-remote-collections-edit-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 8px;\n\t\t\tmargin-top: 16px;\n\t\t}\n\t\t.retold-remote-collections-edit-btn\n\t\t{\n\t\t\tpadding: 6px 14px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-collections-edit-btn:hover\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-collections-edit-btn-primary\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.retold-remote-collections-edit-btn-primary:hover\n\t\t{\n\t\t\topacity: 0.9;\n\t\t}\n\t\t.retold-remote-collections-edit-btn-danger\n\t\t{\n\t\t\tborder-color: var(--retold-danger-muted, #e55);\n\t\t\tcolor: var(--retold-danger-muted, #e55);\n\t\t\tmargin-top: 16px;\n\t\t}\n\t\t.retold-remote-collections-edit-btn-danger:hover\n\t\t{\n\t\t\tbackground: rgba(200, 50, 50, 0.1);\n\t\t}\n\t\t/* ---- Drag-and-drop feedback ---- */\n\t\t.retold-remote-collection-item.dragging\n\t\t{\n\t\t\topacity: 0.4;\n\t\t}\n\t\t.retold-remote-collection-item.drag-over\n\t\t{\n\t\t\tborder-top: 2px solid var(--retold-accent);\n\t\t}\n\t",Templates:[{Hash:"RetoldRemote-CollectionsPanel",Template:'<div class="retold-remote-collections-panel" id="RetoldRemote-CollectionsPanel-Root"></div>'}],Renderables:[{RenderableHash:"RetoldRemote-CollectionsPanel",TemplateHash:"RetoldRemote-CollectionsPanel",DestinationAddress:"#RetoldRemote-Collections-Container"}]};class r extends i{constructor(t,e,n){super(t,e,n),this._draggedItemId=null}onAfterRender(){super.onAfterRender(),this.renderContent()}renderContent(){let t=document.getElementById("RetoldRemote-CollectionsPanel-Root");if(t)switch(this.pict.AppData.RetoldRemote.CollectionsPanelMode){case"detail":this._renderDetailMode(t);break;case"edit":this._renderEditMode(t);break;default:this._renderListMode(t)}}_renderListMode(t){let e=this,n=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"];t.innerHTML="";let o=document.createElement("div");o.className="retold-remote-collections-header";let r=document.createElement("div");r.className="retold-remote-collections-header-title",r.textContent="Collections";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="New Collection",s.textContent="+",s.onclick=()=>{let t=prompt("Collection name:");t&&t.trim()&&i.createCollection(t.trim(),(t,e)=>{!t&&e&&(n.CollectionsPanelMode="detail",i.fetchCollection(e.GUID))})},o.appendChild(r),o.appendChild(s),t.appendChild(o);let a=document.createElement("div");a.className="retold-remote-collections-search";let l=document.createElement("input");l.type="text",l.placeholder="Search collections...",l.value=n.CollectionSearchQuery||"",l.oninput=i=>{n.CollectionSearchQuery=i.target.value,e._renderCollectionCards(t.querySelector(".retold-remote-collections-body"))},a.appendChild(l),t.appendChild(a);let d=document.createElement("div");d.className="retold-remote-collections-body",t.appendChild(d),this._renderCollectionCards(d)}_renderCollectionCards(t){if(!t)return;let e=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"],i=this.pict.providers["RetoldRemote-Icons"];t.innerHTML="";let o=n.searchCollections(e.CollectionSearchQuery);if(!o||0===o.length){let n=document.createElement("div");return n.className="retold-remote-collections-empty",n.textContent=e.CollectionSearchQuery?"No collections match your search.":"No collections yet. Click + to create one.",void t.appendChild(n)}for(let r=0;r<o.length;r++){let s=o[r],a=document.createElement("div");a.className="retold-remote-collection-card",a.onclick=()=>{e.CollectionsPanelMode="detail",n.fetchCollection(s.GUID)};let l=document.createElement("div");l.className="retold-remote-collection-card-icon",i&&"function"==typeof i.getIcon?l.innerHTML=i.getIcon("bookmark",18):l.textContent="☰";let d=document.createElement("div");d.className="retold-remote-collection-card-info";let c=document.createElement("div");c.className="retold-remote-collection-card-name",c.textContent=s.Name||"Untitled";let p=document.createElement("div");p.className="retold-remote-collection-card-meta",p.textContent=s.ItemCount+" item"+(1!==s.ItemCount?"s":""),d.appendChild(c),d.appendChild(p),a.appendChild(l),a.appendChild(d),t.appendChild(a)}}_renderDetailMode(t){let e=this,n=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"],o=n.ActiveCollection;if(t.innerHTML="",!o)return void(t.innerHTML='<div class="retold-remote-collections-empty">Loading...</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="Back to list",s.textContent="←",s.onclick=()=>{n.CollectionsPanelMode="list",n.ActiveCollectionGUID=null,n.ActiveCollection=null,e.renderContent()};let a=document.createElement("div");a.className="retold-remote-collections-header-title",a.textContent=o.Name||"Untitled";let l=document.createElement("button");l.className="retold-remote-collections-header-btn",l.title="Edit collection",l.textContent="✎",l.onclick=()=>{n.CollectionsPanelMode="edit",e.renderContent()},r.appendChild(s),r.appendChild(a),r.appendChild(l),t.appendChild(r);let d="operation-plan"===o.CollectionType;if(d){let e=document.createElement("div");e.className="retold-remote-collections-detail-controls retold-remote-collections-op-controls";let n=o.Items||[],r=0,s=0,a=0,l=0;for(let t=0;t<n.length;t++){let e=n[t].OperationStatus;"completed"===e?s++:"failed"===e?a++:"skipped"===e?l++:n[t].Operation&&r++}let d=document.createElement("div");d.className="retold-remote-collections-op-summary";let c=[];r>0&&c.push(r+" pending"),s>0&&c.push(s+" done"),a>0&&c.push(a+" failed"),l>0&&c.push(l+" skipped"),d.textContent=c.join(" · ")||"No operations",e.appendChild(d);let p=document.createElement("div");if(p.className="retold-remote-collections-op-buttons",r>0){let t=document.createElement("button");t.className="retold-remote-collections-op-execute-btn",t.textContent="Execute "+r+" Move"+(r>1?"s":""),t.onclick=()=>{t.disabled=!0,t.textContent="Moving...",i.executeCollectionOperations(o.GUID)},p.appendChild(t)}if(o.OperationBatchGUID&&s>0){let t=document.createElement("button");t.className="retold-remote-collections-op-undo-btn",t.textContent="Undo",t.onclick=()=>{t.disabled=!0,t.textContent="Undoing...",i.undoCollectionOperations(o.GUID)},p.appendChild(t)}e.appendChild(p),t.appendChild(e)}else{let e=document.createElement("div");e.className="retold-remote-collections-detail-controls";let r=document.createElement("select");r.className="retold-remote-collections-sort-select";let s=[{value:"manual",label:"Manual"},{value:"name",label:"Name"},{value:"modified",label:"Date Added"},{value:"type",label:"Type"}];for(let t=0;t<s.length;t++){let e=document.createElement("option");e.value=s[t].value,e.textContent=s[t].label,o.SortMode===s[t].value&&(e.selected=!0),r.appendChild(e)}r.onchange=t=>{i.sortActiveCollection(t.target.value,null)};let a=document.createElement("button");a.className="retold-remote-collections-sort-dir",a.textContent="desc"===o.SortDirection?"↓":"↑",a.title="desc"===o.SortDirection?"Descending":"Ascending",a.onclick=()=>{let t="desc"===n.ActiveCollection.SortDirection?"asc":"desc";i.sortActiveCollection(null,t)},e.appendChild(r),e.appendChild(a),t.appendChild(e)}let c=document.createElement("div");c.className="retold-remote-collections-body",t.appendChild(c),d?this._renderOperationItemList(c,o):this._renderItemList(c,o)}_renderItemList(t,e){let n=this,i=this.pict.AppData.RetoldRemote,o=this.pict.providers["RetoldRemote-CollectionManager"],r=e.Items||[];if(t.innerHTML="",0===r.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items yet. Browse files and add them to this collection.",void t.appendChild(e)}for(let s=0;s<r.length;s++){let a=r[s],l=document.createElement("div");if(l.className="retold-remote-collection-item",l.setAttribute("data-item-id",a.ID),"manual"===e.SortMode){let e=document.createElement("div");e.className="retold-remote-collection-item-drag",e.textContent="☰",e.draggable=!0,e.ondragstart=t=>{n._draggedItemId=a.ID,l.classList.add("dragging"),t.dataTransfer.effectAllowed="move"},e.ondragend=()=>{l.classList.remove("dragging"),n._draggedItemId=null;let e=t.querySelectorAll(".retold-remote-collection-item");for(let t=0;t<e.length;t++)e[t].classList.remove("drag-over")},l.appendChild(e)}l.ondragover=t=>{t.preventDefault(),t.dataTransfer.dropEffect="move",l.classList.add("drag-over")},l.ondragleave=()=>{l.classList.remove("drag-over")},l.ondrop=t=>{if(t.preventDefault(),l.classList.remove("drag-over"),n._draggedItemId&&n._draggedItemId!==a.ID){let t=e.Items||[],i=[];for(let e=0;e<t.length;e++)t[e].ID!==n._draggedItemId&&(t[e].ID===a.ID&&i.push(n._draggedItemId),i.push(t[e].ID));o.reorderItems(e.GUID,i)}};let d=document.createElement("div");d.className="retold-remote-collection-item-icon";let c=a.Path||"",p=c.replace(/^.*\./,"").toLowerCase(),h=this.pict.PictApplication._getMediaType(p);if("image"===h&&"file"===a.Type){let t=document.createElement("img"),e=this.pict.providers["RetoldRemote-Provider"];e&&(t.src=e.getThumbnailURL(c,48,48)),t.alt="",t.loading="lazy",d.appendChild(t)}else d.textContent=this._getTypeIcon(a.Type,h);let u=document.createElement("div");u.className="retold-remote-collection-item-name",u.textContent=a.Label||c.split("/").pop()||c,u.title=c;let m=document.createElement("div");m.className="retold-remote-collection-item-type",m.textContent=a.Type||"file";let f=document.createElement("button");f.className="retold-remote-collection-item-remove",f.title="Remove from collection",f.textContent="×",f.onclick=t=>{t.stopPropagation(),o.removeItemFromCollection(e.GUID,a.ID)};let g=s;l.onclick=()=>{"file"===a.Type||"subfile"===a.Type||"image-crop"===a.Type||"video-clip"===a.Type||"video-frame"===a.Type?(i.BrowsingCollection=!0,i.BrowsingCollectionIndex=g,n.pict.PictApplication.navigateToFile(a.Path)):"folder"!==a.Type&&"folder-contents"!==a.Type||n.pict.PictApplication.loadFileList(a.Path)},l.appendChild(d),l.appendChild(u),l.appendChild(m),l.appendChild(f),t.appendChild(l)}}_renderOperationItemList(t,e){let n=this,i=this.pict.providers["RetoldRemote-CollectionManager"],o=e.Items||[];if(t.innerHTML="",0===o.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items in this sort plan.",void t.appendChild(e)}for(let r=0;r<o.length;r++){let s=o[r],a=document.createElement("div");a.className="retold-remote-collection-op-item";let l=s.OperationStatus||"pending";a.classList.add("op-status-"+l);let d=document.createElement("div");d.className="retold-remote-collection-op-status","completed"===l?(d.textContent="✓",d.title="Completed"):"failed"===l?(d.textContent="✗",d.title=s.OperationError||"Failed"):"skipped"===l?(d.textContent="—",d.title="Skipped"):(d.textContent="○",d.title="Pending");let c=document.createElement("div");c.className="retold-remote-collection-op-source";let p=s.Path||"";c.textContent=p.split("/").pop()||p,c.title=p;let h=document.createElement("div");h.className="retold-remote-collection-op-arrow",h.textContent="→";let u=document.createElement("div");u.className="retold-remote-collection-op-dest";let m=s.DestinationPath||"";u.textContent=m||"(no destination)",u.title=m,"pending"===l&&(u.style.cursor="pointer",u.onclick=t=>{t.stopPropagation(),n._startEditDestination(u,s,e)});let f=document.createElement("div");f.className="retold-remote-collection-op-badge",f.textContent=(s.Operation||"move").toUpperCase();let g=document.createElement("button");if(g.className="retold-remote-collection-item-remove",g.title="Skip this operation",g.textContent="×","pending"===l?g.onclick=t=>{t.stopPropagation(),i.skipItemOperation(s.ID)}:g.style.visibility="hidden","failed"===l&&s.OperationError){let t=document.createElement("div");t.className="retold-remote-collection-op-error",t.textContent=s.OperationError,a.appendChild(t)}a.appendChild(d),a.appendChild(c),a.appendChild(h),a.appendChild(u),a.appendChild(f),a.appendChild(g),t.appendChild(a)}}_startEditDestination(t,e,n){let i=this.pict.providers["RetoldRemote-CollectionManager"],o=document.createElement("input");o.type="text",o.className="retold-remote-collection-op-dest-input",o.value=e.DestinationPath||"";o.onblur=()=>{let n=o.value.trim();n&&n!==e.DestinationPath&&i.setItemDestination(e.ID,n),t.textContent=n||e.DestinationPath||"(no destination)",t.title=n||e.DestinationPath||""},o.onkeydown=n=>{"Enter"===n.key?(n.preventDefault(),o.blur()):"Escape"===n.key&&(n.preventDefault(),t.textContent=e.DestinationPath||"(no destination)",t.title=e.DestinationPath||"")},t.textContent="",t.appendChild(o),o.focus(),o.select()}_renderEditMode(t){let e=this,n=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"],o=n.ActiveCollection;if(t.innerHTML="",!o)return void(t.innerHTML='<div class="retold-remote-collections-empty">No collection selected.</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="Back to detail",s.textContent="←",s.onclick=()=>{n.CollectionsPanelMode="detail",e.renderContent()};let a=document.createElement("div");a.className="retold-remote-collections-header-title",a.textContent="Edit Collection",r.appendChild(s),r.appendChild(a),t.appendChild(r);let l=document.createElement("div");l.className="retold-remote-collections-body";let d=document.createElement("div");d.className="retold-remote-collections-edit",d.appendChild(this._createEditGroup("Name","input",o.Name||"","edit-name")),d.appendChild(this._createEditGroup("Description (Markdown)","textarea",o.Description||"","edit-description"));let c=this._createEditGroup("Cover Image Path","input",o.CoverImage||"","edit-cover"),p=this.pict.AppData.ContentEditor.CurrentFile;if(p){let t=document.createElement("button");t.className="retold-remote-collections-edit-btn",t.textContent="Use current file",t.style.marginTop="4px",t.style.fontSize="0.72rem",t.onclick=()=>{let t=document.getElementById("retold-remote-edit-cover");t&&(t.value=p)},c.appendChild(t)}d.appendChild(c),d.appendChild(this._createEditGroup("Tags (comma-separated)","input",(o.Tags||[]).join(", "),"edit-tags"));let h=document.createElement("div");h.className="retold-remote-collections-edit-actions";let u=document.createElement("button");u.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-primary",u.textContent="Save",u.onclick=()=>{let t=document.getElementById("retold-remote-edit-name"),e=document.getElementById("retold-remote-edit-description"),r=document.getElementById("retold-remote-edit-cover"),s=document.getElementById("retold-remote-edit-tags"),a={GUID:o.GUID,Name:t?t.value:o.Name,Description:e?e.value:o.Description,CoverImage:r?r.value:o.CoverImage,Tags:s?s.value.split(",").map(t=>t.trim()).filter(t=>t):o.Tags};i.updateCollection(a,t=>{if(!t){n.CollectionsPanelMode="detail",i.fetchCollection(o.GUID);let t=i._getToast();t&&t.show("Collection saved")}})};let m=document.createElement("button");m.className="retold-remote-collections-edit-btn",m.textContent="Cancel",m.onclick=()=>{n.CollectionsPanelMode="detail",e.renderContent()},h.appendChild(u),h.appendChild(m),d.appendChild(h);let f=document.createElement("button");f.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-danger",f.textContent="Delete Collection",f.onclick=()=>{confirm("Delete this collection? This cannot be undone.")&&i.deleteCollection(o.GUID)},d.appendChild(f),l.appendChild(d),t.appendChild(l)}_createEditGroup(t,e,n,i){let o=document.createElement("div");o.className="retold-remote-collections-edit-group";let r,s=document.createElement("div");return s.className="retold-remote-collections-edit-label",s.textContent=t,"textarea"===e?(r=document.createElement("textarea"),r.className="retold-remote-collections-edit-textarea"):(r=document.createElement("input"),r.className="retold-remote-collections-edit-input",r.type="text"),r.value=n,r.id="retold-remote-"+i,o.appendChild(s),o.appendChild(r),o}_getTypeIcon(t,e){switch(t){case"folder":case"folder-contents":return"📁";case"subfile":return"🗄";case"image-crop":return"✂";case"video-clip":case"video-frame":return"🎬"}switch(e){case"image":return"🖼";case"video":return"🎬";case"audio":return"🎵";default:return"📄"}}}r.default_configuration=o,e.exports=r},{"pict-view":76}],131:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-Gallery",DefaultRenderable:"RetoldRemote-Gallery-Grid",DefaultDestinationAddress:"#RetoldRemote-Gallery-Container",AutoRender:!1,CSS:'\n\t\t.retold-remote-gallery-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tmargin-bottom: 8px;\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.retold-remote-gallery-filter\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.retold-remote-gallery-filter-btn\n\t\t{\n\t\t\tpadding: 3px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-gallery-filter-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tborder-color: var(--retold-scrollbar-hover);\n\t\t}\n\t\t.retold-remote-gallery-filter-btn.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t.retold-remote-gallery-filter-toggle\n\t\t{\n\t\t\tposition: relative;\n\t\t}\n\t\t.retold-remote-gallery-filter-toggle.has-filters\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-gallery-filter-count\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tmin-width: 14px;\n\t\t\theight: 14px;\n\t\t\tline-height: 14px;\n\t\t\tpadding: 0 3px;\n\t\t\tborder-radius: 7px;\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-tertiary);\n\t\t\tfont-size: 0.58rem;\n\t\t\tfont-weight: 700;\n\t\t\ttext-align: center;\n\t\t\tmargin-left: 4px;\n\t\t}\n\t\t/* Sort dropdown */\n\t\t.retold-remote-gallery-sort\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t\t.retold-remote-gallery-sort-select\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-gallery-sort-select:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-gallery-search\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmax-width: 300px;\n\t\t\tpadding: 4px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-gallery-search:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-gallery-search::placeholder\n\t\t{\n\t\t\tcolor: var(--retold-text-placeholder);\n\t\t}\n\t\t.retold-remote-gallery-search-options\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-gallery-search-option\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 3px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tcursor: pointer;\n\t\t\twhite-space: nowrap;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.retold-remote-gallery-search-option:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-gallery-search-option input[type="checkbox"]\n\t\t{\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t\taccent-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-gallery-search-option.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-gallery-search-regex-error\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: #e06c75;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t/* Filter chips */\n\t\t.retold-remote-filter-chips\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 6px;\n\t\t\tmargin-bottom: 8px;\n\t\t\talign-items: center;\n\t\t}\n\t\t.retold-remote-filter-chip\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tpadding: 2px 8px;\n\t\t\tborder: 1px solid var(--retold-border-light);\n\t\t\tborder-radius: 12px;\n\t\t\tbackground: rgba(128, 128, 128, 0.08);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.68rem;\n\t\t}\n\t\t.retold-remote-filter-chip-remove\n\t\t{\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.82rem;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0 2px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.retold-remote-filter-chip-remove:hover\n\t\t{\n\t\t\tcolor: var(--retold-danger);\n\t\t}\n\t\t.retold-remote-filter-chip-clear\n\t\t{\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.68rem;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 2px 4px;\n\t\t}\n\t\t.retold-remote-filter-chip-clear:hover\n\t\t{\n\t\t\tcolor: var(--retold-danger);\n\t\t}\n\t\t/* Filter panel */\n\t\t.retold-remote-filter-panel\n\t\t{\n\t\t\tmargin-bottom: 12px;\n\t\t\tpadding: 12px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 6px;\n\t\t\tbackground: var(--retold-bg-panel);\n\t\t}\n\t\t.retold-remote-filter-panel-grid\n\t\t{\n\t\t\tdisplay: grid;\n\t\t\tgrid-template-columns: 1fr 1fr;\n\t\t\tgap: 12px 24px;\n\t\t}\n\t\t.retold-remote-filter-section\n\t\t{\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.retold-remote-filter-section-title\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.retold-remote-filter-ext-list\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 2px 10px;\n\t\t}\n\t\t.retold-remote-filter-ext-item\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.retold-remote-filter-ext-item input\n\t\t{\n\t\t\taccent-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-filter-ext-count\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.65rem;\n\t\t}\n\t\t.retold-remote-filter-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.retold-remote-filter-input\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.72rem;\n\t\t\twidth: 100px;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-filter-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-filter-label\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.68rem;\n\t\t}\n\t\t.retold-remote-filter-actions\n\t\t{\n\t\t\tgrid-column: 1 / -1;\n\t\t\tdisplay: flex;\n\t\t\tgap: 8px;\n\t\t\talign-items: center;\n\t\t\tpadding-top: 8px;\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tmargin-top: 8px;\n\t\t}\n\t\t.retold-remote-filter-preset-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 6px;\n\t\t\talign-items: center;\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.retold-remote-filter-preset-select\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.72rem;\n\t\t\tmin-width: 100px;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-filter-preset-input\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.72rem;\n\t\t\twidth: 120px;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-filter-preset-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-filter-btn-sm\n\t\t{\n\t\t\tpadding: 2px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.68rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-filter-btn-sm:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tborder-color: var(--retold-scrollbar-hover);\n\t\t}\n\t\t/* Grid layout */\n\t\t.retold-remote-grid\n\t\t{\n\t\t\tdisplay: grid;\n\t\t\tgap: 12px;\n\t\t}\n\t\t.retold-remote-grid.size-small\n\t\t{\n\t\t\tgrid-template-columns: repeat(auto-fill, minmax(120px, 1fr));\n\t\t}\n\t\t.retold-remote-grid.size-medium\n\t\t{\n\t\t\tgrid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n\t\t}\n\t\t.retold-remote-grid.size-large\n\t\t{\n\t\t\tgrid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n\t\t}\n\t\t/* Tile */\n\t\t.retold-remote-tile\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder: 2px solid transparent;\n\t\t\tborder-radius: 6px;\n\t\t\tcursor: pointer;\n\t\t\toverflow: hidden;\n\t\t\ttransition: border-color 0.15s, transform 0.1s;\n\t\t}\n\t\t.retold-remote-tile:hover\n\t\t{\n\t\t\tborder-color: var(--retold-border-light);\n\t\t}\n\t\t.retold-remote-tile.selected\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbox-shadow: 0 0 0 1px rgba(128, 128, 128, 0.3);\n\t\t}\n\t\t.retold-remote-tile-thumb\n\t\t{\n\t\t\tposition: relative;\n\t\t\twidth: 100%;\n\t\t\tpadding-bottom: 75%; /* 4:3 aspect ratio */\n\t\t\tbackground: var(--retold-bg-thumb);\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.retold-remote-tile-thumb img\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tobject-fit: cover;\n\t\t}\n\t\t.retold-remote-tile-thumb-icon\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: var(--retold-text-placeholder);\n\t\t}\n\t\t.retold-remote-tile-badge\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 6px;\n\t\t\tright: 6px;\n\t\t\tpadding: 1px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.6rem;\n\t\t\tfont-weight: 700;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t}\n\t\t.retold-remote-tile-badge-image { background: rgba(102, 194, 184, 0.8); color: #fff; }\n\t\t.retold-remote-tile-badge-video { background: rgba(180, 102, 194, 0.8); color: #fff; }\n\t\t.retold-remote-tile-badge-audio { background: rgba(194, 160, 102, 0.8); color: #fff; }\n\t\t.retold-remote-tile-badge-document { background: rgba(194, 102, 102, 0.8); color: #fff; }\n\t\t.retold-remote-tile-badge-folder { background: rgba(102, 140, 194, 0.8); color: #fff; }\n\t\t.retold-remote-tile-duration\n\t\t{\n\t\t\tposition: absolute;\n\t\t\tbottom: 6px;\n\t\t\tright: 6px;\n\t\t\tpadding: 1px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: rgba(0, 0, 0, 0.7);\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-tile-label\n\t\t{\n\t\t\tpadding: 6px 8px 2px 8px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-tile-meta\n\t\t{\n\t\t\tpadding: 0 8px 6px 8px;\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t/* List mode */\n\t\t.retold-remote-list\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 2px;\n\t\t}\n\t\t.retold-remote-list-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 6px 10px;\n\t\t\tborder-radius: 4px;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.retold-remote-list-row:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t}\n\t\t.retold-remote-list-row.selected\n\t\t{\n\t\t\tbackground: var(--retold-bg-selected);\n\t\t}\n\t\t.retold-remote-list-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 24px;\n\t\t\ttext-align: center;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-list-name\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-list-ext\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 42px;\n\t\t\ttext-align: right;\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\ttext-transform: uppercase;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-list-size\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 56px;\n\t\t\ttext-align: right;\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-list-date\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 72px;\n\t\t\ttext-align: right;\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t/* Long-press tooltip */\n\t\t.retold-remote-longpress-tooltip\n\t\t{\n\t\t\tposition: fixed;\n\t\t\tz-index: 10000;\n\t\t\tmax-width: 80vw;\n\t\t\tpadding: 6px 12px;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tword-break: break-all;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t/* Column toggle buttons in filter panel */\n\t\t.retold-remote-filter-col-toggles\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.retold-remote-filter-col-toggle\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tpadding: 3px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.retold-remote-filter-col-toggle:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tborder-color: var(--retold-scrollbar-hover);\n\t\t}\n\t\t.retold-remote-filter-col-toggle.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t/* Empty state */\n\t\t.retold-remote-empty\n\t\t{\n\t\t\ttext-align: center;\n\t\t\tpadding: 60px 20px;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-empty-icon\n\t\t{\n\t\t\tfont-size: 3rem;\n\t\t\tmargin-bottom: 12px;\n\t\t}\n\t\t/* Help panel flyout */\n\t\t#RetoldRemote-Help-Panel\n\t\t{\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tz-index: 9999;\n\t\t}\n\t\t.retold-remote-help-backdrop\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground: rgba(0, 0, 0, 0.5);\n\t\t\tdisplay: flex;\n\t\t\talign-items: flex-start;\n\t\t\tjustify-content: flex-end;\n\t\t}\n\t\t.retold-remote-help-flyout\n\t\t{\n\t\t\twidth: 340px;\n\t\t\tmax-height: calc(100vh - 32px);\n\t\t\tmargin: 16px;\n\t\t\tbackground: var(--retold-bg-panel);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 8px;\n\t\t\toverflow-y: auto;\n\t\t\tbox-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);\n\t\t\tanimation: retold-help-slide-in 0.15s ease-out;\n\t\t}\n\t\t@keyframes retold-help-slide-in\n\t\t{\n\t\t\tfrom { transform: translateX(20px); opacity: 0; }\n\t\t\tto { transform: translateX(0); opacity: 1; }\n\t\t}\n\t\t.retold-remote-help-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 14px 16px 10px 16px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t}\n\t\t.retold-remote-help-title\n\t\t{\n\t\t\tfont-size: 0.88rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-help-close\n\t\t{\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 1.2rem;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0 4px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.retold-remote-help-close:hover\n\t\t{\n\t\t\tcolor: var(--retold-danger);\n\t\t}\n\t\t.retold-remote-help-section\n\t\t{\n\t\t\tpadding: 12px 16px 8px 16px;\n\t\t}\n\t\t.retold-remote-help-section + .retold-remote-help-section\n\t\t{\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t}\n\t\t.retold-remote-help-section-title\n\t\t{\n\t\t\tfont-size: 0.65rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-accent);\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.8px;\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.retold-remote-help-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 3px 0;\n\t\t}\n\t\t.retold-remote-help-key\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tmin-width: 72px;\n\t\t\tpadding: 2px 8px;\n\t\t\tborder: 1px solid var(--retold-border-light);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: rgba(255, 255, 255, 0.04);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-family: var(--retold-font-mono, monospace);\n\t\t\tfont-size: 0.72rem;\n\t\t\ttext-align: center;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-help-desc\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.74rem;\n\t\t}\n\t\t.retold-remote-help-footer\n\t\t{\n\t\t\tpadding: 10px 16px;\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-help-footer strong\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t',Templates:[],Renderables:[]};class r extends i{constructor(t,e,n){super(t,e,n),this._intersectionObserver=null}renderGallery(){let t=document.getElementById("RetoldRemote-Gallery-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,n=e.GalleryItems||[],i=e.ViewMode||"list",o=e.ThumbnailSize||"medium",r=e.GalleryCursorIndex||0,s=document.getElementById("RetoldRemote-Gallery-Search"),a=s&&document.activeElement===s,l=a?s.selectionStart:0,d=a?s.selectionEnd:0,c=this._buildHeaderHTML(e.FilterState?e.FilterState.MediaType:"all");if(c+=this._buildFilterPanelHTML(),c+=this._buildFilterChipsHTML(),0===n.length){c+='<div class="retold-remote-empty">';let e=this.pict.providers["RetoldRemote-Icons"];if(c+='<div class="retold-remote-empty-icon"><span class="retold-remote-icon retold-remote-icon-xl">'+(e?e.getIcon("gallery-empty",96):"")+"</span></div>",c+="<div>Empty folder</div>",c+="</div>",t.innerHTML=c,a){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&(t.focus(),t.setSelectionRange(l,d))}return}if(c+="gallery"===i?this._buildGridHTML(n,o,r):this._buildListHTML(n,r),t.innerHTML=c,a){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&(t.focus(),t.setSelectionRange(l,d))}this._setupLazyLoading();let p=this.pict.providers["RetoldRemote-GalleryNavigation"];p&&p.recalculateColumns();let h=this.pict.views["ContentEditor-TopBar"];h&&h.updateFilterIcon&&h.updateFilterIcon()}_buildHeaderHTML(t){let e=this.pict.AppData.RetoldRemote;if(!e.FilterBarVisible)return"";let n=[{key:"all",label:"All"},{key:"images",label:"Images"},{key:"video",label:"Video"},{key:"audio",label:"Audio"},{key:"documents",label:"Docs"}],i='<div class="retold-remote-gallery-header">';i+='<div class="retold-remote-gallery-filter">';for(let e=0;e<n.length;e++){let o=n[e];i+='<button class="retold-remote-gallery-filter-btn'+(o.key===t?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].setFilter('"+o.key+"')\">"+o.label+"</button>"}i+="</div>",i+='<div class="retold-remote-gallery-sort">',i+='<select class="retold-remote-gallery-sort-select" id="RetoldRemote-Gallery-Sort" onchange="pict.views[\'RetoldRemote-Gallery\'].onSortChange(this.value)">';let o=[{value:"folder-first:asc",label:"Folders first"},{value:"name:asc",label:"Name A–Z"},{value:"name:desc",label:"Name Z–A"},{value:"modified:desc",label:"Newest modified"},{value:"modified:asc",label:"Oldest modified"},{value:"created:desc",label:"Newest created"},{value:"created:asc",label:"Oldest created"}],r=(e.SortField||"folder-first")+":"+(e.SortDirection||"asc");for(let t=0;t<o.length;t++){let e=o[t].value===r?" selected":"";i+='<option value="'+o[t].value+'"'+e+">"+o[t].label+"</option>"}i+="</select>",i+="</div>";let s=this.pict.providers["RetoldRemote-GalleryFilterSort"],a=s?s.getActiveFilterChips().length:0;i+='<button class="retold-remote-gallery-filter-btn retold-remote-gallery-filter-toggle'+(a>0?" has-filters":"")+'" onclick="pict.views[\'RetoldRemote-Gallery\'].toggleFilterPanel()">⚙ Filters',a>0&&(i+='<span class="retold-remote-gallery-filter-count">'+a+"</span>"),i+="</button>";let l=e.SearchQuery||"";i+='<input type="text" class="retold-remote-gallery-search" id="RetoldRemote-Gallery-Search" placeholder="Search files... (/)" value="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l)+'" oninput="pict.views[\'RetoldRemote-Gallery\'].onSearchInput(this.value)">';let d=e.SearchCaseSensitive||!1,c=e.SearchRegex||!1;return i+='<div class="retold-remote-gallery-search-options">',i+='<label class="retold-remote-gallery-search-option'+(d?" active":"")+'"><input type="checkbox" '+(d?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchCaseSensitiveChange(this.checked)\">Aa</label>",i+='<label class="retold-remote-gallery-search-option'+(c?" active":"")+'"><input type="checkbox" '+(c?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchRegexChange(this.checked)\">.*</label>",e._searchRegexError&&(i+='<span class="retold-remote-gallery-search-regex-error" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e._searchRegexError)+'">invalid regex</span>'),i+="</div>",i+="</div>",i}_buildFilterPanelHTML(){let t=this.pict.AppData.RetoldRemote;if(!t.FilterPanelOpen)return"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"],n=e?e.getAvailableExtensions():[],i=t.FilterState||{},o='<div class="retold-remote-filter-panel">';o+='<div class="retold-remote-filter-panel-grid">',o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">File Type</div>',o+='<div class="retold-remote-filter-ext-list">';let r=i.Extensions||[];for(let t=0;t<n.length;t++){let e=n[t];o+='<label class="retold-remote-filter-ext-item">',o+='<input type="checkbox" '+(0===r.length||r.indexOf(e.ext)>=0?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onExtensionToggle('"+e.ext+"', this.checked)\">",o+=" ."+e.ext+' <span class="retold-remote-filter-ext-count">('+e.count+")</span>",o+="</label>"}return o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">File Size</div>',o+='<div class="retold-remote-filter-row">',o+='<input type="number" class="retold-remote-filter-input" placeholder="Min KB" value="'+(null!==i.SizeMin&&void 0!==i.SizeMin?Math.round(i.SizeMin/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('min', this.value)\">",o+='<span class="retold-remote-filter-label">to</span>',o+='<input type="number" class="retold-remote-filter-input" placeholder="Max KB" value="'+(null!==i.SizeMax&&void 0!==i.SizeMax?Math.round(i.SizeMax/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('max', this.value)\">",o+='<span class="retold-remote-filter-label">KB</span>',o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">Modified Date</div>',o+='<div class="retold-remote-filter-row">',o+='<input type="date" class="retold-remote-filter-input" value="'+(i.DateModifiedAfter||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedAfter', this.value)\">",o+='<span class="retold-remote-filter-label">to</span>',o+='<input type="date" class="retold-remote-filter-input" value="'+(i.DateModifiedBefore||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedBefore', this.value)\">",o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">List Columns</div>',o+='<div class="retold-remote-filter-col-toggles">',o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowExtension?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowExtension')\">Ext</button>",o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowSize?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowSize')\">Size</button>",o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowDate?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowDate')\">Date</button>",o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">Presets</div>',o+=this._buildPresetControlsHTML(),o+="</div>",o+='<div class="retold-remote-filter-actions">',o+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear All Filters</button>',o+="</div>",o+="</div>",o+="</div>",o}_buildPresetControlsHTML(){let t=this.pict.AppData.RetoldRemote.FilterPresets||[],e='<div class="retold-remote-filter-preset-row">';if(t.length>0){e+='<select class="retold-remote-filter-preset-select" id="RetoldRemote-Filter-PresetSelect" onchange="pict.views[\'RetoldRemote-Gallery\'].loadFilterPreset(this.value)">',e+='<option value="">Load preset...</option>';for(let n=0;n<t.length;n++)e+='<option value="'+n+'">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t[n].Name)+"</option>";e+="</select>",e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].deleteSelectedPreset()">✕</button>'}return e+='<input type="text" class="retold-remote-filter-preset-input" id="RetoldRemote-Filter-PresetName" placeholder="Preset name...">',e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].saveFilterPreset()">Save</button>',e+="</div>",e}_buildFilterChipsHTML(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(!t)return"";let e=t.getActiveFilterChips();if(0===e.length)return"";let n='<div class="retold-remote-filter-chips">';for(let t=0;t<e.length;t++){let i=e[t];n+='<span class="retold-remote-filter-chip">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.label)+" <button class=\"retold-remote-filter-chip-remove\" onclick=\"pict.views['RetoldRemote-Gallery'].removeFilterChip('"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.key)+"')\">&times;</button></span>"}return n+='<button class="retold-remote-filter-chip-clear" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear all</button>',n+="</div>",n}_buildGridHTML(t,e,n){let i='<div class="retold-remote-grid size-'+e+'">',o=this.pict.providers["RetoldRemote-Provider"],r=this.pict.providers["RetoldRemote-Icons"];for(let e=0;e<t.length;e++){let s=t[e],a=e===n?" selected":"",l=(s.Extension||"").toLowerCase(),d=this._getCategory(l,s.Type);if(i+='<div class="retold-remote-tile'+a+'" data-index="'+e+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+e+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+e+')">',i+='<div class="retold-remote-tile-thumb">',"folder"===s.Type)i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("folder",48):"")+"</span></div>",i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Folder</span>';else if("archive"===s.Type)i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-archive",48):"")+"</span></div>",i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Archive</span>';else if("image"===d&&o){let t=o.getThumbnailURL(s.Path,400,300);i+=t?'<img data-src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-image",48):"")+"</span></div>",i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-image">'+l+"</span>"}else if("video"===d){if(o){let t=o.getThumbnailURL(s.Path,400,300);i+=t?'<img data-src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-video",48):"")+"</span></div>"}else i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-video",48):"")+"</span></div>";i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-video">Video</span>'}else"audio"===d?(i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-audio",48):"")+"</span></div>",i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-audio">Audio</span>'):"document"===d?(i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIconForEntry(s,48):"")+"</span></div>",i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-document">'+l+"</span>"):i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIconForEntry(s,48):"")+"</span></div>";i+="</div>",i+='<div class="retold-remote-tile-label" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+"</div>","file"===s.Type&&void 0!==s.Size?i+='<div class="retold-remote-tile-meta">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(s.Size)+"</div>":"folder"===s.Type?i+='<div class="retold-remote-tile-meta">Folder</div>':"archive"===s.Type&&(i+='<div class="retold-remote-tile-meta">Archive'+(s.Size?" · "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(s.Size):"")+"</div>"),i+="</div>"}return i+="</div>",i}_buildListHTML(t,e){let n=this.pict.AppData.RetoldRemote,i=!1!==n.ListShowExtension,o=!1!==n.ListShowSize,r=!1!==n.ListShowDate,s='<div class="retold-remote-list">',a=this.pict.providers["RetoldRemote-Icons"];for(let n=0;n<t.length;n++){let l=t[n],d=n===e?" selected":"",c="";if(a&&(c='<span class="retold-remote-icon retold-remote-icon-sm">'+a.getIconForEntry(l,16)+"</span>"),s+='<div class="retold-remote-list-row'+d+'" data-index="'+n+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+n+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+n+')">',s+='<div class="retold-remote-list-icon">'+c+"</div>",s+='<div class="retold-remote-list-name" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name)+"\" ontouchstart=\"pict.views['RetoldRemote-Gallery']._onNameTouchStart(event, '"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name).replace(/'/g,"\\&#39;")+"')\" ontouchend=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\" ontouchcancel=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\">"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name)+"</div>",i){let t="";"file"===l.Type||"archive"===l.Type?t=(l.Extension||"").replace(/^\./,"").toLowerCase():"folder"===l.Type&&(t=""),s+='<div class="retold-remote-list-ext">'+t+"</div>"}o&&("file"!==l.Type&&"archive"!==l.Type||void 0===l.Size?s+='<div class="retold-remote-list-size"></div>':s+='<div class="retold-remote-list-size">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(l.Size)+"</div>"),r&&(l.Modified?s+='<div class="retold-remote-list-date">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatShortDate(l.Modified)+"</div>":s+='<div class="retold-remote-list-date"></div>'),s+="</div>"}return s+="</div>",s}_setupLazyLoading(){this._intersectionObserver&&this._intersectionObserver.disconnect();let t=document.querySelectorAll(".retold-remote-tile-thumb img[data-src]");if(0!==t.length){this._intersectionObserver=new IntersectionObserver(t=>{for(let e=0;e<t.length;e++)if(t[e].isIntersecting){let n=t[e].target;n.src=n.getAttribute("data-src"),n.removeAttribute("data-src"),this._intersectionObserver.unobserve(n)}},{rootMargin:"200px"});for(let e=0;e<t.length;e++)this._intersectionObserver.observe(t[e])}}onTileClick(t){let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.moveCursor(t)}onTileDoubleClick(t){this.pict.AppData.RetoldRemote.GalleryCursorIndex=t;let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.openCurrent()}setFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState.MediaType=t;let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];n&&n.applyFilterSort()}onSearchInput(t){this.pict.AppData.RetoldRemote.SearchQuery=t||"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchCaseSensitiveChange(t){this.pict.AppData.RetoldRemote.SearchCaseSensitive=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchRegexChange(t){this.pict.AppData.RetoldRemote.SearchRegex=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSortChange(t){let e=t.split(":"),n=this.pict.AppData.RetoldRemote;n.SortField=e[0],n.SortDirection=e[1]||"asc";let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}toggleFilterPanel(){let t=this.pict.AppData.RetoldRemote;t.FilterPanelOpen=!t.FilterPanelOpen,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}onExtensionToggle(t,e){let n=this.pict.AppData.RetoldRemote.FilterState,i=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e)n.Extensions.length>0&&n.Extensions.push(t);else if(0===n.Extensions.length&&i){let e=i.getAvailableExtensions();n.Extensions=e.map(t=>t.ext).filter(e=>e!==t)}else n.Extensions=n.Extensions.filter(e=>e!==t);i&&i.applyFilterSort()}onSizeFilterChange(t,e){let n=this.pict.AppData.RetoldRemote.FilterState,i=e&&""!==e?1024*parseInt(e,10):null;"min"===t?n.SizeMin=i:n.SizeMax=i;let o=this.pict.providers["RetoldRemote-GalleryFilterSort"];o&&o.applyFilterSort()}onDateFilterChange(t,e){this.pict.AppData.RetoldRemote.FilterState[t]=e||null;let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];n&&n.applyFilterSort()}removeFilterChip(t){let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.removeFilter(t),e.applyFilterSort())}clearAllFilters(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];t&&(t.clearAllFilters(),t.applyFilterSort())}saveFilterPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetName");if(!t||!t.value.trim())return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.savePreset(t.value.trim()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}loadFilterPreset(t){if(""===t||null==t)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.loadPreset(parseInt(t,10)),e.applyFilterSort()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}deleteSelectedPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetSelect");if(!t||""===t.value)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.deletePreset(parseInt(t.value,10)),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}toggleListColumn(t){let e=this.pict.AppData.RetoldRemote,n=e[t];e[t]=!1===n,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}_onNameTouchStart(t,e){let n=this;this._clearLongPressTimer(),this._longPressTimer=setTimeout(function(){n._showLongPressTooltip(t,e)},500)}_onNameTouchEnd(t){this._clearLongPressTimer(),this._hideLongPressTooltip()}_clearLongPressTimer(){this._longPressTimer&&(clearTimeout(this._longPressTimer),this._longPressTimer=null)}_showLongPressTooltip(t,e){this._hideLongPressTooltip();let n=document.createElement("div");n.className="retold-remote-longpress-tooltip",n.textContent=e;let i=t.touches&&t.touches[0];i&&(n.style.left=Math.min(i.clientX,window.innerWidth-20)+"px",n.style.top=i.clientY-50+"px"),document.body.appendChild(n),this._longPressTooltipEl=n,t.preventDefault()}_hideLongPressTooltip(){this._longPressTooltipEl&&(this._longPressTooltipEl.parentNode&&this._longPressTooltipEl.parentNode.removeChild(this._longPressTooltipEl),this._longPressTooltipEl=null)}_getCategory(t,e){if("folder"===e)return"folder";if("archive"===e)return"archive";let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(n)return n.getCategory(t);let i=(t||"").replace(/^\./,"").toLowerCase();return"png"===i||"jpg"===i||"jpeg"===i||"gif"===i||"webp"===i?"image":"mp4"===i||"webm"===i||"mov"===i?"video":"mp3"===i||"wav"===i||"ogg"===i?"audio":"pdf"===i?"document":"other"}}r.default_configuration=o,e.exports=r},{"pict-view":76}],132:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-ImageViewer",DefaultRenderable:"RetoldRemote-ImageViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:"\n\t\t#RetoldRemote-ImageViewer-Img\n\t\t{\n\t\t\timage-orientation: from-image;\n\t\t\ttransition: width 0.15s ease, height 0.15s ease;\n\t\t\tdisplay: block;\n\t\t}\n\t\t.retold-remote-fit-indicator\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\tbackground: rgba(0, 0, 0, 0.7);\n\t\t\tcolor: #fff;\n\t\t\tpadding: 8px 18px;\n\t\t\tborder-radius: 6px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tpointer-events: none;\n\t\t\tz-index: 20;\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.3s ease;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-fit-indicator.visible\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t"};class r extends i{constructor(t,e,n){super(t,e,n),this._zoomLevel=1,this._naturalWidth=0,this._naturalHeight=0,this._resizeHandler=null}initImage(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t)return;this._naturalWidth=t.naturalWidth,this._naturalHeight=t.naturalHeight,this._zoomLevel=1,this._applyDisplay(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler);let e=this,n=null;this._resizeHandler=function(){clearTimeout(n),n=setTimeout(function(){e._applyDisplay()},100)},window.addEventListener("resize",this._resizeHandler)}_getFitMode(){return this.pict.AppData.RetoldRemote.ImageFitMode||"auto"}setFitMode(t){this.pict.AppData.RetoldRemote.ImageFitMode=t,this._zoomLevel=1,this._applyDisplay(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}cycleFitMode(){let t;switch(this._getFitMode()){case"fit":t="auto";break;case"auto":t="original";break;default:t="fit"}this.setFitMode(t),this._showFitModeIndicator(t)}toggleZoom(){this._naturalWidth&&(1===this._zoomLevel?this._zoomLevel=2:this._zoomLevel=1,this._applyDisplay())}zoomIn(){this._zoomLevel=Math.min(1.25*this._zoomLevel,8),this._applyDisplay()}zoomOut(){this._zoomLevel=Math.max(this._zoomLevel/1.25,.25),this._applyDisplay()}zoomReset(){this._zoomLevel=1,this._applyDisplay()}_applyDisplay(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t||!this._naturalWidth)return;let e=t.parentElement;if(!e)return;let n=this._getBaseSize(e),i=Math.round(n.width*this._zoomLevel),o=Math.round(n.height*this._zoomLevel);t.style.maxWidth="none",t.style.maxHeight="none",t.style.objectFit="",t.style.width=i+"px",t.style.height=o+"px",t.style.transform="",this._zoomLevel>1||i>e.clientWidth||o>e.clientHeight?t.style.cursor="zoom-out":t.style.cursor="zoom-in"}_getBaseSize(t){let e=this._naturalWidth,n=this._naturalHeight,i=t.clientWidth,o=t.clientHeight;if(!i||!o)return{width:e,height:n};let r=e/n;switch(this._getFitMode()){case"fit":{let t=i,e=i/r;return e>o&&(e=o,t=o*r),{width:t,height:e}}case"auto":{if(e<=i&&n<=o)return{width:e,height:n};let t=i,s=i/r;return s>o&&(s=o,t=o*r),{width:t,height:s}}default:return{width:e,height:n}}}_showFitModeIndicator(t){let e={fit:"Fit to Window",auto:"Original if Smaller",original:"Original Size"}[t]||t;this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator(e,1200)}cleanup(){this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null)}}r.default_configuration=o,e.exports=r},{"pict-view":76}],133:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"RetoldRemote-Layout-Shell",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:"\n\t\t#ContentEditor-Application-Container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\theight: 100dvh;\n\t\t\tbackground: var(--retold-bg-primary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tfont-family: var(--retold-font-family, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif);\n\t\t}\n\t\t#ContentEditor-TopBar-Container\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-body\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t/* Sidebar */\n\t\t.content-editor-sidebar-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tposition: relative;\n\t\t\ttransition: width 0.2s ease;\n\t\t}\n\t\t.content-editor-sidebar-inner\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-sidebar-tabs\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t}\n\t\t.content-editor-sidebar-tab\n\t\t{\n\t\t\tflex: 1;\n\t\t\tpadding: 7px 0;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.content-editor-sidebar-tab:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.content-editor-sidebar-tab.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-bottom-color: var(--retold-accent);\n\t\t}\n\t\t.content-editor-sidebar-pane\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t}\n\t\t/* Collapsed state */\n\t\t.content-editor-sidebar-wrap.collapsed\n\t\t{\n\t\t\twidth: 0 !important;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-inner\n\t\t{\n\t\t\tvisibility: hidden;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-resize-handle\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Resize handle */\n\t\t.content-editor-resize-handle\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 5px;\n\t\t\tcursor: col-resize;\n\t\t\tbackground: transparent;\n\t\t\tborder-right: 1px solid var(--retold-border);\n\t\t\ttransition: background 0.15s;\n\t\t}\n\t\t.content-editor-resize-handle:hover,\n\t\t.content-editor-resize-handle.dragging\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tborder-right-color: var(--retold-accent);\n\t\t}\n\t\t/* File browser overrides for sidebar */\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser\n\t\t{\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-browse-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-view-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-modified,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-modified\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-header\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Hide the ugly white + button from the breadcrumb bar */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-breadcrumb-addfolder\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Subtle add-folder button at bottom of file list */\n\t\t.retold-remote-sidebar-addfolder\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tpadding: 8px 12px;\n\t\t\tmargin-top: 4px;\n\t\t\tborder: 1px dashed var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-family: inherit;\n\t\t\tcursor: pointer;\n\t\t\ttext-align: center;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t}\n\t\t.retold-remote-sidebar-addfolder:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tborder-color: var(--retold-text-dim);\n\t\t\tbackground: rgba(128, 128, 128, 0.06);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tborder-bottom-color: var(--retold-border);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row.selected\n\t\t{\n\t\t\tbackground: var(--retold-bg-selected);\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row.sidebar-focused\n\t\t{\n\t\t\toutline: 2px solid var(--retold-accent);\n\t\t\toutline-offset: -2px;\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.content-editor-sidebar-inner.keyboard-focused\n\t\t{\n\t\t\tbox-shadow: inset 0 0 0 1px var(--retold-accent);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-breadcrumb-bar\n\t\t{\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom-color: var(--retold-border);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-breadcrumbs\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tbackground: transparent;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-breadcrumb-link\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t/* Insert button: hidden by default, visible on row hover for ALL files */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tpadding: 1px 6px;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-insert-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row:hover .pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t}\n\t\t/* Main content area */\n\t\t#RetoldRemote-Content-Container\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tposition: relative;\n\t\t}\n\t\t#RetoldRemote-Gallery-Container\n\t\t{\n\t\t\tpadding: 12px;\n\t\t\tmin-height: 100%;\n\t\t}\n\t\t#RetoldRemote-Viewer-Container\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tbackground: var(--retold-bg-viewer);\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Also hide the editor container from the parent */\n\t\t#ContentEditor-Editor-Container\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t/* ============================================================\n\t\t MOBILE: Sidebar becomes a top drawer\n\t\t ============================================================ */\n\t\t@media (max-width: 600px)\n\t\t{\n\t\t\t.content-editor-body\n\t\t\t{\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t/* Sidebar becomes a top section with a height instead of width */\n\t\t\t.content-editor-sidebar-wrap\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\theight: 33vh;\n\t\t\t\theight: 33dvh;\n\t\t\t\ttransition: height 0.2s ease;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.content-editor-sidebar-wrap.collapsed\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\theight: 0 !important;\n\t\t\t}\n\n\t\t\t/* Resize handle becomes horizontal bar at the bottom of the drawer */\n\t\t\t.content-editor-resize-handle\n\t\t\t{\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 8px;\n\t\t\t\tcursor: row-resize;\n\t\t\t\tborder-right: none;\n\t\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\n\t\t\t.content-editor-resize-handle::after\n\t\t\t{\n\t\t\t\tcontent: '';\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 36px;\n\t\t\t\theight: 3px;\n\t\t\t\tborder-radius: 2px;\n\t\t\t\tbackground: var(--retold-text-placeholder);\n\t\t\t\topacity: 0.5;\n\t\t\t}\n\n\t\t\t.content-editor-resize-handle:hover::after,\n\t\t\t.content-editor-resize-handle.dragging::after\n\t\t\t{\n\t\t\t\tbackground: var(--retold-accent);\n\t\t\t\topacity: 1;\n\t\t\t}\n\n\t\t\t/* Sidebar inner fills the drawer */\n\t\t\t.content-editor-sidebar-inner\n\t\t\t{\n\t\t\t\tflex: 1;\n\t\t\t\tmin-height: 0;\n\t\t\t}\n\n\t\t\t/* Content takes remaining space */\n\t\t\t#RetoldRemote-Content-Container\n\t\t\t{\n\t\t\t\tflex: 1;\n\t\t\t\tmin-height: 0;\n\t\t\t}\n\n\t\t\t/* Collections panel: hide in mobile */\n\t\t\t.retold-remote-collections-wrap\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\n\t\t/* ---- Right-side Collections Panel ---- */\n\t\t.retold-remote-collections-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tposition: relative;\n\t\t\ttransition: width 0.2s ease;\n\t\t\tborder-left: 1px solid var(--retold-border);\n\t\t}\n\t\t.retold-remote-collections-wrap.collapsed\n\t\t{\n\t\t\twidth: 0 !important;\n\t\t\tborder-left: none;\n\t\t}\n\t\t.retold-remote-collections-wrap.collapsed .retold-remote-collections-inner\n\t\t{\n\t\t\tvisibility: hidden;\n\t\t}\n\t\t.retold-remote-collections-wrap.collapsed .retold-remote-collections-resize-handle\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.retold-remote-collections-inner\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t\tbackground: var(--retold-bg-primary);\n\t\t}\n\t\t.retold-remote-collections-resize-handle\n\t\t{\n\t\t\tposition: absolute;\n\t\t\tleft: 0;\n\t\t\ttop: 0;\n\t\t\tbottom: 0;\n\t\t\twidth: 5px;\n\t\t\tcursor: col-resize;\n\t\t\tz-index: 10;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.retold-remote-collections-resize-handle:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\topacity: 0.3;\n\t\t}\n\t",Templates:[{Hash:"RetoldRemote-Layout-Shell",Template:'\n\t\t\t\t<div id="ContentEditor-TopBar-Container"></div>\n\t\t\t\t<div class="content-editor-body">\n\t\t\t\t\t<div class="content-editor-sidebar-wrap" style="width: 250px;">\n\t\t\t\t\t\t<div class="content-editor-sidebar-inner">\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab active" data-tab="files" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="settings" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'settings\')">Settings</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="files" id="ContentEditor-Sidebar-Container"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="settings" id="RetoldRemote-Settings-Container" style="display:none"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="content-editor-resize-handle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id="RetoldRemote-Content-Container">\n\t\t\t\t\t\t<div id="RetoldRemote-Gallery-Container"></div>\n\t\t\t\t\t\t<div id="RetoldRemote-Viewer-Container"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="retold-remote-collections-wrap collapsed" id="RetoldRemote-Collections-Wrap" style="width: 300px;">\n\t\t\t\t\t\t<div class="retold-remote-collections-resize-handle"></div>\n\t\t\t\t\t\t<div class="retold-remote-collections-inner">\n\t\t\t\t\t\t\t<div id="RetoldRemote-Collections-Container"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-Layout-Shell",TemplateHash:"RetoldRemote-Layout-Shell",DestinationAddress:"#ContentEditor-Application-Container"}]};class r extends i{constructor(t,e,n){super(t,e,n),this._sidebarDragging=!1,this._collectionsDragging=!1}onAfterRender(){super.onAfterRender(),this.pict.CSSMap.injectCSS(),this._setupResizeHandle();let t=this.pict.AppData.RetoldRemote;if(t&&t.SidebarCollapsed){let t=document.querySelector(".content-editor-sidebar-wrap");t&&t.classList.add("collapsed")}if(!this.isMobileDrawer()&&t&&t.SidebarWidth){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.width=t.SidebarWidth+"px")}if(this.isMobileDrawer()&&t&&t.SidebarDrawerHeight){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.height=t.SidebarDrawerHeight+"px")}if(t&&t.CollectionsPanelOpen){let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&(e.classList.remove("collapsed"),t.CollectionsPanelWidth&&(e.style.width=t.CollectionsPanelWidth+"px"))}this._setupCollectionsResizeHandle();let e=this;window.addEventListener("hashchange",()=>{e.pict.PictApplication.resolveHash()})}isMobileDrawer(){return window.innerWidth<=600}toggleSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t)return;t.classList.toggle("collapsed");let e=this.pict.AppData.RetoldRemote,n=t.classList.contains("collapsed");if(e.SidebarCollapsed=n,!n)if(this.isMobileDrawer()){let n=e.SidebarDrawerHeight||Math.round(.33*window.innerHeight);t.style.height=n+"px"}else e.SidebarWidth&&(t.style.width=e.SidebarWidth+"px");this.pict.PictApplication.saveSettings();let i=this.pict.providers["RetoldRemote-GalleryNavigation"];i&&setTimeout(()=>i.recalculateColumns(),250)}switchSidebarTab(t){if(document.querySelectorAll(".content-editor-sidebar-tab").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-tab")===t)}),document.querySelectorAll(".content-editor-sidebar-pane").forEach(e=>{e.style.display=e.getAttribute("data-pane")===t?"":"none"}),"settings"===t){let t=this.pict.views["RetoldRemote-SettingsPanel"];t&&t.render()}}_setupResizeHandle(){let t=this,e=document.querySelector(".content-editor-resize-handle"),n=document.querySelector(".content-editor-sidebar-wrap");if(!e||!n)return;let i=0,o=0,r=0,s=0;function a(t){return t.touches&&t.touches.length>0?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}}function l(l){t._sidebarDragging=!0;let p=a(l);i=p.x,o=p.y,r=n.offsetWidth,s=n.offsetHeight,e.classList.add("dragging"),document.addEventListener("mousemove",d),document.addEventListener("mouseup",c),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("touchend",c),l.preventDefault()}function d(e){if(!t._sidebarDragging)return;let l=a(e);if(t.isMobileDrawer()){let t=s+(l.y-o),e=Math.round(.7*window.innerHeight);t=Math.max(80,Math.min(t,e)),n.style.height=t+"px"}else{let t=r+(l.x-i);t=Math.max(150,Math.min(t,600)),n.style.width=t+"px"}e.preventDefault()}function c(){t._sidebarDragging=!1,e.classList.remove("dragging"),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",d),document.removeEventListener("touchend",c);let i=t.pict.AppData.RetoldRemote;t.isMobileDrawer()?i.SidebarDrawerHeight=n.offsetHeight:i.SidebarWidth=n.offsetWidth,t.pict.PictApplication.saveSettings();let o=t.pict.providers["RetoldRemote-GalleryNavigation"];o&&o.recalculateColumns()}e.addEventListener("mousedown",l),e.addEventListener("touchstart",l,{passive:!1}),e.addEventListener("dblclick",function(e){e.preventDefault(),t.toggleSidebar()})}toggleCollectionsPanel(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}_setupCollectionsResizeHandle(){let t=document.querySelector(".retold-remote-collections-resize-handle"),e=document.getElementById("RetoldRemote-Collections-Wrap");if(!t||!e)return;let n=this,i=0,o=0;function r(r){if(e.classList.contains("collapsed"))return;r.preventDefault(),n._collectionsDragging=!0,t.classList.add("dragging");let l=r.touches?r.touches[0].clientX:r.clientX;i=l,o=e.getBoundingClientRect().width,document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",a)}function s(t){if(!n._collectionsDragging)return;t.preventDefault();let r=t.touches?t.touches[0].clientX:t.clientX,s=i-r,a=Math.max(150,Math.min(600,o+s));e.style.width=a+"px"}function a(){if(!n._collectionsDragging)return;n._collectionsDragging=!1,t.classList.remove("dragging"),n.pict.AppData.RetoldRemote.CollectionsPanelWidth=e.getBoundingClientRect().width,n.pict.PictApplication.saveSettings(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",a);let i=n.pict.providers["RetoldRemote-GalleryNavigation"];i&&"function"==typeof i.recalculateColumns&&i.recalculateColumns()}t.addEventListener("mousedown",r),t.addEventListener("touchstart",r,{passive:!1}),t.addEventListener("dblclick",function(t){t.preventDefault(),n.toggleCollectionsPanel()})}}r.default_configuration=o,e.exports=r},{"pict-view":76}],134:[function(t,e,n){const i=t("pict-view"),o=t("pict-section-code"),r={ViewIdentifier:"RetoldRemote-MediaViewer",DefaultRenderable:"RetoldRemote-MediaViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:"\n\t\t.retold-remote-viewer\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t}\n\t\t.retold-remote-viewer-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tz-index: 5;\n\t\t}\n\t\t.retold-remote-viewer-nav-btn\n\t\t{\n\t\t\tpadding: 4px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.8rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-viewer-nav-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-viewer-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-viewer-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\toverflow: auto;\n\t\t\tposition: relative;\n\t\t}\n\t\t/* File info overlay */\n\t\t.retold-remote-fileinfo-overlay\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 48px;\n\t\t\tright: 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 16px;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tz-index: 10;\n\t\t\tmin-width: 200px;\n\t\t\tdisplay: none;\n\t\t}\n\t\t.retold-remote-fileinfo-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 3px 0;\n\t\t}\n\t\t.retold-remote-fileinfo-label\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-fileinfo-value\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t/* Code viewer container */\n\t\t.retold-remote-code-viewer-container\n\t\t{\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.retold-remote-code-viewer-loading\n\t\t{\n\t\t\tpadding: 16px 20px;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-style: italic;\n\t\t\tfont-size: 0.82rem;\n\t\t}\n\t\t/* pict-section-code dark theme overrides */\n\t\t.retold-remote-code-viewer-container .pict-code-editor-wrap\n\t\t{\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\theight: 100%;\n\t\t\tfont-family: var(--retold-font-mono, 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace);\n\t\t\tfont-size: 0.82rem;\n\t\t\tline-height: 1.6;\n\t\t}\n\t\t.retold-remote-code-viewer-container .pict-code-line-numbers\n\t\t{\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-right: 1px solid var(--retold-border);\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.78rem;\n\t\t\tline-height: 1.6;\n\t\t\tpadding: 10px 0;\n\t\t}\n\t\t.retold-remote-code-viewer-container .pict-code-editor\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tpadding: 10px 10px 10px 12px;\n\t\t\ttab-size: 4;\n\t\t\t-moz-tab-size: 4;\n\t\t\tcaret-color: var(--retold-accent);\n\t\t\tborder-radius: 0;\n\t\t}\n\t\t/* Syntax highlighting colors for dark themes */\n\t\t.retold-remote-code-viewer-container .pict-code-editor .keyword { color: #C678DD; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .string { color: #98C379; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .number { color: #D19A66; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .comment { color: #5C6370; font-style: italic; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .operator { color: #56B6C2; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .punctuation { color: #ABB2BF; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .function-name { color: #61AFEF; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .property { color: #E06C75; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .tag { color: #E06C75; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .attr-name { color: #D19A66; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .attr-value { color: #98C379; }\n\t\t/* Video wrap with stats bar */\n\t\t.retold-remote-video-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 100%;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\t.retold-remote-video-wrap video\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: calc(100% - 40px);\n\t\t\tobject-fit: contain;\n\t\t}\n\t\t.retold-remote-video-stats\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 16px;\n\t\t\tpadding: 6px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\twidth: 100%;\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\twhite-space: nowrap;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.retold-remote-video-stats span\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.retold-remote-video-stats .retold-remote-video-stat-label\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-video-stats .retold-remote-video-stat-value\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-explore-btn\n\t\t{\n\t\t\tmargin-left: auto;\n\t\t\tpadding: 3px 12px;\n\t\t\tborder: 1px solid var(--retold-accent);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-explore-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-primary);\n\t\t}\n\t\t.retold-remote-vlc-btn\n\t\t{\n\t\t\tpadding: 3px 12px;\n\t\t\tborder: 1px solid var(--retold-accent);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-vlc-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-primary);\n\t\t}\n\t\t/* Video action menu */\n\t\t.retold-remote-video-action-menu\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 12px;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\t.retold-remote-video-action-menu-title\n\t\t{\n\t\t\tfont-size: 0.85rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tmargin-bottom: 4px;\n\t\t\ttext-align: center;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmax-width: 80%;\n\t\t}\n\t\t.retold-remote-video-action-thumb-wrap\n\t\t{\n\t\t\tmargin-bottom: 4px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-video-action-thumb-wrap img\n\t\t{\n\t\t\tmax-width: 640px;\n\t\t\tmax-height: 360px;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tobject-fit: contain;\n\t\t\tbackground: var(--retold-bg-primary);\n\t\t}\n\t\t.retold-remote-video-action-thumb-wrap .retold-remote-video-action-thumb-loading\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-style: italic;\n\t\t\tpadding: 8px;\n\t\t}\n\t\t.retold-remote-video-action-btn\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 12px 24px;\n\t\t\tmin-width: 280px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 6px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.85rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color 0.15s, color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\ttext-align: left;\n\t\t}\n\t\t.retold-remote-video-action-btn:hover,\n\t\t.retold-remote-video-action-btn.selected\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t}\n\t\t.retold-remote-video-action-key\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 2px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-primary);\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-family: var(--retold-font-mono, monospace);\n\t\t\tmin-width: 24px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t/* Ebook reader */\n\t\t.retold-remote-ebook-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tposition: relative;\n\t\t}\n\t\t.retold-remote-ebook-toc\n\t\t{\n\t\t\twidth: 240px;\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-right: 1px solid var(--retold-border);\n\t\t\toverflow-y: auto;\n\t\t\tfont-size: 0.78rem;\n\t\t\tpadding: 8px 0;\n\t\t}\n\t\t.retold-remote-ebook-toc.collapsed\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.retold-remote-ebook-toc-item\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tpadding: 6px 16px;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s, color 0.1s;\n\t\t\tborder: none;\n\t\t\tbackground: none;\n\t\t\twidth: 100%;\n\t\t\ttext-align: left;\n\t\t\tfont-family: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.retold-remote-ebook-toc-item:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-ebook-toc-item.indent-1\n\t\t{\n\t\t\tpadding-left: 32px;\n\t\t}\n\t\t.retold-remote-ebook-toc-item.indent-2\n\t\t{\n\t\t\tpadding-left: 48px;\n\t\t}\n\t\t.retold-remote-ebook-reader\n\t\t{\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tmin-width: 0;\n\t\t\tposition: relative;\n\t\t}\n\t\t.retold-remote-ebook-content\n\t\t{\n\t\t\tflex: 1;\n\t\t\tposition: relative;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.retold-remote-ebook-content iframe\n\t\t{\n\t\t\tborder: none;\n\t\t}\n\t\t.retold-remote-ebook-controls\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 16px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-ebook-page-btn\n\t\t{\n\t\t\tpadding: 6px 20px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.82rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-ebook-page-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-ebook-toc-btn\n\t\t{\n\t\t\tpadding: 6px 12px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-ebook-toc-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-ebook-loading\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\theight: 100%;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.85rem;\n\t\t}\n\t\t/* Distraction-free toggle */\n\t\t.retold-remote-df-toggle\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 8px;\n\t\t\tleft: 8px;\n\t\t\tz-index: 15;\n\t\t\tpadding: 4px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: rgba(0, 0, 0, 0.5);\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.2s ease, color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-viewer-body:hover .retold-remote-df-toggle,\n\t\t.retold-remote-df-toggle:focus\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.retold-remote-df-toggle:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-df-toggle.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t/* Distraction-free exit hotspot (top-left corner) */\n\t\t.retold-remote-df-exit-hotspot\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 80px;\n\t\t\theight: 80px;\n\t\t\tz-index: 16;\n\t\t\tcursor: pointer;\n\t\t\tdisplay: none;\n\t\t}\n\t\t.retold-remote-df-exit-hotspot::after\n\t\t{\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: 12px;\n\t\t\tleft: 12px;\n\t\t\twidth: 8px;\n\t\t\theight: 8px;\n\t\t\tborder-radius: 50%;\n\t\t\tbackground: var(--retold-accent);\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.3s ease;\n\t\t}\n\t\t.retold-remote-df-exit-hotspot:hover::after\n\t\t{\n\t\t\topacity: 0.6;\n\t\t}\n\t"};class s extends i{constructor(t,e,n){super(t,e,n),this._swipeStartX=0,this._swipeStartY=0,this._swipeTouchCount=0,this._swipeHandlers=null,this._dfExitHandlers=null}showMedia(t,e){let n=this.pict.AppData.RetoldRemote;n.ActiveMode="viewer",n.CurrentViewerFile=t,n.CurrentViewerMediaType=e,n.VideoMenuActive="video"===e;let i=document.getElementById("RetoldRemote-Gallery-Container"),o=document.getElementById("RetoldRemote-Viewer-Container");i&&(i.style.display="none"),o&&(o.style.display="block");let r=t.replace(/^.*\//,""),s=this.pict.providers["RetoldRemote-Provider"],a=s?s.getContentURL(t):"/content/"+encodeURIComponent(t),l='<div class="retold-remote-viewer">';switch(l+='<div class="retold-remote-viewer-header">',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].closeViewer()" title="Back (Esc)">&larr; Back</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].prevFile()" title="Previous (k)">&lsaquo; Prev</button>',l+='<div class="retold-remote-viewer-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(r)+"</div>",l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].nextFile()" title="Next (j)">Next &rsaquo;</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFileInfo()" title="Info (i)">&#9432;</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFullscreen()" title="Fullscreen (f)">&#9634;</button>',l+="</div>",l+='<div class="retold-remote-viewer-body">',l+='<button class="retold-remote-df-toggle'+(n._distractionFreeMode?" active":"")+'" id="RetoldRemote-DF-Toggle" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleDistractionFree()" title="Distraction-Free (d)">&#9673; DF</button>',l+='<div class="retold-remote-df-exit-hotspot" id="RetoldRemote-DF-ExitHotspot"'+(n._distractionFreeMode?"":' style="display:none"')+"></div>",e){case"image":l+=this._buildImageHTML(a,r);break;case"video":l+=this._buildVideoHTML(a,r);break;case"audio":l+=this._buildAudioHTML(a,r);break;case"text":l+=this._buildTextHTML(a,r,t);break;case"document":l+=this._buildDocumentHTML(a,r,t);break;default:l+=this._buildFallbackHTML(a,r)}if(l+='<div class="retold-remote-fileinfo-overlay" id="RetoldRemote-FileInfo-Overlay">',l+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Loading...</span></div>',l+="</div>",l+="</div>",l+="</div>",o&&(o.innerHTML=l),this._loadFileInfo(t),"text"===e&&this._loadCodeViewer(a,t),"document"===e){let e=t.replace(/^.*\./,"").toLowerCase();"epub"!==e&&"mobi"!==e||this._loadEbookViewer(a,t)}this._setupSwipeNavigation(),this._setupDFExitHotspot();let d=this.pict.views["ContentEditor-TopBar"];d&&d.updateInfo()}_setupSwipeNavigation(){this._cleanupSwipe();let t=document.querySelector(".retold-remote-viewer-body");if(!t)return;let e=this,n=function(t){e._swipeTouchCount=t.touches.length,1===t.touches.length&&(e._swipeStartX=t.touches[0].clientX,e._swipeStartY=t.touches[0].clientY)},i=function(t){if(1!==e._swipeTouchCount)return;let n=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY,o=n-e._swipeStartX,r=i-e._swipeStartY;if(Math.abs(o)<50||Math.abs(r)>Math.abs(o))return;let s=document.querySelector(".retold-remote-viewer-body");if(s&&s.scrollWidth>s.clientWidth+2)return;let a=e.pict.providers["RetoldRemote-GalleryNavigation"];a&&(o<0?a.nextFile():a.prevFile())};t.addEventListener("touchstart",n,{passive:!0}),t.addEventListener("touchend",i,{passive:!0}),this._swipeHandlers={element:t,touchstart:n,touchend:i}}_cleanupSwipe(){this._swipeHandlers&&(this._swipeHandlers.element.removeEventListener("touchstart",this._swipeHandlers.touchstart),this._swipeHandlers.element.removeEventListener("touchend",this._swipeHandlers.touchend),this._swipeHandlers=null)}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree(),this._updateDFControls()}_updateDFControls(){let t=this.pict.AppData.RetoldRemote._distractionFreeMode||!1,e=document.getElementById("RetoldRemote-DF-Toggle");e&&(t?e.classList.add("active"):e.classList.remove("active"));let n=document.getElementById("RetoldRemote-DF-ExitHotspot");n&&(n.style.display=t?"":"none")}_setupDFExitHotspot(){this._cleanupDFExitHotspot();let t=document.getElementById("RetoldRemote-DF-ExitHotspot");if(!t)return;let e=this,n=function(){e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree()},i=0,o=function(t){let n=Date.now();if(n-i<300){t.preventDefault(),e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree(),i=0}else i=n};t.addEventListener("dblclick",n),t.addEventListener("touchend",o),this._dfExitHandlers={element:t,dblclick:n,touchend:o}}_cleanupDFExitHotspot(){this._dfExitHandlers&&(this._dfExitHandlers.element.removeEventListener("dblclick",this._dfExitHandlers.dblclick),this._dfExitHandlers.element.removeEventListener("touchend",this._dfExitHandlers.touchend),this._dfExitHandlers=null)}_buildImageHTML(t,e){return'<img src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'" style="max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;" id="RetoldRemote-ImageViewer-Img" onload="pict.views[\'RetoldRemote-ImageViewer\'].initImage()" onclick="pict.views[\'RetoldRemote-ImageViewer\'].toggleZoom()">'}_buildVideoHTML(t,e){let n=this.pict.AppData.RetoldRemote.ServerCapabilities||{},i=(this.pict.AppData.RetoldRemote.CurrentViewerFile,'<div class="retold-remote-video-action-menu" id="RetoldRemote-VideoActionMenu">');return i+='<div class="retold-remote-video-action-menu-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div>",n.ffmpeg&&(i+='<div id="RetoldRemote-VideoActionThumb" class="retold-remote-video-action-thumb-wrap"></div>',setTimeout(()=>{this.loadVideoMenuFrame()},0)),n.ffmpeg&&(i+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video"><span class="retold-remote-video-action-key">e</span>Explore Video Frames</button>'),i+='<button class="retold-remote-video-action-btn selected" onclick="pict.views[\'RetoldRemote-MediaViewer\'].playVideo()" title="Play video in browser"><span class="retold-remote-video-action-key">Space</span>Play in Browser</button>',n.ffmpeg&&(i+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].loadVideoMenuFrame()" title="Extract a frame from the midpoint of this video"><span class="retold-remote-video-action-key">t</span>Thumbnail</button>'),i+='<button class="retold-remote-video-action-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device"><span class="retold-remote-video-action-key">v</span>Stream with VLC</button>',i+="</div>",i}playVideo(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;e.replace(/^.*\//,"");let n=this.pict.providers["RetoldRemote-Provider"],i=n?n.getContentURL(e):"/content/"+encodeURIComponent(e),o=t.ServerCapabilities||{},r='<div class="retold-remote-video-wrap">';r+="<video controls"+(t.AutoplayVideo?" autoplay":"")+' preload="metadata" id="RetoldRemote-VideoPlayer"><source src="'+i+'">Your browser does not support the video tag.</video>',r+='<div class="retold-remote-video-stats" id="RetoldRemote-VideoStats">',r+='<span class="retold-remote-video-stat-label">Loading info...</span>',o.ffmpeg&&(r+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video">Explore Video</button>'),r+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device">Stream with VLC</button>',r+="</div>",r+="</div>";let s=document.getElementById("RetoldRemote-VideoActionMenu");s&&(s.outerHTML=r),t.VideoMenuActive=!1}loadVideoMenuFrame(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;let n=document.getElementById("RetoldRemote-VideoActionThumb");if(!n)return;n.innerHTML='<div class="retold-remote-video-action-thumb-loading">Extracting frame...</div>';let i=this.pict.providers["RetoldRemote-Provider"],o=i?i._getPathParam(e):encodeURIComponent(e);fetch("/api/media/video-frames?path="+o+"&count=1").then(t=>t.json()).then(n=>{if(t.CurrentViewerFile!==e)return;let i=document.getElementById("RetoldRemote-VideoActionThumb");if(i)if(n&&n.Frames&&n.Frames.length>0){let t=n.Frames[0],o="/api/media/video-frame/"+n.CacheKey+"/"+t.Filename;i.innerHTML='<img src="'+o+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e.replace(/^.*\//,""))+'" onerror="this.parentNode.innerHTML=\'\'">'}else i.innerHTML=""}).catch(()=>{let t=document.getElementById("RetoldRemote-VideoActionThumb");t&&(t.innerHTML="")})}_buildAudioHTML(t,e){let n=this.pict.providers["RetoldRemote-Icons"],i='<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(n?'<span class="retold-remote-icon retold-remote-icon-lg">'+n.getIcon("music-note",64)+"</span>":"&#127925;")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div><audio controls"+(this.pict.AppData.RetoldRemote.AutoplayAudio?" autoplay":"")+' preload="metadata" id="RetoldRemote-AudioPlayer" style="width: 100%; max-width: 500px;"><source src="'+t+'">Your browser does not support the audio tag.</audio>';i+='<div style="margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;">';let o=this.pict.AppData.RetoldRemote.ServerCapabilities||{};return(o.ffprobe||o.ffmpeg)&&(i+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore waveform and extract segments from this audio">Explore Audio</button>'),i+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device (v)">Stream with VLC</button>',i+="</div>",i+="</div>",i}_buildDocumentHTML(t,e,n){let i=n.replace(/^.*\./,"").toLowerCase();if("pdf"===i)return'<iframe src="'+t+'" style="width: 100%; height: 100%; border: none;"></iframe>';if("epub"===i||"mobi"===i)return this._buildEbookHTML(t,e,n);let o=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(o?'<span class="retold-remote-icon retold-remote-icon-lg">'+o.getIcon("document-large",64)+"</span>":"&#128196;")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Open in new tab</a></div>'}_buildTextHTML(t,e,n){return'<div class="retold-remote-code-viewer-container" id="RetoldRemote-CodeViewer-Container"><div class="retold-remote-code-viewer-loading">Loading...</div></div>'}_getHighlightLanguage(t){if({js:!0,mjs:!0,cjs:!0,ts:!0,tsx:!0,jsx:!0}[t])return"javascript";if("json"===t)return"json";if({html:!0,htm:!0,xml:!0,svg:!0}[t])return"html";return{css:!0,scss:!0,sass:!0,less:!0}[t]?"css":"sql"===t?"sql":"javascript"}_loadCodeViewer(t,e){let n=this,i=e.replace(/^.*\./,"").toLowerCase();fetch(t).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.text()}).then(t=>{let e=document.getElementById("RetoldRemote-CodeViewer-Container");if(!e)return;let r=n._getHighlightLanguage(i);if(n._activeCodeJar&&(n._activeCodeJar.destroy(),n._activeCodeJar=null),"undefined"==typeof window||"function"!=typeof window.CodeJar){e.innerHTML='<div class="retold-remote-code-viewer-loading">CodeJar not loaded; showing plain text.</div>';let n=document.createElement("pre");return n.style.cssText="padding:16px 20px; margin:0; color:var(--retold-text-primary); font-family:monospace; white-space:pre; tab-size:4; overflow:auto; height:100%;",n.textContent=t,void e.appendChild(n)}e.innerHTML="";let s=document.createElement("div");s.className="pict-code-editor-wrap";let a=document.createElement("div");a.className="pict-code-line-numbers",s.appendChild(a);let l=document.createElement("div");l.className="pict-code-editor language-"+r,s.appendChild(l),e.appendChild(s);let d=o.createHighlighter(r);n._activeCodeJar=window.CodeJar(l,d,{tab:"\t",catchTab:!1,addClosing:!1}),l.style.whiteSpace="pre",l.style.overflowWrap="normal",n._activeCodeJar.updateCode(t),l.setAttribute("contenteditable","false");let c=t.split("\n").length,p="";for(let t=1;t<=c;t++)p+="<span>"+t+"</span>";a.innerHTML=p}).catch(t=>{let e=document.getElementById("RetoldRemote-CodeViewer-Container");e&&(e.innerHTML='<div class="retold-remote-code-viewer-loading">Failed to load file: '+t.message+"</div>")})}_buildEbookHTML(t,e,n){return'<div class="retold-remote-ebook-wrap"><div class="retold-remote-ebook-toc collapsed" id="RetoldRemote-EbookTOC"></div><div class="retold-remote-ebook-reader"><div class="retold-remote-ebook-content" id="RetoldRemote-EbookContent"><div class="retold-remote-ebook-loading">Loading ebook...</div></div><div class="retold-remote-ebook-controls"><button class="retold-remote-ebook-toc-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleEbookTOC()">&#9776; TOC</button><button class="retold-remote-ebook-page-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].ebookPrevPage()">&larr; Prev</button><button class="retold-remote-ebook-page-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].ebookNextPage()">Next &rarr;</button></div></div></div>'}_loadEbookViewer(t,e){let n=this;if("mobi"===e.replace(/^.*\./,"").toLowerCase()){if(!(this.pict.AppData.RetoldRemote.ServerCapabilities||{}).ebook_convert){let e=document.getElementById("RetoldRemote-EbookContent");return void(e&&(e.innerHTML='<div class="retold-remote-ebook-loading">MOBI viewing requires Calibre (ebook-convert) on the server.<br><a href="'+t+'" target="_blank" style="color: var(--retold-accent); margin-top: 12px; display: inline-block;">Download file</a></div>'))}let i=document.getElementById("RetoldRemote-EbookContent");i&&(i.innerHTML='<div class="retold-remote-ebook-loading">Converting MOBI to EPUB...</div>');let o=this.pict.providers["RetoldRemote-Provider"],r=o?o._getPathParam(e):encodeURIComponent(e);fetch("/api/media/ebook-convert?path="+r).then(t=>t.json()).then(t=>{if(!t||!t.Success)throw new Error(t?t.Error:"Conversion failed.");let e="/api/media/ebook/"+t.CacheKey+"/"+t.OutputFilename;n._renderEpub(e)}).catch(e=>{let i=document.getElementById("RetoldRemote-EbookContent");i&&(i.innerHTML='<div class="retold-remote-ebook-loading">Failed to convert: '+n.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e.message)+'<br><a href="'+t+'" target="_blank" style="color: var(--retold-accent); margin-top: 12px; display: inline-block;">Download file</a></div>')})}else this._renderEpub(t)}_renderEpub(t){let e=this;if("undefined"==typeof window||"function"!=typeof window.ePub){let t=document.getElementById("RetoldRemote-EbookContent");return void(t&&(t.innerHTML='<div class="retold-remote-ebook-loading">epub.js library not loaded.</div>'))}if(this._activeBook){try{this._activeBook.destroy()}catch(t){}this._activeBook=null,this._activeRendition=null}let n=document.getElementById("RetoldRemote-EbookContent");n&&(n.innerHTML="",fetch(t).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.arrayBuffer()}).then(t=>{let i=window.ePub(t);e._activeBook=i;let o=i.renderTo(n,{width:"100%",height:"100%",spread:"none"});e._activeRendition=o,o.display(),o.themes.default({body:{color:"var(--retold-text-primary, #d4d4d4)",background:"var(--retold-bg-primary, #1e1e1e)","font-family":'Georgia, "Times New Roman", serif',"line-height":"1.6",padding:"20px 40px"},a:{color:"var(--retold-accent, #569cd6)"}}),i.loaded.navigation.then(t=>{e._renderEbookTOC(t.toc)})}).catch(t=>{n&&(n.innerHTML='<div class="retold-remote-ebook-loading">Failed to load ebook: '+e.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.message)+"</div>")}))}_renderEbookTOC(t){let e=document.getElementById("RetoldRemote-EbookTOC");if(!e||!t)return;let n=this,i="",o=function(t,e){for(let r=0;r<t.length;r++){let s=t[r],a=e>0?" indent-"+Math.min(e,2):"";i+='<button class="retold-remote-ebook-toc-item'+a+'" data-href="'+n.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.href)+"\" onclick=\"pict.views['RetoldRemote-MediaViewer'].ebookGoToChapter(this.getAttribute('data-href'))\">"+n.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.label.trim())+"</button>",s.subitems&&s.subitems.length>0&&o(s.subitems,e+1)}};o(t,0),e.innerHTML=i}ebookGoToChapter(t){this._activeRendition&&t&&this._activeRendition.display(t)}ebookPrevPage(){this._activeRendition&&this._activeRendition.prev()}ebookNextPage(){this._activeRendition&&this._activeRendition.next()}toggleEbookTOC(){let t=document.getElementById("RetoldRemote-EbookTOC");t&&t.classList.toggle("collapsed")}_buildFallbackHTML(t,e){let n=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(n?'<span class="retold-remote-icon retold-remote-icon-lg">'+n.getIcon("document-large",64)+"</span>":"&#128196;")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Download / Open in new tab</a></div>'}_loadFileInfo(t){let e=this,n=this.pict.providers["RetoldRemote-Provider"];n&&n.fetchMediaProbe(t,(t,n)=>{if(!n)return;let i=document.getElementById("RetoldRemote-FileInfo-Overlay");if(i){let t="";if(void 0!==n.Size&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Size</span><span class="retold-remote-fileinfo-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(n.Size)+"</span></div>"),n.Width&&n.Height&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Dimensions</span><span class="retold-remote-fileinfo-value">'+n.Width+" x "+n.Height+"</span></div>"),n.Duration){let e=Math.floor(n.Duration/60),i=Math.floor(n.Duration%60);t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Duration</span><span class="retold-remote-fileinfo-value">'+e+":"+(i<10?"0":"")+i+"</span></div>"}n.Codec&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Codec</span><span class="retold-remote-fileinfo-value">'+n.Codec+"</span></div>"),n.Format&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Format</span><span class="retold-remote-fileinfo-value">'+n.Format+"</span></div>"),n.Modified&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Modified</span><span class="retold-remote-fileinfo-value">'+new Date(n.Modified).toLocaleString()+"</span></div>"),n.Path&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Path</span><span class="retold-remote-fileinfo-value">'+n.Path+"</span></div>"),i.innerHTML=t}let o=document.getElementById("RetoldRemote-VideoStats");if(o){let t="";if(n.Duration){let e=Math.floor(n.Duration/60),i=Math.floor(n.Duration%60);t+='<span><span class="retold-remote-video-stat-label">Duration</span> <span class="retold-remote-video-stat-value">'+e+":"+(i<10?"0":"")+i+"</span></span>"}if(n.Width&&n.Height&&(t+='<span><span class="retold-remote-video-stat-label">Resolution</span> <span class="retold-remote-video-stat-value">'+n.Width+"×"+n.Height+"</span></span>"),n.Codec&&(t+='<span><span class="retold-remote-video-stat-label">Codec</span> <span class="retold-remote-video-stat-value">'+n.Codec+"</span></span>"),n.Bitrate){let e,i=n.Bitrate;e=i>=1e6?(i/1e6).toFixed(1)+" Mbps":i>=1e3?Math.round(i/1e3)+" kbps":i+" bps",t+='<span><span class="retold-remote-video-stat-label">Bitrate</span> <span class="retold-remote-video-stat-value">'+e+"</span></span>"}void 0!==n.Size&&(t+='<span><span class="retold-remote-video-stat-label">Size</span> <span class="retold-remote-video-stat-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(n.Size)+"</span></span>");let i=o.querySelector(".retold-remote-explore-btn"),r=i?i.outerHTML:"",s=o.querySelector(".retold-remote-vlc-btn"),a=s?s.outerHTML:"";o.innerHTML=t+r+a}})}}s.default_configuration=r,e.exports=s},{"pict-section-code":49,"pict-view":76}],135:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-SettingsPanel",DefaultRenderable:"RetoldRemote-SettingsPanel",DefaultDestinationAddress:"#RetoldRemote-Settings-Container",AutoRender:!1,CSS:"\n\t\t.retold-remote-settings\n\t\t{\n\t\t\tpadding: 12px;\n\t\t}\n\t\t.retold-remote-settings-section\n\t\t{\n\t\t\tmargin-bottom: 16px;\n\t\t}\n\t\t.retold-remote-settings-section-title\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tfont-weight: 700;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.retold-remote-settings-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 4px 0;\n\t\t}\n\t\t.retold-remote-settings-label\n\t\t{\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-settings-select\n\t\t{\n\t\t\tpadding: 3px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-settings-checkbox\n\t\t{\n\t\t\taccent-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-settings-capabilities\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tpadding: 8px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.72rem;\n\t\t}\n\t\t.retold-remote-settings-cap-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 2px 0;\n\t\t}\n\t\t.retold-remote-settings-cap-label\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-settings-cap-yes\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-settings-cap-no\n\t\t{\n\t\t\tcolor: var(--retold-danger-muted);\n\t\t}\n\t\t.retold-remote-settings-vlc-btn\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tpadding: 8px 12px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-family: inherit;\n\t\t\tcursor: pointer;\n\t\t\ttext-align: left;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t}\n\t\t.retold-remote-settings-vlc-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-settings-input\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.retold-remote-settings-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-settings-input-row\n\t\t{\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.retold-remote-settings-input-label\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-bottom: 3px;\n\t\t}\n\t\t.retold-remote-settings-template-preview\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-top: 3px;\n\t\t\tfont-style: italic;\n\t\t\tword-break: break-all;\n\t\t}\n\t"};class r extends i{constructor(t,e,n){super(t,e,n)}onAfterRender(){super.onAfterRender(),this._renderSettingsContent()}_renderSettingsContent(){let t=document.getElementById("RetoldRemote-Settings-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,n=e.ServerCapabilities||{},i='<div class="retold-remote-settings">';i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">Appearance</div>',i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Theme</span>',i+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeTheme(this.value)">';let o=this.pict.providers["RetoldRemote-Theme"];if(o){let t=o.getThemeList(),e=o.getCurrentTheme(),n="";for(let o=0;o<t.length;o++){let r=t[o];r.category!==n&&(n&&(i+="</optgroup>"),i+='<optgroup label="'+r.category+'">',n=r.category),i+='<option value="'+r.key+'"'+(r.key===e?" selected":"")+">"+r.name+"</option>"}n&&(i+="</optgroup>")}i+="</select>",i+="</div>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">Gallery</div>',i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">View mode</span>',i+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ViewMode', this.value)\">",i+='<option value="gallery"'+("gallery"===e.ViewMode?" selected":"")+">Grid</option>",i+='<option value="list"'+("list"===e.ViewMode?" selected":"")+">List</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Thumbnail size</span>',i+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ThumbnailSize', this.value)\">",i+='<option value="small"'+("small"===e.ThumbnailSize?" selected":"")+">Small</option>",i+='<option value="medium"'+("medium"===e.ThumbnailSize?" selected":"")+">Medium</option>",i+='<option value="large"'+("large"===e.ThumbnailSize?" selected":"")+">Large</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Sort by</span>',i+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortField(this.value)">',i+='<option value="folder-first"'+("folder-first"===e.SortField?" selected":"")+">Folders first</option>",i+='<option value="name"'+("name"===e.SortField?" selected":"")+">Name</option>",i+='<option value="modified"'+("modified"===e.SortField?" selected":"")+">Modified</option>",i+='<option value="created"'+("created"===e.SortField?" selected":"")+">Created</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Sort direction</span>',i+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortDirection(this.value)">',i+='<option value="asc"'+("asc"===e.SortDirection?" selected":"")+">Ascending</option>",i+='<option value="desc"'+("desc"===e.SortDirection?" selected":"")+">Descending</option>",i+="</select>",i+="</div>";let r=e.FilterState&&e.FilterState.MediaType||"all";i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Media filter</span>',i+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeMediaFilter(this.value)">',i+='<option value="all"'+("all"===r?" selected":"")+">All files</option>",i+='<option value="images"'+("images"===r?" selected":"")+">Images</option>",i+='<option value="video"'+("video"===r?" selected":"")+">Video</option>",i+='<option value="audio"'+("audio"===r?" selected":"")+">Audio</option>",i+='<option value="documents"'+("documents"===r?" selected":"")+">Documents</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Show hidden files</span>',i+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.ShowHiddenFiles?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleHiddenFiles(this.checked)\">",i+="</div>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">Viewer</div>',i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Image fit mode</span>',i+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeImageFitMode(this.value)">',i+='<option value="fit"'+("fit"===e.ImageFitMode?" selected":"")+">Fit to window</option>",i+='<option value="auto"'+("auto"===e.ImageFitMode?" selected":"")+">Original if smaller</option>",i+='<option value="original"'+("original"===e.ImageFitMode?" selected":"")+">Original size</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Autoplay video</span>',i+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayVideo?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayVideo', this.checked)\">",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Autoplay audio</span>',i+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayAudio?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayAudio', this.checked)\">",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Nav bar in distraction-free</span>',i+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.DistractionFreeShowNav?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleDistractionFreeNav(this.checked)\">",i+="</div>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">Server Capabilities</div>',i+='<div class="retold-remote-settings-capabilities">';let s=[{key:"sharp",label:"Sharp (image thumbnails)"},{key:"imagemagick",label:"ImageMagick (image fallback)"},{key:"ffmpeg",label:"ffmpeg (video thumbnails)"},{key:"ffprobe",label:"ffprobe (media metadata)"}];for(let t=0;t<s.length;t++){let e=s[t],o=n[e.key];i+='<div class="retold-remote-settings-cap-row">',i+='<span class="retold-remote-settings-cap-label">'+e.label+"</span>",i+='<span class="'+(o?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(o?"Available":"Not found")+"</span>",i+="</div>"}i+='<div class="retold-remote-settings-cap-row" style="margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--retold-border);">',i+='<span class="retold-remote-settings-cap-label">Hashed filenames</span>',i+='<span class="'+(e.HashedFilenames?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(e.HashedFilenames?"Enabled":"Disabled")+"</span>",i+="</div>",i+="</div>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">AI File Sort</div>';let a=this.pict.providers["RetoldRemote-AISortManager"],l=e.AISortSettings||{AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"};i+='<div class="retold-remote-settings-input-row">',i+='<label class="retold-remote-settings-input-label">AI Endpoint URL</label>',i+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortEndpoint" value="'+this._escapeAttr(l.AIEndpoint)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIEndpoint\', this.value)" placeholder="http://localhost:11434">',i+="</div>",i+='<div class="retold-remote-settings-input-row">',i+='<label class="retold-remote-settings-input-label">Model</label>',i+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortModel" value="'+this._escapeAttr(l.AIModel)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIModel\', this.value)" placeholder="llama3.1">',i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Provider</span>',i+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeAISetting('AIProvider', this.value)\">",i+='<option value="ollama"'+("ollama"===l.AIProvider?" selected":"")+">Ollama</option>",i+='<option value="openai"'+("openai"===l.AIProvider?" selected":"")+">OpenAI-compatible</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-input-row" style="margin-top: 8px;">',i+='<label class="retold-remote-settings-input-label">Naming Template</label>',i+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortTemplate" value="'+this._escapeAttr(l.NamingTemplate)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'NamingTemplate\', this.value)" placeholder="{artist}/{album}/{track} - {title}">';let d=a?a.getTemplatePreview(l.NamingTemplate):"";d&&(i+='<div class="retold-remote-settings-template-preview">Preview: '+this._escapeHTML(d)+"</div>"),i+="</div>",i+='<button class="retold-remote-settings-vlc-btn" id="RetoldRemote-AISortTestBtn" onclick="pict.views[\'RetoldRemote-SettingsPanel\'].testAIConnection()" style="margin-top: 8px;">',i+="Test Connection",i+="</button>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">VLC Streaming</div>',i+='<button class="retold-remote-settings-vlc-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].openModal()">',i+="VLC Protocol Setup",i+="</button>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">Help</div>',i+='<button class="retold-remote-settings-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">',i+="Help (F1)",i+="</button>",i+="</div>",i+="</div>",t.innerHTML=i}changeTheme(t){let e=this.pict.providers["RetoldRemote-Theme"];e&&(e.applyTheme(t),this.pict.PictApplication.saveSettings(),this._renderSettingsContent())}changeSetting(t,e){let n=this.pict.AppData.RetoldRemote;if(n[t]=e,this.pict.PictApplication.saveSettings(),"gallery"===n.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}toggleHiddenFiles(t){this.pict.AppData.RetoldRemote.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings(),this.pict.PictApplication.syncHiddenFilesSetting(()=>{this.pict.PictApplication.loadFileList()})}toggleAutoplay(t,e){this.pict.AppData.RetoldRemote[t]=e,this.pict.PictApplication.saveSettings()}toggleDistractionFreeNav(t){let e=this.pict.AppData.RetoldRemote;if(e.DistractionFreeShowNav=t,this.pict.PictApplication.saveSettings(),e._distractionFreeMode){let e=document.querySelector(".retold-remote-viewer-header");e&&(e.style.display=t?"":"none")}}changeImageFitMode(t){let e=this.pict.views["RetoldRemote-ImageViewer"];if(e)e.setFitMode(t);else{this.pict.AppData.RetoldRemote.ImageFitMode=t,this.pict.PictApplication.saveSettings()}}changeSortField(t){this.pict.AppData.RetoldRemote.SortField=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeSortDirection(t){this.pict.AppData.RetoldRemote.SortDirection=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeMediaFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState&&(e.FilterState.MediaType=t),this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeAISetting(t,e){let n=this.pict.providers["RetoldRemote-AISortManager"];if(n){let i={};i[t]=e,n.updateSettings(i)}"NamingTemplate"===t&&this._renderSettingsContent()}testAIConnection(){let t=document.getElementById("RetoldRemote-AISortTestBtn");t&&(t.disabled=!0,t.textContent="Testing...");let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.testConnection()}_escapeAttr(t){return t?String(t).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):""}_escapeHTML(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):""}_refilterGallery(){let t=this.pict.AppData.RetoldRemote,e=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e&&e.runFilterPipeline(),"gallery"===t.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}}r.default_configuration=o,e.exports=r},{"pict-view":76}],136:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"RetoldRemote-TopBar",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"\n\t\t.retold-remote-topbar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\theight: 40px;\n\t\t\tpadding: 0 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tgap: 16px;\n\t\t}\n\t\t.retold-remote-topbar-sidebar-toggle\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tpadding: 0;\n\t\t\tmargin: 0;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 1rem;\n\t\t\tline-height: 1;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\t-webkit-tap-highlight-color: transparent;\n\t\t}\n\t\t.retold-remote-topbar-sidebar-toggle:hover,\n\t\t.retold-remote-topbar-sidebar-toggle:active,\n\t\t.retold-remote-topbar-df-toggle:hover,\n\t\t.retold-remote-topbar-df-toggle:active\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t.retold-remote-topbar-df-toggle\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tpadding: 0;\n\t\t\tmargin: 0;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 1rem;\n\t\t\tline-height: 1;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\t-webkit-tap-highlight-color: transparent;\n\t\t}\n\t\t.retold-remote-topbar-location\n\t\t{\n\t\t\tposition: relative;\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\twhite-space: nowrap;\n\t\t\ttext-align: center;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\toverflow: visible;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.retold-remote-topbar-location-inner\n\t\t{\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-topbar-location-crumb\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tcursor: pointer;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.retold-remote-topbar-location-crumb:hover\n\t\t{\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.retold-remote-topbar-home-crumb\n\t\t{\n\t\t\tcursor: pointer;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tvertical-align: middle;\n\t\t\topacity: 0.8;\n\t\t}\n\t\t.retold-remote-topbar-home-crumb:hover\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.retold-remote-topbar-sep\n\t\t{\n\t\t\tcolor: var(--retold-text-placeholder);\n\t\t\tmargin: 0 3px;\n\t\t}\n\t\t/* Breadcrumb overflow hamburger */\n\t\t.retold-remote-topbar-breadcrumb-overflow\n\t\t{\n\t\t\tposition: relative;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tvertical-align: middle;\n\t\t}\n\t\t.retold-remote-topbar-overflow-btn\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tpadding: 0;\n\t\t\tmargin: 0;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.9rem;\n\t\t\tline-height: 1;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\t-webkit-tap-highlight-color: transparent;\n\t\t}\n\t\t.retold-remote-topbar-overflow-btn:hover,\n\t\t.retold-remote-topbar-overflow-btn:active\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t.retold-remote-topbar-overflow-dropdown\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: absolute;\n\t\t\ttop: 100%;\n\t\t\tleft: 0;\n\t\t\tmargin-top: 4px;\n\t\t\tmin-width: 200px;\n\t\t\tmax-width: 300px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 6px;\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);\n\t\t\tz-index: 1000;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.retold-remote-topbar-overflow-dropdown.open\n\t\t{\n\t\t\tdisplay: block;\n\t\t}\n\t\t.retold-remote-topbar-overflow-item\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\twidth: 100%;\n\t\t\tpadding: 12px 16px;\n\t\t\tborder: none;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tfont-size: 0.9rem;\n\t\t\ttext-align: left;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t\t-webkit-tap-highlight-color: transparent;\n\t\t\tmin-height: 44px;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.retold-remote-topbar-overflow-item:last-child\n\t\t{\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.retold-remote-topbar-overflow-item:hover,\n\t\t.retold-remote-topbar-overflow-item:active\n\t\t{\n\t\t\tbackground: rgba(128, 128, 128, 0.12);\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-topbar-overflow-item-icon\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tflex-shrink: 0;\n\t\t\topacity: 0.7;\n\t\t}\n\t\t.retold-remote-topbar-overflow-item-label\n\t\t{\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-topbar-info\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-topbar-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.retold-remote-topbar-btn\n\t\t{\n\t\t\tpadding: 4px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-topbar-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-topbar-addcoll-btn\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t}\n\t\t.retold-remote-topbar-collections-btn.panel-open\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t/* Add-to-collection dropdown */\n\t\t.retold-remote-addcoll-dropdown\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 100%;\n\t\t\tright: 0;\n\t\t\tmargin-top: 4px;\n\t\t\tmin-width: 220px;\n\t\t\tmax-width: 320px;\n\t\t\tmax-height: 300px;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 6px;\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);\n\t\t\tz-index: 1000;\n\t\t}\n\t\t.retold-remote-addcoll-dropdown-item\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\twidth: 100%;\n\t\t\tpadding: 10px 14px;\n\t\t\tborder: none;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tfont-size: 0.82rem;\n\t\t\ttext-align: left;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.retold-remote-addcoll-dropdown-item:last-child\n\t\t{\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.retold-remote-addcoll-dropdown-item:hover\n\t\t{\n\t\t\tbackground: rgba(128, 128, 128, 0.12);\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-addcoll-dropdown-new\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.retold-remote-topbar-filter-btn\n\t\t{\n\t\t\tposition: relative;\n\t\t\tpadding: 4px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.82rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.retold-remote-topbar-filter-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-topbar-filter-btn.filter-active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t.retold-remote-topbar-filter-btn.filter-bar-open\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-text-muted);\n\t\t\tbackground: rgba(128, 128, 128, 0.06);\n\t\t}\n\t\t.retold-remote-topbar-aisort-btn\n\t\t{\n\t\t\tpadding: 4px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-topbar-aisort-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t.retold-remote-topbar-aisort-btn.generating\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcursor: wait;\n\t\t}\n\t\t.retold-remote-topbar-filter-badge\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: -4px;\n\t\t\tright: -4px;\n\t\t\tmin-width: 14px;\n\t\t\theight: 14px;\n\t\t\tline-height: 14px;\n\t\t\tpadding: 0 3px;\n\t\t\tborder-radius: 7px;\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-tertiary);\n\t\t\tfont-size: 0.55rem;\n\t\t\tfont-weight: 700;\n\t\t\ttext-align: center;\n\t\t}\n\t",Templates:[{Hash:"RetoldRemote-TopBar",Template:'\n\t\t\t\t<div class="retold-remote-topbar">\n\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle" id="RetoldRemote-TopBar-SidebarToggle" onclick="pict.views[\'ContentEditor-Layout\'].toggleSidebar()" title="Toggle Sidebar"></button>\n\t\t\t\t\t<button class="retold-remote-topbar-df-toggle" id="RetoldRemote-TopBar-DFToggle" onclick="pict.views[\'ContentEditor-TopBar\'].toggleDistractionFree()" title="Distraction-free mode (d)"></button>\n\t\t\t\t\t<div class="retold-remote-topbar-location" id="RetoldRemote-TopBar-Location"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-info" id="RetoldRemote-TopBar-Info"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-actions">\n\t\t\t\t\t\t<button class="retold-remote-topbar-aisort-btn" id="RetoldRemote-TopBar-AISortBtn" onclick="pict.views[\'ContentEditor-TopBar\'].triggerAISort()" title="AI Sort (generate sort plan for current folder)" style="display:none;">AI Sort</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-addcoll-btn" id="RetoldRemote-TopBar-AddToCollectionBtn" onclick="pict.views[\'ContentEditor-TopBar\'].addToCollection(event)" title="Add to collection">+&#9733;</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle retold-remote-topbar-collections-btn" id="RetoldRemote-TopBar-CollectionsBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleCollections()" title="Toggle Collections panel (b)">&#9733;</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-filter-btn" id="RetoldRemote-TopBar-FilterBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleFilterBar()" title="Toggle filter bar (/)">&#9698;</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-TopBar",TemplateHash:"RetoldRemote-TopBar",DestinationAddress:"#ContentEditor-TopBar-Container"}]};class r extends i{constructor(t,e,n){super(t,e,n)}onAfterRender(){super.onAfterRender(),this.updateSidebarToggleIcon(),this.updateDFToggleIcon(),this.updateLocation(),this.updateInfo()}updateSidebarToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-SidebarToggle");if(!t)return;let e=this.pict.providers["RetoldRemote-Icons"];t.innerHTML=e?e.getIcon("sidebar",18):"&#9776;"}updateDFToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-DFToggle");t&&(t.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9" /><polyline points="9 21 3 21 3 15" /><polyline points="21 15 21 21 15 21" /><polyline points="3 9 3 3 9 3" /></svg>')}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree&&t._toggleDistractionFree()}updateLocation(){let t=document.getElementById("RetoldRemote-TopBar-Location");if(!t)return;this.pict.AppData.RetoldRemote;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",n=this.pict.providers["RetoldRemote-Icons"],i='<span class="retold-remote-topbar-home-crumb" onclick="pict.PictApplication.loadFileList(\'\')" title="Home">'+(n?n.getIcon("home",16):"/")+"</span>";if(!e)return void(t.innerHTML='<span class="retold-remote-topbar-location-inner">'+i+"</span>");let o=e.split("/").filter(t=>t);if(o.length<=1){let e=i;for(let t=0;t<o.length;t++){e+='<span class="retold-remote-topbar-sep">/</span>',e+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+o.slice(0,t+1).join("/")+"')\">"+o[t]+"</span>"}return void(t.innerHTML='<span class="retold-remote-topbar-location-inner">'+e+"</span>")}let r=n?n.getIcon("folder",16):"",s="";s+="<button class=\"retold-remote-topbar-overflow-item\" onclick=\"pict.PictApplication.loadFileList(''); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",s+='<span class="retold-remote-topbar-overflow-item-icon">'+(n?n.getIcon("home",16):"/")+"</span>",s+='<span class="retold-remote-topbar-overflow-item-label">Home</span>',s+="</button>";for(let t=0;t<o.length-1;t++){s+='<button class="retold-remote-topbar-overflow-item" onclick="pict.PictApplication.loadFileList(\''+o.slice(0,t+1).join("/")+"'); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",s+='<span class="retold-remote-topbar-overflow-item-icon">'+r+"</span>",s+='<span class="retold-remote-topbar-overflow-item-label">'+o[t]+"</span>",s+="</button>"}let a=o[o.length-1],l="";l+='<span class="retold-remote-topbar-breadcrumb-overflow">',l+='<button class="retold-remote-topbar-overflow-btn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleBreadcrumbDropdown()" title="Navigate to parent folders">&#9776;</button>',l+='<div class="retold-remote-topbar-overflow-dropdown" id="RetoldRemote-BreadcrumbDropdown">',l+=s,l+="</div>",l+="</span>",l+='<span class="retold-remote-topbar-location-inner">',l+=i,l+='<span class="retold-remote-topbar-sep">/</span>',l+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+o.join("/")+"')\">"+a+"</span>",l+="</span>",t.innerHTML=l}toggleBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");if(t)if(t.classList.contains("open"))this.closeBreadcrumbDropdown();else{t.classList.add("open");let e=this,n=function(i){if(t.contains(i.target))return;let o=t.parentElement&&t.parentElement.querySelector(".retold-remote-topbar-overflow-btn");o&&o.contains(i.target)||(e.closeBreadcrumbDropdown(),document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0))};setTimeout(function(){document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0)},0),this._breadcrumbCloseHandler=n}}closeBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");t&&t.classList.remove("open"),this._breadcrumbCloseHandler&&(document.removeEventListener("click",this._breadcrumbCloseHandler,!0),document.removeEventListener("touchstart",this._breadcrumbCloseHandler,!0),this._breadcrumbCloseHandler=null)}toggleFilterBar(){let t=this.pict.AppData.RetoldRemote;t.FilterBarVisible=!t.FilterBarVisible,t.FilterBarVisible||(t.FilterPanelOpen=!1);let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery(),this.updateFilterIcon(),t.FilterBarVisible&&setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()},50)}updateFilterIcon(){let t=document.getElementById("RetoldRemote-TopBar-FilterBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-GalleryFilterSort"],i=n?n.getActiveFilterChips().length:0,o=e.FilterBarVisible||!1;t.classList.remove("filter-active","filter-bar-open"),i>0?(t.classList.add("filter-active"),t.innerHTML='&#9683;<span class="retold-remote-topbar-filter-badge">'+i+"</span>",t.title=i+" active filter"+(i>1?"s":"")+" (/)"):o?(t.classList.add("filter-bar-open"),t.innerHTML="&#9698;",t.title="Hide filter bar (/)"):(t.innerHTML="&#9698;",t.title="Toggle filter bar (/)")}updateInfo(){this.updateAISortButton();let t=document.getElementById("RetoldRemote-TopBar-Info");if(!t)return;let e=this.pict.AppData.RetoldRemote,n=e.FolderSummary;if("viewer"===e.ActiveMode){let n=e.GalleryItems||[],i=e.GalleryCursorIndex||0,o=n[i];if(o){let e=i+1+"/"+n.length;t.textContent=e+" · "+o.Name}return}let i=e.GalleryItems||[],o=e.GalleryCursorIndex||0,r="";if(i.length>0&&(r=o+1+"/"+i.length),!n)return void(t.textContent=r);let s=[];r&&s.push(r),n.Folders>0&&s.push(n.Folders+" folders"),n.Images>0&&s.push(n.Images+" images"),n.Videos>0&&s.push(n.Videos+" videos"),n.Audio>0&&s.push(n.Audio+" audio"),n.Documents>0&&s.push(n.Documents+" docs"),n.Other>0&&s.push(n.Other+" other"),t.textContent=s.join(" · ")}triggerAISort(){let t=this.pict.providers["RetoldRemote-AISortManager"];if(!t)return;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",n=document.getElementById("RetoldRemote-TopBar-AISortBtn");n&&(n.classList.add("generating"),n.textContent="Sorting..."),t.generateSortPlan(e,(t,e)=>{n&&(n.classList.remove("generating"),n.textContent="AI Sort")})}updateAISortButton(){let t=document.getElementById("RetoldRemote-TopBar-AISortBtn");if(!t)return;let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.isAvailable()?t.style.display="":t.style.display="none"}toggleCollections(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}updateCollectionsIcon(){let t=document.getElementById("RetoldRemote-TopBar-CollectionsBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-Icons"];e.CollectionsPanelOpen?(t.classList.add("panel-open"),n&&"function"==typeof n.getIcon&&(t.innerHTML=n.getIcon("bookmark-filled",16))):(t.classList.remove("panel-open"),n&&"function"==typeof n.getIcon&&(t.innerHTML=n.getIcon("bookmark",16)))}addToCollection(t){let e=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"];if(n){if(e.LastUsedCollectionGUID){if(n.addCurrentFileToCollection(e.LastUsedCollectionGUID))return}this.showAddToCollectionDropdown(t)}}showAddToCollectionDropdown(t){let e=this,n=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"];this._closeAddToCollectionDropdown();let o=document.getElementById("RetoldRemote-TopBar-AddToCollectionBtn");o&&i.fetchCollections(()=>{let t=n.Collections||[],r=document.createElement("div");r.className="retold-remote-addcoll-dropdown",r.id="RetoldRemote-AddToCollection-Dropdown";let s=document.createElement("button");s.className="retold-remote-addcoll-dropdown-item retold-remote-addcoll-dropdown-new",s.textContent="+ New Collection...",s.onclick=()=>{e._closeAddToCollectionDropdown();let t=prompt("Collection name:");t&&t.trim()&&i.createCollection(t.trim(),(t,e)=>{!t&&e&&i.addCurrentFileToCollection(e.GUID)})},r.appendChild(s);for(let n=0;n<t.length;n++){let o=t[n],s=document.createElement("button");s.className="retold-remote-addcoll-dropdown-item",s.textContent=o.Name||"Untitled",s.onclick=()=>{e._closeAddToCollectionDropdown(),i.addCurrentFileToCollection(o.GUID)},r.appendChild(s)}o.style.position="relative",o.appendChild(r),setTimeout(()=>{document.addEventListener("click",e._boundCloseDropdown=t=>{r.contains(t.target)||t.target===o||e._closeAddToCollectionDropdown()})},10)})}_closeAddToCollectionDropdown(){let t=document.getElementById("RetoldRemote-AddToCollection-Dropdown");t&&t.remove(),this._boundCloseDropdown&&(document.removeEventListener("click",this._boundCloseDropdown),this._boundCloseDropdown=null)}}r.default_configuration=o,e.exports=r},{"pict-view":76}],137:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-VLCSetup",DefaultRenderable:"RetoldRemote-VLCSetup",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:'\n\t\t.retold-remote-vlc-modal-backdrop\n\t\t{\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tbackground: rgba(0, 0, 0, 0.6);\n\t\t\tz-index: 9000;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.retold-remote-vlc-modal\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 8px;\n\t\t\twidth: 600px;\n\t\t\tmax-width: 90vw;\n\t\t\tmax-height: 85vh;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tbox-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);\n\t\t}\n\t\t.retold-remote-vlc-modal-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 14px 18px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-vlc-modal-title\n\t\t{\n\t\t\tfont-size: 0.85rem;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-vlc-modal-close\n\t\t{\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 1.1rem;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 2px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-family: inherit;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.retold-remote-vlc-modal-close:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-vlc-modal-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 18px;\n\t\t}\n\t\t.retold-remote-vlc-setup-section\n\t\t{\n\t\t\tmargin-bottom: 18px;\n\t\t}\n\t\t.retold-remote-vlc-setup-section-title\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tfont-weight: 700;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.retold-remote-vlc-setup-desc\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tline-height: 1.5;\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.retold-remote-vlc-setup-status\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 8px;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tmargin-bottom: 12px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-vlc-setup-status-dot\n\t\t{\n\t\t\twidth: 8px;\n\t\t\theight: 8px;\n\t\t\tborder-radius: 50%;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-vlc-setup-status-dot.detected\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-vlc-setup-status-dot.unknown\n\t\t{\n\t\t\tbackground: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-vlc-setup-platform\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.retold-remote-vlc-setup-platform.active\n\t\t{\n\t\t\tdisplay: block;\n\t\t}\n\t\t.retold-remote-vlc-setup-platform-tabs\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 0;\n\t\t\tmargin-bottom: 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t}\n\t\t.retold-remote-vlc-setup-platform-tab\n\t\t{\n\t\t\tpadding: 6px 12px;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-vlc-setup-platform-tab:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-vlc-setup-platform-tab.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-bottom-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-vlc-setup-code\n\t\t{\n\t\t\tbackground: var(--retold-bg-primary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 10px;\n\t\t\tfont-family: "SF Mono", "Fira Code", "Consolas", monospace;\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tline-height: 1.6;\n\t\t\toverflow-x: auto;\n\t\t\twhite-space: pre;\n\t\t\tmargin-bottom: 8px;\n\t\t\ttab-size: 4;\n\t\t}\n\t\t.retold-remote-vlc-setup-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 6px 14px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-family: inherit;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t\tmargin-right: 6px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.retold-remote-vlc-setup-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-vlc-setup-btn.primary\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.retold-remote-vlc-setup-btn.primary:hover\n\t\t{\n\t\t\topacity: 0.85;\n\t\t}\n\t\t.retold-remote-vlc-setup-step\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t\tmargin-bottom: 10px;\n\t\t}\n\t\t.retold-remote-vlc-setup-step-num\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\tborder-radius: 50%;\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: #fff;\n\t\t\tfont-size: 0.65rem;\n\t\t\tfont-weight: 700;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.retold-remote-vlc-setup-step-content\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.retold-remote-vlc-setup-note\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-style: italic;\n\t\t\tmargin-top: 4px;\n\t\t}\n\t\t.retold-remote-toast\n\t\t{\n\t\t\tposition: fixed;\n\t\t\tbottom: 20px;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tcolor: var(--retold-accent);\n\t\t\tpadding: 8px 16px;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tz-index: 10000;\n\t\t\tpointer-events: none;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t}\n\t'};class r extends i{constructor(t,e,n){super(t,e,n),this._activePlatformTab=this._detectPlatform(),this._modalVisible=!1,this._boundKeyHandler=null}_detectPlatform(){let t="undefined"!=typeof navigator?navigator.userAgent:"";return/Macintosh|Mac OS X/.test(t)?"macos":/Windows/.test(t)?"windows":"linux"}openModal(){if(this._modalVisible)return;this._modalVisible=!0;let t=document.createElement("div");t.className="retold-remote-vlc-modal-backdrop",t.id="RetoldRemote-VLCSetup-Backdrop",t.onclick=e=>{e.target===t&&this.closeModal()};let e=document.createElement("div");e.className="retold-remote-vlc-modal";let n=document.createElement("div");n.className="retold-remote-vlc-modal-header",n.innerHTML='<span class="retold-remote-vlc-modal-title">VLC Protocol Setup</span><button class="retold-remote-vlc-modal-close" onclick="pict.views[\'RetoldRemote-VLCSetup\'].closeModal()">X</button>';let i=document.createElement("div");i.className="retold-remote-vlc-modal-body",i.id="RetoldRemote-VLCSetup-Container",e.appendChild(n),e.appendChild(i),t.appendChild(e),document.body.appendChild(t),this._renderVLCSetupContent(),this._boundKeyHandler=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),this.closeModal())},document.addEventListener("keydown",this._boundKeyHandler,!0)}closeModal(){if(!this._modalVisible)return;this._modalVisible=!1;let t=document.getElementById("RetoldRemote-VLCSetup-Backdrop");t&&t.remove(),this._boundKeyHandler&&(document.removeEventListener("keydown",this._boundKeyHandler,!0),this._boundKeyHandler=null)}switchPlatformTab(t){this._activePlatformTab=t,this._renderVLCSetupContent()}_renderVLCSetupContent(){let t=document.getElementById("RetoldRemote-VLCSetup-Container");if(!t)return;let e=this._activePlatformTab,n="";n+='<div class="retold-remote-vlc-setup-section">',n+='<div class="retold-remote-vlc-setup-desc">',n+="Stream media directly in VLC from the browser. Press <b>v</b> in the media viewer to launch VLC with the current file.",n+="</div>",n+="</div>",n+='<div class="retold-remote-vlc-setup-status">',n+='<div class="retold-remote-vlc-setup-status-dot '+(this._detectPlatform()===e?"detected":"unknown")+'"></div>',n+="<span>Detected platform: <b>"+this._getPlatformLabel(this._detectPlatform())+"</b></span>",n+="</div>",n+='<div class="retold-remote-vlc-setup-platform-tabs">',n+=this._buildPlatformTab("macos","macOS",e),n+=this._buildPlatformTab("windows","Windows",e),n+=this._buildPlatformTab("linux","Linux",e),n+="</div>",n+=this._buildMacOSContent(e),n+=this._buildWindowsContent(e),n+=this._buildLinuxContent(e),n+='<div class="retold-remote-vlc-setup-section">',n+='<div class="retold-remote-vlc-setup-section-title">Test</div>',n+='<div class="retold-remote-vlc-setup-desc">',n+="Click below to test whether the vlc:// protocol handler is registered. VLC should open.",n+="</div>",n+='<button class="retold-remote-vlc-setup-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].testProtocol()">Test VLC Protocol</button>',n+="</div>",t.innerHTML=n}_buildPlatformTab(t,e,n){let i="retold-remote-vlc-setup-platform-tab";return t===n&&(i+=" active"),'<button class="'+i+"\" onclick=\"pict.views['RetoldRemote-VLCSetup'].switchPlatformTab('"+t+"')\">"+e+"</button>"}_getPlatformLabel(t){return"macos"===t?"macOS":"windows"===t?"Windows":"Linux"}_buildMacOSContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("macos"===t?" active":""))+'" data-platform="macos">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (macOS)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC on macOS does not register a vlc:// protocol handler by default. ",e+="An AppleScript app bundle is needed to bridge vlc:// links to VLC. ",e+="Run the command below in Terminal to create and register the handler automatically.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Automatic Setup</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Copy and paste this into Terminal:",e+="</div>";let n=this._getMacSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyMacSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates an AppleScript at <code>/tmp/VLCProtocol.applescript</code> that handles vlc:// URLs</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Compiles it into an app bundle at <code>/Applications/VLCProtocol.app</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Adds the vlc:// URL scheme to the app\'s Info.plist</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">4</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers the protocol handler with macOS Launch Services</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC installed at /Applications/VLC.app and Python 3 (included with macOS).</div>',e+="</div>",e+="</div>",e}_buildWindowsContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("windows"===t?" active":""))+'" data-platform="windows">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Windows)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC on Windows registers the vlc:// protocol handler during installation. ",e+="If it is not working, you can re-register it by saving and running the registry file below.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option A: Reinstall VLC</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Reinstall VLC and ensure "Register VLC as handler for vlc:// protocol" is checked during installation.</div>',e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option B: Registry File</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Save this as <code>vlc-protocol.reg</code> and double-click to import. ",e+="Adjust the VLC path if yours differs.",e+="</div>";let n=this._getWindowsRegFile();e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsReg()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option C: Batch Script</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Alternatively, save this as <code>vlc-protocol-setup.bat</code> and run as Administrator. ",e+="This creates a wrapper script that URL-decodes the vlc:// link before passing it to VLC.",e+="</div>";let i=this._getWindowsBatchScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsBatch()">Copy to Clipboard</button>',e+="</div>",e+="</div>",e}_buildLinuxContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("linux"===t?" active":""))+'" data-platform="linux">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Linux)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Register a vlc:// protocol handler using a .desktop file and xdg-mime. ",e+="Run the command below in a terminal.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup Command</div>';let n=this._getLinuxSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyLinuxSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a handler script at <code>~/.local/bin/vlc-protocol</code> that URL-decodes and opens VLC</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a .desktop file at <code>~/.local/share/applications/vlc-protocol.desktop</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers vlc:// as a URL scheme via <code>xdg-mime</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC and Python 3 installed.</div>',e+="</div>",e+="</div>",e}_getMacSetupScript(){return["# Create the AppleScript handler","cat > /tmp/VLCProtocol.applescript << 'EOF'","on open location theURL","\tset theURL to text 7 thru -1 of theURL","\tset theURL to do shell script \"python3 -c 'import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))' \" & quoted form of theURL",'\tdo shell script "open -a VLC " & quoted form of theURL',"end open location","EOF","","# Compile into app bundle","osacompile -o /Applications/VLCProtocol.app /tmp/VLCProtocol.applescript","","# Add vlc:// URL scheme to Info.plist",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0 dict" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","/usr/libexec/PlistBuddy -c \"Add :CFBundleURLTypes:0:CFBundleURLName string 'VLC Protocol'\" \\"," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes:0 string vlc" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","","# Register with Launch Services","/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister \\"," -f /Applications/VLCProtocol.app","",'echo "VLC protocol handler installed successfully."'].join("\n")}_getWindowsRegFile(){return["Windows Registry Editor Version 5.00","","[HKEY_CLASSES_ROOT\\vlc]",'@="URL:VLC Protocol"','"URL Protocol"=""',"","[HKEY_CLASSES_ROOT\\vlc\\shell]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open\\command]",'@="\\"C:\\\\Program Files\\\\VideoLAN\\\\VLC\\\\vlc.exe\\" \\"%1\\""'].join("\n")}_getWindowsBatchScript(){return["@echo off","REM VLC Protocol Handler Setup for Windows","REM Run this as Administrator","","REM Create the handler script",'mkdir "%APPDATA%\\VLCProtocol" 2>nul',"(","echo import sys, urllib.parse, subprocess","echo url = sys.argv[1] if len(sys.argv^) ^> 1 else ''","echo if url.startswith('vlc://'^): url = url[6:]","echo url = urllib.parse.unquote(url^)","echo subprocess.Popen(['C:\\\\Program Files\\\\VideoLAN\\\\VLC\\\\vlc.exe', url]^)",') > "%APPDATA%\\VLCProtocol\\handler.py"',"","REM Register the protocol in the registry",'reg add "HKCU\\Software\\Classes\\vlc" /ve /d "URL:VLC Protocol" /f','reg add "HKCU\\Software\\Classes\\vlc" /v "URL Protocol" /d "" /f','reg add "HKCU\\Software\\Classes\\vlc\\shell\\open\\command" /ve /d "pythonw \\"%APPDATA%\\VLCProtocol\\handler.py\\" \\"%%1\\"" /f',"","echo VLC protocol handler installed successfully.","pause"].join("\n")}_getLinuxSetupScript(){return["# Create handler script","mkdir -p ~/.local/bin","cat > ~/.local/bin/vlc-protocol << 'EOF'","#!/bin/bash",'URL="$1"','URL="${URL#vlc://}"','URL=$(python3 -c "import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))" "$URL")','exec vlc "$URL" &',"EOF","chmod +x ~/.local/bin/vlc-protocol","","# Create .desktop file","cat > ~/.local/share/applications/vlc-protocol.desktop << 'EOF'","[Desktop Entry]","Name=VLC Protocol Handler","Exec=bash -c '~/.local/bin/vlc-protocol %u'","Type=Application","NoDisplay=true","MimeType=x-scheme-handler/vlc;","EOF","","# Register the handler","xdg-mime default vlc-protocol.desktop x-scheme-handler/vlc","update-desktop-database ~/.local/share/applications/","",'echo "VLC protocol handler installed successfully."'].join("\n")}_copyToClipboard(t,e){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(t).then(()=>{this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}).catch(()=>{this._fallbackCopy(t,e)}):this._fallbackCopy(t,e)}_fallbackCopy(t,e){let n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n),n.select();try{document.execCommand("copy"),this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}catch(t){this.pict.providers["RetoldRemote-ToastNotification"].showToast("Failed to copy - please select and copy manually")}document.body.removeChild(n)}copyMacSetup(){this._copyToClipboard(this._getMacSetupScript(),"macOS setup script")}copyWindowsReg(){this._copyToClipboard(this._getWindowsRegFile(),"Registry file")}copyWindowsBatch(){this._copyToClipboard(this._getWindowsBatchScript(),"Batch script")}copyLinuxSetup(){this._copyToClipboard(this._getLinuxSetupScript(),"Linux setup script")}testProtocol(){let t="https://www.sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4",e=/Windows/.test(navigator.userAgent)?"vlc://"+t:"vlc://"+encodeURIComponent(t),n=document.createElement("a");n.href=e,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}}r.default_configuration=o,e.exports=r},{"pict-view":76}],138:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-VideoExplorer",DefaultRenderable:"RetoldRemote-VideoExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:'\n\t\t.retold-remote-vex\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t}\n\t\t.retold-remote-vex-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tz-index: 5;\n\t\t}\n\t\t.retold-remote-vex-nav-btn\n\t\t{\n\t\t\tpadding: 4px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.8rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-vex-nav-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-vex-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-vex-info\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 16px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-vex-info-item\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.retold-remote-vex-info-label\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-vex-info-value\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-vex-controls\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-vex-controls label\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-vex-controls select,\n\t\t.retold-remote-vex-controls input[type="range"]\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 2px 6px;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-vex-controls .retold-remote-vex-refresh-btn\n\t\t{\n\t\t\tpadding: 3px 12px;\n\t\t\tborder: 1px solid var(--retold-accent);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-vex-controls .retold-remote-vex-refresh-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-primary);\n\t\t}\n\t\t.retold-remote-vex-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 16px;\n\t\t}\n\t\t.retold-remote-vex-loading\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\theight: 100%;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t\t.retold-remote-vex-loading-spinner\n\t\t{\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tborder: 3px solid var(--retold-border);\n\t\t\tborder-top-color: var(--retold-accent);\n\t\t\tborder-radius: 50%;\n\t\t\tanimation: retold-vex-spin 0.8s linear infinite;\n\t\t\tmargin-bottom: 16px;\n\t\t}\n\t\t@keyframes retold-vex-spin\n\t\t{\n\t\t\tto { transform: rotate(360deg); }\n\t\t}\n\t\t.retold-remote-vex-grid\n\t\t{\n\t\t\tdisplay: grid;\n\t\t\tgrid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n\t\t\tgap: 12px;\n\t\t}\n\t\t.retold-remote-vex-frame\n\t\t{\n\t\t\tposition: relative;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow: hidden;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder: 2px solid transparent;\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color 0.15s, transform 0.1s;\n\t\t}\n\t\t.retold-remote-vex-frame:hover\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\ttransform: translateY(-1px);\n\t\t}\n\t\t.retold-remote-vex-frame.selected\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-vex-frame img\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tdisplay: block;\n\t\t\taspect-ratio: 16 / 9;\n\t\t\tobject-fit: contain;\n\t\t\tbackground: #000;\n\t\t}\n\t\t.retold-remote-vex-frame-info\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 6px 10px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t}\n\t\t.retold-remote-vex-frame-timestamp\n\t\t{\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-family: var(--retold-font-mono, monospace);\n\t\t}\n\t\t.retold-remote-vex-frame-index\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-vex-frame.custom-frame\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tborder-style: dashed;\n\t\t}\n\t\t.retold-remote-vex-frame.custom-frame .retold-remote-vex-frame-info\n\t\t{\n\t\t\tbackground: color-mix(in srgb, var(--retold-accent) 12%, var(--retold-bg-secondary));\n\t\t}\n\t\t.retold-remote-vex-frame-loading\n\t\t{\n\t\t\twidth: 100%;\n\t\t\taspect-ratio: 16 / 9;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: #000;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\t\t.retold-remote-vex-timeline-marker.custom\n\t\t{\n\t\t\tbackground: var(--retold-text-primary);\n\t\t\topacity: 0.9;\n\t\t\twidth: 2px;\n\t\t\tborder: 1px dashed var(--retold-accent);\n\t\t}\n\t\t/* Timeline bar at bottom */\n\t\t.retold-remote-vex-timeline\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-vex-timeline-bar\n\t\t{\n\t\t\tflex: 1;\n\t\t\theight: 24px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder-radius: 4px;\n\t\t\tposition: relative;\n\t\t\toverflow: hidden;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.retold-remote-vex-timeline-marker\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\twidth: 3px;\n\t\t\theight: 100%;\n\t\t\tbackground: var(--retold-accent);\n\t\t\topacity: 0.7;\n\t\t\ttransition: opacity 0.15s;\n\t\t}\n\t\t.retold-remote-vex-timeline-marker:hover\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.retold-remote-vex-timeline-marker.selected\n\t\t{\n\t\t\topacity: 1;\n\t\t\tbackground: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-vex-timeline-label\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t/* Frame preview overlay */\n\t\t.retold-remote-vex-preview-backdrop\n\t\t{\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground: rgba(0, 0, 0, 0.85);\n\t\t\tz-index: 100;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.retold-remote-vex-preview-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\twidth: 100%;\n\t\t\tmax-width: 95vw;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-vex-preview-header .retold-remote-vex-nav-btn\n\t\t{\n\t\t\tbackground: rgba(40, 44, 52, 0.8);\n\t\t}\n\t\t.retold-remote-vex-preview-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-vex-preview-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\toverflow: auto;\n\t\t\tpadding: 8px;\n\t\t\tmax-width: 95vw;\n\t\t\tmax-height: calc(100vh - 60px);\n\t\t}\n\t\t.retold-remote-vex-preview-body img\n\t\t{\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 100%;\n\t\t\tobject-fit: contain;\n\t\t\tborder-radius: 4px;\n\t\t\tbox-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);\n\t\t}\n\t\t/* Error state */\n\t\t.retold-remote-vex-error\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\theight: 100%;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.85rem;\n\t\t\ttext-align: center;\n\t\t\tpadding: 40px;\n\t\t}\n\t\t.retold-remote-vex-error-message\n\t\t{\n\t\t\tcolor: #e06c75;\n\t\t\tmargin-bottom: 16px;\n\t\t}\n\t'};class r extends i{constructor(t,e,n){super(t,e,n),this._currentPath="",this._frameData=null,this._selectedFrameIndex=-1,this._frameCount=20,this._fullResFrames=!1,this._customFrames=[]}showExplorer(t){this.pict.AppData.RetoldRemote.ActiveMode="video-explorer",this._currentPath=t,this._frameData=null,this._selectedFrameIndex=-1,this._customFrames=[];let e=this.pict.providers["RetoldRemote-Provider"],n=e?e.getFragmentIdentifier(t):t;window.location.hash="#/explore/"+n;let i=document.getElementById("RetoldRemote-Gallery-Container"),o=document.getElementById("RetoldRemote-Viewer-Container");i&&(i.style.display="none"),o&&(o.style.display="block");let r=t.replace(/^.*\//,""),s='<div class="retold-remote-vex">';s+='<div class="retold-remote-vex-header">',s+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()" title="Back to video (Esc)">&larr; Back</button>',s+='<div class="retold-remote-vex-title">Video Explorer &mdash; '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(r)+"</div>",s+="</div>",s+='<div class="retold-remote-vex-info" id="RetoldRemote-VEX-Info" style="display:none;"></div>',s+='<div class="retold-remote-vex-controls" id="RetoldRemote-VEX-Controls" style="display:none;">',s+="<label>Frames:</label>",s+='<select id="RetoldRemote-VEX-FrameCount" onchange="pict.views[\'RetoldRemote-VideoExplorer\'].onFrameCountChange(this.value)">',s+='<option value="10"'+(10===this._frameCount?" selected":"")+">10</option>",s+='<option value="20"'+(20===this._frameCount?" selected":"")+">20</option>",s+='<option value="40"'+(40===this._frameCount?" selected":"")+">40</option>",s+='<option value="60"'+(60===this._frameCount?" selected":"")+">60</option>",s+='<option value="100"'+(100===this._frameCount?" selected":"")+">100</option>",s+="</select>",s+='<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;">',s+='<input type="checkbox" id="RetoldRemote-VEX-FullRes"'+(this._fullResFrames?" checked":"")+" onchange=\"pict.views['RetoldRemote-VideoExplorer'].onFullResChange(this.checked)\">",s+="Full Res Frames</label>",s+='<button class="retold-remote-vex-refresh-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].refresh()">Refresh</button>',s+="</div>",s+='<div class="retold-remote-vex-body" id="RetoldRemote-VEX-Body">',s+='<div class="retold-remote-vex-loading">',s+='<div class="retold-remote-vex-loading-spinner"></div>',s+="Extracting frames from video...",s+="</div>",s+="</div>",s+='<div class="retold-remote-vex-timeline" id="RetoldRemote-VEX-Timeline" style="display:none;"></div>',s+="</div>",o&&(o.innerHTML=s);let a=this.pict.views["ContentEditor-TopBar"];a&&a.updateInfo(),this._fetchFrames(t)}_fetchFrames(t){let e=this,n=this.pict.providers["RetoldRemote-Provider"],i="/api/media/video-frames?path="+(n?n._getPathParam(t):encodeURIComponent(t))+"&count="+this._frameCount;this._fullResFrames&&(i+="&width=1920&height=1080"),fetch(i).then(t=>t.json()).then(t=>{t&&t.Success?(e._frameData=t,e._renderFrames()):e._showError(t?t.Error:"Unknown error")}).catch(t=>{e._showError(t.message)})}_renderFrames(){let t=this._frameData;if(!t)return;let e=document.getElementById("RetoldRemote-VEX-Info");if(e){let n="";n+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Duration</span> <span class="retold-remote-vex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.DurationFormatted)+"</span></span>",t.VideoWidth&&t.VideoHeight&&(n+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Resolution</span> <span class="retold-remote-vex-info-value">'+t.VideoWidth+"&times;"+t.VideoHeight+"</span></span>"),t.Codec&&(n+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Codec</span> <span class="retold-remote-vex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Codec)+"</span></span>"),t.FileSize&&(n+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Size</span> <span class="retold-remote-vex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(t.FileSize)+"</span></span>"),n+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Frames</span> <span class="retold-remote-vex-info-value">'+t.FrameCount+"</span></span>",e.innerHTML=n,e.style.display=""}let n=document.getElementById("RetoldRemote-VEX-Controls");n&&(n.style.display="");let i=document.getElementById("RetoldRemote-VEX-Body");if(i){let e='<div class="retold-remote-vex-grid">';for(let n=0;n<t.Frames.length;n++){let i=t.Frames[n];e+='<div class="retold-remote-vex-frame" id="retold-vex-frame-'+n+"\" onclick=\"pict.views['RetoldRemote-VideoExplorer'].selectFrame("+n+")\" ondblclick=\"pict.views['RetoldRemote-VideoExplorer'].openFrameFullsize("+n+')">',e+='<img src="'+("/api/media/video-frame/"+t.CacheKey+"/"+i.Filename)+'" alt="Frame at '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.TimestampFormatted)+'" loading="lazy">',e+='<div class="retold-remote-vex-frame-info">',e+='<span class="retold-remote-vex-frame-timestamp">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.TimestampFormatted)+"</span>",e+='<span class="retold-remote-vex-frame-index">#'+(i.Index+1)+"</span>",e+="</div>",e+="</div>"}e+="</div>",i.innerHTML=e}this._renderTimeline()}_renderTimeline(){let t=this._frameData;if(!t||!t.Duration)return;let e=document.getElementById("RetoldRemote-VEX-Timeline");if(!e)return;let n="";n+='<span class="retold-remote-vex-timeline-label">0:00</span>',n+='<div class="retold-remote-vex-timeline-bar" id="RetoldRemote-VEX-TimelineBar" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].onTimelineClick(event)">';for(let e=0;e<t.Frames.length;e++){let i=t.Frames[e],o=i.Timestamp/t.Duration*100;n+='<div class="retold-remote-vex-timeline-marker'+(e===this._selectedFrameIndex?" selected":"")+'" style="left:'+o.toFixed(2)+'%;" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.TimestampFormatted)+"\" onclick=\"event.stopPropagation(); pict.views['RetoldRemote-VideoExplorer'].selectFrame("+e+')"></div>'}if(this._customFrames)for(let e=0;e<this._customFrames.length;e++){let i=this._customFrames[e];n+='<div class="retold-remote-vex-timeline-marker custom" style="left:'+(i.Timestamp/t.Duration*100).toFixed(2)+'%;" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.TimestampFormatted)+'"></div>'}n+="</div>",n+='<span class="retold-remote-vex-timeline-label">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.DurationFormatted)+"</span>",e.innerHTML=n,e.style.display=""}selectFrame(t){if(this._selectedFrameIndex>=0){let t=document.getElementById("retold-vex-frame-"+this._selectedFrameIndex);t&&t.classList.remove("selected")}this._selectedFrameIndex=t;let e=document.getElementById("retold-vex-frame-"+t);e&&(e.classList.add("selected"),e.scrollIntoView({behavior:"smooth",block:"nearest"})),this._updateTimelineSelection()}_updateTimelineSelection(){let t=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!t)return;let e=t.querySelectorAll(".retold-remote-vex-timeline-marker");for(let t=0;t<e.length;t++)t===this._selectedFrameIndex?e[t].classList.add("selected"):e[t].classList.remove("selected")}onTimelineClick(t){let e=this._frameData;if(!e||!e.Duration||!e.CacheKey)return;let n=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!n)return;let i=n.getBoundingClientRect(),o=t.clientX-i.left,r=Math.max(0,Math.min(1,o/i.width))*e.Duration,s=this,a=this.pict.providers["RetoldRemote-Provider"],l="/api/media/video-frame-at?path="+(a?a._getPathParam(this._currentPath):encodeURIComponent(this._currentPath))+"&cacheKey="+encodeURIComponent(e.CacheKey)+"&timestamp="+r.toFixed(3);this._fullResFrames&&(l+="&width=1920&height=1080");let d="retold-vex-custom-"+Date.now();this._insertFramePlaceholder(r,d),fetch(l).then(t=>t.json()).then(t=>{if(!t||!t.Success)throw new Error(t?t.Error:"Extraction failed.");s._customFrames.push(t);let n=document.getElementById(d);if(n){let i="/api/media/video-frame/"+e.CacheKey+"/"+t.Filename,o=s.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Filename).replace(/'/g,"\\'"),r=s.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.TimestampFormatted).replace(/'/g,"\\'");n.ondblclick=function(){pict.views["RetoldRemote-VideoExplorer"].openCustomFrameFullsize(o,r)},n.style.cursor="pointer",n.innerHTML='<img src="'+i+'" alt="Frame at '+s.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.TimestampFormatted)+'" loading="lazy"><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.TimestampFormatted)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>'}s._renderTimeline()}).catch(t=>{let e=document.getElementById(d);e&&(e.innerHTML='<div class="retold-remote-vex-frame-loading">Failed: '+s.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.message)+'</div><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(r)+'</span><span class="retold-remote-vex-frame-index">error</span></div>')})}_insertFramePlaceholder(t,e){let n=document.querySelector(".retold-remote-vex-grid");if(!n)return;this._frameData;let i=document.createElement("div");i.className="retold-remote-vex-frame custom-frame",i.id=e,i.innerHTML='<div class="retold-remote-vex-frame-loading">Extracting...</div><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(t)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>';let o=null,r=n.children;for(let e=0;e<r.length;e++){let n=r[e],i=n.querySelector(".retold-remote-vex-frame-timestamp");if(i){if(this._parseTimestamp(i.textContent)>t){o=n;break}}}o?n.insertBefore(i,o):n.appendChild(i),i.scrollIntoView({behavior:"smooth",block:"nearest"})}_parseTimestamp(t){if(!t)return 0;let e=t.trim().split(":");return 3===e.length?3600*parseInt(e[0],10)+60*parseInt(e[1],10)+parseInt(e[2],10):2===e.length?60*parseInt(e[0],10)+parseInt(e[1],10):parseFloat(t)||0}openFrameFullsize(t){if(!this._frameData||!this._frameData.Frames[t])return;let e=this._frameData.Frames[t],n="/api/media/video-frame/"+this._frameData.CacheKey+"/"+e.Filename,i=e.TimestampFormatted+" · #"+(e.Index+1);this._showFramePreview(n,i,"regular",t)}openCustomFrameFullsize(t,e){if(!this._frameData)return;let n="/api/media/video-frame/"+this._frameData.CacheKey+"/"+t,i=e+" · custom",o=-1;for(let e=0;e<this._customFrames.length;e++)if(this._customFrames[e].Filename===t){o=e;break}this._showFramePreview(n,i,"custom",o)}_buildAllFramesList(){let t=[];if(this._frameData&&this._frameData.Frames)for(let e=0;e<this._frameData.Frames.length;e++){let n=this._frameData.Frames[e];t.push({Type:"regular",Index:e,Timestamp:n.Timestamp,TimestampFormatted:n.TimestampFormatted,Filename:n.Filename,Label:n.TimestampFormatted+" · #"+(n.Index+1)})}if(this._customFrames)for(let e=0;e<this._customFrames.length;e++){let n=this._customFrames[e];t.push({Type:"custom",Index:e,Timestamp:n.Timestamp,TimestampFormatted:n.TimestampFormatted,Filename:n.Filename,Label:n.TimestampFormatted+" · custom"})}return t.sort((t,e)=>t.Timestamp-e.Timestamp),t}_showFramePreview(t,e,n,i){this._previewType=n,this._previewIndex=i;let o=this._buildAllFramesList();this._previewAllFrames=o,this._previewPosition=0;for(let t=0;t<o.length;t++)if(o[t].Type===n&&o[t].Index===i){this._previewPosition=t;break}let r=document.createElement("div");r.className="retold-remote-vex-preview-backdrop",r.id="RetoldRemote-VEX-Preview",r.onclick=t=>{t.target===r&&this.closeFramePreview()};let s="";s+='<div class="retold-remote-vex-preview-header">',s+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].closeFramePreview()" title="Back (Esc)">&larr; Back</button>',s+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].previewPrevFrame()" title="Previous (←)">&lsaquo; Prev</button>',s+='<div class="retold-remote-vex-preview-title" id="RetoldRemote-VEX-PreviewTitle">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div>",s+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].previewNextFrame()" title="Next (→)">Next &rsaquo;</button>',s+="</div>",s+='<div class="retold-remote-vex-preview-body" id="RetoldRemote-VEX-PreviewBody">',s+='<img src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'">',s+="</div>",r.innerHTML=s,document.body.appendChild(r),this._previewKeyHandler=t=>{switch(t.key){case"Escape":t.preventDefault(),t.stopImmediatePropagation(),this.closeFramePreview();break;case"ArrowLeft":case"k":t.preventDefault(),t.stopImmediatePropagation(),this.previewPrevFrame();break;case"ArrowRight":case"j":t.preventDefault(),t.stopImmediatePropagation(),this.previewNextFrame()}},document.addEventListener("keydown",this._previewKeyHandler)}closeFramePreview(){let t=document.getElementById("RetoldRemote-VEX-Preview");t&&t.remove(),this._previewKeyHandler&&(document.removeEventListener("keydown",this._previewKeyHandler),this._previewKeyHandler=null)}previewPrevFrame(){!this._previewAllFrames||this._previewPosition<=0||(this._previewPosition--,this._updatePreviewFrame())}previewNextFrame(){!this._previewAllFrames||this._previewPosition>=this._previewAllFrames.length-1||(this._previewPosition++,this._updatePreviewFrame())}_updatePreviewFrame(){let t=this._previewAllFrames[this._previewPosition];if(!t||!this._frameData)return;let e="/api/media/video-frame/"+this._frameData.CacheKey+"/"+t.Filename,n=document.getElementById("RetoldRemote-VEX-PreviewBody");n&&(n.innerHTML='<img src="'+e+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Label)+'">');let i=document.getElementById("RetoldRemote-VEX-PreviewTitle");i&&(i.textContent=t.Label),this._previewType=t.Type,this._previewIndex=t.Index,"regular"===t.Type&&this.selectFrame(t.Index)}onFrameCountChange(t){this._frameCount=parseInt(t,10)||20,this.refresh()}onFullResChange(t){this._fullResFrames=t,this.refresh()}refresh(){let t=document.getElementById("RetoldRemote-VEX-Body");t&&(t.innerHTML='<div class="retold-remote-vex-loading"><div class="retold-remote-vex-loading-spinner"></div>Extracting frames from video...</div>');let e=document.getElementById("RetoldRemote-VEX-Timeline");e&&(e.style.display="none"),this._selectedFrameIndex=-1,this._customFrames=[],this._fetchFrames(this._currentPath)}goBack(){if(this._currentPath){let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"video")}else{let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}}_showError(t){let e=document.getElementById("RetoldRemote-VEX-Body");e&&(e.innerHTML='<div class="retold-remote-vex-error"><div class="retold-remote-vex-error-message">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()">Back to Video</button></div>')}}r.default_configuration=o,e.exports=r},{"pict-view":76}]},{},[113])(113)});
135
+ const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-CollectionsPanel",DefaultRenderable:"RetoldRemote-CollectionsPanel",DefaultDestinationAddress:"#RetoldRemote-Collections-Container",AutoRender:!1,CSS:"\n\t\t/* ---- Collections Panel Container ---- */\n\t\t.retold-remote-collections-panel\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.retold-remote-collections-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 8px 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-collections-header-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.retold-remote-collections-header-btn\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 26px;\n\t\t\theight: 26px;\n\t\t\tpadding: 0;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.82rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-collections-header-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t/* ---- Search ---- */\n\t\t.retold-remote-collections-search\n\t\t{\n\t\t\tpadding: 6px 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-collections-search input\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t\toutline: none;\n\t\t}\n\t\t.retold-remote-collections-search input:focus\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t/* ---- Collection List ---- */\n\t\t.retold-remote-collections-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t}\n\t\t.retold-remote-collections-empty\n\t\t{\n\t\t\tpadding: 24px 16px;\n\t\t\ttext-align: center;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-collection-card\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t\tpadding: 10px 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s;\n\t\t}\n\t\t.retold-remote-collection-card:hover\n\t\t{\n\t\t\tbackground: rgba(128, 128, 128, 0.08);\n\t\t}\n\t\t.retold-remote-collection-card-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-size: 1rem;\n\t\t}\n\t\t.retold-remote-collection-card-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.retold-remote-collection-card-name\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.retold-remote-collection-card-meta\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-top: 2px;\n\t\t}\n\t\t/* ---- Detail mode ---- */\n\t\t.retold-remote-collections-detail-controls\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t\tpadding: 6px 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-collections-sort-select\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-family: inherit;\n\t\t\tflex: 1;\n\t\t}\n\t\t.retold-remote-collections-sort-dir\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-collections-sort-dir:hover\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t/* ---- Item rows ---- */\n\t\t.retold-remote-collection-item\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 6px 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s;\n\t\t\tposition: relative;\n\t\t}\n\t\t.retold-remote-collection-item:hover\n\t\t{\n\t\t\tbackground: rgba(128, 128, 128, 0.08);\n\t\t}\n\t\t.retold-remote-collection-item-drag\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 16px;\n\t\t\tcursor: grab;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.68rem;\n\t\t\ttext-align: center;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.retold-remote-collection-item-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 24px;\n\t\t\theight: 24px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.82rem;\n\t\t}\n\t\t.retold-remote-collection-item-icon img\n\t\t{\n\t\t\twidth: 24px;\n\t\t\theight: 24px;\n\t\t\tobject-fit: cover;\n\t\t\tborder-radius: 2px;\n\t\t}\n\t\t.retold-remote-collection-item-name\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.retold-remote-collection-item-type\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.62rem;\n\t\t\tpadding: 1px 4px;\n\t\t\tborder-radius: 2px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\ttext-transform: uppercase;\n\t\t}\n\t\t.retold-remote-collection-item-remove\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: none;\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder: none;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.82rem;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.retold-remote-collection-item:hover .retold-remote-collection-item-remove\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.retold-remote-collection-item-remove:hover\n\t\t{\n\t\t\tcolor: var(--retold-danger-muted, #e55);\n\t\t\tbackground: rgba(200, 50, 50, 0.1);\n\t\t}\n\t\t/* ---- Operation Plan mode ---- */\n\t\t.retold-remote-collections-op-controls\n\t\t{\n\t\t\tflex-direction: column;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.retold-remote-collections-op-summary\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tpadding: 4px 0;\n\t\t}\n\t\t.retold-remote-collections-op-buttons\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.retold-remote-collections-op-execute-btn\n\t\t{\n\t\t\tflex: 1;\n\t\t\tpadding: 6px 12px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-accent, #4a90d9);\n\t\t\tcolor: #fff;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.retold-remote-collections-op-execute-btn:hover\n\t\t{\n\t\t\topacity: 0.9;\n\t\t}\n\t\t.retold-remote-collections-op-execute-btn:disabled\n\t\t{\n\t\t\topacity: 0.5;\n\t\t\tcursor: default;\n\t\t}\n\t\t.retold-remote-collections-op-undo-btn\n\t\t{\n\t\t\tpadding: 6px 12px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.retold-remote-collections-op-undo-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t}\n\t\t.retold-remote-collection-op-item\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tpadding: 6px 8px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tfont-size: 0.75rem;\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.retold-remote-collection-op-item.op-status-completed\n\t\t{\n\t\t\topacity: 0.6;\n\t\t}\n\t\t.retold-remote-collection-op-item.op-status-skipped\n\t\t{\n\t\t\topacity: 0.4;\n\t\t\ttext-decoration: line-through;\n\t\t}\n\t\t.retold-remote-collection-op-item.op-status-failed\n\t\t{\n\t\t\tbackground: rgba(200, 50, 50, 0.05);\n\t\t}\n\t\t.retold-remote-collection-op-status\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 16px;\n\t\t\ttext-align: center;\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\t\t.op-status-completed .retold-remote-collection-op-status\n\t\t{\n\t\t\tcolor: var(--retold-success, #4a4);\n\t\t}\n\t\t.op-status-failed .retold-remote-collection-op-status\n\t\t{\n\t\t\tcolor: var(--retold-danger-muted, #e55);\n\t\t}\n\t\t.op-status-pending .retold-remote-collection-op-status\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-collection-op-source\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-collection-op-arrow\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tpadding: 0 2px;\n\t\t}\n\t\t.retold-remote-collection-op-dest\n\t\t{\n\t\t\tflex: 2;\n\t\t\tmin-width: 0;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-collection-op-dest-input\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder: 1px solid var(--retold-accent);\n\t\t\tborder-radius: 2px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.retold-remote-collection-op-badge\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.6rem;\n\t\t\tpadding: 1px 4px;\n\t\t\tborder-radius: 2px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\ttext-transform: uppercase;\n\t\t\tfont-weight: 600;\n\t\t\tletter-spacing: 0.3px;\n\t\t}\n\t\t.retold-remote-collection-op-error\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-danger-muted, #e55);\n\t\t\tpadding: 2px 0 0 20px;\n\t\t}\n\t\t/* ---- Edit mode ---- */\n\t\t.retold-remote-collections-edit\n\t\t{\n\t\t\tpadding: 12px;\n\t\t}\n\t\t.retold-remote-collections-edit-group\n\t\t{\n\t\t\tmargin-bottom: 12px;\n\t\t}\n\t\t.retold-remote-collections-edit-label\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-bottom: 4px;\n\t\t}\n\t\t.retold-remote-collections-edit-input\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tpadding: 6px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.retold-remote-collections-edit-input:focus\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\toutline: none;\n\t\t}\n\t\t.retold-remote-collections-edit-textarea\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tmin-height: 80px;\n\t\t\tpadding: 6px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t\tresize: vertical;\n\t\t}\n\t\t.retold-remote-collections-edit-textarea:focus\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\toutline: none;\n\t\t}\n\t\t.retold-remote-collections-edit-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 8px;\n\t\t\tmargin-top: 16px;\n\t\t}\n\t\t.retold-remote-collections-edit-btn\n\t\t{\n\t\t\tpadding: 6px 14px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-collections-edit-btn:hover\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-collections-edit-btn-primary\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.retold-remote-collections-edit-btn-primary:hover\n\t\t{\n\t\t\topacity: 0.9;\n\t\t}\n\t\t.retold-remote-collections-edit-btn-danger\n\t\t{\n\t\t\tborder-color: var(--retold-danger-muted, #e55);\n\t\t\tcolor: var(--retold-danger-muted, #e55);\n\t\t\tmargin-top: 16px;\n\t\t}\n\t\t.retold-remote-collections-edit-btn-danger:hover\n\t\t{\n\t\t\tbackground: rgba(200, 50, 50, 0.1);\n\t\t}\n\t\t/* ---- Drag-and-drop feedback ---- */\n\t\t.retold-remote-collection-item.dragging\n\t\t{\n\t\t\topacity: 0.4;\n\t\t}\n\t\t.retold-remote-collection-item.drag-over\n\t\t{\n\t\t\tborder-top: 2px solid var(--retold-accent);\n\t\t}\n\t",Templates:[{Hash:"RetoldRemote-CollectionsPanel",Template:'<div class="retold-remote-collections-panel" id="RetoldRemote-CollectionsPanel-Root"></div>'}],Renderables:[{RenderableHash:"RetoldRemote-CollectionsPanel",TemplateHash:"RetoldRemote-CollectionsPanel",DestinationAddress:"#RetoldRemote-Collections-Container"}]};class r extends i{constructor(t,e,n){super(t,e,n),this._draggedItemId=null}onAfterRender(){super.onAfterRender(),this.renderContent()}renderContent(){let t=document.getElementById("RetoldRemote-CollectionsPanel-Root");if(t)switch(this.pict.AppData.RetoldRemote.CollectionsPanelMode){case"detail":this._renderDetailMode(t);break;case"edit":this._renderEditMode(t);break;default:this._renderListMode(t)}}_renderListMode(t){let e=this,n=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"];t.innerHTML="";let o=document.createElement("div");o.className="retold-remote-collections-header";let r=document.createElement("div");r.className="retold-remote-collections-header-title",r.textContent="Collections";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="New Collection",s.textContent="+",s.onclick=()=>{let t=prompt("Collection name:");t&&t.trim()&&i.createCollection(t.trim(),(t,e)=>{!t&&e&&(n.CollectionsPanelMode="detail",i.fetchCollection(e.GUID))})},o.appendChild(r),o.appendChild(s),t.appendChild(o);let a=document.createElement("div");a.className="retold-remote-collections-search";let l=document.createElement("input");l.type="text",l.placeholder="Search collections...",l.value=n.CollectionSearchQuery||"",l.oninput=i=>{n.CollectionSearchQuery=i.target.value,e._renderCollectionCards(t.querySelector(".retold-remote-collections-body"))},a.appendChild(l),t.appendChild(a);let d=document.createElement("div");d.className="retold-remote-collections-body",t.appendChild(d),this._renderCollectionCards(d)}_renderCollectionCards(t){if(!t)return;let e=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"],i=this.pict.providers["RetoldRemote-Icons"];t.innerHTML="";let o=n.searchCollections(e.CollectionSearchQuery);if(!o||0===o.length){let n=document.createElement("div");return n.className="retold-remote-collections-empty",n.textContent=e.CollectionSearchQuery?"No collections match your search.":"No collections yet. Click + to create one.",void t.appendChild(n)}for(let r=0;r<o.length;r++){let s=o[r],a=document.createElement("div");a.className="retold-remote-collection-card",a.onclick=()=>{e.CollectionsPanelMode="detail",n.fetchCollection(s.GUID)};let l=document.createElement("div");l.className="retold-remote-collection-card-icon",i&&"function"==typeof i.getIcon?l.innerHTML=i.getIcon("bookmark",18):l.textContent="☰";let d=document.createElement("div");d.className="retold-remote-collection-card-info";let c=document.createElement("div");c.className="retold-remote-collection-card-name",c.textContent=s.Name||"Untitled";let p=document.createElement("div");p.className="retold-remote-collection-card-meta",p.textContent=s.ItemCount+" item"+(1!==s.ItemCount?"s":""),d.appendChild(c),d.appendChild(p),a.appendChild(l),a.appendChild(d),t.appendChild(a)}}_renderDetailMode(t){let e=this,n=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"],o=n.ActiveCollection;if(t.innerHTML="",!o)return void(t.innerHTML='<div class="retold-remote-collections-empty">Loading...</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="Back to list",s.textContent="←",s.onclick=()=>{n.CollectionsPanelMode="list",n.ActiveCollectionGUID=null,n.ActiveCollection=null,e.renderContent()};let a=document.createElement("div");a.className="retold-remote-collections-header-title",a.textContent=o.Name||"Untitled";let l=document.createElement("button");l.className="retold-remote-collections-header-btn",l.title="Edit collection",l.textContent="✎",l.onclick=()=>{n.CollectionsPanelMode="edit",e.renderContent()},r.appendChild(s),r.appendChild(a),r.appendChild(l),t.appendChild(r);let d="operation-plan"===o.CollectionType;if(d){let e=document.createElement("div");e.className="retold-remote-collections-detail-controls retold-remote-collections-op-controls";let n=o.Items||[],r=0,s=0,a=0,l=0;for(let t=0;t<n.length;t++){let e=n[t].OperationStatus;"completed"===e?s++:"failed"===e?a++:"skipped"===e?l++:n[t].Operation&&r++}let d=document.createElement("div");d.className="retold-remote-collections-op-summary";let c=[];r>0&&c.push(r+" pending"),s>0&&c.push(s+" done"),a>0&&c.push(a+" failed"),l>0&&c.push(l+" skipped"),d.textContent=c.join(" · ")||"No operations",e.appendChild(d);let p=document.createElement("div");if(p.className="retold-remote-collections-op-buttons",r>0){let t=document.createElement("button");t.className="retold-remote-collections-op-execute-btn",t.textContent="Execute "+r+" Move"+(r>1?"s":""),t.onclick=()=>{t.disabled=!0,t.textContent="Moving...",i.executeCollectionOperations(o.GUID)},p.appendChild(t)}if(o.OperationBatchGUID&&s>0){let t=document.createElement("button");t.className="retold-remote-collections-op-undo-btn",t.textContent="Undo",t.onclick=()=>{t.disabled=!0,t.textContent="Undoing...",i.undoCollectionOperations(o.GUID)},p.appendChild(t)}e.appendChild(p),t.appendChild(e)}else{let e=document.createElement("div");e.className="retold-remote-collections-detail-controls";let r=document.createElement("select");r.className="retold-remote-collections-sort-select";let s=[{value:"manual",label:"Manual"},{value:"name",label:"Name"},{value:"modified",label:"Date Added"},{value:"type",label:"Type"}];for(let t=0;t<s.length;t++){let e=document.createElement("option");e.value=s[t].value,e.textContent=s[t].label,o.SortMode===s[t].value&&(e.selected=!0),r.appendChild(e)}r.onchange=t=>{i.sortActiveCollection(t.target.value,null)};let a=document.createElement("button");a.className="retold-remote-collections-sort-dir",a.textContent="desc"===o.SortDirection?"↓":"↑",a.title="desc"===o.SortDirection?"Descending":"Ascending",a.onclick=()=>{let t="desc"===n.ActiveCollection.SortDirection?"asc":"desc";i.sortActiveCollection(null,t)},e.appendChild(r),e.appendChild(a),t.appendChild(e)}let c=document.createElement("div");c.className="retold-remote-collections-body",t.appendChild(c),d?this._renderOperationItemList(c,o):this._renderItemList(c,o)}_renderItemList(t,e){let n=this,i=this.pict.AppData.RetoldRemote,o=this.pict.providers["RetoldRemote-CollectionManager"],r=e.Items||[];if(t.innerHTML="",0===r.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items yet. Browse files and add them to this collection.",void t.appendChild(e)}for(let s=0;s<r.length;s++){let a=r[s],l=document.createElement("div");if(l.className="retold-remote-collection-item",l.setAttribute("data-item-id",a.ID),"manual"===e.SortMode){let e=document.createElement("div");e.className="retold-remote-collection-item-drag",e.textContent="☰",e.draggable=!0,e.ondragstart=t=>{n._draggedItemId=a.ID,l.classList.add("dragging"),t.dataTransfer.effectAllowed="move"},e.ondragend=()=>{l.classList.remove("dragging"),n._draggedItemId=null;let e=t.querySelectorAll(".retold-remote-collection-item");for(let t=0;t<e.length;t++)e[t].classList.remove("drag-over")},l.appendChild(e)}l.ondragover=t=>{t.preventDefault(),t.dataTransfer.dropEffect="move",l.classList.add("drag-over")},l.ondragleave=()=>{l.classList.remove("drag-over")},l.ondrop=t=>{if(t.preventDefault(),l.classList.remove("drag-over"),n._draggedItemId&&n._draggedItemId!==a.ID){let t=e.Items||[],i=[];for(let e=0;e<t.length;e++)t[e].ID!==n._draggedItemId&&(t[e].ID===a.ID&&i.push(n._draggedItemId),i.push(t[e].ID));o.reorderItems(e.GUID,i)}};let d=document.createElement("div");d.className="retold-remote-collection-item-icon";let c=a.Path||"",p=c.replace(/^.*\./,"").toLowerCase(),h=this.pict.PictApplication._getMediaType(p);if("image"===h&&"file"===a.Type){let t=document.createElement("img"),e=this.pict.providers["RetoldRemote-Provider"];e&&(t.src=e.getThumbnailURL(c,48,48)),t.alt="",t.loading="lazy",d.appendChild(t)}else d.textContent=this._getTypeIcon(a.Type,h);let u=document.createElement("div");u.className="retold-remote-collection-item-name",u.textContent=a.Label||c.split("/").pop()||c,u.title=c;let m=document.createElement("div");m.className="retold-remote-collection-item-type",m.textContent=a.Type||"file";let f=document.createElement("button");f.className="retold-remote-collection-item-remove",f.title="Remove from collection",f.textContent="×",f.onclick=t=>{t.stopPropagation(),o.removeItemFromCollection(e.GUID,a.ID)};let g=s;l.onclick=()=>{"file"===a.Type||"subfile"===a.Type||"image-crop"===a.Type||"video-clip"===a.Type||"video-frame"===a.Type?(i.BrowsingCollection=!0,i.BrowsingCollectionIndex=g,n.pict.PictApplication.navigateToFile(a.Path)):"folder"!==a.Type&&"folder-contents"!==a.Type||n.pict.PictApplication.loadFileList(a.Path)},l.appendChild(d),l.appendChild(u),l.appendChild(m),l.appendChild(f),t.appendChild(l)}}_renderOperationItemList(t,e){let n=this,i=this.pict.providers["RetoldRemote-CollectionManager"],o=e.Items||[];if(t.innerHTML="",0===o.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items in this sort plan.",void t.appendChild(e)}for(let r=0;r<o.length;r++){let s=o[r],a=document.createElement("div");a.className="retold-remote-collection-op-item";let l=s.OperationStatus||"pending";a.classList.add("op-status-"+l);let d=document.createElement("div");d.className="retold-remote-collection-op-status","completed"===l?(d.textContent="✓",d.title="Completed"):"failed"===l?(d.textContent="✗",d.title=s.OperationError||"Failed"):"skipped"===l?(d.textContent="—",d.title="Skipped"):(d.textContent="○",d.title="Pending");let c=document.createElement("div");c.className="retold-remote-collection-op-source";let p=s.Path||"";c.textContent=p.split("/").pop()||p,c.title=p;let h=document.createElement("div");h.className="retold-remote-collection-op-arrow",h.textContent="→";let u=document.createElement("div");u.className="retold-remote-collection-op-dest";let m=s.DestinationPath||"";u.textContent=m||"(no destination)",u.title=m,"pending"===l&&(u.style.cursor="pointer",u.onclick=t=>{t.stopPropagation(),n._startEditDestination(u,s,e)});let f=document.createElement("div");f.className="retold-remote-collection-op-badge",f.textContent=(s.Operation||"move").toUpperCase();let g=document.createElement("button");if(g.className="retold-remote-collection-item-remove",g.title="Skip this operation",g.textContent="×","pending"===l?g.onclick=t=>{t.stopPropagation(),i.skipItemOperation(s.ID)}:g.style.visibility="hidden","failed"===l&&s.OperationError){let t=document.createElement("div");t.className="retold-remote-collection-op-error",t.textContent=s.OperationError,a.appendChild(t)}a.appendChild(d),a.appendChild(c),a.appendChild(h),a.appendChild(u),a.appendChild(f),a.appendChild(g),t.appendChild(a)}}_startEditDestination(t,e,n){let i=this.pict.providers["RetoldRemote-CollectionManager"],o=document.createElement("input");o.type="text",o.className="retold-remote-collection-op-dest-input",o.value=e.DestinationPath||"";o.onblur=()=>{let n=o.value.trim();n&&n!==e.DestinationPath&&i.setItemDestination(e.ID,n),t.textContent=n||e.DestinationPath||"(no destination)",t.title=n||e.DestinationPath||""},o.onkeydown=n=>{"Enter"===n.key?(n.preventDefault(),o.blur()):"Escape"===n.key&&(n.preventDefault(),t.textContent=e.DestinationPath||"(no destination)",t.title=e.DestinationPath||"")},t.textContent="",t.appendChild(o),o.focus(),o.select()}_renderEditMode(t){let e=this,n=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"],o=n.ActiveCollection;if(t.innerHTML="",!o)return void(t.innerHTML='<div class="retold-remote-collections-empty">No collection selected.</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let s=document.createElement("button");s.className="retold-remote-collections-header-btn",s.title="Back to detail",s.textContent="←",s.onclick=()=>{n.CollectionsPanelMode="detail",e.renderContent()};let a=document.createElement("div");a.className="retold-remote-collections-header-title",a.textContent="Edit Collection",r.appendChild(s),r.appendChild(a),t.appendChild(r);let l=document.createElement("div");l.className="retold-remote-collections-body";let d=document.createElement("div");d.className="retold-remote-collections-edit",d.appendChild(this._createEditGroup("Name","input",o.Name||"","edit-name")),d.appendChild(this._createEditGroup("Description (Markdown)","textarea",o.Description||"","edit-description"));let c=this._createEditGroup("Cover Image Path","input",o.CoverImage||"","edit-cover"),p=this.pict.AppData.ContentEditor.CurrentFile;if(p){let t=document.createElement("button");t.className="retold-remote-collections-edit-btn",t.textContent="Use current file",t.style.marginTop="4px",t.style.fontSize="0.72rem",t.onclick=()=>{let t=document.getElementById("retold-remote-edit-cover");t&&(t.value=p)},c.appendChild(t)}d.appendChild(c),d.appendChild(this._createEditGroup("Tags (comma-separated)","input",(o.Tags||[]).join(", "),"edit-tags"));let h=document.createElement("div");h.className="retold-remote-collections-edit-actions";let u=document.createElement("button");u.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-primary",u.textContent="Save",u.onclick=()=>{let t=document.getElementById("retold-remote-edit-name"),e=document.getElementById("retold-remote-edit-description"),r=document.getElementById("retold-remote-edit-cover"),s=document.getElementById("retold-remote-edit-tags"),a={GUID:o.GUID,Name:t?t.value:o.Name,Description:e?e.value:o.Description,CoverImage:r?r.value:o.CoverImage,Tags:s?s.value.split(",").map(t=>t.trim()).filter(t=>t):o.Tags};i.updateCollection(a,t=>{if(!t){n.CollectionsPanelMode="detail",i.fetchCollection(o.GUID);let t=i._getToast();t&&t.show("Collection saved")}})};let m=document.createElement("button");m.className="retold-remote-collections-edit-btn",m.textContent="Cancel",m.onclick=()=>{n.CollectionsPanelMode="detail",e.renderContent()},h.appendChild(u),h.appendChild(m),d.appendChild(h);let f=document.createElement("button");f.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-danger",f.textContent="Delete Collection",f.onclick=()=>{confirm("Delete this collection? This cannot be undone.")&&i.deleteCollection(o.GUID)},d.appendChild(f),l.appendChild(d),t.appendChild(l)}_createEditGroup(t,e,n,i){let o=document.createElement("div");o.className="retold-remote-collections-edit-group";let r,s=document.createElement("div");return s.className="retold-remote-collections-edit-label",s.textContent=t,"textarea"===e?(r=document.createElement("textarea"),r.className="retold-remote-collections-edit-textarea"):(r=document.createElement("input"),r.className="retold-remote-collections-edit-input",r.type="text"),r.value=n,r.id="retold-remote-"+i,o.appendChild(s),o.appendChild(r),o}_getTypeIcon(t,e){switch(t){case"folder":case"folder-contents":return"📁";case"subfile":return"🗄";case"image-crop":return"✂";case"video-clip":case"video-frame":return"🎬"}switch(e){case"image":return"🖼";case"video":return"🎬";case"audio":return"🎵";default:return"📄"}}}r.default_configuration=o,e.exports=r},{"pict-view":76}],131:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-Gallery",DefaultRenderable:"RetoldRemote-Gallery-Grid",DefaultDestinationAddress:"#RetoldRemote-Gallery-Container",AutoRender:!1,CSS:'\n\t\t.retold-remote-gallery-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tmargin-bottom: 8px;\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.retold-remote-gallery-filter\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.retold-remote-gallery-filter-btn\n\t\t{\n\t\t\tpadding: 3px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-gallery-filter-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tborder-color: var(--retold-scrollbar-hover);\n\t\t}\n\t\t.retold-remote-gallery-filter-btn.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t.retold-remote-gallery-filter-toggle\n\t\t{\n\t\t\tposition: relative;\n\t\t}\n\t\t.retold-remote-gallery-filter-toggle.has-filters\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-gallery-filter-count\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tmin-width: 14px;\n\t\t\theight: 14px;\n\t\t\tline-height: 14px;\n\t\t\tpadding: 0 3px;\n\t\t\tborder-radius: 7px;\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-tertiary);\n\t\t\tfont-size: 0.58rem;\n\t\t\tfont-weight: 700;\n\t\t\ttext-align: center;\n\t\t\tmargin-left: 4px;\n\t\t}\n\t\t/* Sort dropdown */\n\t\t.retold-remote-gallery-sort\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t\t.retold-remote-gallery-sort-select\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-gallery-sort-select:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-gallery-search\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmax-width: 300px;\n\t\t\tpadding: 4px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-gallery-search:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-gallery-search::placeholder\n\t\t{\n\t\t\tcolor: var(--retold-text-placeholder);\n\t\t}\n\t\t.retold-remote-gallery-search-options\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-gallery-search-option\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 3px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tcursor: pointer;\n\t\t\twhite-space: nowrap;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.retold-remote-gallery-search-option:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-gallery-search-option input[type="checkbox"]\n\t\t{\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t\taccent-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-gallery-search-option.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-gallery-search-regex-error\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: #e06c75;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t/* Filter chips */\n\t\t.retold-remote-filter-chips\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 6px;\n\t\t\tmargin-bottom: 8px;\n\t\t\talign-items: center;\n\t\t}\n\t\t.retold-remote-filter-chip\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tpadding: 2px 8px;\n\t\t\tborder: 1px solid var(--retold-border-light);\n\t\t\tborder-radius: 12px;\n\t\t\tbackground: rgba(128, 128, 128, 0.08);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.68rem;\n\t\t}\n\t\t.retold-remote-filter-chip-remove\n\t\t{\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.82rem;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0 2px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.retold-remote-filter-chip-remove:hover\n\t\t{\n\t\t\tcolor: var(--retold-danger);\n\t\t}\n\t\t.retold-remote-filter-chip-clear\n\t\t{\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.68rem;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 2px 4px;\n\t\t}\n\t\t.retold-remote-filter-chip-clear:hover\n\t\t{\n\t\t\tcolor: var(--retold-danger);\n\t\t}\n\t\t/* Filter panel */\n\t\t.retold-remote-filter-panel\n\t\t{\n\t\t\tmargin-bottom: 12px;\n\t\t\tpadding: 12px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 6px;\n\t\t\tbackground: var(--retold-bg-panel);\n\t\t}\n\t\t.retold-remote-filter-panel-grid\n\t\t{\n\t\t\tdisplay: grid;\n\t\t\tgrid-template-columns: 1fr 1fr;\n\t\t\tgap: 12px 24px;\n\t\t}\n\t\t.retold-remote-filter-section\n\t\t{\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.retold-remote-filter-section-title\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.retold-remote-filter-ext-list\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 2px 10px;\n\t\t}\n\t\t.retold-remote-filter-ext-item\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.retold-remote-filter-ext-item input\n\t\t{\n\t\t\taccent-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-filter-ext-count\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.65rem;\n\t\t}\n\t\t.retold-remote-filter-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.retold-remote-filter-input\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.72rem;\n\t\t\twidth: 100px;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-filter-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-filter-label\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.68rem;\n\t\t}\n\t\t.retold-remote-filter-actions\n\t\t{\n\t\t\tgrid-column: 1 / -1;\n\t\t\tdisplay: flex;\n\t\t\tgap: 8px;\n\t\t\talign-items: center;\n\t\t\tpadding-top: 8px;\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tmargin-top: 8px;\n\t\t}\n\t\t.retold-remote-filter-preset-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 6px;\n\t\t\talign-items: center;\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.retold-remote-filter-preset-select\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.72rem;\n\t\t\tmin-width: 100px;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-filter-preset-input\n\t\t{\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.72rem;\n\t\t\twidth: 120px;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-filter-preset-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-filter-btn-sm\n\t\t{\n\t\t\tpadding: 2px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.68rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-filter-btn-sm:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tborder-color: var(--retold-scrollbar-hover);\n\t\t}\n\t\t/* Grid layout */\n\t\t.retold-remote-grid\n\t\t{\n\t\t\tdisplay: grid;\n\t\t\tgap: 12px;\n\t\t}\n\t\t.retold-remote-grid.size-small\n\t\t{\n\t\t\tgrid-template-columns: repeat(auto-fill, minmax(120px, 1fr));\n\t\t}\n\t\t.retold-remote-grid.size-medium\n\t\t{\n\t\t\tgrid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n\t\t}\n\t\t.retold-remote-grid.size-large\n\t\t{\n\t\t\tgrid-template-columns: repeat(auto-fill, minmax(300px, 1fr));\n\t\t}\n\t\t/* Tile */\n\t\t.retold-remote-tile\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder: 2px solid transparent;\n\t\t\tborder-radius: 6px;\n\t\t\tcursor: pointer;\n\t\t\toverflow: hidden;\n\t\t\ttransition: border-color 0.15s, transform 0.1s;\n\t\t}\n\t\t.retold-remote-tile:hover\n\t\t{\n\t\t\tborder-color: var(--retold-border-light);\n\t\t}\n\t\t.retold-remote-tile.selected\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbox-shadow: 0 0 0 1px rgba(128, 128, 128, 0.3);\n\t\t}\n\t\t.retold-remote-tile-thumb\n\t\t{\n\t\t\tposition: relative;\n\t\t\twidth: 100%;\n\t\t\tpadding-bottom: 75%; /* 4:3 aspect ratio */\n\t\t\tbackground: var(--retold-bg-thumb);\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.retold-remote-tile-thumb img\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tobject-fit: cover;\n\t\t}\n\t\t.retold-remote-tile-thumb-icon\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: var(--retold-text-placeholder);\n\t\t}\n\t\t.retold-remote-tile-badge\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 6px;\n\t\t\tright: 6px;\n\t\t\tpadding: 1px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.6rem;\n\t\t\tfont-weight: 700;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t}\n\t\t.retold-remote-tile-badge-image { background: rgba(102, 194, 184, 0.8); color: #fff; }\n\t\t.retold-remote-tile-badge-video { background: rgba(180, 102, 194, 0.8); color: #fff; }\n\t\t.retold-remote-tile-badge-audio { background: rgba(194, 160, 102, 0.8); color: #fff; }\n\t\t.retold-remote-tile-badge-document { background: rgba(194, 102, 102, 0.8); color: #fff; }\n\t\t.retold-remote-tile-badge-folder { background: rgba(102, 140, 194, 0.8); color: #fff; }\n\t\t.retold-remote-tile-duration\n\t\t{\n\t\t\tposition: absolute;\n\t\t\tbottom: 6px;\n\t\t\tright: 6px;\n\t\t\tpadding: 1px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: rgba(0, 0, 0, 0.7);\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-tile-label\n\t\t{\n\t\t\tpadding: 6px 8px 2px 8px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-tile-meta\n\t\t{\n\t\t\tpadding: 0 8px 6px 8px;\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t/* List mode */\n\t\t.retold-remote-list\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 2px;\n\t\t}\n\t\t.retold-remote-list-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 6px 10px;\n\t\t\tborder-radius: 4px;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.retold-remote-list-row:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t}\n\t\t.retold-remote-list-row.selected\n\t\t{\n\t\t\tbackground: var(--retold-bg-selected);\n\t\t}\n\t\t.retold-remote-list-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 24px;\n\t\t\ttext-align: center;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-list-name\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-list-ext\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 42px;\n\t\t\ttext-align: right;\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\ttext-transform: uppercase;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-list-size\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 56px;\n\t\t\ttext-align: right;\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-list-date\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 72px;\n\t\t\ttext-align: right;\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t/* Long-press tooltip */\n\t\t.retold-remote-longpress-tooltip\n\t\t{\n\t\t\tposition: fixed;\n\t\t\tz-index: 10000;\n\t\t\tmax-width: 80vw;\n\t\t\tpadding: 6px 12px;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tword-break: break-all;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t/* Column toggle buttons in filter panel */\n\t\t.retold-remote-filter-col-toggles\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.retold-remote-filter-col-toggle\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tpadding: 3px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.retold-remote-filter-col-toggle:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tborder-color: var(--retold-scrollbar-hover);\n\t\t}\n\t\t.retold-remote-filter-col-toggle.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t/* Empty state */\n\t\t.retold-remote-empty\n\t\t{\n\t\t\ttext-align: center;\n\t\t\tpadding: 60px 20px;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-empty-icon\n\t\t{\n\t\t\tfont-size: 3rem;\n\t\t\tmargin-bottom: 12px;\n\t\t}\n\t\t/* Help panel flyout */\n\t\t#RetoldRemote-Help-Panel\n\t\t{\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tz-index: 9999;\n\t\t}\n\t\t.retold-remote-help-backdrop\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground: rgba(0, 0, 0, 0.5);\n\t\t\tdisplay: flex;\n\t\t\talign-items: flex-start;\n\t\t\tjustify-content: flex-end;\n\t\t}\n\t\t.retold-remote-help-flyout\n\t\t{\n\t\t\twidth: 340px;\n\t\t\tmax-height: calc(100vh - 32px);\n\t\t\tmargin: 16px;\n\t\t\tbackground: var(--retold-bg-panel);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 8px;\n\t\t\toverflow-y: auto;\n\t\t\tbox-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);\n\t\t\tanimation: retold-help-slide-in 0.15s ease-out;\n\t\t}\n\t\t@keyframes retold-help-slide-in\n\t\t{\n\t\t\tfrom { transform: translateX(20px); opacity: 0; }\n\t\t\tto { transform: translateX(0); opacity: 1; }\n\t\t}\n\t\t.retold-remote-help-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 14px 16px 10px 16px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t}\n\t\t.retold-remote-help-title\n\t\t{\n\t\t\tfont-size: 0.88rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-help-close\n\t\t{\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 1.2rem;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0 4px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.retold-remote-help-close:hover\n\t\t{\n\t\t\tcolor: var(--retold-danger);\n\t\t}\n\t\t.retold-remote-help-section\n\t\t{\n\t\t\tpadding: 12px 16px 8px 16px;\n\t\t}\n\t\t.retold-remote-help-section + .retold-remote-help-section\n\t\t{\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t}\n\t\t.retold-remote-help-section-title\n\t\t{\n\t\t\tfont-size: 0.65rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-accent);\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.8px;\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.retold-remote-help-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 3px 0;\n\t\t}\n\t\t.retold-remote-help-key\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tmin-width: 72px;\n\t\t\tpadding: 2px 8px;\n\t\t\tborder: 1px solid var(--retold-border-light);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: rgba(255, 255, 255, 0.04);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-family: var(--retold-font-mono, monospace);\n\t\t\tfont-size: 0.72rem;\n\t\t\ttext-align: center;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-help-desc\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.74rem;\n\t\t}\n\t\t.retold-remote-help-footer\n\t\t{\n\t\t\tpadding: 10px 16px;\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-help-footer strong\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t',Templates:[],Renderables:[]};class r extends i{constructor(t,e,n){super(t,e,n),this._intersectionObserver=null}renderGallery(){let t=document.getElementById("RetoldRemote-Gallery-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,n=e.GalleryItems||[],i=e.ViewMode||"list",o=e.ThumbnailSize||"medium",r=e.GalleryCursorIndex||0,s=document.getElementById("RetoldRemote-Gallery-Search"),a=s&&document.activeElement===s,l=a?s.selectionStart:0,d=a?s.selectionEnd:0,c=this._buildHeaderHTML(e.FilterState?e.FilterState.MediaType:"all");if(c+=this._buildFilterPanelHTML(),c+=this._buildFilterChipsHTML(),0===n.length){c+='<div class="retold-remote-empty">';let e=this.pict.providers["RetoldRemote-Icons"];if(c+='<div class="retold-remote-empty-icon"><span class="retold-remote-icon retold-remote-icon-xl">'+(e?e.getIcon("gallery-empty",96):"")+"</span></div>",c+="<div>Empty folder</div>",c+="</div>",t.innerHTML=c,a){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&(t.focus(),t.setSelectionRange(l,d))}return}if(c+="gallery"===i?this._buildGridHTML(n,o,r):this._buildListHTML(n,r),t.innerHTML=c,a){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&(t.focus(),t.setSelectionRange(l,d))}this._setupLazyLoading();let p=this.pict.providers["RetoldRemote-GalleryNavigation"];p&&p.recalculateColumns();let h=this.pict.views["ContentEditor-TopBar"];h&&h.updateFilterIcon&&h.updateFilterIcon()}_buildHeaderHTML(t){let e=this.pict.AppData.RetoldRemote;if(!e.FilterBarVisible)return"";let n=[{key:"all",label:"All"},{key:"images",label:"Images"},{key:"video",label:"Video"},{key:"audio",label:"Audio"},{key:"documents",label:"Docs"}],i='<div class="retold-remote-gallery-header">';i+='<div class="retold-remote-gallery-filter">';for(let e=0;e<n.length;e++){let o=n[e];i+='<button class="retold-remote-gallery-filter-btn'+(o.key===t?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].setFilter('"+o.key+"')\">"+o.label+"</button>"}i+="</div>",i+='<div class="retold-remote-gallery-sort">',i+='<select class="retold-remote-gallery-sort-select" id="RetoldRemote-Gallery-Sort" onchange="pict.views[\'RetoldRemote-Gallery\'].onSortChange(this.value)">';let o=[{value:"folder-first:asc",label:"Folders first"},{value:"name:asc",label:"Name A–Z"},{value:"name:desc",label:"Name Z–A"},{value:"modified:desc",label:"Newest modified"},{value:"modified:asc",label:"Oldest modified"},{value:"created:desc",label:"Newest created"},{value:"created:asc",label:"Oldest created"}],r=(e.SortField||"folder-first")+":"+(e.SortDirection||"asc");for(let t=0;t<o.length;t++){let e=o[t].value===r?" selected":"";i+='<option value="'+o[t].value+'"'+e+">"+o[t].label+"</option>"}i+="</select>",i+="</div>";let s=this.pict.providers["RetoldRemote-GalleryFilterSort"],a=s?s.getActiveFilterChips().length:0;i+='<button class="retold-remote-gallery-filter-btn retold-remote-gallery-filter-toggle'+(a>0?" has-filters":"")+'" onclick="pict.views[\'RetoldRemote-Gallery\'].toggleFilterPanel()">⚙ Filters',a>0&&(i+='<span class="retold-remote-gallery-filter-count">'+a+"</span>"),i+="</button>";let l=e.SearchQuery||"";i+='<input type="text" class="retold-remote-gallery-search" id="RetoldRemote-Gallery-Search" placeholder="Search files... (/)" value="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l)+'" oninput="pict.views[\'RetoldRemote-Gallery\'].onSearchInput(this.value)">';let d=e.SearchCaseSensitive||!1,c=e.SearchRegex||!1;return i+='<div class="retold-remote-gallery-search-options">',i+='<label class="retold-remote-gallery-search-option'+(d?" active":"")+'"><input type="checkbox" '+(d?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchCaseSensitiveChange(this.checked)\">Aa</label>",i+='<label class="retold-remote-gallery-search-option'+(c?" active":"")+'"><input type="checkbox" '+(c?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchRegexChange(this.checked)\">.*</label>",e._searchRegexError&&(i+='<span class="retold-remote-gallery-search-regex-error" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e._searchRegexError)+'">invalid regex</span>'),i+="</div>",i+="</div>",i}_buildFilterPanelHTML(){let t=this.pict.AppData.RetoldRemote;if(!t.FilterPanelOpen)return"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"],n=e?e.getAvailableExtensions():[],i=t.FilterState||{},o='<div class="retold-remote-filter-panel">';o+='<div class="retold-remote-filter-panel-grid">',o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">File Type</div>',o+='<div class="retold-remote-filter-ext-list">';let r=i.Extensions||[];for(let t=0;t<n.length;t++){let e=n[t];o+='<label class="retold-remote-filter-ext-item">',o+='<input type="checkbox" '+(0===r.length||r.indexOf(e.ext)>=0?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onExtensionToggle('"+e.ext+"', this.checked)\">",o+=" ."+e.ext+' <span class="retold-remote-filter-ext-count">('+e.count+")</span>",o+="</label>"}return o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">File Size</div>',o+='<div class="retold-remote-filter-row">',o+='<input type="number" class="retold-remote-filter-input" placeholder="Min KB" value="'+(null!==i.SizeMin&&void 0!==i.SizeMin?Math.round(i.SizeMin/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('min', this.value)\">",o+='<span class="retold-remote-filter-label">to</span>',o+='<input type="number" class="retold-remote-filter-input" placeholder="Max KB" value="'+(null!==i.SizeMax&&void 0!==i.SizeMax?Math.round(i.SizeMax/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('max', this.value)\">",o+='<span class="retold-remote-filter-label">KB</span>',o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">Modified Date</div>',o+='<div class="retold-remote-filter-row">',o+='<input type="date" class="retold-remote-filter-input" value="'+(i.DateModifiedAfter||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedAfter', this.value)\">",o+='<span class="retold-remote-filter-label">to</span>',o+='<input type="date" class="retold-remote-filter-input" value="'+(i.DateModifiedBefore||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedBefore', this.value)\">",o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">List Columns</div>',o+='<div class="retold-remote-filter-col-toggles">',o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowExtension?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowExtension')\">Ext</button>",o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowSize?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowSize')\">Size</button>",o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowDate?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowDate')\">Date</button>",o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">Presets</div>',o+=this._buildPresetControlsHTML(),o+="</div>",o+='<div class="retold-remote-filter-actions">',o+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear All Filters</button>',o+="</div>",o+="</div>",o+="</div>",o}_buildPresetControlsHTML(){let t=this.pict.AppData.RetoldRemote.FilterPresets||[],e='<div class="retold-remote-filter-preset-row">';if(t.length>0){e+='<select class="retold-remote-filter-preset-select" id="RetoldRemote-Filter-PresetSelect" onchange="pict.views[\'RetoldRemote-Gallery\'].loadFilterPreset(this.value)">',e+='<option value="">Load preset...</option>';for(let n=0;n<t.length;n++)e+='<option value="'+n+'">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t[n].Name)+"</option>";e+="</select>",e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].deleteSelectedPreset()">✕</button>'}return e+='<input type="text" class="retold-remote-filter-preset-input" id="RetoldRemote-Filter-PresetName" placeholder="Preset name...">',e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].saveFilterPreset()">Save</button>',e+="</div>",e}_buildFilterChipsHTML(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(!t)return"";let e=t.getActiveFilterChips();if(0===e.length)return"";let n='<div class="retold-remote-filter-chips">';for(let t=0;t<e.length;t++){let i=e[t];n+='<span class="retold-remote-filter-chip">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.label)+" <button class=\"retold-remote-filter-chip-remove\" onclick=\"pict.views['RetoldRemote-Gallery'].removeFilterChip('"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.key)+"')\">&times;</button></span>"}return n+='<button class="retold-remote-filter-chip-clear" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear all</button>',n+="</div>",n}_buildGridHTML(t,e,n){let i='<div class="retold-remote-grid size-'+e+'">',o=this.pict.providers["RetoldRemote-Provider"],r=this.pict.providers["RetoldRemote-Icons"];for(let e=0;e<t.length;e++){let s=t[e],a=e===n?" selected":"",l=(s.Extension||"").toLowerCase(),d=this._getCategory(l,s.Type);if(i+='<div class="retold-remote-tile'+a+'" data-index="'+e+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+e+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+e+')">',i+='<div class="retold-remote-tile-thumb">',"folder"===s.Type)i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("folder",48):"")+"</span></div>",i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Folder</span>';else if("archive"===s.Type)i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-archive",48):"")+"</span></div>",i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Archive</span>';else if("image"===d&&o){let t=o.getThumbnailURL(s.Path,400,300);i+=t?'<img data-src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-image",48):"")+"</span></div>",i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-image">'+l+"</span>"}else if("video"===d){if(o){let t=o.getThumbnailURL(s.Path,400,300);i+=t?'<img data-src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-video",48):"")+"</span></div>"}else i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-video",48):"")+"</span></div>";i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-video">Video</span>'}else"audio"===d?(i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-audio",48):"")+"</span></div>",i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-audio">Audio</span>'):"document"===d?(i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIconForEntry(s,48):"")+"</span></div>",i+='<span class="retold-remote-tile-badge retold-remote-tile-badge-document">'+l+"</span>"):i+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIconForEntry(s,48):"")+"</span></div>";i+="</div>",i+='<div class="retold-remote-tile-label" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+'">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.Name)+"</div>","file"===s.Type&&void 0!==s.Size?i+='<div class="retold-remote-tile-meta">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(s.Size)+"</div>":"folder"===s.Type?i+='<div class="retold-remote-tile-meta">Folder</div>':"archive"===s.Type&&(i+='<div class="retold-remote-tile-meta">Archive'+(s.Size?" · "+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(s.Size):"")+"</div>"),i+="</div>"}return i+="</div>",i}_buildListHTML(t,e){let n=this.pict.AppData.RetoldRemote,i=!1!==n.ListShowExtension,o=!1!==n.ListShowSize,r=!1!==n.ListShowDate,s='<div class="retold-remote-list">',a=this.pict.providers["RetoldRemote-Icons"];for(let n=0;n<t.length;n++){let l=t[n],d=n===e?" selected":"",c="";if(a&&(c='<span class="retold-remote-icon retold-remote-icon-sm">'+a.getIconForEntry(l,16)+"</span>"),s+='<div class="retold-remote-list-row'+d+'" data-index="'+n+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+n+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+n+')">',s+='<div class="retold-remote-list-icon">'+c+"</div>",s+='<div class="retold-remote-list-name" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name)+"\" ontouchstart=\"pict.views['RetoldRemote-Gallery']._onNameTouchStart(event, '"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name).replace(/'/g,"\\&#39;")+"')\" ontouchend=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\" ontouchcancel=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\">"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l.Name)+"</div>",i){let t="";"file"===l.Type||"archive"===l.Type?t=(l.Extension||"").replace(/^\./,"").toLowerCase():"folder"===l.Type&&(t=""),s+='<div class="retold-remote-list-ext">'+t+"</div>"}o&&("file"!==l.Type&&"archive"!==l.Type||void 0===l.Size?s+='<div class="retold-remote-list-size"></div>':s+='<div class="retold-remote-list-size">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(l.Size)+"</div>"),r&&(l.Modified?s+='<div class="retold-remote-list-date">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatShortDate(l.Modified)+"</div>":s+='<div class="retold-remote-list-date"></div>'),s+="</div>"}return s+="</div>",s}_setupLazyLoading(){this._intersectionObserver&&this._intersectionObserver.disconnect();let t=document.querySelectorAll(".retold-remote-tile-thumb img[data-src]");if(0!==t.length){this._intersectionObserver=new IntersectionObserver(t=>{for(let e=0;e<t.length;e++)if(t[e].isIntersecting){let n=t[e].target;n.src=n.getAttribute("data-src"),n.removeAttribute("data-src"),this._intersectionObserver.unobserve(n)}},{rootMargin:"200px"});for(let e=0;e<t.length;e++)this._intersectionObserver.observe(t[e])}}onTileClick(t){let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.moveCursor(t)}onTileDoubleClick(t){this.pict.AppData.RetoldRemote.GalleryCursorIndex=t;let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.openCurrent()}setFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState.MediaType=t;let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];n&&n.applyFilterSort()}onSearchInput(t){this.pict.AppData.RetoldRemote.SearchQuery=t||"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchCaseSensitiveChange(t){this.pict.AppData.RetoldRemote.SearchCaseSensitive=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchRegexChange(t){this.pict.AppData.RetoldRemote.SearchRegex=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSortChange(t){let e=t.split(":"),n=this.pict.AppData.RetoldRemote;n.SortField=e[0],n.SortDirection=e[1]||"asc";let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}toggleFilterPanel(){let t=this.pict.AppData.RetoldRemote;t.FilterPanelOpen=!t.FilterPanelOpen,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}onExtensionToggle(t,e){let n=this.pict.AppData.RetoldRemote.FilterState,i=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e)n.Extensions.length>0&&n.Extensions.push(t);else if(0===n.Extensions.length&&i){let e=i.getAvailableExtensions();n.Extensions=e.map(t=>t.ext).filter(e=>e!==t)}else n.Extensions=n.Extensions.filter(e=>e!==t);i&&i.applyFilterSort()}onSizeFilterChange(t,e){let n=this.pict.AppData.RetoldRemote.FilterState,i=e&&""!==e?1024*parseInt(e,10):null;"min"===t?n.SizeMin=i:n.SizeMax=i;let o=this.pict.providers["RetoldRemote-GalleryFilterSort"];o&&o.applyFilterSort()}onDateFilterChange(t,e){this.pict.AppData.RetoldRemote.FilterState[t]=e||null;let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];n&&n.applyFilterSort()}removeFilterChip(t){let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.removeFilter(t),e.applyFilterSort())}clearAllFilters(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];t&&(t.clearAllFilters(),t.applyFilterSort())}saveFilterPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetName");if(!t||!t.value.trim())return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.savePreset(t.value.trim()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}loadFilterPreset(t){if(""===t||null==t)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.loadPreset(parseInt(t,10)),e.applyFilterSort()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}deleteSelectedPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetSelect");if(!t||""===t.value)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.deletePreset(parseInt(t.value,10)),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}toggleListColumn(t){let e=this.pict.AppData.RetoldRemote,n=e[t];e[t]=!1===n,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}_onNameTouchStart(t,e){let n=this;this._clearLongPressTimer(),this._longPressTimer=setTimeout(function(){n._showLongPressTooltip(t,e)},500)}_onNameTouchEnd(t){this._clearLongPressTimer(),this._hideLongPressTooltip()}_clearLongPressTimer(){this._longPressTimer&&(clearTimeout(this._longPressTimer),this._longPressTimer=null)}_showLongPressTooltip(t,e){this._hideLongPressTooltip();let n=document.createElement("div");n.className="retold-remote-longpress-tooltip",n.textContent=e;let i=t.touches&&t.touches[0];i&&(n.style.left=Math.min(i.clientX,window.innerWidth-20)+"px",n.style.top=i.clientY-50+"px"),document.body.appendChild(n),this._longPressTooltipEl=n,t.preventDefault()}_hideLongPressTooltip(){this._longPressTooltipEl&&(this._longPressTooltipEl.parentNode&&this._longPressTooltipEl.parentNode.removeChild(this._longPressTooltipEl),this._longPressTooltipEl=null)}_getCategory(t,e){if("folder"===e)return"folder";if("archive"===e)return"archive";let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(n)return n.getCategory(t);let i=(t||"").replace(/^\./,"").toLowerCase();return"png"===i||"jpg"===i||"jpeg"===i||"gif"===i||"webp"===i?"image":"mp4"===i||"webm"===i||"mov"===i?"video":"mp3"===i||"wav"===i||"ogg"===i?"audio":"pdf"===i?"document":"other"}}r.default_configuration=o,e.exports=r},{"pict-view":76}],132:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-ImageViewer",DefaultRenderable:"RetoldRemote-ImageViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:"\n\t\t#RetoldRemote-ImageViewer-Img\n\t\t{\n\t\t\timage-orientation: from-image;\n\t\t\ttransition: width 0.15s ease, height 0.15s ease;\n\t\t\tdisplay: block;\n\t\t}\n\t\t.retold-remote-fit-indicator\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 50%;\n\t\t\tleft: 50%;\n\t\t\ttransform: translate(-50%, -50%);\n\t\t\tbackground: rgba(0, 0, 0, 0.7);\n\t\t\tcolor: #fff;\n\t\t\tpadding: 8px 18px;\n\t\t\tborder-radius: 6px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tpointer-events: none;\n\t\t\tz-index: 20;\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.3s ease;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-fit-indicator.visible\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t"};class r extends i{constructor(t,e,n){super(t,e,n),this._zoomLevel=1,this._naturalWidth=0,this._naturalHeight=0,this._resizeHandler=null}initImage(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t)return;this._naturalWidth=t.naturalWidth,this._naturalHeight=t.naturalHeight,this._zoomLevel=1,this._applyDisplay(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler);let e=this,n=null;this._resizeHandler=function(){clearTimeout(n),n=setTimeout(function(){e._applyDisplay()},100)},window.addEventListener("resize",this._resizeHandler)}_getFitMode(){return this.pict.AppData.RetoldRemote.ImageFitMode||"auto"}setFitMode(t){this.pict.AppData.RetoldRemote.ImageFitMode=t,this._zoomLevel=1,this._applyDisplay(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}cycleFitMode(){let t;switch(this._getFitMode()){case"fit":t="auto";break;case"auto":t="original";break;default:t="fit"}this.setFitMode(t),this._showFitModeIndicator(t)}toggleZoom(){this._naturalWidth&&(1===this._zoomLevel?this._zoomLevel=2:this._zoomLevel=1,this._applyDisplay())}zoomIn(){this._zoomLevel=Math.min(1.25*this._zoomLevel,8),this._applyDisplay()}zoomOut(){this._zoomLevel=Math.max(this._zoomLevel/1.25,.25),this._applyDisplay()}zoomReset(){this._zoomLevel=1,this._applyDisplay()}_applyDisplay(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t||!this._naturalWidth)return;let e=t.parentElement;if(!e)return;let n=this._getBaseSize(e),i=Math.round(n.width*this._zoomLevel),o=Math.round(n.height*this._zoomLevel);t.style.maxWidth="none",t.style.maxHeight="none",t.style.objectFit="",t.style.width=i+"px",t.style.height=o+"px",t.style.transform="",this._zoomLevel>1||i>e.clientWidth||o>e.clientHeight?t.style.cursor="zoom-out":t.style.cursor="zoom-in"}_getBaseSize(t){let e=this._naturalWidth,n=this._naturalHeight,i=t.clientWidth,o=t.clientHeight;if(!i||!o)return{width:e,height:n};let r=e/n;switch(this._getFitMode()){case"fit":{let t=i,e=i/r;return e>o&&(e=o,t=o*r),{width:t,height:e}}case"auto":{if(e<=i&&n<=o)return{width:e,height:n};let t=i,s=i/r;return s>o&&(s=o,t=o*r),{width:t,height:s}}default:return{width:e,height:n}}}_showFitModeIndicator(t){let e={fit:"Fit to Window",auto:"Original if Smaller",original:"Original Size"}[t]||t;this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator(e,1200)}cleanup(){this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null)}}r.default_configuration=o,e.exports=r},{"pict-view":76}],133:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"RetoldRemote-Layout-Shell",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:"\n\t\t#ContentEditor-Application-Container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\theight: 100dvh;\n\t\t\tbackground: var(--retold-bg-primary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tfont-family: var(--retold-font-family, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif);\n\t\t}\n\t\t#ContentEditor-TopBar-Container\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-body\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t/* Sidebar */\n\t\t.content-editor-sidebar-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tposition: relative;\n\t\t\ttransition: width 0.2s ease;\n\t\t}\n\t\t.content-editor-sidebar-inner\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-sidebar-tabs\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t}\n\t\t.content-editor-sidebar-tab\n\t\t{\n\t\t\tflex: 1;\n\t\t\tpadding: 7px 0;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.content-editor-sidebar-tab:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.content-editor-sidebar-tab.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-bottom-color: var(--retold-accent);\n\t\t}\n\t\t.content-editor-sidebar-pane\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t}\n\t\t/* Collapsed state */\n\t\t.content-editor-sidebar-wrap.collapsed\n\t\t{\n\t\t\twidth: 0 !important;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-inner\n\t\t{\n\t\t\tvisibility: hidden;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-resize-handle\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Resize handle */\n\t\t.content-editor-resize-handle\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 5px;\n\t\t\tcursor: col-resize;\n\t\t\tbackground: transparent;\n\t\t\tborder-right: 1px solid var(--retold-border);\n\t\t\ttransition: background 0.15s;\n\t\t}\n\t\t.content-editor-resize-handle:hover,\n\t\t.content-editor-resize-handle.dragging\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tborder-right-color: var(--retold-accent);\n\t\t}\n\t\t/* File browser overrides for sidebar */\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser\n\t\t{\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-browse-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-view-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-modified,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-modified\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-header\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Hide the ugly white + button from the breadcrumb bar */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-breadcrumb-addfolder\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Subtle add-folder button at bottom of file list */\n\t\t.retold-remote-sidebar-addfolder\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tpadding: 8px 12px;\n\t\t\tmargin-top: 4px;\n\t\t\tborder: 1px dashed var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-family: inherit;\n\t\t\tcursor: pointer;\n\t\t\ttext-align: center;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t}\n\t\t.retold-remote-sidebar-addfolder:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tborder-color: var(--retold-text-dim);\n\t\t\tbackground: rgba(128, 128, 128, 0.06);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tborder-bottom-color: var(--retold-border);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row.selected\n\t\t{\n\t\t\tbackground: var(--retold-bg-selected);\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row.sidebar-focused\n\t\t{\n\t\t\toutline: 2px solid var(--retold-accent);\n\t\t\toutline-offset: -2px;\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.content-editor-sidebar-inner.keyboard-focused\n\t\t{\n\t\t\tbox-shadow: inset 0 0 0 1px var(--retold-accent);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-breadcrumb-bar\n\t\t{\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom-color: var(--retold-border);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-breadcrumbs\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tbackground: transparent;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-breadcrumb-link\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t/* Insert button: hidden by default, visible on row hover for ALL files */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tpadding: 1px 6px;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-insert-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row:hover .pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t}\n\t\t/* Main content area */\n\t\t#RetoldRemote-Content-Container\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tposition: relative;\n\t\t}\n\t\t#RetoldRemote-Gallery-Container\n\t\t{\n\t\t\tpadding: 12px;\n\t\t\tpadding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));\n\t\t\tmin-height: 100%;\n\t\t}\n\t\t#RetoldRemote-Viewer-Container\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tbackground: var(--retold-bg-viewer);\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Also hide the editor container from the parent */\n\t\t#ContentEditor-Editor-Container\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t/* ---- Right-side Collections Panel ---- */\n\t\t.retold-remote-collections-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tposition: relative;\n\t\t\ttransition: width 0.2s ease;\n\t\t\tborder-left: 1px solid var(--retold-border);\n\t\t}\n\t\t.retold-remote-collections-wrap.collapsed\n\t\t{\n\t\t\twidth: 0 !important;\n\t\t\tborder-left: none;\n\t\t}\n\t\t.retold-remote-collections-wrap.collapsed .retold-remote-collections-inner\n\t\t{\n\t\t\tvisibility: hidden;\n\t\t}\n\t\t.retold-remote-collections-wrap.collapsed .retold-remote-collections-resize-handle\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.retold-remote-collections-inner\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t\tbackground: var(--retold-bg-primary);\n\t\t}\n\t\t.retold-remote-collections-resize-handle\n\t\t{\n\t\t\tposition: absolute;\n\t\t\tleft: 0;\n\t\t\ttop: 0;\n\t\t\tbottom: 0;\n\t\t\twidth: 5px;\n\t\t\tcursor: col-resize;\n\t\t\tz-index: 10;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.retold-remote-collections-resize-handle:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\topacity: 0.3;\n\t\t}\n\n\t\t/* ============================================================\n\t\t MOBILE: Sidebar becomes a top drawer\n\t\t ============================================================ */\n\t\t@media (max-width: 600px)\n\t\t{\n\t\t\t.content-editor-body\n\t\t\t{\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t/* Sidebar becomes a top section with a height instead of width */\n\t\t\t.content-editor-sidebar-wrap\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\theight: 33vh;\n\t\t\t\theight: 33dvh;\n\t\t\t\ttransition: height 0.2s ease;\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t.content-editor-sidebar-wrap.collapsed\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\theight: 0 !important;\n\t\t\t}\n\n\t\t\t/* Resize handle becomes horizontal bar at the bottom of the drawer */\n\t\t\t.content-editor-resize-handle\n\t\t\t{\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 8px;\n\t\t\t\tcursor: row-resize;\n\t\t\t\tborder-right: none;\n\t\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\n\t\t\t.content-editor-resize-handle::after\n\t\t\t{\n\t\t\t\tcontent: '';\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 36px;\n\t\t\t\theight: 3px;\n\t\t\t\tborder-radius: 2px;\n\t\t\t\tbackground: var(--retold-text-placeholder);\n\t\t\t\topacity: 0.5;\n\t\t\t}\n\n\t\t\t.content-editor-resize-handle:hover::after,\n\t\t\t.content-editor-resize-handle.dragging::after\n\t\t\t{\n\t\t\t\tbackground: var(--retold-accent);\n\t\t\t\topacity: 1;\n\t\t\t}\n\n\t\t\t/* Sidebar inner fills the drawer */\n\t\t\t.content-editor-sidebar-inner\n\t\t\t{\n\t\t\t\tflex: 1;\n\t\t\t\tmin-height: 0;\n\t\t\t}\n\n\t\t\t/* Content takes remaining space */\n\t\t\t#RetoldRemote-Content-Container\n\t\t\t{\n\t\t\t\tflex: 1;\n\t\t\t\tmin-height: 0;\n\t\t\t}\n\n\t\t\t/* Gallery: don't force min-height on small screens */\n\t\t\t#RetoldRemote-Gallery-Container\n\t\t\t{\n\t\t\t\tmin-height: auto;\n\t\t\t}\n\n\t\t\t/* Collections panel: fully hidden on mobile */\n\t\t\t.retold-remote-collections-wrap,\n\t\t\t.retold-remote-collections-wrap.collapsed\n\t\t\t{\n\t\t\t\tdisplay: none !important;\n\t\t\t\theight: 0 !important;\n\t\t\t}\n\t\t}\n\t",Templates:[{Hash:"RetoldRemote-Layout-Shell",Template:'\n\t\t\t\t<div id="ContentEditor-TopBar-Container"></div>\n\t\t\t\t<div class="content-editor-body">\n\t\t\t\t\t<div class="content-editor-sidebar-wrap" style="width: 250px;">\n\t\t\t\t\t\t<div class="content-editor-sidebar-inner">\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab active" data-tab="files" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="settings" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'settings\')">Settings</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="files" id="ContentEditor-Sidebar-Container"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="settings" id="RetoldRemote-Settings-Container" style="display:none"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="content-editor-resize-handle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id="RetoldRemote-Content-Container">\n\t\t\t\t\t\t<div id="RetoldRemote-Gallery-Container"></div>\n\t\t\t\t\t\t<div id="RetoldRemote-Viewer-Container"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="retold-remote-collections-wrap collapsed" id="RetoldRemote-Collections-Wrap" style="width: 300px;">\n\t\t\t\t\t\t<div class="retold-remote-collections-resize-handle"></div>\n\t\t\t\t\t\t<div class="retold-remote-collections-inner">\n\t\t\t\t\t\t\t<div id="RetoldRemote-Collections-Container"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-Layout-Shell",TemplateHash:"RetoldRemote-Layout-Shell",DestinationAddress:"#ContentEditor-Application-Container"}]};class r extends i{constructor(t,e,n){super(t,e,n),this._sidebarDragging=!1,this._collectionsDragging=!1}onAfterRender(){super.onAfterRender(),this.pict.CSSMap.injectCSS(),this._setupResizeHandle();let t=this.pict.AppData.RetoldRemote;if(t&&t.SidebarCollapsed){let t=document.querySelector(".content-editor-sidebar-wrap");t&&t.classList.add("collapsed")}if(!this.isMobileDrawer()&&t&&t.SidebarWidth){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.width=t.SidebarWidth+"px")}if(this.isMobileDrawer()&&t&&t.SidebarDrawerHeight){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.height=t.SidebarDrawerHeight+"px")}if(t&&t.CollectionsPanelOpen){let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&(e.classList.remove("collapsed"),t.CollectionsPanelWidth&&(e.style.width=t.CollectionsPanelWidth+"px"))}this._setupCollectionsResizeHandle();let e=this;window.addEventListener("hashchange",()=>{e.pict.PictApplication.resolveHash()})}isMobileDrawer(){return window.innerWidth<=600}toggleSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t)return;t.classList.toggle("collapsed");let e=this.pict.AppData.RetoldRemote,n=t.classList.contains("collapsed");if(e.SidebarCollapsed=n,!n)if(this.isMobileDrawer()){let n=e.SidebarDrawerHeight||Math.round(.33*window.innerHeight);t.style.height=n+"px"}else e.SidebarWidth&&(t.style.width=e.SidebarWidth+"px");this.pict.PictApplication.saveSettings();let i=this.pict.providers["RetoldRemote-GalleryNavigation"];i&&setTimeout(()=>i.recalculateColumns(),250)}switchSidebarTab(t){if(document.querySelectorAll(".content-editor-sidebar-tab").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-tab")===t)}),document.querySelectorAll(".content-editor-sidebar-pane").forEach(e=>{e.style.display=e.getAttribute("data-pane")===t?"":"none"}),"settings"===t){let t=this.pict.views["RetoldRemote-SettingsPanel"];t&&t.render()}}_setupResizeHandle(){let t=this,e=document.querySelector(".content-editor-resize-handle"),n=document.querySelector(".content-editor-sidebar-wrap");if(!e||!n)return;let i=0,o=0,r=0,s=0;function a(t){return t.touches&&t.touches.length>0?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}}function l(l){t._sidebarDragging=!0;let p=a(l);i=p.x,o=p.y,r=n.offsetWidth,s=n.offsetHeight,e.classList.add("dragging"),document.addEventListener("mousemove",d),document.addEventListener("mouseup",c),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("touchend",c),l.preventDefault()}function d(e){if(!t._sidebarDragging)return;let l=a(e);if(t.isMobileDrawer()){let t=s+(l.y-o),e=Math.round(.7*window.innerHeight);t=Math.max(80,Math.min(t,e)),n.style.height=t+"px"}else{let t=r+(l.x-i);t=Math.max(150,Math.min(t,600)),n.style.width=t+"px"}e.preventDefault()}function c(){t._sidebarDragging=!1,e.classList.remove("dragging"),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",d),document.removeEventListener("touchend",c);let i=t.pict.AppData.RetoldRemote;t.isMobileDrawer()?i.SidebarDrawerHeight=n.offsetHeight:i.SidebarWidth=n.offsetWidth,t.pict.PictApplication.saveSettings();let o=t.pict.providers["RetoldRemote-GalleryNavigation"];o&&o.recalculateColumns()}e.addEventListener("mousedown",l),e.addEventListener("touchstart",l,{passive:!1}),e.addEventListener("dblclick",function(e){e.preventDefault(),t.toggleSidebar()})}toggleCollectionsPanel(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}_setupCollectionsResizeHandle(){let t=document.querySelector(".retold-remote-collections-resize-handle"),e=document.getElementById("RetoldRemote-Collections-Wrap");if(!t||!e)return;let n=this,i=0,o=0;function r(r){if(e.classList.contains("collapsed"))return;r.preventDefault(),n._collectionsDragging=!0,t.classList.add("dragging");let l=r.touches?r.touches[0].clientX:r.clientX;i=l,o=e.getBoundingClientRect().width,document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",a)}function s(t){if(!n._collectionsDragging)return;t.preventDefault();let r=t.touches?t.touches[0].clientX:t.clientX,s=i-r,a=Math.max(150,Math.min(600,o+s));e.style.width=a+"px"}function a(){if(!n._collectionsDragging)return;n._collectionsDragging=!1,t.classList.remove("dragging"),n.pict.AppData.RetoldRemote.CollectionsPanelWidth=e.getBoundingClientRect().width,n.pict.PictApplication.saveSettings(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",a);let i=n.pict.providers["RetoldRemote-GalleryNavigation"];i&&"function"==typeof i.recalculateColumns&&i.recalculateColumns()}t.addEventListener("mousedown",r),t.addEventListener("touchstart",r,{passive:!1}),t.addEventListener("dblclick",function(t){t.preventDefault(),n.toggleCollectionsPanel()})}}r.default_configuration=o,e.exports=r},{"pict-view":76}],134:[function(t,e,n){const i=t("pict-view"),o=t("pict-section-code"),r={ViewIdentifier:"RetoldRemote-MediaViewer",DefaultRenderable:"RetoldRemote-MediaViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:"\n\t\t.retold-remote-viewer\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t}\n\t\t.retold-remote-viewer-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tz-index: 5;\n\t\t}\n\t\t.retold-remote-viewer-nav-btn\n\t\t{\n\t\t\tpadding: 4px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.8rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-viewer-nav-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-viewer-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-viewer-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\toverflow: auto;\n\t\t\tposition: relative;\n\t\t}\n\t\t/* File info overlay */\n\t\t.retold-remote-fileinfo-overlay\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 48px;\n\t\t\tright: 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 16px;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.78rem;\n\t\t\tz-index: 10;\n\t\t\tmin-width: 200px;\n\t\t\tdisplay: none;\n\t\t}\n\t\t.retold-remote-fileinfo-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 3px 0;\n\t\t}\n\t\t.retold-remote-fileinfo-label\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-fileinfo-value\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t/* Code viewer container */\n\t\t.retold-remote-code-viewer-container\n\t\t{\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.retold-remote-code-viewer-loading\n\t\t{\n\t\t\tpadding: 16px 20px;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-style: italic;\n\t\t\tfont-size: 0.82rem;\n\t\t}\n\t\t/* pict-section-code dark theme overrides */\n\t\t.retold-remote-code-viewer-container .pict-code-editor-wrap\n\t\t{\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\theight: 100%;\n\t\t\tfont-family: var(--retold-font-mono, 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace);\n\t\t\tfont-size: 0.82rem;\n\t\t\tline-height: 1.6;\n\t\t}\n\t\t.retold-remote-code-viewer-container .pict-code-line-numbers\n\t\t{\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-right: 1px solid var(--retold-border);\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.78rem;\n\t\t\tline-height: 1.6;\n\t\t\tpadding: 10px 0;\n\t\t}\n\t\t.retold-remote-code-viewer-container .pict-code-editor\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tpadding: 10px 10px 10px 12px;\n\t\t\ttab-size: 4;\n\t\t\t-moz-tab-size: 4;\n\t\t\tcaret-color: var(--retold-accent);\n\t\t\tborder-radius: 0;\n\t\t}\n\t\t/* Syntax highlighting colors for dark themes */\n\t\t.retold-remote-code-viewer-container .pict-code-editor .keyword { color: #C678DD; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .string { color: #98C379; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .number { color: #D19A66; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .comment { color: #5C6370; font-style: italic; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .operator { color: #56B6C2; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .punctuation { color: #ABB2BF; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .function-name { color: #61AFEF; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .property { color: #E06C75; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .tag { color: #E06C75; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .attr-name { color: #D19A66; }\n\t\t.retold-remote-code-viewer-container .pict-code-editor .attr-value { color: #98C379; }\n\t\t/* Video wrap with stats bar */\n\t\t.retold-remote-video-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 100%;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\t.retold-remote-video-wrap video\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: calc(100% - 40px);\n\t\t\tobject-fit: contain;\n\t\t}\n\t\t.retold-remote-video-stats\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 16px;\n\t\t\tpadding: 6px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\twidth: 100%;\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\twhite-space: nowrap;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.retold-remote-video-stats span\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.retold-remote-video-stats .retold-remote-video-stat-label\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-video-stats .retold-remote-video-stat-value\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-explore-btn\n\t\t{\n\t\t\tmargin-left: auto;\n\t\t\tpadding: 3px 12px;\n\t\t\tborder: 1px solid var(--retold-accent);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-explore-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-primary);\n\t\t}\n\t\t.retold-remote-vlc-btn\n\t\t{\n\t\t\tpadding: 3px 12px;\n\t\t\tborder: 1px solid var(--retold-accent);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-vlc-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-primary);\n\t\t}\n\t\t/* Video action menu */\n\t\t.retold-remote-video-action-menu\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 12px;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\t\t.retold-remote-video-action-menu-title\n\t\t{\n\t\t\tfont-size: 0.85rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tmargin-bottom: 4px;\n\t\t\ttext-align: center;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmax-width: 80%;\n\t\t}\n\t\t.retold-remote-video-action-thumb-wrap\n\t\t{\n\t\t\tmargin-bottom: 4px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-video-action-thumb-wrap img\n\t\t{\n\t\t\tmax-width: 640px;\n\t\t\tmax-height: 360px;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tobject-fit: contain;\n\t\t\tbackground: var(--retold-bg-primary);\n\t\t}\n\t\t.retold-remote-video-action-thumb-wrap .retold-remote-video-action-thumb-loading\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-style: italic;\n\t\t\tpadding: 8px;\n\t\t}\n\t\t.retold-remote-video-action-btn\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 12px 24px;\n\t\t\tmin-width: 280px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 6px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.85rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color 0.15s, color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\ttext-align: left;\n\t\t}\n\t\t.retold-remote-video-action-btn:hover,\n\t\t.retold-remote-video-action-btn.selected\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t}\n\t\t.retold-remote-video-action-key\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 2px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-primary);\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-family: var(--retold-font-mono, monospace);\n\t\t\tmin-width: 24px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t/* Ebook reader */\n\t\t.retold-remote-ebook-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tposition: relative;\n\t\t}\n\t\t.retold-remote-ebook-toc\n\t\t{\n\t\t\twidth: 240px;\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-right: 1px solid var(--retold-border);\n\t\t\toverflow-y: auto;\n\t\t\tfont-size: 0.78rem;\n\t\t\tpadding: 8px 0;\n\t\t}\n\t\t.retold-remote-ebook-toc.collapsed\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.retold-remote-ebook-toc-item\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tpadding: 6px 16px;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s, color 0.1s;\n\t\t\tborder: none;\n\t\t\tbackground: none;\n\t\t\twidth: 100%;\n\t\t\ttext-align: left;\n\t\t\tfont-family: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.retold-remote-ebook-toc-item:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-ebook-toc-item.indent-1\n\t\t{\n\t\t\tpadding-left: 32px;\n\t\t}\n\t\t.retold-remote-ebook-toc-item.indent-2\n\t\t{\n\t\t\tpadding-left: 48px;\n\t\t}\n\t\t.retold-remote-ebook-reader\n\t\t{\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tmin-width: 0;\n\t\t\tposition: relative;\n\t\t}\n\t\t.retold-remote-ebook-content\n\t\t{\n\t\t\tflex: 1;\n\t\t\tposition: relative;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.retold-remote-ebook-content iframe\n\t\t{\n\t\t\tborder: none;\n\t\t}\n\t\t.retold-remote-ebook-controls\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 16px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-ebook-page-btn\n\t\t{\n\t\t\tpadding: 6px 20px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.82rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-ebook-page-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-ebook-toc-btn\n\t\t{\n\t\t\tpadding: 6px 12px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-ebook-toc-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-ebook-loading\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\theight: 100%;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.85rem;\n\t\t}\n\t\t/* Distraction-free toggle */\n\t\t.retold-remote-df-toggle\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 8px;\n\t\t\tleft: 8px;\n\t\t\tz-index: 15;\n\t\t\tpadding: 4px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: rgba(0, 0, 0, 0.5);\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.2s ease, color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-viewer-body:hover .retold-remote-df-toggle,\n\t\t.retold-remote-df-toggle:focus\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.retold-remote-df-toggle:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-df-toggle.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t/* Distraction-free exit hotspot (top-left corner) */\n\t\t.retold-remote-df-exit-hotspot\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 80px;\n\t\t\theight: 80px;\n\t\t\tz-index: 16;\n\t\t\tcursor: pointer;\n\t\t\tdisplay: none;\n\t\t}\n\t\t.retold-remote-df-exit-hotspot::after\n\t\t{\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: 12px;\n\t\t\tleft: 12px;\n\t\t\twidth: 8px;\n\t\t\theight: 8px;\n\t\t\tborder-radius: 50%;\n\t\t\tbackground: var(--retold-accent);\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.3s ease;\n\t\t}\n\t\t.retold-remote-df-exit-hotspot:hover::after\n\t\t{\n\t\t\topacity: 0.6;\n\t\t}\n\t"};class s extends i{constructor(t,e,n){super(t,e,n),this._swipeStartX=0,this._swipeStartY=0,this._swipeTouchCount=0,this._swipeHandlers=null,this._dfExitHandlers=null}showMedia(t,e){let n=this.pict.AppData.RetoldRemote;n.ActiveMode="viewer",n.CurrentViewerFile=t,n.CurrentViewerMediaType=e,n.VideoMenuActive="video"===e;let i=document.getElementById("RetoldRemote-Gallery-Container"),o=document.getElementById("RetoldRemote-Viewer-Container");i&&(i.style.display="none"),o&&(o.style.display="block");let r=t.replace(/^.*\//,""),s=this.pict.providers["RetoldRemote-Provider"],a=s?s.getContentURL(t):"/content/"+encodeURIComponent(t),l='<div class="retold-remote-viewer">';switch(l+='<div class="retold-remote-viewer-header">',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].closeViewer()" title="Back (Esc)">&larr; Back</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].prevFile()" title="Previous (k)">&lsaquo; Prev</button>',l+='<div class="retold-remote-viewer-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(r)+"</div>",l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].nextFile()" title="Next (j)">Next &rsaquo;</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFileInfo()" title="Info (i)">&#9432;</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFullscreen()" title="Fullscreen (f)">&#9634;</button>',l+="</div>",l+='<div class="retold-remote-viewer-body">',l+='<button class="retold-remote-df-toggle'+(n._distractionFreeMode?" active":"")+'" id="RetoldRemote-DF-Toggle" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleDistractionFree()" title="Distraction-Free (d)">&#9673; DF</button>',l+='<div class="retold-remote-df-exit-hotspot" id="RetoldRemote-DF-ExitHotspot"'+(n._distractionFreeMode?"":' style="display:none"')+"></div>",e){case"image":l+=this._buildImageHTML(a,r);break;case"video":l+=this._buildVideoHTML(a,r);break;case"audio":l+=this._buildAudioHTML(a,r);break;case"text":l+=this._buildTextHTML(a,r,t);break;case"document":l+=this._buildDocumentHTML(a,r,t);break;default:l+=this._buildFallbackHTML(a,r)}if(l+='<div class="retold-remote-fileinfo-overlay" id="RetoldRemote-FileInfo-Overlay">',l+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Loading...</span></div>',l+="</div>",l+="</div>",l+="</div>",o&&(o.innerHTML=l),this._loadFileInfo(t),"text"===e&&this._loadCodeViewer(a,t),"document"===e){let e=t.replace(/^.*\./,"").toLowerCase();"epub"!==e&&"mobi"!==e||this._loadEbookViewer(a,t)}this._setupSwipeNavigation(),this._setupDFExitHotspot();let d=this.pict.views["ContentEditor-TopBar"];d&&d.updateInfo()}_setupSwipeNavigation(){this._cleanupSwipe();let t=document.querySelector(".retold-remote-viewer-body");if(!t)return;let e=this,n=function(t){e._swipeTouchCount=t.touches.length,1===t.touches.length&&(e._swipeStartX=t.touches[0].clientX,e._swipeStartY=t.touches[0].clientY)},i=function(t){if(1!==e._swipeTouchCount)return;let n=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY,o=n-e._swipeStartX,r=i-e._swipeStartY;if(Math.abs(o)<50||Math.abs(r)>Math.abs(o))return;let s=document.querySelector(".retold-remote-viewer-body");if(s&&s.scrollWidth>s.clientWidth+2)return;let a=e.pict.providers["RetoldRemote-GalleryNavigation"];a&&(o<0?a.nextFile():a.prevFile())};t.addEventListener("touchstart",n,{passive:!0}),t.addEventListener("touchend",i,{passive:!0}),this._swipeHandlers={element:t,touchstart:n,touchend:i}}_cleanupSwipe(){this._swipeHandlers&&(this._swipeHandlers.element.removeEventListener("touchstart",this._swipeHandlers.touchstart),this._swipeHandlers.element.removeEventListener("touchend",this._swipeHandlers.touchend),this._swipeHandlers=null)}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree(),this._updateDFControls()}_updateDFControls(){let t=this.pict.AppData.RetoldRemote._distractionFreeMode||!1,e=document.getElementById("RetoldRemote-DF-Toggle");e&&(t?e.classList.add("active"):e.classList.remove("active"));let n=document.getElementById("RetoldRemote-DF-ExitHotspot");n&&(n.style.display=t?"":"none")}_setupDFExitHotspot(){this._cleanupDFExitHotspot();let t=document.getElementById("RetoldRemote-DF-ExitHotspot");if(!t)return;let e=this,n=function(){e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree()},i=0,o=function(t){let n=Date.now();if(n-i<300){t.preventDefault(),e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree(),i=0}else i=n};t.addEventListener("dblclick",n),t.addEventListener("touchend",o),this._dfExitHandlers={element:t,dblclick:n,touchend:o}}_cleanupDFExitHotspot(){this._dfExitHandlers&&(this._dfExitHandlers.element.removeEventListener("dblclick",this._dfExitHandlers.dblclick),this._dfExitHandlers.element.removeEventListener("touchend",this._dfExitHandlers.touchend),this._dfExitHandlers=null)}_buildImageHTML(t,e){return'<img src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'" style="max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;" id="RetoldRemote-ImageViewer-Img" onload="pict.views[\'RetoldRemote-ImageViewer\'].initImage()" onclick="pict.views[\'RetoldRemote-ImageViewer\'].toggleZoom()">'}_buildVideoHTML(t,e){let n=this.pict.AppData.RetoldRemote.ServerCapabilities||{},i=(this.pict.AppData.RetoldRemote.CurrentViewerFile,'<div class="retold-remote-video-action-menu" id="RetoldRemote-VideoActionMenu">');return i+='<div class="retold-remote-video-action-menu-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div>",n.ffmpeg&&(i+='<div id="RetoldRemote-VideoActionThumb" class="retold-remote-video-action-thumb-wrap"></div>',setTimeout(()=>{this.loadVideoMenuFrame()},0)),n.ffmpeg&&(i+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video"><span class="retold-remote-video-action-key">e</span>Explore Video Frames</button>'),i+='<button class="retold-remote-video-action-btn selected" onclick="pict.views[\'RetoldRemote-MediaViewer\'].playVideo()" title="Play video in browser"><span class="retold-remote-video-action-key">Space</span>Play in Browser</button>',n.ffmpeg&&(i+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].loadVideoMenuFrame()" title="Extract a frame from the midpoint of this video"><span class="retold-remote-video-action-key">t</span>Thumbnail</button>'),i+='<button class="retold-remote-video-action-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device"><span class="retold-remote-video-action-key">v</span>Stream with VLC</button>',i+="</div>",i}playVideo(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;e.replace(/^.*\//,"");let n=this.pict.providers["RetoldRemote-Provider"],i=n?n.getContentURL(e):"/content/"+encodeURIComponent(e),o=t.ServerCapabilities||{},r='<div class="retold-remote-video-wrap">';r+="<video controls"+(t.AutoplayVideo?" autoplay":"")+' preload="metadata" id="RetoldRemote-VideoPlayer"><source src="'+i+'">Your browser does not support the video tag.</video>',r+='<div class="retold-remote-video-stats" id="RetoldRemote-VideoStats">',r+='<span class="retold-remote-video-stat-label">Loading info...</span>',o.ffmpeg&&(r+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video">Explore Video</button>'),r+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device">Stream with VLC</button>',r+="</div>",r+="</div>";let s=document.getElementById("RetoldRemote-VideoActionMenu");s&&(s.outerHTML=r),t.VideoMenuActive=!1}loadVideoMenuFrame(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;let n=document.getElementById("RetoldRemote-VideoActionThumb");if(!n)return;n.innerHTML='<div class="retold-remote-video-action-thumb-loading">Extracting frame...</div>';let i=this.pict.providers["RetoldRemote-Provider"],o=i?i._getPathParam(e):encodeURIComponent(e);fetch("/api/media/video-frames?path="+o+"&count=1").then(t=>t.json()).then(n=>{if(t.CurrentViewerFile!==e)return;let i=document.getElementById("RetoldRemote-VideoActionThumb");if(i)if(n&&n.Frames&&n.Frames.length>0){let t=n.Frames[0],o="/api/media/video-frame/"+n.CacheKey+"/"+t.Filename;i.innerHTML='<img src="'+o+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e.replace(/^.*\//,""))+'" onerror="this.parentNode.innerHTML=\'\'">'}else i.innerHTML=""}).catch(()=>{let t=document.getElementById("RetoldRemote-VideoActionThumb");t&&(t.innerHTML="")})}_buildAudioHTML(t,e){let n=this.pict.providers["RetoldRemote-Icons"],i='<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(n?'<span class="retold-remote-icon retold-remote-icon-lg">'+n.getIcon("music-note",64)+"</span>":"&#127925;")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div><audio controls"+(this.pict.AppData.RetoldRemote.AutoplayAudio?" autoplay":"")+' preload="metadata" id="RetoldRemote-AudioPlayer" style="width: 100%; max-width: 500px;"><source src="'+t+'">Your browser does not support the audio tag.</audio>';i+='<div style="margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;">';let o=this.pict.AppData.RetoldRemote.ServerCapabilities||{};return(o.ffprobe||o.ffmpeg)&&(i+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore waveform and extract segments from this audio">Explore Audio</button>'),i+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device (v)">Stream with VLC</button>',i+="</div>",i+="</div>",i}_buildDocumentHTML(t,e,n){let i=n.replace(/^.*\./,"").toLowerCase();if("pdf"===i)return'<iframe src="'+t+'" style="width: 100%; height: 100%; border: none;"></iframe>';if("epub"===i||"mobi"===i)return this._buildEbookHTML(t,e,n);let o=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(o?'<span class="retold-remote-icon retold-remote-icon-lg">'+o.getIcon("document-large",64)+"</span>":"&#128196;")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Open in new tab</a></div>'}_buildTextHTML(t,e,n){return'<div class="retold-remote-code-viewer-container" id="RetoldRemote-CodeViewer-Container"><div class="retold-remote-code-viewer-loading">Loading...</div></div>'}_getHighlightLanguage(t){if({js:!0,mjs:!0,cjs:!0,ts:!0,tsx:!0,jsx:!0}[t])return"javascript";if("json"===t)return"json";if({html:!0,htm:!0,xml:!0,svg:!0}[t])return"html";return{css:!0,scss:!0,sass:!0,less:!0}[t]?"css":"sql"===t?"sql":"javascript"}_loadCodeViewer(t,e){let n=this,i=e.replace(/^.*\./,"").toLowerCase();fetch(t).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.text()}).then(t=>{let e=document.getElementById("RetoldRemote-CodeViewer-Container");if(!e)return;let r=n._getHighlightLanguage(i);if(n._activeCodeJar&&(n._activeCodeJar.destroy(),n._activeCodeJar=null),"undefined"==typeof window||"function"!=typeof window.CodeJar){e.innerHTML='<div class="retold-remote-code-viewer-loading">CodeJar not loaded; showing plain text.</div>';let n=document.createElement("pre");return n.style.cssText="padding:16px 20px; margin:0; color:var(--retold-text-primary); font-family:monospace; white-space:pre; tab-size:4; overflow:auto; height:100%;",n.textContent=t,void e.appendChild(n)}e.innerHTML="";let s=document.createElement("div");s.className="pict-code-editor-wrap";let a=document.createElement("div");a.className="pict-code-line-numbers",s.appendChild(a);let l=document.createElement("div");l.className="pict-code-editor language-"+r,s.appendChild(l),e.appendChild(s);let d=o.createHighlighter(r);n._activeCodeJar=window.CodeJar(l,d,{tab:"\t",catchTab:!1,addClosing:!1}),l.style.whiteSpace="pre",l.style.overflowWrap="normal",n._activeCodeJar.updateCode(t),l.setAttribute("contenteditable","false");let c=t.split("\n").length,p="";for(let t=1;t<=c;t++)p+="<span>"+t+"</span>";a.innerHTML=p}).catch(t=>{let e=document.getElementById("RetoldRemote-CodeViewer-Container");e&&(e.innerHTML='<div class="retold-remote-code-viewer-loading">Failed to load file: '+t.message+"</div>")})}_buildEbookHTML(t,e,n){return'<div class="retold-remote-ebook-wrap"><div class="retold-remote-ebook-toc collapsed" id="RetoldRemote-EbookTOC"></div><div class="retold-remote-ebook-reader"><div class="retold-remote-ebook-content" id="RetoldRemote-EbookContent"><div class="retold-remote-ebook-loading">Loading ebook...</div></div><div class="retold-remote-ebook-controls"><button class="retold-remote-ebook-toc-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleEbookTOC()">&#9776; TOC</button><button class="retold-remote-ebook-page-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].ebookPrevPage()">&larr; Prev</button><button class="retold-remote-ebook-page-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].ebookNextPage()">Next &rarr;</button></div></div></div>'}_loadEbookViewer(t,e){let n=this;if("mobi"===e.replace(/^.*\./,"").toLowerCase()){if(!(this.pict.AppData.RetoldRemote.ServerCapabilities||{}).ebook_convert){let e=document.getElementById("RetoldRemote-EbookContent");return void(e&&(e.innerHTML='<div class="retold-remote-ebook-loading">MOBI viewing requires Calibre (ebook-convert) on the server.<br><a href="'+t+'" target="_blank" style="color: var(--retold-accent); margin-top: 12px; display: inline-block;">Download file</a></div>'))}let i=document.getElementById("RetoldRemote-EbookContent");i&&(i.innerHTML='<div class="retold-remote-ebook-loading">Converting MOBI to EPUB...</div>');let o=this.pict.providers["RetoldRemote-Provider"],r=o?o._getPathParam(e):encodeURIComponent(e);fetch("/api/media/ebook-convert?path="+r).then(t=>t.json()).then(t=>{if(!t||!t.Success)throw new Error(t?t.Error:"Conversion failed.");let e="/api/media/ebook/"+t.CacheKey+"/"+t.OutputFilename;n._renderEpub(e)}).catch(e=>{let i=document.getElementById("RetoldRemote-EbookContent");i&&(i.innerHTML='<div class="retold-remote-ebook-loading">Failed to convert: '+n.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e.message)+'<br><a href="'+t+'" target="_blank" style="color: var(--retold-accent); margin-top: 12px; display: inline-block;">Download file</a></div>')})}else this._renderEpub(t)}_renderEpub(t){let e=this;if("undefined"==typeof window||"function"!=typeof window.ePub){let t=document.getElementById("RetoldRemote-EbookContent");return void(t&&(t.innerHTML='<div class="retold-remote-ebook-loading">epub.js library not loaded.</div>'))}if(this._activeBook){try{this._activeBook.destroy()}catch(t){}this._activeBook=null,this._activeRendition=null}let n=document.getElementById("RetoldRemote-EbookContent");n&&(n.innerHTML="",fetch(t).then(t=>{if(!t.ok)throw new Error("HTTP "+t.status);return t.arrayBuffer()}).then(t=>{let i=window.ePub(t);e._activeBook=i;let o=i.renderTo(n,{width:"100%",height:"100%",spread:"none"});e._activeRendition=o,o.display(),o.themes.default({body:{color:"var(--retold-text-primary, #d4d4d4)",background:"var(--retold-bg-primary, #1e1e1e)","font-family":'Georgia, "Times New Roman", serif',"line-height":"1.6",padding:"20px 40px"},a:{color:"var(--retold-accent, #569cd6)"}}),i.loaded.navigation.then(t=>{e._renderEbookTOC(t.toc)})}).catch(t=>{n&&(n.innerHTML='<div class="retold-remote-ebook-loading">Failed to load ebook: '+e.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.message)+"</div>")}))}_renderEbookTOC(t){let e=document.getElementById("RetoldRemote-EbookTOC");if(!e||!t)return;let n=this,i="",o=function(t,e){for(let r=0;r<t.length;r++){let s=t[r],a=e>0?" indent-"+Math.min(e,2):"";i+='<button class="retold-remote-ebook-toc-item'+a+'" data-href="'+n.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.href)+"\" onclick=\"pict.views['RetoldRemote-MediaViewer'].ebookGoToChapter(this.getAttribute('data-href'))\">"+n.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s.label.trim())+"</button>",s.subitems&&s.subitems.length>0&&o(s.subitems,e+1)}};o(t,0),e.innerHTML=i}ebookGoToChapter(t){this._activeRendition&&t&&this._activeRendition.display(t)}ebookPrevPage(){this._activeRendition&&this._activeRendition.prev()}ebookNextPage(){this._activeRendition&&this._activeRendition.next()}toggleEbookTOC(){let t=document.getElementById("RetoldRemote-EbookTOC");t&&t.classList.toggle("collapsed")}_buildFallbackHTML(t,e){let n=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(n?'<span class="retold-remote-icon retold-remote-icon-lg">'+n.getIcon("document-large",64)+"</span>":"&#128196;")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Download / Open in new tab</a></div>'}_loadFileInfo(t){let e=this,n=this.pict.providers["RetoldRemote-Provider"];n&&n.fetchMediaProbe(t,(t,n)=>{if(!n)return;let i=document.getElementById("RetoldRemote-FileInfo-Overlay");if(i){let t="";if(void 0!==n.Size&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Size</span><span class="retold-remote-fileinfo-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(n.Size)+"</span></div>"),n.Width&&n.Height&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Dimensions</span><span class="retold-remote-fileinfo-value">'+n.Width+" x "+n.Height+"</span></div>"),n.Duration){let e=Math.floor(n.Duration/60),i=Math.floor(n.Duration%60);t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Duration</span><span class="retold-remote-fileinfo-value">'+e+":"+(i<10?"0":"")+i+"</span></div>"}n.Codec&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Codec</span><span class="retold-remote-fileinfo-value">'+n.Codec+"</span></div>"),n.Format&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Format</span><span class="retold-remote-fileinfo-value">'+n.Format+"</span></div>"),n.Modified&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Modified</span><span class="retold-remote-fileinfo-value">'+new Date(n.Modified).toLocaleString()+"</span></div>"),n.Path&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Path</span><span class="retold-remote-fileinfo-value">'+n.Path+"</span></div>"),i.innerHTML=t}let o=document.getElementById("RetoldRemote-VideoStats");if(o){let t="";if(n.Duration){let e=Math.floor(n.Duration/60),i=Math.floor(n.Duration%60);t+='<span><span class="retold-remote-video-stat-label">Duration</span> <span class="retold-remote-video-stat-value">'+e+":"+(i<10?"0":"")+i+"</span></span>"}if(n.Width&&n.Height&&(t+='<span><span class="retold-remote-video-stat-label">Resolution</span> <span class="retold-remote-video-stat-value">'+n.Width+"×"+n.Height+"</span></span>"),n.Codec&&(t+='<span><span class="retold-remote-video-stat-label">Codec</span> <span class="retold-remote-video-stat-value">'+n.Codec+"</span></span>"),n.Bitrate){let e,i=n.Bitrate;e=i>=1e6?(i/1e6).toFixed(1)+" Mbps":i>=1e3?Math.round(i/1e3)+" kbps":i+" bps",t+='<span><span class="retold-remote-video-stat-label">Bitrate</span> <span class="retold-remote-video-stat-value">'+e+"</span></span>"}void 0!==n.Size&&(t+='<span><span class="retold-remote-video-stat-label">Size</span> <span class="retold-remote-video-stat-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(n.Size)+"</span></span>");let i=o.querySelector(".retold-remote-explore-btn"),r=i?i.outerHTML:"",s=o.querySelector(".retold-remote-vlc-btn"),a=s?s.outerHTML:"";o.innerHTML=t+r+a}})}}s.default_configuration=r,e.exports=s},{"pict-section-code":49,"pict-view":76}],135:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-SettingsPanel",DefaultRenderable:"RetoldRemote-SettingsPanel",DefaultDestinationAddress:"#RetoldRemote-Settings-Container",AutoRender:!1,CSS:"\n\t\t.retold-remote-settings\n\t\t{\n\t\t\tpadding: 12px;\n\t\t}\n\t\t.retold-remote-settings-section\n\t\t{\n\t\t\tmargin-bottom: 16px;\n\t\t}\n\t\t.retold-remote-settings-section-title\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tfont-weight: 700;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.retold-remote-settings-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 4px 0;\n\t\t}\n\t\t.retold-remote-settings-label\n\t\t{\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-settings-select\n\t\t{\n\t\t\tpadding: 3px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-settings-checkbox\n\t\t{\n\t\t\taccent-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-settings-capabilities\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tpadding: 8px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.72rem;\n\t\t}\n\t\t.retold-remote-settings-cap-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 2px 0;\n\t\t}\n\t\t.retold-remote-settings-cap-label\n\t\t{\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-settings-cap-yes\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-settings-cap-no\n\t\t{\n\t\t\tcolor: var(--retold-danger-muted);\n\t\t}\n\t\t.retold-remote-settings-vlc-btn\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tpadding: 8px 12px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-family: inherit;\n\t\t\tcursor: pointer;\n\t\t\ttext-align: left;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t}\n\t\t.retold-remote-settings-vlc-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-settings-input\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.retold-remote-settings-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-settings-input-row\n\t\t{\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.retold-remote-settings-input-label\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-bottom: 3px;\n\t\t}\n\t\t.retold-remote-settings-template-preview\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-top: 3px;\n\t\t\tfont-style: italic;\n\t\t\tword-break: break-all;\n\t\t}\n\t"};class r extends i{constructor(t,e,n){super(t,e,n)}onAfterRender(){super.onAfterRender(),this._renderSettingsContent()}_renderSettingsContent(){let t=document.getElementById("RetoldRemote-Settings-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,n=e.ServerCapabilities||{},i='<div class="retold-remote-settings">';i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">Appearance</div>',i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Theme</span>',i+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeTheme(this.value)">';let o=this.pict.providers["RetoldRemote-Theme"];if(o){let t=o.getThemeList(),e=o.getCurrentTheme(),n="";for(let o=0;o<t.length;o++){let r=t[o];r.category!==n&&(n&&(i+="</optgroup>"),i+='<optgroup label="'+r.category+'">',n=r.category),i+='<option value="'+r.key+'"'+(r.key===e?" selected":"")+">"+r.name+"</option>"}n&&(i+="</optgroup>")}i+="</select>",i+="</div>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">Gallery</div>',i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">View mode</span>',i+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ViewMode', this.value)\">",i+='<option value="gallery"'+("gallery"===e.ViewMode?" selected":"")+">Grid</option>",i+='<option value="list"'+("list"===e.ViewMode?" selected":"")+">List</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Thumbnail size</span>',i+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ThumbnailSize', this.value)\">",i+='<option value="small"'+("small"===e.ThumbnailSize?" selected":"")+">Small</option>",i+='<option value="medium"'+("medium"===e.ThumbnailSize?" selected":"")+">Medium</option>",i+='<option value="large"'+("large"===e.ThumbnailSize?" selected":"")+">Large</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Sort by</span>',i+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortField(this.value)">',i+='<option value="folder-first"'+("folder-first"===e.SortField?" selected":"")+">Folders first</option>",i+='<option value="name"'+("name"===e.SortField?" selected":"")+">Name</option>",i+='<option value="modified"'+("modified"===e.SortField?" selected":"")+">Modified</option>",i+='<option value="created"'+("created"===e.SortField?" selected":"")+">Created</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Sort direction</span>',i+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortDirection(this.value)">',i+='<option value="asc"'+("asc"===e.SortDirection?" selected":"")+">Ascending</option>",i+='<option value="desc"'+("desc"===e.SortDirection?" selected":"")+">Descending</option>",i+="</select>",i+="</div>";let r=e.FilterState&&e.FilterState.MediaType||"all";i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Media filter</span>',i+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeMediaFilter(this.value)">',i+='<option value="all"'+("all"===r?" selected":"")+">All files</option>",i+='<option value="images"'+("images"===r?" selected":"")+">Images</option>",i+='<option value="video"'+("video"===r?" selected":"")+">Video</option>",i+='<option value="audio"'+("audio"===r?" selected":"")+">Audio</option>",i+='<option value="documents"'+("documents"===r?" selected":"")+">Documents</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Show hidden files</span>',i+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.ShowHiddenFiles?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleHiddenFiles(this.checked)\">",i+="</div>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">Viewer</div>',i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Image fit mode</span>',i+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeImageFitMode(this.value)">',i+='<option value="fit"'+("fit"===e.ImageFitMode?" selected":"")+">Fit to window</option>",i+='<option value="auto"'+("auto"===e.ImageFitMode?" selected":"")+">Original if smaller</option>",i+='<option value="original"'+("original"===e.ImageFitMode?" selected":"")+">Original size</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Autoplay video</span>',i+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayVideo?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayVideo', this.checked)\">",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Autoplay audio</span>',i+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayAudio?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayAudio', this.checked)\">",i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Nav bar in distraction-free</span>',i+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.DistractionFreeShowNav?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleDistractionFreeNav(this.checked)\">",i+="</div>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">Server Capabilities</div>',i+='<div class="retold-remote-settings-capabilities">';let s=[{key:"sharp",label:"Sharp (image thumbnails)"},{key:"imagemagick",label:"ImageMagick (image fallback)"},{key:"ffmpeg",label:"ffmpeg (video thumbnails)"},{key:"ffprobe",label:"ffprobe (media metadata)"}];for(let t=0;t<s.length;t++){let e=s[t],o=n[e.key];i+='<div class="retold-remote-settings-cap-row">',i+='<span class="retold-remote-settings-cap-label">'+e.label+"</span>",i+='<span class="'+(o?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(o?"Available":"Not found")+"</span>",i+="</div>"}i+='<div class="retold-remote-settings-cap-row" style="margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--retold-border);">',i+='<span class="retold-remote-settings-cap-label">Hashed filenames</span>',i+='<span class="'+(e.HashedFilenames?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(e.HashedFilenames?"Enabled":"Disabled")+"</span>",i+="</div>",i+="</div>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">AI File Sort</div>';let a=this.pict.providers["RetoldRemote-AISortManager"],l=e.AISortSettings||{AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"};i+='<div class="retold-remote-settings-input-row">',i+='<label class="retold-remote-settings-input-label">AI Endpoint URL</label>',i+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortEndpoint" value="'+this._escapeAttr(l.AIEndpoint)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIEndpoint\', this.value)" placeholder="http://localhost:11434">',i+="</div>",i+='<div class="retold-remote-settings-input-row">',i+='<label class="retold-remote-settings-input-label">Model</label>',i+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortModel" value="'+this._escapeAttr(l.AIModel)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIModel\', this.value)" placeholder="llama3.1">',i+="</div>",i+='<div class="retold-remote-settings-row">',i+='<span class="retold-remote-settings-label">Provider</span>',i+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeAISetting('AIProvider', this.value)\">",i+='<option value="ollama"'+("ollama"===l.AIProvider?" selected":"")+">Ollama</option>",i+='<option value="openai"'+("openai"===l.AIProvider?" selected":"")+">OpenAI-compatible</option>",i+="</select>",i+="</div>",i+='<div class="retold-remote-settings-input-row" style="margin-top: 8px;">',i+='<label class="retold-remote-settings-input-label">Naming Template</label>',i+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortTemplate" value="'+this._escapeAttr(l.NamingTemplate)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'NamingTemplate\', this.value)" placeholder="{artist}/{album}/{track} - {title}">';let d=a?a.getTemplatePreview(l.NamingTemplate):"";d&&(i+='<div class="retold-remote-settings-template-preview">Preview: '+this._escapeHTML(d)+"</div>"),i+="</div>",i+='<button class="retold-remote-settings-vlc-btn" id="RetoldRemote-AISortTestBtn" onclick="pict.views[\'RetoldRemote-SettingsPanel\'].testAIConnection()" style="margin-top: 8px;">',i+="Test Connection",i+="</button>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">VLC Streaming</div>',i+='<button class="retold-remote-settings-vlc-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].openModal()">',i+="VLC Protocol Setup",i+="</button>",i+="</div>",i+='<div class="retold-remote-settings-section">',i+='<div class="retold-remote-settings-section-title">Help</div>',i+='<button class="retold-remote-settings-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">',i+="Help (F1)",i+="</button>",i+="</div>",i+="</div>",t.innerHTML=i}changeTheme(t){let e=this.pict.providers["RetoldRemote-Theme"];e&&(e.applyTheme(t),this.pict.PictApplication.saveSettings(),this._renderSettingsContent())}changeSetting(t,e){let n=this.pict.AppData.RetoldRemote;if(n[t]=e,this.pict.PictApplication.saveSettings(),"gallery"===n.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}toggleHiddenFiles(t){this.pict.AppData.RetoldRemote.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings(),this.pict.PictApplication.syncHiddenFilesSetting(()=>{this.pict.PictApplication.loadFileList()})}toggleAutoplay(t,e){this.pict.AppData.RetoldRemote[t]=e,this.pict.PictApplication.saveSettings()}toggleDistractionFreeNav(t){let e=this.pict.AppData.RetoldRemote;if(e.DistractionFreeShowNav=t,this.pict.PictApplication.saveSettings(),e._distractionFreeMode){let e=document.querySelector(".retold-remote-viewer-header");e&&(e.style.display=t?"":"none")}}changeImageFitMode(t){let e=this.pict.views["RetoldRemote-ImageViewer"];if(e)e.setFitMode(t);else{this.pict.AppData.RetoldRemote.ImageFitMode=t,this.pict.PictApplication.saveSettings()}}changeSortField(t){this.pict.AppData.RetoldRemote.SortField=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeSortDirection(t){this.pict.AppData.RetoldRemote.SortDirection=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeMediaFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState&&(e.FilterState.MediaType=t),this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeAISetting(t,e){let n=this.pict.providers["RetoldRemote-AISortManager"];if(n){let i={};i[t]=e,n.updateSettings(i)}"NamingTemplate"===t&&this._renderSettingsContent()}testAIConnection(){let t=document.getElementById("RetoldRemote-AISortTestBtn");t&&(t.disabled=!0,t.textContent="Testing...");let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.testConnection()}_escapeAttr(t){return t?String(t).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):""}_escapeHTML(t){return t?String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"):""}_refilterGallery(){let t=this.pict.AppData.RetoldRemote,e=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e&&e.runFilterPipeline(),"gallery"===t.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}}r.default_configuration=o,e.exports=r},{"pict-view":76}],136:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"RetoldRemote-TopBar",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"\n\t\t.retold-remote-topbar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\theight: 40px;\n\t\t\tpadding: 0 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tgap: 16px;\n\t\t}\n\t\t.retold-remote-topbar-sidebar-toggle\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tpadding: 0;\n\t\t\tmargin: 0;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 1rem;\n\t\t\tline-height: 1;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\t-webkit-tap-highlight-color: transparent;\n\t\t}\n\t\t.retold-remote-topbar-sidebar-toggle:hover,\n\t\t.retold-remote-topbar-sidebar-toggle:active,\n\t\t.retold-remote-topbar-df-toggle:hover,\n\t\t.retold-remote-topbar-df-toggle:active\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t.retold-remote-topbar-df-toggle\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tpadding: 0;\n\t\t\tmargin: 0;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 1rem;\n\t\t\tline-height: 1;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\t-webkit-tap-highlight-color: transparent;\n\t\t}\n\t\t.retold-remote-topbar-location\n\t\t{\n\t\t\tposition: relative;\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\twhite-space: nowrap;\n\t\t\ttext-align: center;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\toverflow: hidden;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.retold-remote-topbar-location-inner\n\t\t{\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-topbar-location-crumb\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tcursor: pointer;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.retold-remote-topbar-location-crumb:hover\n\t\t{\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.retold-remote-topbar-home-crumb\n\t\t{\n\t\t\tcursor: pointer;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tvertical-align: middle;\n\t\t\topacity: 0.8;\n\t\t}\n\t\t.retold-remote-topbar-home-crumb:hover\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.retold-remote-topbar-sep\n\t\t{\n\t\t\tcolor: var(--retold-text-placeholder);\n\t\t\tmargin: 0 3px;\n\t\t}\n\t\t/* Breadcrumb overflow hamburger */\n\t\t.retold-remote-topbar-breadcrumb-overflow\n\t\t{\n\t\t\tposition: relative;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tvertical-align: middle;\n\t\t}\n\t\t.retold-remote-topbar-overflow-btn\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tpadding: 0;\n\t\t\tmargin: 0;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.9rem;\n\t\t\tline-height: 1;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\t-webkit-tap-highlight-color: transparent;\n\t\t}\n\t\t.retold-remote-topbar-overflow-btn:hover,\n\t\t.retold-remote-topbar-overflow-btn:active\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t.retold-remote-topbar-overflow-dropdown\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: absolute;\n\t\t\ttop: 100%;\n\t\t\tleft: 0;\n\t\t\tmargin-top: 4px;\n\t\t\tmin-width: 200px;\n\t\t\tmax-width: 300px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 6px;\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);\n\t\t\tz-index: 1000;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.retold-remote-topbar-overflow-dropdown.open\n\t\t{\n\t\t\tdisplay: block;\n\t\t}\n\t\t.retold-remote-topbar-overflow-item\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\twidth: 100%;\n\t\t\tpadding: 12px 16px;\n\t\t\tborder: none;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tfont-size: 0.9rem;\n\t\t\ttext-align: left;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t\t-webkit-tap-highlight-color: transparent;\n\t\t\tmin-height: 44px;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.retold-remote-topbar-overflow-item:last-child\n\t\t{\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.retold-remote-topbar-overflow-item:hover,\n\t\t.retold-remote-topbar-overflow-item:active\n\t\t{\n\t\t\tbackground: rgba(128, 128, 128, 0.12);\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-topbar-overflow-item-icon\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tflex-shrink: 0;\n\t\t\topacity: 0.7;\n\t\t}\n\t\t.retold-remote-topbar-overflow-item-label\n\t\t{\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-topbar-info\n\t\t{\n\t\t\tflex-shrink: 1;\n\t\t\tmin-width: 0;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-topbar-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.retold-remote-topbar-btn\n\t\t{\n\t\t\tpadding: 4px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-topbar-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-topbar-addcoll-btn\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t}\n\t\t.retold-remote-topbar-collections-btn.panel-open\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t/* Add-to-collection dropdown */\n\t\t.retold-remote-addcoll-dropdown\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 100%;\n\t\t\tright: 0;\n\t\t\tmargin-top: 4px;\n\t\t\tmin-width: 220px;\n\t\t\tmax-width: 320px;\n\t\t\tmax-height: 300px;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 6px;\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);\n\t\t\tz-index: 1000;\n\t\t}\n\t\t.retold-remote-addcoll-dropdown-item\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\twidth: 100%;\n\t\t\tpadding: 10px 14px;\n\t\t\tborder: none;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tfont-size: 0.82rem;\n\t\t\ttext-align: left;\n\t\t\tcursor: pointer;\n\t\t\tfont-family: inherit;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.retold-remote-addcoll-dropdown-item:last-child\n\t\t{\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.retold-remote-addcoll-dropdown-item:hover\n\t\t{\n\t\t\tbackground: rgba(128, 128, 128, 0.12);\n\t\t\tcolor: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-addcoll-dropdown-new\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.retold-remote-topbar-filter-btn\n\t\t{\n\t\t\tposition: relative;\n\t\t\tpadding: 4px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.82rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.retold-remote-topbar-filter-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-topbar-filter-btn.filter-active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t.retold-remote-topbar-filter-btn.filter-bar-open\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-text-muted);\n\t\t\tbackground: rgba(128, 128, 128, 0.06);\n\t\t}\n\t\t.retold-remote-topbar-aisort-btn\n\t\t{\n\t\t\tpadding: 4px 8px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.72rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s, background 0.15s;\n\t\t\tfont-family: inherit;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.retold-remote-topbar-aisort-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tbackground: rgba(128, 128, 128, 0.1);\n\t\t}\n\t\t.retold-remote-topbar-aisort-btn.generating\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcursor: wait;\n\t\t}\n\t\t.retold-remote-topbar-filter-badge\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: -4px;\n\t\t\tright: -4px;\n\t\t\tmin-width: 14px;\n\t\t\theight: 14px;\n\t\t\tline-height: 14px;\n\t\t\tpadding: 0 3px;\n\t\t\tborder-radius: 7px;\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-tertiary);\n\t\t\tfont-size: 0.55rem;\n\t\t\tfont-weight: 700;\n\t\t\ttext-align: center;\n\t\t}\n\t\t@media (max-width: 600px)\n\t\t{\n\t\t\t.retold-remote-topbar\n\t\t\t{\n\t\t\t\tpadding: 0 8px;\n\t\t\t\tgap: 6px;\n\t\t\t}\n\t\t\t.retold-remote-topbar-actions\n\t\t\t{\n\t\t\t\tgap: 4px;\n\t\t\t}\n\t\t}\n\t",Templates:[{Hash:"RetoldRemote-TopBar",Template:'\n\t\t\t\t<div class="retold-remote-topbar">\n\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle" id="RetoldRemote-TopBar-SidebarToggle" onclick="pict.views[\'ContentEditor-Layout\'].toggleSidebar()" title="Toggle Sidebar"></button>\n\t\t\t\t\t<button class="retold-remote-topbar-df-toggle" id="RetoldRemote-TopBar-DFToggle" onclick="pict.views[\'ContentEditor-TopBar\'].toggleDistractionFree()" title="Distraction-free mode (d)"></button>\n\t\t\t\t\t<div class="retold-remote-topbar-location" id="RetoldRemote-TopBar-Location"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-info" id="RetoldRemote-TopBar-Info"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-actions">\n\t\t\t\t\t\t<button class="retold-remote-topbar-aisort-btn" id="RetoldRemote-TopBar-AISortBtn" onclick="pict.views[\'ContentEditor-TopBar\'].triggerAISort()" title="AI Sort (generate sort plan for current folder)" style="display:none;">Ai</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-addcoll-btn" id="RetoldRemote-TopBar-AddToCollectionBtn" onclick="pict.views[\'ContentEditor-TopBar\'].addToCollection(event)" title="Add to collection">&#9733;</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle retold-remote-topbar-collections-btn" id="RetoldRemote-TopBar-CollectionsBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleCollections()" title="Toggle Collections panel (b)">&#9733;</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-filter-btn" id="RetoldRemote-TopBar-FilterBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleFilterBar()" title="Toggle filter bar (/)">&#9698;</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-TopBar",TemplateHash:"RetoldRemote-TopBar",DestinationAddress:"#ContentEditor-TopBar-Container"}]};class r extends i{constructor(t,e,n){super(t,e,n)}onAfterRender(){super.onAfterRender(),this.updateSidebarToggleIcon(),this.updateDFToggleIcon(),this.updateLocation(),this.updateInfo()}updateSidebarToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-SidebarToggle");if(!t)return;let e=this.pict.providers["RetoldRemote-Icons"];t.innerHTML=e?e.getIcon("sidebar",18):"&#9776;"}updateDFToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-DFToggle");t&&(t.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9" /><polyline points="9 21 3 21 3 15" /><polyline points="21 15 21 21 15 21" /><polyline points="3 9 3 3 9 3" /></svg>')}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree&&t._toggleDistractionFree()}updateLocation(){let t=document.getElementById("RetoldRemote-TopBar-Location");if(!t)return;this.pict.AppData.RetoldRemote;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",n=this.pict.providers["RetoldRemote-Icons"],i='<span class="retold-remote-topbar-home-crumb" onclick="pict.PictApplication.loadFileList(\'\')" title="Home">'+(n?n.getIcon("home",16):"/")+"</span>";if(!e)return void(t.innerHTML='<span class="retold-remote-topbar-location-inner">'+i+"</span>");let o=e.split("/").filter(t=>t);if(o.length<=1){let e=i;for(let t=0;t<o.length;t++){e+='<span class="retold-remote-topbar-sep">/</span>',e+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+o.slice(0,t+1).join("/")+"')\">"+o[t]+"</span>"}return void(t.innerHTML='<span class="retold-remote-topbar-location-inner">'+e+"</span>")}let r=n?n.getIcon("folder",16):"",s="";s+="<button class=\"retold-remote-topbar-overflow-item\" onclick=\"pict.PictApplication.loadFileList(''); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",s+='<span class="retold-remote-topbar-overflow-item-icon">'+(n?n.getIcon("home",16):"/")+"</span>",s+='<span class="retold-remote-topbar-overflow-item-label">Home</span>',s+="</button>";for(let t=0;t<o.length-1;t++){s+='<button class="retold-remote-topbar-overflow-item" onclick="pict.PictApplication.loadFileList(\''+o.slice(0,t+1).join("/")+"'); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",s+='<span class="retold-remote-topbar-overflow-item-icon">'+r+"</span>",s+='<span class="retold-remote-topbar-overflow-item-label">'+o[t]+"</span>",s+="</button>"}let a=o[o.length-1],l="";l+='<span class="retold-remote-topbar-breadcrumb-overflow">',l+='<button class="retold-remote-topbar-overflow-btn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleBreadcrumbDropdown()" title="Navigate to parent folders">&#9776;</button>',l+='<div class="retold-remote-topbar-overflow-dropdown" id="RetoldRemote-BreadcrumbDropdown">',l+=s,l+="</div>",l+="</span>",l+='<span class="retold-remote-topbar-location-inner">',l+=i,l+='<span class="retold-remote-topbar-sep">/</span>',l+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+o.join("/")+"')\">"+a+"</span>",l+="</span>",t.innerHTML=l}toggleBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");if(t)if(t.classList.contains("open"))this.closeBreadcrumbDropdown();else{t.classList.add("open");let e=this,n=function(i){if(t.contains(i.target))return;let o=t.parentElement&&t.parentElement.querySelector(".retold-remote-topbar-overflow-btn");o&&o.contains(i.target)||(e.closeBreadcrumbDropdown(),document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0))};setTimeout(function(){document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0)},0),this._breadcrumbCloseHandler=n}}closeBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");t&&t.classList.remove("open"),this._breadcrumbCloseHandler&&(document.removeEventListener("click",this._breadcrumbCloseHandler,!0),document.removeEventListener("touchstart",this._breadcrumbCloseHandler,!0),this._breadcrumbCloseHandler=null)}toggleFilterBar(){let t=this.pict.AppData.RetoldRemote;t.FilterBarVisible=!t.FilterBarVisible,t.FilterBarVisible||(t.FilterPanelOpen=!1);let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery(),this.updateFilterIcon(),t.FilterBarVisible&&setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()},50)}updateFilterIcon(){let t=document.getElementById("RetoldRemote-TopBar-FilterBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-GalleryFilterSort"],i=n?n.getActiveFilterChips().length:0,o=e.FilterBarVisible||!1;t.classList.remove("filter-active","filter-bar-open"),i>0?(t.classList.add("filter-active"),t.innerHTML='&#9683;<span class="retold-remote-topbar-filter-badge">'+i+"</span>",t.title=i+" active filter"+(i>1?"s":"")+" (/)"):o?(t.classList.add("filter-bar-open"),t.innerHTML="&#9698;",t.title="Hide filter bar (/)"):(t.innerHTML="&#9698;",t.title="Toggle filter bar (/)")}updateInfo(){this.updateAISortButton();let t=document.getElementById("RetoldRemote-TopBar-Info");if(!t)return;let e=this.pict.AppData.RetoldRemote,n=e.FolderSummary;if("viewer"===e.ActiveMode){let n=e.GalleryItems||[],i=e.GalleryCursorIndex||0,o=n[i];if(o){let e=i+1+"/"+n.length;t.textContent=e+" · "+o.Name}return}let i=e.GalleryItems||[],o=e.GalleryCursorIndex||0,r="";if(i.length>0&&(r=o+1+"/"+i.length),!n)return void(t.textContent=r);let s=[];r&&s.push(r),n.Folders>0&&s.push(n.Folders+" folders"),n.Images>0&&s.push(n.Images+" images"),n.Videos>0&&s.push(n.Videos+" videos"),n.Audio>0&&s.push(n.Audio+" audio"),n.Documents>0&&s.push(n.Documents+" docs"),n.Other>0&&s.push(n.Other+" other"),t.textContent=s.join(" · ")}triggerAISort(){let t=this.pict.providers["RetoldRemote-AISortManager"];if(!t)return;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",n=document.getElementById("RetoldRemote-TopBar-AISortBtn");n&&(n.classList.add("generating"),n.textContent="..."),t.generateSortPlan(e,(t,e)=>{n&&(n.classList.remove("generating"),n.textContent="Ai")})}updateAISortButton(){let t=document.getElementById("RetoldRemote-TopBar-AISortBtn");if(!t)return;let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.isAvailable()?t.style.display="":t.style.display="none"}toggleCollections(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}updateCollectionsIcon(){let t=document.getElementById("RetoldRemote-TopBar-CollectionsBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-Icons"];e.CollectionsPanelOpen?(t.classList.add("panel-open"),n&&"function"==typeof n.getIcon&&(t.innerHTML=n.getIcon("bookmark-filled",16))):(t.classList.remove("panel-open"),n&&"function"==typeof n.getIcon&&(t.innerHTML=n.getIcon("bookmark",16)))}addToCollection(t){let e=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"];if(n){if(e.LastUsedCollectionGUID){if(n.addCurrentFileToCollection(e.LastUsedCollectionGUID))return}this.showAddToCollectionDropdown(t)}}showAddToCollectionDropdown(t){let e=this,n=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"];this._closeAddToCollectionDropdown();let o=document.getElementById("RetoldRemote-TopBar-AddToCollectionBtn");o&&i.fetchCollections(()=>{let t=n.Collections||[],r=document.createElement("div");r.className="retold-remote-addcoll-dropdown",r.id="RetoldRemote-AddToCollection-Dropdown";let s=document.createElement("button");s.className="retold-remote-addcoll-dropdown-item retold-remote-addcoll-dropdown-new",s.textContent="+ New Collection...",s.onclick=()=>{e._closeAddToCollectionDropdown();let t=prompt("Collection name:");t&&t.trim()&&i.createCollection(t.trim(),(t,e)=>{!t&&e&&i.addCurrentFileToCollection(e.GUID)})},r.appendChild(s);for(let n=0;n<t.length;n++){let o=t[n],s=document.createElement("button");s.className="retold-remote-addcoll-dropdown-item",s.textContent=o.Name||"Untitled",s.onclick=()=>{e._closeAddToCollectionDropdown(),i.addCurrentFileToCollection(o.GUID)},r.appendChild(s)}o.style.position="relative",o.appendChild(r),setTimeout(()=>{document.addEventListener("click",e._boundCloseDropdown=t=>{r.contains(t.target)||t.target===o||e._closeAddToCollectionDropdown()})},10)})}_closeAddToCollectionDropdown(){let t=document.getElementById("RetoldRemote-AddToCollection-Dropdown");t&&t.remove(),this._boundCloseDropdown&&(document.removeEventListener("click",this._boundCloseDropdown),this._boundCloseDropdown=null)}}r.default_configuration=o,e.exports=r},{"pict-view":76}],137:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-VLCSetup",DefaultRenderable:"RetoldRemote-VLCSetup",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:'\n\t\t.retold-remote-vlc-modal-backdrop\n\t\t{\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tbackground: rgba(0, 0, 0, 0.6);\n\t\t\tz-index: 9000;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.retold-remote-vlc-modal\n\t\t{\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 8px;\n\t\t\twidth: 600px;\n\t\t\tmax-width: 90vw;\n\t\t\tmax-height: 85vh;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tbox-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);\n\t\t}\n\t\t.retold-remote-vlc-modal-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 14px 18px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-vlc-modal-title\n\t\t{\n\t\t\tfont-size: 0.85rem;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-vlc-modal-close\n\t\t{\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 1.1rem;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 2px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-family: inherit;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.retold-remote-vlc-modal-close:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-vlc-modal-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 18px;\n\t\t}\n\t\t.retold-remote-vlc-setup-section\n\t\t{\n\t\t\tmargin-bottom: 18px;\n\t\t}\n\t\t.retold-remote-vlc-setup-section-title\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tfont-weight: 700;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.retold-remote-vlc-setup-desc\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tline-height: 1.5;\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.retold-remote-vlc-setup-status\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 8px;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tmargin-bottom: 12px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-vlc-setup-status-dot\n\t\t{\n\t\t\twidth: 8px;\n\t\t\theight: 8px;\n\t\t\tborder-radius: 50%;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-vlc-setup-status-dot.detected\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-vlc-setup-status-dot.unknown\n\t\t{\n\t\t\tbackground: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-vlc-setup-platform\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.retold-remote-vlc-setup-platform.active\n\t\t{\n\t\t\tdisplay: block;\n\t\t}\n\t\t.retold-remote-vlc-setup-platform-tabs\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 0;\n\t\t\tmargin-bottom: 12px;\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t}\n\t\t.retold-remote-vlc-setup-platform-tab\n\t\t{\n\t\t\tpadding: 6px 12px;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-vlc-setup-platform-tab:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-vlc-setup-platform-tab.active\n\t\t{\n\t\t\tcolor: var(--retold-accent);\n\t\t\tborder-bottom-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-vlc-setup-code\n\t\t{\n\t\t\tbackground: var(--retold-bg-primary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 10px;\n\t\t\tfont-family: "SF Mono", "Fira Code", "Consolas", monospace;\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tline-height: 1.6;\n\t\t\toverflow-x: auto;\n\t\t\twhite-space: pre;\n\t\t\tmargin-bottom: 8px;\n\t\t\ttab-size: 4;\n\t\t}\n\t\t.retold-remote-vlc-setup-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 6px 14px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-family: inherit;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t\tmargin-right: 6px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.retold-remote-vlc-setup-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-bg-hover);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-vlc-setup-btn.primary\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.retold-remote-vlc-setup-btn.primary:hover\n\t\t{\n\t\t\topacity: 0.85;\n\t\t}\n\t\t.retold-remote-vlc-setup-step\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t\tmargin-bottom: 10px;\n\t\t}\n\t\t.retold-remote-vlc-setup-step-num\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\tborder-radius: 50%;\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: #fff;\n\t\t\tfont-size: 0.65rem;\n\t\t\tfont-weight: 700;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.retold-remote-vlc-setup-step-content\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.retold-remote-vlc-setup-note\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-style: italic;\n\t\t\tmargin-top: 4px;\n\t\t}\n\t\t.retold-remote-toast\n\t\t{\n\t\t\tposition: fixed;\n\t\t\tbottom: 20px;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tcolor: var(--retold-accent);\n\t\t\tpadding: 8px 16px;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tz-index: 10000;\n\t\t\tpointer-events: none;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t}\n\t'};class r extends i{constructor(t,e,n){super(t,e,n),this._activePlatformTab=this._detectPlatform(),this._modalVisible=!1,this._boundKeyHandler=null}_detectPlatform(){let t="undefined"!=typeof navigator?navigator.userAgent:"";return/Macintosh|Mac OS X/.test(t)?"macos":/Windows/.test(t)?"windows":"linux"}openModal(){if(this._modalVisible)return;this._modalVisible=!0;let t=document.createElement("div");t.className="retold-remote-vlc-modal-backdrop",t.id="RetoldRemote-VLCSetup-Backdrop",t.onclick=e=>{e.target===t&&this.closeModal()};let e=document.createElement("div");e.className="retold-remote-vlc-modal";let n=document.createElement("div");n.className="retold-remote-vlc-modal-header",n.innerHTML='<span class="retold-remote-vlc-modal-title">VLC Protocol Setup</span><button class="retold-remote-vlc-modal-close" onclick="pict.views[\'RetoldRemote-VLCSetup\'].closeModal()">X</button>';let i=document.createElement("div");i.className="retold-remote-vlc-modal-body",i.id="RetoldRemote-VLCSetup-Container",e.appendChild(n),e.appendChild(i),t.appendChild(e),document.body.appendChild(t),this._renderVLCSetupContent(),this._boundKeyHandler=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),this.closeModal())},document.addEventListener("keydown",this._boundKeyHandler,!0)}closeModal(){if(!this._modalVisible)return;this._modalVisible=!1;let t=document.getElementById("RetoldRemote-VLCSetup-Backdrop");t&&t.remove(),this._boundKeyHandler&&(document.removeEventListener("keydown",this._boundKeyHandler,!0),this._boundKeyHandler=null)}switchPlatformTab(t){this._activePlatformTab=t,this._renderVLCSetupContent()}_renderVLCSetupContent(){let t=document.getElementById("RetoldRemote-VLCSetup-Container");if(!t)return;let e=this._activePlatformTab,n="";n+='<div class="retold-remote-vlc-setup-section">',n+='<div class="retold-remote-vlc-setup-desc">',n+="Stream media directly in VLC from the browser. Press <b>v</b> in the media viewer to launch VLC with the current file.",n+="</div>",n+="</div>",n+='<div class="retold-remote-vlc-setup-status">',n+='<div class="retold-remote-vlc-setup-status-dot '+(this._detectPlatform()===e?"detected":"unknown")+'"></div>',n+="<span>Detected platform: <b>"+this._getPlatformLabel(this._detectPlatform())+"</b></span>",n+="</div>",n+='<div class="retold-remote-vlc-setup-platform-tabs">',n+=this._buildPlatformTab("macos","macOS",e),n+=this._buildPlatformTab("windows","Windows",e),n+=this._buildPlatformTab("linux","Linux",e),n+="</div>",n+=this._buildMacOSContent(e),n+=this._buildWindowsContent(e),n+=this._buildLinuxContent(e),n+='<div class="retold-remote-vlc-setup-section">',n+='<div class="retold-remote-vlc-setup-section-title">Test</div>',n+='<div class="retold-remote-vlc-setup-desc">',n+="Click below to test whether the vlc:// protocol handler is registered. VLC should open.",n+="</div>",n+='<button class="retold-remote-vlc-setup-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].testProtocol()">Test VLC Protocol</button>',n+="</div>",t.innerHTML=n}_buildPlatformTab(t,e,n){let i="retold-remote-vlc-setup-platform-tab";return t===n&&(i+=" active"),'<button class="'+i+"\" onclick=\"pict.views['RetoldRemote-VLCSetup'].switchPlatformTab('"+t+"')\">"+e+"</button>"}_getPlatformLabel(t){return"macos"===t?"macOS":"windows"===t?"Windows":"Linux"}_buildMacOSContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("macos"===t?" active":""))+'" data-platform="macos">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (macOS)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC on macOS does not register a vlc:// protocol handler by default. ",e+="An AppleScript app bundle is needed to bridge vlc:// links to VLC. ",e+="Run the command below in Terminal to create and register the handler automatically.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Automatic Setup</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Copy and paste this into Terminal:",e+="</div>";let n=this._getMacSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyMacSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates an AppleScript at <code>/tmp/VLCProtocol.applescript</code> that handles vlc:// URLs</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Compiles it into an app bundle at <code>/Applications/VLCProtocol.app</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Adds the vlc:// URL scheme to the app\'s Info.plist</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">4</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers the protocol handler with macOS Launch Services</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC installed at /Applications/VLC.app and Python 3 (included with macOS).</div>',e+="</div>",e+="</div>",e}_buildWindowsContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("windows"===t?" active":""))+'" data-platform="windows">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Windows)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC on Windows registers the vlc:// protocol handler during installation. ",e+="If it is not working, you can re-register it by saving and running the registry file below.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option A: Reinstall VLC</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Reinstall VLC and ensure "Register VLC as handler for vlc:// protocol" is checked during installation.</div>',e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option B: Registry File</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Save this as <code>vlc-protocol.reg</code> and double-click to import. ",e+="Adjust the VLC path if yours differs.",e+="</div>";let n=this._getWindowsRegFile();e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsReg()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option C: Batch Script</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Alternatively, save this as <code>vlc-protocol-setup.bat</code> and run as Administrator. ",e+="This creates a wrapper script that URL-decodes the vlc:// link before passing it to VLC.",e+="</div>";let i=this._getWindowsBatchScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsBatch()">Copy to Clipboard</button>',e+="</div>",e+="</div>",e}_buildLinuxContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("linux"===t?" active":""))+'" data-platform="linux">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Linux)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Register a vlc:// protocol handler using a .desktop file and xdg-mime. ",e+="Run the command below in a terminal.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup Command</div>';let n=this._getLinuxSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyLinuxSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a handler script at <code>~/.local/bin/vlc-protocol</code> that URL-decodes and opens VLC</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a .desktop file at <code>~/.local/share/applications/vlc-protocol.desktop</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers vlc:// as a URL scheme via <code>xdg-mime</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC and Python 3 installed.</div>',e+="</div>",e+="</div>",e}_getMacSetupScript(){return["# Create the AppleScript handler","cat > /tmp/VLCProtocol.applescript << 'EOF'","on open location theURL","\tset theURL to text 7 thru -1 of theURL","\tset theURL to do shell script \"python3 -c 'import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))' \" & quoted form of theURL",'\tdo shell script "open -a VLC " & quoted form of theURL',"end open location","EOF","","# Compile into app bundle","osacompile -o /Applications/VLCProtocol.app /tmp/VLCProtocol.applescript","","# Add vlc:// URL scheme to Info.plist",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0 dict" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","/usr/libexec/PlistBuddy -c \"Add :CFBundleURLTypes:0:CFBundleURLName string 'VLC Protocol'\" \\"," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes:0 string vlc" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","","# Register with Launch Services","/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister \\"," -f /Applications/VLCProtocol.app","",'echo "VLC protocol handler installed successfully."'].join("\n")}_getWindowsRegFile(){return["Windows Registry Editor Version 5.00","","[HKEY_CLASSES_ROOT\\vlc]",'@="URL:VLC Protocol"','"URL Protocol"=""',"","[HKEY_CLASSES_ROOT\\vlc\\shell]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open\\command]",'@="\\"C:\\\\Program Files\\\\VideoLAN\\\\VLC\\\\vlc.exe\\" \\"%1\\""'].join("\n")}_getWindowsBatchScript(){return["@echo off","REM VLC Protocol Handler Setup for Windows","REM Run this as Administrator","","REM Create the handler script",'mkdir "%APPDATA%\\VLCProtocol" 2>nul',"(","echo import sys, urllib.parse, subprocess","echo url = sys.argv[1] if len(sys.argv^) ^> 1 else ''","echo if url.startswith('vlc://'^): url = url[6:]","echo url = urllib.parse.unquote(url^)","echo subprocess.Popen(['C:\\\\Program Files\\\\VideoLAN\\\\VLC\\\\vlc.exe', url]^)",') > "%APPDATA%\\VLCProtocol\\handler.py"',"","REM Register the protocol in the registry",'reg add "HKCU\\Software\\Classes\\vlc" /ve /d "URL:VLC Protocol" /f','reg add "HKCU\\Software\\Classes\\vlc" /v "URL Protocol" /d "" /f','reg add "HKCU\\Software\\Classes\\vlc\\shell\\open\\command" /ve /d "pythonw \\"%APPDATA%\\VLCProtocol\\handler.py\\" \\"%%1\\"" /f',"","echo VLC protocol handler installed successfully.","pause"].join("\n")}_getLinuxSetupScript(){return["# Create handler script","mkdir -p ~/.local/bin","cat > ~/.local/bin/vlc-protocol << 'EOF'","#!/bin/bash",'URL="$1"','URL="${URL#vlc://}"','URL=$(python3 -c "import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))" "$URL")','exec vlc "$URL" &',"EOF","chmod +x ~/.local/bin/vlc-protocol","","# Create .desktop file","cat > ~/.local/share/applications/vlc-protocol.desktop << 'EOF'","[Desktop Entry]","Name=VLC Protocol Handler","Exec=bash -c '~/.local/bin/vlc-protocol %u'","Type=Application","NoDisplay=true","MimeType=x-scheme-handler/vlc;","EOF","","# Register the handler","xdg-mime default vlc-protocol.desktop x-scheme-handler/vlc","update-desktop-database ~/.local/share/applications/","",'echo "VLC protocol handler installed successfully."'].join("\n")}_copyToClipboard(t,e){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(t).then(()=>{this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}).catch(()=>{this._fallbackCopy(t,e)}):this._fallbackCopy(t,e)}_fallbackCopy(t,e){let n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n),n.select();try{document.execCommand("copy"),this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}catch(t){this.pict.providers["RetoldRemote-ToastNotification"].showToast("Failed to copy - please select and copy manually")}document.body.removeChild(n)}copyMacSetup(){this._copyToClipboard(this._getMacSetupScript(),"macOS setup script")}copyWindowsReg(){this._copyToClipboard(this._getWindowsRegFile(),"Registry file")}copyWindowsBatch(){this._copyToClipboard(this._getWindowsBatchScript(),"Batch script")}copyLinuxSetup(){this._copyToClipboard(this._getLinuxSetupScript(),"Linux setup script")}testProtocol(){let t="https://www.sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4",e=/Windows/.test(navigator.userAgent)?"vlc://"+t:"vlc://"+encodeURIComponent(t),n=document.createElement("a");n.href=e,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)}}r.default_configuration=o,e.exports=r},{"pict-view":76}],138:[function(t,e,n){const i=t("pict-view"),o={ViewIdentifier:"RetoldRemote-VideoExplorer",DefaultRenderable:"RetoldRemote-VideoExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:'\n\t\t.retold-remote-vex\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t}\n\t\t.retold-remote-vex-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tz-index: 5;\n\t\t}\n\t\t.retold-remote-vex-nav-btn\n\t\t{\n\t\t\tpadding: 4px 10px;\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 0.8rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-vex-nav-btn:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-vex-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-vex-info\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 16px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-vex-info-item\n\t\t{\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.retold-remote-vex-info-label\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-vex-info-value\n\t\t{\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t}\n\t\t.retold-remote-vex-controls\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-bottom: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-vex-controls label\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t}\n\t\t.retold-remote-vex-controls select,\n\t\t.retold-remote-vex-controls input[type="range"]\n\t\t{\n\t\t\tfont-size: 0.75rem;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tcolor: var(--retold-text-primary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 2px 6px;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-vex-controls .retold-remote-vex-refresh-btn\n\t\t{\n\t\t\tpadding: 3px 12px;\n\t\t\tborder: 1px solid var(--retold-accent);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: transparent;\n\t\t\tcolor: var(--retold-accent);\n\t\t\tfont-size: 0.75rem;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, color 0.15s;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.retold-remote-vex-controls .retold-remote-vex-refresh-btn:hover\n\t\t{\n\t\t\tbackground: var(--retold-accent);\n\t\t\tcolor: var(--retold-bg-primary);\n\t\t}\n\t\t.retold-remote-vex-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 16px;\n\t\t}\n\t\t.retold-remote-vex-loading\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\theight: 100%;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t\t.retold-remote-vex-loading-spinner\n\t\t{\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tborder: 3px solid var(--retold-border);\n\t\t\tborder-top-color: var(--retold-accent);\n\t\t\tborder-radius: 50%;\n\t\t\tanimation: retold-vex-spin 0.8s linear infinite;\n\t\t\tmargin-bottom: 16px;\n\t\t}\n\t\t@keyframes retold-vex-spin\n\t\t{\n\t\t\tto { transform: rotate(360deg); }\n\t\t}\n\t\t.retold-remote-vex-grid\n\t\t{\n\t\t\tdisplay: grid;\n\t\t\tgrid-template-columns: repeat(auto-fill, minmax(280px, 1fr));\n\t\t\tgap: 12px;\n\t\t}\n\t\t.retold-remote-vex-frame\n\t\t{\n\t\t\tposition: relative;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow: hidden;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder: 2px solid transparent;\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color 0.15s, transform 0.1s;\n\t\t}\n\t\t.retold-remote-vex-frame:hover\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\ttransform: translateY(-1px);\n\t\t}\n\t\t.retold-remote-vex-frame.selected\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t}\n\t\t.retold-remote-vex-frame img\n\t\t{\n\t\t\twidth: 100%;\n\t\t\tdisplay: block;\n\t\t\taspect-ratio: 16 / 9;\n\t\t\tobject-fit: contain;\n\t\t\tbackground: #000;\n\t\t}\n\t\t.retold-remote-vex-frame-info\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 6px 10px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t}\n\t\t.retold-remote-vex-frame-timestamp\n\t\t{\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\tfont-family: var(--retold-font-mono, monospace);\n\t\t}\n\t\t.retold-remote-vex-frame-index\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-vex-frame.custom-frame\n\t\t{\n\t\t\tborder-color: var(--retold-accent);\n\t\t\tborder-style: dashed;\n\t\t}\n\t\t.retold-remote-vex-frame.custom-frame .retold-remote-vex-frame-info\n\t\t{\n\t\t\tbackground: color-mix(in srgb, var(--retold-accent) 12%, var(--retold-bg-secondary));\n\t\t}\n\t\t.retold-remote-vex-frame-loading\n\t\t{\n\t\t\twidth: 100%;\n\t\t\taspect-ratio: 16 / 9;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: #000;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.8rem;\n\t\t}\n\t\t.retold-remote-vex-timeline-marker.custom\n\t\t{\n\t\t\tbackground: var(--retold-text-primary);\n\t\t\topacity: 0.9;\n\t\t\twidth: 2px;\n\t\t\tborder: 1px dashed var(--retold-accent);\n\t\t}\n\t\t/* Timeline bar at bottom */\n\t\t.retold-remote-vex-timeline\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 8px 16px;\n\t\t\tbackground: var(--retold-bg-secondary);\n\t\t\tborder-top: 1px solid var(--retold-border);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-vex-timeline-bar\n\t\t{\n\t\t\tflex: 1;\n\t\t\theight: 24px;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder-radius: 4px;\n\t\t\tposition: relative;\n\t\t\toverflow: hidden;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.retold-remote-vex-timeline-marker\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\twidth: 3px;\n\t\t\theight: 100%;\n\t\t\tbackground: var(--retold-accent);\n\t\t\topacity: 0.7;\n\t\t\ttransition: opacity 0.15s;\n\t\t}\n\t\t.retold-remote-vex-timeline-marker:hover\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.retold-remote-vex-timeline-marker.selected\n\t\t{\n\t\t\topacity: 1;\n\t\t\tbackground: var(--retold-text-primary);\n\t\t}\n\t\t.retold-remote-vex-timeline-label\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t/* Frame preview overlay */\n\t\t.retold-remote-vex-preview-backdrop\n\t\t{\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbackground: rgba(0, 0, 0, 0.85);\n\t\t\tz-index: 100;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.retold-remote-vex-preview-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 16px;\n\t\t\twidth: 100%;\n\t\t\tmax-width: 95vw;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-vex-preview-header .retold-remote-vex-nav-btn\n\t\t{\n\t\t\tbackground: rgba(40, 44, 52, 0.8);\n\t\t}\n\t\t.retold-remote-vex-preview-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-secondary);\n\t\t\ttext-align: center;\n\t\t}\n\t\t.retold-remote-vex-preview-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\toverflow: auto;\n\t\t\tpadding: 8px;\n\t\t\tmax-width: 95vw;\n\t\t\tmax-height: calc(100vh - 60px);\n\t\t}\n\t\t.retold-remote-vex-preview-body img\n\t\t{\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 100%;\n\t\t\tobject-fit: contain;\n\t\t\tborder-radius: 4px;\n\t\t\tbox-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);\n\t\t}\n\t\t/* Error state */\n\t\t.retold-remote-vex-error\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\theight: 100%;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t\tfont-size: 0.85rem;\n\t\t\ttext-align: center;\n\t\t\tpadding: 40px;\n\t\t}\n\t\t.retold-remote-vex-error-message\n\t\t{\n\t\t\tcolor: #e06c75;\n\t\t\tmargin-bottom: 16px;\n\t\t}\n\t'};class r extends i{constructor(t,e,n){super(t,e,n),this._currentPath="",this._frameData=null,this._selectedFrameIndex=-1,this._frameCount=20,this._fullResFrames=!1,this._customFrames=[]}showExplorer(t){this.pict.AppData.RetoldRemote.ActiveMode="video-explorer",this._currentPath=t,this._frameData=null,this._selectedFrameIndex=-1,this._customFrames=[];let e=this.pict.providers["RetoldRemote-Provider"],n=e?e.getFragmentIdentifier(t):t;window.location.hash="#/explore/"+n;let i=document.getElementById("RetoldRemote-Gallery-Container"),o=document.getElementById("RetoldRemote-Viewer-Container");i&&(i.style.display="none"),o&&(o.style.display="block");let r=t.replace(/^.*\//,""),s='<div class="retold-remote-vex">';s+='<div class="retold-remote-vex-header">',s+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()" title="Back to video (Esc)">&larr; Back</button>',s+='<div class="retold-remote-vex-title">Video Explorer &mdash; '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(r)+"</div>",s+="</div>",s+='<div class="retold-remote-vex-info" id="RetoldRemote-VEX-Info" style="display:none;"></div>',s+='<div class="retold-remote-vex-controls" id="RetoldRemote-VEX-Controls" style="display:none;">',s+="<label>Frames:</label>",s+='<select id="RetoldRemote-VEX-FrameCount" onchange="pict.views[\'RetoldRemote-VideoExplorer\'].onFrameCountChange(this.value)">',s+='<option value="10"'+(10===this._frameCount?" selected":"")+">10</option>",s+='<option value="20"'+(20===this._frameCount?" selected":"")+">20</option>",s+='<option value="40"'+(40===this._frameCount?" selected":"")+">40</option>",s+='<option value="60"'+(60===this._frameCount?" selected":"")+">60</option>",s+='<option value="100"'+(100===this._frameCount?" selected":"")+">100</option>",s+="</select>",s+='<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;">',s+='<input type="checkbox" id="RetoldRemote-VEX-FullRes"'+(this._fullResFrames?" checked":"")+" onchange=\"pict.views['RetoldRemote-VideoExplorer'].onFullResChange(this.checked)\">",s+="Full Res Frames</label>",s+='<button class="retold-remote-vex-refresh-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].refresh()">Refresh</button>',s+="</div>",s+='<div class="retold-remote-vex-body" id="RetoldRemote-VEX-Body">',s+='<div class="retold-remote-vex-loading">',s+='<div class="retold-remote-vex-loading-spinner"></div>',s+="Extracting frames from video...",s+="</div>",s+="</div>",s+='<div class="retold-remote-vex-timeline" id="RetoldRemote-VEX-Timeline" style="display:none;"></div>',s+="</div>",o&&(o.innerHTML=s);let a=this.pict.views["ContentEditor-TopBar"];a&&a.updateInfo(),this._fetchFrames(t)}_fetchFrames(t){let e=this,n=this.pict.providers["RetoldRemote-Provider"],i="/api/media/video-frames?path="+(n?n._getPathParam(t):encodeURIComponent(t))+"&count="+this._frameCount;this._fullResFrames&&(i+="&width=1920&height=1080"),fetch(i).then(t=>t.json()).then(t=>{t&&t.Success?(e._frameData=t,e._renderFrames()):e._showError(t?t.Error:"Unknown error")}).catch(t=>{e._showError(t.message)})}_renderFrames(){let t=this._frameData;if(!t)return;let e=document.getElementById("RetoldRemote-VEX-Info");if(e){let n="";n+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Duration</span> <span class="retold-remote-vex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.DurationFormatted)+"</span></span>",t.VideoWidth&&t.VideoHeight&&(n+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Resolution</span> <span class="retold-remote-vex-info-value">'+t.VideoWidth+"&times;"+t.VideoHeight+"</span></span>"),t.Codec&&(n+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Codec</span> <span class="retold-remote-vex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Codec)+"</span></span>"),t.FileSize&&(n+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Size</span> <span class="retold-remote-vex-info-value">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(t.FileSize)+"</span></span>"),n+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Frames</span> <span class="retold-remote-vex-info-value">'+t.FrameCount+"</span></span>",e.innerHTML=n,e.style.display=""}let n=document.getElementById("RetoldRemote-VEX-Controls");n&&(n.style.display="");let i=document.getElementById("RetoldRemote-VEX-Body");if(i){let e='<div class="retold-remote-vex-grid">';for(let n=0;n<t.Frames.length;n++){let i=t.Frames[n];e+='<div class="retold-remote-vex-frame" id="retold-vex-frame-'+n+"\" onclick=\"pict.views['RetoldRemote-VideoExplorer'].selectFrame("+n+")\" ondblclick=\"pict.views['RetoldRemote-VideoExplorer'].openFrameFullsize("+n+')">',e+='<img src="'+("/api/media/video-frame/"+t.CacheKey+"/"+i.Filename)+'" alt="Frame at '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.TimestampFormatted)+'" loading="lazy">',e+='<div class="retold-remote-vex-frame-info">',e+='<span class="retold-remote-vex-frame-timestamp">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.TimestampFormatted)+"</span>",e+='<span class="retold-remote-vex-frame-index">#'+(i.Index+1)+"</span>",e+="</div>",e+="</div>"}e+="</div>",i.innerHTML=e}this._renderTimeline()}_renderTimeline(){let t=this._frameData;if(!t||!t.Duration)return;let e=document.getElementById("RetoldRemote-VEX-Timeline");if(!e)return;let n="";n+='<span class="retold-remote-vex-timeline-label">0:00</span>',n+='<div class="retold-remote-vex-timeline-bar" id="RetoldRemote-VEX-TimelineBar" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].onTimelineClick(event)">';for(let e=0;e<t.Frames.length;e++){let i=t.Frames[e],o=i.Timestamp/t.Duration*100;n+='<div class="retold-remote-vex-timeline-marker'+(e===this._selectedFrameIndex?" selected":"")+'" style="left:'+o.toFixed(2)+'%;" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.TimestampFormatted)+"\" onclick=\"event.stopPropagation(); pict.views['RetoldRemote-VideoExplorer'].selectFrame("+e+')"></div>'}if(this._customFrames)for(let e=0;e<this._customFrames.length;e++){let i=this._customFrames[e];n+='<div class="retold-remote-vex-timeline-marker custom" style="left:'+(i.Timestamp/t.Duration*100).toFixed(2)+'%;" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i.TimestampFormatted)+'"></div>'}n+="</div>",n+='<span class="retold-remote-vex-timeline-label">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.DurationFormatted)+"</span>",e.innerHTML=n,e.style.display=""}selectFrame(t){if(this._selectedFrameIndex>=0){let t=document.getElementById("retold-vex-frame-"+this._selectedFrameIndex);t&&t.classList.remove("selected")}this._selectedFrameIndex=t;let e=document.getElementById("retold-vex-frame-"+t);e&&(e.classList.add("selected"),e.scrollIntoView({behavior:"smooth",block:"nearest"})),this._updateTimelineSelection()}_updateTimelineSelection(){let t=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!t)return;let e=t.querySelectorAll(".retold-remote-vex-timeline-marker");for(let t=0;t<e.length;t++)t===this._selectedFrameIndex?e[t].classList.add("selected"):e[t].classList.remove("selected")}onTimelineClick(t){let e=this._frameData;if(!e||!e.Duration||!e.CacheKey)return;let n=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!n)return;let i=n.getBoundingClientRect(),o=t.clientX-i.left,r=Math.max(0,Math.min(1,o/i.width))*e.Duration,s=this,a=this.pict.providers["RetoldRemote-Provider"],l="/api/media/video-frame-at?path="+(a?a._getPathParam(this._currentPath):encodeURIComponent(this._currentPath))+"&cacheKey="+encodeURIComponent(e.CacheKey)+"&timestamp="+r.toFixed(3);this._fullResFrames&&(l+="&width=1920&height=1080");let d="retold-vex-custom-"+Date.now();this._insertFramePlaceholder(r,d),fetch(l).then(t=>t.json()).then(t=>{if(!t||!t.Success)throw new Error(t?t.Error:"Extraction failed.");s._customFrames.push(t);let n=document.getElementById(d);if(n){let i="/api/media/video-frame/"+e.CacheKey+"/"+t.Filename,o=s.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Filename).replace(/'/g,"\\'"),r=s.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.TimestampFormatted).replace(/'/g,"\\'");n.ondblclick=function(){pict.views["RetoldRemote-VideoExplorer"].openCustomFrameFullsize(o,r)},n.style.cursor="pointer",n.innerHTML='<img src="'+i+'" alt="Frame at '+s.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.TimestampFormatted)+'" loading="lazy"><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.TimestampFormatted)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>'}s._renderTimeline()}).catch(t=>{let e=document.getElementById(d);e&&(e.innerHTML='<div class="retold-remote-vex-frame-loading">Failed: '+s.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.message)+'</div><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+s.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(r)+'</span><span class="retold-remote-vex-frame-index">error</span></div>')})}_insertFramePlaceholder(t,e){let n=document.querySelector(".retold-remote-vex-grid");if(!n)return;this._frameData;let i=document.createElement("div");i.className="retold-remote-vex-frame custom-frame",i.id=e,i.innerHTML='<div class="retold-remote-vex-frame-loading">Extracting...</div><div class="retold-remote-vex-frame-info"><span class="retold-remote-vex-frame-timestamp">'+this.pict.providers["RetoldRemote-FormattingUtilities"].formatTimestamp(t)+'</span><span class="retold-remote-vex-frame-index">custom</span></div>';let o=null,r=n.children;for(let e=0;e<r.length;e++){let n=r[e],i=n.querySelector(".retold-remote-vex-frame-timestamp");if(i){if(this._parseTimestamp(i.textContent)>t){o=n;break}}}o?n.insertBefore(i,o):n.appendChild(i),i.scrollIntoView({behavior:"smooth",block:"nearest"})}_parseTimestamp(t){if(!t)return 0;let e=t.trim().split(":");return 3===e.length?3600*parseInt(e[0],10)+60*parseInt(e[1],10)+parseInt(e[2],10):2===e.length?60*parseInt(e[0],10)+parseInt(e[1],10):parseFloat(t)||0}openFrameFullsize(t){if(!this._frameData||!this._frameData.Frames[t])return;let e=this._frameData.Frames[t],n="/api/media/video-frame/"+this._frameData.CacheKey+"/"+e.Filename,i=e.TimestampFormatted+" · #"+(e.Index+1);this._showFramePreview(n,i,"regular",t)}openCustomFrameFullsize(t,e){if(!this._frameData)return;let n="/api/media/video-frame/"+this._frameData.CacheKey+"/"+t,i=e+" · custom",o=-1;for(let e=0;e<this._customFrames.length;e++)if(this._customFrames[e].Filename===t){o=e;break}this._showFramePreview(n,i,"custom",o)}_buildAllFramesList(){let t=[];if(this._frameData&&this._frameData.Frames)for(let e=0;e<this._frameData.Frames.length;e++){let n=this._frameData.Frames[e];t.push({Type:"regular",Index:e,Timestamp:n.Timestamp,TimestampFormatted:n.TimestampFormatted,Filename:n.Filename,Label:n.TimestampFormatted+" · #"+(n.Index+1)})}if(this._customFrames)for(let e=0;e<this._customFrames.length;e++){let n=this._customFrames[e];t.push({Type:"custom",Index:e,Timestamp:n.Timestamp,TimestampFormatted:n.TimestampFormatted,Filename:n.Filename,Label:n.TimestampFormatted+" · custom"})}return t.sort((t,e)=>t.Timestamp-e.Timestamp),t}_showFramePreview(t,e,n,i){this._previewType=n,this._previewIndex=i;let o=this._buildAllFramesList();this._previewAllFrames=o,this._previewPosition=0;for(let t=0;t<o.length;t++)if(o[t].Type===n&&o[t].Index===i){this._previewPosition=t;break}let r=document.createElement("div");r.className="retold-remote-vex-preview-backdrop",r.id="RetoldRemote-VEX-Preview",r.onclick=t=>{t.target===r&&this.closeFramePreview()};let s="";s+='<div class="retold-remote-vex-preview-header">',s+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].closeFramePreview()" title="Back (Esc)">&larr; Back</button>',s+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].previewPrevFrame()" title="Previous (←)">&lsaquo; Prev</button>',s+='<div class="retold-remote-vex-preview-title" id="RetoldRemote-VEX-PreviewTitle">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div>",s+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].previewNextFrame()" title="Next (→)">Next &rsaquo;</button>',s+="</div>",s+='<div class="retold-remote-vex-preview-body" id="RetoldRemote-VEX-PreviewBody">',s+='<img src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'">',s+="</div>",r.innerHTML=s,document.body.appendChild(r),this._previewKeyHandler=t=>{switch(t.key){case"Escape":t.preventDefault(),t.stopImmediatePropagation(),this.closeFramePreview();break;case"ArrowLeft":case"k":t.preventDefault(),t.stopImmediatePropagation(),this.previewPrevFrame();break;case"ArrowRight":case"j":t.preventDefault(),t.stopImmediatePropagation(),this.previewNextFrame()}},document.addEventListener("keydown",this._previewKeyHandler)}closeFramePreview(){let t=document.getElementById("RetoldRemote-VEX-Preview");t&&t.remove(),this._previewKeyHandler&&(document.removeEventListener("keydown",this._previewKeyHandler),this._previewKeyHandler=null)}previewPrevFrame(){!this._previewAllFrames||this._previewPosition<=0||(this._previewPosition--,this._updatePreviewFrame())}previewNextFrame(){!this._previewAllFrames||this._previewPosition>=this._previewAllFrames.length-1||(this._previewPosition++,this._updatePreviewFrame())}_updatePreviewFrame(){let t=this._previewAllFrames[this._previewPosition];if(!t||!this._frameData)return;let e="/api/media/video-frame/"+this._frameData.CacheKey+"/"+t.Filename,n=document.getElementById("RetoldRemote-VEX-PreviewBody");n&&(n.innerHTML='<img src="'+e+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t.Label)+'">');let i=document.getElementById("RetoldRemote-VEX-PreviewTitle");i&&(i.textContent=t.Label),this._previewType=t.Type,this._previewIndex=t.Index,"regular"===t.Type&&this.selectFrame(t.Index)}onFrameCountChange(t){this._frameCount=parseInt(t,10)||20,this.refresh()}onFullResChange(t){this._fullResFrames=t,this.refresh()}refresh(){let t=document.getElementById("RetoldRemote-VEX-Body");t&&(t.innerHTML='<div class="retold-remote-vex-loading"><div class="retold-remote-vex-loading-spinner"></div>Extracting frames from video...</div>');let e=document.getElementById("RetoldRemote-VEX-Timeline");e&&(e.style.display="none"),this._selectedFrameIndex=-1,this._customFrames=[],this._fetchFrames(this._currentPath)}goBack(){if(this._currentPath){let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"video")}else{let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}}_showError(t){let e=document.getElementById("RetoldRemote-VEX-Body");e&&(e.innerHTML='<div class="retold-remote-vex-error"><div class="retold-remote-vex-error-message">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()">Back to Video</button></div>')}}r.default_configuration=o,e.exports=r},{"pict-view":76}]},{},[113])(113)});
136
136
  //# sourceMappingURL=retold-remote.min.js.map