retold-remote 0.0.1

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.
Files changed (41) hide show
  1. package/LICENSE +21 -0
  2. package/css/retold-remote.css +83 -0
  3. package/html/codejar.js +511 -0
  4. package/html/index.html +23 -0
  5. package/package.json +68 -0
  6. package/server.js +43 -0
  7. package/source/Pict-Application-RetoldRemote-Configuration.json +7 -0
  8. package/source/Pict-Application-RetoldRemote.js +622 -0
  9. package/source/Pict-RetoldRemote-Bundle.js +14 -0
  10. package/source/cli/RetoldRemote-CLI-Program.js +15 -0
  11. package/source/cli/RetoldRemote-CLI-Run.js +3 -0
  12. package/source/cli/RetoldRemote-Server-Setup.js +257 -0
  13. package/source/cli/commands/RetoldRemote-Command-Serve.js +87 -0
  14. package/source/providers/Pict-Provider-GalleryFilterSort.js +597 -0
  15. package/source/providers/Pict-Provider-GalleryNavigation.js +819 -0
  16. package/source/providers/Pict-Provider-RetoldRemote.js +273 -0
  17. package/source/providers/Pict-Provider-RetoldRemoteIcons.js +640 -0
  18. package/source/providers/Pict-Provider-RetoldRemoteTheme.js +879 -0
  19. package/source/server/RetoldRemote-MediaService.js +536 -0
  20. package/source/server/RetoldRemote-PathRegistry.js +121 -0
  21. package/source/server/RetoldRemote-ThumbnailCache.js +89 -0
  22. package/source/server/RetoldRemote-ToolDetector.js +78 -0
  23. package/source/views/PictView-Remote-Gallery.js +1437 -0
  24. package/source/views/PictView-Remote-ImageViewer.js +363 -0
  25. package/source/views/PictView-Remote-Layout.js +420 -0
  26. package/source/views/PictView-Remote-MediaViewer.js +530 -0
  27. package/source/views/PictView-Remote-SettingsPanel.js +318 -0
  28. package/source/views/PictView-Remote-TopBar.js +206 -0
  29. package/web-application/codejar.js +511 -0
  30. package/web-application/css/retold-remote.css +83 -0
  31. package/web-application/index.html +23 -0
  32. package/web-application/js/pict.min.js +12 -0
  33. package/web-application/js/pict.min.js.map +1 -0
  34. package/web-application/retold-remote.compatible.js +5764 -0
  35. package/web-application/retold-remote.compatible.js.map +1 -0
  36. package/web-application/retold-remote.compatible.min.js +120 -0
  37. package/web-application/retold-remote.compatible.min.js.map +1 -0
  38. package/web-application/retold-remote.js +5763 -0
  39. package/web-application/retold-remote.js.map +1 -0
  40. package/web-application/retold-remote.min.js +120 -0
  41. package/web-application/retold-remote.min.js.map +1 -0
@@ -0,0 +1,120 @@
1
+ "use strict";function _defineProperty(t,e,i){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==typeof e?e:e+""}function _toPrimitive(t,e){if("object"!=typeof t||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).retoldRemote=t()}}(function(){return function t(e,i,n){function o(s,a){if(!i[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(r)return r(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var d=i[s]={exports:{}};e[s][0].call(d.exports,function(t){return o(e[s][1][t]||t)},d,d.exports,t,e,i,n)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,e,i){e.exports={name:"fable-serviceproviderbase",version:"3.0.18",description:"Simple base classes for fable services.",main:"source/Fable-ServiceProviderBase.js",scripts:{start:"node source/Fable-ServiceProviderBase.js",test:"npx mocha -u tdd -R spec",tests:"npx mocha -u tdd --exit -R spec --grep",coverage:"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec",build:"npx quack build",types:"tsc -p ./tsconfig.build.json",check:"tsc -p . --noEmit"},types:"types/source/Fable-ServiceProviderBase.d.ts",mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},repository:{type:"git",url:"https://github.com/stevenvelozo/fable-serviceproviderbase.git"},keywords:["entity","behavior"],author:"Steven Velozo <steven@velozo.com> (http://velozo.com/)",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/fable-serviceproviderbase/issues"},homepage:"https://github.com/stevenvelozo/fable-serviceproviderbase",devDependencies:{"@types/mocha":"^10.0.10",fable:"^3.1.55",quackage:"^1.0.51",typescript:"^5.9.3"}}},{}],2:[function(t,e,i){const n=t("../package.json");class o{constructor(t,e,i){this.fable,this.UUID,this.options,this.services,this.servicesMap,"object"==typeof t&&t.isFable?this.connectFable(t):this.fable=!1,this._PackageFableServiceProvider=n,this.fable?(this.UUID=t.getUUID(),this.options="object"==typeof e?e:{}):(this.options="object"!=typeof t||t.isFable?"object"==typeof e?e:{}:t,this.UUID="CORE-SVC-".concat(Math.floor(89999*Math.random()+1e4))),this.serviceType="Unknown-".concat(this.UUID),this.Hash="string"==typeof i?i:this.fable||"string"!=typeof e?"".concat(this.UUID):e}connectFable(t){if("object"!=typeof t||!t.isFable){let e="Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(typeof t,"].}");return console.log(e),new Error(e)}return this.fable||(this.fable=t),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}}_defineProperty(o,"isFableService",!0),e.exports=o,e.exports.CoreServiceProviderBase=o},{"../package.json":1}],3:[function(t,e,i){!function(){var t,n,o,r,s,a,l,c,d,p,h,u,f,m,g,v,b,y,w,C,x,A,D,E,P,S,k,F,T,R,I,L=function(t){var e=new L.Builder;return e.pipeline.add(L.trimmer,L.stopWordFilter,L.stemmer),e.searchPipeline.add(L.stemmer),t.call(e,e),e.build()};L.version="2.3.9",
2
+ /*!
3
+ * lunr.utils
4
+ * Copyright (C) 2020 Oliver Nightingale
5
+ */
6
+ L.utils={},L.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),L.utils.asString=function(t){return null==t?"":t.toString()},L.utils.clone=function(t){if(null==t)return t;for(var e=Object.create(null),i=Object.keys(t),n=0;n<i.length;n++){var o=i[n],r=t[o];if(Array.isArray(r))e[o]=r.slice();else{if("string"!=typeof r&&"number"!=typeof r&&"boolean"!=typeof r)throw new TypeError("clone is not deep and does not support nested objects");e[o]=r}}return e},L.FieldRef=function(t,e,i){this.docRef=t,this.fieldName=e,this._stringValue=i},L.FieldRef.joiner="/",L.FieldRef.fromString=function(t){var e=t.indexOf(L.FieldRef.joiner);if(-1===e)throw"malformed field ref string";var i=t.slice(0,e),n=t.slice(e+1);return new L.FieldRef(n,i,t)},L.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+L.FieldRef.joiner+this.docRef),this._stringValue},
7
+ /*!
8
+ * lunr.Set
9
+ * Copyright (C) 2020 Oliver Nightingale
10
+ */
11
+ L.Set=function(t){if(this.elements=Object.create(null),t){this.length=t.length;for(var e=0;e<this.length;e++)this.elements[t[e]]=!0}else this.length=0},L.Set.complete={intersect:function(t){return t},union:function(){return this},contains:function(){return!0}},L.Set.empty={intersect:function(){return this},union:function(t){return t},contains:function(){return!1}},L.Set.prototype.contains=function(t){return!!this.elements[t]},L.Set.prototype.intersect=function(t){var e,i,n,o=[];if(t===L.Set.complete)return this;if(t===L.Set.empty)return t;this.length<t.length?(e=this,i=t):(e=t,i=this),n=Object.keys(e.elements);for(var r=0;r<n.length;r++){var s=n[r];s in i.elements&&o.push(s)}return new L.Set(o)},L.Set.prototype.union=function(t){return t===L.Set.complete?L.Set.complete:t===L.Set.empty?this:new L.Set(Object.keys(this.elements).concat(Object.keys(t.elements)))},L.idf=function(t,e){var i=0;for(var n in t)"_index"!=n&&(i+=Object.keys(t[n]).length);var o=(e-i+.5)/(i+.5);return Math.log(1+Math.abs(o))},L.Token=function(t,e){this.str=t||"",this.metadata=e||{}},L.Token.prototype.toString=function(){return this.str},L.Token.prototype.update=function(t){return this.str=t(this.str,this.metadata),this},L.Token.prototype.clone=function(t){return t=t||function(t){return t},new L.Token(t(this.str,this.metadata),this.metadata)},
12
+ /*!
13
+ * lunr.tokenizer
14
+ * Copyright (C) 2020 Oliver Nightingale
15
+ */
16
+ L.tokenizer=function(t,e){if(null==t||null==t)return[];if(Array.isArray(t))return t.map(function(t){return new L.Token(L.utils.asString(t).toLowerCase(),L.utils.clone(e))});for(var i=t.toString().toLowerCase(),n=i.length,o=[],r=0,s=0;r<=n;r++){var a=r-s;if(i.charAt(r).match(L.tokenizer.separator)||r==n){if(a>0){var l=L.utils.clone(e)||{};l.position=[s,a],l.index=o.length,o.push(new L.Token(i.slice(s,r),l))}s=r+1}}return o},L.tokenizer.separator=/[\s\-]+/,
17
+ /*!
18
+ * lunr.Pipeline
19
+ * Copyright (C) 2020 Oliver Nightingale
20
+ */
21
+ L.Pipeline=function(){this._stack=[]},L.Pipeline.registeredFunctions=Object.create(null),L.Pipeline.registerFunction=function(t,e){e in this.registeredFunctions&&L.utils.warn("Overwriting existing registered function: "+e),t.label=e,L.Pipeline.registeredFunctions[t.label]=t},L.Pipeline.warnIfFunctionNotRegistered=function(t){t.label&&t.label in this.registeredFunctions||L.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",t)},L.Pipeline.load=function(t){var e=new L.Pipeline;return t.forEach(function(t){var i=L.Pipeline.registeredFunctions[t];if(!i)throw new Error("Cannot load unregistered function: "+t);e.add(i)}),e},L.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(t){L.Pipeline.warnIfFunctionNotRegistered(t),this._stack.push(t)},this)},L.Pipeline.prototype.after=function(t,e){L.Pipeline.warnIfFunctionNotRegistered(e);var i=this._stack.indexOf(t);if(-1==i)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,e)},L.Pipeline.prototype.before=function(t,e){L.Pipeline.warnIfFunctionNotRegistered(e);var i=this._stack.indexOf(t);if(-1==i)throw new Error("Cannot find existingFn");this._stack.splice(i,0,e)},L.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},L.Pipeline.prototype.run=function(t){for(var e=this._stack.length,i=0;i<e;i++){for(var n=this._stack[i],o=[],r=0;r<t.length;r++){var s=n(t[r],r,t);if(null!=s&&""!==s)if(Array.isArray(s))for(var a=0;a<s.length;a++)o.push(s[a]);else o.push(s)}t=o}return t},L.Pipeline.prototype.runString=function(t,e){var i=new L.Token(t,e);return this.run([i]).map(function(t){return t.toString()})},L.Pipeline.prototype.reset=function(){this._stack=[]},L.Pipeline.prototype.toJSON=function(){return this._stack.map(function(t){return L.Pipeline.warnIfFunctionNotRegistered(t),t.label})},
22
+ /*!
23
+ * lunr.Vector
24
+ * Copyright (C) 2020 Oliver Nightingale
25
+ */
26
+ L.Vector=function(t){this._magnitude=0,this.elements=t||[]},L.Vector.prototype.positionForIndex=function(t){if(0==this.elements.length)return 0;for(var e=0,i=this.elements.length/2,n=i-e,o=Math.floor(n/2),r=this.elements[2*o];n>1&&(r<t&&(e=o),r>t&&(i=o),r!=t);)n=i-e,o=e+Math.floor(n/2),r=this.elements[2*o];return r==t||r>t?2*o:r<t?2*(o+1):void 0},L.Vector.prototype.insert=function(t,e){this.upsert(t,e,function(){throw"duplicate index"})},L.Vector.prototype.upsert=function(t,e,i){this._magnitude=0;var n=this.positionForIndex(t);this.elements[n]==t?this.elements[n+1]=i(this.elements[n+1],e):this.elements.splice(n,0,t,e)},L.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var t=0,e=this.elements.length,i=1;i<e;i+=2){var n=this.elements[i];t+=n*n}return this._magnitude=Math.sqrt(t)},L.Vector.prototype.dot=function(t){for(var e=0,i=this.elements,n=t.elements,o=i.length,r=n.length,s=0,a=0,l=0,c=0;l<o&&c<r;)(s=i[l])<(a=n[c])?l+=2:s>a?c+=2:s==a&&(e+=i[l+1]*n[c+1],l+=2,c+=2);return e},L.Vector.prototype.similarity=function(t){return this.dot(t)/this.magnitude()||0},L.Vector.prototype.toArray=function(){for(var t=new Array(this.elements.length/2),e=1,i=0;e<this.elements.length;e+=2,i++)t[i]=this.elements[e];return t},L.Vector.prototype.toJSON=function(){return this.elements},
27
+ /*!
28
+ * lunr.stemmer
29
+ * Copyright (C) 2020 Oliver Nightingale
30
+ * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
31
+ */
32
+ L.stemmer=(t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},n={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},a="^("+(r="[^aeiou][^aeiouy]*")+")?"+(s=(o="[aeiouy]")+"[aeiou]*")+r+"("+s+")?$",l="^("+r+")?"+s+r+s+r,c="^("+r+")?"+o,d=new RegExp("^("+r+")?"+s+r),p=new RegExp(l),h=new RegExp(a),u=new RegExp(c),f=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,g=/^(.+?)eed$/,v=/^(.+?)(ed|ing)$/,b=/.$/,y=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),C=new RegExp("^"+r+o+"[^aeiouwxy]$"),x=/^(.+?[^aeiou])y$/,A=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,D=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,E=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,P=/^(.+?)(s|t)(ion)$/,S=/^(.+?)e$/,k=/ll$/,F=new RegExp("^"+r+o+"[^aeiouwxy]$"),T=function(e){var i,o,r,s,a,l,c;if(e.length<3)return e;if("y"==(r=e.substr(0,1))&&(e=r.toUpperCase()+e.substr(1)),a=m,(s=f).test(e)?e=e.replace(s,"$1$2"):a.test(e)&&(e=e.replace(a,"$1$2")),a=v,(s=g).test(e)){var T=s.exec(e);(s=d).test(T[1])&&(s=b,e=e.replace(s,""))}else a.test(e)&&(i=(T=a.exec(e))[1],(a=u).test(i)&&(l=w,c=C,(a=y).test(e=i)?e+="e":l.test(e)?(s=b,e=e.replace(s,"")):c.test(e)&&(e+="e")));return(s=x).test(e)&&(e=(i=(T=s.exec(e))[1])+"i"),(s=A).test(e)&&(i=(T=s.exec(e))[1],o=T[2],(s=d).test(i)&&(e=i+t[o])),(s=D).test(e)&&(i=(T=s.exec(e))[1],o=T[2],(s=d).test(i)&&(e=i+n[o])),a=P,(s=E).test(e)?(i=(T=s.exec(e))[1],(s=p).test(i)&&(e=i)):a.test(e)&&(i=(T=a.exec(e))[1]+T[2],(a=p).test(i)&&(e=i)),(s=S).test(e)&&(i=(T=s.exec(e))[1],a=h,l=F,((s=p).test(i)||a.test(i)&&!l.test(i))&&(e=i)),a=p,(s=k).test(e)&&a.test(e)&&(s=b,e=e.replace(s,"")),"y"==r&&(e=r.toLowerCase()+e.substr(1)),e},function(t){return t.update(T)}),L.Pipeline.registerFunction(L.stemmer,"stemmer"),
33
+ /*!
34
+ * lunr.stopWordFilter
35
+ * Copyright (C) 2020 Oliver Nightingale
36
+ */
37
+ L.generateStopWordFilter=function(t){var e=t.reduce(function(t,e){return t[e]=e,t},{});return function(t){if(t&&e[t.toString()]!==t.toString())return t}},L.stopWordFilter=L.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),L.Pipeline.registerFunction(L.stopWordFilter,"stopWordFilter"),
38
+ /*!
39
+ * lunr.trimmer
40
+ * Copyright (C) 2020 Oliver Nightingale
41
+ */
42
+ L.trimmer=function(t){return t.update(function(t){return t.replace(/^\W+/,"").replace(/\W+$/,"")})},L.Pipeline.registerFunction(L.trimmer,"trimmer"),
43
+ /*!
44
+ * lunr.TokenSet
45
+ * Copyright (C) 2020 Oliver Nightingale
46
+ */
47
+ L.TokenSet=function(){this.final=!1,this.edges={},this.id=L.TokenSet._nextId,L.TokenSet._nextId+=1},L.TokenSet._nextId=1,L.TokenSet.fromArray=function(t){for(var e=new L.TokenSet.Builder,i=0,n=t.length;i<n;i++)e.insert(t[i]);return e.finish(),e.root},L.TokenSet.fromClause=function(t){return"editDistance"in t?L.TokenSet.fromFuzzyString(t.term,t.editDistance):L.TokenSet.fromString(t.term)},L.TokenSet.fromFuzzyString=function(t,e){for(var i=new L.TokenSet,n=[{node:i,editsRemaining:e,str:t}];n.length;){var o=n.pop();if(o.str.length>0){var r,s=o.str.charAt(0);s in o.node.edges?r=o.node.edges[s]:(r=new L.TokenSet,o.node.edges[s]=r),1==o.str.length&&(r.final=!0),n.push({node:r,editsRemaining:o.editsRemaining,str:o.str.slice(1)})}if(0!=o.editsRemaining){if("*"in o.node.edges)var a=o.node.edges["*"];else{a=new L.TokenSet;o.node.edges["*"]=a}if(0==o.str.length&&(a.final=!0),n.push({node:a,editsRemaining:o.editsRemaining-1,str:o.str}),o.str.length>1&&n.push({node:o.node,editsRemaining:o.editsRemaining-1,str:o.str.slice(1)}),1==o.str.length&&(o.node.final=!0),o.str.length>=1){if("*"in o.node.edges)var l=o.node.edges["*"];else{l=new L.TokenSet;o.node.edges["*"]=l}1==o.str.length&&(l.final=!0),n.push({node:l,editsRemaining:o.editsRemaining-1,str:o.str.slice(1)})}if(o.str.length>1){var c,d=o.str.charAt(0),p=o.str.charAt(1);p in o.node.edges?c=o.node.edges[p]:(c=new L.TokenSet,o.node.edges[p]=c),1==o.str.length&&(c.final=!0),n.push({node:c,editsRemaining:o.editsRemaining-1,str:d+o.str.slice(2)})}}}return i},L.TokenSet.fromString=function(t){for(var e=new L.TokenSet,i=e,n=0,o=t.length;n<o;n++){var r=t[n],s=n==o-1;if("*"==r)e.edges[r]=e,e.final=s;else{var a=new L.TokenSet;a.final=s,e.edges[r]=a,e=a}}return i},L.TokenSet.prototype.toArray=function(){for(var t=[],e=[{prefix:"",node:this}];e.length;){var i=e.pop(),n=Object.keys(i.node.edges),o=n.length;i.node.final&&(i.prefix.charAt(0),t.push(i.prefix));for(var r=0;r<o;r++){var s=n[r];e.push({prefix:i.prefix.concat(s),node:i.node.edges[s]})}}return t},L.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var t=this.final?"1":"0",e=Object.keys(this.edges).sort(),i=e.length,n=0;n<i;n++){var o=e[n];t=t+o+this.edges[o].id}return t},L.TokenSet.prototype.intersect=function(t){for(var e=new L.TokenSet,i=void 0,n=[{qNode:t,output:e,node:this}];n.length;){i=n.pop();for(var o=Object.keys(i.qNode.edges),r=o.length,s=Object.keys(i.node.edges),a=s.length,l=0;l<r;l++)for(var c=o[l],d=0;d<a;d++){var p=s[d];if(p==c||"*"==c){var h=i.node.edges[p],u=i.qNode.edges[c],f=h.final&&u.final,m=void 0;p in i.output.edges?(m=i.output.edges[p]).final=m.final||f:((m=new L.TokenSet).final=f,i.output.edges[p]=m),n.push({qNode:u,output:m,node:h})}}}return e},L.TokenSet.Builder=function(){this.previousWord="",this.root=new L.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},L.TokenSet.Builder.prototype.insert=function(t){var e,i=0;if(t<this.previousWord)throw new Error("Out of order word insertion");for(var n=0;n<t.length&&n<this.previousWord.length&&t[n]==this.previousWord[n];n++)i++;this.minimize(i),e=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(n=i;n<t.length;n++){var o=new L.TokenSet,r=t[n];e.edges[r]=o,this.uncheckedNodes.push({parent:e,char:r,child:o}),e=o}e.final=!0,this.previousWord=t},L.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},L.TokenSet.Builder.prototype.minimize=function(t){for(var e=this.uncheckedNodes.length-1;e>=t;e--){var i=this.uncheckedNodes[e],n=i.child.toString();n in this.minimizedNodes?i.parent.edges[i.char]=this.minimizedNodes[n]:(i.child._str=n,this.minimizedNodes[n]=i.child),this.uncheckedNodes.pop()}},
48
+ /*!
49
+ * lunr.Index
50
+ * Copyright (C) 2020 Oliver Nightingale
51
+ */
52
+ L.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},L.Index.prototype.search=function(t){return this.query(function(e){new L.QueryParser(t,e).parse()})},L.Index.prototype.query=function(t){for(var e=new L.Query(this.fields),i=Object.create(null),n=Object.create(null),o=Object.create(null),r=Object.create(null),s=Object.create(null),a=0;a<this.fields.length;a++)n[this.fields[a]]=new L.Vector;t.call(e,e);for(a=0;a<e.clauses.length;a++){var l=e.clauses[a],c=null,d=L.Set.empty;c=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var p=0;p<c.length;p++){var h=c[p];l.term=h;var u=L.TokenSet.fromClause(l),f=this.tokenSet.intersect(u).toArray();if(0===f.length&&l.presence===L.Query.presence.REQUIRED){for(var m=0;m<l.fields.length;m++){r[R=l.fields[m]]=L.Set.empty}break}for(var g=0;g<f.length;g++){var v=f[g],b=this.invertedIndex[v],y=b._index;for(m=0;m<l.fields.length;m++){var w=b[R=l.fields[m]],C=Object.keys(w),x=v+"/"+R,A=new L.Set(C);if(l.presence==L.Query.presence.REQUIRED&&(d=d.union(A),void 0===r[R]&&(r[R]=L.Set.complete)),l.presence!=L.Query.presence.PROHIBITED){if(n[R].upsert(y,l.boost,function(t,e){return t+e}),!o[x]){for(var D=0;D<C.length;D++){var E,P=C[D],S=new L.FieldRef(P,R),k=w[P];void 0===(E=i[S])?i[S]=new L.MatchData(v,R,k):E.add(v,R,k)}o[x]=!0}}else void 0===s[R]&&(s[R]=L.Set.empty),s[R]=s[R].union(A)}}}if(l.presence===L.Query.presence.REQUIRED)for(m=0;m<l.fields.length;m++){r[R=l.fields[m]]=r[R].intersect(d)}}var F=L.Set.complete,T=L.Set.empty;for(a=0;a<this.fields.length;a++){var R;r[R=this.fields[a]]&&(F=F.intersect(r[R])),s[R]&&(T=T.union(s[R]))}var I=Object.keys(i),M=[],_=Object.create(null);if(e.isNegated()){I=Object.keys(this.fieldVectors);for(a=0;a<I.length;a++){S=I[a];var B=L.FieldRef.fromString(S);i[S]=new L.MatchData}}for(a=0;a<I.length;a++){var H=(B=L.FieldRef.fromString(I[a])).docRef;if(F.contains(H)&&!T.contains(H)){var V,j=this.fieldVectors[B],z=n[B.fieldName].similarity(j);if(void 0!==(V=_[H]))V.score+=z,V.matchData.combine(i[B]);else{var N={ref:H,score:z,matchData:i[B]};_[H]=N,M.push(N)}}}return M.sort(function(t,e){return e.score-t.score})},L.Index.prototype.toJSON=function(){var t=Object.keys(this.invertedIndex).sort().map(function(t){return[t,this.invertedIndex[t]]},this),e=Object.keys(this.fieldVectors).map(function(t){return[t,this.fieldVectors[t].toJSON()]},this);return{version:L.version,fields:this.fields,fieldVectors:e,invertedIndex:t,pipeline:this.pipeline.toJSON()}},L.Index.load=function(t){var e={},i={},n=t.fieldVectors,o=Object.create(null),r=t.invertedIndex,s=new L.TokenSet.Builder,a=L.Pipeline.load(t.pipeline);t.version!=L.version&&L.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+L.version+"' does not match serialized index '"+t.version+"'");for(var l=0;l<n.length;l++){var c=(p=n[l])[0],d=p[1];i[c]=new L.Vector(d)}for(l=0;l<r.length;l++){var p,h=(p=r[l])[0],u=p[1];s.insert(h),o[h]=u}return s.finish(),e.fields=t.fields,e.fieldVectors=i,e.invertedIndex=o,e.tokenSet=s.root,e.pipeline=a,new L.Index(e)},
53
+ /*!
54
+ * lunr.Builder
55
+ * Copyright (C) 2020 Oliver Nightingale
56
+ */
57
+ L.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=L.tokenizer,this.pipeline=new L.Pipeline,this.searchPipeline=new L.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},L.Builder.prototype.ref=function(t){this._ref=t},L.Builder.prototype.field=function(t,e){if(/\//.test(t))throw new RangeError("Field '"+t+"' contains illegal character '/'");this._fields[t]=e||{}},L.Builder.prototype.b=function(t){this._b=t<0?0:t>1?1:t},L.Builder.prototype.k1=function(t){this._k1=t},L.Builder.prototype.add=function(t,e){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=e||{},this.documentCount+=1;for(var o=0;o<n.length;o++){var r=n[o],s=this._fields[r].extractor,a=s?s(t):t[r],l=this.tokenizer(a,{fields:[r]}),c=this.pipeline.run(l),d=new L.FieldRef(i,r),p=Object.create(null);this.fieldTermFrequencies[d]=p,this.fieldLengths[d]=0,this.fieldLengths[d]+=c.length;for(var h=0;h<c.length;h++){var u=c[h];if(null==p[u]&&(p[u]=0),p[u]+=1,null==this.invertedIndex[u]){var f=Object.create(null);f._index=this.termIndex,this.termIndex+=1;for(var m=0;m<n.length;m++)f[n[m]]=Object.create(null);this.invertedIndex[u]=f}null==this.invertedIndex[u][r][i]&&(this.invertedIndex[u][r][i]=Object.create(null));for(var g=0;g<this.metadataWhitelist.length;g++){var v=this.metadataWhitelist[g],b=u.metadata[v];null==this.invertedIndex[u][r][i][v]&&(this.invertedIndex[u][r][i][v]=[]),this.invertedIndex[u][r][i][v].push(b)}}}},L.Builder.prototype.calculateAverageFieldLengths=function(){for(var t=Object.keys(this.fieldLengths),e=t.length,i={},n={},o=0;o<e;o++){var r=L.FieldRef.fromString(t[o]),s=r.fieldName;n[s]||(n[s]=0),n[s]+=1,i[s]||(i[s]=0),i[s]+=this.fieldLengths[r]}var a=Object.keys(this._fields);for(o=0;o<a.length;o++){var l=a[o];i[l]=i[l]/n[l]}this.averageFieldLength=i},L.Builder.prototype.createFieldVectors=function(){for(var t={},e=Object.keys(this.fieldTermFrequencies),i=e.length,n=Object.create(null),o=0;o<i;o++){for(var r=L.FieldRef.fromString(e[o]),s=r.fieldName,a=this.fieldLengths[r],l=new L.Vector,c=this.fieldTermFrequencies[r],d=Object.keys(c),p=d.length,h=this._fields[s].boost||1,u=this._documents[r.docRef].boost||1,f=0;f<p;f++){var m,g,v,b=d[f],y=c[b],w=this.invertedIndex[b]._index;void 0===n[b]?(m=L.idf(this.invertedIndex[b],this.documentCount),n[b]=m):m=n[b],g=m*((this._k1+1)*y)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[s]))+y),g*=h,g*=u,v=Math.round(1e3*g)/1e3,l.insert(w,v)}t[r]=l}this.fieldVectors=t},L.Builder.prototype.createTokenSet=function(){this.tokenSet=L.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},L.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new L.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},L.Builder.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},L.MatchData=function(t,e,i){for(var n=Object.create(null),o=Object.keys(i||{}),r=0;r<o.length;r++){var s=o[r];n[s]=i[s].slice()}this.metadata=Object.create(null),void 0!==t&&(this.metadata[t]=Object.create(null),this.metadata[t][e]=n)},L.MatchData.prototype.combine=function(t){for(var e=Object.keys(t.metadata),i=0;i<e.length;i++){var n=e[i],o=Object.keys(t.metadata[n]);null==this.metadata[n]&&(this.metadata[n]=Object.create(null));for(var r=0;r<o.length;r++){var s=o[r],a=Object.keys(t.metadata[n][s]);null==this.metadata[n][s]&&(this.metadata[n][s]=Object.create(null));for(var l=0;l<a.length;l++){var c=a[l];null==this.metadata[n][s][c]?this.metadata[n][s][c]=t.metadata[n][s][c]:this.metadata[n][s][c]=this.metadata[n][s][c].concat(t.metadata[n][s][c])}}}},L.MatchData.prototype.add=function(t,e,i){if(!(t in this.metadata))return this.metadata[t]=Object.create(null),void(this.metadata[t][e]=i);if(e in this.metadata[t])for(var n=Object.keys(i),o=0;o<n.length;o++){var r=n[o];r in this.metadata[t][e]?this.metadata[t][e][r]=this.metadata[t][e][r].concat(i[r]):this.metadata[t][e][r]=i[r]}else this.metadata[t][e]=i},L.Query=function(t){this.clauses=[],this.allFields=t},L.Query.wildcard=new String("*"),L.Query.wildcard.NONE=0,L.Query.wildcard.LEADING=1,L.Query.wildcard.TRAILING=2,L.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},L.Query.prototype.clause=function(t){return"fields"in t||(t.fields=this.allFields),"boost"in t||(t.boost=1),"usePipeline"in t||(t.usePipeline=!0),"wildcard"in t||(t.wildcard=L.Query.wildcard.NONE),t.wildcard&L.Query.wildcard.LEADING&&t.term.charAt(0)!=L.Query.wildcard&&(t.term="*"+t.term),t.wildcard&L.Query.wildcard.TRAILING&&t.term.slice(-1)!=L.Query.wildcard&&(t.term=t.term+"*"),"presence"in t||(t.presence=L.Query.presence.OPTIONAL),this.clauses.push(t),this},L.Query.prototype.isNegated=function(){for(var t=0;t<this.clauses.length;t++)if(this.clauses[t].presence!=L.Query.presence.PROHIBITED)return!1;return!0},L.Query.prototype.term=function(t,e){if(Array.isArray(t))return t.forEach(function(t){this.term(t,L.utils.clone(e))},this),this;var i=e||{};return i.term=t.toString(),this.clause(i),this},L.QueryParseError=function(t,e,i){this.name="QueryParseError",this.message=t,this.start=e,this.end=i},L.QueryParseError.prototype=new Error,L.QueryLexer=function(t){this.lexemes=[],this.str=t,this.length=t.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},L.QueryLexer.prototype.run=function(){for(var t=L.QueryLexer.lexText;t;)t=t(this)},L.QueryLexer.prototype.sliceString=function(){for(var t=[],e=this.start,i=this.pos,n=0;n<this.escapeCharPositions.length;n++)i=this.escapeCharPositions[n],t.push(this.str.slice(e,i)),e=i+1;return t.push(this.str.slice(e,this.pos)),this.escapeCharPositions.length=0,t.join("")},L.QueryLexer.prototype.emit=function(t){this.lexemes.push({type:t,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},L.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},L.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return L.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},L.QueryLexer.prototype.width=function(){return this.pos-this.start},L.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},L.QueryLexer.prototype.backup=function(){this.pos-=1},L.QueryLexer.prototype.acceptDigitRun=function(){var t,e;do{e=(t=this.next()).charCodeAt(0)}while(e>47&&e<58);t!=L.QueryLexer.EOS&&this.backup()},L.QueryLexer.prototype.more=function(){return this.pos<this.length},L.QueryLexer.EOS="EOS",L.QueryLexer.FIELD="FIELD",L.QueryLexer.TERM="TERM",L.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",L.QueryLexer.BOOST="BOOST",L.QueryLexer.PRESENCE="PRESENCE",L.QueryLexer.lexField=function(t){return t.backup(),t.emit(L.QueryLexer.FIELD),t.ignore(),L.QueryLexer.lexText},L.QueryLexer.lexTerm=function(t){if(t.width()>1&&(t.backup(),t.emit(L.QueryLexer.TERM)),t.ignore(),t.more())return L.QueryLexer.lexText},L.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(L.QueryLexer.EDIT_DISTANCE),L.QueryLexer.lexText},L.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(L.QueryLexer.BOOST),L.QueryLexer.lexText},L.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(L.QueryLexer.TERM)},L.QueryLexer.termSeparator=L.tokenizer.separator,L.QueryLexer.lexText=function(t){for(;;){var e=t.next();if(e==L.QueryLexer.EOS)return L.QueryLexer.lexEOS;if(92!=e.charCodeAt(0)){if(":"==e)return L.QueryLexer.lexField;if("~"==e)return t.backup(),t.width()>0&&t.emit(L.QueryLexer.TERM),L.QueryLexer.lexEditDistance;if("^"==e)return t.backup(),t.width()>0&&t.emit(L.QueryLexer.TERM),L.QueryLexer.lexBoost;if("+"==e&&1===t.width())return t.emit(L.QueryLexer.PRESENCE),L.QueryLexer.lexText;if("-"==e&&1===t.width())return t.emit(L.QueryLexer.PRESENCE),L.QueryLexer.lexText;if(e.match(L.QueryLexer.termSeparator))return L.QueryLexer.lexTerm}else t.escapeCharacter()}},L.QueryParser=function(t,e){this.lexer=new L.QueryLexer(t),this.query=e,this.currentClause={},this.lexemeIdx=0},L.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=L.QueryParser.parseClause;t;)t=t(this);return this.query},L.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},L.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},L.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},L.QueryParser.parseClause=function(t){var e=t.peekLexeme();if(null!=e)switch(e.type){case L.QueryLexer.PRESENCE:return L.QueryParser.parsePresence;case L.QueryLexer.FIELD:return L.QueryParser.parseField;case L.QueryLexer.TERM:return L.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+e.type;throw e.str.length>=1&&(i+=" with value '"+e.str+"'"),new L.QueryParseError(i,e.start,e.end)}},L.QueryParser.parsePresence=function(t){var e=t.consumeLexeme();if(null!=e){switch(e.str){case"-":t.currentClause.presence=L.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=L.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+e.str+"'";throw new L.QueryParseError(i,e.start,e.end)}var n=t.peekLexeme();if(null==n){i="expecting term or field, found nothing";throw new L.QueryParseError(i,e.start,e.end)}switch(n.type){case L.QueryLexer.FIELD:return L.QueryParser.parseField;case L.QueryLexer.TERM:return L.QueryParser.parseTerm;default:i="expecting term or field, found '"+n.type+"'";throw new L.QueryParseError(i,n.start,n.end)}}},L.QueryParser.parseField=function(t){var e=t.consumeLexeme();if(null!=e){if(-1==t.query.allFields.indexOf(e.str)){var i=t.query.allFields.map(function(t){return"'"+t+"'"}).join(", "),n="unrecognised field '"+e.str+"', possible fields: "+i;throw new L.QueryParseError(n,e.start,e.end)}t.currentClause.fields=[e.str];var o=t.peekLexeme();if(null==o){n="expecting term, found nothing";throw new L.QueryParseError(n,e.start,e.end)}if(o.type===L.QueryLexer.TERM)return L.QueryParser.parseTerm;n="expecting term, found '"+o.type+"'";throw new L.QueryParseError(n,o.start,o.end)}},L.QueryParser.parseTerm=function(t){var e=t.consumeLexeme();if(null!=e){t.currentClause.term=e.str.toLowerCase(),-1!=e.str.indexOf("*")&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(null!=i)switch(i.type){case L.QueryLexer.TERM:return t.nextClause(),L.QueryParser.parseTerm;case L.QueryLexer.FIELD:return t.nextClause(),L.QueryParser.parseField;case L.QueryLexer.EDIT_DISTANCE:return L.QueryParser.parseEditDistance;case L.QueryLexer.BOOST:return L.QueryParser.parseBoost;case L.QueryLexer.PRESENCE:return t.nextClause(),L.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new L.QueryParseError(n,i.start,i.end)}else t.nextClause()}},L.QueryParser.parseEditDistance=function(t){var e=t.consumeLexeme();if(null!=e){var i=parseInt(e.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new L.QueryParseError(n,e.start,e.end)}t.currentClause.editDistance=i;var o=t.peekLexeme();if(null!=o)switch(o.type){case L.QueryLexer.TERM:return t.nextClause(),L.QueryParser.parseTerm;case L.QueryLexer.FIELD:return t.nextClause(),L.QueryParser.parseField;case L.QueryLexer.EDIT_DISTANCE:return L.QueryParser.parseEditDistance;case L.QueryLexer.BOOST:return L.QueryParser.parseBoost;case L.QueryLexer.PRESENCE:return t.nextClause(),L.QueryParser.parsePresence;default:n="Unexpected lexeme type '"+o.type+"'";throw new L.QueryParseError(n,o.start,o.end)}else t.nextClause()}},L.QueryParser.parseBoost=function(t){var e=t.consumeLexeme();if(null!=e){var i=parseInt(e.str,10);if(isNaN(i)){var n="boost must be numeric";throw new L.QueryParseError(n,e.start,e.end)}t.currentClause.boost=i;var o=t.peekLexeme();if(null!=o)switch(o.type){case L.QueryLexer.TERM:return t.nextClause(),L.QueryParser.parseTerm;case L.QueryLexer.FIELD:return t.nextClause(),L.QueryParser.parseField;case L.QueryLexer.EDIT_DISTANCE:return L.QueryParser.parseEditDistance;case L.QueryLexer.BOOST:return L.QueryParser.parseBoost;case L.QueryLexer.PRESENCE:return t.nextClause(),L.QueryParser.parsePresence;default:n="Unexpected lexeme type '"+o.type+"'";throw new L.QueryParseError(n,o.start,o.end)}else t.nextClause()}},R=this,I=function(){return L},"object"==typeof i?e.exports=I():R.lunr=I()}()},{}],4:[function(t,e,i){e.exports={name:"pict-application",version:"1.0.32",description:"Application base class for a pict view-based application",main:"source/Pict-Application.js",scripts:{test:"npx mocha -u tdd -R spec",start:"node source/Pict-Application.js",coverage:"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-application-image:local","docker-dev-run":'docker run -it -d --name pict-application-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-application" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-application-image:local',"docker-dev-shell":"docker exec -it pict-application-dev /bin/bash",tests:"npx mocha -u tdd --exit -R spec --grep",lint:"eslint source/**",types:"tsc -p ."},types:"types/source/Pict-Application.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-application.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-application/issues"},homepage:"https://github.com/stevenvelozo/pict-application#readme",devDependencies:{"@eslint/js":"^9.28.0","browser-env":"^3.3.0",eslint:"^9.28.0",pict:"^1.0.348","pict-provider":"^1.0.10","pict-view":"^1.0.66",quackage:"^1.0.51",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{"fable-serviceproviderbase":"^3.0.18"}}},{}],5:[function(t,e,i){const n=t("fable-serviceproviderbase"),o=t("../package.json"),r={Name:"DefaultPictApplication",MainViewportViewIdentifier:"Default-View",MainViewportRenderableHash:!1,MainViewportDestinationAddress:!1,MainViewportDefaultDataAddress:!1,AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!0,AutoRenderViewsAfterInitialize:!1,AutoLoginAfterInitialize:!1,AutoLoadDataAfterLogin:!1,ConfigurationOnlyViews:[],Manifests:{},IdentifierAddressPrefix:"PICT-"};e.exports=class extends n{constructor(t,e,i){let n="object"==typeof t.settings.PictApplicationConfiguration?t.settings.PictApplicationConfiguration:{};super(t,Object.assign({},JSON.parse(JSON.stringify(r)),n,e),i),this.options,this.log,this.fable,this.UUID,this.Hash,this.servicesMap,this.serviceType="PictApplication",this._Package=o,this.pict=this.fable,this.AppData=this.fable.AppData,this.Bundle=this.fable.Bundle,this.initializeTimestamp,this.lastSolvedTimestamp,this.lastLoginTimestamp,this.lastMarshalFromViewsTimestamp,this.lastMarshalToViewsTimestamp,this.lastAutoRenderTimestamp,this.lastLoadDataTimestamp;let s=Object.keys(this.options.Manifests);if(s.length>0)for(let t=0;t<s.length;t++){let e=s[t];this.fable.instantiateServiceProvider("Manifest",this.options.Manifests[e],e)}}onPreSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onPreSolve:")),!0}onPreSolveAsync(t){return this.onPreSolve(),t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeSolve:")),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onSolve:")),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," executing solve() function..."));let t=Object.keys(this.pict.providers),e=[];for(let i=0;i<t.length;i++){let n=this.pict.providers[t[i]];n.options.AutoSolveWithApp&&e.push(n)}e.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<e.length;t++)e[t].solve(e[t]);this.onBeforeSolve();let i=Object.keys(this.pict.views),n=[];for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoInitialize&&n.push(e)}n.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<n.length;t++)n[t].solve();return this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),!0}solveAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");e.anticipate(this.onBeforeSolveAsync.bind(this));let i="function"==typeof t&&t;i||(this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),i=t=>{t&&this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync Auto Callback Error: ").concat(t),t)});let n=Object.keys(this.pict.providers),o=[];for(let t=0;t<n.length;t++){let e=this.pict.providers[n[t]];e.options.AutoSolveWithApp&&o.push(e)}o.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<o.length;t++)e.anticipate(o[t].solveAsync.bind(o[t]));let r=Object.keys(this.pict.views),s=[];for(let t=0;t<r.length;t++){let e=this.pict.views[r[t]];e.options.AutoSolveWithApp&&s.push(e)}s.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<s.length;t++)e.anticipate(s[t].solveAsync.bind(s[t]));e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync() complete.")),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterSolve:")),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeLoginAsync:")),t()}onLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onLoginAsync:")),t()}loginAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," loginAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),i=t=>{t&&this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," loginAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeLoginAsync.bind(this)),e.anticipate(this.onLoginAsync.bind(this)),e.anticipate(this.onAfterLoginAsync.bind(this)),this.options.AutoLoadDataAfterLogin&&e.anticipate(t=>{if(!this.isLoggedIn())return t();this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto loading data after login...")),this.loadDataAsync(e=>{t(e)})}),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," loginAsync() complete.")),this.lastLoginTimestamp=this.fable.log.getTimeStamp(),i(t)))}isLoggedIn(){return!0}onAfterLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterLoginAsync:")),t()}onBeforeLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeLoadDataAsync:")),t()}onLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onLoadDataAsync:")),t()}loadDataAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," loadDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),i=t=>{t&&this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," loadDataAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeLoadDataAsync.bind(this));let n=Object.keys(this.pict.providers),o=[];for(let t=0;t<n.length;t++){let e=this.pict.providers[n[t]];e.options.AutoLoadDataWithApp&&o.push(e)}o.sort((t,e)=>t.options.AutoLoadDataOrdinal-e.options.AutoLoadDataOrdinal);for(const t of o)e.anticipate(t.onBeforeLoadDataAsync.bind(t));e.anticipate(this.onLoadDataAsync.bind(this));for(const t of o)e.anticipate(t.onLoadDataAsync.bind(t));e.anticipate(this.onAfterLoadDataAsync.bind(this));for(const t of o)e.anticipate(t.onAfterLoadDataAsync.bind(t));e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," loadDataAsync() complete.")),this.lastLoadDataTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterLoadDataAsync:")),t()}onBeforeSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeSaveDataAsync:")),t()}onSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onSaveDataAsync:")),t()}saveDataAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," saveDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),i=t=>{t&&this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," saveDataAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeSaveDataAsync.bind(this));let n=Object.keys(this.pict.providers),o=[];for(let t=0;t<n.length;t++){let e=this.pict.providers[n[t]];e.options.AutoSaveDataWithApp&&o.push(e)}o.sort((t,e)=>t.options.AutoSaveDataOrdinal-e.options.AutoSaveDataOrdinal);for(const t of o)e.anticipate(t.onBeforeSaveDataAsync.bind(t));e.anticipate(this.onSaveDataAsync.bind(this));for(const t of o)e.anticipate(t.onSaveDataAsync.bind(t));e.anticipate(this.onAfterSaveDataAsync.bind(this));for(const t of o)e.anticipate(t.onAfterSaveDataAsync.bind(t));e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," saveDataAsync() complete.")),this.lastSaveDataTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterSaveDataAsync:")),t()}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeInitialize:")),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onInitialize:")),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){if(this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow APPLICATION [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initialize:")),this.initializeTimestamp)return this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initialize called but initialization is already completed. Aborting.")),!1;{if(this.onBeforeInitialize(),"ConfigurationOnlyViews"in this.options)for(let t=0;t<this.options.ConfigurationOnlyViews.length;t++){let e=void 0===this.options.ConfigurationOnlyViews[t].ViewIdentifier?"AutoView-".concat(this.fable.getUUID()):this.options.ConfigurationOnlyViews[t].ViewIdentifier;this.log.info("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," adding configuration only view: ").concat(e)),this.pict.addView(e,this.options.ConfigurationOnlyViews[t])}this.onInitialize();let t=Object.keys(this.pict.providers),e=[];for(let i=0;i<t.length;i++){let n=this.pict.providers[t[i]];n.options.AutoInitialize&&e.push(n)}e.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<e.length;t++)e[t].initialize();let i=Object.keys(this.pict.views),n=[];for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoInitialize&&n.push(e)}n.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<n.length;t++)n[t].initialize();return this.onAfterInitialize(),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto solving after initialization...")),this.solve()),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto rendering after initialization...")),this.render()),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.onCompletionOfInitialize(),!0}}initializeAsync(t){this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow APPLICATION [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initializeAsync:"));let e="function"==typeof t&&t;if(e||(this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initializeAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),e=t=>{t&&this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initializeAsync Auto Callback Error: ").concat(t),t)}),this.initializeTimestamp)return this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," async initialize called but initialization is already completed. Aborting.")),this.onCompletionOfInitializeAsync(e);{let t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");if(this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," beginning initialization...")),"ConfigurationOnlyViews"in this.options)for(let t=0;t<this.options.ConfigurationOnlyViews.length;t++){let e=void 0===this.options.ConfigurationOnlyViews[t].ViewIdentifier?"AutoView-".concat(this.fable.getUUID()):this.options.ConfigurationOnlyViews[t].ViewIdentifier;this.log.info("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," adding configuration only view: ").concat(e)),this.pict.addView(e,this.options.ConfigurationOnlyViews[t])}t.anticipate(this.onBeforeInitializeAsync.bind(this)),t.anticipate(this.onInitializeAsync.bind(this));let i=Object.keys(this.pict.providers),n=[];for(let t=0;t<i.length;t++){let e=this.pict.providers[i[t]];e.options.AutoInitialize&&n.push(e)}n.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let e=0;e<n.length;e++)t.anticipate(n[e].initializeAsync.bind(n[e]));let o=Object.keys(this.pict.views),r=[];for(let t=0;t<o.length;t++){let e=this.pict.views[o[t]];e.options.AutoInitialize&&r.push(e)}r.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let e=0;e<r.length;e++){let i=r[e];t.anticipate(i.initializeAsync.bind(i))}t.anticipate(this.onAfterInitializeAsync.bind(this)),this.options.AutoLoginAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto login (asynchronously) after initialization...")),t.anticipate(this.loginAsync.bind(this))),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto solving (asynchronously) after initialization...")),t.anticipate(this.solveAsync.bind(this))),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," auto rendering (asynchronously) after initialization...")),t.anticipate(this.renderMainViewportAsync.bind(this))),t.wait(t=>(t&&this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initializeAsync Error: ").concat(t.message||t),{stack:t.stack}),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," initialization complete.")),e()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterInitialize:")),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onCompletionOfInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onCompletionOfInitialize:")),!0}onCompletionOfInitializeAsync(t){return this.onCompletionOfInitialize(),t()}onBeforeMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeMarshalFromViews:")),!0}onBeforeMarshalFromViewsAsync(t){return this.onBeforeMarshalFromViews(),t()}onMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onMarshalFromViews:")),!0}onMarshalFromViewsAsync(t){return this.onMarshalFromViews(),t()}marshalFromViews(){this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," executing marshalFromViews() function...")),this.onBeforeMarshalFromViews();let t=Object.keys(this.pict.views),e=[];for(let i=0;i<t.length;i++){let n=this.pict.views[t[i]];e.push(n)}for(let t=0;t<e.length;t++)e[t].marshalFromView();return this.onMarshalFromViews(),this.onAfterMarshalFromViews(),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalFromViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),i=t=>{t&&this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewsAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeMarshalFromViewsAsync.bind(this));let n=Object.keys(this.pict.views),o=[];for(let t=0;t<n.length;t++){let e=this.pict.views[n[t]];o.push(e)}for(let t=0;t<o.length;t++)e.anticipate(o[t].marshalFromViewAsync.bind(o[t]));e.anticipate(this.onMarshalFromViewsAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewsAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewsAsync() complete.")),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterMarshalFromViews:")),!0}onAfterMarshalFromViewsAsync(t){return this.onAfterMarshalFromViews(),t()}onBeforeMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeMarshalToViews:")),!0}onBeforeMarshalToViewsAsync(t){return this.onBeforeMarshalToViews(),t()}onMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onMarshalToViews:")),!0}onMarshalToViewsAsync(t){return this.onMarshalToViews(),t()}marshalToViews(){this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," executing marshalToViews() function...")),this.onBeforeMarshalToViews();let t=Object.keys(this.pict.views),e=[];for(let i=0;i<t.length;i++){let n=this.pict.views[t[i]];e.push(n)}for(let t=0;t<e.length;t++)e[t].marshalToView();return this.onMarshalToViews(),this.onAfterMarshalToViews(),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalToViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),i=t=>{t&&this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewsAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeMarshalToViewsAsync.bind(this));let n=Object.keys(this.pict.views),o=[];for(let t=0;t<n.length;t++){let e=this.pict.views[n[t]];o.push(e)}for(let t=0;t<o.length;t++)e.anticipate(o[t].marshalToViewAsync.bind(o[t]));e.anticipate(this.onMarshalToViewsAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewsAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewsAsync() complete.")),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterMarshalToViews:")),!0}onAfterMarshalToViewsAsync(t){return this.onAfterMarshalToViews(),t()}onBeforeRender(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onBeforeRender:")),!0}onBeforeRenderAsync(t){return this.onBeforeRender(),t()}render(t,e,i,n){let o="string"!=typeof t?this.options.MainViewportViewIdentifier:t,r="string"!=typeof e?this.options.MainViewportRenderableHash:e,s="string"!=typeof i?this.options.MainViewportDestinationAddress:i,a="string"!=typeof n?this.options.MainViewportDefaultDataAddress:n;this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow APPLICATION [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," VIEW Renderable[").concat(r,"] Destination[").concat(s,"] TemplateDataAddress[").concat(a,"] render:")),this.onBeforeRender();let l="string"==typeof o&&this.servicesMap.PictView[o];return l?(this.onRender(),l.render(r,s,a),this.onAfterRender(),!0):(this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not render from View ").concat(o," because it is not a valid view.")),!1)}onRender(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onRender:")),!0}onRenderAsync(t){return this.onRender(),t()}renderAsync(t,e,i,n,o){let r="string"!=typeof t?this.options.MainViewportViewIdentifier:t,s="string"!=typeof e?this.options.MainViewportRenderableHash:e,a="string"!=typeof i?this.options.MainViewportDestinationAddress:i,l="string"!=typeof n?this.options.MainViewportDefaultDataAddress:n,c="function"==typeof o?o:"function"==typeof n?n:"function"==typeof i?i:"function"==typeof e?e:"function"==typeof t&&t;c||(this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),c=t=>{t&&this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync Auto Callback Error: ").concat(t),t)}),this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow APPLICATION [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," VIEW Renderable[").concat(s,"] Destination[").concat(a,"] TemplateDataAddress[").concat(l,"] renderAsync:"));let d=this.fable.newAnticipate();d.anticipate(this.onBeforeRenderAsync.bind(this));let p="string"==typeof r&&this.servicesMap.PictView[r];if(!p){let t="PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," could not asynchronously render from View ").concat(r," because it is not a valid view.");return this.pict.LogNoisiness>3&&this.log.error(t),c(new Error(t))}return d.anticipate(this.onRenderAsync.bind(this)),d.anticipate(t=>{p.renderAsync.call(p,s,a,l,t)}),d.anticipate(this.onAfterRenderAsync.bind(this)),d.wait(c)}onAfterRender(){return this.pict.LogNoisiness>3&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," onAfterRender:")),!0}onAfterRenderAsync(t){return this.onAfterRender(),t()}renderMainViewport(){return this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow APPLICATION [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderMainViewport:")),this.render()}renderMainViewportAsync(t){return this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow APPLICATION [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderMainViewportAsync:")),this.renderAsync(t)}renderAutoViews(){this.pict.LogNoisiness>0&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," beginning renderAutoViews..."));let t=Object.keys(this.pict.views);t.sort((t,e)=>this.pict.views[t].options.AutoRenderOrdinal-this.pict.views[e].options.AutoRenderOrdinal);for(let e=0;e<t.length;e++){let i=this.pict.views[t[e]];i.options.AutoRender&&i.render()}this.pict.LogNoisiness>0&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAutoViewsAsync complete."))}renderAutoViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAutoViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),i=t=>{t&&this.log.error("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAutoViewsAsync Auto Callback Error: ").concat(t),t)}),this.pict.LogNoisiness>0&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," beginning renderAutoViewsAsync..."));let n=Object.keys(this.pict.views);n.sort((t,e)=>this.pict.views[t].options.AutoRenderOrdinal-this.pict.views[e].options.AutoRenderOrdinal);for(let t=0;t<n.length;t++){let i=this.pict.views[n[t]];i.options.AutoRender&&e.anticipate(i.renderAsync.bind(i))}e.wait(t=>(this.lastAutoRenderTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.trace("PictApp [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAutoViewsAsync complete.")),i(t)))}get isPictApplication(){return!0}}},{"../package.json":4,"fable-serviceproviderbase":2}],6:[function(t,e,i){e.exports=t("./views/Pict-View-Content.js"),e.exports.PictContentProvider=t("./providers/Pict-Provider-Content.js")},{"./providers/Pict-Provider-Content.js":7,"./views/Pict-View-Content.js":8}],7:[function(t,e,i){const n=t("pict-provider");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}parseMarkdown(t,e){if(!t)return"";let i=t.split("\n"),n=[],o=!1,r=0,s="",a=[],l=!1,c="",d=!1,p=[],h=!1,u=[],f=[],m=()=>{f.length>0&&(n.push("<p>"+f.map(t=>this.parseInline(t,e)).join(" ")+"</p>"),f=[])};for(let t=0;t<i.length;t++){let g=i[t];if(!o&&g.trim().match(/^\$\$/)){h?(n.push('<div class="pict-content-katex-display">'+u.join("\n")+"</div>"),h=!1,u=[]):(m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1),d&&(n.push("<blockquote>"+this.parseMarkdown(p.join("\n"),e)+"</blockquote>"),d=!1,p=[]),h=!0);continue}if(h){u.push(g);continue}let v=g.match(/^(`{3,})/);if(v){let t=v[1].length;if(o){if(t>=r&&g.trim()===v[1]){"mermaid"===s?n.push('<pre class="mermaid">'+a.join("\n")+"</pre>"):n.push('<pre><code class="language-'+this.escapeHTML(s)+'">'+this.escapeHTML(a.join("\n"))+"</code></pre>"),o=!1,r=0,s="",a=[];continue}a.push(g);continue}m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1),d&&(n.push("<blockquote>"+this.parseMarkdown(p.join("\n"),e)+"</blockquote>"),d=!1,p=[]),r=t,s=g.replace(/^`{3,}/,"").trim(),o=!0;continue}if(o){a.push(g);continue}if(g.match(/^>\s?/)){d||(m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1),d=!0,p=[]),p.push(g.replace(/^>\s?/,""));continue}if(d&&(n.push("<blockquote>"+this.parseMarkdown(p.join("\n"),e)+"</blockquote>"),d=!1,p=[]),g.match(/^(-{3,}|\*{3,}|_{3,})\s*$/)){m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1),n.push("<hr>");continue}let b=g.match(/^(#{1,6})\s+(.+)/);if(b){m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1);let t=b[1].length,i=this.parseInline(b[2],e),o=b[2].toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-");n.push("<h"+t+' id="'+o+'">'+i+"</h"+t+">");continue}let y=g.match(/^(\s*)[-*+]\s+(.*)/);if(y){m(),l&&"ul"===c||(l&&n.push("ul"===c?"</ul>":"</ol>"),n.push("<ul>"),l=!0,c="ul"),n.push("<li>"+this.parseInline(y[2],e)+"</li>");continue}let w=g.match(/^(\s*)\d+\.\s+(.*)/);if(w)m(),l&&"ol"===c||(l&&n.push("ul"===c?"</ul>":"</ol>"),n.push("<ol>"),l=!0,c="ol"),n.push("<li>"+this.parseInline(w[2],e)+"</li>");else if(l&&""!==g.trim()&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1),""!==g.trim()){if(g.match(/^\|/)&&t+1<i.length&&i[t+1].match(/^\|[\s-:|]+\|/)){m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1);let o="<table>",r=g.split("|").filter(t=>""!==t.trim());o+="<thead><tr>";for(let t=0;t<r.length;t++)o+="<th>"+this.parseInline(r[t].trim(),e)+"</th>";for(o+="</tr></thead>",t++,o+="<tbody>";t+1<i.length&&i[t+1].match(/^\|/);){t++;let n=i[t].split("|").filter(t=>""!==t.trim());o+="<tr>";for(let t=0;t<n.length;t++)o+="<td>"+this.parseInline(n[t].trim(),e)+"</td>";o+="</tr>"}o+="</tbody></table>",n.push(o);continue}f.push(g)}else m()}return m(),l&&n.push("ul"===c?"</ul>":"</ol>"),d&&n.push("<blockquote>"+this.parseMarkdown(p.join("\n"),e)+"</blockquote>"),o&&n.push("<pre><code>"+this.escapeHTML(a.join("\n"))+"</code></pre>"),n.join("\n")}parseInline(t,e){if(!t)return"";let i=t,n=[];return i=i.replace(/`([^`]+)`/g,(t,e)=>{let i=n.length;return n.push("<code>"+e+"</code>"),"\0CODEINLINE"+i+"\0"}),i=i.replace(/\$([^\$\s][^\$]*?[^\$\s])\$/g,'<span class="pict-content-katex-inline">$1</span>'),i=i.replace(/\$([^\$\s])\$/g,'<span class="pict-content-katex-inline">$1</span>'),i=i.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1">'),i=i.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,i,n)=>{if("function"==typeof e){let t=e(n,i);if(t){let e=t.target?' target="'+t.target+'"':"",n=t.rel?' rel="'+t.rel+'"':"";return'<a href="'+t.href+'"'+e+n+">"+i+"</a>"}}return n.match(/^https?:\/\//)?'<a href="'+n+'" target="_blank" rel="noopener">'+i+"</a>":'<a href="'+n+'">'+i+"</a>"}),i=i.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),i=i.replace(/__([^_]+)__/g,"<strong>$1</strong>"),i=i.replace(/\*([^*]+)\*/g,"<em>$1</em>"),i=i.replace(/_([^_]+)_/g,"<em>$1</em>"),i=i.replace(/\x00CODEINLINE(\d+)\x00/g,(t,e)=>n[parseInt(e)]),i}escapeHTML(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}},e.exports.default_configuration={ProviderIdentifier:"Pict-Content",AutoInitialize:!0,AutoInitializeOrdinal:0}},{"pict-provider":19}],8:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}displayContent(t,e){let i=e||"Pict-Content-Body";this.pict.ContentAssignment.assignContent("#"+i,t);let n=document.getElementById(i);n&&n.parentElement&&(n.parentElement.scrollTop=0),this.renderMermaidDiagrams(i),this.renderKaTeXEquations(i)}renderMermaidDiagrams(t){if("undefined"==typeof mermaid)return;let e=t||"Pict-Content-Body",i=document.getElementById(e);if(!i)return;let n=i.querySelectorAll("pre.mermaid");if(!(n.length<1))try{mermaid.run({nodes:n})}catch(t){this.log.error("Mermaid rendering error: "+t.message)}}renderKaTeXEquations(t){if("undefined"==typeof katex)return;let e=t||"Pict-Content-Body",i=document.getElementById(e);if(!i)return;let n=i.querySelectorAll(".pict-content-katex-inline");for(let t=0;t<n.length;t++)try{katex.render(n[t].textContent,n[t],{throwOnError:!1,displayMode:!1})}catch(t){this.log.warn("KaTeX inline error: "+t.message)}let o=i.querySelectorAll(".pict-content-katex-display");for(let t=0;t<o.length;t++)try{katex.render(o[t].textContent,o[t],{throwOnError:!1,displayMode:!0})}catch(t){this.log.warn("KaTeX display error: "+t.message)}}showLoading(t,e){let i=e||"Pict-Content-Body",n=t||"Loading content...";this.pict.ContentAssignment.assignContent("#"+i,'<div class="pict-content-loading">'+n+"</div>")}},e.exports.default_configuration={ViewIdentifier:"Pict-Content",DefaultRenderable:"Pict-Content-Display",DefaultDestinationAddress:"#Pict-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-content {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.pict-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 200px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.pict-content h1 {\n\t\t\tfont-size: 2em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-content h2 {\n\t\t\tfont-size: 1.5em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding-bottom: 0.25em;\n\t\t\tmargin-top: 1.5em;\n\t\t}\n\t\t.pict-content h3 {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-content h4, .pict-content h5, .pict-content h6 {\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-content p {\n\t\t\tline-height: 1.7;\n\t\t\tcolor: #423D37;\n\t\t\tmargin: 0.75em 0;\n\t\t}\n\t\t.pict-content a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.pict-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.pict-content pre {\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-content code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t.pict-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content blockquote {\n\t\t\tborder-left: 4px solid #2E7D74;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tbackground: #F7F5F0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-content blockquote p {\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-content ul, .pict-content ol {\n\t\t\tpadding-left: 2em;\n\t\t\tline-height: 1.8;\n\t\t}\n\t\t.pict-content li {\n\t\t\tmargin: 0.25em 0;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\tmargin: 2em 0;\n\t\t}\n\t\t.pict-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content table th {\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-content table td {\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content table tr:nth-child(even) {\n\t\t\tbackground: #F7F5F0;\n\t\t}\n\t\t.pict-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-content pre.mermaid {\n\t\t\tbackground: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\ttext-align: center;\n\t\t\tpadding: 1em;\n\t\t}\n\t\t.pict-content .pict-content-katex-display {\n\t\t\ttext-align: center;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-content .pict-content-katex-inline {\n\t\t\tdisplay: inline;\n\t\t}\n\t",Templates:[{Hash:"Pict-Content-Template",Template:'\n<div class="pict-content" id="Pict-Content-Body">\n\t<div class="pict-content-loading">Loading content...</div>\n</div>\n'}],Renderables:[{RenderableHash:"Pict-Content-Display",TemplateHash:"Pict-Content-Template",DestinationAddress:"#Pict-Content-Container",RenderMethod:"replace"}]}},{"pict-view":52}],9:[function(t,e,i){e.exports={Name:"Pict Docuserve",Hash:"Docuserve",MainViewportViewIdentifier:"Docuserve-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"Docuserve-Pict-Application"}}},{}],10:[function(t,e,i){const n=t("pict-application"),o=t("./providers/Pict-Provider-Docuserve-Documentation.js"),r=t("./views/PictView-Docuserve-Layout.js"),s=t("./views/PictView-Docuserve-TopBar.js"),a=t("./views/PictView-Docuserve-Sidebar.js"),l=t("./views/PictView-Docuserve-Splash.js"),c=t("./views/PictView-Docuserve-Content.js"),d=t("./views/PictView-Docuserve-Search.js");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.pict.addProvider("Docuserve-Documentation",o.default_configuration,o),this.pict.addView("Docuserve-Layout",r.default_configuration,r),this.pict.addView("Docuserve-TopBar",s.default_configuration,s),this.pict.addView("Docuserve-Sidebar",a.default_configuration,a),this.pict.addView("Docuserve-Splash",l.default_configuration,l),this.pict.addView("Docuserve-Content",c.default_configuration,c),this.pict.addView("Docuserve-Search",d.default_configuration,d)}onAfterInitializeAsync(t){this.pict.AppData.Docuserve={CatalogLoaded:!1,Catalog:null,CoverLoaded:!1,Cover:null,SidebarLoaded:!1,SidebarGroups:[],TopBarLoaded:!1,TopBar:null,ErrorPageLoaded:!1,ErrorPageHTML:null,KeywordIndexLoaded:!1,KeywordDocumentCount:0,CurrentGroup:"",CurrentModule:"",CurrentPath:"",SidebarVisible:!0,DocsBaseURL:"",CatalogURL:"retold-catalog.json"},this.pict.providers["Docuserve-Documentation"].loadCatalog(()=>{let e=this.pict.AppData.Docuserve;return e.CoverLoaded&&e.Cover&&e.Cover.Title?document.title=e.Cover.Title.replace(/<[^>]*>/g,""):e.TopBarLoaded&&e.TopBar&&e.TopBar.Brand&&(document.title=e.TopBar.Brand.replace(/<[^>]*>/g,"")),this.pict.views["Docuserve-Layout"].render(),super.onAfterInitializeAsync(t)})}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t||"Home"===t)return void this.showView("Docuserve-Splash");let e=t.split("/");if("search"===e[0]){let t=decodeURIComponent(e.slice(1).join("/"));return void this.navigateToSearch(t)}if("page"===e[0]&&e.length>=2){let t=e.slice(1).join("/");return void this.navigateToPage(t)}if("doc"===e[0]&&e.length>=3){let t=e[1],i=e[2];if(e.length>=4){let n=e.slice(3).join("/");this.navigateToModulePath(t,i,n)}else this.navigateToModule(t,i);return}this.navigateToPage(t)}navigateTo(t){window.location.hash=t}showView(t){t in this.pict.views&&(this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath="",this.pict.views[t].render(),this.pict.views["Docuserve-Sidebar"].clearModuleNav(),this.pict.views["Docuserve-Sidebar"].renderSidebarGroups())}navigateToModule(t,e){this.navigateToModulePath(t,e,"README.md")}navigateToModulePath(t,e,i){let n=this.pict.providers["Docuserve-Documentation"],o=this.pict.views["Docuserve-Content"],r=this.pict.views["Docuserve-Sidebar"];this.pict.AppData.Docuserve.CurrentGroup=t,this.pict.AppData.Docuserve.CurrentModule=e,this.pict.AppData.Docuserve.CurrentPath=i,o.render(),o.showLoading(),r.renderSidebarGroups(),r.renderModuleNav(t,e);let s=n.resolveDocumentURL(t,e,i||"README.md");if(!s)return void o.displayContent(n.getErrorPageHTML(t+"/"+e));let a=i||"README.md";n.fetchDocument(s,(i,r)=>{if(!i)return void o.displayContent(r);let s=t+"/"+e+"/"+a;n.fetchLocalDocument(s,(t,e)=>{o.displayContent(e)},t,e,a)},t,e,a)}navigateToPage(t){let e=this.pict.providers["Docuserve-Documentation"],i=this.pict.views["Docuserve-Content"],n=this.pict.views["Docuserve-Sidebar"];this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath=t,i.render(),i.showLoading(),n.clearModuleNav(),n.renderSidebarGroups();let o=t;o.match(/\.md$/)||(o+=".md"),e.fetchLocalDocument(o,(t,e)=>{i.displayContent(e)})}navigateToSearch(t){let e=this.pict.views["Docuserve-Sidebar"],i=this.pict.views["Docuserve-Search"];this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath="",e.clearModuleNav(),e.renderSidebarGroups(),i.render(),i.showSearch(t||"")}},e.exports.default_configuration=t("./Pict-Application-Docuserve-Configuration.json")},{"./Pict-Application-Docuserve-Configuration.json":9,"./providers/Pict-Provider-Docuserve-Documentation.js":11,"./views/PictView-Docuserve-Content.js":12,"./views/PictView-Docuserve-Layout.js":13,"./views/PictView-Docuserve-Search.js":14,"./views/PictView-Docuserve-Sidebar.js":15,"./views/PictView-Docuserve-Splash.js":16,"./views/PictView-Docuserve-TopBar.js":17,"pict-application":5}],11:[function(t,e,i){const n=t("pict-provider"),o=t("lunr"),r=t("pict-section-content").PictContentProvider;e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._Catalog=null,this._ContentCache={},this._ContentProvider=this.pict.addProvider("Pict-Content",r.default_configuration,r)}_createLinkResolver(t,e,i){return(n,o)=>{if(n.match(/^\//)||n.match(/^[^:]+\.md/)){return{href:this.convertDocLink(n,t,e,i)}}let r=this.resolveGitHubURLToRoute(n);return r?{href:r}:null}}loadCatalog(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.CatalogURL||"retold-catalog.json",n=()=>{let t=5,i=()=>{if(t--,t<=0){if(this.pict.AppData.Docuserve.SidebarGroups&&!(this.pict.AppData.Docuserve.SidebarGroups.length<1))return e();this.autoDiscoverSidebar(e)}};this.loadCover(i),this.loadSidebar(i),this.loadTopbar(i),this.loadErrorPage(i),this.loadKeywordIndex(i)};fetch(i).then(t=>t.ok?t.json():(this.log.info("Docuserve: No catalog at [".concat(i,"]; running in standalone mode.")),null)).then(t=>{t&&(this._Catalog=t,this.pict.AppData.Docuserve.Catalog=t,this.pict.AppData.Docuserve.CatalogLoaded=!0,this.buildSidebarData(t)),n()}).catch(t=>{this.log.info("Docuserve: Catalog load error (".concat(t,"); continuing in standalone mode.")),n()})}autoDiscoverSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"README.md").then(t=>t.ok?t.text():null).then(t=>{if(t){let e=t.match(/^#+\s+(.+)/m),i=e?e[1].trim():"Docs";this.pict.AppData.Docuserve.SidebarGroups=[{Name:i,Key:"docs",Route:"#/page/README",Modules:[]}],this.pict.AppData.Docuserve.CoverLoaded||(this.pict.AppData.Docuserve.Cover={Title:i,Tagline:"",Description:"",Highlights:[],Actions:[{Text:"Read the Docs",Href:"README.md"}]},this.pict.AppData.Docuserve.CoverLoaded=!0)}else this.log.info("Docuserve: No README.md found; sidebar will be empty.");return e()}).catch(t=>(this.log.info("Docuserve: README.md discovery failed (".concat(t,").")),e()))}loadCover(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"cover.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.Cover=this.parseCover(t),this.pict.AppData.Docuserve.CoverLoaded=!0,e()):(this.log.info("Docuserve: No cover.md found; splash will use catalog data."),e())).catch(t=>(this.log.warn("Docuserve: Error loading cover.md: ".concat(t)),e()))}parseCover(t){let e={Title:"",Tagline:"",Description:"",Highlights:[],Actions:[]},i=t.split("\n");for(let t=0;t<i.length;t++){let n=i[t].trim();if(!n)continue;let o=n.match(/^#+\s+(.+)/);if(o){e.Title=o[1].trim();continue}let r=n.match(/^>\s*(.*)/);if(r){e.Tagline=r[1].trim();continue}let s=n.match(/^[-*+]\s+(.*)/);if(s){let t=s[1],i=t.match(/^\*\*([^*]+)\*\*\s*[-—:]\s*(.*)/);i?e.Highlights.push({Label:i[1].trim(),Text:i[2].trim()}):e.Highlights.push({Label:"",Text:t.trim()});continue}let a=n.match(/^\[([^\]]+)\]\(([^)]+)\)\s*$/);a?e.Actions.push({Text:a[1].trim(),Href:a[2].trim()}):e.Description?e.Description+=" "+n:e.Description=n}return e}loadSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_sidebar.md").then(t=>t.ok?t.text():null).then(t=>{if(!t)return this.log.info("Docuserve: No _sidebar.md found; sidebar will use catalog data."),e();let i=this.parseSidebarMarkdown(t);return i&&i.length>0&&(this.pict.AppData.Docuserve.SidebarGroups=i,this.pict.AppData.Docuserve.SidebarLoaded=!0),e()}).catch(t=>(this.log.warn("Docuserve: Error loading _sidebar.md: ".concat(t)),e()))}loadTopbar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_topbar.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.TopBar=this.parseTopbar(t),this.pict.AppData.Docuserve.TopBarLoaded=!0,e()):(this.log.info("Docuserve: No _topbar.md found; top bar will use defaults."),e())).catch(t=>(this.log.warn("Docuserve: Error loading _topbar.md: ".concat(t)),e()))}parseTopbar(t){let e={Brand:"",NavLinks:[],ExternalLinks:[]},i=t.split("\n");for(let t=0;t<i.length;t++){let n=i[t].trim();if(!n)continue;let o=n.match(/^#+\s+(.+)/);if(o){e.Brand=o[1].trim();continue}let r=n.match(/^[-*+]\s+(.*)/);if(r){let t=r[1].trim().match(/^\[([^\]]+)\]\(([^)]+)\)/);if(t){let i=t[1].trim(),n=t[2].trim();if(n.match(/^https?:\/\//))e.ExternalLinks.push({Text:i,Href:n});else{let t=this.convertSidebarLink(n);e.NavLinks.push({Text:i,Href:t})}}continue}}return e}loadErrorPage(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"errorpage.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.ErrorPageHTML=this._ContentProvider.parseMarkdown(t),this.pict.AppData.Docuserve.ErrorPageLoaded=!0,e()):(this.log.info("Docuserve: No errorpage.md found; errors will use default page."),e())).catch(t=>(this.log.warn("Docuserve: Error loading errorpage.md: ".concat(t)),e()))}loadKeywordIndex(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"retold-keyword-index.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!t.LunrIndex||!t.Documents)return this.log.info("Docuserve: No keyword index found; search will be unavailable."),e();try{this._LunrIndex=o.Index.load(t.LunrIndex),this._KeywordDocuments=t.Documents,this.pict.AppData.Docuserve.KeywordIndexLoaded=!0,this.pict.AppData.Docuserve.KeywordDocumentCount=t.DocumentCount||0,this.log.info("Docuserve: Keyword index loaded (".concat(t.DocumentCount||0," documents)."))}catch(t){this.log.warn("Docuserve: Error hydrating lunr index: ".concat(t))}return e()}).catch(t=>(this.log.warn("Docuserve: Error loading keyword index: ".concat(t)),e()))}isModuleInCatalog(t,e){if(!this._Catalog||!this._Catalog.Groups)return!1;for(let i=0;i<this._Catalog.Groups.length;i++){let n=this._Catalog.Groups[i];if(n.Key===t)for(let t=0;t<n.Modules.length;t++){if(n.Modules[t].Name===e)return!0}}return!1}findModuleGroupKey(t){if(!this._Catalog||!this._Catalog.Groups)return null;for(let e=0;e<this._Catalog.Groups.length;e++){let i=this._Catalog.Groups[e];for(let e=0;e<i.Modules.length;e++)if(i.Modules[e].Name===t)return i.Key}return null}isGroupInCatalog(t){if(!this._Catalog||!this._Catalog.Groups)return!1;for(let e=0;e<this._Catalog.Groups.length;e++)if(this._Catalog.Groups[e].Key===t)return!0;return!1}search(t){if(!(this._LunrIndex&&this._KeywordDocuments&&t&&t.trim()))return[];let e=[];try{let i=this._LunrIndex.search(t);for(let t=0;t<i.length;t++){let n=i[t].ref,o=i[t].score,r=this._KeywordDocuments[n];if(!r)continue;let s=n.split("/"),a="";if(s.length>=2){let t=s[0],e=s[1];a=this.isModuleInCatalog(t,e)?"#/doc/"+n:"#/page/"+n}e.push({Key:n,Title:r.Title||n,Group:r.Group||"",Module:r.Module||"",DocPath:r.DocPath||"",Score:o,Route:a})}}catch(t){this.log.warn("Docuserve: Search error: ".concat(t))}return e}getErrorPageHTML(t){let e=t||"unknown";return this.pict.AppData.Docuserve.ErrorPageLoaded&&this.pict.AppData.Docuserve.ErrorPageHTML?this.pict.AppData.Docuserve.ErrorPageHTML.replace(/\{\{path\}\}/g,this._ContentProvider.escapeHTML(e)):'<div class="docuserve-not-found"><h2>Page Not Found</h2><p>The document <code>'+this._ContentProvider.escapeHTML(e)+'</code> could not be loaded.</p><p><a href="#/Home">Return to the home page</a></p></div>'}parseSidebarMarkdown(t){let e=[],i=null,n=t.split("\n");for(let t=0;t<n.length;t++){let o=n[t];if(!o.trim())continue;let r=o.match(/^(\s*)/),s=r?r[1].length:0,a=o.trim().match(/^[-*+]\s+(.*)/);if(!a)continue;let l=a[1].trim(),c=l.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(s<2)if(c){let t=c[1].trim(),n=c[2].trim();i={Name:t,Key:this.deriveGroupKey(t,n),Route:this.convertSidebarLink(n),Modules:[]},e.push(i)}else{let t=l,n=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");i={Name:t,Key:n,Route:"",Modules:[]},e.push(i)}else if(i)if(c){let t=c[1].trim(),e=c[2].trim(),n=this.convertSidebarLink(e);i.Modules.push({Name:t,HasDocs:!0,Group:i.Key,Route:n})}else i.Modules.push({Name:l,HasDocs:!1,Group:i.Key,Route:""})}return e}convertSidebarLink(t){if(!t)return"";if("/"===t)return"#/Home";if(t.match(/^#[^/]/)){let t=this.pict.AppData.Docuserve.SidebarGroups;if(t)for(let e=0;e<t.length;e++){let i=t[e].Modules;if(i)for(let t=0;t<i.length;t++)if(i[t].HasDocs&&i[t].Route&&"#/Home"!==i[t].Route)return i[t].Route;if(t[e].Route&&"#/Home"!==t[e].Route)return t[e].Route}return"#/Home"}let e=t.replace(/^\//,"").replace(/\/$/,"");if(!e)return"#/Home";let i=e.split("/");if(i.length>=2){if(this.isGroupInCatalog(i[0])&&this.isModuleInCatalog(i[0],i[1]))return"#/doc/"+e;let t=this.findModuleGroupKey(i[1]);if(t){let e=i.slice(2).join("/");return e?"#/doc/"+t+"/"+i[1]+"/"+e:"#/doc/"+t+"/"+i[1]}}return e.match(/\.md$/)?"#/page/"+e.replace(/\.md$/,""):"#/page/"+e}deriveGroupKey(t,e){if(e&&"/"!==e){let t=e.replace(/^\//,"").replace(/\.md$/,"").replace(/\/$/,"");if(t&&!t.includes("/"))return t.toLowerCase()}return t.split(/[\s—\-:]+/)[0].toLowerCase().replace(/[^a-z0-9]/g,"")}buildSidebarData(t){let e=[];for(let i=0;i<t.Groups.length;i++){let n=t.Groups[i],o={Name:n.Name,Key:n.Key,Description:n.Description,Modules:[]};for(let t=0;t<n.Modules.length;t++){let e=n.Modules[t];o.Modules.push({Name:e.Name,HasDocs:e.HasDocs,Group:n.Key,Route:"#/doc/"+n.Key+"/"+e.Name})}e.push(o)}this.pict.AppData.Docuserve.SidebarGroups=e}resolveDocumentURL(t,e,i){if(!this._Catalog)return null;let n=this._Catalog.GitHubOrg||"stevenvelozo",o=this._Catalog.DefaultBranch||"master";for(let r=0;r<this._Catalog.Groups.length;r++){let s=this._Catalog.Groups[r];if(s.Key===t)for(let t=0;t<s.Modules.length;t++){let r=s.Modules[t];if(r.Name!==e)continue;let a=r.Branch||o,l=i||"README.md";return"https://raw.githubusercontent.com/"+n+"/"+r.Repo+"/"+a+"/docs/"+l}}return null}resolveGitHubURLToRoute(t){if(!this._Catalog||!this._Catalog.Groups||!t)return null;let e=t.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)/);if(!e)return null;let i=e[1],n=e[2];if(i!==this._Catalog.GitHubOrg)return null;for(let t=0;t<this._Catalog.Groups.length;t++){let e=this._Catalog.Groups[t];for(let t=0;t<e.Modules.length;t++){let i=e.Modules[t];if(i.Repo===n)return"#/doc/"+e.Key+"/"+i.Name}}return null}resolveGitHubPagesURL(t,e){if(!this._Catalog||!this._Catalog.Groups)return null;let i=this._Catalog.GitHubOrg||"stevenvelozo";for(let n=0;n<this._Catalog.Groups.length;n++){let o=this._Catalog.Groups[n];if(o.Key===t)for(let t=0;t<o.Modules.length;t++){let n=o.Modules[t];if(n.Name===e)return n.HasDocs?"https://"+i+".github.io/"+n.Repo+"/":null}}return null}getModuleSidebar(t,e){if(!this._Catalog)return null;for(let i=0;i<this._Catalog.Groups.length;i++){let n=this._Catalog.Groups[i];if(n.Key===t)for(let t=0;t<n.Modules.length;t++){let i=n.Modules[t];if(i.Name===e)return i.Sidebar||null}}return null}fetchDocument(t,e,i,n,o){let r="function"==typeof e?e:()=>{};return t?this._ContentCache[t]?r(null,this._ContentCache[t]):void fetch(t).then(t=>t.ok?t.text():null).then(e=>{if(!e)return r("Document not found",this.getErrorPageHTML(t));let s=this._ContentProvider.parseMarkdown(e,this._createLinkResolver(i,n,o));return this._ContentCache[t]=s,r(null,s)}).catch(e=>(this.log.warn("Docuserve: Error fetching document [".concat(t,"]: ").concat(e)),r(e,this.getErrorPageHTML(t)))):r("No URL provided","")}fetchLocalDocument(t,e,i,n,o){let r=(this.pict.AppData.Docuserve.DocsBaseURL||"")+t;this.fetchDocument(r,e,i,n,o)}convertDocLink(t,e,i,n){let o=t.replace(/^\.\//,"");o=o.replace(/^\//,"");let r=o.split("/");if(r.length>=2&&this.isGroupInCatalog(r[0])&&this.isModuleInCatalog(r[0],r[1]))return"#/doc/"+o;if(e&&i){let t="";if(n){let e=n.split("/");e.length>1&&(e.pop(),t=e.join("/")+"/")}return"#/doc/"+e+"/"+i+"/"+t+o}if(o.match(/\.md$/)){return"#/page/"+o.replace(/\.md$/,"")}return"#/page/"+o}},e.exports.default_configuration={ProviderIdentifier:"Docuserve-Documentation",AutoInitialize:!0,AutoInitializeOrdinal:0}},{lunr:3,"pict-provider":19,"pict-section-content":6}],12:[function(t,e,i){const n=t("pict-section-content");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}displayContent(t){let e=t,i=this.pict.AppData.Docuserve.CurrentGroup,n=this.pict.AppData.Docuserve.CurrentModule;if(i&&n){let t=this.pict.providers["Docuserve-Documentation"];if(t){let o=t.resolveGitHubPagesURL(i,n);o&&(e='<div class="docuserve-module-external-link"><a href="'+o+'" target="_blank" rel="noopener">&#x2197; View '+n+" documentation site</a></div>"+e)}}super.displayContent(e,"Docuserve-Content-Body")}showLoading(){super.showLoading("Loading documentation...","Docuserve-Content-Body")}},e.exports.default_configuration={ViewIdentifier:"Docuserve-Content",DefaultRenderable:"Docuserve-Content-Display",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-content {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.pict-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 200px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.pict-content h1 {\n\t\t\tfont-size: 2em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-content h2 {\n\t\t\tfont-size: 1.5em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding-bottom: 0.25em;\n\t\t\tmargin-top: 1.5em;\n\t\t}\n\t\t.pict-content h3 {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-content h4, .pict-content h5, .pict-content h6 {\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-content p {\n\t\t\tline-height: 1.7;\n\t\t\tcolor: #423D37;\n\t\t\tmargin: 0.75em 0;\n\t\t}\n\t\t.pict-content a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.pict-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.pict-content pre {\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-content code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t.pict-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content blockquote {\n\t\t\tborder-left: 4px solid #2E7D74;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tbackground: #F7F5F0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-content blockquote p {\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-content ul, .pict-content ol {\n\t\t\tpadding-left: 2em;\n\t\t\tline-height: 1.8;\n\t\t}\n\t\t.pict-content li {\n\t\t\tmargin: 0.25em 0;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\tmargin: 2em 0;\n\t\t}\n\t\t.pict-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content table th {\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-content table td {\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content table tr:nth-child(even) {\n\t\t\tbackground: #F7F5F0;\n\t\t}\n\t\t.pict-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-content pre.mermaid {\n\t\t\tbackground: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\ttext-align: center;\n\t\t\tpadding: 1em;\n\t\t}\n\t\t.pict-content .pict-content-katex-display {\n\t\t\ttext-align: center;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-content .pict-content-katex-inline {\n\t\t\tdisplay: inline;\n\t\t}\n\t\t.docuserve-module-external-link {\n\t\t\tpadding: 0.5em 0;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-align: right;\n\t\t}\n\t\t.docuserve-module-external-link a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.docuserve-module-external-link a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.docuserve-not-found {\n\t\t\ttext-align: center;\n\t\t\tpadding: 3em 1em;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.docuserve-not-found h2 {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1.5em;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.docuserve-not-found code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Content-Template",Template:'\n<div class="pict-content" id="Docuserve-Content-Body">\n\t<div class="pict-content-loading">Loading documentation...</div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Content-Display",TemplateHash:"Docuserve-Content-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]}},{"pict-section-content":6}],13:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,n){if(this.pict.views["Docuserve-TopBar"].render(),this.pict.views["Docuserve-Sidebar"].render(),this.pict.views["Docuserve-Splash"].render(),this.pict.CSSMap.injectCSS(),this.pict.PictApplication.resolveHash(),!this._HashChangeListenerBound){this._HashChangeListenerBound=!0;let t=this;window.addEventListener("hashchange",()=>{t.pict.PictApplication.resolveHash()})}return super.onAfterRender(t,e,i,n)}},e.exports.default_configuration={ViewIdentifier:"Docuserve-Layout",DefaultRenderable:"Docuserve-Layout-Shell",DefaultDestinationAddress:"#Docuserve-Application-Container",AutoRender:!1,CSS:"\n\t\t#Docuserve-Application-Container {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t#Docuserve-TopBar-Container {\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.docuserve-body {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#Docuserve-Sidebar-Container {\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 280px;\n\t\t\toverflow-y: auto;\n\t\t\tbackground-color: #F5F0E8;\n\t\t}\n\t\t#Docuserve-Content-Container {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\toverflow-y: auto;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Layout-Shell-Template",Template:'\n<div id="Docuserve-TopBar-Container"></div>\n<div class="docuserve-body">\n\t<div id="Docuserve-Sidebar-Container"></div>\n\t<div id="Docuserve-Content-Container"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Layout-Shell",TemplateHash:"Docuserve-Layout-Shell-Template",DestinationAddress:"#Docuserve-Application-Container",RenderMethod:"replace"}]}},{"pict-view":52}],14:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._SearchDebounceTimer=null}onAfterRender(t,e,i,n){let o=document.getElementById("Docuserve-Search-Input");return o&&o.addEventListener("input",()=>{this._SearchDebounceTimer&&clearTimeout(this._SearchDebounceTimer),this._SearchDebounceTimer=setTimeout(()=>{this.performSearch(o.value)},250)}),super.onAfterRender(t,e,i,n)}showSearch(t){let e=document.getElementById("Docuserve-Search-Input");if(e&&(e.value=t||"",e.focus()),t&&t.trim())this.performSearch(t);else{let t=this.pict.AppData.Docuserve.KeywordDocumentCount||0,e=t>0?"Search across "+t+" documents.":"Enter a search term to find documentation.";this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e),this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","")}let i=document.getElementById("Docuserve-Content-Container");i&&(i.scrollTop=0)}performSearch(t){if(!t||!t.trim()){let t=this.pict.AppData.Docuserve.KeywordDocumentCount||0,e=t>0?"Search across "+t+" documents.":"Enter a search term to find documentation.";return this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e),void this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","")}let e=this.pict.providers["Docuserve-Documentation"].search(t);if(0===e.length)return this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status","No results found for '"+this.escapeHTML(t)+"'."),void this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","");this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e.length+" result"+(1!==e.length?"s":"")+" for '"+this.escapeHTML(t)+"'");let i="";for(let t=0;t<e.length;t++){let n=e[t],o="";n.Group&&n.Module&&(o=n.Group+" &rsaquo; "+n.Module),i+='<a class="docuserve-search-result" href="'+n.Route+'">',i+='<div class="docuserve-search-result-title">'+this.escapeHTML(n.Title)+"</div>",o&&(i+='<div class="docuserve-search-result-breadcrumb">'+o+"</div>"),n.DocPath&&(i+='<div class="docuserve-search-result-path">'+this.escapeHTML(n.DocPath)+"</div>"),i+="</a>"}this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results",i)}escapeHTML(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}},e.exports.default_configuration={ViewIdentifier:"Docuserve-Search",DefaultRenderable:"Docuserve-Search-Display",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-search {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.docuserve-search-header {\n\t\t\tmargin-bottom: 1.5em;\n\t\t}\n\t\t.docuserve-search-header h1 {\n\t\t\tfont-size: 1.75em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin: 0 0 0.75em 0;\n\t\t}\n\t\t.docuserve-search-input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.75em 1em;\n\t\t\tfont-size: 1.1em;\n\t\t\tborder: 2px solid #D4CCBE;\n\t\t\tborder-radius: 6px;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t\ttransition: border-color 0.15s;\n\t\t}\n\t\t.docuserve-search-input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-search-status {\n\t\t\tmargin-top: 0.75em;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.docuserve-search-results {\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.docuserve-search-result {\n\t\t\tdisplay: block;\n\t\t\tpadding: 1em 1.25em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tborder: 1px solid #EAE3D8;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: inherit;\n\t\t\ttransition: border-color 0.15s, box-shadow 0.15s;\n\t\t}\n\t\t.docuserve-search-result:hover {\n\t\t\tborder-color: #2E7D74;\n\t\t\tbox-shadow: 0 2px 8px rgba(46, 125, 116, 0.1);\n\t\t}\n\t\t.docuserve-search-result-title {\n\t\t\tfont-size: 1.05em;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #2E7D74;\n\t\t\tmargin-bottom: 0.25em;\n\t\t}\n\t\t.docuserve-search-result-breadcrumb {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 0.2em;\n\t\t}\n\t\t.docuserve-search-result-path {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #A39889;\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.docuserve-search-empty {\n\t\t\ttext-align: center;\n\t\t\tpadding: 3em 1em;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Search-Template",Template:'\n<div class="docuserve-search">\n\t<div class="docuserve-search-header">\n\t\t<h1>Search Documentation</h1>\n\t\t<input type="text" class="docuserve-search-input" id="Docuserve-Search-Input" placeholder="Search across all modules...">\n\t\t<div id="Docuserve-Search-Status" class="docuserve-search-status"></div>\n\t</div>\n\t<div id="Docuserve-Search-Results" class="docuserve-search-results"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Search-Display",TemplateHash:"Docuserve-Search-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]}},{"pict-view":52}],15:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._SidebarSearchDebounceTimer=null}onAfterRender(t,e,i,n){this.renderSidebarGroups();let o=document.getElementById("Docuserve-Sidebar-Search");if(o&&this.pict.AppData.Docuserve.KeywordIndexLoaded){o.style.display="";let t=document.getElementById("Docuserve-Sidebar-Search-Input");t&&t.addEventListener("input",()=>{this._SidebarSearchDebounceTimer&&clearTimeout(this._SidebarSearchDebounceTimer),this._SidebarSearchDebounceTimer=setTimeout(()=>{this.performSidebarSearch(t.value)},250)})}return super.onAfterRender(t,e,i,n)}renderSidebarGroups(){let t=this.pict.AppData.Docuserve.SidebarGroups;if(!t||t.length<1)return void this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-Groups","");let e="";for(let i=0;i<t.length;i++){let n=t[i];e+='<div class="docuserve-sidebar-group">';let o=n.Route||"";if(!o)for(let t=0;t<n.Modules.length;t++)if(n.Modules[t].HasDocs&&n.Modules[t].Route){o=n.Modules[t].Route;break}if(o){let t="",i=window.location.hash||"";this.pict.AppData.Docuserve.CurrentGroup!==n.Key&&i!==o||(t=" active"),e+='<a class="docuserve-sidebar-group-title'+t+'" href="'+o+'">'+this.escapeHTML(n.Name)+"</a>"}else e+='<div class="docuserve-sidebar-group-title">'+this.escapeHTML(n.Name)+"</div>";e+='<ul class="docuserve-sidebar-modules">';for(let t=0;t<n.Modules.length;t++){let i=n.Modules[t];if(i.HasDocs){let t="";this.pict.AppData.Docuserve.CurrentGroup===i.Group&&this.pict.AppData.Docuserve.CurrentModule===i.Name&&(t=' class="active"'),e+="<li><a"+t+' href="'+i.Route+'">'+this.escapeHTML(i.Name)+"</a></li>"}else e+='<li><span class="no-docs">'+this.escapeHTML(i.Name)+"</span></li>"}e+="</ul>",e+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-Groups",e)}renderModuleNav(t,e){let i=this.pict.providers["Docuserve-Documentation"];if(!i)return;let n=i.getModuleSidebar(t,e);if(!n)return void this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav","");let o="#/doc/"+t+"/"+e+"/",r='<div class="docuserve-sidebar-module-nav">';for(let t=0;t<n.length;t++){let e=n[t];if(e.Children){r+='<div class="docuserve-sidebar-module-nav-section">'+this.escapeHTML(e.Title)+"</div>";for(let t=0;t<e.Children.length;t++){let i=e.Children[t];i.Path&&(r+='<a href="'+o+i.Path+'">'+this.escapeHTML(i.Title)+"</a>")}}else e.Path&&(r+='<a href="'+o+e.Path+'">'+this.escapeHTML(e.Title)+"</a>")}r+="</div>",this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav",r)}performSidebarSearch(t){let e=document.getElementById("Docuserve-Sidebar-Search-Results");if(!e)return;if(!t||!t.trim())return void(e.innerHTML="");let i=this.pict.providers["Docuserve-Documentation"].search(t);if(0===i.length)return void(e.innerHTML='<div style="padding: 0.4em 0.5em; font-size: 0.82em; color: #8A7F72;">No results found.</div>');let n="";for(let t=0;t<i.length&&t<8;t++){let e=i[t],o="";e.Group&&e.Module&&(o=e.Group+" / "+e.Module),n+='<a href="'+e.Route+'">',n+='<div class="docuserve-sidebar-search-result-title">'+this.escapeHTML(e.Title)+"</div>",o&&(n+='<div class="docuserve-sidebar-search-result-meta">'+this.escapeHTML(o)+"</div>"),n+="</a>"}if(i.length>8){n+='<a class="docuserve-sidebar-search-all" href="#/search/'+encodeURIComponent(t)+'">See all '+i.length+" results</a>"}e.innerHTML=n}toggleSidebar(){this.pict.AppData.Docuserve.SidebarVisible=!this.pict.AppData.Docuserve.SidebarVisible;let t=document.getElementById("Docuserve-Sidebar-Container"),e=document.getElementById("Docuserve-TopBar-Toggle");this.pict.AppData.Docuserve.SidebarVisible?(t&&(t.style.display=""),e&&(e.style.display="none")):(t&&(t.style.display="none"),e&&(e.style.display="inline-block"))}clearModuleNav(){this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav","")}escapeHTML(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}},e.exports.default_configuration={ViewIdentifier:"Docuserve-Sidebar",DefaultRenderable:"Docuserve-Sidebar-Content",DefaultDestinationAddress:"#Docuserve-Sidebar-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-sidebar {\n\t\t\tborder-right: 1px solid #DDD6CA;\n\t\t\tpadding: 1em 0;\n\t\t\tpadding-top: 0;\n\t\t\tmin-height: 100%;\n\t\t\tposition: relative;\n\t\t}\n\t\t.docuserve-sidebar-header {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: flex-end;\n\t\t\tpadding: 0.4em 0.5em 0;\n\t\t}\n\t\t.docuserve-sidebar-close {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1.2em;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0.2em 0.4em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.docuserve-sidebar-close:hover {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search {\n\t\t\tpadding: 0 1em 1em 1em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tmargin-bottom: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tborder: 1px solid #D4CCBE;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.85em;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.docuserve-sidebar-search input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search-results {\n\t\t\tmargin-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search-results a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tcolor: #423D37;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.82em;\n\t\t\tborder-radius: 3px;\n\t\t\ttransition: background-color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-search-results a:hover {\n\t\t\tbackground-color: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search-result-title {\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.docuserve-sidebar-search-results a:hover .docuserve-sidebar-search-result-title {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-search-result-meta {\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.docuserve-sidebar-search-all {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tfont-size: 0.82em;\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t\tborder-top: 1px solid #EAE3D8;\n\t\t\tmargin-top: 0.25em;\n\t\t\tpadding-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search-all:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.docuserve-sidebar-home {\n\t\t\tpadding: 0.5em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t}\n\t\t.docuserve-sidebar-home a {\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.docuserve-sidebar-home a:hover {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-group {\n\t\t\tmargin-top: 0.25em;\n\t\t}\n\t\t.docuserve-sidebar-group-title {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.5em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t}\n\t\t.docuserve-sidebar-group-title:hover {\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground-color: #EAE3D8;\n\t\t}\n\t\ta.docuserve-sidebar-group-title.active {\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground-color: #E0EDEB;\n\t\t}\n\t\t.docuserve-sidebar-modules {\n\t\t\tlist-style: none;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.docuserve-sidebar-modules li {\n\t\t\tpadding: 0;\n\t\t}\n\t\t.docuserve-sidebar-modules a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.3em 1.25em 0.3em 2em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-modules a:hover {\n\t\t\tbackground-color: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.docuserve-sidebar-modules a.active {\n\t\t\tcolor: #2E7D74;\n\t\t\tfont-weight: 600;\n\t\t\tbackground-color: #E0EDEB;\n\t\t}\n\t\t.docuserve-sidebar-modules .no-docs {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.3em 1.25em 0.3em 2em;\n\t\t\tcolor: #A39889;\n\t\t\tfont-size: 0.85em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav {\n\t\t\tborder-top: 1px solid #EAE3D8;\n\t\t\tmargin-top: 0.5em;\n\t\t\tpadding-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav-section {\n\t\t\tpadding: 0.4em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.02em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.25em 1.25em 0.25em 2.25em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.82em;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-module-nav a:hover {\n\t\t\tbackground-color: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Sidebar-Template",Template:'\n<div class="docuserve-sidebar">\n\t<div class="docuserve-sidebar-header">\n\t\t<button class="docuserve-sidebar-close" onclick="{~P~}.views[\'Docuserve-Sidebar\'].toggleSidebar()">&times;</button>\n\t</div>\n\t<div id="Docuserve-Sidebar-Search" class="docuserve-sidebar-search" style="display:none;">\n\t\t<input type="text" placeholder="Search docs..." id="Docuserve-Sidebar-Search-Input">\n\t\t<div id="Docuserve-Sidebar-Search-Results" class="docuserve-sidebar-search-results"></div>\n\t</div>\n\t<div class="docuserve-sidebar-home">\n\t\t<a onclick="{~P~}.PictApplication.navigateTo(\'/Home\')">Home</a>\n\t</div>\n\t<div id="Docuserve-Sidebar-Groups"></div>\n\t<div id="Docuserve-Sidebar-ModuleNav"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Sidebar-Content",TemplateHash:"Docuserve-Sidebar-Template",DestinationAddress:"#Docuserve-Sidebar-Container",RenderMethod:"replace"}]}},{"pict-view":52}],16:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,n){let o=this.pict.AppData.Docuserve;return o.CoverLoaded&&o.Cover?this.renderFromCover(o.Cover):this.renderFromCatalog(o),super.onAfterRender(t,e,i,n)}renderFromCover(t){this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Title",this.sanitizeTitle(t.Title)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Tagline",this.escapeHTML(t.Tagline)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Description",this.escapeHTML(t.Description));let e="";for(let i=0;i<t.Highlights.length;i++){let n=t.Highlights[i];e+='<div class="docuserve-splash-highlight-card">',n.Label&&(e+="<h3>"+this.escapeHTML(n.Label)+"</h3>"),e+="<p>"+this.escapeHTML(n.Text)+"</p>",e+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Highlights",e);let i="",n=this.pict.providers["Docuserve-Documentation"];for(let e=0;e<t.Actions.length;e++){let o=t.Actions[e],r=0===e?"primary":"secondary",s=o.Href;if(s.match(/^https?:\/\//))i+='<a class="'+r+'" href="'+this.escapeHTML(s)+'" target="_blank" rel="noopener">'+this.escapeHTML(o.Text)+"</a>";else{let t=n.convertSidebarLink(s);i+='<a class="'+r+'" href="'+this.escapeHTML(t)+'">'+this.escapeHTML(o.Text)+"</a>"}}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Actions",i)}renderFromCatalog(t){let e="Documentation",i="";t.CatalogLoaded&&t.Catalog&&t.Catalog.Name?e=t.Catalog.Name:t.TopBarLoaded&&t.TopBar&&t.TopBar.Brand?e=t.TopBar.Brand:"undefined"!=typeof document&&document.title&&(e=document.title),t.CatalogLoaded&&t.Catalog&&t.Catalog.Description&&(i=t.Catalog.Description),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Title",this.escapeHTML(e)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Tagline",this.escapeHTML(i)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Description","");let n="",o=t.SidebarGroups||[];for(let t=0;t<o.length;t++){let e=o[t];if(!e.Modules||e.Modules.length<1)continue;let i=e.Description||e.Modules.length+" modules";n+='<div class="docuserve-splash-highlight-card">',n+="<h3>"+this.escapeHTML(e.Name)+"</h3>",n+="<p>"+this.escapeHTML(i)+"</p>",n+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Highlights",n),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Actions","")}sanitizeTitle(t){return t?this.escapeHTML(t).replace(/&lt;small&gt;/gi,"<small>").replace(/&lt;\/small&gt;/gi,"</small>"):""}escapeHTML(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}},e.exports.default_configuration={ViewIdentifier:"Docuserve-Splash",DefaultRenderable:"Docuserve-Splash-Content",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-splash {\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\tmin-height: calc(100vh - 56px);\n\t\t\tpadding: 3em 2em;\n\t\t\ttext-align: center;\n\t\t\tbackground: linear-gradient(135deg, #F5F0E8 0%, #E4EFED 100%);\n\t\t}\n\t\t.docuserve-splash h1 {\n\t\t\tfont-size: 3em;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin: 0 0 0.25em 0;\n\t\t}\n\t\t.docuserve-splash h1 small {\n\t\t\tfont-size: 0.4em;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #7A7568;\n\t\t\tvertical-align: middle;\n\t\t\tmargin-left: 0.15em;\n\t\t}\n\t\t.docuserve-splash-tagline {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #7A7568;\n\t\t\tmargin-bottom: 1.5em;\n\t\t\tfont-style: italic;\n\t\t}\n\t\t.docuserve-splash-description {\n\t\t\tfont-size: 1em;\n\t\t\tcolor: #5E5549;\n\t\t\tmax-width: 600px;\n\t\t\tline-height: 1.7;\n\t\t\tmargin-bottom: 2em;\n\t\t}\n\t\t.docuserve-splash-highlights {\n\t\t\tdisplay: grid;\n\t\t\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\t\t\tgap: 1.25em;\n\t\t\tmax-width: 900px;\n\t\t\twidth: 100%;\n\t\t\tmargin-bottom: 2.5em;\n\t\t}\n\t\t.docuserve-splash-highlight-card {\n\t\t\tbackground: #fff;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tpadding: 1.25em;\n\t\t\ttext-align: left;\n\t\t\ttransition: box-shadow 0.2s, border-color 0.2s;\n\t\t}\n\t\t.docuserve-splash-highlight-card:hover {\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-splash-highlight-card h3 {\n\t\t\tmargin: 0 0 0.5em 0;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.docuserve-splash-highlight-card p {\n\t\t\tmargin: 0;\n\t\t\tcolor: #7A7568;\n\t\t\tfont-size: 0.85em;\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.docuserve-splash-actions {\n\t\t\tdisplay: flex;\n\t\t\tgap: 1em;\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.docuserve-splash-actions a {\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 0.7em 1.5em;\n\t\t\tborder-radius: 6px;\n\t\t\tfont-size: 0.95em;\n\t\t\tfont-weight: 600;\n\t\t\ttext-decoration: none;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-splash-actions .primary {\n\t\t\tbackground-color: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-splash-actions .primary:hover {\n\t\t\tbackground-color: #256861;\n\t\t}\n\t\t.docuserve-splash-actions .secondary {\n\t\t\tbackground-color: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\tborder: 2px solid #2E7D74;\n\t\t}\n\t\t.docuserve-splash-actions .secondary:hover {\n\t\t\tborder-color: #256861;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Splash-Template",Template:'\n<div class="docuserve-splash">\n\t<h1 id="Docuserve-Splash-Title"></h1>\n\t<div class="docuserve-splash-tagline" id="Docuserve-Splash-Tagline"></div>\n\t<div class="docuserve-splash-description" id="Docuserve-Splash-Description"></div>\n\t<div class="docuserve-splash-highlights" id="Docuserve-Splash-Highlights"></div>\n\t<div class="docuserve-splash-actions" id="Docuserve-Splash-Actions"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Splash-Content",TemplateHash:"Docuserve-Splash-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]}},{"pict-view":52}],17:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,n){return this.renderTopBarContent(),super.onAfterRender(t,e,i,n)}renderTopBarContent(){let t=this.pict.AppData.Docuserve,e=document.getElementById("Docuserve-TopBar-Brand"),i=document.getElementById("Docuserve-TopBar-Nav"),n=document.getElementById("Docuserve-TopBar-Links");if(e&&i&&n)if(t.TopBarLoaded&&t.TopBar){let o=t.TopBar;e.innerHTML=this.sanitizeTitle(o.Brand||"Documentation");let r='<a href="#/Home">Home</a>';for(let t=0;t<o.NavLinks.length;t++){let e=o.NavLinks[t];r+='<a href="'+e.Href+'">'+this.escapeHTML(e.Text)+"</a>"}i.innerHTML=r;let s="";t.KeywordIndexLoaded&&(s+='<a href="#/search/">Search</a>');for(let t=0;t<o.ExternalLinks.length;t++){let e=o.ExternalLinks[t];s+='<a href="'+this.escapeHTML(e.Href)+'" target="_blank" rel="noopener">'+this.escapeHTML(e.Text)+"</a>"}n.innerHTML=s}else{let o="Documentation";t.CoverLoaded&&t.Cover&&t.Cover.Title?o=t.Cover.Title:t.CatalogLoaded&&t.Catalog&&t.Catalog.Name&&(o=t.Catalog.Name),e.innerHTML=this.sanitizeTitle(o),i.innerHTML='<a href="#/Home">Home</a>',n.innerHTML=t.KeywordIndexLoaded?'<a href="#/search/">Search</a>':""}}sanitizeTitle(t){return t?this.escapeHTML(t).replace(/&lt;small&gt;/gi,"<small>").replace(/&lt;\/small&gt;/gi,"</small>"):""}escapeHTML(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}},e.exports.default_configuration={ViewIdentifier:"Docuserve-TopBar",DefaultRenderable:"Docuserve-TopBar-Content",DefaultDestinationAddress:"#Docuserve-TopBar-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-topbar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tbackground-color: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 0 1.5em;\n\t\t\theight: 56px;\n\t\t\tbox-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tz-index: 100;\n\t\t}\n\t\t.docuserve-topbar-brand {\n\t\t\tfont-size: 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tletter-spacing: 0.02em;\n\t\t\tcolor: #E8E0D4;\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-topbar-brand small {\n\t\t\tfont-size: 0.65em;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-left: 0.2em;\n\t\t}\n\t\t.docuserve-topbar-brand:hover {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-nav {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.25em;\n\t\t}\n\t\t.docuserve-topbar-nav a {\n\t\t\tcolor: #B5AA9A;\n\t\t\ttext-decoration: none;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.9em;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-topbar-nav a:hover {\n\t\t\tbackground-color: #524438;\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-links {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.5em;\n\t\t}\n\t\t.docuserve-topbar-links a {\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tborder-radius: 4px;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t}\n\t\t.docuserve-topbar-links a:hover {\n\t\t\tbackground-color: #524438;\n\t\t\tcolor: #E8E0D4;\n\t\t}\n\t\t.docuserve-topbar-toggle {\n\t\t\tdisplay: none;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: #B5AA9A;\n\t\t\tfont-size: 1.3em;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0.3em 0.5em;\n\t\t\tmargin-left: 0.5em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.docuserve-topbar-toggle:hover {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-right {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-TopBar-Template",Template:'\n<div class="docuserve-topbar">\n\t<a id="Docuserve-TopBar-Brand" class="docuserve-topbar-brand" href="#/Home"></a>\n\t<div id="Docuserve-TopBar-Nav" class="docuserve-topbar-nav"></div>\n\t<div class="docuserve-topbar-right">\n\t\t<div id="Docuserve-TopBar-Links" class="docuserve-topbar-links"></div>\n\t\t<button id="Docuserve-TopBar-Toggle" class="docuserve-topbar-toggle" onclick="{~P~}.views[\'Docuserve-Sidebar\'].toggleSidebar()">&#9776;</button>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-TopBar-Content",TemplateHash:"Docuserve-TopBar-Template",DestinationAddress:"#Docuserve-TopBar-Container",RenderMethod:"replace"}]}},{"pict-view":52}],18:[function(t,e,i){e.exports={name:"pict-provider",version:"1.0.10",description:"Pict Provider Base Class",main:"source/Pict-Provider.js",scripts:{start:"node source/Pict-Provider.js",test:"npx mocha -u tdd -R spec",tests:"npx mocha -u tdd --exit -R spec --grep",coverage:"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-provider-image:local","docker-dev-run":'docker run -it -d --name pict-provider-dev -p 24125:8080 -p 30027:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-provider" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-provider-image:local',"docker-dev-shell":"docker exec -it pict-provider-dev /bin/bash",lint:"eslint source/**",types:"tsc -p ."},types:"types/source/Pict-Provider.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-provider.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-provider/issues"},homepage:"https://github.com/stevenvelozo/pict-provider#readme",devDependencies:{"@eslint/js":"^9.39.1",eslint:"^9.39.1",pict:"^1.0.348",quackage:"^1.0.51",typescript:"^5.9.3"},dependencies:{"fable-serviceproviderbase":"^3.0.18"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]}}},{}],19:[function(t,e,i){const n=t("fable-serviceproviderbase"),o=t("../package.json"),r={ProviderIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoLoadDataWithApp:!0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,Manifests:{},Templates:[]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(r)),e),i),this.fable,this.pict,this.log,this.options,this.UUID,this.Hash,this.options.ProviderIdentifier||(this.options.ProviderIdentifier="AutoProviderID-".concat(this.fable.getUUID())),this.serviceType="PictProvider",this._Package=o,this.pict=this.fable,this.AppData=this.pict.AppData,this.Bundle=this.pict.Bundle,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1;for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];e.hasOwnProperty("Postfix")&&e.hasOwnProperty("Template")?(e.Source||(e.Source="PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," options object.")),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," could not load Default Template ").concat(t," in the options array."),e)}}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onBeforeInitialize:")),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onInitialize:")),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow PROVIDER [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialize:")),this.initializeTimestamp?(this.log.warn("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialize called but initialization is already completed. Aborting.")),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow PROVIDER [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initializeAsync:")),this.initializeTimestamp)return this.log.warn("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," async initialize called but initialization is already completed. Aborting.")),t();{let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," beginning initialization...")),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait(e=>(this.initializeTimestamp=this.pict.log.getTimeStamp(),e?this.log.error("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialization failed: ").concat(e.message||e),{Stack:e.stack}):this.pict.LogNoisiness>0&&this.log.info("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialization complete.")),t()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onAfterInitialize:")),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onPreRender(){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onPreRender:")),!0}onPreRenderAsync(t){return this.onPreRender(),t()}render(){return this.onPreRender()}renderAsync(t){return this.onPreRender(),t()}onPreSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onPreSolve:")),!0}onPreSolveAsync(t){return this.onPreSolve(),t()}solve(){return this.onPreSolve()}solveAsync(t){return this.onPreSolve(),t()}onBeforeLoadDataAsync(t){return t()}onLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onLoadDataAsync:")),t()}onAfterLoadDataAsync(t){return t()}onBeforeSaveDataAsync(t){return t()}onSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onSaveDataAsync:")),t()}onAfterSaveDataAsync(t){return t()}}},{"../package.json":18,"fable-serviceproviderbase":2}],20:[function(t,e,i){const n={javascript:{tokenizer:/(\/\/[^\n]*|\/\*[\s\S]*?\*\/)|(["'])(?:(?!\2|\\).|\\.)*?\2|(`(?:[^`\\]|\\.)*?`)|(\/(?![/*])(?:\\.|\[(?:\\.|[^\]])*\]|[^/\\\n])+\/[gimsuvy]*)/g,keywords:/\b(async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|from|function|get|if|import|in|instanceof|let|new|of|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/g,builtins:/\b(true|false|null|undefined|NaN|Infinity|console|window|document|Math|JSON|Array|Object|String|Number|Boolean|Date|RegExp|Map|Set|Promise|Error|Symbol|parseInt|parseFloat|require|module|exports)\b/g,numbers:/\b(\d+\.?\d*(?:e[+-]?\d+)?|0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+)\b/g},json:{tokenizer:/(\/\/[^\n]*|\/\*[\s\S]*?\*\/)|("(?:[^"\\]|\\.)*")/g,keywords:/\b(true|false|null)\b/g,numbers:/-?\b\d+\.?\d*(?:e[+-]?\d+)?\b/g},html:{tokenizer:/(<!--[\s\S]*?-->)|(["'])(?:(?!\2|\\).|\\.)*?\2|(<\/?[a-zA-Z][a-zA-Z0-9-]*(?:\s+[a-zA-Z-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*\/?>)/g,tagGroupIndex:3},css:{tokenizer:/(\/\*[\s\S]*?\*\/)|(["'])(?:(?!\2|\\).|\\.)*?\2/g,selectors:/([.#]?[a-zA-Z_][\w-]*(?:\s*[>+~]\s*[.#]?[a-zA-Z_][\w-]*)*)\s*\{/g,properties:/\b([a-zA-Z-]+)\s*:/g,numbers:/\b(\d+\.?\d*)(px|em|rem|%|vh|vw|s|ms|deg|fr)?\b/g,keywords:/\b(important|inherit|initial|unset|none|auto|block|inline|flex|grid)\b/g},sql:{tokenizer:/(--[^\n]*|\/\*[\s\S]*?\*\/)|(["'])(?:(?!\2|\\).|\\.)*?\2/g,keywords:/\b(SELECT|FROM|WHERE|AND|OR|INSERT|INTO|VALUES|UPDATE|SET|DELETE|CREATE|TABLE|DROP|ALTER|ADD|COLUMN|INDEX|JOIN|LEFT|RIGHT|INNER|OUTER|ON|AS|ORDER|BY|GROUP|HAVING|LIMIT|OFFSET|UNION|ALL|DISTINCT|COUNT|SUM|AVG|MIN|MAX|NOT|NULL|IS|IN|BETWEEN|LIKE|EXISTS|CASE|WHEN|THEN|ELSE|END|PRIMARY|KEY|FOREIGN|REFERENCES|CONSTRAINT|DEFAULT|CHECK|UNIQUE|CASCADE|GRANT|REVOKE|COMMIT|ROLLBACK|BEGIN|TRANSACTION|INT|VARCHAR|DATETIME|AUTO_INCREMENT|CURRENT_TIMESTAMP)\b/gi,numbers:/\b\d+\.?\d*\b/g}};function o(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function r(t,e){let i=t;return e.selectors&&(e.selectors.lastIndex=0,i=i.replace(e.selectors,'<span class="function-name">$1</span>{')),e.properties&&(e.properties.lastIndex=0,i=i.replace(e.properties,'<span class="property">$1</span>:')),e.keywords&&(e.keywords.lastIndex=0,i=i.replace(e.keywords,'<span class="keyword">$1</span>')),e.builtins&&(e.builtins.lastIndex=0,i=i.replace(e.builtins,'<span class="keyword">$1</span>')),e.numbers&&(e.numbers.lastIndex=0,i=i.replace(e.numbers,t=>'<span class="number">'.concat(t,"</span>"))),i}function s(t){let e="",i=t,n=i.match(/^(<\/?)([a-zA-Z][a-zA-Z0-9-]*)/);if(!n)return o(t);e+=o(n[1]),e+='<span class="tag">'+o(n[2])+"</span>",i=i.substring(n[0].length);let r,s=/^(\s+)([a-zA-Z-]+)(?:(\s*=\s*)(["'])([^"']*?)\4)?/;for(;null!==(r=i.match(s));)e+=r[1],e+='<span class="attr-name">'+o(r[2])+"</span>",r[3]&&(e+=o(r[3]),e+='<span class="attr-value">'+o(r[4])+o(r[5])+o(r[4])+"</span>"),i=i.substring(r[0].length);return e+=o(i),e}n.js=n.javascript,n.htm=n.html,e.exports=function(t){return function(e){let i=e.textContent,a="string"==typeof t?t.toLowerCase():"javascript",l=n[a];if(!l)return void(e.innerHTML=o(i));if(!l.tokenizer)return void(e.innerHTML=r(o(i),l));let c,d="",p=0,h=l.tagGroupIndex||0;for(l.tokenizer.lastIndex=0;null!==(c=l.tokenizer.exec(i));){if(c.index>p){d+=r(o(i.substring(p,c.index)),l)}let t=c[0];c[1]?d+='<span class="comment">'.concat(o(t),"</span>"):h>0&&c[h]?d+=s(t):d+='<span class="string">'.concat(o(t),"</span>"),p=l.tokenizer.lastIndex}if(p<i.length){d+=r(o(i.substring(p)),l)}e.innerHTML=d}},e.exports.LanguageDefinitions=n},{}],21:[function(t,e,i){e.exports={RenderOnLoad:!0,DefaultRenderable:"CodeEditor-Wrap",DefaultDestinationAddress:"#CodeEditor-Container-Div",Templates:[{Hash:"CodeEditor-Container",Template:"\x3c!-- CodeEditor-Container Rendering Soon --\x3e"}],Renderables:[{RenderableHash:"CodeEditor-Wrap",TemplateHash:"CodeEditor-Container",DestinationAddress:"#CodeEditor-Container-Div"}],TargetElementAddress:"#CodeEditor-Container-Div",CodeDataAddress:!1,Language:"javascript",ReadOnly:!1,Tab:"\t",IndentOn:/[({[]$/,MoveToNewLine:/^[)}\]]/,AddClosing:!0,CatchTab:!0,LineNumbers:!0,DefaultCode:"// Enter your code here\n",CSS:".pict-code-editor-wrap\n{\n\tdisplay: flex;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\tfont-size: 14px;\n\tline-height: 1.5;\n\tborder: 1px solid #D0D0D0;\n\tborder-radius: 4px;\n\toverflow: auto;\n}\n.pict-code-editor-wrap .pict-code-line-numbers\n{\n\tposition: sticky;\n\tleft: 0;\n\twidth: 40px;\n\tmin-width: 40px;\n\tpadding: 10px 0;\n\ttext-align: right;\n\tbackground: #F5F5F5;\n\tborder-right: 1px solid #D0D0D0;\n\tcolor: #999;\n\tfont-size: 13px;\n\tline-height: 1.5;\n\tuser-select: none;\n\tpointer-events: none;\n\tbox-sizing: border-box;\n\tz-index: 1;\n}\n.pict-code-editor-wrap .pict-code-line-numbers span\n{\n\tdisplay: block;\n\tpadding: 0 8px 0 0;\n}\n.pict-code-editor-wrap .pict-code-editor\n{\n\tmargin: 0;\n\tpadding: 10px 10px 10px 8px;\n\tmin-height: 100px;\n\tflex: 1;\n\tmin-width: 0;\n\toutline: none;\n\ttab-size: 4;\n\twhite-space: pre;\n\toverflow-wrap: normal;\n\tcolor: #383A42;\n\tbackground: #FAFAFA;\n\tcaret-color: #526FFF;\n\tborder-radius: 0 4px 4px 0;\n}\n.pict-code-editor-wrap .pict-code-editor.pict-code-no-line-numbers\n{\n\tpadding-left: 10px;\n\tborder-radius: 4px;\n}\n.pict-code-editor-wrap .pict-code-editor .keyword { color: #A626A4; }\n.pict-code-editor-wrap .pict-code-editor .string { color: #50A14F; }\n.pict-code-editor-wrap .pict-code-editor .number { color: #986801; }\n.pict-code-editor-wrap .pict-code-editor .comment { color: #A0A1A7; font-style: italic; }\n.pict-code-editor-wrap .pict-code-editor .operator { color: #0184BC; }\n.pict-code-editor-wrap .pict-code-editor .punctuation { color: #383A42; }\n.pict-code-editor-wrap .pict-code-editor .function-name { color: #4078F2; }\n.pict-code-editor-wrap .pict-code-editor .property { color: #E45649; }\n.pict-code-editor-wrap .pict-code-editor .tag { color: #E45649; }\n.pict-code-editor-wrap .pict-code-editor .attr-name { color: #986801; }\n.pict-code-editor-wrap .pict-code-editor .attr-value { color: #50A14F; }\n"}},{}],22:[function(t,e,i){const n=t("pict-view"),o=t("./Pict-Code-Highlighter.js"),r=t("./Pict-Section-Code-DefaultConfiguration.js");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},r,e),i),this.initialRenderComplete=!1,this.codeJar=null,this._highlightFunction=null,this._language=this.options.Language||"javascript"}onBeforeInitialize(){return super.onBeforeInitialize(),this._codeJarPrototype=null,this.targetElement=!1,this._highlightFunction=o(this._language),super.onBeforeInitialize()}connectCodeJarPrototype(t){if("function"!=typeof t)return"undefined"!=typeof window&&"function"==typeof window.CodeJar?(this.log.trace("PICT-Code Found CodeJar in window.CodeJar."),void(this._codeJarPrototype=window.CodeJar)):(this.log.error("PICT-Code No CodeJar prototype found. Include codejar via script tag or call connectCodeJarPrototype(CodeJar) explicitly."),!1);this._codeJarPrototype=t}onAfterRender(t){return this.pict.CSSMap.injectCSS(),this.initialRenderComplete||(this.onAfterInitialRender(),this.initialRenderComplete=!0),super.onAfterRender(t)}onAfterInitialRender(){if(this._codeJarPrototype||this.connectCodeJarPrototype(),!this._codeJarPrototype)return this.log.error("PICT-Code Cannot initialize editor; no CodeJar prototype available."),!1;if(this.codeJar)return this.log.error("PICT-Code editor is already initialized!"),!1;let t=this.services.ContentAssignment.getElement(this.options.TargetElementAddress);if(!t||t.length<1)return this.log.error("PICT-Code Could not find target element [".concat(this.options.TargetElementAddress,"]!")),this.targetElement=!1,!1;this.targetElement=t[0],this._buildEditorDOM();let e=this._resolveCodeContent(),i={};this.options.Tab&&(i.tab=this.options.Tab),this.options.IndentOn&&(i.indentOn=this.options.IndentOn),this.options.MoveToNewLine&&(i.moveToNewLine=this.options.MoveToNewLine),void 0!==this.options.AddClosing&&(i.addClosing=this.options.AddClosing),void 0!==this.options.CatchTab&&(i.catchTab=this.options.CatchTab),this.customConfigureEditorOptions(i);let n=this._editorElement;this.codeJar=this._codeJarPrototype(n,this._highlightFunction,i),e&&this.codeJar.updateCode(e),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)}),this._updateLineNumbers(),this.options.ReadOnly&&n.setAttribute("contenteditable","false")}_buildEditorDOM(){this.targetElement.innerHTML="";let t=document.createElement("div");if(t.className="pict-code-editor-wrap",this.options.LineNumbers){let e=document.createElement("div");e.className="pict-code-line-numbers",t.appendChild(e),this._lineNumbersElement=e}let e=document.createElement("div");e.className="pict-code-editor language-"+this._language,this.options.LineNumbers||(e.className+=" pict-code-no-line-numbers"),t.appendChild(e),this.targetElement.appendChild(t),this._editorElement=e,this._wrapElement=t}_updateLineNumbers(){if(!this.options.LineNumbers||!this._lineNumbersElement||!this._editorElement)return;let t=(this._editorElement.textContent||"").split("\n").length,e="";for(let i=1;i<=t;i++)e+="<span>".concat(i,"</span>");this._lineNumbersElement.innerHTML=e}_resolveCodeContent(){if(this.options.CodeDataAddress){const t={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};let e=this.fable.manifest.getValueByHash(t,this.options.CodeDataAddress);if("string"==typeof e)return e;this.log.warn("PICT-Code Address [".concat(this.options.CodeDataAddress,"] did not return a string; it was ").concat(typeof e,"."))}return this.options.DefaultCode||""}customConfigureEditorOptions(t){}onCodeChange(t){if(this.options.CodeDataAddress){const e={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};this.fable.manifest.setValueByHash(e,this.options.CodeDataAddress,t)}}getCode(){return this.codeJar?this.codeJar.toString():(this.log.warn("PICT-Code getCode called before editor initialized."),"")}setCode(t){this.codeJar?(this.codeJar.updateCode(t),this._updateLineNumbers()):this.log.warn("PICT-Code setCode called before editor initialized.")}setLanguage(t){if(this._language=t,this._highlightFunction=o(t),this._editorElement&&(this._editorElement.className="pict-code-editor language-"+t,this.options.LineNumbers||(this._editorElement.className+=" pict-code-no-line-numbers")),this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}setHighlightFunction(t){if("function"==typeof t){if(this._highlightFunction=t,this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}else this.log.error("PICT-Code setHighlightFunction requires a function.")}setReadOnly(t){this.options.ReadOnly=t,this._editorElement&&this._editorElement.setAttribute("contenteditable",t?"false":"true")}destroy(){this.codeJar&&(this.codeJar.destroy(),this.codeJar=null)}marshalToView(){if(super.marshalToView(),this.codeJar&&this.options.CodeDataAddress){let t=this._resolveCodeContent();"string"==typeof t&&(this.codeJar.updateCode(t),this._updateLineNumbers())}}marshalFromView(){super.marshalFromView(),this.codeJar&&this.options.CodeDataAddress&&this.onCodeChange(this.codeJar.toString())}},e.exports.default_configuration=r,e.exports.createHighlighter=o},{"./Pict-Code-Highlighter.js":20,"./Pict-Section-Code-DefaultConfiguration.js":21,"pict-view":52}],23:[function(t,e,i){arguments[4][20][0].apply(i,arguments)},{dup:20}],24:[function(t,e,i){e.exports={RenderOnLoad:!0,DefaultRenderable:"CodeEditor-Wrap",DefaultDestinationAddress:"#CodeEditor-Container-Div",Templates:[{Hash:"CodeEditor-Container",Template:"\x3c!-- CodeEditor-Container Rendering Soon --\x3e"}],Renderables:[{RenderableHash:"CodeEditor-Wrap",TemplateHash:"CodeEditor-Container",DestinationAddress:"#CodeEditor-Container-Div"}],TargetElementAddress:"#CodeEditor-Container-Div",CodeDataAddress:!1,Language:"javascript",ReadOnly:!1,Tab:"\t",IndentOn:/[({[]$/,MoveToNewLine:/^[)}\]]/,AddClosing:!0,CatchTab:!0,LineNumbers:!0,DefaultCode:"// Enter your code here\n",CSS:".pict-code-editor-wrap\n{\n\tposition: relative;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\tfont-size: 14px;\n\tline-height: 1.5;\n\tborder: 1px solid #D0D0D0;\n\tborder-radius: 4px;\n\toverflow: auto;\n}\n.pict-code-editor-wrap .pict-code-line-numbers\n{\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 40px;\n\tpadding: 10px 0;\n\ttext-align: right;\n\tbackground: #F5F5F5;\n\tborder-right: 1px solid #D0D0D0;\n\tcolor: #999;\n\tfont-size: 13px;\n\tline-height: 1.5;\n\tuser-select: none;\n\tpointer-events: none;\n\tbox-sizing: border-box;\n}\n.pict-code-editor-wrap .pict-code-line-numbers span\n{\n\tdisplay: block;\n\tpadding: 0 8px 0 0;\n}\n.pict-code-editor-wrap .pict-code-editor\n{\n\tmargin: 0;\n\tpadding: 10px 10px 10px 48px;\n\tmin-height: 100px;\n\toutline: none;\n\ttab-size: 4;\n\twhite-space: pre;\n\toverflow-wrap: normal;\n\toverflow-x: auto;\n\tcolor: #383A42;\n\tbackground: #FAFAFA;\n\tcaret-color: #526FFF;\n\tborder-radius: 4px;\n}\n.pict-code-editor-wrap .pict-code-editor.pict-code-no-line-numbers\n{\n\tpadding-left: 10px;\n}\n.pict-code-editor-wrap .pict-code-editor .keyword { color: #A626A4; }\n.pict-code-editor-wrap .pict-code-editor .string { color: #50A14F; }\n.pict-code-editor-wrap .pict-code-editor .number { color: #986801; }\n.pict-code-editor-wrap .pict-code-editor .comment { color: #A0A1A7; font-style: italic; }\n.pict-code-editor-wrap .pict-code-editor .operator { color: #0184BC; }\n.pict-code-editor-wrap .pict-code-editor .punctuation { color: #383A42; }\n.pict-code-editor-wrap .pict-code-editor .function-name { color: #4078F2; }\n.pict-code-editor-wrap .pict-code-editor .property { color: #E45649; }\n.pict-code-editor-wrap .pict-code-editor .tag { color: #E45649; }\n.pict-code-editor-wrap .pict-code-editor .attr-name { color: #986801; }\n.pict-code-editor-wrap .pict-code-editor .attr-value { color: #50A14F; }\n"}},{}],25:[function(t,e,i){arguments[4][22][0].apply(i,arguments)},{"./Pict-Code-Highlighter.js":23,"./Pict-Section-Code-DefaultConfiguration.js":24,dup:22,"pict-view":52}],26:[function(t,e,i){arguments[4][6][0].apply(i,arguments)},{"./providers/Pict-Provider-Content.js":27,"./views/Pict-View-Content.js":28,dup:6}],27:[function(t,e,i){const n=t("pict-provider"),o=t("pict-section-code").createHighlighter;e.exports=class extends n{constructor(t,e,i){super(t,e,i)}highlightCode(t,e){if(!t)return"";let i={textContent:t,innerHTML:""};return o(e)(i),i.innerHTML}generateLineNumbers(t){if(!t)return"<span>1</span>";let e=t.split("\n").length,i="";for(let t=1;t<=e;t++)i+="<span>"+t+"</span>";return i}parseMarkdown(t,e){if(!t)return"";let i=t.split("\n"),n=[],o=!1,r=0,s="",a=[],l=!1,c="",d=!1,p=[],h=!1,u=[],f=[],m=()=>{f.length>0&&(n.push("<p>"+f.map(t=>this.parseInline(t,e)).join(" ")+"</p>"),f=[])};for(let t=0;t<i.length;t++){let g=i[t];if(!o&&g.trim().match(/^\$\$/)){h?(n.push('<div class="pict-content-katex-display">'+u.join("\n")+"</div>"),h=!1,u=[]):(m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1),d&&(n.push("<blockquote>"+this.parseMarkdown(p.join("\n"),e)+"</blockquote>"),d=!1,p=[]),h=!0);continue}if(h){u.push(g);continue}let v=g.match(/^(`{3,})/);if(v){let t=v[1].length;if(o){if(t>=r&&g.trim()===v[1]){if("mermaid"===s)n.push('<pre class="mermaid">'+a.join("\n")+"</pre>");else{let t=a.join("\n"),e=this.highlightCode(t,s),i=this.generateLineNumbers(t);n.push('<div class="pict-content-code-wrap"><div class="pict-content-code-line-numbers">'+i+'</div><pre><code class="language-'+this.escapeHTML(s)+'">'+e+"</code></pre></div>")}o=!1,r=0,s="",a=[];continue}a.push(g);continue}m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1),d&&(n.push("<blockquote>"+this.parseMarkdown(p.join("\n"),e)+"</blockquote>"),d=!1,p=[]),r=t,s=g.replace(/^`{3,}/,"").trim(),o=!0;continue}if(o){a.push(g);continue}if(g.match(/^>\s?/)){d||(m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1),d=!0,p=[]),p.push(g.replace(/^>\s?/,""));continue}if(d&&(n.push("<blockquote>"+this.parseMarkdown(p.join("\n"),e)+"</blockquote>"),d=!1,p=[]),g.match(/^(-{3,}|\*{3,}|_{3,})\s*$/)){m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1),n.push("<hr>");continue}let b=g.match(/^(#{1,6})\s+(.+)/);if(b){m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1);let t=b[1].length,i=this.parseInline(b[2],e),o=b[2].toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-");n.push("<h"+t+' id="'+o+'">'+i+"</h"+t+">");continue}let y=g.match(/^(\s*)[-*+]\s+(.*)/);if(y){m(),l&&"ul"===c||(l&&n.push("ul"===c?"</ul>":"</ol>"),n.push("<ul>"),l=!0,c="ul"),n.push("<li>"+this.parseInline(y[2],e)+"</li>");continue}let w=g.match(/^(\s*)\d+\.\s+(.*)/);if(w)m(),l&&"ol"===c||(l&&n.push("ul"===c?"</ul>":"</ol>"),n.push("<ol>"),l=!0,c="ol"),n.push("<li>"+this.parseInline(w[2],e)+"</li>");else if(l&&""!==g.trim()&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1),""!==g.trim()){if(g.match(/^\|/)&&t+1<i.length&&i[t+1].match(/^\|[\s-:|]+\|/)){m(),l&&(n.push("ul"===c?"</ul>":"</ol>"),l=!1);let o="<table>",r=g.split("|").filter(t=>""!==t.trim());o+="<thead><tr>";for(let t=0;t<r.length;t++)o+="<th>"+this.parseInline(r[t].trim(),e)+"</th>";for(o+="</tr></thead>",t++,o+="<tbody>";t+1<i.length&&i[t+1].match(/^\|/);){t++;let n=i[t].split("|").filter(t=>""!==t.trim());o+="<tr>";for(let t=0;t<n.length;t++)o+="<td>"+this.parseInline(n[t].trim(),e)+"</td>";o+="</tr>"}o+="</tbody></table>",n.push(o);continue}f.push(g)}else m()}if(m(),l&&n.push("ul"===c?"</ul>":"</ol>"),d&&n.push("<blockquote>"+this.parseMarkdown(p.join("\n"),e)+"</blockquote>"),o){let t=a.join("\n"),e=this.highlightCode(t,s),i=this.generateLineNumbers(t);n.push('<div class="pict-content-code-wrap"><div class="pict-content-code-line-numbers">'+i+"</div><pre><code>"+e+"</code></pre></div>")}return n.join("\n")}parseInline(t,e){if(!t)return"";let i=t,n=[];return i=i.replace(/`([^`]+)`/g,(t,e)=>{let i=n.length;return n.push("<code>"+e+"</code>"),"\0CODEINLINE"+i+"\0"}),i=i.replace(/\$([^\$\s][^\$]*?[^\$\s])\$/g,'<span class="pict-content-katex-inline">$1</span>'),i=i.replace(/\$([^\$\s])\$/g,'<span class="pict-content-katex-inline">$1</span>'),i=i.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,'<img src="$2" alt="$1">'),i=i.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,i,n)=>{if("function"==typeof e){let t=e(n,i);if(t){let e=t.target?' target="'+t.target+'"':"",n=t.rel?' rel="'+t.rel+'"':"";return'<a href="'+t.href+'"'+e+n+">"+i+"</a>"}}return n.match(/^https?:\/\//)?'<a href="'+n+'" target="_blank" rel="noopener">'+i+"</a>":'<a href="'+n+'">'+i+"</a>"}),i=i.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),i=i.replace(/__([^_]+)__/g,"<strong>$1</strong>"),i=i.replace(/\*([^*]+)\*/g,"<em>$1</em>"),i=i.replace(/_([^_]+)_/g,"<em>$1</em>"),i=i.replace(/\x00CODEINLINE(\d+)\x00/g,(t,e)=>n[parseInt(e)]),i}escapeHTML(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"):""}},e.exports.default_configuration={ProviderIdentifier:"Pict-Content",AutoInitialize:!0,AutoInitializeOrdinal:0}},{"pict-provider":19,"pict-section-code":25}],28:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}displayContent(t,e){let i=e||"Pict-Content-Body";this.pict.ContentAssignment.assignContent("#"+i,t);let n=document.getElementById(i);n&&n.parentElement&&(n.parentElement.scrollTop=0),this.renderMermaidDiagrams(i),this.renderKaTeXEquations(i)}renderMermaidDiagrams(t){if("undefined"==typeof mermaid)return;let e=t||"Pict-Content-Body",i=document.getElementById(e);if(!i)return;let n=i.querySelectorAll("pre.mermaid");if(!(n.length<1))try{mermaid.run({nodes:n})}catch(t){this.log.error("Mermaid rendering error: "+t.message)}}renderKaTeXEquations(t){if("undefined"==typeof katex)return;let e=t||"Pict-Content-Body",i=document.getElementById(e);if(!i)return;let n=i.querySelectorAll(".pict-content-katex-inline");for(let t=0;t<n.length;t++)try{katex.render(n[t].textContent,n[t],{throwOnError:!1,displayMode:!1})}catch(t){this.log.warn("KaTeX inline error: "+t.message)}let o=i.querySelectorAll(".pict-content-katex-display");for(let t=0;t<o.length;t++)try{katex.render(o[t].textContent,o[t],{throwOnError:!1,displayMode:!0})}catch(t){this.log.warn("KaTeX display error: "+t.message)}}showLoading(t,e){let i=e||"Pict-Content-Body",n=t||"Loading content...";this.pict.ContentAssignment.assignContent("#"+i,'<div class="pict-content-loading">'+n+"</div>")}},e.exports.default_configuration={ViewIdentifier:"Pict-Content",DefaultRenderable:"Pict-Content-Display",DefaultDestinationAddress:"#Pict-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-content {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.pict-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 200px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.pict-content h1 {\n\t\t\tfont-size: 2em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-content h2 {\n\t\t\tfont-size: 1.5em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding-bottom: 0.25em;\n\t\t\tmargin-top: 1.5em;\n\t\t}\n\t\t.pict-content h3 {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-content h4, .pict-content h5, .pict-content h6 {\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-content p {\n\t\t\tline-height: 1.7;\n\t\t\tcolor: #423D37;\n\t\t\tmargin: 0.75em 0;\n\t\t}\n\t\t.pict-content a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.pict-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.pict-content-code-wrap {\n\t\t\tposition: relative;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1.5;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow: auto;\n\t\t\tmargin: 1em 0;\n\t\t\tbackground: #3D3229;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 40px;\n\t\t\tpadding: 1.25em 0;\n\t\t\ttext-align: right;\n\t\t\tbackground: #342A22;\n\t\t\tborder-right: 1px solid #4A3F35;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 13px;\n\t\t\tline-height: 1.5;\n\t\t\tuser-select: none;\n\t\t\tpointer-events: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers span {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0 8px 0 0;\n\t\t}\n\t\t.pict-content-code-wrap pre {\n\t\t\tmargin: 0;\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em 1.25em 1.25em 52px;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content-code-wrap pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.pict-content-code-wrap .keyword { color: #C678DD; }\n\t\t.pict-content-code-wrap .string { color: #98C379; }\n\t\t.pict-content-code-wrap .number { color: #D19A66; }\n\t\t.pict-content-code-wrap .comment { color: #7F848E; font-style: italic; }\n\t\t.pict-content-code-wrap .operator { color: #56B6C2; }\n\t\t.pict-content-code-wrap .punctuation { color: #E8E0D4; }\n\t\t.pict-content-code-wrap .function-name { color: #61AFEF; }\n\t\t.pict-content-code-wrap .property { color: #E06C75; }\n\t\t.pict-content-code-wrap .tag { color: #E06C75; }\n\t\t.pict-content-code-wrap .attr-name { color: #D19A66; }\n\t\t.pict-content-code-wrap .attr-value { color: #98C379; }\n\t\t.pict-content pre {\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1.25em;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-content code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t.pict-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content blockquote {\n\t\t\tborder-left: 4px solid #2E7D74;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tbackground: #F7F5F0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-content blockquote p {\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-content ul, .pict-content ol {\n\t\t\tpadding-left: 2em;\n\t\t\tline-height: 1.8;\n\t\t}\n\t\t.pict-content li {\n\t\t\tmargin: 0.25em 0;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\tmargin: 2em 0;\n\t\t}\n\t\t.pict-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content table th {\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-content table td {\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-content table tr:nth-child(even) {\n\t\t\tbackground: #F7F5F0;\n\t\t}\n\t\t.pict-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-content pre.mermaid {\n\t\t\tbackground: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\ttext-align: center;\n\t\t\tpadding: 1em;\n\t\t}\n\t\t.pict-content .pict-content-katex-display {\n\t\t\ttext-align: center;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-content .pict-content-katex-inline {\n\t\t\tdisplay: inline;\n\t\t}\n\t",Templates:[{Hash:"Pict-Content-Template",Template:'\n<div class="pict-content" id="Pict-Content-Body">\n\t<div class="pict-content-loading">Loading content...</div>\n</div>\n'}],Renderables:[{RenderableHash:"Pict-Content-Display",TemplateHash:"Pict-Content-Template",DestinationAddress:"#Pict-Content-Container",RenderMethod:"replace"}]}},{"pict-view":52}],29:[function(t,e,i){e.exports={ViewIdentifier:"Pict-FileBrowser",DefaultRenderable:"FileBrowser-Container",DefaultDestinationAddress:"#Pict-FileBrowser-Container",AutoRender:!1,StateAddresses:{Layout:"AppData.PictFileBrowser.Layout",RootLocation:"AppData.PictFileBrowser.RootLocation",CurrentLocation:"AppData.PictFileBrowser.CurrentLocation",CurrentFile:"AppData.PictFileBrowser.CurrentFile"},DefaultState:{Layout:"browser-detail",RootLocation:"/",CurrentLocation:"",CurrentFile:null},FileListAddress:"AppData.PictFileBrowser.FileList",FolderTreeAddress:"AppData.PictFileBrowser.FolderTree",ChildFolderCacheAddress:"AppData.PictFileBrowser.ChildFolderCache",Templates:[{Hash:"FileBrowser-Container-Template",Template:'\n<div class="pict-filebrowser" id="Pict-FileBrowser-Wrap">\n\t<div class="pict-filebrowser-browse-pane" id="Pict-FileBrowser-BrowsePane"></div>\n\t<div class="pict-filebrowser-main-pane">\n\t\t<div class="pict-filebrowser-list-pane" id="Pict-FileBrowser-ListPane"></div>\n\t\t<div class="pict-filebrowser-view-pane" id="Pict-FileBrowser-ViewPane"></div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"FileBrowser-Container",TemplateHash:"FileBrowser-Container-Template",DestinationAddress:"#Pict-FileBrowser-Container",RenderMethod:"replace"}],CSS:"\n\t\t.pict-filebrowser {\n\t\t\tdisplay: flex;\n\t\t\theight: 100%;\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n\t\t\tfont-size: 14px;\n\t\t\tcolor: #3D3229;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\toverflow: hidden;\n\t\t\tbackground: #FAFAF8;\n\t\t}\n\n\t\t.pict-filebrowser-browse-pane {\n\t\t\twidth: 240px;\n\t\t\tmin-width: 180px;\n\t\t\tborder-right: 1px solid #DDD6CA;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: #F5F0E8;\n\t\t\tflex-shrink: 0;\n\t\t}\n\n\t\t.pict-filebrowser-main-pane {\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}\n\n\t\t.pict-filebrowser-list-pane {\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t}\n\n\t\t.pict-filebrowser-view-pane {\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: #FAFAF8;\n\t\t}\n\n\t\t/* --- Browsing: Tree --- */\n\t\t.pict-fb-tree {\n\t\t\tpadding: 8px 0;\n\t\t}\n\t\t.pict-fb-tree-node {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 4px 8px 4px 0;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-tree-node:hover {\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t.pict-fb-tree-node.selected {\n\t\t\tbackground: #DDD6CA;\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.pict-fb-tree-toggle {\n\t\t\tdisplay: inline-block;\n\t\t\twidth: 16px;\n\t\t\ttext-align: center;\n\t\t\tflex-shrink: 0;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 10px;\n\t\t}\n\t\t.pict-fb-tree-icon {\n\t\t\tmargin-right: 6px;\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 14px;\n\t\t}\n\t\t.pict-fb-tree-label {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.pict-fb-tree-children {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.pict-fb-tree-children.expanded {\n\t\t\tdisplay: block;\n\t\t}\n\n\t\t/* --- Browsing: Search --- */\n\t\t.pict-fb-search {\n\t\t\tpadding: 8px;\n\t\t}\n\t\t.pict-fb-search-input {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tpadding: 6px 10px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 13px;\n\t\t\toutline: none;\n\t\t\tbackground: #fff;\n\t\t}\n\t\t.pict-fb-search-input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-fb-search-results {\n\t\t\tmargin-top: 4px;\n\t\t}\n\t\t.pict-fb-search-result {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 5px 8px;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 3px;\n\t\t}\n\t\t.pict-fb-search-result:hover {\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t.pict-fb-search-result-icon {\n\t\t\tmargin-right: 6px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-fb-search-result-name {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-search-result-path {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 11px;\n\t\t\tmargin-left: auto;\n\t\t\tpadding-left: 8px;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t/* --- Listing: Detail --- */\n\t\t.pict-fb-detail {\n\t\t\twidth: 100%;\n\t\t}\n\t\t.pict-fb-detail-header {\n\t\t\tdisplay: flex;\n\t\t\tpadding: 6px 12px;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 12px;\n\t\t\ttext-transform: uppercase;\n\t\t\tcolor: #8A7F72;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #F5F0E8;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.pict-fb-detail-header-cell {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-fb-detail-header-cell:hover {\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-fb-detail-col-name {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-fb-detail-col-size {\n\t\t\twidth: 90px;\n\t\t\ttext-align: right;\n\t\t\tflex-shrink: 0;\n\t\t\tpadding-right: 12px;\n\t\t}\n\t\t.pict-fb-detail-col-modified {\n\t\t\twidth: 150px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-fb-detail-row {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 5px 12px;\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 1px solid #F0ECE4;\n\t\t}\n\t\t.pict-fb-detail-row:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-fb-detail-row.selected {\n\t\t\tbackground: #E0EDE9;\n\t\t}\n\t\t.pict-fb-detail-icon {\n\t\t\tmargin-right: 8px;\n\t\t\tflex-shrink: 0;\n\t\t\tfont-size: 16px;\n\t\t}\n\t\t.pict-fb-detail-name {\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}\n\t\t.pict-fb-detail-size {\n\t\t\twidth: 90px;\n\t\t\ttext-align: right;\n\t\t\tflex-shrink: 0;\n\t\t\tpadding-right: 12px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 12px;\n\t\t}\n\t\t.pict-fb-detail-modified {\n\t\t\twidth: 150px;\n\t\t\tflex-shrink: 0;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 12px;\n\t\t}\n\n\t\t/* --- Listing: Icons --- */\n\t\t.pict-fb-icons {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tpadding: 12px;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.pict-fb-icon-item {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\twidth: 96px;\n\t\t\tpadding: 10px 6px;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.pict-fb-icon-item:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-fb-icon-item.selected {\n\t\t\tbackground: #E0EDE9;\n\t\t}\n\t\t.pict-fb-icon-graphic {\n\t\t\tfont-size: 36px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.pict-fb-icon-label {\n\t\t\tfont-size: 12px;\n\t\t\tword-break: break-word;\n\t\t\tline-height: 1.3;\n\t\t\tmax-height: 2.6em;\n\t\t\toverflow: hidden;\n\t\t}\n\n\t\t/* --- Viewing: FileInfo --- */\n\t\t.pict-fb-fileinfo {\n\t\t\tpadding: 12px 16px;\n\t\t}\n\t\t.pict-fb-fileinfo-title {\n\t\t\tfont-size: 15px;\n\t\t\tfont-weight: 600;\n\t\t\tmargin-bottom: 8px;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-fb-fileinfo-table {\n\t\t\twidth: 100%;\n\t\t\tfont-size: 13px;\n\t\t}\n\t\t.pict-fb-fileinfo-table td {\n\t\t\tpadding: 3px 0;\n\t\t}\n\t\t.pict-fb-fileinfo-label {\n\t\t\tcolor: #8A7F72;\n\t\t\twidth: 100px;\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.pict-fb-fileinfo-value {\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-fb-fileinfo-none {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-style: italic;\n\t\t}\n\n\t\t/* --- Viewing: Image --- */\n\t\t.pict-fb-image-viewer {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tpadding: 16px;\n\t\t\tmin-height: 200px;\n\t\t}\n\t\t.pict-fb-image-viewer img {\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 500px;\n\t\t\tobject-fit: contain;\n\t\t\tborder-radius: 4px;\n\t\t\tbox-shadow: 0 1px 3px rgba(0,0,0,0.1);\n\t\t}\n\t\t.pict-fb-image-viewer-none {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-style: italic;\n\t\t}\n\n\t\t/* --- Breadcrumb / Location Bar --- */\n\t\t.pict-fb-breadcrumb {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 6px 12px;\n\t\t\tfont-size: 13px;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\toverflow-x: auto;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-fb-breadcrumb-segment {\n\t\t\tcursor: pointer;\n\t\t\tcolor: #2E7D74;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder-radius: 3px;\n\t\t}\n\t\t.pict-fb-breadcrumb-segment:hover {\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t.pict-fb-breadcrumb-separator {\n\t\t\tmargin: 0 2px;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.pict-fb-breadcrumb-current {\n\t\t\tcolor: #3D3229;\n\t\t\tfont-weight: 500;\n\t\t\tpadding: 2px 4px;\n\t\t}\n\n\t\t/* --- Empty state --- */\n\t\t.pict-fb-empty {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tpadding: 32px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-style: italic;\n\t\t}\n\t"}},{}],30:[function(t,e,i){e.exports=t("./views/Pict-View-FileBrowser.js"),e.exports.PictFileBrowserBrowseProvider=t("./providers/Pict-Provider-FileBrowserBrowse.js"),e.exports.PictFileBrowserListProvider=t("./providers/Pict-Provider-FileBrowserList.js"),e.exports.PictFileBrowserViewProvider=t("./providers/Pict-Provider-FileBrowserView.js"),e.exports.PictFileBrowserLayoutProvider=t("./providers/Pict-Provider-FileBrowserLayout.js"),e.exports.PictFileBrowserIconProvider=t("./providers/Pict-Provider-FileBrowserIcons.js"),e.exports.PictViewBrowseTree=t("./views/Pict-View-FileBrowser-BrowseTree.js"),e.exports.PictViewBrowseSearch=t("./views/Pict-View-FileBrowser-BrowseSearch.js"),e.exports.PictViewListDetail=t("./views/Pict-View-FileBrowser-ListDetail.js"),e.exports.PictViewListIcons=t("./views/Pict-View-FileBrowser-ListIcons.js"),e.exports.PictViewFileInfo=t("./views/Pict-View-FileBrowser-ViewFileInfo.js"),e.exports.PictViewImageViewer=t("./views/Pict-View-FileBrowser-ViewImage.js"),e.exports.FileBrowserService=t("./services/Pict-Service-FileBrowser.js")},{"./providers/Pict-Provider-FileBrowserBrowse.js":31,"./providers/Pict-Provider-FileBrowserIcons.js":32,"./providers/Pict-Provider-FileBrowserLayout.js":33,"./providers/Pict-Provider-FileBrowserList.js":34,"./providers/Pict-Provider-FileBrowserView.js":35,"./services/Pict-Service-FileBrowser.js":36,"./views/Pict-View-FileBrowser-BrowseSearch.js":37,"./views/Pict-View-FileBrowser-BrowseTree.js":38,"./views/Pict-View-FileBrowser-ListDetail.js":39,"./views/Pict-View-FileBrowser-ListIcons.js":40,"./views/Pict-View-FileBrowser-ViewFileInfo.js":41,"./views/Pict-View-FileBrowser-ViewImage.js":42,"./views/Pict-View-FileBrowser.js":43}],31:[function(t,e,i){const n=t("pict-provider");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}getFolderTree(){let t=this.getFileBrowserOption("FolderTreeAddress","AppData.PictFileBrowser.FolderTree"),e=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t);return Array.isArray(e)?e:[]}flattenTree(t){let e=t||this.getFolderTree(),i=[],n=(t,e)=>{for(let o=0;o<t.length;o++){let r=t[o],s=e?e+"/"+r.Name:r.Name;i.push({Name:r.Name,Path:s}),Array.isArray(r.Children)&&r.Children.length>0&&n(r.Children,s)}};return n(e,""),i}getChildFolders(t){let e=this.getFileBrowserOption("ChildFolderCacheAddress","AppData.PictFileBrowser.ChildFolderCache"),i=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},e);if(!i||"object"!=typeof i)return null;let n=t||"_root_";return Array.isArray(i[n])?i[n]:null}setChildFolders(t,e){let i=this.getFileBrowserOption("ChildFolderCacheAddress","AppData.PictFileBrowser.ChildFolderCache"),n=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},i);n&&"object"==typeof n||(n={}),n[t||"_root_"]=Array.isArray(e)?e:[],this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,n)}searchFiles(t,e){if(!t||"string"!=typeof t)return[];let i=e||this.getFileList(),n=t.toLowerCase();return i.filter(t=>t.Name&&t.Name.toLowerCase().indexOf(n)>=0)}navigateToFolder(t){let e=this.getFileBrowserOption("StateAddresses",{}),i=e.CurrentLocation||"AppData.PictFileBrowser.CurrentLocation",n=e.CurrentFile||"AppData.PictFileBrowser.CurrentFile";this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,t||""),this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},n,null)}getFileList(){let t=this.getFileBrowserOption("FileListAddress","AppData.PictFileBrowser.FileList"),e=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t);return Array.isArray(e)?e:[]}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-Browse",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0}},{"pict-provider":19}],32:[function(t,e,i){const n=t("pict-provider"),o={Primary:"#3D3229",Accent:"#2E7D74",Muted:"#8A7F72",Light:"#F5F0E8",WarmBeige:"#EAE3D8",TealTint:"#E0EDE9",Lavender:"#E8E0F0",AmberTint:"#F0E8D0"},r={folder:t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.WarmBeige+'" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 9H20.8" stroke="'+o.Primary+'" stroke-width="1" opacity="0.3" /></svg>',"folder-open":t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.WarmBeige+'" stroke="'+o.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="'+o.Primary+'" stroke-width="1.5" fill="'+o.Light+'" stroke-linecap="round" stroke-linejoin="round" opacity="0.7" /></svg>',file:t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.Light+'" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /></svg>',"file-text":t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.Light+'" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+o.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="'+o.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="15.8" x2="15.9" y2="15.8" stroke="'+o.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="18.8" x2="12.2" y2="18.8" stroke="'+o.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>',"file-code":t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.Light+'" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M8.5 13.2L6.8 15.1L8.6 16.8" stroke="'+o.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="'+o.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><line x1="12.8" y1="12" x2="11.2" y2="18" stroke="'+o.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>',"file-image":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><rect x="3.1" y="3.2" width="17.8" height="17.7" rx="2" fill="'+o.Lavender+'" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="8.3" cy="8.7" r="1.8" fill="'+o.Accent+'" /><path d="M20.8 15.2L15.9 10.1L5.2 20.8" stroke="'+o.Primary+'" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"file-pdf":t=>'<svg width="'+t+'" height="'+t+'" 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="#F0DDDD" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+o.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="#C04040" letter-spacing="-0.3">PDF</text></svg>',"file-spreadsheet":t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.TealTint+'" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+o.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="'+o.Accent+'" stroke-width="1.2" /><line x1="7.2" y1="13.7" x2="17" y2="13.7" stroke="'+o.Accent+'" stroke-width="1" /><line x1="7.2" y1="16.3" x2="17" y2="16.3" stroke="'+o.Accent+'" stroke-width="1" /><line x1="10.9" y1="11.1" x2="10.9" y2="18.9" stroke="'+o.Accent+'" stroke-width="1" /></svg>',"file-archive":t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.WarmBeige+'" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+o.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="'+o.Primary+'" /><rect x="8.8" y="14.2" width="2.5" height="2" rx="0.4" fill="'+o.Primary+'" /><rect x="8.8" y="17.2" width="2.5" height="2" rx="0.4" fill="'+o.Primary+'" /></svg>',"file-audio":t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.AmberTint+'" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="10.2" cy="16.8" r="2.1" fill="none" stroke="'+o.Accent+'" stroke-width="1.5" /><path d="M12.2 16.8V11.2L16.1 10.1" stroke="'+o.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="'+o.Accent+'" stroke-width="1.2" /></svg>',"file-video":t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.Lavender+'" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+o.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="'+o.Accent+'" stroke="'+o.Accent+'" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" /></svg>',"file-web":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8.9" fill="'+o.TealTint+'" stroke="'+o.Primary+'" stroke-width="1.8" /><ellipse cx="12" cy="12" rx="4.1" ry="8.9" fill="none" stroke="'+o.Primary+'" stroke-width="1.2" /><line x1="3.1" y1="12" x2="20.9" y2="12" stroke="'+o.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="'+o.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="'+o.Primary+'" stroke-width="1" fill="none" /></svg>',"file-config":t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.Light+'" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+o.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="12" cy="15" r="2.8" fill="none" stroke="'+o.Muted+'" stroke-width="1.5" /><line x1="12" y1="11" x2="12" y2="12.2" stroke="'+o.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="12" y1="17.8" x2="12" y2="19" stroke="'+o.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="13.2" x2="15.8" y2="12.6" stroke="'+o.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="17" x2="9.2" y2="16.4" stroke="'+o.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="16.8" x2="15.8" y2="17.4" stroke="'+o.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="13" x2="9.2" y2="13.6" stroke="'+o.Muted+'" stroke-width="1.3" stroke-linecap="round" /></svg>',home:t=>'<svg width="'+t+'" height="'+t+'" 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="'+o.TealTint+'" stroke="'+o.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="'+o.Accent+'" /></svg>',"arrow-up":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M12.1 19.1V5.1" stroke="'+o.Muted+'" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M5.2 11.9L12.1 5.1L18.9 11.9" stroke="'+o.Muted+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"chevron-right":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M9.2 6.1L14.8 12.1L9.1 17.9" stroke="'+o.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',"chevron-down":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M6.1 9.2L12.1 14.8L17.9 9.1" stroke="'+o.Muted+'" stroke-width="2.5" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>',search:t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><circle cx="10.8" cy="10.8" r="6.8" stroke="'+o.Primary+'" stroke-width="1.8" /><line x1="15.9" y1="16.1" x2="20.8" y2="20.8" stroke="'+o.Primary+'" stroke-width="2" stroke-linecap="round" /></svg>',"sort-asc":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+o.Primary+'" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+o.Muted+'" opacity="0.35" /></svg>',"sort-desc":t=>'<svg width="'+t+'" height="'+t+'" viewBox="0 0 24 24" fill="none"><path d="M12 4.2L7.2 10.8H16.8L12 4.2Z" fill="'+o.Muted+'" opacity="0.35" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+o.Primary+'" /></svg>'},s={".jpg":"file-image",".jpeg":"file-image",".png":"file-image",".gif":"file-image",".svg":"file-image",".webp":"file-image",".bmp":"file-image",".ico":"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",".mp3":"file-audio",".wav":"file-audio",".flac":"file-audio",".ogg":"file-audio",".aac":"file-audio",".wma":"file-audio",".m4a":"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"};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._icons=Object.assign({},r),this._extensionMap=Object.assign({},s),this._cssInjected=!1}getIcon(t,e){let i=e||16,n=this._icons[t];return"function"==typeof n?n(i):""}getIconForEntry(t,e){if(!t)return"";if(t.Icon&&"string"==typeof t.Icon&&0===t.Icon.indexOf("<svg"))return t.Icon;let i=e||16;if("folder"===t.Type)return this.getIcon("folder",i);let n=(t.Extension||"").toLowerCase();return n&&this._extensionMap[n]?this.getIcon(this._extensionMap[n],i):this.getIcon("file",i)}getUIIcon(t,e){return this.getIcon(t,e||16)}registerIcon(t,e){return!(!t||"function"!=typeof e)&&(this._icons[t]=e,!0)}registerExtension(t,e){return!(!t||!e)&&(this._extensionMap[t.toLowerCase()]=e,!0)}getIconNames(){return Object.keys(this._icons)}getExtensionMap(){return Object.assign({},this._extensionMap)}injectCSS(){this._cssInjected||this.pict&&this.pict.CSSMap&&(this.pict.CSSMap.addCSS("PictFileBrowserIcons",".pict-fb-svg-icon { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; }\n.pict-fb-svg-icon svg { display: block; }\n.pict-fb-tree-icon svg { width: 16px; height: 16px; }\n.pict-fb-detail-icon svg { width: 16px; height: 16px; }\n.pict-fb-icon-graphic svg { width: 36px; height: 36px; }\n.pict-fb-tree-toggle svg { width: 10px; height: 10px; }\n"),this._cssInjected=!0)}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-Icons",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0},e.exports.BuiltInIcons=r,e.exports.ExtensionMap=s,e.exports.Colors=o},{"pict-provider":19}],33:[function(t,e,i){const n=t("pict-provider"),o={"list-only":{Key:"list-only",Label:"List Only",Description:"Full-width file list",Panes:["list"],PaneCount:1,CSSClass:"pict-fb-layout-list-only"},"tree-list":{Key:"tree-list",Label:"Tree + List",Description:"Folder tree on the left, file list on the right",Panes:["browse","list"],PaneCount:2,CSSClass:"pict-fb-layout-tree-list"},"list-detail":{Key:"list-detail",Label:"List + Detail",Description:"File list on top, file details on the bottom",Panes:["list","view"],PaneCount:2,CSSClass:"pict-fb-layout-list-detail"},"tree-detail":{Key:"tree-detail",Label:"Tree + Detail",Description:"Folder tree on the left, file details on the right",Panes:["browse","view"],PaneCount:2,CSSClass:"pict-fb-layout-tree-detail"},"browser-detail":{Key:"browser-detail",Label:"Browser",Description:"Folder tree on the left, file list top-right, details bottom-right",Panes:["browse","list","view"],PaneCount:3,CSSClass:"pict-fb-layout-browser-detail"},"browser-columns":{Key:"browser-columns",Label:"Columns",Description:"Three-column layout: folder tree, file list, and file details side-by-side",Panes:["browse","list","view"],PaneCount:3,CSSClass:"pict-fb-layout-browser-columns"}};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.layouts=JSON.parse(JSON.stringify(o))}getLayouts(){return this.layouts}getLayoutList(){let t=[];for(let e in this.layouts)t.push(this.layouts[e]);return t.sort((t,e)=>t.PaneCount!==e.PaneCount?t.PaneCount-e.PaneCount:t.Key.localeCompare(e.Key)),t}getLayout(t){return this.layouts[t]||null}getCurrentLayoutKey(){let t=this.getFileBrowserOption("StateAddresses",{}).Layout||"AppData.PictFileBrowser.Layout";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||"browser-detail"}getCurrentLayout(){let t=this.getCurrentLayoutKey();return this.layouts[t]||this.layouts["browser-detail"]}setLayout(t){if(!this.layouts[t])return!1;let e=this.getFileBrowserOption("StateAddresses",{}).Layout||"AppData.PictFileBrowser.Layout";return this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},e,t),!0}isPaneVisible(t){return this.getCurrentLayout().Panes.indexOf(t)>=0}registerLayout(t){return!(!t||!t.Key)&&(this.layouts[t.Key]=t,!0)}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-Layout",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0},e.exports.BuiltInLayouts=o},{"pict-provider":19}],34:[function(t,e,i){const n=t("pict-provider");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.sortField="Name",this.sortAscending=!0}getFileList(){let t=this.getFileBrowserOption("FileListAddress","AppData.PictFileBrowser.FileList"),e=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t);return Array.isArray(e)?e:[]}getSortedFileList(t){let e=(t||this.getFileList()).slice(),i=this.sortField,n=this.sortAscending;return e.sort((t,e)=>{let o="folder"===t.Type?0:1,r="folder"===e.Type?0:1;if(o!==r)return o-r;let s=t[i],a=e[i];if(null==s&&null==a)return 0;if(null==s)return 1;if(null==a)return-1;let l=0;return l="string"==typeof s?s.localeCompare(a):s<a?-1:s>a?1:0,n?l:-l}),e}setSortField(t){this.sortField===t?this.sortAscending=!this.sortAscending:(this.sortField=t,this.sortAscending=!0)}selectFile(t){let e=this.getFileBrowserOption("StateAddresses",{}).CurrentFile||"AppData.PictFileBrowser.CurrentFile";this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},e,t||null)}getSelectedFile(){let t=this.getFileBrowserOption("StateAddresses",{}).CurrentFile||"AppData.PictFileBrowser.CurrentFile";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||null}openEntry(t){if(t)if("folder"===t.Type){let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){let i=this.getFileBrowserOption("StateAddresses",{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation",n=this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},i)||"",o=n?n+"/"+t.Name:t.Name;e.navigateToFolder(o)}}else this.selectFile(t)}formatFileSize(t){return null==t||isNaN(t)?"--":t<1024?t+" B":t<1048576?(t/1024).toFixed(1)+" KB":t<1073741824?(t/1048576).toFixed(1)+" MB":(t/1073741824).toFixed(1)+" GB"}formatDate(t){if(!t)return"--";try{let e=new Date(t);return isNaN(e.getTime())?"--":e.toLocaleDateString()+" "+e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(t){return"--"}}getEntryIcon(t){if(!t)return"";if(t.Icon)return t.Icon;let e=this.pict.providers["Pict-FileBrowser-Icons"];if(e)return e.getIconForEntry(t,16);if("folder"===t.Type)return"📁";switch((t.Extension||"").toLowerCase()){case".jpg":case".jpeg":case".png":case".gif":case".svg":case".webp":case".bmp":return"🖼";case".pdf":default:return"📄";case".doc":case".docx":case".txt":case".md":case".rtf":return"📃";case".xls":case".xlsx":case".csv":return"📊";case".zip":case".tar":case".gz":case".rar":case".7z":return"📦";case".js":case".ts":case".py":case".rb":case".java":case".c":case".cpp":case".go":case".rs":return"💻";case".html":case".css":case".json":case".xml":case".yaml":case".yml":return"🌐";case".mp3":case".wav":case".flac":case".ogg":case".aac":return"🎵";case".mp4":case".avi":case".mov":case".mkv":case".webm":return"🎥"}}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-List",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0}},{"pict-provider":19}],35:[function(t,e,i){const n=t("pict-provider");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}getCurrentFile(){let t=this.getFileBrowserOption("StateAddresses",{}).CurrentFile||"AppData.PictFileBrowser.CurrentFile";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||null}isImage(t){let e=t||this.getCurrentFile();if(!e)return!1;if(e.MimeType&&0===e.MimeType.indexOf("image/"))return!0;let i=(e.Extension||"").toLowerCase();return[".jpg",".jpeg",".png",".gif",".svg",".webp",".bmp",".ico",".tiff",".tif"].indexOf(i)>=0}getImageURL(t){let e=t||this.getCurrentFile();return e&&(e.URL||e.ThumbnailURL)||null}getFileTypeDescription(t){let e=t||this.getCurrentFile();if(!e)return"Unknown";if("folder"===e.Type)return"Folder";let i=(e.Extension||"").toLowerCase();switch(i){case".jpg":case".jpeg":return"JPEG Image";case".png":return"PNG Image";case".gif":return"GIF Image";case".svg":return"SVG Image";case".webp":return"WebP Image";case".bmp":return"Bitmap Image";case".pdf":return"PDF Document";case".doc":case".docx":return"Word Document";case".xls":case".xlsx":return"Excel Spreadsheet";case".csv":return"CSV File";case".txt":return"Text File";case".md":return"Markdown File";case".html":return"HTML File";case".css":return"CSS Stylesheet";case".js":return"JavaScript File";case".ts":return"TypeScript File";case".json":return"JSON File";case".xml":return"XML File";case".yaml":case".yml":return"YAML File";case".py":return"Python Script";case".rb":return"Ruby Script";case".java":return"Java File";case".c":return"C Source File";case".cpp":return"C++ Source File";case".go":return"Go Source File";case".rs":return"Rust Source File";case".zip":return"ZIP Archive";case".tar":return"TAR Archive";case".gz":return"GZip Archive";case".rar":return"RAR Archive";case".mp3":return"MP3 Audio";case".wav":return"WAV Audio";case".mp4":return"MP4 Video";case".avi":return"AVI Video";case".mov":return"QuickTime Video";default:return i?i.substring(1).toUpperCase()+" File":"File"}}getFileBrowserOption(t,e){if(this.pict.views&&this.pict.views["Pict-FileBrowser"]){let e=this.pict.views["Pict-FileBrowser"].options;if(e&&t in e)return e[t]}return e}},e.exports.default_configuration={ProviderIdentifier:"Pict-FileBrowser-View",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0}},{"pict-provider":19}],36:[function(t,e,i){(function(i){(function(){
58
+ /**
59
+ * Pict FileBrowser Service
60
+ *
61
+ * A Fable service that provides:
62
+ * 1. REST API endpoints for browsing a filesystem path
63
+ * 2. A static web app that uses the pict-section-filebrowser control
64
+ *
65
+ * Usage:
66
+ * const libFable = require('fable');
67
+ * const libOrator = require('orator');
68
+ * const libOratorServiceServerRestify = require('orator-serviceserver-restify');
69
+ * const libPictFileBrowser = require('pict-section-filebrowser');
70
+ *
71
+ * let tmpFable = new libFable({ Product: 'MyApp', APIServerPort: 8080 });
72
+ * tmpFable.serviceManager.addServiceType('OratorServiceServer', libOratorServiceServerRestify);
73
+ * tmpFable.serviceManager.addServiceType('Orator', libOrator);
74
+ *
75
+ * let tmpOrator = tmpFable.serviceManager.instantiateServiceProvider('Orator');
76
+ * let tmpFileBrowser = new libPictFileBrowser.FileBrowserService(tmpFable,
77
+ * { BasePath: '/path/to/browse', APIRoutePrefix: '/api/filebrowser' });
78
+ *
79
+ * tmpOrator.startService(() =>
80
+ * {
81
+ * tmpFileBrowser.connectRoutes();
82
+ * console.log('File browser ready at http://localhost:8080/filebrowser/');
83
+ * });
84
+ *
85
+ * @license MIT
86
+ * @author Steven Velozo <steven@velozo.com>
87
+ */
88
+ const n=t("fable-serviceproviderbase"),o=t("path"),r=t("fs"),s=t("url"),a={BasePath:".",APIRoutePrefix:"/api/filebrowser",WebAppRoute:"/filebrowser/*",WebAppRouteStrip:"/filebrowser/",ServeWebApp:!0,IncludeHiddenFiles:!1,MaxTreeDepth:2};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.serviceType="PictFileBrowserService";for(let t in a)t in this.options||(this.options[t]=a[t]);this.basePath=o.resolve(this.options.BasePath)}connectRoutes(){if(!this.fable.Orator||!this.fable.Orator.serviceServer)return this.log.error("PictFileBrowserService: Orator service server is not available. Initialize Orator first."),!1;let t=this.fable.Orator.serviceServer,e=this.options.APIRoutePrefix;if(t.get(e+"/list",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.listDirectory(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/tree",(t,e,i)=>{let n=this.parseQueryParams(t),o=this.options.MaxTreeDepth;n.depth&&(o=parseInt(n.depth)||this.options.MaxTreeDepth),this.buildFolderTree("",o,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/info",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.getFileInfo(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/children",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.listChildFolders(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),this.options.ServeWebApp){let t=o.join(i,"..","www");this.fable.Orator.addStaticRoute(t,"index.html",this.options.WebAppRoute,this.options.WebAppRouteStrip)}return this.log.info("PictFileBrowserService: Routes connected. Browsing path: "+this.basePath),!0}parseQueryParams(t){if(t.query&&"object"==typeof t.query)return t.query;return s.parse(t.url,!0).query||{}}resolveSafePath(t){let e=(t||"").replace(/\.\./g,"").replace(/\/\//g,"/"),i=o.resolve(this.basePath,e);return 0!==i.indexOf(this.basePath)?null:i}listDirectory(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(n,s)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):"ENOTDIR"===n.code?e(new Error("Path is not a directory")):e(n);let a=[],l=s.length;if(0===l)return e(null,a);for(let n=0;n<s.length;n++){let c=s[n],d=c.name;if(!this.options.IncludeHiddenFiles&&"."===d.charAt(0)){if(l--,0===l)return e(null,a);continue}let p=o.join(i,d),h=t?t+"/"+d:d;r.stat(p,((t,i,n)=>(r,s)=>{let c={Name:t,Path:i,Type:n?"folder":"file"};if(s&&!r&&(c.Size=s.size,c.Modified=s.mtime,c.Created=s.birthtime,n||(c.Extension=o.extname(t))),a.push(c),l--,0===l)return e(null,a)})(d,h,c.isDirectory()))}})}listChildFolders(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(n,s)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):"ENOTDIR"===n.code?e(new Error("Path is not a directory")):e(n);let a=[];for(let t=0;t<s.length;t++){if(!s[t].isDirectory())continue;let e=s[t].name;(this.options.IncludeHiddenFiles||"."!==e.charAt(0))&&a.push(e)}if(a.sort((t,e)=>t.localeCompare(e)),0===a.length)return e(null,[]);let l=[],c=a.length;for(let n=0;n<a.length;n++){let s=a[n],d=o.join(i,s),p=t?t+"/"+s:s;r.readdir(d,{withFileTypes:!0},((t,i)=>(n,o)=>{let r=!1;if(!n&&o)for(let t=0;t<o.length;t++)if(o[t].isDirectory()){let e=o[t].name;if(this.options.IncludeHiddenFiles||"."!==e.charAt(0)){r=!0;break}}if(l.push({Name:t,Path:i,HasChildren:r}),c--,0===c)return l.sort((t,e)=>t.Name.localeCompare(e.Name)),e(null,l)})(s,p))}})}buildFolderTree(t,e,i){let n=this.resolveSafePath(t);if(!n)return i(new Error("Invalid path"));this._buildTreeRecursive(n,t,e,0,i)}_buildTreeRecursive(t,e,i,n,s){if(i>0&&n>=i)return s(null,[]);r.readdir(t,{withFileTypes:!0},(r,a)=>{if(r)return s(null,[]);let l=[];for(let t=0;t<a.length;t++)if(a[t].isDirectory()){let e=a[t].name;if(!this.options.IncludeHiddenFiles&&"."===e.charAt(0))continue;l.push(e)}if(0===l.length)return s(null,[]);let c=[],d=l.length;for(let r=0;r<l.length;r++){let a=l[r],p=o.join(t,a),h=e?e+"/"+a:a;this._buildTreeRecursive(p,h,i,n+1,((t,e)=>(i,n)=>{if(c.push({Name:t,Path:e,Children:n||[]}),d--,0===d)return c.sort((t,e)=>t.Name.localeCompare(e.Name)),s(null,c)})(a,h))}})}getFileInfo(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.stat(i,(n,r)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):e(n);let s=o.basename(i),a={Name:s,Path:t||s,Type:r.isDirectory()?"folder":"file",Size:r.size,Modified:r.mtime,Created:r.birthtime};return r.isDirectory()||(a.Extension=o.extname(s)),e(null,a)})}},e.exports.default_configuration=a}).call(this)}).call(this,"/../retold-content-system/node_modules/pict-section-filebrowser/source/services")},{"fable-serviceproviderbase":2,fs:67,path:106,url:137}],37:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-BrowseSearch",DefaultRenderable:"BrowseSearch-Container",DefaultDestinationAddress:"#Pict-FileBrowser-BrowsePane",AutoRender:!1,Templates:[{Hash:"FileBrowser-BrowseSearch-Container-Template",Template:'\n<div class="pict-fb-search">\n\t<input type="text" class="pict-fb-search-input"\n\t\tid="Pict-FileBrowser-SearchInput"\n\t\tplaceholder="Search files..."\n\t\toninput="pict.views[\'{~D:Record.ViewHash~}\'].onSearchInput(this.value)" />\n\t<div class="pict-fb-search-results" id="Pict-FileBrowser-SearchResults"></div>\n</div>\n'},{Hash:"FileBrowser-BrowseSearch-Result-Template",Template:'\n<div class="pict-fb-search-result" onclick="{~D:Record.ClickHandler~}">\n\t<span class="pict-fb-search-result-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-search-result-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-search-result-path">{~D:Record.Path~}</span>\n</div>\n'},{Hash:"FileBrowser-BrowseSearch-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"BrowseSearch-Container",TemplateHash:"FileBrowser-BrowseSearch-Container-Template",DestinationAddress:"#Pict-FileBrowser-BrowsePane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this.lastQuery="",this.debounceTimer=null}onAfterRender(t){let e=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Container-Template",{ViewHash:this.Hash});return this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-BrowsePane",e),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}onSearchInput(t){this.lastQuery=t||"",this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.performSearch(this.lastQuery)},150)}performSearch(t){let e="#Pict-FileBrowser-SearchResults";if(!t||t.length<1)return void this.pict.ContentAssignment.assignContent(e,"");let i=this.pict.providers["Pict-FileBrowser-Browse"];if(!i)return;let n=i.searchFiles(t),o=this.pict.providers["Pict-FileBrowser-List"];if(0===n.length){let t=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Empty-Template",{Message:"No results found"});return void this.pict.ContentAssignment.assignContent(e,t)}let r="";for(let t=0;t<n.length&&t<50;t++){let e=n[t],i=o?o.getEntryIcon(e):"📄",s=e.Path||"",a={Name:e.Name,Path:s,Icon:i,ClickHandler:"pict.views['"+this.Hash+"'].selectResult("+t+")"};r+=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Result-Template",a)}this.pict.ContentAssignment.assignContent(e,r),this._lastResults=n}selectResult(t){if(!this._lastResults||t>=this._lastResults.length)return;let e=this._lastResults[t],i=this.pict.providers["Pict-FileBrowser-List"];i&&i.openEntry(e)}},e.exports.default_configuration=o},{"pict-view":52}],38:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-BrowseTree",DefaultRenderable:"BrowseTree-Container",DefaultDestinationAddress:"#Pict-FileBrowser-BrowsePane",AutoRender:!1,Templates:[{Hash:"FileBrowser-BrowseTree-Container-Template",Template:'<div class="pict-fb-tree" id="Pict-FileBrowser-Tree"></div>'},{Hash:"FileBrowser-BrowseTree-Node-Template",Template:'\n<div class="pict-fb-tree-node{~D:Record.SelectedClass~}" style="padding-left: {~D:Record.Indent~}px;" data-path="{~D:Record.Path~}" onclick="{~D:Record.ClickHandler~}">\n\t<span class="{~D:Record.ToggleClass~}" onclick="{~D:Record.ToggleHandler~}">{~D:Record.ToggleIcon~}</span>\n\t<span class="pict-fb-tree-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-tree-label">{~D:Record.Name~}</span>\n</div>\n<div class="pict-fb-tree-children{~D:Record.ExpandedClass~}" id="Pict-FB-TreeChildren-{~D:Record.NodeID~}">\n{~D:Record.ChildrenHTML~}\n</div>\n'}],Renderables:[{RenderableHash:"BrowseTree-Container",TemplateHash:"FileBrowser-BrowseTree-Container-Template",DestinationAddress:"#Pict-FileBrowser-BrowsePane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this.expandedPaths={}}onAfterRender(t){return this.rebuildTree(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildTree(){if(!this.pict.providers["Pict-FileBrowser-Browse"])return;let t=this.getCurrentLocation(),e=this.renderTreeLevel("",0,t);this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-Tree",e)}renderTreeLevel(t,e,i){let n=this.pict.providers["Pict-FileBrowser-Browse"];if(!n)return"";let o=n.getChildFolders(t);if(!o)return this.expandedPaths[t]?'<div class="pict-fb-tree-loading" style="padding-left: '+(24+16*e)+'px;">Loading...</div>':"";let r="";for(let t=0;t<o.length;t++){let s=o[t],a=s.Path,l=a.replace(/[^a-zA-Z0-9]/g,"_"),c=!!this.expandedPaths[a],d=a===i,p=n.getChildFolders(a),h=s.HasChildren||p&&p.length>0,u="";c&&(u=this.renderTreeLevel(a,e+1,i));let f=this.pict.providers["Pict-FileBrowser-Icons"],m=f?f.getIcon("folder",16):"📁",g="";h&&(g=f?c?f.getIcon("chevron-down",10):f.getIcon("chevron-right",10):c?"▾":"▸");let v={Name:s.Name,Path:a,NodeID:l,Indent:8+16*e,Icon:m,ToggleIcon:g,ToggleClass:h?"pict-fb-tree-toggle":"pict-fb-tree-toggle-empty",ToggleHandler:h?"event.stopPropagation(); pict.views['"+this.Hash+"'].toggleNode('"+a+"')":"",ClickHandler:"pict.views['"+this.Hash+"'].selectFolder('"+a+"')",SelectedClass:d?" selected":"",ExpandedClass:c?" expanded":"",ChildrenHTML:u};r+=this.pict.parseTemplateByHash("FileBrowser-BrowseTree-Node-Template",v)}return r}toggleNode(t){if(this.expandedPaths[t]=!this.expandedPaths[t],this.expandedPaths[t]){let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){e.getChildFolders(t)||"function"==typeof this.onRequestChildren&&this.onRequestChildren(t)}}this.rebuildTree()}onRequestChildren(t){}selectFolder(t){this.expandedPaths[t]=!0;let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){e.getChildFolders(t)||"function"==typeof this.onRequestChildren&&this.onRequestChildren(t),e.navigateToFolder(t)}this.rebuildTree()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=o},{"pict-view":52}],39:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ListDetail",DefaultRenderable:"ListDetail-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ListPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ListDetail-Container-Template",Template:'\n<div class="pict-fb-detail" id="Pict-FileBrowser-DetailList">\n\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-Breadcrumb"></div>\n\t<div class="pict-fb-detail-header">\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-name" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Name\')">Name</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-size" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Size\')">Size</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-modified" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Modified\')">Modified</div>\n\t</div>\n\t<div id="Pict-FileBrowser-DetailRows"></div>\n</div>\n'},{Hash:"FileBrowser-ListDetail-Row-Template",Template:'\n<div class="pict-fb-detail-row{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<span class="pict-fb-detail-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-detail-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-detail-size">{~D:Record.SizeFormatted~}</span>\n\t<span class="pict-fb-detail-modified">{~D:Record.ModifiedFormatted~}</span>\n</div>\n'},{Hash:"FileBrowser-ListDetail-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'},{Hash:"FileBrowser-Breadcrumb-Segment-Template",Template:'<span class="pict-fb-breadcrumb-segment" onclick="{~D:Record.ClickHandler~}">{~D:Record.Label~}</span>'},{Hash:"FileBrowser-Breadcrumb-Separator-Template",Template:'<span class="pict-fb-breadcrumb-separator">/</span>'},{Hash:"FileBrowser-Breadcrumb-Current-Template",Template:'<span class="pict-fb-breadcrumb-current">{~D:Record.Label~}</span>'}],Renderables:[{RenderableHash:"ListDetail-Container",TemplateHash:"FileBrowser-ListDetail-Container-Template",DestinationAddress:"#Pict-FileBrowser-ListPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this._cachedFileList=[]}onAfterRender(t){let e=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Container-Template",{ViewHash:this.Hash});return this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ListPane",e),this.rebuildList(),this.rebuildBreadcrumb(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildList(){let t=this.pict.providers["Pict-FileBrowser-List"];if(!t)return;let e=t.getSortedFileList();this._cachedFileList=e;let i=t.getSelectedFile();if(0===e.length){let t=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Empty-Template",{Message:"This folder is empty"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-DetailRows",t)}let n="";for(let o=0;o<e.length;o++){let r=e[o],s=i&&i.Name===r.Name&&i.Path===r.Path,a={Index:o,Name:r.Name,Icon:t.getEntryIcon(r),SizeFormatted:"folder"===r.Type?"--":t.formatFileSize(r.Size),ModifiedFormatted:t.formatDate(r.Modified),SelectedClass:s?" selected":"",ClickHandler:"pict.views['"+this.Hash+"'].selectEntry("+o+")",DblClickHandler:"pict.views['"+this.Hash+"'].openEntry("+o+")"};n+=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Row-Template",a)}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-DetailRows",n)}rebuildBreadcrumb(){let t=this.getCurrentLocation(),e="",i=this.pict.providers["Pict-FileBrowser-Icons"],n=i?i.getIcon("home",16):"🏠";if(e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:n,ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('')"}),t){let i=t.split("/"),n="";for(let t=0;t<i.length;t++)if(n=n?n+"/"+i[t]:i[t],e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Separator-Template",{}),t===i.length-1)e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Current-Template",{Label:i[t]});else{let o=n;e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:i[t],ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('"+o+"')"})}}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-Breadcrumb",e)}selectEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.selectFile(this._cachedFileList[t]),this.rebuildList()}openEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.openEntry(this._cachedFileList[t]),this.rebuildList(),this.rebuildBreadcrumb()}sortBy(t){let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.setSortField(t),this.rebuildList()}navigateToPath(t){let e=this.pict.providers["Pict-FileBrowser-Browse"];e&&e.navigateToFolder(t),this.rebuildList(),this.rebuildBreadcrumb()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=o},{"pict-view":52}],40:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ListIcons",DefaultRenderable:"ListIcons-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ListPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ListIcons-Container-Template",Template:'\n<div id="Pict-FileBrowser-IconList">\n\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-IconBreadcrumb"></div>\n\t<div class="pict-fb-icons" id="Pict-FileBrowser-IconGrid"></div>\n</div>\n'},{Hash:"FileBrowser-ListIcons-Item-Template",Template:'\n<div class="pict-fb-icon-item{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<div class="pict-fb-icon-graphic">{~D:Record.Icon~}</div>\n\t<div class="pict-fb-icon-label">{~D:Record.Name~}</div>\n</div>\n'},{Hash:"FileBrowser-ListIcons-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"ListIcons-Container",TemplateHash:"FileBrowser-ListIcons-Container-Template",DestinationAddress:"#Pict-FileBrowser-ListPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this._cachedFileList=[]}onAfterRender(t){return this.rebuildGrid(),this.rebuildBreadcrumb(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildGrid(){let t=this.pict.providers["Pict-FileBrowser-List"];if(!t)return;let e=t.getSortedFileList();this._cachedFileList=e;let i=t.getSelectedFile();if(0===e.length){let t=this.pict.parseTemplateByHash("FileBrowser-ListIcons-Empty-Template",{Message:"This folder is empty"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconGrid",t)}let n="";for(let o=0;o<e.length;o++){let r=e[o],s=i&&i.Name===r.Name&&i.Path===r.Path,a={Index:o,Name:r.Name,Icon:t.getEntryIcon(r),SelectedClass:s?" selected":"",ClickHandler:"pict.views['"+this.Hash+"'].selectEntry("+o+")",DblClickHandler:"pict.views['"+this.Hash+"'].openEntry("+o+")"};n+=this.pict.parseTemplateByHash("FileBrowser-ListIcons-Item-Template",a)}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconGrid",n)}rebuildBreadcrumb(){let t=this.getCurrentLocation(),e="";if(e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:"🏠",ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('')"}),t){let i=t.split("/"),n="";for(let t=0;t<i.length;t++)if(n=n?n+"/"+i[t]:i[t],e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Separator-Template",{}),t===i.length-1)e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Current-Template",{Label:i[t]});else{let o=n;e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:i[t],ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('"+o+"')"})}}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconBreadcrumb",e)}selectEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.selectFile(this._cachedFileList[t]),this.rebuildGrid()}openEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.openEntry(this._cachedFileList[t]),this.rebuildGrid(),this.rebuildBreadcrumb()}navigateToPath(t){let e=this.pict.providers["Pict-FileBrowser-Browse"];e&&e.navigateToFolder(t),this.rebuildGrid(),this.rebuildBreadcrumb()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=o},{"pict-view":52}],41:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ViewFileInfo",DefaultRenderable:"ViewFileInfo-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ViewPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ViewFileInfo-Container-Template",Template:'<div class="pict-fb-fileinfo" id="Pict-FileBrowser-FileInfo"></div>'},{Hash:"FileBrowser-ViewFileInfo-Detail-Template",Template:'\n<div class="pict-fb-fileinfo-title">{~D:Record.Name~}</div>\n<table class="pict-fb-fileinfo-table">\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Type</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.TypeDescription~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Size</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.SizeFormatted~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Modified</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.ModifiedFormatted~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Extension</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.Extension~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Path</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.Path~}</td>\n\t</tr>\n</table>\n'},{Hash:"FileBrowser-ViewFileInfo-Empty-Template",Template:'<div class="pict-fb-fileinfo-none">No file selected</div>'}],Renderables:[{RenderableHash:"ViewFileInfo-Container",TemplateHash:"FileBrowser-ViewFileInfo-Container-Template",DestinationAddress:"#Pict-FileBrowser-ViewPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i)}onAfterRender(t){return this.rebuildFileInfo(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildFileInfo(){let t=this.pict.providers["Pict-FileBrowser-View"],e=this.pict.providers["Pict-FileBrowser-List"],i=t?t.getCurrentFile():null;if(!i){let t=this.pict.parseTemplateByHash("FileBrowser-ViewFileInfo-Empty-Template",{});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-FileInfo",t)}let n={Name:i.Name||"Unknown",TypeDescription:t?t.getFileTypeDescription(i):"File",SizeFormatted:e?e.formatFileSize(i.Size):i.Size||"--",ModifiedFormatted:e?e.formatDate(i.Modified):i.Modified||"--",Extension:i.Extension||"--",Path:i.Path||"--"},o=this.pict.parseTemplateByHash("FileBrowser-ViewFileInfo-Detail-Template",n);this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-FileInfo",o)}},e.exports.default_configuration=o},{"pict-view":52}],42:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ViewImage",DefaultRenderable:"ViewImage-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ViewPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ViewImage-Container-Template",Template:'<div class="pict-fb-image-viewer" id="Pict-FileBrowser-ImageViewer"></div>'},{Hash:"FileBrowser-ViewImage-Display-Template",Template:'<img src="{~D:Record.ImageURL~}" alt="{~D:Record.Name~}" />'},{Hash:"FileBrowser-ViewImage-NoImage-Template",Template:'<div class="pict-fb-image-viewer-none">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"ViewImage-Container",TemplateHash:"FileBrowser-ViewImage-Container-Template",DestinationAddress:"#Pict-FileBrowser-ViewPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i)}onAfterRender(t){return this.rebuildImageView(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildImageView(){let t=this.pict.providers["Pict-FileBrowser-View"],e=t?t.getCurrentFile():null;if(!e){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"No file selected"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}if(!(!!t&&t.isImage(e))){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"Selected file is not an image"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}let i=t?t.getImageURL(e):null;if(!i){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"No image URL available"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}let n=this.pict.parseTemplateByHash("FileBrowser-ViewImage-Display-Template",{ImageURL:i,Name:e.Name||"Image"});this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",n)}},e.exports.default_configuration=o},{"pict-view":52}],43:[function(t,e,i){const n=t("pict-view"),o=t("../Pict-Section-FileBrowser-DefaultConfiguration.js"),r=t("../providers/Pict-Provider-FileBrowserBrowse.js"),s=t("../providers/Pict-Provider-FileBrowserList.js"),a=t("../providers/Pict-Provider-FileBrowserView.js"),l=t("../providers/Pict-Provider-FileBrowserLayout.js"),c=t("../providers/Pict-Provider-FileBrowserIcons.js");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(o)),e),i),this.pict.providers["Pict-FileBrowser-Browse"]||this.pict.addProvider("Pict-FileBrowser-Browse",r.default_configuration,r),this.pict.providers["Pict-FileBrowser-List"]||this.pict.addProvider("Pict-FileBrowser-List",s.default_configuration,s),this.pict.providers["Pict-FileBrowser-View"]||this.pict.addProvider("Pict-FileBrowser-View",a.default_configuration,a),this.pict.providers["Pict-FileBrowser-Layout"]||this.pict.addProvider("Pict-FileBrowser-Layout",l.default_configuration,l),this.pict.providers["Pict-FileBrowser-Icons"]||this.pict.addProvider("Pict-FileBrowser-Icons",c.default_configuration,c),this.ensureDefaultState()}ensureDefaultState(){let t=this.options.DefaultState||{},e=this.options.StateAddresses||{},i={AppData:this.pict.AppData,Pict:this.pict};this.pict.AppData.PictFileBrowser||(this.pict.AppData.PictFileBrowser={});for(let n in e){let o=e[n],r=this.pict.manifest.getValueByHash(i,o);if(null==r){let e=t[n];void 0!==e&&this.pict.manifest.setValueByHash(i,o,e)}}this.pict.AppData.PictFileBrowser.FileList||(this.pict.AppData.PictFileBrowser.FileList=[]),this.pict.AppData.PictFileBrowser.FolderTree||(this.pict.AppData.PictFileBrowser.FolderTree=[])}onAfterRender(t){return this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}getState(t){let e=(this.options.StateAddresses||{})[t];if(e)return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},e)}setState(t,e){let i=(this.options.StateAddresses||{})[t];i&&this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,e)}},e.exports.default_configuration=o},{"../Pict-Section-FileBrowser-DefaultConfiguration.js":29,"../providers/Pict-Provider-FileBrowserBrowse.js":31,"../providers/Pict-Provider-FileBrowserIcons.js":32,"../providers/Pict-Provider-FileBrowserLayout.js":33,"../providers/Pict-Provider-FileBrowserList.js":34,"../providers/Pict-Provider-FileBrowserView.js":35,"pict-view":52}],44:[function(t,e,i){e.exports.attach=function(t){t._createEditorInContainer=function(e,i,n){let o=t._codeMirrorModules,r=[];o.extensions&&Array.isArray(o.extensions)&&(r=r.concat(o.extensions)),r.push(o.EditorView.updateListener.of(e=>{e.docChanged&&t._onSegmentContentChange(i,e.state.doc.toString()),e.focusChanged&&(e.view.hasFocus?(t._setActiveSegment(i),t._updateSidebarPosition(i)):setTimeout(()=>{if(t._activeSegmentIndex===i){let e=document.getElementById("PictMDE-Segment-".concat(i));e&&!e.contains(document.activeElement)&&(t._clearActiveSegment(i),t._resetSidebarPosition(i))}},100)),e.selectionSet&&e.view.hasFocus&&t._updateSidebarPosition(i)})),r.push(o.EditorView.domEventHandlers({keydown:(e,n)=>(e.ctrlKey||e.metaKey)&&"b"===e.key?(e.preventDefault(),t.applyFormatting(i,"bold"),!0):(e.ctrlKey||e.metaKey)&&"i"===e.key?(e.preventDefault(),t.applyFormatting(i,"italic"),!0):(e.ctrlKey||e.metaKey)&&"e"===e.key?(e.preventDefault(),t.applyFormatting(i,"code"),!0):void 0,paste:(e,n)=>{let o=e.clipboardData&&e.clipboardData.items;if(!o)return!1;for(let n=0;n<o.length;n++)if(o[n].type.startsWith("image/")){e.preventDefault();let r=o[n].getAsFile();return r&&t._processImageFile(r,i),!0}return!1}}));let s=t._buildDataURICollapseExtension();s&&r.push(s),t.options.ReadOnly&&(r.push(o.EditorState.readOnly.of(!0)),r.push(o.EditorView.editable.of(!1))),r=t.customConfigureExtensions(r,i);let a=o.EditorState.create({doc:n||"",extensions:r}),l=new o.EditorView({state:a,parent:e});t._segmentEditors[i]=l},t._buildDataURICollapseExtension=function(){let e=t._codeMirrorModules;if(!(e&&e.Decoration&&e.ViewPlugin&&e.WidgetType))return null;let i=e.Decoration,n=e.ViewPlugin,o=e.WidgetType;class r extends o{constructor(t){super(),this.label=t}toDOM(){let t=document.createElement("span");return t.className="pict-mde-data-uri-collapsed",t.textContent=this.label,t.title="Data URI (click to expand in image preview below)",t}eq(t){return this.label===t.label}}function s(t){let e=[],n=t.state.doc;for(let o of t.visibleRanges){let t,s=o.from,a=o.to,l=n.sliceString(s,a),c=/!\[[^\]]*\]\(data:([^;]+);base64,/g;for(;null!==(t=c.exec(l));){let o=s+t.index+t[0].length,a=-1,l=o,c=n.length,d=Math.min(c,l+5242880),p=4096;for(let t=l;t<d;t+=p){let e=Math.min(t+p,d),i=n.sliceString(t,e).indexOf(")");if(i>=0){a=t+i;break}}if(a<0)continue;let h=a-o;if(h<200)continue;let u,f=Math.round(.75*h);u=f>=1048576?(f/1048576).toFixed(1)+"MB":f>=1024?Math.round(f/1024)+"KB":f+"B";t[1];let m="…".concat(u,")"),g=i.replace({widget:new r(m)});e.push(g.range(o,a+1))}}return i.set(e,!0)}return n.fromClass(class{constructor(t){this.decorations=s(t)}update(t){(t.docChanged||t.viewportChanged)&&(this.decorations=s(t.view))}},{decorations:t=>t.decorations})}}},{}],45:[function(t,e,i){e.exports.attach=function(t){t._wireSegmentDragEvents=function(e,i){let n=e.querySelector(".pict-mde-drag-handle");n&&(n.addEventListener("dragstart",n=>{t._dragSourceIndex=i,n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",String(i));let o=t._getContainerElement();o&&o.classList.add("pict-mde-dragging"),setTimeout(()=>{e.style.opacity="0.4"},0)}),n.addEventListener("dragend",()=>{e.style.opacity="",t._dragSourceIndex=-1,t._clearAllDropIndicators();let i=t._getContainerElement();i&&i.classList.remove("pict-mde-dragging")}),e.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer.dropEffect="move",t._clearAllDropIndicators();let n=e.getBoundingClientRect(),o=n.top+n.height/2;i.clientY<o?e.classList.add("pict-mde-drag-over-top"):e.classList.add("pict-mde-drag-over-bottom")}),e.addEventListener("dragleave",t=>{e.contains(t.relatedTarget)||(e.classList.remove("pict-mde-drag-over-top"),e.classList.remove("pict-mde-drag-over-bottom"))}),e.addEventListener("drop",n=>{n.preventDefault();let o=e.classList.contains("pict-mde-drag-over-bottom");t._clearAllDropIndicators();let r=t._dragSourceIndex;r<0||r===i||t._reorderSegment(r,i,o)}))},t._clearAllDropIndicators=function(){let e=t._getContainerElement();if(!e)return;let i=e.querySelectorAll(".pict-mde-segment");for(let t=0;t<i.length;t++)i[t].classList.remove("pict-mde-drag-over-top"),i[t].classList.remove("pict-mde-drag-over-bottom")},t._reorderSegment=function(e,i,n){let o=t._getLogicalIndex(e),r=t._getLogicalIndex(i);if(o<0||r<0)return void t.log.warn("PICT-MarkdownEditor _reorderSegment: could not resolve logical indices (from=".concat(o,", to=").concat(r,")."));if(o===r)return;t._marshalAllEditorsToData();let s=t._getSegmentsFromData();if(!s||s.length<2)return;let a=n?r+1:r;if(o<a&&a--,a===o)return;let l=s.splice(o,1)[0];s.splice(a,0,l),t._setSegmentsToData(s),t._reorderHiddenPreviewState(o,a),t._buildEditorUI()},t._reorderHiddenPreviewState=function(e,i){if(e===i)return;let n=Object.keys(t._hiddenPreviewSegments).map(t=>parseInt(t,10));if(0===n.length)return;let o=Math.max(...n,e,i),r=[];for(let e=0;e<=o;e++)r.push(!!t._hiddenPreviewSegments[e]);let s=r.splice(e,1)[0];r.splice(i,0,s),t._hiddenPreviewSegments={};for(let e=0;e<r.length;e++)r[e]&&(t._hiddenPreviewSegments[e]=!0)},t._swapHiddenPreviewState=function(e,i){let n=!!t._hiddenPreviewSegments[e];!!t._hiddenPreviewSegments[i]?t._hiddenPreviewSegments[e]=!0:delete t._hiddenPreviewSegments[e],n?t._hiddenPreviewSegments[i]=!0:delete t._hiddenPreviewSegments[i]},t._setActiveSegment=function(e){if(t._activeSegmentIndex>=0&&t._activeSegmentIndex!==e){let e=document.getElementById("PictMDE-Segment-".concat(t._activeSegmentIndex));e&&e.classList.remove("pict-mde-active")}t._activeSegmentIndex=e;let i=document.getElementById("PictMDE-Segment-".concat(e));i&&i.classList.add("pict-mde-active")},t._clearActiveSegment=function(e){t._activeSegmentIndex===e&&(t._activeSegmentIndex=-1);let i=document.getElementById("PictMDE-Segment-".concat(e));i&&i.classList.remove("pict-mde-active"),t._resetSidebarPosition(e)},t._updateSidebarPosition=function(e){let i=document.getElementById("PictMDE-Segment-".concat(e));if(!i)return;let n=i.querySelector(".pict-mde-quadrant-tr");if(!n)return;let o=t._segmentEditors[e];if(!o)return;let r=o.state.selection.main.head,s=o.coordsAtPos(r);if(!s)return void t._resetSidebarPosition(e);let a=i.getBoundingClientRect(),l=s.top-a.top,c=n.offsetHeight||0,d=i.offsetHeight||0,p=Math.max(0,d-c);l=Math.max(0,Math.min(l,p)),n.classList.add("pict-mde-sidebar-at-cursor"),n.style.setProperty("--pict-mde-sidebar-top","".concat(l,"px"))},t._resetSidebarPosition=function(t){let e=document.getElementById("PictMDE-Segment-".concat(t));if(!e)return;let i=e.querySelector(".pict-mde-quadrant-tr");i&&(i.classList.remove("pict-mde-sidebar-at-cursor"),i.style.removeProperty("--pict-mde-sidebar-top"))}}},{}],46:[function(t,e,i){const n={bold:{wrap:"**"},italic:{wrap:"*"},code:{wrap:"`"},heading:{prefix:"# "},link:{before:"[",after:"](url)"}};e.exports.attach=function(t){t.applyFormatting=function(e,i){let o=t._segmentEditors[e];if(!o)return void t.log.warn("PICT-MarkdownEditor applyFormatting: no editor for segment ".concat(e,"."));let r=n[i];if(!r)return void t.log.warn('PICT-MarkdownEditor applyFormatting: unknown format type "'.concat(i,'".'));let s,a,l=o.state,c=l.selection.main,d=c.from,p=c.to,h=d!==p,u=h?l.sliceDoc(d,p):"";if(r.wrap){let t=r.wrap;if(h){let e=l.sliceDoc(Math.max(0,d-t.length),d),i=l.sliceDoc(p,Math.min(l.doc.length,p+t.length));if(e===t&&i===t)return s=[{from:d-t.length,to:d,insert:""},{from:p,to:p+t.length,insert:""}],a=d-t.length,void o.dispatch({changes:s,selection:{anchor:a,head:a+u.length}});s={from:d,to:p,insert:t+u+t},a=d+t.length,o.dispatch({changes:s,selection:{anchor:a,head:a+u.length}})}else{s={from:d,insert:t+t},a=d+t.length,o.dispatch({changes:s,selection:{anchor:a}})}}else if(r.prefix){let t=l.doc.lineAt(d);s=t.text.startsWith(r.prefix)?{from:t.from,to:t.from+r.prefix.length,insert:""}:{from:t.from,insert:r.prefix},o.dispatch({changes:s})}else if(r.before&&r.after)if(h){s={from:d,to:p,insert:r.before+u+r.after},a=d+r.before.length+u.length+2,o.dispatch({changes:s,selection:{anchor:a,head:a+3}})}else{s={from:d,insert:r.before+r.after},a=d+r.before.length,o.dispatch({changes:s,selection:{anchor:a}})}o.focus()}}},{}],47:[function(t,e,i){e.exports.attach=function(t){t.openImagePicker=function(e){let i=document.getElementById("PictMDE-ImageInput-".concat(e));i?(i.onchange=()=>{i.files&&i.files.length>0&&t._processImageFile(i.files[0],e),i.value=""},i.click()):t.log.warn("PICT-MarkdownEditor openImagePicker: file input not found for segment ".concat(e,"."))},t._processImageFile=function(e,i){if(!e||!e.type||!e.type.startsWith("image/"))return void t.log.warn("PICT-MarkdownEditor _processImageFile: not an image file (type: ".concat(e?e.type:"null",")."));let n=e.name?e.name.replace(/\.[^.]+$/,""):"image";if(t.onImageUpload(e,i,(e,o)=>{e?t.log.error("PICT-MarkdownEditor image upload error: ".concat(e)):o&&t._insertImageMarkdown(i,o,n)}))return;if("undefined"==typeof FileReader)return void t.log.error("PICT-MarkdownEditor _processImageFile: FileReader not available in this environment.");let o=new FileReader;o.onload=()=>{t._insertImageMarkdown(i,o.result,n)},o.onerror=()=>{t.log.error("PICT-MarkdownEditor _processImageFile: FileReader error.")},o.readAsDataURL(e)},t._insertImageMarkdown=function(e,i,n){let o=t._segmentEditors[e];if(!o)return void t.log.warn("PICT-MarkdownEditor _insertImageMarkdown: no editor for segment ".concat(e,"."));let r="![".concat(n||"image","](").concat(i,")"),s=o.state.selection.main.head;o.dispatch({changes:{from:s,insert:r},selection:{anchor:s+r.length}}),o.focus(),t._updateImagePreviews(e)},t._updateImagePreviews=function(e){let i=document.getElementById("PictMDE-ImagePreview-".concat(e));if(!i)return;let n=t._segmentEditors[e];if(!n)return i.innerHTML="",void i.classList.remove("pict-mde-has-images");let o,r=n.state.doc.toString(),s=/!\[([^\]]*)\]\(([^)]+)\)/g,a=[];for(;null!==(o=s.exec(r));)a.push({alt:o[1]||"image",url:o[2]});if(0===a.length)return i.innerHTML="",void i.classList.remove("pict-mde-has-images");let l="";for(let t=0;t<a.length;t++){let e=a[t].alt.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),i=a[t].url.replace(/&/g,"&amp;").replace(/"/g,"&quot;");l+='<div class="pict-mde-image-preview-item"><img src="'.concat(i,'" alt="').concat(e,'" /><span class="pict-mde-image-preview-label">').concat(e,"</span></div>")}i.innerHTML=l,i.classList.add("pict-mde-has-images")},t._wireImageDragEvents=function(e,i){e.addEventListener("dragover",i=>{t._dragSourceIndex>=0||!i.dataTransfer||!i.dataTransfer.types||i.dataTransfer.types.indexOf("Files")<0||(i.preventDefault(),i.dataTransfer.dropEffect="copy",e.classList.add("pict-mde-image-dragover"))}),e.addEventListener("dragleave",t=>{e.contains(t.relatedTarget)||e.classList.remove("pict-mde-image-dragover")}),e.addEventListener("drop",n=>{if(e.classList.remove("pict-mde-image-dragover"),t._dragSourceIndex>=0)return;if(!n.dataTransfer||!n.dataTransfer.files||n.dataTransfer.files.length<1)return;let o=n.dataTransfer.files[0];o.type&&o.type.startsWith("image/")&&(n.preventDefault(),n.stopPropagation(),t._processImageFile(o,i))})}}},{}],48:[function(t,e,i){const n=t("pict-section-content").PictContentProvider;e.exports.attach=function(t){t._getContentProvider=function(){return t._contentProvider||(t._contentProvider=new n(t.fable,{},"Pict-Content-Provider-MDE")),t._contentProvider},t._updateRichPreviews=function(e){if(!t.options.EnableRichPreview)return;let i=document.getElementById("PictMDE-RichPreview-".concat(e));if(!i)return;let n=t._segmentEditors[e];if(!n)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let o=n.state.doc.toString();if(!o||0===o.trim().length)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let r=t._getContentProvider().parseMarkdown(o);if(!r||0===r.trim().length)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let s="PictMDE-RichPreviewBody-".concat(e);i.innerHTML='<div class="pict-content" id="'.concat(s,'">').concat(r,"</div>"),i.classList.add("pict-mde-has-rich-preview");let a=(t._richPreviewGenerations[e]||0)+1;t._richPreviewGenerations[e]=a,t._postRenderMermaid(s,e,a),t._postRenderKaTeX(s)},t._postRenderMermaid=function(e,i,n){if("undefined"==typeof mermaid)return;let o=document.getElementById(e);if(!o)return;let r=o.querySelectorAll("pre.mermaid");if(!(r.length<1))try{let e=mermaid.run({nodes:r});e&&"function"==typeof e.catch&&e.catch(e=>{(-1===i?t._renderedViewGeneration:t._richPreviewGenerations[i])===n&&t.log.warn("PICT-MarkdownEditor mermaid render error: ".concat(e.message||e))})}catch(e){t.log.warn("PICT-MarkdownEditor mermaid render error: ".concat(e.message||e))}},t._postRenderKaTeX=function(e){if("undefined"==typeof katex)return;let i=document.getElementById(e);if(!i)return;let n=i.querySelectorAll(".pict-content-katex-inline");for(let e=0;e<n.length;e++)try{katex.render(n[e].textContent,n[e],{throwOnError:!1,displayMode:!1})}catch(e){t.log.warn("PICT-MarkdownEditor KaTeX inline error: ".concat(e.message||e))}let o=i.querySelectorAll(".pict-content-katex-display");for(let e=0;e<o.length;e++)try{katex.render(o[e].textContent,o[e],{throwOnError:!1,displayMode:!0})}catch(e){t.log.warn("PICT-MarkdownEditor KaTeX display error: ".concat(e.message||e))}},t._escapeHTMLForPreview=function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},t.toggleRenderedView=function(e){t._renderedViewActive="boolean"==typeof e?e:!t._renderedViewActive,t._renderedViewActive?t._renderRenderedView():t._restoreEditingView()},t._renderRenderedView=function(){let e=t._getContainerElement();if(!e)return;t._marshalAllEditorsToData();let i=t._getSegmentsFromData(),n="";if(i&&i.length>0){let t=[];for(let e=0;e<i.length;e++)t.push(i[e].Content||"");n=t.join("\n\n")}for(let e in t._segmentEditors)t._segmentEditors[e]&&t._segmentEditors[e].destroy();t._segmentEditors={};let o=t._getContentProvider().parseMarkdown(n),r="PictMDE-RenderedView";e.innerHTML='<div class="pict-mde-rendered-view" id="'.concat(r,'"><div class="pict-content">').concat(o||"","</div></div>"),e.classList.add("pict-mde-rendered-mode"),t._renderedViewGeneration++;let s=t._renderedViewGeneration,a=e.querySelector("#".concat(r," .pict-content"));if(a){let e="PictMDE-RenderedViewContent";a.id=e,t._postRenderMermaid(e,-1,s),t._postRenderKaTeX(e)}},t._restoreEditingView=function(){let e=t._getContainerElement();e&&(e.classList.remove("pict-mde-rendered-mode"),t._buildEditorUI())}}},{"pict-section-content":26}],49:[function(t,e,i){e.exports={DefaultRenderable:"MarkdownEditor-Wrap",DefaultDestinationAddress:"#MarkdownEditor-Container-Div",Templates:[{Hash:"MarkdownEditor-Container",Template:'<div class="pict-mde" id="PictMDE-Container"></div>'},{Hash:"MarkdownEditor-Segment",Template:'<div class="pict-mde-segment" id="PictMDE-Segment-{~D:Record.SegmentIndex~}" data-segment-index="{~D:Record.SegmentIndex~}">\n\t<div class="pict-mde-left-controls">\n\t\t<div class="pict-mde-quadrant-tl"></div>\n\t\t<div class="pict-mde-quadrant-bl"></div>\n\t</div>\n\t<div class="pict-mde-drag-handle" draggable="true" title="Drag to reorder"></div>\n\t<div class="pict-mde-segment-body">\n\t\t<div class="pict-mde-segment-editor" id="PictMDE-SegmentEditor-{~D:Record.SegmentIndex~}"></div>\n\t\t<div class="pict-mde-image-preview" id="PictMDE-ImagePreview-{~D:Record.SegmentIndex~}"></div>\n\t\t<div class="pict-mde-rich-preview" id="PictMDE-RichPreview-{~D:Record.SegmentIndex~}"></div>\n\t</div>\n\t<div class="pict-mde-sidebar" id="PictMDE-Sidebar-{~D:Record.SegmentIndex~}">\n\t\t<div class="pict-mde-quadrant-tr"></div>\n\t\t<div class="pict-mde-quadrant-br"></div>\n\t\t<input type="file" accept="image/*" class="pict-mde-image-input" id="PictMDE-ImageInput-{~D:Record.SegmentIndex~}" style="display:none" />\n\t</div>\n</div>'},{Hash:"MarkdownEditor-AddSegment",Template:'<div class="pict-mde-add-segment">\n\t<button type="button" class="pict-mde-btn-add" onclick="{~D:Record.ViewIdentifier~}.addSegment()">+ Add Segment</button>\n</div>'}],Renderables:[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",DestinationAddress:"#MarkdownEditor-Container-Div"}],TargetElementAddress:"#MarkdownEditor-Container-Div",ContentDataAddress:!1,ReadOnly:!1,EnableRichPreview:!0,ButtonsTL:[{HTML:"&times;",Action:"removeSegment",Class:"pict-mde-btn-remove",Title:"Remove Segment"}],ButtonsBL:[{HTML:"&uarr;",Action:"moveSegmentUp",Class:"pict-mde-btn-move",Title:"Move Up"},{HTML:"&darr;",Action:"moveSegmentDown",Class:"pict-mde-btn-move",Title:"Move Down"},{HTML:"&#x229E;",Action:"toggleControls",Class:"pict-mde-btn-linenums",Title:"Toggle Controls"},{HTML:"&#x25CE;",Action:"toggleSegmentPreview",Class:"pict-mde-btn-preview",Title:"Toggle Preview"}],ButtonsTR:[{HTML:"<b>B</b>",Action:"applyFormatting:bold",Class:"",Title:"Bold (Ctrl+B)"},{HTML:"<i>I</i>",Action:"applyFormatting:italic",Class:"",Title:"Italic (Ctrl+I)"},{HTML:"<code>&lt;&gt;</code>",Action:"applyFormatting:code",Class:"",Title:"Inline Code (Ctrl+E)"},{HTML:"#",Action:"applyFormatting:heading",Class:"",Title:"Heading"},{HTML:"[&thinsp;]",Action:"applyFormatting:link",Class:"",Title:"Link"},{HTML:"&#x25A3;",Action:"openImagePicker",Class:"pict-mde-sidebar-btn-image",Title:"Insert Image"}],ButtonsBR:[],CSS:"\n/* ---- Container ---- */\n.pict-mde\n{\n\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n\tfont-size: 14px;\n}\n\n/* ---- Segment row: left-controls | drag-handle | editor body | sidebar ---- */\n.pict-mde-segment\n{\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: stretch;\n\tmargin-bottom: 6px;\n\tmin-height: 48px;\n\ttransition: background-color 0.15s ease;\n}\n\n/* ---- Left controls column ---- */\n.pict-mde-left-controls\n{\n\tflex: 0 0 22px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 2px 0;\n}\n\n/* ---- Left-side quadrants ---- */\n.pict-mde-quadrant-tl\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tposition: sticky;\n\ttop: 2px;\n\tz-index: 2;\n}\n.pict-mde-quadrant-bl\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tposition: sticky;\n\tbottom: 2px;\n\tz-index: 2;\n}\n\n/* ---- Left-side buttons (shared base) ---- */\n.pict-mde-left-btn\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 20px;\n\theight: 20px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tpadding: 0;\n\tcolor: #888;\n\tline-height: 1;\n\tfont-family: inherit;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n}\n.pict-mde-segment:hover .pict-mde-left-btn,\n.pict-mde-segment.pict-mde-active .pict-mde-left-btn\n{\n\topacity: 1;\n}\n.pict-mde-left-btn:hover\n{\n\tcolor: #222;\n}\n.pict-mde-btn-remove:hover\n{\n\tcolor: #CC3333;\n}\n.pict-mde-btn-linenums\n{\n\tfont-size: 11px;\n\tfont-weight: 600;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n}\n/* Highlight when controls are active */\n.pict-mde.pict-mde-controls-on .pict-mde-btn-linenums\n{\n\tcolor: #4A90D9;\n}\n.pict-mde-btn-preview\n{\n\tfont-size: 11px;\n}\n/* Highlight the preview button when preview is visible (not hidden) */\n.pict-mde-segment:not(.pict-mde-preview-hidden) .pict-mde-btn-preview\n{\n\tcolor: #4A90D9;\n}\n/* Dim preview button when this segment's preview is individually hidden */\n.pict-mde-segment.pict-mde-preview-hidden .pict-mde-btn-preview\n{\n\tcolor: #CCC;\n}\n\n/* ---- Drag handle (simple grey bar) ---- */\n.pict-mde-drag-handle\n{\n\tflex: 0 0 8px;\n\tcursor: grab;\n\tbackground: #EDEDED;\n\ttransition: background-color 0.15s ease;\n\tuser-select: none;\n}\n.pict-mde-drag-handle:active\n{\n\tcursor: grabbing;\n}\n.pict-mde-drag-handle:hover\n{\n\tbackground: #C8C8C8;\n}\n\n/* ---- Editor body (middle column) ---- */\n.pict-mde-segment-body\n{\n\tflex: 1 1 auto;\n\tmin-width: 0;\n\tbackground: #FFFFFF;\n\ttransition: background-color 0.15s ease;\n}\n.pict-mde-segment-editor\n{\n\tmin-height: 48px;\n}\n\n/* ---- Image preview area below the editor ---- */\n.pict-mde-image-preview\n{\n\tdisplay: none;\n}\n.pict-mde-image-preview.pict-mde-has-images\n{\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tborder-top: 1px solid #EDEDED;\n}\n.pict-mde-image-preview img\n{\n\tmax-width: 200px;\n\tmax-height: 150px;\n\tborder-radius: 3px;\n\tborder: 1px solid #E0E0E0;\n\tobject-fit: contain;\n\tbackground: #F8F8F8;\n}\n.pict-mde-image-preview-item\n{\n\tposition: relative;\n\tdisplay: inline-block;\n}\n.pict-mde-image-preview-label\n{\n\tdisplay: block;\n\tfont-size: 10px;\n\tcolor: #999;\n\tmargin-top: 2px;\n\tmax-width: 200px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n/* ---- Rich content preview area (rendered via pict-section-content) ---- */\n.pict-mde-rich-preview\n{\n\tdisplay: none;\n}\n.pict-mde-rich-preview.pict-mde-has-rich-preview\n{\n\tdisplay: block;\n\tborder-top: 1px solid #EDEDED;\n\tbackground: #FCFCFC;\n}\n/* Global preview toggle: hide all previews when container has class */\n.pict-mde.pict-mde-previews-hidden .pict-mde-rich-preview.pict-mde-has-rich-preview,\n.pict-mde.pict-mde-previews-hidden .pict-mde-image-preview.pict-mde-has-images\n{\n\tdisplay: none;\n}\n/* Per-segment preview toggle: hide previews for a specific segment */\n.pict-mde-segment.pict-mde-preview-hidden .pict-mde-rich-preview.pict-mde-has-rich-preview,\n.pict-mde-segment.pict-mde-preview-hidden .pict-mde-image-preview.pict-mde-has-images\n{\n\tdisplay: none;\n}\n/* Constrain the pict-content inside the preview to fit the segment */\n.pict-mde-rich-preview .pict-content\n{\n\tpadding: 12px;\n\tmax-width: none;\n\tmargin: 0;\n\tfont-size: 13px;\n}\n/* Reduce heading sizes in the preview to be proportional */\n.pict-mde-rich-preview .pict-content h1\n{\n\tfont-size: 1.4em;\n\tmargin-top: 0;\n}\n.pict-mde-rich-preview .pict-content h2\n{\n\tfont-size: 1.2em;\n\tmargin-top: 0.75em;\n}\n.pict-mde-rich-preview .pict-content h3\n{\n\tfont-size: 1.1em;\n\tmargin-top: 0.6em;\n}\n\n/* ---- Rendered view (full document preview mode) ---- */\n.pict-mde-rendered-view\n{\n\tpadding: 16px 20px;\n\tbackground: #FFFFFF;\n\tmin-height: 120px;\n}\n.pict-mde-rendered-view .pict-content\n{\n\tmax-width: none;\n\tmargin: 0;\n}\n/* Hide the add-segment button in rendered mode */\n.pict-mde.pict-mde-rendered-mode .pict-mde-add-segment\n{\n\tdisplay: none;\n}\n\n/* Focused / active editor gets subtle warm background */\n.pict-mde-segment.pict-mde-active .pict-mde-segment-body\n{\n\tbackground: #FAFAF5;\n}\n.pict-mde-segment.pict-mde-active .pict-mde-drag-handle\n{\n\tbackground: #9CB4C8;\n}\n\n/* ---- Right sidebar column ---- */\n.pict-mde-sidebar\n{\n\tflex: 0 0 30px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n\tjustify-content: space-between;\n\tposition: relative;\n}\n\n/* ---- Right-side quadrants ---- */\n.pict-mde-quadrant-tr\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tpadding: 4px 0;\n\twidth: 100%;\n\topacity: 0;\n\ttransition: opacity 0.15s ease, top 0.1s ease;\n\tposition: sticky;\n\ttop: 0;\n}\n.pict-mde-quadrant-br\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tpadding: 4px 0;\n\twidth: 100%;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n\tposition: sticky;\n\tbottom: 0;\n}\n\n/* Active segment always shows its right-side quadrants */\n.pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n.pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n{\n\topacity: 1;\n}\n/* When no segment is active, hovering shows both left + right controls */\n.pict-mde:not(:has(.pict-mde-active)) .pict-mde-segment:hover .pict-mde-quadrant-tr,\n.pict-mde:not(:has(.pict-mde-active)) .pict-mde-segment:hover .pict-mde-quadrant-br\n{\n\topacity: 1;\n}\n\n/* ---- Controls-hidden mode: right quadrants show faintly on hover ---- */\n.pict-mde.pict-mde-controls-hidden .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-quadrant-br\n{\n\topacity: 0;\n}\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment:hover .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment:hover .pict-mde-quadrant-br\n{\n\topacity: 0.3;\n}\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n{\n\topacity: 0.3;\n}\n\n/* When JS sets a cursor-relative offset, switch TR from sticky to absolute positioning */\n.pict-mde-quadrant-tr.pict-mde-sidebar-at-cursor\n{\n\tposition: absolute;\n\ttop: var(--pict-mde-sidebar-top, 0px);\n}\n\n/* ---- Right-side buttons (shared base) ---- */\n.pict-mde-sidebar-btn\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 22px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tpadding: 0;\n\tborder-radius: 3px;\n\tcolor: #666;\n\tline-height: 1;\n\tfont-family: inherit;\n}\n.pict-mde-sidebar-btn:hover\n{\n\tcolor: #222;\n}\n.pict-mde-sidebar-btn b\n{\n\tfont-size: 13px;\n\tfont-weight: 700;\n}\n.pict-mde-sidebar-btn i\n{\n\tfont-size: 13px;\n\tfont-style: italic;\n}\n.pict-mde-sidebar-btn code\n{\n\tfont-size: 10px;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n}\n\n/* ---- Add segment button ---- */\n.pict-mde-add-segment\n{\n\tmargin-top: 6px;\n\tpadding-left: 30px;\n}\n.pict-mde-btn-add\n{\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 7px;\n\tborder: 2px dashed #D0D0D0;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: #999;\n\tfont-size: 12px;\n\tfont-weight: 600;\n\tcursor: pointer;\n\ttransition: all 0.15s ease;\n}\n.pict-mde-btn-add:hover\n{\n\tborder-color: #4A90D9;\n\tcolor: #4A90D9;\n\tbackground: rgba(74, 144, 217, 0.04);\n}\n\n/* ---- Image drag-over indicator ---- */\n.pict-mde-segment-editor.pict-mde-image-dragover\n{\n\toutline: 2px dashed #4A90D9;\n\toutline-offset: -2px;\n}\n\n/* ---- Drag-in-progress: prevent CodeMirror from intercepting drop events ---- */\n.pict-mde.pict-mde-dragging .pict-mde-segment-editor\n{\n\tpointer-events: none;\n}\n\n/* ---- Drop target indicators for drag reorder ---- */\n.pict-mde-segment.pict-mde-drag-over-top\n{\n\tbox-shadow: 0 -2px 0 0 #4A90D9;\n}\n.pict-mde-segment.pict-mde-drag-over-bottom\n{\n\tbox-shadow: 0 2px 0 0 #4A90D9;\n}\n\n/* ---- CodeMirror overrides inside segments ---- */\n.pict-mde-segment-editor .cm-editor\n{\n\tborder: none;\n}\n.pict-mde-segment-editor .cm-editor .cm-scroller\n{\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\tfont-size: 14px;\n\tline-height: 1.6;\n}\n.pict-mde-segment-editor .cm-editor.cm-focused\n{\n\toutline: none;\n}\n.pict-mde-segment-editor .cm-editor .cm-content\n{\n\tpadding: 8px 12px;\n\tmin-height: 36px;\n}\n.pict-mde-segment-editor .cm-editor .cm-gutters\n{\n\tbackground: #F8F8F8;\n\tborder-right: 1px solid #E8E8E8;\n\tcolor: #BBB;\n}\n\n/* ---- Collapsed data URI widget ---- */\n.pict-mde-data-uri-collapsed\n{\n\tdisplay: inline;\n\tbackground: #F0F0F0;\n\tcolor: #888;\n\tfont-size: 11px;\n\tpadding: 1px 4px;\n\tborder-radius: 3px;\n\tborder: 1px solid #E0E0E0;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n\tcursor: default;\n\twhite-space: nowrap;\n}\n\n/* ---- Line number / controls toggle: gutters hidden by default ---- */\n.pict-mde .cm-editor .cm-gutters\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-controls-on .cm-editor .cm-gutters\n{\n\tdisplay: flex;\n}\n"}},{}],50:[function(t,e,i){const n=t("pict-view"),o=t("pict-section-content"),r=t("./Pict-Section-MarkdownEditor-DefaultConfiguration.js"),s=t("./Pict-MDE-Formatting.js"),a=t("./Pict-MDE-ImageHandling.js"),l=t("./Pict-MDE-DragAndReorder.js"),c=t("./Pict-MDE-RichPreview.js"),d=t("./Pict-MDE-CodeMirror.js");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},r,e),i),this.initialRenderComplete=!1,this._codeMirrorModules=null,this._segmentEditors={},this._segmentCounter=0,this._viewCallIdentifier=!1,this._activeSegmentIndex=-1,this._dragSourceIndex=-1,this._controlsVisible=!0,this._previewsVisible=!0,this._hiddenPreviewSegments={},this._imagePreviewTimers={},this._richPreviewTimers={},this._richPreviewGenerations={},this._contentProvider=null,this._renderedViewActive=!1,this._renderedViewGeneration=0,s.attach(this),a.attach(this),l.attach(this),c.attach(this),d.attach(this)}onBeforeInitialize(){return super.onBeforeInitialize(),this.targetElement=!1,super.onBeforeInitialize()}connectCodeMirrorModules(t){if(!t||"object"!=typeof t||"function"!=typeof t.EditorView||"function"!=typeof t.EditorState)return"undefined"!=typeof window&&window.CodeMirrorModules&&"function"==typeof window.CodeMirrorModules.EditorView?(this.log.trace("PICT-MarkdownEditor Found CodeMirror modules on window.CodeMirrorModules."),void(this._codeMirrorModules=window.CodeMirrorModules)):(this.log.error("PICT-MarkdownEditor No CodeMirror modules found. Provide them via connectCodeMirrorModules() or set window.CodeMirrorModules."),!1);this._codeMirrorModules=t}onAfterRender(t){return this.pict.CSSMap.injectCSS(),this.initialRenderComplete||(this.onAfterInitialRender(),this.initialRenderComplete=!0),super.onAfterRender(t)}onAfterInitialRender(){if(this._codeMirrorModules||this.connectCodeMirrorModules(),!this._codeMirrorModules)return this.log.error("PICT-MarkdownEditor Cannot initialize; no CodeMirror modules available."),!1;if(this.options.EnableRichPreview){let t=o.default_configuration;t&&t.CSS&&this.pict.CSSMap.addCSS("Pict-Content-View",t.CSS)}let t=this.services.ContentAssignment.getElement(this.options.TargetElementAddress);if(!t||t.length<1)return this.log.error("PICT-MarkdownEditor Could not find target element [".concat(this.options.TargetElementAddress,"]!")),this.targetElement=!1,!1;this.targetElement=t[0],this._viewCallIdentifier=this._resolveViewCallIdentifier(),this._buildEditorUI()}_resolveViewCallIdentifier(){let t=this.pict.views;for(let e in t)if(t[e]===this)return"_Pict.views.".concat(e);return"_Pict.servicesMap.PictView['".concat(this.Hash,"']")}_getContainerElement(){if(this.targetElement){let t=this.targetElement.querySelector(".pict-mde");if(t)return t}return this.targetElement||null}_buildEditorUI(){let t=this._getContainerElement();t&&!t.classList.contains("pict-mde")&&t.classList.add("pict-mde");for(let t in this._segmentEditors)this._segmentEditors[t]&&this._segmentEditors[t].destroy();t.innerHTML="",this._previewsVisible||t.classList.add("pict-mde-previews-hidden"),this._controlsVisible?t.classList.add("pict-mde-controls-on"):t.classList.add("pict-mde-controls-hidden");let e=this._getSegmentsFromData();e&&0!==e.length||(e=[{Content:""}],this._setSegmentsToData(e)),this._segmentCounter=0,this._segmentEditors={};for(let i=0;i<e.length;i++)this._renderSegment(t,i,e[i].Content||"");this._renderAddButton(t)}_renderSegment(t,e,i){let n=this._segmentCounter++,o={SegmentIndex:n,SegmentDisplayIndex:e+1,ViewIdentifier:this._viewCallIdentifier},r=this.pict.parseTemplateByHash("MarkdownEditor-Segment",o),s=document.createElement("div");s.innerHTML=r;let a=s.firstElementChild;t.appendChild(a),this._buildQuadrantButtons(a,n),this._hiddenPreviewSegments[e]&&a.classList.add("pict-mde-preview-hidden"),this._wireSegmentDragEvents(a,n);let l=document.getElementById("PictMDE-SegmentEditor-".concat(n));l&&(this._createEditorInContainer(l,n,i),this._wireImageDragEvents(l,n),i&&(this._updateImagePreviews(n),this._updateRichPreviews(n)))}_buildQuadrantButtons(t,e){let i=[{key:"ButtonsTL",selector:".pict-mde-quadrant-tl",baseClass:"pict-mde-left-btn"},{key:"ButtonsBL",selector:".pict-mde-quadrant-bl",baseClass:"pict-mde-left-btn"},{key:"ButtonsTR",selector:".pict-mde-quadrant-tr",baseClass:"pict-mde-sidebar-btn"},{key:"ButtonsBR",selector:".pict-mde-quadrant-br",baseClass:"pict-mde-sidebar-btn"}],n=this;for(let o=0;o<i.length;o++){let r=i[o],s=t.querySelector(r.selector);if(!s)continue;let a=this.options[r.key];if(Array.isArray(a))for(let t=0;t<a.length;t++){let i=a[t],o=document.createElement("button");o.type="button",o.className=r.baseClass,i.Class&&(o.className+=" "+i.Class),o.innerHTML=i.HTML||"",o.title=i.Title||"";let l=i.Action||"",c=l,d=null,p=l.indexOf(":");p>=0&&(c=l.substring(0,p),d=l.substring(p+1)),function(t,e,i){o.addEventListener("click",()=>{"function"==typeof n[t]?null!==e?n[t](i,e):n[t](i):n.log.warn('PICT-MarkdownEditor _buildQuadrantButtons: method "'.concat(t,'" not found.'))})}(c,d,e),s.appendChild(o)}}}customConfigureExtensions(t,e){return t}_renderAddButton(t){let e={ViewIdentifier:this._viewCallIdentifier},i=this.pict.parseTemplateByHash("MarkdownEditor-AddSegment",e),n=document.createElement("div");n.innerHTML=i;let o=n.firstElementChild;t.appendChild(o)}onImageUpload(t,e,i){return!1}toggleControls(t,e){let i=e;"boolean"==typeof t&&(i=t),this._controlsVisible="boolean"==typeof i?i:!this._controlsVisible;let n=this._getContainerElement();n&&(this._controlsVisible?(n.classList.add("pict-mde-controls-on"),n.classList.remove("pict-mde-controls-hidden")):(n.classList.remove("pict-mde-controls-on"),n.classList.add("pict-mde-controls-hidden")))}toggleLineNumbers(t){this.toggleControls(t)}togglePreview(t){this._previewsVisible="boolean"==typeof t?t:!this._previewsVisible;let e=this._getContainerElement();e&&(this._previewsVisible?e.classList.remove("pict-mde-previews-hidden"):e.classList.add("pict-mde-previews-hidden"))}toggleSegmentPreview(t,e){let i=this._getLogicalIndex(t);if(i<0)return;let n=!!this._hiddenPreviewSegments[i];n="boolean"==typeof e?!e:!n,n?this._hiddenPreviewSegments[i]=!0:delete this._hiddenPreviewSegments[i];let o=document.getElementById("PictMDE-Segment-".concat(t));o&&(n?o.classList.add("pict-mde-preview-hidden"):o.classList.remove("pict-mde-preview-hidden"))}_getSegmentsFromData(){if(!this.options.ContentDataAddress)return null;const t={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};let e=this.fable.manifest.getValueByHash(t,this.options.ContentDataAddress);return Array.isArray(e)?e:null}_setSegmentsToData(t){if(!this.options.ContentDataAddress)return;const e={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};this.fable.manifest.setValueByHash(e,this.options.ContentDataAddress,t)}_onSegmentContentChange(t,e){let i=this._getLogicalIndex(t);if(i<0)return;let n=this._getSegmentsFromData();if(!n)return;i<n.length&&(n[i].Content=e),this.onContentChange(i,e);let o=this;this._imagePreviewTimers[t]&&clearTimeout(this._imagePreviewTimers[t]),this._imagePreviewTimers[t]=setTimeout(()=>{o._updateImagePreviews(t),delete o._imagePreviewTimers[t]},500),this._richPreviewTimers[t]&&clearTimeout(this._richPreviewTimers[t]),this._richPreviewTimers[t]=setTimeout(()=>{o._updateRichPreviews(t),delete o._richPreviewTimers[t]},500)}onContentChange(t,e){}_getLogicalIndex(t){let e=this._getContainerElement();if(!e)return-1;let i=e.querySelectorAll(".pict-mde-segment");for(let e=0;e<i.length;e++){if(parseInt(i[e].getAttribute("data-segment-index"),10)===t)return e}return-1}_getOrderedSegmentIndices(){let t=this._getContainerElement();if(!t)return[];let e=t.querySelectorAll(".pict-mde-segment"),i=[];for(let t=0;t<e.length;t++)i.push(parseInt(e[t].getAttribute("data-segment-index"),10));return i}addSegment(t){let e="string"==typeof t?t:"",i=this._getSegmentsFromData();i||(i=[]),i.push({Content:e}),this._setSegmentsToData(i),this._buildEditorUI()}removeSegment(t){let e=this._getLogicalIndex(t);if(e<0)return void this.log.warn("PICT-MarkdownEditor removeSegment: segment index ".concat(t," not found."));let i=this._getSegmentsFromData();if(!i||i.length<=1)return void this.log.warn("PICT-MarkdownEditor removeSegment: cannot remove the last segment.");this._segmentEditors[t]&&(this._segmentEditors[t].destroy(),delete this._segmentEditors[t]),i.splice(e,1),this._setSegmentsToData(i);let n={};for(let t in this._hiddenPreviewSegments){let i=parseInt(t,10);i<e?n[i]=!0:i>e&&(n[i-1]=!0)}this._hiddenPreviewSegments=n,this._buildEditorUI()}moveSegmentUp(t){let e=this._getLogicalIndex(t);if(e<=0)return;this._marshalAllEditorsToData();let i=this._getSegmentsFromData();if(!i)return;let n=i[e];i[e]=i[e-1],i[e-1]=n,this._swapHiddenPreviewState(e,e-1),this._buildEditorUI()}moveSegmentDown(t){let e=this._getLogicalIndex(t),i=this._getSegmentsFromData();if(!i||e<0||e>=i.length-1)return;this._marshalAllEditorsToData();let n=i[e];i[e]=i[e+1],i[e+1]=n,this._swapHiddenPreviewState(e,e+1),this._buildEditorUI()}getSegmentContent(t){let e=this._getOrderedSegmentIndices();if(t<0||t>=e.length)return"";let i=e[t],n=this._segmentEditors[i];return n?n.state.doc.toString():""}setSegmentContent(t,e){let i=this._getOrderedSegmentIndices();if(t<0||t>=i.length)return void this.log.warn("PICT-MarkdownEditor setSegmentContent: index ".concat(t," out of range."));let n=i[t],o=this._segmentEditors[n];o&&o.dispatch({changes:{from:0,to:o.state.doc.length,insert:e}})}getSegmentCount(){return this._getOrderedSegmentIndices().length}getAllContent(t){let e="string"==typeof t?t:"\n\n",i=this._getOrderedSegmentIndices(),n=[];for(let t=0;t<i.length;t++){let e=this._segmentEditors[i[t]];e&&n.push(e.state.doc.toString())}return n.join(e)}_marshalAllEditorsToData(){let t=this._getSegmentsFromData();if(!t)return;let e=this._getOrderedSegmentIndices();for(let i=0;i<e.length;i++){let n=this._segmentEditors[e[i]];n&&i<t.length&&(t[i].Content=n.state.doc.toString())}}setReadOnly(t){this.options.ReadOnly=t,this.initialRenderComplete&&(this._marshalAllEditorsToData(),this._buildEditorUI())}marshalToView(){super.marshalToView(),this.initialRenderComplete&&this.options.ContentDataAddress&&this._buildEditorUI()}marshalFromView(){super.marshalFromView(),this._marshalAllEditorsToData()}destroy(){for(let t in this._segmentEditors)this._segmentEditors[t]&&this._segmentEditors[t].destroy();this._segmentEditors={};for(let t in this._richPreviewTimers)clearTimeout(this._richPreviewTimers[t]);this._richPreviewTimers={},this._richPreviewGenerations={}}},e.exports.default_configuration=r},{"./Pict-MDE-CodeMirror.js":44,"./Pict-MDE-DragAndReorder.js":45,"./Pict-MDE-Formatting.js":46,"./Pict-MDE-ImageHandling.js":47,"./Pict-MDE-RichPreview.js":48,"./Pict-Section-MarkdownEditor-DefaultConfiguration.js":49,"pict-section-content":26,"pict-view":52}],51:[function(t,e,i){e.exports={name:"pict-view",version:"1.0.66",description:"Pict View Base Class",main:"source/Pict-View.js",scripts:{test:"mocha -u tdd -R spec",tests:"mocha -u tdd -R spec -g",start:"node source/Pict-View.js",coverage:"nyc --reporter=lcov --reporter=text-lcov npm test",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-view-image:local","docker-dev-run":'docker run -it -d --name pict-view-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-view" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-view-image:local',"docker-dev-shell":"docker exec -it pict-view-dev /bin/bash",types:"tsc -p .",lint:"eslint source/**"},types:"types/source/Pict-View.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-view.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-view/issues"},homepage:"https://github.com/stevenvelozo/pict-view#readme",devDependencies:{"@eslint/js":"^9.39.1","browser-env":"^3.3.0",eslint:"^9.39.1",pict:"^1.0.348",quackage:"^1.0.51",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{fable:"^3.1.57","fable-serviceproviderbase":"^3.0.18"}}},{}],52:[function(t,e,i){const n=t("fable-serviceproviderbase"),o=t("../package.json"),r={DefaultRenderable:!1,DefaultDestinationAddress:!1,DefaultTemplateRecordAddress:!1,ViewIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoRender:!0,AutoRenderOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,CSSHash:!1,CSS:!1,CSSProvider:!1,CSSPriority:500,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(r)),e),i),this.fable,this.options,this.UUID,this.Hash,this.log;const n=this.Hash===this.UUID;this.UUID="V-".concat(this.UUID),n&&(this.Hash=this.UUID),this.options.ViewIdentifier||(this.options.ViewIdentifier="AutoViewID-".concat(this.fable.getUUID())),this.serviceType="PictView",this._Package=o,this.pict=this.fable,this.AppData=this.pict.AppData,this.Bundle=this.pict.Bundle,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1,this.lastRenderedTimestamp=!1,this.lastMarshalFromViewTimestamp=!1,this.lastMarshalToViewTimestamp=!1,this.pict.instantiateServiceProviderIfNotExists("TransactionTracking");for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];"Hash"in e&&"Template"in e?(e.Source||(e.Source="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," options object.")),this.pict.TemplateProvider.addTemplate(e.Hash,e.Template,e.Source)):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Template ").concat(t," in the options array."),e)}for(let t=0;t<this.options.DefaultTemplates.length;t++){let e=this.options.DefaultTemplates[t];"Postfix"in e&&"Template"in e?(e.Source||(e.Source="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," options object.")),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Default Template ").concat(t," in the options array."),e)}if(this.options.CSS){let t=this.options.CSSHash?this.options.CSSHash:"View-".concat(this.options.ViewIdentifier),e=this.options.CSSProvider?this.options.CSSProvider:t;this.pict.CSSMap.addCSS(t,this.options.CSS,e,this.options.CSSPriority)}this.renderables={};for(let t=0;t<this.options.Renderables.length;t++){let e=this.options.Renderables[t];this.addRenderable(e)}}addRenderable(t,e,i,n,o){let r;if("object"==typeof t)r=t;else{r={RenderableHash:t,TemplateHash:e,DefaultTemplateRecordAddress:i,ContentDestinationAddress:n,RenderMethod:"string"!=typeof o?o:"replace"}}"string"!=typeof r.RenderableHash||"string"!=typeof r.TemplateHash?this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Renderable; RenderableHash or TemplateHash are invalid."),r):(this.pict.LogNoisiness>0&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," adding renderable [").concat(r.RenderableHash,"] pointed to template ").concat(r.TemplateHash,".")),this.renderables[r.RenderableHash]=r)}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeInitialize:")),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onInitialize:")),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialize:")),this.initializeTimestamp?(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialize called but initialization is already completed. Aborting.")),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initializeAsync:")),this.initializeTimestamp)return this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," async initialize called but initialization is already completed. Aborting.")),t();{let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," beginning initialization...")),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait(e=>(e&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialization failed: ").concat(e.message||e),{stack:e.stack}),this.initializeTimestamp=this.pict.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialization complete.")),t()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterInitialize:")),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onBeforeRender(t){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeRender:")),!0}onBeforeRenderAsync(t,e){return this.onBeforeRender(e),t()}onBeforeProject(t){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeProject:")),!0}onBeforeProjectAsync(t,e){return this.onBeforeProject(e),t()}buildRenderOptions(t,e,i){let n={Valid:!0};return n.RenderableHash="string"==typeof t?t:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,n.RenderableHash||(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not find a suitable RenderableHash ").concat(n.RenderableHash," (param ").concat(t,"because it is not a valid renderable.")),n.Valid=!1),n.Renderable=this.renderables[n.RenderableHash],n.Renderable||(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n.RenderableHash," (param ").concat(t,") because it does not exist.")),n.Valid=!1),n.DestinationAddress="string"==typeof e?e:"string"==typeof n.Renderable.ContentDestinationAddress?n.Renderable.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress,n.DestinationAddress||(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(n.RenderableHash," (param ").concat(t,") because it does not have a valid destination address (param ").concat(e,").")),n.Valid=!1),"object"==typeof i?(n.RecordAddress="Passed in as object",n.Record=i):(n.RecordAddress="string"==typeof i?i:"string"==typeof n.Renderable.DefaultTemplateRecordAddress?n.Renderable.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,n.Record="string"==typeof n.RecordAddress?this.pict.DataProvider.getDataByAddress(n.RecordAddress):void 0),n}assignRenderContent(t,e,i){return this.pict.ContentAssignment.projectContent(t.RenderMethod,e,i,t.TestAddress)}render(t,e,i,n){return this.renderWithScope(this,t,e,i,n)}renderWithScope(t,e,i,n,o){let r,s,a,l="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;return l?("__Virtual"==l?r={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof i?i:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:o&&o.TransactionHash,RootRenderableViewHash:o&&o.RootRenderableViewHash}:(r=Object.assign({},this.renderables[l]),r.ContentDestinationAddress="string"==typeof i?i:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),r.TransactionHash||(r.TransactionHash="ViewRender-V-".concat(this.options.ViewIdentifier,"-R-").concat(l,"-U-").concat(this.pict.getUUID()),r.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(r.TransactionHash)),r?r.ContentDestinationAddress?("object"==typeof n?(a=n,s="Passed in as object"):(s="string"==typeof n?n:"string"==typeof r.DefaultTemplateRecordAddress?r.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,a="string"==typeof s?this.pict.DataProvider.getDataByAddress(s):void 0),this.onBeforeRender(r),this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] Renderable[").concat(l,"] Destination[").concat(r.ContentDestinationAddress,"] TemplateRecordAddress[").concat(s,"] render:")),this.pict.LogNoisiness>0&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Beginning Render of Renderable[").concat(l,"] to Destination [").concat(r.ContentDestinationAddress,"]...")),r.Content=this.pict.parseTemplateByHash(r.TemplateHash,a,null,[this],t,{RootRenderable:"object"==typeof o?o:r}),this.pict.LogNoisiness>0&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Assigning Renderable[").concat(l,"] content length ").concat(r.Content.length," to Destination [").concat(r.ContentDestinationAddress,"] using render method [").concat(r.RenderMethod,"].")),this.onBeforeProject(r),this.onProject(r),"virtual-assignment"!==r.RenderMethod&&(this.onAfterProject(r),this.onAfterRender(r)),!0):(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(l," (param ").concat(e,") because it does not have a valid destination address.")),!1):(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(l," (param ").concat(e,") because it does not exist.")),!1)):(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(l," (param ").concat(e,") because it is not a valid renderable.")),!1)}renderAsync(t,e,i,n,o){return this.renderWithScopeAsync(this,t,e,i,n,o)}renderWithScopeAsync(t,e,i,n,o,r){let s,a,l,c="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,d="function"==typeof r?r:"function"==typeof n?n:"function"==typeof i?i:"function"==typeof e?e:"function"==typeof o?o:null;if(d||(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),d=t=>{t&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync Auto Callback Error: ").concat(t),t)}),!c)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(c," (param ").concat(e,"because it is not a valid renderable.")),d(new Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(c," (param ").concat(e,"because it is not a valid renderable.")));if("__Virtual"==c?s={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof i?i:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:o&&"function"!=typeof o&&o.TransactionHash,RootRenderableViewHash:o&&"function"!=typeof o&&o.RootRenderableViewHash}:(s=Object.assign({},this.renderables[c]),s.ContentDestinationAddress="string"==typeof i?i:"string"==typeof s.ContentDestinationAddress?s.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),s.TransactionHash||(s.TransactionHash="ViewRender-V-".concat(this.options.ViewIdentifier,"-R-").concat(c,"-U-").concat(this.pict.getUUID()),s.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(s.TransactionHash)),!s)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(c," (param ").concat(e,") because it does not exist.")),d(new Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(c," (param ").concat(e,") because it does not exist.")));if(!s.ContentDestinationAddress)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(c," (param ").concat(e,") because it does not have a valid destination address.")),d(new Error("Could not render ".concat(c)));"object"==typeof n?(l=n,a="Passed in as object"):(a="string"==typeof n?n:"string"==typeof s.DefaultTemplateRecordAddress?s.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,l="string"==typeof a?this.pict.DataProvider.getDataByAddress(a):void 0),this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] Renderable[").concat(c,"] Destination[").concat(s.ContentDestinationAddress,"] TemplateRecordAddress[").concat(a,"] renderAsync:")),this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Beginning Asynchronous Render (callback-style)..."));let p=this.fable.newAnticipate();p.anticipate(t=>{this.onBeforeRenderAsync(t,s)}),p.anticipate(i=>{this.pict.parseTemplateByHash(s.TemplateHash,l,(t,n)=>t?(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render (asynchronously) ").concat(c," (param ").concat(e,") because it did not parse the template."),t),i(t)):(s.Content=n,i()),[this],t,{RootRenderable:"object"==typeof o?o:s})}),p.anticipate(t=>{this.onBeforeProjectAsync(t,s)}),p.anticipate(t=>{this.onProjectAsync(t,s)}),"virtual-assignment"!==s.RenderMethod&&(p.anticipate(t=>{this.onAfterProjectAsync(t,s)}),p.anticipate(t=>{this.onAfterRenderAsync(t,s)})),p.wait(d)}renderDefaultAsync(t){this.renderAsync(t)}basicRender(t,e,i){return this.basicRenderWithScope(this,t,e,i)}basicRenderWithScope(t,e,i,n){let o=this.buildRenderOptions(e,i,n);return o.Valid?(this.assignRenderContent(o.Renderable,o.DestinationAddress,this.pict.parseTemplateByHash(o.Renderable.TemplateHash,o.Record,null,[this],t,{RootRenderable:o.Renderable})),!0):(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not perform a basic render of ").concat(o.RenderableHash," because it is not valid.")),!1)}basicRenderAsync(t,e,i,n){return this.basicRenderWithScopeAsync(this,t,e,i,n)}basicRenderWithScopeAsync(t,e,i,n,o){let r="function"==typeof o?o:"function"==typeof n?n:"function"==typeof i?i:"function"==typeof e?e:null;r||(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," basicRenderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),r=t=>{t&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," basicRenderAsync Auto Callback Error: ").concat(t),t)});const s=this.buildRenderOptions(e,i,n);if(!s.Valid){let t="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not perform a basic render of ").concat(s.RenderableHash," because it is not valid.");return this.log.error(t),r(new Error(t))}this.pict.parseTemplateByHash(s.Renderable.TemplateHash,s.Record,(t,e)=>t?(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render (asynchronously) ").concat(s.RenderableHash," because it did not parse the template."),t),r(t)):(this.assignRenderContent(s.Renderable,s.DestinationAddress,e),r()),[this],t,{RootRenderable:s.Renderable})}onProject(t){this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onProject:")),"virtual-assignment"===t.RenderMethod&&this.pict.TransactionTracking.pushToTransactionQueue(t.TransactionHash,{ViewHash:this.Hash,Renderable:t},"Deferred-Post-Content-Assignment"),this.pict.LogNoisiness>0&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Assigning Renderable[").concat(t.RenderableHash,"] content length ").concat(t.Content.length," to Destination [").concat(t.ContentDestinationAddress,"] using Async render method ").concat(t.RenderMethod,".")),this.pict.ContentAssignment.projectContent(t.RenderMethod,t.ContentDestinationAddress,t.Content,t.TestAddress),this.lastRenderedTimestamp=this.pict.log.getTimeStamp()}onProjectAsync(t,e){return this.onProject(e),t()}onAfterRender(t){if(this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterRender:")),t&&t.RootRenderableViewHash===this.Hash){const e=this.pict.TransactionTracking.clearTransactionQueue(t.TransactionHash)||[];for(const i of e){const e=this.pict.views[i.Data.ViewHash];e?(e.onAfterProject(),e.onAfterRender(i.Data.Renderable)):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterRender: Could not find view for transaction hash ").concat(t.TransactionHash," and ViewHash ").concat(i.Data.ViewHash,"."))}}return!0}onAfterRenderAsync(t,e){this.onAfterRender(e);const i=this.fable.newAnticipate();if(e&&e.RootRenderableViewHash===this.Hash){const t=this.pict.TransactionTracking.clearTransactionQueue(e.TransactionHash)||[];for(const n of t){const t=this.pict.views[n.Data.ViewHash];t?(i.anticipate(t.onAfterProjectAsync.bind(t)),i.anticipate(e=>{t.onAfterRenderAsync(e,n.Data.Renderable)})):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterRenderAsync: Could not find view for transaction hash ").concat(e.TransactionHash," and ViewHash ").concat(n.Data.ViewHash,"."))}}return i.wait(t)}onAfterProject(t){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterProject:")),!0}onAfterProjectAsync(t,e){return t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeSolve:")),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onSolve:")),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){return this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function...")),this.onBeforeSolve(),this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),!0}solveAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),i=t=>{t&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeSolveAsync.bind(this)),e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," solveAsync() complete.")),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterSolve:")),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeMarshalFromView:")),!0}onBeforeMarshalFromViewAsync(t){return this.onBeforeMarshalFromView(),t()}onMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onMarshalFromView:")),!0}onMarshalFromViewAsync(t){return this.onMarshalFromView(),t()}marshalFromView(){return this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function...")),this.onBeforeMarshalFromView(),this.onMarshalFromView(),this.onAfterMarshalFromView(),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalFromViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),i=t=>{t&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeMarshalFromViewAsync.bind(this)),e.anticipate(this.onMarshalFromViewAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," marshalFromViewAsync() complete.")),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalFromView:")),!0}onAfterMarshalFromViewAsync(t){return this.onAfterMarshalFromView(),t()}onBeforeMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeMarshalToView:")),!0}onBeforeMarshalToViewAsync(t){return this.onBeforeMarshalToView(),t()}onMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onMarshalToView:")),!0}onMarshalToViewAsync(t){return this.onMarshalToView(),t()}marshalToView(){return this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function...")),this.onBeforeMarshalToView(),this.onMarshalToView(),this.onAfterMarshalToView(),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalToViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),i=t=>{t&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeMarshalToViewAsync.bind(this)),e.anticipate(this.onMarshalToViewAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," marshalToViewAsync() complete.")),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalToView:")),!0}onAfterMarshalToViewAsync(t){return this.onAfterMarshalToView(),t()}get isPictView(){return!0}}},{"../package.json":51,"fable-serviceproviderbase":2}],53:[function(t,e,i){e.exports={Name:"Retold Content Editor",Hash:"ContentEditor",MainViewportViewIdentifier:"ContentEditor-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"ContentEditor-Pict-Application"}}},{}],54:[function(t,e,i){const n=t("pict-application"),o=t("pict-section-filebrowser"),r=t("./providers/Pict-Provider-ContentEditor.js"),s=t("./views/PictView-Editor-Layout.js"),a=t("./views/PictView-Editor-TopBar.js"),l=t("./views/PictView-Editor-MarkdownEditor.js"),c=t("./views/PictView-Editor-CodeEditor.js"),d=t("./views/PictView-Editor-SettingsPanel.js"),p=t("./views/PictView-Editor-MarkdownReference.js"),h=t("./views/PictView-Editor-Topics.js");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.pict.addProvider("ContentEditor-Provider",r.default_configuration,r),this.pict.addView("ContentEditor-Layout",s.default_configuration,s),this.pict.addView("ContentEditor-TopBar",a.default_configuration,a),this.pict.addView("ContentEditor-MarkdownEditor",l.default_configuration,l),this.pict.addView("ContentEditor-CodeEditor",c.default_configuration,c),this.pict.addView("ContentEditor-SettingsPanel",d.default_configuration,d),this.pict.addView("ContentEditor-MarkdownReference",p.default_configuration,p),this.pict.addView("ContentEditor-Topics",h.default_configuration,h);let n=JSON.parse(JSON.stringify(o.default_configuration));n.DefaultDestinationAddress="#ContentEditor-Sidebar-Container",n.DefaultState.Layout="list-only",this.pict.addView("Pict-FileBrowser",n,o),this.pict.addView("Pict-FileBrowser-ListDetail",o.PictViewListDetail.default_configuration,o.PictViewListDetail)}onAfterInitializeAsync(t){"undefined"!=typeof window&&(window.pict=this.pict),this.pict.AppData.ContentEditor={CurrentFile:"",ActiveEditor:"markdown",IsDirty:!1,IsSaving:!1,IsLoading:!1,Files:[],Document:{Segments:[{Content:""}]},CodeContent:"",SaveStatus:"",SaveStatusClass:"",AutoSegmentMarkdown:!1,AutoSegmentDepth:1,AutoContentPreview:!1,MarkdownEditingControls:!0,MarkdownWordWrap:!0,CodeWordWrap:!1,SidebarCollapsed:!1,SidebarWidth:250,AutoPreviewImages:!0,AutoPreviewVideo:!1,AutoPreviewAudio:!1,ShowHiddenFiles:!1,TopicsFilePath:".pict_documentation_topics.json"},this._loadSettings(),this.pict.views["ContentEditor-Layout"].render();let e=this,i=this.pict.providers["Pict-FileBrowser-List"];if(i){let t=i.selectFile.bind(i);i.selectFile=function(i){t(i),i&&"file"===i.Type&&e.navigateToFile(i.Path)}}let n=this.pict.providers["Pict-FileBrowser-Browse"];if(n){let t=n.navigateToFolder.bind(n);n.navigateToFolder=function(i){t(i),e.loadFileList(i)}}this.syncHiddenFilesSetting(()=>{e.loadFileList(null,()=>{e.resolveHash()})});let o=this.pict.AppData.ContentEditor.TopicsFilePath;if(o){let t=this.pict.views["ContentEditor-Topics"];t&&t.loadTopicsFile(o,()=>{})}return super.onAfterInitializeAsync(t)}syncHiddenFilesSetting(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.ContentEditor.ShowHiddenFiles;fetch("/api/filebrowser/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({IncludeHiddenFiles:!!i})}).then(()=>e()).catch(()=>e())}loadFileList(t,e){let i="function"==typeof e?e:"function"==typeof t?t:()=>{},n=this,o="string"==typeof t?t:null;null===o&&this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(o=this.pict.AppData.PictFileBrowser.CurrentLocation);let r="/api/filebrowser/list";o&&o.length>0&&(r+="?path="+encodeURIComponent(o)),fetch(r).then(t=>t.json()).then(t=>{n.pict.AppData.PictFileBrowser=n.pict.AppData.PictFileBrowser||{},n.pict.AppData.PictFileBrowser.FileList=t||[];let e=n.pict.views["Pict-FileBrowser"];e&&e.render();let o=n.pict.views["Pict-FileBrowser-ListDetail"];return o&&o.render(),i()}).catch(t=>(n.log.error("Failed to load file list: ".concat(t.message)),i()))}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t)return;let e=t.split("/");if("edit"===e[0]&&e.length>=2){let t=e.slice(1).join("/");if(this.pict.AppData.ContentEditor.CurrentFile===t)return;this.navigateToFile(t)}}getEditorTypeForFile(t){if(!t)return"markdown";let e=t.replace(/^.*\./,"").toLowerCase();if("md"===e||"markdown"===e)return"markdown";return{png:!0,jpg:!0,jpeg:!0,gif:!0,bmp:!0,webp:!0,ico:!0,svg:!0,tiff:!0,tif:!0,avif:!0,heic:!0,heif:!0,mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,mp4:!0,avi:!0,mkv:!0,mov:!0,wmv:!0,webm:!0,flv:!0,m4v:!0,pdf:!0,doc:!0,docx:!0,xls:!0,xlsx:!0,ppt:!0,pptx:!0,odt:!0,ods:!0,odp:!0,zip:!0,tar:!0,gz:!0,bz2:!0,xz:!0,"7z":!0,rar:!0,ttf:!0,otf:!0,woff:!0,woff2:!0,eot:!0,exe:!0,dll:!0,so:!0,dylib:!0,o:!0,class:!0,pyc:!0,wasm:!0}[e]?"binary":"code"}_cleanupEditors(){let t=this.pict.views["ContentEditor-CodeEditor"];t&&(t.codeJar&&t.destroy(),t.initialRenderComplete=!1);let e=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");e&&e[0]&&(e[0].innerHTML="")}_formatFileSize(t){if(0===t)return"0 B";let e=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(t)/Math.log(1024));return i>=e.length&&(i=e.length-1),(t/Math.pow(1024,i)).toFixed(0===i?0:1)+" "+e[i]}_getMediaType(t){return{png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0}[t]?"image":{mp4:!0,webm:!0,mov:!0,mkv:!0,avi:!0,wmv:!0,flv:!0,m4v:!0,ogv:!0}[t]?"video":{mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,oga:!0}[t]?"audio":"other"}_buildMediaPreviewHTML(t,e,i){return"image"===t?'<div class="binary-preview-image-wrap"><div class="binary-preview-image"><img src="'+e+'" alt="'+i+'"></div></div>':"video"===t?'<div class="binary-preview-media-wrap"><video class="binary-preview-video" controls preload="metadata"><source src="'+e+'">Your browser does not support the video tag.</video></div>':"audio"===t?'<div class="binary-preview-media-wrap"><audio class="binary-preview-audio" controls preload="metadata"><source src="'+e+'">Your browser does not support the audio tag.</audio></div>':""}loadMediaPreview(t,e,i){let n=document.getElementById("ContentEditor-MediaPreviewPlaceholder");n&&(n.innerHTML=this._buildMediaPreviewHTML(t,e,i))}_showBinaryPreview(t){let e=this,i=t.replace(/^.*\//,""),n=t.replace(/^.*\./,"").toLowerCase(),o="/content/"+encodeURIComponent(t),r=this._getMediaType(n),s=this.pict.AppData.ContentEditor,a=!1;"image"===r&&(a=s.AutoPreviewImages),"video"===r&&(a=s.AutoPreviewVideo),"audio"===r&&(a=s.AutoPreviewAudio),fetch("/api/filebrowser/info?path="+encodeURIComponent(t)).then(t=>t.json()).then(t=>{let s=t&&"number"==typeof t.Size?e._formatFileSize(t.Size):"Unknown",l=t&&t.Modified?new Date(t.Modified).toLocaleString():"Unknown",c=e.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");if(!c||!c[0])return;let d="";"other"!==r&&(a?d+=e._buildMediaPreviewHTML(r,o,i):(d+='<div id="ContentEditor-MediaPreviewPlaceholder">',d+='<button class="binary-preview-btn binary-preview-btn-preview"',d+=' onclick="pict.PictApplication.loadMediaPreview(',d+="'"+r+"','"+o+"','"+i.replace(/'/g,"\\'")+"'",d+=')">Preview '+r.charAt(0).toUpperCase()+r.slice(1)+"</button>",d+="</div>")),d+='<div class="binary-preview-card">',d+='<div class="binary-preview-icon">'+n.toUpperCase()+"</div>",d+='<div class="binary-preview-info">',d+='<div class="binary-preview-name">'+i+"</div>",d+='<div class="binary-preview-meta">Size: '+s+"</div>",d+='<div class="binary-preview-meta">Modified: '+l+"</div>",d+='<div class="binary-preview-meta">Type: .'+n+"</div>",d+="</div>",d+='<div class="binary-preview-actions">',d+='<a class="binary-preview-btn" href="'+o+'" download="'+i+'">Download</a>',d+='<a class="binary-preview-btn binary-preview-btn-secondary" href="'+o+'" target="_blank">Open in New Tab</a>',d+="</div>",d+="</div>",c[0].innerHTML=d}).catch(()=>{let t=e.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");t&&t[0]&&(t[0].innerHTML='<div class="binary-preview-card"><div class="binary-preview-icon">'+n.toUpperCase()+'</div><div class="binary-preview-info"><div class="binary-preview-name">'+i+'</div><div class="binary-preview-meta">Binary file — cannot be edited in the browser</div></div><div class="binary-preview-actions"><a class="binary-preview-btn" href="'+o+'" download="'+i+'">Download</a><a class="binary-preview-btn binary-preview-btn-secondary" href="'+o+'" target="_blank">Open in New Tab</a></div></div>')})}segmentMarkdownContent(t){let e=this.pict.AppData.ContentEditor;if(!e.AutoSegmentMarkdown||!t)return[{Content:t||""}];let i=parseInt(e.AutoSegmentDepth,10)||1;if(1===i){let e=t.split("\n"),i=[],n=[],o=!1;for(let t=0;t<e.length;t++){let r=e[t];/^(`{3,}|~{3,})/.test(r.trim())?(o=!o,n.push(r)):o||""!==r.trim()?n.push(r):n.length>0&&(i.push({Content:n.join("\n")}),n=[])}return n.length>0&&i.push({Content:n.join("\n")}),i.length>0?i:[{Content:""}]}let n=new RegExp("^(#{1,"+i+"})\\s"),o=t.split("\n"),r=[],s=[];for(let t=0;t<o.length;t++){let e=o[t];n.test(e.trim())&&s.length>0&&(r.push({Content:s.join("\n")}),s=[]),s.push(e)}return s.length>0&&r.push({Content:s.join("\n")}),r.length>0?r:[{Content:""}]}navigateToFile(t){if(!t)return;let e=this,i=this.getEditorTypeForFile(t);if(this.pict.AppData.ContentEditor.SaveStatus="",this.pict.AppData.ContentEditor.SaveStatusClass="",window.location.hash="#/edit/"+t,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.IsDirty=!1,this.pict.AppData.ContentEditor.ActiveEditor=i,this._cleanupEditors(),this.pict.views["ContentEditor-TopBar"].render(),"binary"===i)return this._showBinaryPreview(t),void this.updateStats();let n=this.pict.providers["ContentEditor-Provider"];this.pict.AppData.ContentEditor.IsLoading=!0,n.loadFile(t,(n,o)=>{if(e.pict.AppData.ContentEditor.IsLoading=!1,n)return e.pict.AppData.ContentEditor.SaveStatus="Error loading file: "+n,e.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-error",void e.pict.views["ContentEditor-TopBar"].render();if("markdown"===i){e.pict.AppData.ContentEditor.Document.Segments=e.segmentMarkdownContent(o);let t=e.pict.views["ContentEditor-MarkdownEditor"];t&&(t.render(),t.marshalToView(),t.togglePreview(e.pict.AppData.ContentEditor.AutoContentPreview),t.toggleControls(e.pict.AppData.ContentEditor.MarkdownEditingControls)),e.updateStats()}else{e.pict.AppData.ContentEditor.CodeContent=o;let i=t.replace(/^.*\./,"").toLowerCase(),n=c.getLanguageForExtension?c.getLanguageForExtension(i):c.ExtensionLanguageMap[i]||"plaintext",r=e.pict.views["ContentEditor-CodeEditor"];r&&(r.initialRenderComplete=!1,r._language=n,r._suppressNextDirty=!0,r.render(),r.marshalToView(),e.pict.AppData.ContentEditor.CodeWordWrap&&r._editorElement&&(r._editorElement.style.whiteSpace="pre-wrap",r._editorElement.style.overflowWrap="break-word")),e.updateStats()}})}saveCurrentFile(){let t=this.pict.AppData.ContentEditor.CurrentFile;if(!t)return;let e=this.pict.providers["ContentEditor-Provider"],i=this,n="";if("code"===this.pict.AppData.ContentEditor.ActiveEditor){let t=this.pict.views["ContentEditor-CodeEditor"];t&&t.marshalFromView(),n=this.pict.AppData.ContentEditor.CodeContent||""}else{let t=this.pict.views["ContentEditor-MarkdownEditor"];t&&t.marshalFromView();let e=this.pict.AppData.ContentEditor.Document.Segments;if(e&&e.length>0){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].Content||"");n=t.join("\n\n")}}this.pict.AppData.ContentEditor.IsSaving=!0,this.pict.AppData.ContentEditor.SaveStatus="Saving...",this.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-saving",this.pict.views["ContentEditor-TopBar"].render(),e.saveFile(t,n,t=>{i.pict.AppData.ContentEditor.IsSaving=!1,t?(i.pict.AppData.ContentEditor.SaveStatus="Error: "+t,i.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-error"):(i.pict.AppData.ContentEditor.IsDirty=!1,i.pict.AppData.ContentEditor.SaveStatus="Saved",i.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-saved",i.loadFileList(),setTimeout(()=>{"Saved"===i.pict.AppData.ContentEditor.SaveStatus&&(i.pict.AppData.ContentEditor.SaveStatus="",i.pict.AppData.ContentEditor.SaveStatusClass="",i.pict.views["ContentEditor-TopBar"].render())},3e3)),i.pict.views["ContentEditor-TopBar"].render()})}closeCurrentFile(){this.pict.AppData.ContentEditor.CurrentFile&&(this.pict.AppData.ContentEditor.IsDirty?this._showCloseConfirmation():this._doCloseFile())}_doCloseFile(){this._hideCloseConfirmation(),this._cleanupEditors(),this.pict.AppData.ContentEditor.CurrentFile="",this.pict.AppData.ContentEditor.ActiveEditor="markdown",this.pict.AppData.ContentEditor.IsDirty=!1,this.pict.AppData.ContentEditor.SaveStatus="",this.pict.AppData.ContentEditor.SaveStatusClass="",this.pict.AppData.ContentEditor.Document.Segments=[{Content:""}],this.pict.AppData.ContentEditor.CodeContent="",window.location.hash="",this.pict.views["ContentEditor-TopBar"].render();let t=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");t&&t[0]&&(t[0].innerHTML='<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#8A7F72;font-size:1.1em;">Select a file from the sidebar to begin editing</div>'),this.updateStats()}confirmCloseFile(){this._doCloseFile()}cancelCloseFile(){this._hideCloseConfirmation()}_showCloseConfirmation(){let t=document.getElementById("ContentEditor-ConfirmOverlay");if(t&&t.classList.add("open"),!this._confirmKeyHandler){let t=this;this._confirmKeyHandler=e=>{let i=e.key.toLowerCase();"y"===i?(e.preventDefault(),t.confirmCloseFile()):"n"!==i&&"Escape"!==e.key||(e.preventDefault(),t.cancelCloseFile())}}window.addEventListener("keydown",this._confirmKeyHandler)}_hideCloseConfirmation(){let t=document.getElementById("ContentEditor-ConfirmOverlay");t&&t.classList.remove("open"),this._confirmKeyHandler&&window.removeEventListener("keydown",this._confirmKeyHandler)}createNewFile(t){if(!t)return;t.replace(/^.*\//,"").indexOf(".")<0&&(t+=".md");let e=this.pict.providers["ContentEditor-Provider"],i=this,n="";n=t.endsWith(".md")?"# "+t.replace(/\.[^.]+$/,"").replace(/^.*\//,"")+"\n\n":"// "+t.replace(/^.*\//,"")+"\n",e.saveFile(t,n,e=>{e||i.loadFileList(null,()=>{i.navigateToFile(t)})})}promptNewFile(){let t=prompt("Enter a name for the new file (e.g. my-page.md, script.js, style.css):");t&&t.trim()&&this.createNewFile(t.trim())}handleF4TopicAction(){let t=this.pict.views["ContentEditor-Layout"],e=this.pict.views["ContentEditor-Topics"];if(!t||!e)return;let i=this.pict.AppData.ContentEditor,n=i.ActiveEditor,o=i.CurrentFile,r=0,s=!1;if("markdown"===n&&o){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(t&&t._segmentEditors){let e=0;for(let i in t._segmentEditors){let n=t._segmentEditors[i];if(n&&n.hasFocus){let t=n.state.selection.main.head;r=e+n.state.doc.lineAt(t).number,s=!0;break}n&&n.state&&(e+=n.state.doc.lines)}}}if(i.SidebarCollapsed&&t.toggleSidebar(),t.switchSidebarTab("topics"),s&&o){let t={TopicCode:"New-Topic",TopicHelpFilePath:o,TopicTitle:this._extractFirstHeading()||"New Topic"};r>0&&(t.RelevantMarkdownLine=r),e.addTopic(t)}}_extractFirstHeading(){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(!t||!t._segmentEditors)return"";let e=7,i="";for(let n in t._segmentEditors){let o=t._segmentEditors[n];if(!o||!o.state||!o.state.doc)continue;let r=o.state.doc;for(let t=1;t<=r.lines;t++){let n=r.line(t).text.match(/^(#{1,6})\s+(.+)/);if(n){let t=n[1].length;if(t<e&&(e=t,i=n[2].trim(),1===e))return i}}}return i}updateStats(){let t=document.getElementById("ContentEditor-Stats");if(!t)return;let e=this.pict.AppData.ContentEditor.ActiveEditor,i=0,n=0,o=0;if("markdown"===e){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(t&&t._segmentEditors)for(let e in t._segmentEditors){let r=t._segmentEditors[e];if(r&&r.state&&r.state.doc){i+=r.state.doc.lines,n+=r.state.doc.length;let t=r.state.doc.toString().match(/\S+/g);t&&(o+=t.length)}}}else{if("code"!==e)return void(t.textContent="");{let t=this.pict.views["ContentEditor-CodeEditor"];if(t&&t.codeJar){let e=t.codeJar.toString();n=e.length,i=e.split("\n").length;let r=e.match(/\S+/g);r&&(o=r.length)}}}t.textContent=i+" lines · "+o+" words · "+n+" chars"}markDirty(){this.pict.AppData.ContentEditor.IsDirty||(this.pict.AppData.ContentEditor.IsDirty=!0,this.pict.views["ContentEditor-TopBar"].render())}get _settingsKey(){return"retold-content-editor-settings"}saveSettings(){if("undefined"==typeof window||!window.localStorage)return;let t=this.pict.AppData.ContentEditor,e={AutoSegmentMarkdown:t.AutoSegmentMarkdown,AutoSegmentDepth:t.AutoSegmentDepth,AutoContentPreview:t.AutoContentPreview,MarkdownEditingControls:t.MarkdownEditingControls,MarkdownWordWrap:t.MarkdownWordWrap,CodeWordWrap:t.CodeWordWrap,SidebarCollapsed:t.SidebarCollapsed,SidebarWidth:t.SidebarWidth,AutoPreviewImages:t.AutoPreviewImages,AutoPreviewVideo:t.AutoPreviewVideo,AutoPreviewAudio:t.AutoPreviewAudio,ShowHiddenFiles:t.ShowHiddenFiles,TopicsFilePath:t.TopicsFilePath};try{window.localStorage.setItem(this._settingsKey,JSON.stringify(e))}catch(t){this.log.warn("Failed to save settings: "+t.message)}}_loadSettings(){if("undefined"!=typeof window&&window.localStorage)try{let t=window.localStorage.getItem(this._settingsKey);if(!t)return;let e=JSON.parse(t),i=this.pict.AppData.ContentEditor;"boolean"==typeof e.AutoSegmentMarkdown&&(i.AutoSegmentMarkdown=e.AutoSegmentMarkdown),"number"==typeof e.AutoSegmentDepth&&(i.AutoSegmentDepth=e.AutoSegmentDepth),"boolean"==typeof e.AutoContentPreview&&(i.AutoContentPreview=e.AutoContentPreview),"boolean"==typeof e.MarkdownEditingControls&&(i.MarkdownEditingControls=e.MarkdownEditingControls),"boolean"==typeof e.MarkdownWordWrap&&(i.MarkdownWordWrap=e.MarkdownWordWrap),"boolean"==typeof e.CodeWordWrap&&(i.CodeWordWrap=e.CodeWordWrap),"boolean"==typeof e.SidebarCollapsed&&(i.SidebarCollapsed=e.SidebarCollapsed),"number"==typeof e.SidebarWidth&&(i.SidebarWidth=e.SidebarWidth),"boolean"==typeof e.AutoPreviewImages&&(i.AutoPreviewImages=e.AutoPreviewImages),"boolean"==typeof e.AutoPreviewVideo&&(i.AutoPreviewVideo=e.AutoPreviewVideo),"boolean"==typeof e.AutoPreviewAudio&&(i.AutoPreviewAudio=e.AutoPreviewAudio),"boolean"==typeof e.ShowHiddenFiles&&(i.ShowHiddenFiles=e.ShowHiddenFiles),"string"==typeof e.TopicsFilePath&&(i.TopicsFilePath=e.TopicsFilePath)}catch(t){this.log.warn("Failed to load settings: "+t.message)}}},e.exports.default_configuration=t("./Pict-Application-ContentEditor-Configuration.json")},{"./Pict-Application-ContentEditor-Configuration.json":53,"./providers/Pict-Provider-ContentEditor.js":58,"./views/PictView-Editor-CodeEditor.js":59,"./views/PictView-Editor-Layout.js":60,"./views/PictView-Editor-MarkdownEditor.js":61,"./views/PictView-Editor-MarkdownReference.js":62,"./views/PictView-Editor-SettingsPanel.js":63,"./views/PictView-Editor-TopBar.js":64,"./views/PictView-Editor-Topics.js":65,"pict-application":5,"pict-section-filebrowser":30}],55:[function(t,e,i){e.exports={Name:"Retold Content Reader",Hash:"ContentReader",MainViewportViewIdentifier:"Docuserve-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"ContentReader-Pict-Application"}}},{}],56:[function(t,e,i){const n=t("pict-docuserve");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterInitializeAsync(t){this.pict.AppData.Docuserve={CatalogLoaded:!1,Catalog:null,CoverLoaded:!1,Cover:null,SidebarLoaded:!1,SidebarGroups:[],TopBarLoaded:!1,TopBar:null,ErrorPageLoaded:!1,ErrorPageHTML:null,KeywordIndexLoaded:!1,KeywordDocumentCount:0,CurrentGroup:"",CurrentModule:"",CurrentPath:"",SidebarVisible:!0,DocsBaseURL:"/content/",CatalogURL:"/content/retold-catalog.json"},this.pict.providers["Docuserve-Documentation"].loadCatalog(()=>{let e=this.pict.AppData.Docuserve;return e.CoverLoaded&&e.Cover&&e.Cover.Title?document.title=e.Cover.Title.replace(/<[^>]*>/g,""):e.TopBarLoaded&&e.TopBar&&e.TopBar.Brand&&(document.title=e.TopBar.Brand.replace(/<[^>]*>/g,"")),e.TopBar?(Array.isArray(e.TopBar.ExternalLinks)||(e.TopBar.ExternalLinks=[]),e.TopBar.ExternalLinks.push({Text:"Edit",Href:"/"})):(e.TopBarLoaded=!0,e.TopBar={Brand:"Content System",NavLinks:[],ExternalLinks:[{Text:"Edit",Href:"/"}]}),this.pict.views["Docuserve-Layout"].render(),t()})}},e.exports.default_configuration=t("./Pict-Application-ContentReader-Configuration.json")},{"./Pict-Application-ContentReader-Configuration.json":55,"pict-docuserve":10}],57:[function(t,e,i){e.exports={PictContentReader:t("./Pict-Application-ContentReader.js"),PictContentEditor:t("./Pict-Application-ContentEditor.js")},"undefined"!=typeof window&&(window.PictContentReader=e.exports.PictContentReader,window.PictContentEditor=e.exports.PictContentEditor)},{"./Pict-Application-ContentEditor.js":54,"./Pict-Application-ContentReader.js":56}],58:[function(t,e,i){const n=t("pict-provider");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}loadFile(t,e){let i="function"==typeof e?e:()=>{};if(!t)return i("No file path specified","");fetch("/api/content/read/"+encodeURIComponent(t)).then(t=>t.ok?t.json():i("File not found: "+t.status,"")).then(t=>t&&t.Success?i(null,t.Content||""):i(t?t.Error:"Unknown error","")).catch(e=>(this.log.warn("ContentEditor: Error loading file [".concat(t,"]: ").concat(e)),i(e.message,"")))}saveFile(t,e,i){let n="function"==typeof i?i:()=>{};if(!t)return n("No file path specified");fetch("/api/content/save/"+encodeURIComponent(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Content:e})}).then(t=>t.ok?t.json():n("Save failed: "+t.status)).then(t=>t&&t.Success?n(null):n(t?t.Error:"Unknown error")).catch(e=>(this.log.warn("ContentEditor: Error saving file [".concat(t,"]: ").concat(e)),n(e.message)))}uploadImage(t,e){let i="function"==typeof e?e:()=>{},n="",o=this.pict.AppData.ContentEditor.CurrentFile;if(o){let t=o.lastIndexOf("/");t>0&&(n=o.substring(0,t))}else this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(n=this.pict.AppData.PictFileBrowser.CurrentLocation);let r={"Content-Type":t.type,"x-filename":t.name};n&&(r["x-upload-path"]=n),fetch("/api/content/upload-image",{method:"POST",body:t,headers:r}).then(t=>t.json()).then(t=>t&&t.Success&&t.URL?i(null,t.URL):i(t?t.Error:"Upload failed")).catch(t=>(this.log.warn("ContentEditor: Image upload failed: ".concat(t)),i(t.message)))}listUploads(t){let e="function"==typeof t?t:()=>{};fetch("/api/content/uploads").then(t=>t.json()).then(t=>t&&t.Success?e(null,t.Files||[]):e(t?t.Error:"Unknown error",[])).catch(t=>(this.log.warn("ContentEditor: Error listing uploads: ".concat(t)),e(t.message,[])))}},e.exports.default_configuration={ProviderIdentifier:"ContentEditor-Provider",AutoInitialize:!0,AutoInitializeOrdinal:0}},{"pict-provider":19}],59:[function(t,e,i){const n=t("pict-section-code"),o={js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"xml",htm:"xml",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"scss",less:"less",sql:"sql",py:"python",rb:"ruby",java:"java",kt:"kotlin",kts:"kotlin",go:"go",rs:"rust",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",swift:"swift",php:"php",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",dockerfile:"dockerfile",docker:"dockerfile",makefile:"makefile",mk:"makefile",md:"markdown",markdown:"markdown",lua:"lua",r:"r",pl:"perl",pm:"perl",ex:"elixir",exs:"elixir",erl:"erlang",hrl:"erlang",hs:"haskell",clj:"clojure",scala:"scala",dart:"dart",groovy:"groovy",gradle:"groovy",tf:"terraform",vim:"vim",diff:"diff",patch:"diff",log:"accesslog",txt:"plaintext"};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._suppressNextDirty=!1}onAfterInitialRender(){if("undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.CodeJar&&this.connectCodeJarPrototype(window.CodeJarModules.CodeJar),"undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.hljs){let t=window.CodeJarModules.hljs,e=this._language;this._highlightFunction=function(i){i.removeAttribute("data-highlighted"),delete i.dataset.highlighted,i.className=i.className.replace(/\bhljs\b/g,"").replace(/\blanguage-\S+/g,"").trim(),i.classList.add("hljs"),e&&"plaintext"!==e&&i.classList.add("language-"+e),t.highlightElement(i)}}return super.onAfterInitialRender()}setLanguage(t){if(this._language=t,"undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.hljs){let e=window.CodeJarModules.hljs,i=t;this._highlightFunction=function(t){t.removeAttribute("data-highlighted"),delete t.dataset.highlighted,t.className=t.className.replace(/\bhljs\b/g,"").replace(/\blanguage-\S+/g,"").trim(),t.classList.add("hljs"),i&&"plaintext"!==i&&t.classList.add("language-"+i),e.highlightElement(t)}}if(this._editorElement&&(this._editorElement.className="pict-code-editor language-"+t,this.options.LineNumbers||(this._editorElement.className+=" pict-code-no-line-numbers")),this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}onCodeChange(t){super.onCodeChange(t),this._suppressNextDirty?this._suppressNextDirty=!1:this.pict.PictApplication&&(this.pict.PictApplication.markDirty(),this.pict.PictApplication.updateStats())}static getLanguageForExtension(t){if(!t)return"plaintext";let e=t.toLowerCase();return o[e]||"plaintext"}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-CodeEditor",DefaultRenderable:"CodeEditor-Wrap",DefaultDestinationAddress:"#ContentEditor-Editor-Container",TargetElementAddress:"#ContentEditor-Editor-Container",CodeDataAddress:"AppData.ContentEditor.CodeContent",ReadOnly:!1,LineNumbers:!0,Language:"javascript",Tab:"\t",AutoRender:!1,Renderables:[{RenderableHash:"CodeEditor-Wrap",TemplateHash:"CodeEditor-Container",DestinationAddress:"#ContentEditor-Editor-Container"}]},e.exports.ExtensionLanguageMap=o},{"pict-section-code":22}],60:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._minSidebarWidth=140,this._maxSidebarWidth=600}onAfterRender(t,e,i,n){this.pict.views["ContentEditor-TopBar"].render();let o=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");o&&o[0]&&!this.pict.AppData.ContentEditor.CurrentFile&&(o[0].innerHTML='<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#8A7F72;font-size:1.1em;">Select a file from the sidebar to begin editing</div>'),this.pict.CSSMap.injectCSS();let r=this.pict.AppData.ContentEditor,s=document.getElementById("ContentEditor-SidebarWrap"),a=document.getElementById("ContentEditor-SidebarToggle");s&&(s.style.width=r.SidebarWidth+"px",r.SidebarCollapsed&&(s.classList.add("collapsed"),a&&(a.innerHTML="&#x25B6;")));let l=this;return a&&a.addEventListener("click",()=>{l.toggleSidebar()}),this._wireResizeHandle(),window.addEventListener("hashchange",()=>{l.pict.PictApplication.resolveHash()}),window.addEventListener("keydown",t=>{if((t.metaKey||t.ctrlKey)&&"s"===t.key)return t.preventDefault(),void l.pict.PictApplication.saveCurrentFile();if("F1"===t.key)return t.preventDefault(),void l._handleF1();if("F2"===t.key)return t.preventDefault(),void l.toggleSidebar();if("F3"===t.key)return t.preventDefault(),void l.toggleUploadForm();if((t.metaKey||t.ctrlKey)&&t.shiftKey&&("u"===t.key||"U"===t.key))return t.preventDefault(),void l.toggleUploadForm();if("F4"===t.key)return t.preventDefault(),void l.pict.PictApplication.handleF4TopicAction();if((t.metaKey||t.ctrlKey)&&t.shiftKey&&("t"===t.key||"T"===t.key))return t.preventDefault(),void l.pict.PictApplication.handleF4TopicAction();if("Escape"===t.key){let e=document.getElementById("ContentEditor-UploadOverlay");if(e&&e.classList.contains("open"))return void l.closeUploadForm();let i=document.getElementById("ContentEditor-ConfirmOverlay");if(i&&i.classList.contains("open"))return;if(l.pict.AppData.ContentEditor.CurrentFile)return t.preventDefault(),void l.pict.PictApplication.closeCurrentFile()}}),super.onAfterRender(t,e,i,n)}toggleSidebar(){let t=document.getElementById("ContentEditor-SidebarWrap"),e=document.getElementById("ContentEditor-SidebarToggle");if(!t)return;let i=this.pict.AppData.ContentEditor;i.SidebarCollapsed=!i.SidebarCollapsed,i.SidebarCollapsed?(t.classList.add("collapsed"),e&&(e.innerHTML="&#x25B6;")):(t.classList.remove("collapsed"),t.style.width=i.SidebarWidth+"px",e&&(e.innerHTML="&#x25C0;")),this.pict.PictApplication.saveSettings()}switchSidebarTab(t){let e={files:document.getElementById("ContentEditor-Sidebar-Container"),reference:document.getElementById("ContentEditor-SidebarReference-Container"),topics:document.getElementById("ContentEditor-SidebarTopics-Container")},i={files:document.getElementById("ContentEditor-SidebarTab-Files"),reference:document.getElementById("ContentEditor-SidebarTab-Reference"),topics:document.getElementById("ContentEditor-SidebarTab-Topics")};for(let t in e)e[t]&&(e[t].style.display="none"),i[t]&&i[t].classList.remove("active");if(e[t]&&(e[t].style.display=""),i[t]&&i[t].classList.add("active"),"reference"===t){let t=this.pict.views["ContentEditor-MarkdownReference"];t&&!t._hasRendered&&t.render()}if("topics"===t){let t=this.pict.views["ContentEditor-Topics"];t&&!t._hasRendered&&t.render()}}_handleF1(){if(this.pict.AppData.ContentEditor.SidebarCollapsed)return this.toggleSidebar(),void this.switchSidebarTab("reference");let t=document.getElementById("ContentEditor-SidebarTab-Reference");t&&t.classList.contains("active")?this.switchSidebarTab("files"):this.switchSidebarTab("reference")}getActiveSidebarTab(){let t=document.getElementById("ContentEditor-SidebarTab-Reference"),e=document.getElementById("ContentEditor-SidebarTab-Topics");return t&&t.classList.contains("active")?"reference":e&&e.classList.contains("active")?"topics":"files"}toggleUploadForm(){let t=document.getElementById("ContentEditor-UploadOverlay");t&&(t.classList.contains("open")?this.closeUploadForm():this.openUploadForm())}openUploadForm(){let t=document.getElementById("ContentEditor-UploadOverlay");t&&t.classList.add("open"),this._wireUploadDropzone()}closeUploadForm(){let t=document.getElementById("ContentEditor-UploadOverlay");t&&t.classList.remove("open");let e=document.getElementById("ContentEditor-UploadFileInput");e&&(e.value="");let i=document.getElementById("ContentEditor-UploadStatus");i&&(i.innerHTML="");let n=document.getElementById("ContentEditor-UploadResult");n&&(n.innerHTML="")}onUploadOverlayClick(t){"ContentEditor-UploadOverlay"===t.target.id&&this.closeUploadForm()}onUploadFileSelected(t){t.files&&t.files.length>0&&this._uploadFile(t.files[0])}_wireUploadDropzone(){let t=document.getElementById("ContentEditor-UploadDropzone");if(!t||t._wired)return;t._wired=!0;let e=this;t.addEventListener("dragover",e=>{e.preventDefault(),e.stopPropagation(),t.classList.add("dragover")}),t.addEventListener("dragleave",e=>{e.preventDefault(),e.stopPropagation(),t.classList.remove("dragover")}),t.addEventListener("drop",i=>{i.preventDefault(),i.stopPropagation(),t.classList.remove("dragover"),i.dataTransfer&&i.dataTransfer.files&&i.dataTransfer.files.length>0&&e._uploadFile(i.dataTransfer.files[0])})}_uploadFile(t){let e=document.getElementById("ContentEditor-UploadStatus"),i=document.getElementById("ContentEditor-UploadResult");if(!t)return;if(!t.type.startsWith("image/"))return void(e&&(e.innerHTML='<span class="content-editor-upload-status-error">Only image files are supported.</span>'));e&&(e.innerHTML="Uploading <strong>"+t.name+"</strong>..."),i&&(i.innerHTML="");let n=this,o=this.pict.providers["ContentEditor-Provider"];o?o.uploadImage(t,(o,r)=>{if(o)return void(e&&(e.innerHTML='<span class="content-editor-upload-status-error">Upload failed: '+o+"</span>"));e&&(e.innerHTML='<span class="content-editor-upload-status-success">Uploaded successfully!</span>');let s="!["+t.name+"]("+r+")";i&&(i.innerHTML='<div class="content-editor-upload-result"><div class="content-editor-upload-result-label">Markdown</div><div class="content-editor-upload-result-url"><span class="content-editor-upload-result-text">'+s+'</span><button class="content-editor-upload-result-copy" onclick="navigator.clipboard.writeText(\''+s.replace(/'/g,"\\'")+'\').then(function(){this.textContent=\'Copied!\'}.bind(this))">Copy</button></div><div class="content-editor-upload-result-label" style="margin-top:8px">URL</div><div class="content-editor-upload-result-url"><span class="content-editor-upload-result-text">'+r+'</span><button class="content-editor-upload-result-copy" onclick="navigator.clipboard.writeText(\''+r.replace(/'/g,"\\'")+"').then(function(){this.textContent='Copied!'}.bind(this))\">Copy</button></div></div>"),n.pict.PictApplication.loadFileList()}):e&&(e.innerHTML='<span class="content-editor-upload-status-error">Provider not available.</span>')}_wireResizeHandle(){let t=document.getElementById("ContentEditor-ResizeHandle"),e=document.getElementById("ContentEditor-SidebarWrap");if(!t||!e)return;let i=this,n=!1,o=0,r=0;function s(t){if(!n)return;let s=t.clientX-o,a=r+s;a<i._minSidebarWidth&&(a=i._minSidebarWidth),a>i._maxSidebarWidth&&(a=i._maxSidebarWidth),e.style.width=a+"px"}function a(){n&&(n=!1,t.classList.remove("dragging"),e.style.transition="",document.body.style.userSelect="",document.body.style.cursor="",i.pict.AppData.ContentEditor.SidebarWidth=e.offsetWidth,i.pict.PictApplication.saveSettings(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a))}t.addEventListener("mousedown",function(l){i.pict.AppData.ContentEditor.SidebarCollapsed||(l.preventDefault(),n=!0,o=l.clientX,r=e.offsetWidth,t.classList.add("dragging"),e.style.transition="none",document.body.style.userSelect="none",document.body.style.cursor="col-resize",document.addEventListener("mousemove",s),document.addEventListener("mouseup",a))})}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"ContentEditor-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\tbackground: #F5F3EE;\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 wrapper holds the sidebar content + collapse toggle */\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/* Inner wrapper: vertical flex for tab bar + panes */\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/* Sidebar tab bar */\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 #DDD6CA;\n\t\t\tbackground: #F5F0EA;\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: #8A7F72;\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}\n\t\t.content-editor-sidebar-tab:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-sidebar-tab.active\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tborder-bottom-color: #2E7D74;\n\t\t}\n\t\t.content-editor-sidebar-addfile\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 30px;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 1.1rem;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, background 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-addfile:hover\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t/* Sidebar panes */\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: #FAF8F4;\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/* Collapse / expand toggle */\n\t\t.content-editor-sidebar-toggle\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 8px;\n\t\t\tright: -20px;\n\t\t\twidth: 20px;\n\t\t\theight: 28px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: #FAF8F4;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-left: none;\n\t\t\tborder-radius: 0 4px 4px 0;\n\t\t\tcursor: pointer;\n\t\t\tz-index: 10;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 11px;\n\t\t\tline-height: 1;\n\t\t\ttransition: color 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-toggle:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-sidebar-wrap.collapsed .content-editor-sidebar-toggle\n\t\t{\n\t\t\tright: -20px;\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 #DDD6CA;\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: #2E7D74;\n\t\t\tborder-right-color: #2E7D74;\n\t\t}\n\t\t/* File browser layout overrides for sidebar use */\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}\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/* Hide size/date columns — the sidebar is too narrow for them */\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/* Hide the column header bar in sidebar mode */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-header\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Editor-Container\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 44px 16px 16px 16px;\n\t\t}\n\t\t/* Code editor: fill the container and remove outer border */\n\t\t#ContentEditor-Editor-Container .pict-code-editor-wrap\n\t\t{\n\t\t\theight: calc(100% - 4px);\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t}\n\t\t#ContentEditor-Editor-Container .pict-code-editor\n\t\t{\n\t\t\tmin-height: unset;\n\t\t\theight: 100%;\n\t\t\tbackground: #FAFAFA;\n\t\t}\n\t\t/* Binary file preview */\n\t\t.binary-preview-image-wrap\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-image\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 24px;\n\t\t}\n\t\t.binary-preview-image img\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 400px;\n\t\t\tobject-fit: contain;\n\t\t\tborder-radius: 4px;\n\t\t}\n\t\t.binary-preview-card\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 20px;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 24px;\n\t\t\tmax-width: 600px;\n\t\t}\n\t\t.binary-preview-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 64px;\n\t\t\theight: 64px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-radius: 8px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: #5E5549;\n\t\t\tletter-spacing: 0.5px;\n\t\t}\n\t\t.binary-preview-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.binary-preview-name\n\t\t{\n\t\t\tfont-size: 1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 6px;\n\t\t\tword-break: break-all;\n\t\t}\n\t\t.binary-preview-meta\n\t\t{\n\t\t\tfont-size: 0.8rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tline-height: 1.6;\n\t\t}\n\t\t.binary-preview-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.binary-preview-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 8px 16px;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-decoration: none;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.binary-preview-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.binary-preview-btn-secondary\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.binary-preview-btn-secondary:hover\n\t\t{\n\t\t\tborder-color: #8A7F72;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.binary-preview-btn-preview\n\t\t{\n\t\t\tpadding: 10px 20px;\n\t\t\tfont-size: 0.85rem;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tbackground: #FAF8F4;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 6px;\n\t\t\ttransition: background 0.15s, border-color 0.15s;\n\t\t}\n\t\t.binary-preview-btn-preview:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-color: #8A7F72;\n\t\t}\n\t\t#ContentEditor-MediaPreviewPlaceholder\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-media-wrap\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-video\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 500px;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tbackground: #000;\n\t\t}\n\t\t.binary-preview-audio\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-width: 500px;\n\t\t}\n\t\t/* Image upload overlay */\n\t\t.content-editor-upload-overlay\n\t\t{\n\t\t\tdisplay: none;\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\tz-index: 1099;\n\t\t\tbackground: rgba(0, 0, 0, 0.35);\n\t\t}\n\t\t.content-editor-upload-overlay.open\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-upload-panel\n\t\t{\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 10px;\n\t\t\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);\n\t\t\twidth: 420px;\n\t\t\tmax-width: 90vw;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-upload-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 #EDE9E3;\n\t\t}\n\t\t.content-editor-upload-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-upload-close\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tfont-size: 1.2rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 2px 6px;\n\t\t\tline-height: 1;\n\t\t\tborder-radius: 4px;\n\t\t}\n\t\t.content-editor-upload-close:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t.content-editor-upload-body\n\t\t{\n\t\t\tpadding: 18px;\n\t\t}\n\t\t.content-editor-upload-dropzone\n\t\t{\n\t\t\tborder: 2px dashed #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tpadding: 28px 16px;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color 0.15s, background 0.15s;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.content-editor-upload-dropzone:hover,\n\t\t.content-editor-upload-dropzone.dragover\n\t\t{\n\t\t\tborder-color: #2E7D74;\n\t\t\tbackground: #F0FAF8;\n\t\t}\n\t\t.content-editor-upload-dropzone-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-upload-dropzone-text\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.content-editor-upload-dropzone-hint\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-top: 4px;\n\t\t}\n\t\t.content-editor-upload-file-input\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.content-editor-upload-status\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\tmin-height: 20px;\n\t\t}\n\t\t.content-editor-upload-status-error\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t}\n\t\t.content-editor-upload-status-success\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.content-editor-upload-result\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tpadding: 10px 12px;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t}\n\t\t.content-editor-upload-result-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 4px;\n\t\t}\n\t\t.content-editor-upload-result-url\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.content-editor-upload-result-text\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-family: monospace;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #3D3229;\n\t\t\tword-break: break-all;\n\t\t}\n\t\t.content-editor-upload-result-copy\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 4px 10px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-upload-result-copy:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.content-editor-upload-kbd\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 1px 5px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-family: monospace;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.content-editor-upload-footer\n\t\t{\n\t\t\tpadding: 10px 18px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-align: center;\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-Layout-Shell-Template",Template:'\n<div id="ContentEditor-TopBar-Container"></div>\n<div class="content-editor-body">\n\t<div class="content-editor-sidebar-wrap" id="ContentEditor-SidebarWrap" style="width:250px">\n\t\t<div class="content-editor-sidebar-inner">\n\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t<button class="content-editor-sidebar-tab active" id="ContentEditor-SidebarTab-Files"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Reference"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'reference\')">Reference</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Topics"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'topics\')">Topics</button>\n\t\t\t\t<button class="content-editor-sidebar-addfile" title="New file"\n\t\t\t\t\tonclick="{~P~}.PictApplication.promptNewFile()">+</button>\n\t\t\t</div>\n\t\t\t<div id="ContentEditor-Sidebar-Container" class="content-editor-sidebar-pane"></div>\n\t\t\t<div id="ContentEditor-SidebarReference-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t\t<div id="ContentEditor-SidebarTopics-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t</div>\n\t\t<div class="content-editor-resize-handle" id="ContentEditor-ResizeHandle"></div>\n\t\t<div class="content-editor-sidebar-toggle" id="ContentEditor-SidebarToggle">&#x25C0;</div>\n\t</div>\n\t<div id="ContentEditor-Editor-Container"></div>\n</div>\n<div class="content-editor-upload-overlay" id="ContentEditor-UploadOverlay"\n\tonclick="{~P~}.views[\'ContentEditor-Layout\'].onUploadOverlayClick(event)">\n\t<div class="content-editor-upload-panel">\n\t\t<div class="content-editor-upload-header">\n\t\t\t<span class="content-editor-upload-title">Upload Image</span>\n\t\t\t<button class="content-editor-upload-close"\n\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].toggleUploadForm()">&times;</button>\n\t\t</div>\n\t\t<div class="content-editor-upload-body">\n\t\t\t<div class="content-editor-upload-dropzone" id="ContentEditor-UploadDropzone"\n\t\t\t\tonclick="document.getElementById(\'ContentEditor-UploadFileInput\').click()">\n\t\t\t\t<div class="content-editor-upload-dropzone-icon">&#x1F4F7;</div>\n\t\t\t\t<div class="content-editor-upload-dropzone-text">Drop an image here or click to browse</div>\n\t\t\t\t<div class="content-editor-upload-dropzone-hint">PNG, JPG, GIF, WebP, SVG, BMP</div>\n\t\t\t</div>\n\t\t\t<input type="file" class="content-editor-upload-file-input" id="ContentEditor-UploadFileInput"\n\t\t\t\taccept="image/png,image/jpeg,image/gif,image/webp,image/svg+xml,image/bmp"\n\t\t\t\tonchange="{~P~}.views[\'ContentEditor-Layout\'].onUploadFileSelected(this)">\n\t\t\t<div class="content-editor-upload-status" id="ContentEditor-UploadStatus"></div>\n\t\t\t<div id="ContentEditor-UploadResult"></div>\n\t\t</div>\n\t\t<div class="content-editor-upload-footer">\n\t\t\t<span class="content-editor-upload-kbd">F3</span> or\n\t\t\t<span class="content-editor-upload-kbd">Ctrl+Shift+U</span> to toggle\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-Layout-Shell",TemplateHash:"ContentEditor-Layout-Shell-Template",DestinationAddress:"#ContentEditor-Application-Container",RenderMethod:"replace"}]}},{"pict-view":52}],61:[function(t,e,i){const n=t("pict-section-markdowneditor");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onImageUpload(t,e,i){let n=this.pict.providers["ContentEditor-Provider"];return!!n&&(n.uploadImage(t,(t,e)=>{t?i(t):i(null,e)}),!0)}customConfigureExtensions(t,e){if(this.pict.AppData.ContentEditor&&this.pict.AppData.ContentEditor.MarkdownWordWrap){let e=this._codeMirrorModules;e&&e.EditorView&&e.EditorView.lineWrapping&&t.push(e.EditorView.lineWrapping)}return t}onContentChange(t,e){this.pict.PictApplication&&(this.pict.PictApplication.markDirty(),this.pict.PictApplication.updateStats())}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-MarkdownEditor",DefaultRenderable:"MarkdownEditor-Wrap",DefaultDestinationAddress:"#ContentEditor-Editor-Container",TargetElementAddress:"#ContentEditor-Editor-Container",ContentDataAddress:"AppData.ContentEditor.Document.Segments",ReadOnly:!1,EnableRichPreview:!0,AutoRender:!1,Renderables:[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",DestinationAddress:"#ContentEditor-Editor-Container"}]}},{"pict-section-markdowneditor":50}],62:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-MarkdownReference",DefaultRenderable:"ContentEditor-MarkdownReference-Display",DefaultDestinationAddress:"#ContentEditor-SidebarReference-Container",AutoRender:!1,CSS:"\n\t\t.md-ref-container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.md-ref-search-bar\n\t\t{\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tz-index: 5;\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\tbackground: #F5F0EA;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-search-input\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8rem;\n\t\t\tbackground: #FFF;\n\t\t\tcolor: #3D3229;\n\t\t\toutline: none;\n\t\t}\n\t\t.md-ref-search-input:focus\n\t\t{\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.md-ref-search-nav\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\twidth: 26px;\n\t\t\theight: 26px;\n\t\t\tcursor: pointer;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.7rem;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-search-nav:hover\n\t\t{\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.md-ref-search-nav:disabled\n\t\t{\n\t\t\topacity: 0.3;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.md-ref-search-count\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\tmin-width: 32px;\n\t\t\ttext-align: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-content\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 12px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tline-height: 1.6;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.md-ref-content h2\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tmargin: 20px 0 8px 0;\n\t\t\tpadding-bottom: 4px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.md-ref-content h2:first-child\n\t\t{\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.md-ref-content h3\n\t\t{\n\t\t\tfont-size: 0.85rem;\n\t\t\tmargin: 14px 0 6px 0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.md-ref-content p\n\t\t{\n\t\t\tmargin: 6px 0;\n\t\t}\n\t\t.md-ref-content code\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tpadding: 1px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.md-ref-content pre\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 8px 10px;\n\t\t\toverflow-x: auto;\n\t\t\tfont-size: 0.76rem;\n\t\t\tline-height: 1.5;\n\t\t\tmargin: 6px 0;\n\t\t\tposition: relative;\n\t\t}\n\t\t.md-ref-content pre code\n\t\t{\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.md-ref-copy-btn\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 4px;\n\t\t\tright: 4px;\n\t\t\tbackground: #FAF8F4;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 2px 6px;\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.15s;\n\t\t}\n\t\t.md-ref-content pre:hover .md-ref-copy-btn\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.md-ref-copy-btn:hover\n\t\t{\n\t\t\tbackground: #EDE9E3;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t/* Search highlight */\n\t\tmark.md-ref-highlight\n\t\t{\n\t\t\tbackground: #FFEAA7;\n\t\t\tcolor: inherit;\n\t\t\tpadding: 0;\n\t\t\tborder-radius: 2px;\n\t\t}\n\t\tmark.md-ref-highlight-active\n\t\t{\n\t\t\tbackground: #E8A94D;\n\t\t\tcolor: #FFF;\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-MarkdownReference-Template",Template:'\n<div class="md-ref-container">\n\t<div class="md-ref-search-bar">\n\t\t<input type="text" class="md-ref-search-input"\n\t\t\tid="ContentEditor-MdRef-SearchInput"\n\t\t\tplaceholder="Search reference..."\n\t\t\toninput="{~P~}.views[\'ContentEditor-MarkdownReference\'].onSearchInput(this.value)"\n\t\t\tonkeydown="{~P~}.views[\'ContentEditor-MarkdownReference\'].onSearchKeydown(event)">\n\t\t<span class="md-ref-search-count" id="ContentEditor-MdRef-SearchCount"></span>\n\t\t<button class="md-ref-search-nav" id="ContentEditor-MdRef-SearchPrev"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-MarkdownReference\'].navigateMatch(-1)" disabled>&#x25B2;</button>\n\t\t<button class="md-ref-search-nav" id="ContentEditor-MdRef-SearchNext"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-MarkdownReference\'].navigateMatch(1)" disabled>&#x25BC;</button>\n\t</div>\n\t<div class="md-ref-content" id="ContentEditor-MdRef-Content">\n\n<h2>Headings</h2>\n<p>Use <code>#</code> through <code>######</code> for heading levels 1&ndash;6.</p>\n<pre><code># Heading 1\n## Heading 2\n### Heading 3\n#### Heading 4\n##### Heading 5\n###### Heading 6</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Emphasis</h2>\n<p>Bold, italic, strikethrough, and combinations.</p>\n<pre><code>**bold text**\n*italic text*\n***bold and italic***\n~~strikethrough~~\n**bold and ~~strikethrough~~**</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Inline Code</h2>\n<p>Wrap text in backticks for inline code.</p>\n<pre><code>Use `console.log()` to debug.\nUse ``double backticks for `literal` backticks``.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Links</h2>\n<p>Inline links, reference links, and autolinks.</p>\n<pre><code>[Link text](https://example.com)\n[Link with title](https://example.com "Title text")\n\n[Reference link][1]\n[1]: https://example.com\n\nAutolink: https://example.com\nEmail: user@example.com</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Images</h2>\n<pre><code>![Alt text](image.png)\n![Alt text](image.png "Image title")\n\n[![Linked image](image.png)](https://example.com)</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Unordered Lists</h2>\n<p>Use <code>-</code>, <code>*</code>, or <code>+</code> for bullet items.</p>\n<pre><code>- Item one\n- Item two\n - Nested item\n - Another nested\n - Deeply nested\n- Item three</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Ordered Lists</h2>\n<pre><code>1. First item\n2. Second item\n3. Third item\n 1. Sub-item A\n 2. Sub-item B</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Task Lists</h2>\n<pre><code>- [x] Completed task\n- [ ] Incomplete task\n- [ ] Another task</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Blockquotes</h2>\n<pre><code>&gt; This is a blockquote.\n&gt;\n&gt; It can span multiple paragraphs.\n&gt;\n&gt;&gt; Nested blockquote.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Code Blocks</h2>\n<p>Use triple backticks with an optional language identifier.</p>\n<pre><code>```javascript\nfunction hello()\n{\n console.log("Hello, world!");\n}\n```\n\n```python\ndef hello():\n print("Hello, world!")\n```\n\n```css\n.container {\n display: flex;\n gap: 16px;\n}\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Tables</h2>\n<p>Use pipes and hyphens. Colons control alignment.</p>\n<pre><code>| Left Align | Center Align | Right Align |\n|:-----------|:------------:|------------:|\n| Cell 1 | Cell 2 | Cell 3 |\n| Cell 4 | Cell 5 | Cell 6 |</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Horizontal Rules</h2>\n<p>Three or more hyphens, asterisks, or underscores.</p>\n<pre><code>---\n\n***\n\n___</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Footnotes</h2>\n<pre><code>Here is a footnote reference[^1] and another[^note].\n\n[^1]: This is the footnote content.\n[^note]: Footnotes can have any label.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>HTML in Markdown</h2>\n<p>Raw HTML is allowed in GitHub-Flavored Markdown.</p>\n<pre><code>&lt;details&gt;\n&lt;summary&gt;Click to expand&lt;/summary&gt;\n\nHidden content here.\n\n&lt;/details&gt;\n\n&lt;kbd&gt;Ctrl&lt;/kbd&gt; + &lt;kbd&gt;S&lt;/kbd&gt; to save.\n\n&lt;mark&gt;Highlighted text&lt;/mark&gt;\n\n&lt;sup&gt;superscript&lt;/sup&gt; and &lt;sub&gt;subscript&lt;/sub&gt;</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Escaping Characters</h2>\n<p>Backslash-escape special markdown characters.</p>\n<pre><code>\\*not italic\\*\n\\# not a heading\n\\[not a link\\](url)\n\\`not code\\`</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Line Breaks</h2>\n<pre><code>End a line with two spaces\nto create a line break.\n\nOr use a blank line\n\nfor a new paragraph.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>KaTeX &mdash; Inline Math</h2>\n<p>Wrap expressions with single dollar signs for inline math.</p>\n<pre><code>The equation $E = mc^2$ is famous.\n\nThe quadratic formula is $x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$.\n\nGreek letters: $\\alpha$, $\\beta$, $\\gamma$, $\\delta$, $\\theta$, $\\pi$.\n\nSubscripts and superscripts: $x_i^2$ and $a_{n+1}$.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>KaTeX &mdash; Display Math</h2>\n<p>Use double dollar signs on their own lines for display (block) math.</p>\n\n<h3>Integral</h3>\n<pre><code>$$\n\\int_{-\\infty}^{\\infty} e^{-x^2} \\, dx = \\sqrt{\\pi}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Summation</h3>\n<pre><code>$$\n\\sum_{n=1}^{\\infty} \\frac{1}{n^2} = \\frac{\\pi^2}{6}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Matrix</h3>\n<pre><code>$$\n\\begin{bmatrix}\na &amp; b \\\\\nc &amp; d\n\\end{bmatrix}\n\\begin{bmatrix}\nx \\\\\ny\n\\end{bmatrix}\n=\n\\begin{bmatrix}\nax + by \\\\\ncx + dy\n\\end{bmatrix}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Aligned Equations</h3>\n<pre><code>$$\n\\begin{aligned}\nf(x) &amp;= x^2 + 2x + 1 \\\\\n &amp;= (x + 1)^2\n\\end{aligned}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Cases (Piecewise)</h3>\n<pre><code>$$\nf(x) = \\begin{cases}\nx^2 &amp; \\text{if } x \\geq 0 \\\\\n-x^2 &amp; \\text{if } x &lt; 0\n\\end{cases}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Fractions &amp; Limits</h3>\n<pre><code>$$\n\\lim_{x \\to 0} \\frac{\\sin x}{x} = 1\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid &mdash; Flowchart</h2>\n<pre><code>```mermaid\ngraph TD\n A[Start] --&gt; B{Decision}\n B --&gt;|Yes| C[Do something]\n B --&gt;|No| D[Do something else]\n C --&gt; E[End]\n D --&gt; E\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid &mdash; Sequence Diagram</h2>\n<pre><code>```mermaid\nsequenceDiagram\n participant A as Alice\n participant B as Bob\n A-&gt;&gt;B: Hello Bob\n B--&gt;&gt;A: Hi Alice\n A-&gt;&gt;B: How are you?\n B--&gt;&gt;A: Great!\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid &mdash; Gantt Chart</h2>\n<pre><code>```mermaid\ngantt\n title Project Timeline\n dateFormat YYYY-MM-DD\n section Phase 1\n Research :a1, 2024-01-01, 30d\n Design :a2, after a1, 20d\n section Phase 2\n Development :b1, after a2, 40d\n Testing :b2, after b1, 15d\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid &mdash; Class Diagram</h2>\n<pre><code>```mermaid\nclassDiagram\n Animal &lt;|-- Duck\n Animal &lt;|-- Fish\n Animal : +int age\n Animal : +String gender\n Animal : +swim()\n Duck : +String beakColor\n Duck : +quack()\n Fish : +int sizeInFeet\n Fish : +canEat()\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid &mdash; State Diagram</h2>\n<pre><code>```mermaid\nstateDiagram-v2\n [*] --&gt; Idle\n Idle --&gt; Processing : Start\n Processing --&gt; Done : Complete\n Processing --&gt; Error : Fail\n Error --&gt; Idle : Reset\n Done --&gt; [*]\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-MarkdownReference-Display",TemplateHash:"ContentEditor-MarkdownReference-Template",DestinationAddress:"#ContentEditor-SidebarReference-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._hasRendered=!1,this._searchMatches=[],this._currentMatchIndex=-1,this._originalContent=""}onAfterRender(t,e,i,n){this._hasRendered=!0;let o=document.getElementById("ContentEditor-MdRef-Content");return o&&(this._originalContent=o.innerHTML),this.pict.CSSMap.injectCSS(),super.onAfterRender(t,e,i,n)}copyCodeBlock(t){let e=t.closest("pre");if(!e)return;let i=e.querySelector("code");if(!i)return;let n=i.textContent;navigator.clipboard&&navigator.clipboard.writeText(n).then(()=>{t.textContent="Copied!",setTimeout(()=>{t.textContent="Copy"},1500)})}onSearchInput(t){this._performSearch(t)}onSearchKeydown(t){"Enter"===t.key&&(t.preventDefault(),t.shiftKey?this.navigateMatch(-1):this.navigateMatch(1)),"Escape"===t.key&&(t.target.value="",this._clearSearch())}navigateMatch(t){if(0===this._searchMatches.length)return;this._currentMatchIndex>=0&&this._searchMatches[this._currentMatchIndex]&&this._searchMatches[this._currentMatchIndex].classList.remove("md-ref-highlight-active"),this._currentMatchIndex+=t,this._currentMatchIndex>=this._searchMatches.length&&(this._currentMatchIndex=0),this._currentMatchIndex<0&&(this._currentMatchIndex=this._searchMatches.length-1);let e=this._searchMatches[this._currentMatchIndex];e.classList.add("md-ref-highlight-active"),e.scrollIntoView({behavior:"smooth",block:"center"}),this._updateSearchCount()}_performSearch(t){let e=document.getElementById("ContentEditor-MdRef-Content");if(!e)return;if(e.innerHTML=this._originalContent,this._searchMatches=[],this._currentMatchIndex=-1,!t||t.length<2)return this._updateSearchCount(),void this._updateNavButtons();let i,n=t.toLowerCase(),o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=[];for(;i=o.nextNode();)i.nodeValue.toLowerCase().indexOf(n)>=0&&r.push(i);for(let t=0;t<r.length;t++)this._highlightTextNode(r[t],n);this._searchMatches=Array.from(e.querySelectorAll("mark.md-ref-highlight")),this._searchMatches.length>0&&(this._currentMatchIndex=0,this._searchMatches[0].classList.add("md-ref-highlight-active"),this._searchMatches[0].scrollIntoView({behavior:"smooth",block:"center"})),this._updateSearchCount(),this._updateNavButtons()}_highlightTextNode(t,e){let i=t.nodeValue,n=i.toLowerCase(),o=t.parentNode,r=document.createDocumentFragment(),s=0,a=n.indexOf(e);for(;a>=0;){a>s&&r.appendChild(document.createTextNode(i.substring(s,a)));let t=document.createElement("mark");t.className="md-ref-highlight",t.textContent=i.substring(a,a+e.length),r.appendChild(t),s=a+e.length,a=n.indexOf(e,s)}s<i.length&&r.appendChild(document.createTextNode(i.substring(s))),o.replaceChild(r,t)}_updateSearchCount(){let t=document.getElementById("ContentEditor-MdRef-SearchCount");if(t)if(0===this._searchMatches.length){let e=document.getElementById("ContentEditor-MdRef-SearchInput");e&&e.value&&e.value.length>=2?t.textContent="0":t.textContent=""}else t.textContent=this._currentMatchIndex+1+"/"+this._searchMatches.length}_updateNavButtons(){let t=document.getElementById("ContentEditor-MdRef-SearchPrev"),e=document.getElementById("ContentEditor-MdRef-SearchNext"),i=this._searchMatches.length>0;t&&(t.disabled=!i),e&&(e.disabled=!i)}_clearSearch(){let t=document.getElementById("ContentEditor-MdRef-Content");t&&this._originalContent&&(t.innerHTML=this._originalContent),this._searchMatches=[],this._currentMatchIndex=-1,this._updateSearchCount(),this._updateNavButtons()}},e.exports.default_configuration=o},{"pict-view":52}],63:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._isOpen=!1}onAfterRender(t,e,i,n){let o=this.pict.AppData.ContentEditor,r=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-MarkdownWordWrap");r&&r[0]&&(r[0].checked=o.MarkdownWordWrap);let s=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-CodeWordWrap");s&&s[0]&&(s[0].checked=o.CodeWordWrap);let a=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-EditingControls");a&&a[0]&&(a[0].checked=o.MarkdownEditingControls);let l=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreview");l&&l[0]&&(l[0].checked=o.AutoContentPreview);let c=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoSegment");c&&c[0]&&(c[0].checked=o.AutoSegmentMarkdown);let d=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-SegmentDepth");d&&d[0]&&(d[0].value=String(o.AutoSegmentDepth),d[0].disabled=!o.AutoSegmentMarkdown);let p=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewImages");p&&p[0]&&(p[0].checked=o.AutoPreviewImages);let h=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewVideo");h&&h[0]&&(h[0].checked=o.AutoPreviewVideo);let u=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewAudio");u&&u[0]&&(u[0].checked=o.AutoPreviewAudio);let f=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-ShowHiddenFiles");return f&&f[0]&&(f[0].checked=o.ShowHiddenFiles),super.onAfterRender(t,e,i,n)}togglePanel(){this._isOpen?this.closePanel():this.openPanel()}openPanel(){this._isOpen=!0;let t=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsFlyout"),e=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsOverlay"),i=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsGear");t&&t[0]&&t[0].classList.add("open"),e&&e[0]&&e[0].classList.add("open"),i&&i[0]&&i[0].classList.add("active")}closePanel(){this._isOpen=!1;let t=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsFlyout"),e=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsOverlay"),i=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsGear");t&&t[0]&&t[0].classList.remove("open"),e&&e[0]&&e[0].classList.remove("open"),i&&i[0]&&i[0].classList.remove("active")}onMarkdownWordWrapChanged(t){this.pict.AppData.ContentEditor.MarkdownWordWrap=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e._segmentEditors)for(let i in e._segmentEditors){let n=e._segmentEditors[i];n&&n.contentDOM&&(t?n.contentDOM.classList.add("cm-lineWrapping"):n.contentDOM.classList.remove("cm-lineWrapping"))}}onCodeWordWrapChanged(t){this.pict.AppData.ContentEditor.CodeWordWrap=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-CodeEditor"];e&&e._editorElement&&"code"===this.pict.AppData.ContentEditor.ActiveEditor&&(t?(e._editorElement.style.whiteSpace="pre-wrap",e._editorElement.style.overflowWrap="break-word"):(e._editorElement.style.whiteSpace="pre",e._editorElement.style.overflowWrap="normal"))}onEditingControlsChanged(t){this.pict.AppData.ContentEditor.MarkdownEditingControls=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e.toggleControls(t)}onAutoPreviewChanged(t){this.pict.AppData.ContentEditor.AutoContentPreview=t,this.pict.PictApplication.saveSettings()}onAutoSegmentChanged(t){this.pict.AppData.ContentEditor.AutoSegmentMarkdown=t,this.pict.PictApplication.saveSettings();let e=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-SegmentDepth");e&&e[0]&&(e[0].disabled=!t)}onSegmentDepthChanged(t){this.pict.AppData.ContentEditor.AutoSegmentDepth=parseInt(t,10)||1,this.pict.PictApplication.saveSettings()}onAutoPreviewImagesChanged(t){this.pict.AppData.ContentEditor.AutoPreviewImages=t,this.pict.PictApplication.saveSettings()}onAutoPreviewVideoChanged(t){this.pict.AppData.ContentEditor.AutoPreviewVideo=t,this.pict.PictApplication.saveSettings()}onAutoPreviewAudioChanged(t){this.pict.AppData.ContentEditor.AutoPreviewAudio=t,this.pict.PictApplication.saveSettings()}onShowHiddenFilesChanged(t){this.pict.AppData.ContentEditor.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings();let e=this;this.pict.PictApplication.syncHiddenFilesSetting(()=>{e.pict.PictApplication.loadFileList()})}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-SettingsPanel",DefaultRenderable:"ContentEditor-SettingsPanel-Display",DefaultDestinationAddress:"#ContentEditor-SettingsPanel-Container",AutoRender:!1,CSS:"\n\t\t.content-editor-settings-wrap\n\t\t{\n\t\t\tposition: relative;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t\t.content-editor-settings-gear\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 6px;\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\tcolor: #B8AFA4;\n\t\t\ttransition: color 0.15s;\n\t\t}\n\t\t.content-editor-settings-gear:hover,\n\t\t.content-editor-settings-gear.active\n\t\t{\n\t\t\tcolor: #E8E0D4;\n\t\t}\n\t\t.content-editor-settings-gear svg\n\t\t{\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\tfill: currentColor;\n\t\t}\n\t\t/* Flyout overlay — covers viewport to catch clicks outside */\n\t\t.content-editor-settings-overlay\n\t\t{\n\t\t\tdisplay: none;\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\tz-index: 999;\n\t\t}\n\t\t.content-editor-settings-overlay.open\n\t\t{\n\t\t\tdisplay: block;\n\t\t}\n\t\t/* Flyout panel */\n\t\t.content-editor-settings-flyout\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 44px;\n\t\t\tright: 0;\n\t\t\twidth: 270px;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tbox-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);\n\t\t\tz-index: 1000;\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(-4px);\n\t\t\tpointer-events: none;\n\t\t\ttransition: opacity 0.15s ease, transform 0.15s ease;\n\t\t}\n\t\t.content-editor-settings-flyout.open\n\t\t{\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t/* Speech bubble arrow */\n\t\t.content-editor-settings-flyout::before\n\t\t{\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: -7px;\n\t\t\tright: 12px;\n\t\t\twidth: 12px;\n\t\t\theight: 12px;\n\t\t\tbackground: #FFF;\n\t\t\tborder-left: 1px solid #DDD6CA;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\ttransform: rotate(45deg);\n\t\t}\n\t\t.content-editor-settings-flyout-body\n\t\t{\n\t\t\tpadding: 8px;\n\t\t}\n\t\t.content-editor-settings-flyout-link\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 10px 12px;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-size: 0.85rem;\n\t\t\tfont-weight: 500;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.content-editor-settings-flyout-link:hover\n\t\t{\n\t\t\tbackground: #F5F3EE;\n\t\t}\n\t\t.content-editor-settings-flyout-link svg\n\t\t{\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tflex-shrink: 0;\n\t\t\tfill: #8A7F72;\n\t\t}\n\t\t.content-editor-settings-divider\n\t\t{\n\t\t\theight: 1px;\n\t\t\tbackground: #EDE9E3;\n\t\t\tmargin: 4px 8px;\n\t\t}\n\t\t/* Settings controls */\n\t\t.content-editor-settings-section\n\t\t{\n\t\t\tpadding: 8px 12px;\n\t\t}\n\t\t.content-editor-settings-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.content-editor-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\tgap: 8px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-settings-row:last-child\n\t\t{\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.content-editor-settings-checkbox\n\t\t{\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\taccent-color: #2E7D74;\n\t\t\tcursor: pointer;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-settings-checkbox-label\n\t\t{\n\t\t\tfont: inherit;\n\t\t\tfont-size: 0.85rem;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.content-editor-settings-select\n\t\t{\n\t\t\twidth: 140px;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: #FFF;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-settings-select:disabled\n\t\t{\n\t\t\topacity: 0.45;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.content-editor-settings-select-label\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-SettingsPanel-Template",Template:'\n<div class="content-editor-settings-wrap">\n\t<button class="content-editor-settings-gear" id="ContentEditor-SettingsGear"\n\t\tonclick="{~P~}.views[\'ContentEditor-SettingsPanel\'].togglePanel()">\n\t\t<svg viewBox="0 0 24 24"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.49.49 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.48.48 0 0 0-.48-.41h-3.84a.48.48 0 0 0-.48.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96a.49.49 0 0 0-.59.22L2.74 8.87a.48.48 0 0 0 .12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.26.41.48.41h3.84c.24 0 .44-.17.48-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6A3.6 3.6 0 1 1 12 8.4a3.6 3.6 0 0 1 0 7.2z"/></svg>\n\t</button>\n\t<div class="content-editor-settings-overlay" id="ContentEditor-SettingsOverlay"\n\t\tonclick="{~P~}.views[\'ContentEditor-SettingsPanel\'].closePanel()"></div>\n\t<div class="content-editor-settings-flyout" id="ContentEditor-SettingsFlyout">\n\t\t<div class="content-editor-settings-flyout-body">\n\t\t\t<a class="content-editor-settings-flyout-link"\n\t\t\t\thref="/preview.html{~D:AppData.ContentEditor.ViewerHash~}" target="_blank">\n\t\t\t\t<svg viewBox="0 0 24 24"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>\n\t\t\t\tDocuserve Preview\n\t\t\t</a>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Word Wrap</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-MarkdownWordWrap">Markdown Word Wrap</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-MarkdownWordWrap"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onMarkdownWordWrapChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-CodeWordWrap">Code Word Wrap</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-CodeWordWrap"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onCodeWordWrapChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Markdown Editor</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-EditingControls">Editing Controls</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-EditingControls"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onEditingControlsChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreview">Auto Content Preview</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreview"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoSegment">Auto Segment Markdown</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoSegment"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoSegmentChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<span class="content-editor-settings-select-label">Segment Depth</span>\n\t\t\t\t\t<select class="content-editor-settings-select"\n\t\t\t\t\t\tid="ContentEditor-Setting-SegmentDepth"\n\t\t\t\t\t\tdisabled\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onSegmentDepthChanged(this.value)">\n\t\t\t\t\t\t<option value="1">Depth 1: Blocks</option>\n\t\t\t\t\t\t<option value="2">Depth 2: ##</option>\n\t\t\t\t\t\t<option value="3">Depth 3: ###</option>\n\t\t\t\t\t\t<option value="4">Depth 4: ####</option>\n\t\t\t\t\t\t<option value="5">Depth 5: #####</option>\n\t\t\t\t\t\t<option value="6">Depth 6: ######</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Media Preview</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewImages">Auto-Preview Images</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewImages"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewImagesChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewVideo">Auto-Preview Video</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewVideo"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewVideoChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewAudio">Auto-Preview Audio</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewAudio"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewAudioChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">File Browser</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-ShowHiddenFiles">Show Hidden Files</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-ShowHiddenFiles"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onShowHiddenFilesChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-SettingsPanel-Display",TemplateHash:"ContentEditor-SettingsPanel-Template",DestinationAddress:"#ContentEditor-SettingsPanel-Container",RenderMethod:"replace"}]}},{"pict-view":52}],64:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onBeforeRender(t,e,i){let n=this.pict.AppData.ContentEditor;if(n.DirtyIndicatorHTML=n.IsDirty?' <span class="content-editor-dirty-indicator">*</span>':"",n.SaveDisabledAttr=!n.CurrentFile||n.IsSaving?"disabled":"",n.SaveVisibilityAttr=n.IsDirty||n.IsSaving||n.SaveStatus?"":'style="display:none"',n.CloseVisibilityAttr=n.CurrentFile?"":'style="display:none"',n.CurrentFile){let t=n.CurrentFile.replace(/\.md$/,"");n.ViewerHash="#/page/"+t}else n.ViewerHash="";return super.onBeforeRender(t,e,i)}onAfterRender(t,e,i,n){let o=this.pict.views["ContentEditor-SettingsPanel"];return o&&o.render(),super.onAfterRender(t,e,i,n)}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"ContentEditor-TopBar-Display",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"\n\t\t.content-editor-topbar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 0;\n\t\t\theight: 48px;\n\t\t\tborder-bottom: 3px solid #2E7D74;\n\t\t\tposition: relative;\n\t\t}\n\t\t.content-editor-topbar-brand\n\t\t{\n\t\t\tpadding: 0 16px;\n\t\t\tfont-size: 1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #E8E0D4;\n\t\t\twhite-space: nowrap;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t/* Centered file name — absolutely positioned so it stays\n\t\t centered in the full bar regardless of left/right content */\n\t\t.content-editor-topbar-file\n\t\t{\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t\tmax-width: 50%;\n\t\t\ttext-align: center;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.content-editor-topbar-filename\n\t\t{\n\t\t\tfont-size: 0.9rem;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: #E8E0D4;\n\t\t\tletter-spacing: 0.2px;\n\t\t}\n\t\t.content-editor-topbar-file .content-editor-dirty-indicator\n\t\t{\n\t\t\tcolor: #E8A94D;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\t/* Left spacer pushes actions to the right */\n\t\t.content-editor-topbar-spacer\n\t\t{\n\t\t\tflex: 1;\n\t\t}\n\t\t.content-editor-topbar-status\n\t\t{\n\t\t\tpadding: 0 12px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-status-saving\n\t\t{\n\t\t\tcolor: #E8A94D;\n\t\t}\n\t\t.content-editor-status-saved\n\t\t{\n\t\t\tcolor: #7BC47F;\n\t\t}\n\t\t.content-editor-status-error\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t}\n\t\t.content-editor-topbar-stats\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\tpadding: 0 8px;\n\t\t\tflex-shrink: 0;\n\t\t\tletter-spacing: 0.2px;\n\t\t}\n\t\t.content-editor-topbar-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 0 12px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-topbar-btn\n\t\t{\n\t\t\tpadding: 6px 14px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.content-editor-topbar-btn-save\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.content-editor-topbar-btn-save:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.content-editor-topbar-btn-save:disabled\n\t\t{\n\t\t\tbackground: #5E5549;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.content-editor-topbar-btn-close\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #B8AFA4;\n\t\t\tborder: 1px solid #5E5549;\n\t\t}\n\t\t.content-editor-topbar-btn-close:hover\n\t\t{\n\t\t\tcolor: #E8E0D4;\n\t\t\tborder-color: #8A7F72;\n\t\t\tbackground: rgba(255, 255, 255, 0.05);\n\t\t}\n\t\t/* Close-file confirmation overlay */\n\t\t.content-editor-confirm-overlay\n\t\t{\n\t\t\tdisplay: none;\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\tz-index: 1099;\n\t\t\tbackground: rgba(0, 0, 0, 0.35);\n\t\t}\n\t\t.content-editor-confirm-overlay.open\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-confirm-panel\n\t\t{\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 10px;\n\t\t\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);\n\t\t\twidth: 360px;\n\t\t\tmax-width: 90vw;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-confirm-body\n\t\t{\n\t\t\tpadding: 24px 22px 16px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.content-editor-confirm-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tmargin-bottom: 8px;\n\t\t\tcolor: #E8A94D;\n\t\t}\n\t\t.content-editor-confirm-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-confirm-message\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-bottom: 16px;\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.content-editor-confirm-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-confirm-btn\n\t\t{\n\t\t\tpadding: 8px 20px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 5px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-confirm-btn-discard\n\t\t{\n\t\t\tbackground: #D9534F;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.content-editor-confirm-btn-discard:hover\n\t\t{\n\t\t\tbackground: #C9302C;\n\t\t}\n\t\t.content-editor-confirm-btn-cancel\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.content-editor-confirm-btn-cancel:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t.content-editor-confirm-footer\n\t\t{\n\t\t\tpadding: 10px 22px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.content-editor-confirm-kbd\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 1px 5px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-family: monospace;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-TopBar-Template",Template:'\n<div class="content-editor-topbar">\n\t<div class="content-editor-topbar-brand">Content Editor</div>\n\t<div class="content-editor-topbar-file">\n\t\t<span class="content-editor-topbar-filename">{~D:AppData.ContentEditor.CurrentFile~}</span>{~D:AppData.ContentEditor.DirtyIndicatorHTML~}\n\t</div>\n\t<div class="content-editor-topbar-spacer"></div>\n\t<div class="content-editor-topbar-status {~D:AppData.ContentEditor.SaveStatusClass~}">\n\t\t{~D:AppData.ContentEditor.SaveStatus~}\n\t</div>\n\t<span class="content-editor-topbar-stats" id="ContentEditor-Stats"></span>\n\t<div class="content-editor-topbar-actions">\n\t\t<button class="content-editor-topbar-btn content-editor-topbar-btn-save"\n\t\t\tonclick="{~P~}.PictApplication.saveCurrentFile()"\n\t\t\t{~D:AppData.ContentEditor.SaveDisabledAttr~} {~D:AppData.ContentEditor.SaveVisibilityAttr~}>Save</button>\n\t\t<button class="content-editor-topbar-btn content-editor-topbar-btn-close"\n\t\t\tonclick="{~P~}.PictApplication.closeCurrentFile()"\n\t\t\t{~D:AppData.ContentEditor.CloseVisibilityAttr~}>Close</button>\n\t\t<div id="ContentEditor-SettingsPanel-Container"></div>\n\t</div>\n</div>\n<div class="content-editor-confirm-overlay" id="ContentEditor-ConfirmOverlay"\n\tonclick="{~P~}.PictApplication.cancelCloseFile()">\n\t<div class="content-editor-confirm-panel" onclick="event.stopPropagation()">\n\t\t<div class="content-editor-confirm-body">\n\t\t\t<div class="content-editor-confirm-icon">&#x26A0;</div>\n\t\t\t<div class="content-editor-confirm-title">Unsaved Changes</div>\n\t\t\t<div class="content-editor-confirm-message">\n\t\t\t\tThis file has unsaved changes.<br>Close without saving?\n\t\t\t</div>\n\t\t\t<div class="content-editor-confirm-actions">\n\t\t\t\t<button class="content-editor-confirm-btn content-editor-confirm-btn-discard"\n\t\t\t\t\tonclick="{~P~}.PictApplication.confirmCloseFile()">Discard &amp; Close</button>\n\t\t\t\t<button class="content-editor-confirm-btn content-editor-confirm-btn-cancel"\n\t\t\t\t\tonclick="{~P~}.PictApplication.cancelCloseFile()">Cancel</button>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="content-editor-confirm-footer">\n\t\t\t<span class="content-editor-confirm-kbd">Y</span> to discard &middot;\n\t\t\t<span class="content-editor-confirm-kbd">N</span> or\n\t\t\t<span class="content-editor-confirm-kbd">Esc</span> to cancel\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-TopBar-Display",TemplateHash:"ContentEditor-TopBar-Template",DestinationAddress:"#ContentEditor-TopBar-Container",RenderMethod:"replace"}]}},{"pict-view":52}],65:[function(t,e,i){const n=t("pict-view");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._topics={},this._topicsFilePath="",this._hasRendered=!1,this._editingTopicCode=null}onAfterRender(){this._hasRendered=!0,this.pict.CSSMap.injectCSS(),this._topicsFilePath?(this._updateHeaderTitle(),this.renderTopicList()):this._showEmptyState()}loadTopicsFile(t,e){let i="function"==typeof e?e:()=>{},n=this;if(!t)return i("No path specified");let o=this.pict.providers["ContentEditor-Provider"];if(!o)return i("Provider not available");o.loadFile(t,(e,o)=>{if(e)return n._topics={},n._topicsFilePath="",n._hasRendered&&n._showEmptyState(),i(e);try{let t=JSON.parse(o);"object"!=typeof t||null===t||Array.isArray(t)?n._topics={}:n._topics=t}catch(t){n._topics={},n.log.warn("ContentEditor-Topics: Failed to parse topics JSON: "+t.message)}return n._topicsFilePath=t,n.pict.AppData.ContentEditor.TopicsFilePath=t,n.pict.PictApplication.saveSettings(),n._hasRendered&&(n._updateHeaderTitle(),n.renderTopicList(),n._showFooter(!0)),i(null)})}saveTopicsFile(t){let e="function"==typeof t?t:()=>{};if(!this._topicsFilePath)return e("No topics file loaded");let i=this.pict.providers["ContentEditor-Provider"];if(!i)return e("Provider not available");let n=JSON.stringify(this._topics,null,"\t");i.saveFile(this._topicsFilePath,n,e)}closeTopicsFile(){this._topics={},this._topicsFilePath="",this._editingTopicCode=null,this.pict.AppData.ContentEditor.TopicsFilePath="",this.pict.PictApplication.saveSettings(),this._hasRendered&&this._showEmptyState()}addTopic(t){if(!this._topicsFilePath)return void this._createDefaultTopicsFile(()=>{this.addTopic(t)});let e=t||{},i=e.TopicCode||this._generateUniqueCode("New-Topic"),n={TopicCode:i,TopicHelpFilePath:e.TopicHelpFilePath||"",TopicTitle:e.TopicTitle||""};"number"==typeof e.RelevantMarkdownLine&&(n.RelevantMarkdownLine=e.RelevantMarkdownLine),this._topics[i]=n;let o=this;this.saveTopicsFile(()=>{o.renderTopicList(),o.startEditTopic(i)})}removeTopic(t){if(!t||!this._topics[t])return;if(!confirm('Remove topic "'+t+'"?'))return;delete this._topics[t],this._editingTopicCode=null;let e=this;this.saveTopicsFile(()=>{e.renderTopicList()})}startEditTopic(t){if(!t||!this._topics[t])return;this._editingTopicCode=t,this.renderTopicList();let e=document.getElementById("topics-edit-code");e&&(e.focus(),e.select())}saveEditTopic(t){if(!t||!this._topics[t])return;let e=document.getElementById("topics-edit-code"),i=document.getElementById("topics-edit-title"),n=document.getElementById("topics-edit-path"),o=document.getElementById("topics-edit-line");if(!e)return;let r=e.value.trim(),s=i?i.value.trim():"",a=n?n.value.trim():"",l=o?parseInt(o.value,10):NaN;if(!r)return void(e.style.borderColor="#D9534F");if(r!==t&&this._topics[r])return e.style.borderColor="#D9534F",void alert('A topic with code "'+r+'" already exists.');r!==t&&delete this._topics[t];let c={TopicCode:r,TopicHelpFilePath:a,TopicTitle:s};!isNaN(l)&&l>0&&(c.RelevantMarkdownLine=l),this._topics[r]=c,this._editingTopicCode=null;let d=this;this.saveTopicsFile(()=>{d.renderTopicList()})}cancelEditTopic(){this._editingTopicCode=null,this.renderTopicList()}navigateToTopic(t){if(!t||!this._topics[t])return;let e=this._topics[t],i=e.TopicHelpFilePath;if(i&&(this.pict.PictApplication.navigateToFile(i),"number"==typeof e.RelevantMarkdownLine&&e.RelevantMarkdownLine>0)){let t=e.RelevantMarkdownLine;setTimeout(()=>{let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&e._segmentEditors){let i=0;for(let n in e._segmentEditors){let o=e._segmentEditors[n];if(o&&o.state&&o.state.doc){let e=o.state.doc.lines;if(i+e>=t){let n=t-i;n<1&&(n=1),n>e&&(n=e);let r=o.state.doc.line(n);o.dispatch({selection:{anchor:r.from},scrollIntoView:!0}),o.focus();break}i+=e}}}},500)}}renderTopicList(){let t=document.getElementById("ContentEditor-Topics-List");if(!t)return;let e=Object.keys(this._topics);if(0===e.length)return void(t.innerHTML='<div style="padding:16px;text-align:center;color:#8A7F72;font-size:0.78rem;">No topics yet. Click "+ Add Topic" to create one.</div>');let i="";for(let t=0;t<e.length;t++){let n=e[t],o=this._topics[n];this._editingTopicCode===n?i+=this._buildEditFormHTML(o):i+=this._buildTopicRowHTML(o)}t.innerHTML=i}_buildTopicRowHTML(t){let e=this._escapeHTML(t.TopicCode||""),i=this._escapeHTML(t.TopicTitle||""),n=this._escapeHTML(t.TopicHelpFilePath||""),o="number"==typeof t.RelevantMarkdownLine?" :"+t.RelevantMarkdownLine:"",r=this._escapeAttr(t.TopicCode||""),s="<div class=\"topics-row\" ondblclick=\"pict.views['ContentEditor-Topics'].startEditTopic('"+r+"')\">";return s+='<div class="topics-row-info">',s+='<div class="topics-row-code">'+e+"</div>",i&&(s+='<div class="topics-row-title">'+i+"</div>"),n&&(s+='<div class="topics-row-path">'+n+o+"</div>"),s+="</div>",s+='<div class="topics-row-actions">',s+='<button class="topics-row-btn" title="Edit" onclick="event.stopPropagation();pict.views[\'ContentEditor-Topics\'].startEditTopic(\''+r+"')\">✎</button>",s+='<button class="topics-row-btn topics-row-btn-delete" title="Delete" onclick="event.stopPropagation();pict.views[\'ContentEditor-Topics\'].removeTopic(\''+r+"')\">✖</button>",n&&(s+='<button class="topics-row-btn" title="Go to file" onclick="event.stopPropagation();pict.views[\'ContentEditor-Topics\'].navigateToTopic(\''+r+"')\">→</button>"),s+="</div>",s+="</div>",s}_buildEditFormHTML(t){let e='<div class="topics-edit">';return e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Topic Code</label>',e+='<input class="topics-edit-input" id="topics-edit-code" type="text" value="'+this._escapeAttr(t.TopicCode||"")+'" placeholder="My-Topic-Code">',e+="</div>",e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Title</label>',e+='<input class="topics-edit-input" id="topics-edit-title" type="text" value="'+this._escapeAttr(t.TopicTitle||"")+'" placeholder="Topic title">',e+="</div>",e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Help File Path</label>',e+='<input class="topics-edit-input" id="topics-edit-path" type="text" value="'+this._escapeAttr(t.TopicHelpFilePath||"")+'" placeholder="path/to/file.md">',e+="</div>",e+='<div class="topics-edit-field">',e+='<label class="topics-edit-label">Line Number (optional)</label>',e+='<input class="topics-edit-input" id="topics-edit-line" type="number" value="'+("number"==typeof t.RelevantMarkdownLine?t.RelevantMarkdownLine:"")+'" placeholder="e.g. 23" min="1">',e+="</div>",e+='<div class="topics-edit-actions">',e+="<button class=\"topics-edit-save\" onclick=\"pict.views['ContentEditor-Topics'].saveEditTopic('"+this._escapeAttr(t.TopicCode||"")+"')\">Save</button>",e+='<button class="topics-edit-cancel" onclick="pict.views[\'ContentEditor-Topics\'].cancelEditTopic()">Cancel</button>',e+="</div>",e+="</div>",e}_showEmptyState(){let t=document.getElementById("ContentEditor-Topics-Container");if(!t){let t=document.getElementById("ContentEditor-SidebarTopics-Container");return void(t&&(t.innerHTML=this._buildEmptyStateHTML()))}t.innerHTML=this._buildEmptyStateHTML()}_buildEmptyStateHTML(){let t='<div class="topics-empty">';return t+='<div class="topics-empty-icon">&#x1F4D1;</div>',t+="<div>No topics file loaded</div>",t+='<button class="topics-empty-btn" onclick="pict.views[\'ContentEditor-Topics\'].loadDefaultTopicsFile()">Load .pict_documentation_topics.json</button>',t+='<button class="topics-empty-btn topics-empty-btn-secondary" onclick="pict.views[\'ContentEditor-Topics\'].promptSelectTopicsFile()">Select file...</button>',t+="</div>",'<div class="topics-empty"><div class="topics-empty-icon">&#x1F4D1;</div><div>No topics file loaded</div><button class="topics-empty-btn" onclick="pict.views[\'ContentEditor-Topics\'].loadDefaultTopicsFile()">Load .pict_documentation_topics.json</button><button class="topics-empty-btn topics-empty-btn-secondary" onclick="pict.views[\'ContentEditor-Topics\'].promptSelectTopicsFile()">Select file...</button></div>'}loadDefaultTopicsFile(){let t=this;this.loadTopicsFile(".pict_documentation_topics.json",e=>{e&&t._createDefaultTopicsFile()})}promptSelectTopicsFile(){let t=prompt("Enter the path to a topics JSON file:",".pict_documentation_topics.json");if(t&&t.trim()){let e=this;this.loadTopicsFile(t.trim(),i=>{i&&confirm('File not found. Create "'+t.trim()+'"?')&&(e._topicsFilePath=t.trim(),e._topics={},e.pict.AppData.ContentEditor.TopicsFilePath=t.trim(),e.pict.PictApplication.saveSettings(),e.saveTopicsFile(()=>{e._hasRendered&&e.render()}))})}}_createDefaultTopicsFile(t){let e="function"==typeof t?t:()=>{},i=this,n=".pict_documentation_topics.json";this._topicsFilePath=n,this._topics={},this.pict.AppData.ContentEditor.TopicsFilePath=n,this.pict.PictApplication.saveSettings(),this.saveTopicsFile(()=>{i._hasRendered&&i.render(),e()})}_updateHeaderTitle(){let t=document.getElementById("ContentEditor-Topics-HeaderTitle");if(t){let e=this._topicsFilePath.replace(/^.*\//,"");t.textContent=e||"Topics",t.title=this._topicsFilePath}}_showFooter(t){let e=document.getElementById("ContentEditor-Topics-Footer");e&&(e.style.display=t?"":"none")}_generateUniqueCode(t){if(!this._topics[t])return t;let e=2;for(;this._topics[t+"-"+e];)e++;return t+"-"+e}_escapeHTML(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}_escapeAttr(t){return String(t).replace(/&/g,"&amp;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-Topics",DefaultRenderable:"Topics-Wrap",DefaultDestinationAddress:"#ContentEditor-SidebarTopics-Container",AutoRender:!1,CSS:"\n\t\t.topics-container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.topics-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t\tbackground: #FAF8F4;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.topics-header-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.topics-header-btn\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tpadding: 2px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.topics-header-btn:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.topics-list\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.topics-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: flex-start;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #F0EDE8;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.topics-row:hover\n\t\t{\n\t\t\tbackground: #F5F0EA;\n\t\t}\n\t\t.topics-row-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.topics-row-code\n\t\t{\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #2E7D74;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.topics-row-title\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-top: 1px;\n\t\t}\n\t\t.topics-row-path\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-top: 1px;\n\t\t}\n\t\t.topics-row-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tgap: 2px;\n\t\t\tpadding-top: 1px;\n\t\t}\n\t\t.topics-row-btn\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.topics-row-btn:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.topics-row-btn-delete:hover\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t\tbackground: #FDF0EF;\n\t\t}\n\t\t/* Inline edit form */\n\t\t.topics-edit\n\t\t{\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #FFF9F0;\n\t\t}\n\t\t.topics-edit-field\n\t\t{\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.topics-edit-label\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 2px;\n\t\t}\n\t\t.topics-edit-input\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tpadding: 4px 6px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #FFF;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.topics-edit-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.topics-edit-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 6px;\n\t\t\tmargin-top: 8px;\n\t\t}\n\t\t.topics-edit-save\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 4px 12px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-edit-save:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.topics-edit-cancel\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 4px 12px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-edit-cancel:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t/* Footer add button */\n\t\t.topics-footer\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.topics-add-btn\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tpadding: 6px 0;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.topics-add-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t/* Empty state */\n\t\t.topics-empty\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\tpadding: 32px 16px;\n\t\t\ttext-align: center;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.82rem;\n\t\t}\n\t\t.topics-empty-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: #C4BDB3;\n\t\t}\n\t\t.topics-empty-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 6px 14px;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-empty-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.topics-empty-btn-secondary\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.topics-empty-btn-secondary:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-color: #8A7F72;\n\t\t}\n\t",Templates:[{Hash:"Topics-Container-Template",Template:'\n<div class="topics-container" id="ContentEditor-Topics-Container">\n\t<div class="topics-header">\n\t\t<span class="topics-header-title" id="ContentEditor-Topics-HeaderTitle">Topics</span>\n\t\t<button class="topics-header-btn" title="Close topics file"\n\t\t\tonclick="pict.views[\'ContentEditor-Topics\'].closeTopicsFile()">&times;</button>\n\t</div>\n\t<div class="topics-list" id="ContentEditor-Topics-List"></div>\n\t<div class="topics-footer" id="ContentEditor-Topics-Footer">\n\t\t<button class="topics-add-btn"\n\t\t\tonclick="pict.views[\'ContentEditor-Topics\'].addTopic()">+ Add Topic</button>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"Topics-Wrap",TemplateHash:"Topics-Container-Template",DestinationAddress:"#ContentEditor-SidebarTopics-Container"}]}},{"pict-view":52}],66:[function(t,e,i){},{}],67:[function(t,e,i){arguments[4][66][0].apply(i,arguments)},{dup:66}],68:[function(t,e,i){var n=t("function-bind"),o=t("./functionApply"),r=t("./functionCall"),s=t("./reflectApply");e.exports=s||n.call(r,o)},{"./functionApply":69,"./functionCall":70,"./reflectApply":72,"function-bind":87}],69:[function(t,e,i){e.exports=Function.prototype.apply},{}],70:[function(t,e,i){e.exports=Function.prototype.call},{}],71:[function(t,e,i){var n=t("function-bind"),o=t("es-errors/type"),r=t("./functionCall"),s=t("./actualApply");e.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new o("a function is required");return s(n,r,t)}},{"./actualApply":68,"./functionCall":70,"es-errors/type":81,"function-bind":87}],72:[function(t,e,i){e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},{}],73:[function(t,e,i){var n=t("get-intrinsic"),o=t("call-bind-apply-helpers"),r=o([n("%String.prototype.indexOf%")]);e.exports=function(t,e){var i=n(t,!!e);return"function"==typeof i&&r(t,".prototype.")>-1?o([i]):i}},{"call-bind-apply-helpers":71,"get-intrinsic":88}],74:[function(t,e,i){var n,o=t("call-bind-apply-helpers"),r=t("gopd");try{n=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var s=!!n&&r&&r(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?o([s.get]):"function"==typeof l&&function(t){return l(null==t?t:a(t))}},{"call-bind-apply-helpers":71,gopd:93}],75:[function(t,e,i){var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}e.exports=n},{}],76:[function(t,e,i){e.exports=EvalError},{}],77:[function(t,e,i){e.exports=Error},{}],78:[function(t,e,i){e.exports=RangeError},{}],79:[function(t,e,i){e.exports=ReferenceError},{}],80:[function(t,e,i){e.exports=SyntaxError},{}],81:[function(t,e,i){e.exports=TypeError},{}],82:[function(t,e,i){e.exports=URIError},{}],83:[function(t,e,i){e.exports=Object},{}],84:[function(t,e,i){arguments[4][1][0].apply(i,arguments)},{dup:1}],85:[function(t,e,i){arguments[4][2][0].apply(i,arguments)},{"../package.json":84,dup:2}],86:[function(t,e,i){var n=Object.prototype.toString,o=Math.max,r=function(t,e){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<e.length;o+=1)i[o+t.length]=e[o];return i};e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==n.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var i,s=function(t,e){for(var i=[],n=e||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i}(arguments,1),a=o(0,e.length-s.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+function(t,e){for(var i="",n=0;n<t.length;n+=1)i+=t[n],n+1<t.length&&(i+=e);return i}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var n=e.apply(this,r(s,arguments));return Object(n)===n?n:this}return e.apply(t,r(s,arguments))}),e.prototype){var d=function(){};d.prototype=e.prototype,i.prototype=new d,d.prototype=null}return i}},{}],87:[function(t,e,i){var n=t("./implementation");e.exports=Function.prototype.bind||n},{"./implementation":86}],88:[function(t,e,i){var n,o=t("es-object-atoms"),r=t("es-errors"),s=t("es-errors/eval"),a=t("es-errors/range"),l=t("es-errors/ref"),c=t("es-errors/syntax"),d=t("es-errors/type"),p=t("es-errors/uri"),h=t("math-intrinsics/abs"),u=t("math-intrinsics/floor"),f=t("math-intrinsics/max"),m=t("math-intrinsics/min"),g=t("math-intrinsics/pow"),v=t("math-intrinsics/round"),b=t("math-intrinsics/sign"),y=Function,w=function(t){try{return y('"use strict"; return ('+t+").constructor;")()}catch(t){}},C=t("gopd"),x=t("es-define-property"),A=function(){throw new d},D=C?function(){try{return A}catch(t){try{return C(arguments,"callee").get}catch(t){return A}}}():A,E=t("has-symbols")(),P=t("get-proto"),S=t("get-proto/Object.getPrototypeOf"),k=t("get-proto/Reflect.getPrototypeOf"),F=t("call-bind-apply-helpers/functionApply"),T=t("call-bind-apply-helpers/functionCall"),R={},I="undefined"!=typeof Uint8Array&&P?P(Uint8Array):n,L={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":E&&P?P([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":R,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&P?P(P([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&P?P((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":C,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&P?P((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&P?P(""[Symbol.iterator]()):n,"%Symbol%":E?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":D,"%TypedArray%":I,"%TypeError%":d,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":F,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":S,"%Math.abs%":h,"%Math.floor%":u,"%Math.max%":f,"%Math.min%":m,"%Math.pow%":g,"%Math.round%":v,"%Math.sign%":b,"%Reflect.getPrototypeOf%":k};if(P)try{null.error}catch(t){var M=P(P(t));L["%Error.prototype%"]=M}var _=function t(e){var i;if("%AsyncFunction%"===e)i=w("async function () {}");else if("%GeneratorFunction%"===e)i=w("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=w("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&P&&(i=P(o.prototype))}return L[e]=i,i},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},H=t("function-bind"),V=t("hasown"),j=H.call(T,Array.prototype.concat),z=H.call(F,Array.prototype.splice),N=H.call(T,String.prototype.replace),O=H.call(T,String.prototype.slice),U=H.call(T,RegExp.prototype.exec),W=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,G=/\\(\\)?/g,q=function(t,e){var i,n=t;if(V(B,n)&&(n="%"+(i=B[n])[0]+"%"),V(L,n)){var o=L[n];if(o===R&&(o=_(n)),void 0===o&&!e)throw new d("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new c("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new d("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new d('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(t){var e=O(t,0,1),i=O(t,-1);if("%"===e&&"%"!==i)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return N(t,W,function(t,e,i,o){n[n.length]=i?N(o,G,"$1"):e||t}),n}(t),n=i.length>0?i[0]:"",o=q("%"+n+"%",e),r=o.name,s=o.value,a=!1,l=o.alias;l&&(n=l[0],z(i,j([0,1],l)));for(var p=1,h=!0;p<i.length;p+=1){var u=i[p],f=O(u,0,1),m=O(u,-1);if(('"'===f||"'"===f||"`"===f||'"'===m||"'"===m||"`"===m)&&f!==m)throw new c("property names with quotes must have matching quotes");if("constructor"!==u&&h||(a=!0),V(L,r="%"+(n+="."+u)+"%"))s=L[r];else if(null!=s){if(!(u in s)){if(!e)throw new d("base intrinsic for "+t+" exists, but the property is not available.");return}if(C&&p+1>=i.length){var g=C(s,u);s=(h=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:s[u]}else h=V(s,u),s=s[u];h&&!a&&(L[r]=s)}}return s}},{"call-bind-apply-helpers/functionApply":69,"call-bind-apply-helpers/functionCall":70,"es-define-property":75,"es-errors":77,"es-errors/eval":76,"es-errors/range":78,"es-errors/ref":79,"es-errors/syntax":80,"es-errors/type":81,"es-errors/uri":82,"es-object-atoms":83,"function-bind":87,"get-proto":91,"get-proto/Object.getPrototypeOf":89,"get-proto/Reflect.getPrototypeOf":90,gopd:93,"has-symbols":94,hasown:96,"math-intrinsics/abs":97,"math-intrinsics/floor":98,"math-intrinsics/max":100,"math-intrinsics/min":101,"math-intrinsics/pow":102,"math-intrinsics/round":103,"math-intrinsics/sign":104}],89:[function(t,e,i){var n=t("es-object-atoms");e.exports=n.getPrototypeOf||null},{"es-object-atoms":83}],90:[function(t,e,i){e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},{}],91:[function(t,e,i){var n=t("./Reflect.getPrototypeOf"),o=t("./Object.getPrototypeOf"),r=t("dunder-proto/get");e.exports=n?function(t){return n(t)}:o?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return o(t)}:r?function(t){return r(t)}:null},{"./Object.getPrototypeOf":89,"./Reflect.getPrototypeOf":90,"dunder-proto/get":74}],92:[function(t,e,i){e.exports=Object.getOwnPropertyDescriptor},{}],93:[function(t,e,i){var n=t("./gOPD");if(n)try{n([],"length")}catch(t){n=null}e.exports=n},{"./gOPD":92}],94:[function(t,e,i){var n="undefined"!=typeof Symbol&&Symbol,o=t("./shams");e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},{"./shams":95}],95:[function(t,e,i){e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},{}],96:[function(t,e,i){var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,r=t("function-bind");e.exports=r.call(n,o)},{"function-bind":87}],97:[function(t,e,i){e.exports=Math.abs},{}],98:[function(t,e,i){e.exports=Math.floor},{}],99:[function(t,e,i){e.exports=Number.isNaN||function(t){return t!=t}},{}],100:[function(t,e,i){e.exports=Math.max},{}],101:[function(t,e,i){e.exports=Math.min},{}],102:[function(t,e,i){e.exports=Math.pow},{}],103:[function(t,e,i){e.exports=Math.round},{}],104:[function(t,e,i){var n=t("./isNaN");e.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},{"./isNaN":99}],105:[function(t,e,i){(function(i){(function(){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=n&&o&&"function"==typeof o.get?o.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&l&&"function"==typeof l.get?l.get:null,d=a&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,u="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,v=String.prototype.match,b=String.prototype.slice,y=String.prototype.replace,w=String.prototype.toUpperCase,C=String.prototype.toLowerCase,x=RegExp.prototype.test,A=Array.prototype.concat,D=Array.prototype.join,E=Array.prototype.slice,P=Math.floor,S="function"==typeof BigInt?BigInt.prototype.valueOf:null,k=Object.getOwnPropertySymbols,F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,R="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===T||"symbol")?Symbol.toStringTag:null,I=Object.prototype.propertyIsEnumerable,L=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function M(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||x.call(/e/,e))return e;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-P(-t):P(t);if(n!==t){var o=String(n),r=b.call(e,o.length+1);return y.call(o,i,"$&_")+"."+y.call(y.call(r,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(e,i,"$&_")}var _=t("./util.inspect"),B=_.custom,H=G(B)?B:null,V={__proto__:null,double:'"',single:"'"},j={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function z(t,e,i){var n=i.quoteStyle||e,o=V[n];return o+t+o}function N(t){return y.call(String(t),/"/g,"&quot;")}function O(t){return!R||!("object"==typeof t&&(R in t||void 0!==t[R]))}function U(t){return"[object Array]"===J(t)&&O(t)}function W(t){return"[object RegExp]"===J(t)&&O(t)}function G(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!F)return!1;try{return F.call(t),!0}catch(t){}return!1}e.exports=function t(e,n,o,a){var l=n||{};if(Q(l,"quoteStyle")&&!Q(V,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Q(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!Q(l,"customInspect")||l.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Q(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Q(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=l.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return K(e,l);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var x=String(e);return w?M(e,x):x}if("bigint"==typeof e){var P=String(e)+"n";return w?M(e,P):P}var k=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=k&&k>0&&"object"==typeof e)return U(e)?"[Array]":"[Object]";var B=function(t,e){var i;if("\t"===t.indent)i="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;i=D.call(Array(t.indent+1)," ")}return{base:i,prev:D.call(Array(e+1),i)}}(l,o);if(void 0===a)a=[];else if($(a,e)>=0)return"[Circular]";function j(e,i,n){if(i&&(a=E.call(a)).push(i),n){var r={depth:l.depth};return Q(l,"quoteStyle")&&(r.quoteStyle=l.quoteStyle),t(e,r,o+1,a)}return t(e,l,o+1,a)}if("function"==typeof e&&!W(e)){var q=function(t){if(t.name)return t.name;var e=v.call(g.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),Z=it(e,j);return"[Function"+(q?": "+q:" (anonymous)")+"]"+(Z.length>0?" { "+D.call(Z,", ")+" }":"")}if(G(e)){var nt=T?y.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):F.call(e);return"object"!=typeof e||T?nt:X(nt)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var ot="<"+C.call(String(e.nodeName)),rt=e.attributes||[],st=0;st<rt.length;st++)ot+=" "+rt[st].name+"="+z(N(rt[st].value),"double",l);return ot+=">",e.childNodes&&e.childNodes.length&&(ot+="..."),ot+="</"+C.call(String(e.nodeName))+">"}if(U(e)){if(0===e.length)return"[]";var at=it(e,j);return B&&!function(t){for(var e=0;e<t.length;e++)if($(t[e],"\n")>=0)return!1;return!0}(at)?"["+et(at,B)+"]":"[ "+D.call(at,", ")+" ]"}if(function(t){return"[object Error]"===J(t)&&O(t)}(e)){var lt=it(e,j);return"cause"in Error.prototype||!("cause"in e)||I.call(e,"cause")?0===lt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+D.call(lt,", ")+" }":"{ ["+String(e)+"] "+D.call(A.call("[cause]: "+j(e.cause),lt),", ")+" }"}if("object"==typeof e&&m){if(H&&"function"==typeof e[H]&&_)return _(e,{depth:k-o});if("symbol"!==m&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!r||!t||"object"!=typeof t)return!1;try{r.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return s&&s.call(e,function(t,i){ct.push(j(i,e,!0)+" => "+j(t,e))}),tt("Map",r.call(e),ct,B)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t);try{r.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var dt=[];return d&&d.call(e,function(t){dt.push(j(t,e))}),tt("Set",c.call(e),dt,B)}if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{return u.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return"[object Number]"===J(t)&&O(t)}(e))return X(j(Number(e)));if(function(t){if(!t||"object"!=typeof t||!S)return!1;try{return S.call(t),!0}catch(t){}return!1}(e))return X(j(S.call(e)));if(function(t){return"[object Boolean]"===J(t)&&O(t)}(e))return X(f.call(e));if(function(t){return"[object String]"===J(t)&&O(t)}(e))return X(j(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==i&&e===i)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===J(t)&&O(t)}(e)&&!W(e)){var pt=it(e,j),ht=L?L(e)===Object.prototype:e instanceof Object||e.constructor===Object,ut=e instanceof Object?"":"null prototype",ft=!ht&&R&&Object(e)===e&&R in e?b.call(J(e),8,-1):ut?"Object":"",mt=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(ft||ut?"["+D.call(A.call([],ft||[],ut||[]),": ")+"] ":"");return 0===pt.length?mt+"{}":B?mt+"{"+et(pt,B)+"}":mt+"{ "+D.call(pt,", ")+" }"}return String(e)};var q=Object.prototype.hasOwnProperty||function(t){return t in this};function Q(t,e){return q.call(t,e)}function J(t){return m.call(t)}function $(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}function K(t,e){if(t.length>e.maxStringLength){var i=t.length-e.maxStringLength,n="... "+i+" more character"+(i>1?"s":"");return K(b.call(t,0,e.maxStringLength),e)+n}var o=j[e.quoteStyle||"single"];return o.lastIndex=0,z(y.call(y.call(t,o,"\\$1"),/[\x00-\x1f]/g,Z),"single",e)}function Z(t){var e=t.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return i?"\\"+i:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function X(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function tt(t,e,i,n){return t+" ("+e+") {"+(n?et(i,n):D.call(i,", "))+"}"}function et(t,e){if(0===t.length)return"";var i="\n"+e.prev+e.base;return i+D.call(t,","+i)+"\n"+e.prev}function it(t,e){var i=U(t),n=[];if(i){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=Q(t,o)?e(t[o],t):""}var r,s="function"==typeof k?k(t):[];if(T){r={};for(var a=0;a<s.length;a++)r["$"+s[a]]=s[a]}for(var l in t)Q(t,l)&&(i&&String(Number(l))===l&&l<t.length||T&&r["$"+l]instanceof Symbol||(x.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if("function"==typeof k)for(var c=0;c<s.length;c++)I.call(t,s[c])&&n.push("["+e(s[c])+"]: "+e(t[s[c]],t));return n}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util.inspect":66}],106:[function(t,e,i){(function(t){(function(){function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function n(t,e){for(var i,n="",o=0,r=-1,s=0,a=0;a<=t.length;++a){if(a<t.length)i=t.charCodeAt(a);else{if(47===i)break;i=47}if(47===i){if(r===a-1||1===s);else if(r!==a-1&&2===s){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),r=a,s=0;continue}}else if(2===n.length||1===n.length){n="",o=0,r=a,s=0;continue}e&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+t.slice(r+1,a):n=t.slice(r+1,a),o=a-r-1;r=a,s=0}else 46===i&&-1!==s?++s:s=-1}return n}var o={resolve:function(){for(var e,o="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===e&&(e=t.cwd()),a=e),i(a),0!==a.length&&(o=a+"/"+o,r=47===a.charCodeAt(0))}return o=n(o,!r),r?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),o=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!e)).length||e||(t="."),t.length>0&&o&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];i(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":o.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=o.resolve(t))===(e=o.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var r=t.length,s=r-n,a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var l=e.length-a,c=s<l?s:l,d=-1,p=0;p<=c;++p){if(p===c){if(l>c){if(47===e.charCodeAt(a+p))return e.slice(a+p+1);if(0===p)return e.slice(a+p)}else s>c&&(47===t.charCodeAt(n+p)?d=p:0===p&&(d=0));break}var h=t.charCodeAt(n+p);if(h!==e.charCodeAt(a+p))break;47===h&&(d=p)}var u="";for(p=n+d+1;p<=r;++p)p!==r&&47!==t.charCodeAt(p)||(0===u.length?u+="..":u+="/..");return u.length>0?u+e.slice(a+d):(a+=d,47===e.charCodeAt(a)&&++a,e.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,o=-1,r=!0,s=t.length-1;s>=1;--s)if(47===(e=t.charCodeAt(s))){if(!r){o=s;break}}else r=!1;return-1===o?n?"/":".":n&&1===o?"//":t.slice(0,o)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var n,o=0,r=-1,s=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var a=e.length-1,l=-1;for(n=t.length-1;n>=0;--n){var c=t.charCodeAt(n);if(47===c){if(!s){o=n+1;break}}else-1===l&&(s=!1,l=n+1),a>=0&&(c===e.charCodeAt(a)?-1===--a&&(r=n):(a=-1,r=l))}return o===r?r=l:-1===r&&(r=t.length),t.slice(o,r)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!s){o=n+1;break}}else-1===r&&(s=!1,r=n+1);return-1===r?"":t.slice(o,r)},extname:function(t){i(t);for(var e=-1,n=0,o=-1,r=!0,s=0,a=t.length-1;a>=0;--a){var l=t.charCodeAt(a);if(47!==l)-1===o&&(r=!1,o=a+1),46===l?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!r){n=a+1;break}}return-1===e||-1===o||0===s||1===s&&e===o-1&&e===n+1?"":t.slice(e,o)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var i=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+n:i+t+n:n}("/",t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,o=t.charCodeAt(0),r=47===o;r?(e.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,c=!0,d=t.length-1,p=0;d>=n;--d)if(47!==(o=t.charCodeAt(d)))-1===l&&(c=!1,l=d+1),46===o?-1===s?s=d:1!==p&&(p=1):-1!==s&&(p=-1);else if(!c){a=d+1;break}return-1===s||-1===l||0===p||1===p&&s===l-1&&s===a+1?-1!==l&&(e.base=e.name=0===a&&r?t.slice(1,l):t.slice(a,l)):(0===a&&r?(e.name=t.slice(1,s),e.base=t.slice(1,l)):(e.name=t.slice(a,s),e.base=t.slice(a,l)),e.ext=t.slice(s,l)),a>0?e.dir=t.slice(0,a-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,e.exports=o}).call(this)}).call(this,t("_process"))},{_process:126}],107:[function(t,e,i){arguments[4][18][0].apply(i,arguments)},{dup:18}],108:[function(t,e,i){arguments[4][19][0].apply(i,arguments)},{"../package.json":107,dup:19,"fable-serviceproviderbase":85}],109:[function(t,e,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],110:[function(t,e,i){arguments[4][30][0].apply(i,arguments)},{"./providers/Pict-Provider-FileBrowserBrowse.js":111,"./providers/Pict-Provider-FileBrowserIcons.js":112,"./providers/Pict-Provider-FileBrowserLayout.js":113,"./providers/Pict-Provider-FileBrowserList.js":114,"./providers/Pict-Provider-FileBrowserView.js":115,"./services/Pict-Service-FileBrowser.js":116,"./views/Pict-View-FileBrowser-BrowseSearch.js":117,"./views/Pict-View-FileBrowser-BrowseTree.js":118,"./views/Pict-View-FileBrowser-ListDetail.js":119,"./views/Pict-View-FileBrowser-ListIcons.js":120,"./views/Pict-View-FileBrowser-ViewFileInfo.js":121,"./views/Pict-View-FileBrowser-ViewImage.js":122,"./views/Pict-View-FileBrowser.js":123,dup:30}],111:[function(t,e,i){arguments[4][31][0].apply(i,arguments)},{dup:31,"pict-provider":108}],112:[function(t,e,i){arguments[4][32][0].apply(i,arguments)},{dup:32,"pict-provider":108}],113:[function(t,e,i){arguments[4][33][0].apply(i,arguments)},{dup:33,"pict-provider":108}],114:[function(t,e,i){arguments[4][34][0].apply(i,arguments)},{dup:34,"pict-provider":108}],115:[function(t,e,i){arguments[4][35][0].apply(i,arguments)},{dup:35,"pict-provider":108}],116:[function(t,e,i){(function(i){(function(){
89
+ /**
90
+ * Pict FileBrowser Service
91
+ *
92
+ * A Fable service that provides:
93
+ * 1. REST API endpoints for browsing a filesystem path
94
+ * 2. A static web app that uses the pict-section-filebrowser control
95
+ *
96
+ * Usage:
97
+ * const libFable = require('fable');
98
+ * const libOrator = require('orator');
99
+ * const libOratorServiceServerRestify = require('orator-serviceserver-restify');
100
+ * const libPictFileBrowser = require('pict-section-filebrowser');
101
+ *
102
+ * let tmpFable = new libFable({ Product: 'MyApp', APIServerPort: 8080 });
103
+ * tmpFable.serviceManager.addServiceType('OratorServiceServer', libOratorServiceServerRestify);
104
+ * tmpFable.serviceManager.addServiceType('Orator', libOrator);
105
+ *
106
+ * let tmpOrator = tmpFable.serviceManager.instantiateServiceProvider('Orator');
107
+ * let tmpFileBrowser = new libPictFileBrowser.FileBrowserService(tmpFable,
108
+ * { BasePath: '/path/to/browse', APIRoutePrefix: '/api/filebrowser' });
109
+ *
110
+ * tmpOrator.startService(() =>
111
+ * {
112
+ * tmpFileBrowser.connectRoutes();
113
+ * console.log('File browser ready at http://localhost:8080/filebrowser/');
114
+ * });
115
+ *
116
+ * @license MIT
117
+ * @author Steven Velozo <steven@velozo.com>
118
+ */
119
+ const n=t("fable-serviceproviderbase"),o=t("path"),r=t("fs"),s=t("url"),a={BasePath:".",APIRoutePrefix:"/api/filebrowser",WebAppRoute:"/filebrowser/*",WebAppRouteStrip:"/filebrowser/",ServeWebApp:!0,IncludeHiddenFiles:!1,MaxTreeDepth:2};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.serviceType="PictFileBrowserService";for(let t in a)t in this.options||(this.options[t]=a[t]);this.basePath=o.resolve(this.options.BasePath)}connectRoutes(){if(!this.fable.Orator||!this.fable.Orator.serviceServer)return this.log.error("PictFileBrowserService: Orator service server is not available. Initialize Orator first."),!1;let t=this.fable.Orator.serviceServer,e=this.options.APIRoutePrefix;if(t.get(e+"/list",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.listDirectory(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/tree",(t,e,i)=>{let n=this.parseQueryParams(t),o=this.options.MaxTreeDepth;n.depth&&(o=parseInt(n.depth)||this.options.MaxTreeDepth),this.buildFolderTree("",o,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/info",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.getFileInfo(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/children",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.listChildFolders(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),this.options.ServeWebApp){let t=o.join(i,"..","www");this.fable.Orator.addStaticRoute(t,"index.html",this.options.WebAppRoute,this.options.WebAppRouteStrip)}return this.log.info("PictFileBrowserService: Routes connected. Browsing path: "+this.basePath),!0}parseQueryParams(t){if(t.query&&"object"==typeof t.query)return t.query;return s.parse(t.url,!0).query||{}}resolveSafePath(t){let e=(t||"").replace(/\.\./g,"").replace(/\/\//g,"/"),i=o.resolve(this.basePath,e);return 0!==i.indexOf(this.basePath)?null:i}listDirectory(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(n,s)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):"ENOTDIR"===n.code?e(new Error("Path is not a directory")):e(n);let a=[],l=s.length;if(0===l)return e(null,a);for(let n=0;n<s.length;n++){let c=s[n],d=c.name;if(!this.options.IncludeHiddenFiles&&"."===d.charAt(0)){if(l--,0===l)return e(null,a);continue}let p=o.join(i,d),h=t?t+"/"+d:d;r.stat(p,((t,i,n)=>(r,s)=>{let c={Name:t,Path:i,Type:n?"folder":"file"};if(s&&!r&&(c.Size=s.size,c.Modified=s.mtime,c.Created=s.birthtime,n||(c.Extension=o.extname(t))),a.push(c),l--,0===l)return e(null,a)})(d,h,c.isDirectory()))}})}listChildFolders(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(n,s)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):"ENOTDIR"===n.code?e(new Error("Path is not a directory")):e(n);let a=[];for(let t=0;t<s.length;t++){if(!s[t].isDirectory())continue;let e=s[t].name;(this.options.IncludeHiddenFiles||"."!==e.charAt(0))&&a.push(e)}if(a.sort((t,e)=>t.localeCompare(e)),0===a.length)return e(null,[]);let l=[],c=a.length;for(let n=0;n<a.length;n++){let s=a[n],d=o.join(i,s),p=t?t+"/"+s:s;r.readdir(d,{withFileTypes:!0},((t,i)=>(n,o)=>{let r=!1;if(!n&&o)for(let t=0;t<o.length;t++)if(o[t].isDirectory()){let e=o[t].name;if(this.options.IncludeHiddenFiles||"."!==e.charAt(0)){r=!0;break}}if(l.push({Name:t,Path:i,HasChildren:r}),c--,0===c)return l.sort((t,e)=>t.Name.localeCompare(e.Name)),e(null,l)})(s,p))}})}buildFolderTree(t,e,i){let n=this.resolveSafePath(t);if(!n)return i(new Error("Invalid path"));this._buildTreeRecursive(n,t,e,0,i)}_buildTreeRecursive(t,e,i,n,s){if(i>0&&n>=i)return s(null,[]);r.readdir(t,{withFileTypes:!0},(r,a)=>{if(r)return s(null,[]);let l=[];for(let t=0;t<a.length;t++)if(a[t].isDirectory()){let e=a[t].name;if(!this.options.IncludeHiddenFiles&&"."===e.charAt(0))continue;l.push(e)}if(0===l.length)return s(null,[]);let c=[],d=l.length;for(let r=0;r<l.length;r++){let a=l[r],p=o.join(t,a),h=e?e+"/"+a:a;this._buildTreeRecursive(p,h,i,n+1,((t,e)=>(i,n)=>{if(c.push({Name:t,Path:e,Children:n||[]}),d--,0===d)return c.sort((t,e)=>t.Name.localeCompare(e.Name)),s(null,c)})(a,h))}})}getFileInfo(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.stat(i,(n,r)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):e(n);let s=o.basename(i),a={Name:s,Path:t||s,Type:r.isDirectory()?"folder":"file",Size:r.size,Modified:r.mtime,Created:r.birthtime};return r.isDirectory()||(a.Extension=o.extname(s)),e(null,a)})}},e.exports.default_configuration=a}).call(this)}).call(this,"/node_modules/pict-section-filebrowser/source/services")},{"fable-serviceproviderbase":85,fs:67,path:106,url:137}],117:[function(t,e,i){arguments[4][37][0].apply(i,arguments)},{dup:37,"pict-view":125}],118:[function(t,e,i){arguments[4][38][0].apply(i,arguments)},{dup:38,"pict-view":125}],119:[function(t,e,i){arguments[4][39][0].apply(i,arguments)},{dup:39,"pict-view":125}],120:[function(t,e,i){arguments[4][40][0].apply(i,arguments)},{dup:40,"pict-view":125}],121:[function(t,e,i){arguments[4][41][0].apply(i,arguments)},{dup:41,"pict-view":125}],122:[function(t,e,i){arguments[4][42][0].apply(i,arguments)},{dup:42,"pict-view":125}],123:[function(t,e,i){arguments[4][43][0].apply(i,arguments)},{"../Pict-Section-FileBrowser-DefaultConfiguration.js":109,"../providers/Pict-Provider-FileBrowserBrowse.js":111,"../providers/Pict-Provider-FileBrowserIcons.js":112,"../providers/Pict-Provider-FileBrowserLayout.js":113,"../providers/Pict-Provider-FileBrowserList.js":114,"../providers/Pict-Provider-FileBrowserView.js":115,dup:43,"pict-view":125}],124:[function(t,e,i){arguments[4][51][0].apply(i,arguments)},{dup:51}],125:[function(t,e,i){arguments[4][52][0].apply(i,arguments)},{"../package.json":124,dup:52,"fable-serviceproviderbase":85}],126:[function(t,e,i){var n,o,r=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var c,d=[],p=!1,h=-1;function u(){p&&c&&(p=!1,c.length?d=c.concat(d):h=-1,d.length&&f())}function f(){if(!p){var t=l(u);p=!0;for(var e=d.length;e;){for(c=d,d=[];++h<e;)c&&c[h].run();h=-1,e=d.length}c=null,p=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function g(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];d.push(new m(t,e)),1!==d.length||p||l(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},{}],127:[function(t,e,i){(function(t){(function(){!function(n){var o="object"==typeof i&&i&&!i.nodeType&&i,r="object"==typeof e&&e&&!e.nodeType&&e,s="object"==typeof t&&t;s.global!==s&&s.window!==s&&s.self!==s||(n=s);var a,l,c=2147483647,d=36,p=/^xn--/,h=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function v(t){throw new RangeError(f[t])}function b(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function y(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+b((t=t.replace(u,".")).split("."),e).join(".")}function w(t){for(var e,i,n=[],o=0,r=t.length;o<r;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<r?56320==(64512&(i=t.charCodeAt(o++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),o--):n.push(e);return n}function C(t){return b(t,function(t){var e="";return t>65535&&(e+=g((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=g(t)}).join("")}function x(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:d}function A(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function D(t,e,i){var n=0;for(t=i?m(t/700):t>>1,t+=m(t/e);t>455;n+=d)t=m(t/35);return m(n+36*t/(t+38))}function E(t){var e,i,n,o,r,s,a,l,p,h,u=[],f=t.length,g=0,b=128,y=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&v("not-basic"),u.push(t.charCodeAt(n));for(o=i>0?i+1:0;o<f;){for(r=g,s=1,a=d;o>=f&&v("invalid-input"),((l=x(t.charCodeAt(o++)))>=d||l>m((c-g)/s))&&v("overflow"),g+=l*s,!(l<(p=a<=y?1:a>=y+26?26:a-y));a+=d)s>m(c/(h=d-p))&&v("overflow"),s*=h;y=D(g-r,e=u.length+1,0==r),m(g/e)>c-b&&v("overflow"),b+=m(g/e),g%=e,u.splice(g++,0,b)}return C(u)}function P(t){var e,i,n,o,r,s,a,l,p,h,u,f,b,y,C,x=[];for(f=(t=w(t)).length,e=128,i=0,r=72,s=0;s<f;++s)(u=t[s])<128&&x.push(g(u));for(n=o=x.length,o&&x.push("-");n<f;){for(a=c,s=0;s<f;++s)(u=t[s])>=e&&u<a&&(a=u);for(a-e>m((c-i)/(b=n+1))&&v("overflow"),i+=(a-e)*b,e=a,s=0;s<f;++s)if((u=t[s])<e&&++i>c&&v("overflow"),u==e){for(l=i,p=d;!(l<(h=p<=r?1:p>=r+26?26:p-r));p+=d)C=l-h,y=d-h,x.push(g(A(h+C%y,0))),l=m(C/y);x.push(g(A(l,0))),r=D(i,b,n==o),i=0,++n}++i,++e}return x.join("")}if(a={version:"1.4.1",ucs2:{decode:w,encode:C},decode:E,encode:P,toASCII:function(t){return y(t,function(t){return h.test(t)?"xn--"+P(t):t})},toUnicode:function(t){return y(t,function(t){return p.test(t)?E(t.slice(4).toLowerCase()):t})}},o&&r)if(e.exports==o)r.exports=a;else for(l in a)a.hasOwnProperty(l)&&(o[l]=a[l]);else n.punycode=a}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],128:[function(t,e,i){var n=String.prototype.replace,o=/%20/g,r="RFC1738",s="RFC3986";e.exports={default:s,formatters:{RFC1738:function(t){return n.call(t,o,"+")},RFC3986:function(t){return String(t)}},RFC1738:r,RFC3986:s}},{}],129:[function(t,e,i){var n=t("./stringify"),o=t("./parse"),r=t("./formats");e.exports={formats:r,parse:o,stringify:n}},{"./formats":128,"./parse":130,"./stringify":131}],130:[function(t,e,i){var n=t("./utils"),o=Object.prototype.hasOwnProperty,r=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(t){return t.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},l=function(t,e,i){if(t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&i>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");return t},c=function(t,e,i,r){if(t){var s=function(t,e){var i=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(e.depth<=0){if(!e.plainObjects&&o.call(Object.prototype,i)&&!e.allowPrototypes)return;return[i]}var n=/(\[[^[\]]*])/g,r=/(\[[^[\]]*])/.exec(i),s=r?i.slice(0,r.index):i,a=[];if(s){if(!e.plainObjects&&o.call(Object.prototype,s)&&!e.allowPrototypes)return;a[a.length]=s}for(var l=0;null!==(r=n.exec(i))&&l<e.depth;){l+=1;var c=r[1].slice(1,-1);if(!e.plainObjects&&o.call(Object.prototype,c)&&!e.allowPrototypes)return;a[a.length]=r[1]}if(r){if(!0===e.strictDepth)throw new RangeError("Input depth exceeded depth option of "+e.depth+" and strictDepth is true");a[a.length]="["+i.slice(r.index)+"]"}return a}(t,i);if(s)return function(t,e,i,o){var r=0;if(t.length>0&&"[]"===t[t.length-1]){var s=t.slice(0,-1).join("");r=Array.isArray(e)&&e[s]?e[s].length:0}for(var a=o?e:l(e,i,r),c=t.length-1;c>=0;--c){var d,p=t[c];if("[]"===p&&i.parseArrays)d=n.isOverflow(a)?a:i.allowEmptyArrays&&(""===a||i.strictNullHandling&&null===a)?[]:n.combine([],a,i.arrayLimit,i.plainObjects);else{d=i.plainObjects?{__proto__:null}:{};var h="["===p.charAt(0)&&"]"===p.charAt(p.length-1)?p.slice(1,-1):p,u=i.decodeDotInKeys?h.replace(/%2E/g,"."):h,f=parseInt(u,10),m=!isNaN(f)&&p!==u&&String(f)===u&&f>=0&&i.parseArrays;if(i.parseArrays||""!==u)if(m&&f<i.arrayLimit)(d=[])[f]=a;else{if(m&&i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(1===i.arrayLimit?"":"s")+" allowed in an array.");m?(d[f]=a,n.markOverflow(d,f)):"__proto__"!==u&&(d[u]=a)}else d={0:a}}a=d}return a}(s,e,i,r)}};e.exports=function(t,e){var i=function(t){if(!t)return s;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.decodeDotInKeys&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==t.throwOnLimitExceeded&&"boolean"!=typeof t.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=void 0===t.charset?s.charset:t.charset,i=void 0===t.duplicates?s.duplicates:t.duplicates;if("combine"!==i&&"first"!==i&&"last"!==i)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===t.allowDots?!0===t.decodeDotInKeys||s.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:s.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:s.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:s.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:s.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:s.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:s.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:s.depth,duplicates:i,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:s.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:s.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:s.strictDepth,strictMerge:"boolean"==typeof t.strictMerge?!!t.strictMerge:s.strictMerge,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof t.throwOnLimitExceeded&&t.throwOnLimitExceeded}}(e);if(""===t||null==t)return i.plainObjects?{__proto__:null}:{};for(var d="string"==typeof t?function(t,e){var i={__proto__:null},c=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;c=c.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var d=e.parameterLimit===1/0?void 0:e.parameterLimit,p=c.split(e.delimiter,e.throwOnLimitExceeded?d+1:d);if(e.throwOnLimitExceeded&&p.length>d)throw new RangeError("Parameter limit exceeded. Only "+d+" parameter"+(1===d?"":"s")+" allowed.");var h,u=-1,f=e.charset;if(e.charsetSentinel)for(h=0;h<p.length;++h)0===p[h].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[h]?f="utf-8":"utf8=%26%2310003%3B"===p[h]&&(f="iso-8859-1"),u=h,h=p.length);for(h=0;h<p.length;++h)if(h!==u){var m,g,v=p[h],b=v.indexOf("]="),y=-1===b?v.indexOf("="):b+1;if(-1===y?(m=e.decoder(v,s.decoder,f,"key"),g=e.strictNullHandling?null:""):null!==(m=e.decoder(v.slice(0,y),s.decoder,f,"key"))&&(g=n.maybeMap(l(v.slice(y+1),e,r(i[m])?i[m].length:0),function(t){return e.decoder(t,s.decoder,f,"value")})),g&&e.interpretNumericEntities&&"iso-8859-1"===f&&(g=a(String(g))),v.indexOf("[]=")>-1&&(g=r(g)?[g]:g),e.comma&&r(g)&&g.length>e.arrayLimit){if(e.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");g=n.combine([],g,e.arrayLimit,e.plainObjects)}if(null!==m){var w=o.call(i,m);w&&("combine"===e.duplicates||v.indexOf("[]=")>-1)?i[m]=n.combine(i[m],g,e.arrayLimit,e.plainObjects):w&&"last"!==e.duplicates||(i[m]=g)}}return i}(t,i):t,p=i.plainObjects?{__proto__:null}:{},h=Object.keys(d),u=0;u<h.length;++u){var f=h[u],m=c(f,d[f],i,"string"==typeof t);p=n.merge(p,m,i)}return!0===i.allowSparse?p:n.compact(p)}},{"./utils":132}],131:[function(t,e,i){var n=t("side-channel"),o=t("./utils"),r=t("./formats"),s=Object.prototype.hasOwnProperty,a={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},l=Array.isArray,c=Array.prototype.push,d=function(t,e){c.apply(t,l(e)?e:[e])},p=Date.prototype.toISOString,h=r.default,u={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:r.formatters[h],indices:!1,serializeDate:function(t){return p.call(t)},skipNulls:!1,strictNullHandling:!1},f={},m=function t(e,i,r,s,a,c,p,h,m,g,v,b,y,w,C,x,A,D){for(var E,P=e,S=D,k=0,F=!1;void 0!==(S=S.get(f))&&!F;){var T=S.get(e);if(k+=1,void 0!==T){if(T===k)throw new RangeError("Cyclic object value");F=!0}void 0===S.get(f)&&(k=0)}if("function"==typeof g?P=g(i,P):P instanceof Date?P=y(P):"comma"===r&&l(P)&&(P=o.maybeMap(P,function(t){return t instanceof Date?y(t):t})),null===P){if(c)return m&&!x?m(i,u.encoder,A,"key",w):i;P=""}if("string"==typeof(E=P)||"number"==typeof E||"boolean"==typeof E||"symbol"==typeof E||"bigint"==typeof E||o.isBuffer(P))return m?[C(x?i:m(i,u.encoder,A,"key",w))+"="+C(m(P,u.encoder,A,"value",w))]:[C(i)+"="+C(String(P))];var R,I=[];if(void 0===P)return I;if("comma"===r&&l(P))x&&m&&(P=o.maybeMap(P,m)),R=[{value:P.length>0?P.join(",")||null:void 0}];else if(l(g))R=g;else{var L=Object.keys(P);R=v?L.sort(v):L}var M=h?String(i).replace(/\./g,"%2E"):String(i),_=s&&l(P)&&1===P.length?M+"[]":M;if(a&&l(P)&&0===P.length)return _+"[]";for(var B=0;B<R.length;++B){var H=R[B],V="object"==typeof H&&H&&void 0!==H.value?H.value:P[H];if(!p||null!==V){var j=b&&h?String(H).replace(/\./g,"%2E"):String(H),z=l(P)?"function"==typeof r?r(_,j):_:_+(b?"."+j:"["+j+"]");D.set(e,k);var N=n();N.set(f,D),d(I,t(V,z,r,s,a,c,p,h,"comma"===r&&x&&l(P)?null:m,g,v,b,y,w,C,x,A,N))}}return I};e.exports=function(t,e){var i,o=t,c=function(t){if(!t)return u;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.encodeDotInKeys&&"boolean"!=typeof t.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||u.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=r.default;if(void 0!==t.format){if(!s.call(r.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var n,o=r.formatters[i],c=u.filter;if(("function"==typeof t.filter||l(t.filter))&&(c=t.filter),n=t.arrayFormat in a?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":u.arrayFormat,"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=void 0===t.allowDots?!0===t.encodeDotInKeys||u.allowDots:!!t.allowDots;return{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:u.addQueryPrefix,allowDots:d,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:u.allowEmptyArrays,arrayFormat:n,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:u.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:void 0===t.delimiter?u.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:u.encode,encodeDotInKeys:"boolean"==typeof t.encodeDotInKeys?t.encodeDotInKeys:u.encodeDotInKeys,encoder:"function"==typeof t.encoder?t.encoder:u.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:u.encodeValuesOnly,filter:c,format:i,formatter:o,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:u.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:u.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:u.strictNullHandling}}(e);"function"==typeof c.filter?o=(0,c.filter)("",o):l(c.filter)&&(i=c.filter);var p=[];if("object"!=typeof o||null===o)return"";var h=a[c.arrayFormat],f="comma"===h&&c.commaRoundTrip;i||(i=Object.keys(o)),c.sort&&i.sort(c.sort);for(var g=n(),v=0;v<i.length;++v){var b=i[v],y=o[b];c.skipNulls&&null===y||d(p,m(y,b,h,f,c.allowEmptyArrays,c.strictNullHandling,c.skipNulls,c.encodeDotInKeys,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,g))}var w=p.join(c.delimiter),C=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?C+="utf8=%26%2310003%3B&":C+="utf8=%E2%9C%93&"),w.length>0?C+w:""}},{"./formats":128,"./utils":132,"side-channel":136}],132:[function(t,e,i){var n=t("./formats"),o=t("side-channel"),r=Object.prototype.hasOwnProperty,s=Array.isArray,a=o(),l=function(t,e){return a.set(t,e),t},c=function(t){return a.has(t)},d=function(t){return a.get(t)},p=function(t,e){a.set(t,e)},h=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),u=function(t,e){for(var i=e&&e.plainObjects?{__proto__:null}:{},n=0;n<t.length;++n)void 0!==t[n]&&(i[n]=t[n]);return i},f=1024;e.exports={arrayToObject:u,assign:function(t,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},t)},combine:function(t,e,i,n){if(c(t)){var o=d(t)+1;return t[o]=e,p(t,o),t}var r=[].concat(t,e);return r.length>i?l(u(r,{plainObjects:n}),r.length-1):r},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],n=0;n<e.length;++n)for(var o=e[n],r=o.obj[o.prop],a=Object.keys(r),l=0;l<a.length;++l){var c=a[l],d=r[c];"object"==typeof d&&null!==d&&-1===i.indexOf(d)&&(e[e.length]={obj:r,prop:c},i[i.length]=d)}return function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(s(i)){for(var n=[],o=0;o<i.length;++o)void 0!==i[o]&&(n[n.length]=i[o]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,i){var n=t.replace(/\+/g," ");if("iso-8859-1"===i)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,i,o,r){if(0===t.length)return t;var s=t;if("symbol"==typeof t?s=Symbol.prototype.toString.call(t):"string"!=typeof t&&(s=String(t)),"iso-8859-1"===i)return escape(s).replace(/%u[0-9a-f]{4}/gi,function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"});for(var a="",l=0;l<s.length;l+=f){for(var c=s.length>=f?s.slice(l,l+f):s,d=[],p=0;p<c.length;++p){var u=c.charCodeAt(p);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||r===n.RFC1738&&(40===u||41===u)?d[d.length]=c.charAt(p):u<128?d[d.length]=h[u]:u<2048?d[d.length]=h[192|u>>6]+h[128|63&u]:u<55296||u>=57344?d[d.length]=h[224|u>>12]+h[128|u>>6&63]+h[128|63&u]:(p+=1,u=65536+((1023&u)<<10|1023&c.charCodeAt(p)),d[d.length]=h[240|u>>18]+h[128|u>>12&63]+h[128|u>>6&63]+h[128|63&u])}a+=d.join("")}return a},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isOverflow:c,isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},markOverflow:l,maybeMap:function(t,e){if(s(t)){for(var i=[],n=0;n<t.length;n+=1)i[i.length]=e(t[n]);return i}return e(t)},merge:function t(e,i,n){if(!i)return e;if("object"!=typeof i&&"function"!=typeof i){if(s(e)){var o=e.length;if(n&&"number"==typeof n.arrayLimit&&o>n.arrayLimit)return l(u(e.concat(i),n),o);e[o]=i}else{if(!e||"object"!=typeof e)return[e,i];if(c(e)){var a=d(e)+1;e[a]=i,p(e,a)}else{if(n&&n.strictMerge)return[e,i];(n&&(n.plainObjects||n.allowPrototypes)||!r.call(Object.prototype,i))&&(e[i]=!0)}}return e}if(!e||"object"!=typeof e){if(c(i)){for(var h=Object.keys(i),f=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},m=0;m<h.length;m++){f[parseInt(h[m],10)+1]=i[h[m]]}return l(f,d(i)+1)}var g=[e].concat(i);return n&&"number"==typeof n.arrayLimit&&g.length>n.arrayLimit?l(u(g,n),g.length-1):g}var v=e;return s(e)&&!s(i)&&(v=u(e,n)),s(e)&&s(i)?(i.forEach(function(i,o){if(r.call(e,o)){var s=e[o];s&&"object"==typeof s&&i&&"object"==typeof i?e[o]=t(s,i,n):e[e.length]=i}else e[o]=i}),e):Object.keys(i).reduce(function(e,o){var s=i[o];if(r.call(e,o)?e[o]=t(e[o],s,n):e[o]=s,c(i)&&!c(e)&&l(e,d(i)),c(e)){var a=parseInt(o,10);String(a)===o&&a>=0&&a>d(e)&&p(e,a)}return e},v)}}},{"./formats":128,"side-channel":136}],133:[function(t,e,i){var n=t("object-inspect"),o=t("es-errors/type"),r=function(t,e,i){for(var n,o=t;null!=(n=o.next);o=n)if(n.key===e)return o.next=n.next,i||(n.next=t.next,t.next=n),n};e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){var i=t&&t.next,n=function(t,e){if(t)return r(t,e,!0)}(t,e);return n&&i&&i===n&&(t=void 0),!!n},get:function(e){return function(t,e){if(t){var i=r(t,e);return i&&i.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!r(t,e)}(t,e)},set:function(e,i){t||(t={next:void 0}),function(t,e,i){var n=r(t,e);n?n.value=i:t.next={key:e,next:t.next,value:i}}(t,e,i)}};return e}},{"es-errors/type":81,"object-inspect":105}],134:[function(t,e,i){var n=t("get-intrinsic"),o=t("call-bound"),r=t("object-inspect"),s=t("es-errors/type"),a=n("%Map%",!0),l=o("Map.prototype.get",!0),c=o("Map.prototype.set",!0),d=o("Map.prototype.has",!0),p=o("Map.prototype.delete",!0),h=o("Map.prototype.size",!0);e.exports=!!a&&function(){var t,e={assert:function(t){if(!e.has(t))throw new s("Side channel does not contain "+r(t))},delete:function(e){if(t){var i=p(t,e);return 0===h(t)&&(t=void 0),i}return!1},get:function(e){if(t)return l(t,e)},has:function(e){return!!t&&d(t,e)},set:function(e,i){t||(t=new a),c(t,e,i)}};return e}},{"call-bound":73,"es-errors/type":81,"get-intrinsic":88,"object-inspect":105}],135:[function(t,e,i){var n=t("get-intrinsic"),o=t("call-bound"),r=t("object-inspect"),s=t("side-channel-map"),a=t("es-errors/type"),l=n("%WeakMap%",!0),c=o("WeakMap.prototype.get",!0),d=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),h=o("WeakMap.prototype.delete",!0);e.exports=l?function(){var t,e,i={assert:function(t){if(!i.has(t))throw new a("Side channel does not contain "+r(t))},delete:function(i){if(l&&i&&("object"==typeof i||"function"==typeof i)){if(t)return h(t,i)}else if(s&&e)return e.delete(i);return!1},get:function(i){return l&&i&&("object"==typeof i||"function"==typeof i)&&t?c(t,i):e&&e.get(i)},has:function(i){return l&&i&&("object"==typeof i||"function"==typeof i)&&t?p(t,i):!!e&&e.has(i)},set:function(i,n){l&&i&&("object"==typeof i||"function"==typeof i)?(t||(t=new l),d(t,i,n)):s&&(e||(e=s()),e.set(i,n))}};return i}:s},{"call-bound":73,"es-errors/type":81,"get-intrinsic":88,"object-inspect":105,"side-channel-map":134}],136:[function(t,e,i){var n=t("es-errors/type"),o=t("object-inspect"),r=t("side-channel-list"),s=t("side-channel-map"),a=t("side-channel-weakmap")||s||r;e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new n("Side channel does not contain "+o(t))},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,i){t||(t=a()),t.set(e,i)}};return e}},{"es-errors/type":81,"object-inspect":105,"side-channel-list":133,"side-channel-map":134,"side-channel-weakmap":135}],137:[function(t,e,i){var n=t("punycode/");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),d=["%","/","?",";","#"].concat(c),p=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=t("qs");function b(t,e,i){if(t&&"object"==typeof t&&t instanceof o)return t;var n=new o;return n.parse(t,e,i),n}o.prototype.parse=function(t,e,i){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",l=t.split(s);l[0]=l[0].replace(/\\/g,"/");var b=t=l.join(s);if(b=b.trim(),!i&&1===t.split("#").length){var y=a.exec(b);if(y)return this.path=b,this.href=b,this.pathname=y[1],y[2]?(this.search=y[2],this.query=e?v.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=r.exec(b);if(w){var C=(w=w[0]).toLowerCase();this.protocol=C,b=b.substr(w.length)}if(i||w||b.match(/^\/\/[^@/]+@[^@/]+/)){var x="//"===b.substr(0,2);!x||w&&m[w]||(b=b.substr(2),this.slashes=!0)}if(!m[w]&&(x||w&&!g[w])){for(var A,D,E=-1,P=0;P<p.length;P++){-1!==(S=b.indexOf(p[P]))&&(-1===E||S<E)&&(E=S)}-1!==(D=-1===E?b.lastIndexOf("@"):b.lastIndexOf("@",E))&&(A=b.slice(0,D),b=b.slice(D+1),this.auth=decodeURIComponent(A)),E=-1;for(P=0;P<d.length;P++){var S;-1!==(S=b.indexOf(d[P]))&&(-1===E||S<E)&&(E=S)}-1===E&&(E=b.length),this.host=b.slice(0,E),b=b.slice(E),this.parseHost(),this.hostname=this.hostname||"";var k="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!k)for(var F=this.hostname.split(/\./),T=(P=0,F.length);P<T;P++){var R=F[P];if(R&&!R.match(h)){for(var I="",L=0,M=R.length;L<M;L++)R.charCodeAt(L)>127?I+="x":I+=R[L];if(!I.match(h)){var _=F.slice(0,P),B=F.slice(P+1),H=R.match(u);H&&(_.push(H[1]),B.unshift(H[2])),B.length&&(b="/"+B.join(".")+b),this.hostname=_.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=n.toASCII(this.hostname));var V=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+V,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!f[C])for(P=0,T=c.length;P<T;P++){var z=c[P];if(-1!==b.indexOf(z)){var N=encodeURIComponent(z);N===z&&(N=escape(z)),b=b.split(z).join(N)}}var O=b.indexOf("#");-1!==O&&(this.hash=b.substr(O),b=b.slice(0,O));var U=b.indexOf("?");if(-1!==U?(this.search=b.substr(U),this.query=b.substr(U+1),e&&(this.query=v.parse(this.query)),b=b.slice(0,U)):e&&(this.search="",this.query={}),b&&(this.pathname=b),g[C]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){V=this.pathname||"";var W=this.search||"";this.path=V+W}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",n=this.hash||"",o=!1,r="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(r=v.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||r&&"?"+r||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==o?(o="//"+(o||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(i=i.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if("string"==typeof t){var e=new o;e.parse(t,!1,!0),t=e}for(var i=new o,n=Object.keys(this),r=0;r<n.length;r++){var s=n[r];i[s]=this[s]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var a=Object.keys(t),l=0;l<a.length;l++){var c=a[l];"protocol"!==c&&(i[c]=t[c])}return g[i.protocol]&&i.hostname&&!i.pathname&&(i.pathname="/",i.path=i.pathname),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!g[t.protocol]){for(var d=Object.keys(t),p=0;p<d.length;p++){var h=d[p];i[h]=t[h]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||m[t.protocol])i.pathname=t.pathname;else{for(var u=(t.pathname||"").split("/");u.length&&!(t.host=u.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==u[0]&&u.unshift(""),u.length<2&&u.unshift(""),i.pathname=u.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var f=i.pathname||"",v=i.search||"";i.path=f+v}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var b=i.pathname&&"/"===i.pathname.charAt(0),y=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=y||b||i.host&&t.pathname,C=w,x=i.pathname&&i.pathname.split("/")||[],A=(u=t.pathname&&t.pathname.split("/")||[],i.protocol&&!g[i.protocol]);if(A&&(i.hostname="",i.port=null,i.host&&(""===x[0]?x[0]=i.host:x.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===u[0]?u[0]=t.host:u.unshift(t.host)),t.host=null),w=w&&(""===u[0]||""===x[0])),y)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,x=u;else if(u.length)x||(x=[]),x.pop(),x=x.concat(u),i.search=t.search,i.query=t.query;else if(null!=t.search){if(A)i.host=x.shift(),i.hostname=i.host,(k=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=k.shift(),i.hostname=k.shift(),i.host=i.hostname);return i.search=t.search,i.query=t.query,null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!x.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var D=x.slice(-1)[0],E=(i.host||t.host||x.length>1)&&("."===D||".."===D)||""===D,P=0,S=x.length;S>=0;S--)"."===(D=x[S])?x.splice(S,1):".."===D?(x.splice(S,1),P++):P&&(x.splice(S,1),P--);if(!w&&!C)for(;P--;P)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),E&&"/"!==x.join("/").substr(-1)&&x.push("");var k,F=""===x[0]||x[0]&&"/"===x[0].charAt(0);A&&(i.hostname=F?"":x.length?x.shift():"",i.host=i.hostname,(k=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=k.shift(),i.hostname=k.shift(),i.host=i.hostname));return(w=w||i.host&&x.length)&&!F&&x.unshift(""),x.length>0?i.pathname=x.join("/"):(i.pathname=null,i.path=null),null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},i.parse=b,i.resolve=function(t,e){return b(t,!1,!0).resolve(e)},i.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},i.format=function(t){return"string"==typeof t&&(t=b(t)),t instanceof o?t.format():o.prototype.format.call(t)},i.Url=o},{"punycode/":127,qs:129}],138:[function(t,e,i){e.exports={Name:"Retold Remote",MainViewportViewIdentifier:"ContentEditor-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1}},{}],139:[function(t,e,i){const n=t("retold-content-system").PictContentEditor,o=(t("pict-section-filebrowser"),t("./providers/Pict-Provider-RetoldRemote.js")),r=t("./providers/Pict-Provider-GalleryNavigation.js"),s=t("./providers/Pict-Provider-GalleryFilterSort.js"),a=t("./providers/Pict-Provider-RetoldRemoteIcons.js"),l=t("./providers/Pict-Provider-RetoldRemoteTheme.js"),c=t("./views/PictView-Remote-Layout.js"),d=t("./views/PictView-Remote-TopBar.js"),p=t("./views/PictView-Remote-SettingsPanel.js"),h=t("./views/PictView-Remote-Gallery.js"),u=t("./views/PictView-Remote-MediaViewer.js"),f=t("./views/PictView-Remote-ImageViewer.js"),m=t("./Pict-Application-RetoldRemote-Configuration.json");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},m,e),i),this.pict.addView("ContentEditor-Layout",c.default_configuration,c),this.pict.addView("ContentEditor-TopBar",d.default_configuration,d),this.pict.addView("RetoldRemote-Gallery",h.default_configuration,h),this.pict.addView("RetoldRemote-MediaViewer",u.default_configuration,u),this.pict.addView("RetoldRemote-ImageViewer",f.default_configuration,f),this.pict.addView("RetoldRemote-SettingsPanel",p.default_configuration,p),this.pict.addProvider("RetoldRemote-Provider",o.default_configuration,o),this.pict.addProvider("RetoldRemote-GalleryNavigation",r.default_configuration,r),this.pict.addProvider("RetoldRemote-GalleryFilterSort",s.default_configuration,s),this.pict.addProvider("RetoldRemote-Icons",a.default_configuration,a),this.pict.addProvider("RetoldRemote-Theme",l.default_configuration,l)}onAfterInitializeAsync(t){"undefined"!=typeof window&&(window.pict=this.pict),this.pict.AppData.RetoldRemote={ActiveMode:"gallery",Theme:"twilight",ViewMode:"list",ThumbnailSize:"medium",RawFileList:[],GalleryItems:[],GalleryCursorIndex:0,GalleryFilter:"all",SearchQuery:"",ServerCapabilities:{},FolderSummary:null,CurrentViewerFile:"",CurrentViewerMediaType:"",HashedFilenames:!1,ShowHiddenFiles:!1,DistractionFreeShowNav:!0,ImageFitMode:"auto",SidebarCollapsed:!1,SidebarWidth:250,FilterState:{MediaType:"all",Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null},SortField:"folder-first",SortDirection:"asc",FilterPanelOpen:!1,FilterPresets:[]},this._loadRemoteSettings();let e=this.pict.providers["RetoldRemote-Theme"];e&&e.applyTheme(this.pict.AppData.RetoldRemote.Theme),this.pict.AppData.ContentEditor={CurrentFile:"",ActiveEditor:"markdown",IsDirty:!1,IsSaving:!1,IsLoading:!1,Files:[],Document:{Segments:[{Content:""}]},CodeContent:"",SaveStatus:"",SaveStatusClass:"",AutoSegmentMarkdown:!1,AutoSegmentDepth:1,AutoContentPreview:!1,MarkdownEditingControls:!0,MarkdownWordWrap:!0,CodeWordWrap:!1,SidebarCollapsed:this.pict.AppData.RetoldRemote.SidebarCollapsed,SidebarWidth:this.pict.AppData.RetoldRemote.SidebarWidth,AutoPreviewImages:!0,AutoPreviewVideo:!1,AutoPreviewAudio:!1,ShowHiddenFiles:this.pict.AppData.RetoldRemote.ShowHiddenFiles,TopicsFilePath:""},this.pict.views["ContentEditor-Layout"].render(),this.pict.views["ContentEditor-TopBar"].render();let i=this,n=this.pict.providers["Pict-FileBrowser-List"];if(n){let t=n.selectFile.bind(n);n.selectFile=function(e){t(e),e&&"file"===e.Type&&i.navigateToFile(e.Path)}}let o=this.pict.providers["Pict-FileBrowser-Browse"];if(o){let t=o.navigateToFolder.bind(o);o.navigateToFolder=function(e){t(e),i.loadFileList(e)}}let r=this.pict.providers["RetoldRemote-Provider"];r&&(r.fetchCapabilities((t,e)=>{!t&&e&&(i.pict.AppData.RetoldRemote.ServerCapabilities=e)}),r.fetchRemoteSettings((t,e)=>{!t&&e&&(i.pict.AppData.RetoldRemote.HashedFilenames=!!e.HashedFilenames)}));let s=this.pict.providers["RetoldRemote-GalleryNavigation"];if(s&&s.bindKeyboardNavigation(),this.syncHiddenFilesSetting(()=>{i.loadFileList(null,()=>{i.resolveHash()})}),"function"==typeof t)return t()}_getMediaType(t){if({pdf:!0,epub:!0,mobi:!0}[t])return"document";return{js:!0,mjs:!0,cjs:!0,ts:!0,tsx:!0,jsx:!0,py:!0,rb:!0,java:!0,c:!0,cpp:!0,h:!0,hpp:!0,cs:!0,go:!0,rs:!0,php:!0,sh:!0,bash:!0,zsh:!0,pl:!0,r:!0,swift:!0,kt:!0,scala:!0,lua:!0,json:!0,xml:!0,yaml:!0,yml:!0,toml:!0,ini:!0,cfg:!0,conf:!0,env:!0,properties:!0,md:!0,markdown:!0,txt:!0,csv:!0,tsv:!0,log:!0,html:!0,htm:!0,css:!0,scss:!0,sass:!0,less:!0,sql:!0,graphql:!0,gql:!0,makefile:!0,dockerfile:!0,gitignore:!0,editorconfig:!0,htaccess:!0,npmrc:!0,eslintrc:!0,prettierrc:!0}[t]?"text":super._getMediaType(t)}navigateToFile(t){if(!t)return;let e=this.getEditorTypeForFile(t),i=t.replace(/^.*\./,"").toLowerCase(),n=this._getMediaType(i),o=(this.pict.AppData.RetoldRemote,this.pict.providers["RetoldRemote-Provider"]),r=o?o.getFragmentIdentifier(t):t;if(window.location.hash="#/view/"+r,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.ActiveEditor=e,"binary"===e){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,n)}else if("text"===n){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,"text")}else if("other"===n){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,"document")}else{let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,n)}let s=this.pict.views["ContentEditor-TopBar"];s&&s.updateInfo()}loadFileList(t,e){let i="function"==typeof e?e:"function"==typeof t?t:()=>{},n=this,o="string"==typeof t?t:null;null===o&&this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(o=this.pict.AppData.PictFileBrowser.CurrentLocation);let r="/api/filebrowser/list";if(o&&o.length>0){let t=n.pict.providers["RetoldRemote-Provider"];r+=t?"?path="+t._getPathParam(o):"?path="+encodeURIComponent(o)}fetch(r).then(t=>{let e=t.headers.get("X-Retold-Folder-Hash");if(e&&o){let t=n.pict.providers["RetoldRemote-Provider"];t&&t.registerHash(o,e)}return t.json()}).then(e=>{n.pict.AppData.PictFileBrowser=n.pict.AppData.PictFileBrowser||{},n.pict.AppData.PictFileBrowser.FileList=e||[],n.pict.AppData.PictFileBrowser.CurrentLocation="string"==typeof t?t:n.pict.AppData.PictFileBrowser.CurrentLocation||"";let o=n.pict.providers["RetoldRemote-Provider"];if(o&&Array.isArray(e))for(let t=0;t<e.length;t++)e[t].Hash&&e[t].Path&&o.registerHash(e[t].Path,e[t].Hash);let r=n.pict.views["Pict-FileBrowser"];r&&r.render();let s=n.pict.views["Pict-FileBrowser-ListDetail"];s&&s.render();let a=n.pict.AppData.RetoldRemote;a.RawFileList=e||[],a.ActiveMode="gallery",a.SearchQuery="",a.FilterState={MediaType:a.FilterState.MediaType,Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null};let l=document.getElementById("RetoldRemote-Gallery-Container"),c=document.getElementById("RetoldRemote-Viewer-Container");l&&(l.style.display=""),c&&(c.style.display="none");let d=n.pict.providers["RetoldRemote-GalleryFilterSort"];if(d)d.applyFilterSort();else{a.GalleryItems=e||[],a.GalleryCursorIndex=0;let t=n.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}let p=n.pict.AppData.PictFileBrowser.CurrentLocation||"",h=n.pict.providers["RetoldRemote-Provider"],u=h&&p?h.getFragmentIdentifier(p):p;window.location.hash=u?"#/browse/"+u:"#/browse/";let f=n.pict.providers["RetoldRemote-Provider"];if(f)f.fetchFolderSummary(p,(t,e)=>{if(!t&&e){a.FolderSummary=e;let t=n.pict.views["ContentEditor-TopBar"];t&&(t.updateLocation(),t.updateInfo())}});else{let t=n.pict.views["ContentEditor-TopBar"];t&&(t.updateLocation(),t.updateInfo())}return i()}).catch(t=>(n.log.error("Failed to load file list: ".concat(t.message)),i()))}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t)return;let e=t.split("/"),i=this.pict.providers["RetoldRemote-Provider"];if("browse"===e[0]){let t=e.slice(1).join("/"),n=i?i.resolveFragmentIdentifier(t):t;n!==(this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"")&&this.loadFileList(n)}else if("view"===e[0]&&e.length>=2){let t=e.slice(1).join("/"),n=i?i.resolveFragmentIdentifier(t):t;if(this.pict.AppData.ContentEditor.CurrentFile===n)return;this.navigateToFile(n)}else if("edit"===e[0]&&e.length>=2){let t=e.slice(1).join("/"),n=i?i.resolveFragmentIdentifier(t):t;this.navigateToFile(n)}}saveSettings(){try{let t=this.pict.AppData.RetoldRemote,e={Theme:t.Theme,ViewMode:t.ViewMode,ThumbnailSize:t.ThumbnailSize,GalleryFilter:t.GalleryFilter,ShowHiddenFiles:t.ShowHiddenFiles,DistractionFreeShowNav:t.DistractionFreeShowNav,ImageFitMode:t.ImageFitMode,SidebarCollapsed:t.SidebarCollapsed,SidebarWidth:t.SidebarWidth,SortField:t.SortField,SortDirection:t.SortDirection,FilterPresets:t.FilterPresets,FilterPanelOpen:t.FilterPanelOpen};localStorage.setItem("retold-remote-settings",JSON.stringify(e))}catch(t){}}_loadRemoteSettings(){try{let t=localStorage.getItem("retold-remote-settings");if(t){let e=JSON.parse(t),i=this.pict.AppData.RetoldRemote;e.Theme&&(i.Theme=e.Theme),e.ViewMode&&(i.ViewMode=e.ViewMode),e.ThumbnailSize&&(i.ThumbnailSize=e.ThumbnailSize),e.GalleryFilter&&(i.GalleryFilter=e.GalleryFilter,i.FilterState.MediaType=e.GalleryFilter),"boolean"==typeof e.ShowHiddenFiles&&(i.ShowHiddenFiles=e.ShowHiddenFiles),"boolean"==typeof e.DistractionFreeShowNav&&(i.DistractionFreeShowNav=e.DistractionFreeShowNav),e.ImageFitMode&&(i.ImageFitMode=e.ImageFitMode),"boolean"==typeof e.SidebarCollapsed&&(i.SidebarCollapsed=e.SidebarCollapsed),e.SidebarWidth&&(i.SidebarWidth=e.SidebarWidth),e.SortField&&(i.SortField=e.SortField),e.SortDirection&&(i.SortDirection=e.SortDirection),Array.isArray(e.FilterPresets)&&(i.FilterPresets=e.FilterPresets),"boolean"==typeof e.FilterPanelOpen&&(i.FilterPanelOpen=e.FilterPanelOpen)}}catch(t){}}}},{"./Pict-Application-RetoldRemote-Configuration.json":138,"./providers/Pict-Provider-GalleryFilterSort.js":141,"./providers/Pict-Provider-GalleryNavigation.js":142,"./providers/Pict-Provider-RetoldRemote.js":143,"./providers/Pict-Provider-RetoldRemoteIcons.js":144,"./providers/Pict-Provider-RetoldRemoteTheme.js":145,"./views/PictView-Remote-Gallery.js":146,"./views/PictView-Remote-ImageViewer.js":147,"./views/PictView-Remote-Layout.js":148,"./views/PictView-Remote-MediaViewer.js":149,"./views/PictView-Remote-SettingsPanel.js":150,"./views/PictView-Remote-TopBar.js":151,"pict-section-filebrowser":110,"retold-content-system":57}],140:[function(t,e,i){e.exports={RetoldRemoteApplication:t("./Pict-Application-RetoldRemote.js")},"undefined"!=typeof window&&(window.RetoldRemoteApplication=e.exports.RetoldRemoteApplication)},{"./Pict-Application-RetoldRemote.js":139}],141:[function(t,e,i){const n=t("pict-provider"),o={png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0,tiff:!0,tif:!0},r={mp4:!0,webm:!0,mov:!0,mkv:!0,avi:!0,wmv:!0,flv:!0,m4v:!0},s={mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0},a={pdf:!0,epub:!0,mobi:!0};class l extends n{constructor(t,e,i){super(t,e,i)}applyFilterSort(){let t=this.pict.AppData.RetoldRemote;if(!t)return;let e=(t.RawFileList||[]).slice();e=this._applySearch(e,t.SearchQuery);let i=t.FilterState||{};e=this._applyMediaTypeFilter(e,i.MediaType||"all"),e=this._applyExtensionFilter(e,i.Extensions||[]),e=this._applySizeFilter(e,i.SizeMin,i.SizeMax),e=this._applyDateFilter(e,i),e=this._sortItems(e,t.SortField||"folder-first",t.SortDirection||"asc"),t.GalleryItems=e,t.GalleryCursorIndex=0;let n=this.pict.views["RetoldRemote-Gallery"];n&&n.renderGallery()}_applySearch(t,e){if(!e)return t;let i=e.toLowerCase();return t.filter(t=>t.Name.toLowerCase().includes(i))}_applyMediaTypeFilter(t,e){return"all"===e?t:t.filter(t=>{if("folder"===t.Type)return!0;let i=this.getCategory((t.Extension||"").toLowerCase());return"images"===e?"image"===i:"video"===e?"video"===i:"audio"===e?"audio"===i:"documents"!==e||"document"===i})}_applyExtensionFilter(t,e){if(!e||0===e.length)return t;let i={};for(let t=0;t<e.length;t++)i[e[t].toLowerCase()]=!0;return t.filter(t=>{if("folder"===t.Type)return!0;let e=(t.Extension||"").replace(/^\./,"").toLowerCase();return!0===i[e]})}_applySizeFilter(t,e,i){return null===e&&null===i?t:t.filter(t=>{if("folder"===t.Type)return!0;let n=t.Size||0;return!(null!==e&&n<e)&&!(null!==i&&n>i)})}_applyDateFilter(t,e){let i=e.DateModifiedAfter?new Date(e.DateModifiedAfter).getTime():null,n=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===i&&null===n&&null===o&&null===r?t:t.filter(t=>{if("folder"===t.Type)return!0;if(null!==i||null!==n){let e=t.Modified?new Date(t.Modified).getTime():0;if(null!==i&&e<i)return!1;if(null!==n&&e>n)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,i){let n="desc"===i?-1:1;return t.slice().sort((t,i)=>{if("folder-first"===e){if("folder"===t.Type&&"folder"!==i.Type)return-1;if("folder"!==t.Type&&"folder"===i.Type)return 1;let e=(t.Name||"").toLowerCase(),o=(i.Name||"").toLowerCase();return e<o?-1*n:e>o?1*n:0}if("name"===e){let e=(t.Name||"").toLowerCase(),o=(i.Name||"").toLowerCase();return e<o?-1*n:e>o?1*n:0}if("modified"===e){let e=t.Modified?new Date(t.Modified).getTime():0,o=i.Modified?new Date(i.Modified).getTime():0;if(e!==o)return(e-o)*n;let r=(t.Name||"").toLowerCase(),s=(i.Name||"").toLowerCase();return r<s?-1:r>s?1:0}if("created"===e){let e=t.Created?new Date(t.Created).getTime():0,o=i.Created?new Date(i.Created).getTime():0;if(e!==o)return(e-o)*n;let r=(t.Name||"").toLowerCase(),s=(i.Name||"").toLowerCase();return r<s?-1:r>s?1:0}return 0})}getCategory(t){let e=(t||"").replace(/^\./,"").toLowerCase();return o[e]?"image":r[e]?"video":s[e]?"audio":a[e]?"document":"other"}getAvailableExtensions(){let t=this.pict.AppData.RetoldRemote,e=t?t.RawFileList:[],i={};for(let t=0;t<e.length;t++){let n=e[t];if("folder"===n.Type)continue;let o=(n.Extension||"").replace(/^\./,"").toLowerCase();o&&(i[o]||(i[o]={ext:o,category:this.getCategory(o),count:0}),i[o].count++)}let n={image:0,video:1,audio:2,document:3,other:4},o=Object.values(i);return o.sort((t,e)=>{let i=n[t.category]||99,o=n[e.category]||99;return i!==o?i-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=[],i=t.FilterState||{};if(i.MediaType&&"all"!==i.MediaType){let t={images:"Images",video:"Video",audio:"Audio",documents:"Docs"};e.push({key:"mediaType",label:t[i.MediaType]||i.MediaType})}let n=i.Extensions||[];if(n.length>0)for(let t=0;t<n.length;t++)e.push({key:"ext:"+n[t],label:"."+n[t]});return null!==i.SizeMin&&void 0!==i.SizeMin&&e.push({key:"sizeMin",label:"≥ "+this._formatSizeKB(i.SizeMin)}),null!==i.SizeMax&&void 0!==i.SizeMax&&e.push({key:"sizeMax",label:"≤ "+this._formatSizeKB(i.SizeMax)}),i.DateModifiedAfter&&e.push({key:"dateModifiedAfter",label:"Modified after "+i.DateModifiedAfter}),i.DateModifiedBefore&&e.push({key:"dateModifiedBefore",label:"Modified before "+i.DateModifiedBefore}),i.DateCreatedAfter&&e.push({key:"dateCreatedAfter",label:"Created after "+i.DateCreatedAfter}),i.DateCreatedBefore&&e.push({key:"dateCreatedBefore",label:"Created before "+i.DateCreatedBefore}),t.SearchQuery&&e.push({key:"search",label:'Search: "'+t.SearchQuery+'"'}),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 i=e.FilterState;if("mediaType"===t)i.MediaType="all",e.GalleryFilter="all";else if(t.startsWith("ext:")){let e=t.substring(4);i.Extensions=(i.Extensions||[]).filter(t=>t!==e)}else"sizeMin"===t?i.SizeMin=null:"sizeMax"===t?i.SizeMax=null:"dateModifiedAfter"===t?i.DateModifiedAfter=null:"dateModifiedBefore"===t?i.DateModifiedBefore=null:"dateCreatedAfter"===t?i.DateCreatedAfter=null:"dateCreatedBefore"===t?i.DateCreatedBefore=null:"search"===t&&(e.SearchQuery="")}clearAllFilters(){let t=this.pict.AppData.RetoldRemote;t&&(t.SearchQuery="",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 i={Name:t,FilterState:JSON.parse(JSON.stringify(e.FilterState)),SortField:e.SortField,SortDirection:e.SortDirection};e.FilterPresets=e.FilterPresets||[],e.FilterPresets.push(i)}loadPreset(t){let e=this.pict.AppData.RetoldRemote;if(!e||!e.FilterPresets)return;let i=e.FilterPresets[t];i&&(e.FilterState=JSON.parse(JSON.stringify(i.FilterState)),e.GalleryFilter=e.FilterState.MediaType||"all",e.SortField=i.SortField||"folder-first",e.SortDirection=i.SortDirection||"asc")}deletePreset(t){let e=this.pict.AppData.RetoldRemote;e&&e.FilterPresets&&e.FilterPresets.splice(t,1)}}l.default_configuration={ProviderIdentifier:"RetoldRemote-GalleryFilterSort",AutoInitialize:!0,AutoInitializeOrdinal:0,AutoSolveWithApp:!1},e.exports=l},{"pict-provider":108}],142:[function(t,e,i){const n=t("pict-provider");class o extends n{constructor(t,e,i){super(t,e,i),this._columnsPerRow=4,this._keydownBound=!1,this._helpPanelVisible=!1}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,i=1;for(let n=1;n<t.length&&t[n].offsetTop===e;n++)i++;this._columnsPerRow=i}bindKeyboardNavigation(){if(this._keydownBound)return;let t=this;this._keydownHandler=function(e){if("F1"===e.key)return e.preventDefault(),void t._toggleHelpPanel();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 i=t.pict.AppData.RetoldRemote.ActiveMode;"gallery"===i?t._handleGalleryKey(e):"viewer"===i&&t._handleViewerKey(e)},document.addEventListener("keydown",this._keydownHandler),this._keydownBound=!0}_handleGalleryKey(t){let e=this.pict.AppData.RetoldRemote,i=e.GalleryItems||[],n=e.GalleryCursorIndex||0;switch(t.key){case"ArrowRight":t.preventDefault(),this.moveCursor(Math.min(n+1,i.length-1));break;case"ArrowLeft":t.preventDefault(),this.moveCursor(Math.max(n-1,0));break;case"ArrowDown":t.preventDefault(),this.moveCursor(Math.min(n+this._columnsPerRow,i.length-1));break;case"ArrowUp":t.preventDefault(),this.moveCursor(Math.max(n-this._columnsPerRow,0));break;case"Enter":t.preventDefault(),this.openCurrent();break;case"Escape":t.preventDefault(),this.navigateUp();break;case"g":t.preventDefault(),this._toggleViewMode();break;case"/":t.preventDefault(),this._focusSearch();break;case"Home":t.preventDefault(),this.moveCursor(0);break;case"End":t.preventDefault(),this.moveCursor(i.length-1);break;case"f":t.preventDefault();{let t=this.pict.views["RetoldRemote-Gallery"];t&&t.toggleFilterPanel()}break;case"s":t.preventDefault();{let t=document.getElementById("RetoldRemote-Gallery-Sort");t&&t.focus()}break;case"c":t.preventDefault(),this._toggleSettingsPanel();break;case"d":t.preventDefault(),this._toggleDistractionFree()}}_handleViewerKey(t){switch(t.key){case"Escape":t.preventDefault(),this.closeViewer();break;case"ArrowRight":case"j":t.preventDefault(),this.nextFile();break;case"ArrowLeft":case"k":t.preventDefault(),this.prevFile();break;case"f":t.preventDefault(),this._toggleFullscreen();break;case"i":t.preventDefault(),this._toggleFileInfo();break;case" ":t.preventDefault(),this._togglePlayPause();break;case"+":case"=":t.preventDefault(),this._zoomIn();break;case"-":t.preventDefault(),this._zoomOut();break;case"0":t.preventDefault(),this._zoomReset();break;case"z":t.preventDefault(),this._cycleFitMode();break;case"d":t.preventDefault(),this._toggleDistractionFree()}}moveCursor(t){let e=this.pict.AppData.RetoldRemote,i=e.GalleryCursorIndex||0;if(t===i)return;e.GalleryCursorIndex=t;let n=document.querySelector('.retold-remote-tile[data-index="'.concat(i,'"], .retold-remote-list-row[data-index="').concat(i,'"]')),o=document.querySelector('.retold-remote-tile[data-index="'.concat(t,'"], .retold-remote-list-row[data-index="').concat(t,'"]'));n&&n.classList.remove("selected"),o&&(o.classList.add("selected"),o.scrollIntoView({block:"nearest",behavior:"smooth"}))}openCurrent(){let t=this.pict.AppData.RetoldRemote,e=t.GalleryItems||[],i=t.GalleryCursorIndex||0;if(i>=e.length)return;let n=e[i];if("folder"===n.Type){let t=this.pict.PictApplication;t&&t.loadFileList&&t.loadFileList(n.Path)}else{let t=this.pict.PictApplication;t&&t.navigateToFile&&t.navigateToFile(n.Path)}}navigateUp(){let t=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";if(!t)return;let e=t.replace(/\/[^/]+\/?$/,"")||"",i=this.pict.PictApplication;i&&i.loadFileList&&i.loadFileList(e)}closeViewer(){this.pict.AppData.RetoldRemote.ActiveMode="gallery";let t=document.getElementById("RetoldRemote-Gallery-Container"),e=document.getElementById("RetoldRemote-Viewer-Container");t&&(t.style.display=""),e&&(e.style.display="none");let i=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",n=this.pict.providers["RetoldRemote-Provider"],o=n&&i?n.getFragmentIdentifier(i):i;window.location.hash=o?"#/browse/"+o:"#/browse/";let r=this.pict.views["RetoldRemote-Gallery"];r&&r.renderGallery()}nextFile(){let t=this.pict.AppData.RetoldRemote,e=t.GalleryItems||[];for(let i=(t.GalleryCursorIndex||0)+1;i<e.length;i++)if("file"===e[i].Type){t.GalleryCursorIndex=i;let n=this.pict.PictApplication;return void(n&&n.navigateToFile&&n.navigateToFile(e[i].Path))}}prevFile(){let t=this.pict.AppData.RetoldRemote,e=t.GalleryItems||[];for(let i=(t.GalleryCursorIndex||0)-1;i>=0;i--)if("file"===e[i].Type){t.GalleryCursorIndex=i;let n=this.pict.PictApplication;return void(n&&n.navigateToFile&&n.navigateToFile(e[i].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 i=this.pict.PictApplication;i&&"function"==typeof i.saveSettings&&i.saveSettings()}_focusSearch(){let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()}_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 i=[["← → ↑ ↓","Navigate tiles"],["Enter","Open selected item"],["Escape","Go up one folder"],["Home / End","Jump to first / last"],["g","Toggle gallery / list view"],["/","Focus search bar"],["f","Toggle filter panel"],["s","Focus sort dropdown"],["c","Settings / config panel"],["d","Distraction-free mode"]];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 n=[["← / k","Previous file"],["→ / j","Next file"],["Escape","Back to gallery"],["f","Toggle fullscreen"],["i","Toggle file info"],["Space","Play / pause media"],["z","Cycle fit mode"],["+ / -","Zoom in / out"],["0","Reset zoom"],["d","Distraction-free mode"]];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">Global</div>';let o=[["F1","Toggle this help panel"],["Escape","Close help panel"]];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>";return e+="</div>",e+='<div class="retold-remote-help-footer">',e+="Current mode: <strong>"+("viewer"===t?"Media Viewer":"Gallery")+"</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 i=e.classList.contains("collapsed"),n=document.querySelector('.content-editor-sidebar-tab[data-tab="settings"]'),o=n&&n.classList.contains("active");i?(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"),i=document.querySelector(".content-editor-sidebar-wrap");if(e&&i){if(t._distractionFreeMode||!1){e.style.display="",i.style.display="",t._distractionFreeMode=!1;let n=document.querySelector(".retold-remote-viewer-header");n&&(n.style.display="")}else if(e.style.display="none",i.style.display="none",t._distractionFreeMode=!0,!t.DistractionFreeShowNav){let t=document.querySelector(".retold-remote-viewer-header");t&&(t.style.display="none")}setTimeout(()=>this.recalculateColumns(),100)}}_toggleFullscreen(){let t=document.getElementById("RetoldRemote-Viewer-Container");t&&(document.fullscreenElement?document.exitFullscreen():t.requestFullscreen())}_toggleFileInfo(){let t=document.getElementById("RetoldRemote-FileInfo-Overlay");t&&(t.style.display="none"===t.style.display?"":"none")}_togglePlayPause(){let t=document.querySelector("#RetoldRemote-Viewer-Container video"),e=document.querySelector("#RetoldRemote-Viewer-Container audio"),i=t||e;i&&(i.paused?i.play():i.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()}}o.default_configuration={ProviderIdentifier:"RetoldRemote-GalleryNavigation",AutoInitialize:!0,AutoSolveWithApp:!1},e.exports=o},{"pict-provider":108}],143:[function(t,e,i){const n=t("pict-provider");class o extends n{constructor(t,e,i){super(t,e,i),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){return"/content/"+t.split("/").map(t=>encodeURIComponent(t)).join("/")}getThumbnailURL(t,e,i){let n=this.pict.AppData.RetoldRemote.ServerCapabilities,o=t.replace(/^.*\./,"").toLowerCase(),r=this._isImageExtension(o);return n&&(n.sharp||n.imagemagick)?"/api/media/thumbnail?path="+this._getPathParam(t)+"&width="+(e||200)+"&height="+(i||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 i="/api/media/folder-summary";t&&(i+="?path="+this._getPathParam(t)),fetch(i).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":108}],144:[function(t,e,i){const n=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",".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 n{constructor(t,e,i){super(t,e,i),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 i=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="'+i.WarmBeige+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M3.2 9H20.8" stroke="'+i.Primary+'" stroke-width="1" opacity="0.3" /></svg>'},"folder-open":e=>{let i=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="'+i.WarmBeige+'" stroke="'+i.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="'+i.Primary+'" stroke-width="1.5" fill="'+i.Light+'" stroke-linecap="round" stroke-linejoin="round" opacity="0.7" /></svg>'},file:e=>{let i=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="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-text":e=>{let i=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="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.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="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="15.8" x2="15.9" y2="15.8" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="18.8" x2="12.2" y2="18.8" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"file-code":e=>{let i=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="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M8.5 13.2L6.8 15.1L8.6 16.8" stroke="'+i.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="'+i.Accent+'" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round" /><line x1="12.8" y1="12" x2="11.2" y2="18" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'},"file-image":e=>{let i=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="'+i.Lavender+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="8.3" cy="8.7" r="1.8" fill="'+i.Accent+'" /><path d="M20.8 15.2L15.9 10.1L5.2 20.8" stroke="'+i.Primary+'" stroke-width="1.8" fill="none" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-pdf":e=>{let i=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="'+i.PdfFill+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.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="'+i.PdfText+'" letter-spacing="-0.3">PDF</text></svg>'},"file-spreadsheet":e=>{let i=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="'+i.TealTint+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.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="'+i.Accent+'" stroke-width="1.2" /><line x1="7.2" y1="13.7" x2="17" y2="13.7" stroke="'+i.Accent+'" stroke-width="1" /><line x1="7.2" y1="16.3" x2="17" y2="16.3" stroke="'+i.Accent+'" stroke-width="1" /><line x1="10.9" y1="11.1" x2="10.9" y2="18.9" stroke="'+i.Accent+'" stroke-width="1" /></svg>'},"file-archive":e=>{let i=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="'+i.WarmBeige+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.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="'+i.Primary+'" /><rect x="8.8" y="14.2" width="2.5" height="2" rx="0.4" fill="'+i.Primary+'" /><rect x="8.8" y="17.2" width="2.5" height="2" rx="0.4" fill="'+i.Primary+'" /></svg>'},"file-audio":e=>{let i=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="'+i.AmberTint+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="10.2" cy="16.8" r="2.1" fill="none" stroke="'+i.Accent+'" stroke-width="1.5" /><path d="M12.2 16.8V11.2L16.1 10.1" stroke="'+i.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="'+i.Accent+'" stroke-width="1.2" /></svg>'},"file-video":e=>{let i=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="'+i.Lavender+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.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="'+i.Accent+'" stroke="'+i.Accent+'" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"file-web":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="8.9" fill="'+i.TealTint+'" stroke="'+i.Primary+'" stroke-width="1.8" /><ellipse cx="12" cy="12" rx="4.1" ry="8.9" fill="none" stroke="'+i.Primary+'" stroke-width="1.2" /><line x1="3.1" y1="12" x2="20.9" y2="12" stroke="'+i.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="'+i.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="'+i.Primary+'" stroke-width="1" fill="none" /></svg>'},"file-config":e=>{let i=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="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><circle cx="12" cy="15" r="2.8" fill="none" stroke="'+i.Muted+'" stroke-width="1.5" /><line x1="12" y1="11" x2="12" y2="12.2" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="12" y1="17.8" x2="12" y2="19" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="13.2" x2="15.8" y2="12.6" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="17" x2="9.2" y2="16.4" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="14.8" y1="16.8" x2="15.8" y2="17.4" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /><line x1="8.2" y1="13" x2="9.2" y2="13.6" stroke="'+i.Muted+'" stroke-width="1.3" stroke-linecap="round" /></svg>'},home:e=>{let i=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="'+i.TealTint+'" stroke="'+i.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="'+i.Accent+'" /></svg>'},"arrow-up":e=>{let i=t._colors;return'<svg width="'+e+'" height="'+e+'" viewBox="0 0 24 24" fill="none"><path d="M12.1 19.1V5.1" stroke="'+i.Muted+'" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /><path d="M5.2 11.9L12.1 5.1L18.9 11.9" stroke="'+i.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 i=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="'+i.Primary+'" stroke-width="1.8" /><line x1="15.9" y1="16.1" x2="20.8" y2="20.8" stroke="'+i.Primary+'" stroke-width="2" stroke-linecap="round" /></svg>'},"sort-asc":e=>{let i=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="'+i.Primary+'" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+i.Muted+'" opacity="0.35" /></svg>'},"sort-desc":e=>{let i=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="'+i.Muted+'" opacity="0.35" /><path d="M12 19.8L7.2 13.2H16.8L12 19.8Z" fill="'+i.Primary+'" /></svg>'},"music-note":e=>{let i=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="'+i.AmberTint+'" stroke="'+i.Accent+'" stroke-width="1.8" /><path d="M11.2 17.8V5.2L19.1 3.1V14.8" stroke="'+i.Accent+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" fill="none" /><circle cx="16.1" cy="14.8" r="2.4" fill="'+i.AmberTint+'" stroke="'+i.Accent+'" stroke-width="1.5" /></svg>'},"film-strip":e=>{let i=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="'+i.Primary+'" stroke-width="1.8" fill="'+i.Lavender+'" /><path d="M9.5 8.5V15.5L16 12L9.5 8.5Z" fill="'+i.Accent+'" stroke="'+i.Accent+'" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" /></svg>'},"gallery-empty":e=>{let i=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="'+i.WarmBeige+'" stroke="'+i.Muted+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="9" y1="11" x2="15" y2="17" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" opacity="0.5" /><line x1="15" y1="11" x2="9" y2="17" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" opacity="0.5" /></svg>'},"document-large":e=>{let i=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="'+i.Light+'" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><path d="M13.9 2.1V8.2H20" stroke="'+i.Primary+'" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" /><line x1="8.1" y1="13" x2="15.9" y2="13" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="16" x2="15.9" y2="16" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /><line x1="8.1" y1="19" x2="12" y2="19" stroke="'+i.Muted+'" stroke-width="1.2" stroke-linecap="round" /></svg>'}}}getIcon(t,e){let i=e||16,n=this._customIcons[t]||this._icons[t];return"function"==typeof n?n(i):""}getIconForEntry(t,e){if(!t)return"";if(t.Icon&&"string"==typeof t.Icon&&0===t.Icon.indexOf("<svg"))return t.Icon;let i=e||16;if("folder"===t.Type)return this.getIcon("folder",i);let n=(t.Extension||"").toLowerCase();return n&&this._extensionMap[n]?this.getIcon(this._extensionMap[n],i):this.getIcon("file",i)}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 i=0;i<e.length;i++)t.indexOf(e[i])<0&&t.push(e[i]);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":108,"pict-section-filebrowser/source/providers/Pict-Provider-FileBrowserIcons.js":112}],145:[function(t,e,i){const n=t("pict-provider");class o extends n{constructor(t,e,i){super(t,e,i),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 i=":root {\n",n=e.Variables,o=Object.keys(n);for(let t=0;t<o.length;t++)i+="\t"+o[t]+": "+n[o[t]]+";\n";if(i+="}\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=i}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 i=this._themeOrder[e],n=this._themes[i];t.push({key:i,name:n.Name,category:n.Category,description:n.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":108}],146:[function(t,e,i){const n=t("pict-view");class o extends n{constructor(t,e,i){super(t,e,i),this._intersectionObserver=null}renderGallery(){let t=document.getElementById("RetoldRemote-Gallery-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.GalleryItems||[],n=e.ViewMode||"list",o=e.ThumbnailSize||"medium",r=e.GalleryCursorIndex||0,s=this._buildHeaderHTML(e.FilterState?e.FilterState.MediaType:"all");if(s+=this._buildFilterPanelHTML(),s+=this._buildFilterChipsHTML(),0===i.length){s+='<div class="retold-remote-empty">';let e=this.pict.providers["RetoldRemote-Icons"];return s+='<div class="retold-remote-empty-icon"><span class="retold-remote-icon retold-remote-icon-xl">'+(e?e.getIcon("gallery-empty",96):"")+"</span></div>",s+="<div>Empty folder</div>",s+="</div>",void(t.innerHTML=s)}s+="gallery"===n?this._buildGridHTML(i,o,r):this._buildListHTML(i,r),t.innerHTML=s,this._setupLazyLoading();let a=this.pict.providers["RetoldRemote-GalleryNavigation"];a&&a.recalculateColumns()}_buildHeaderHTML(t){let e=this.pict.AppData.RetoldRemote,i=[{key:"all",label:"All"},{key:"images",label:"Images"},{key:"video",label:"Video"},{key:"audio",label:"Audio"},{key:"documents",label:"Docs"}],n='<div class="retold-remote-gallery-header">';n+='<div class="retold-remote-gallery-filter">';for(let e=0;e<i.length;e++){let o=i[e];n+='<button class="retold-remote-gallery-filter-btn'+(o.key===t?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].setFilter('"+o.key+"')\">"+o.label+"</button>"}n+="</div>",n+='<div class="retold-remote-gallery-sort">',n+='<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":"";n+='<option value="'+o[t].value+'"'+e+">"+o[t].label+"</option>"}n+="</select>",n+="</div>";let s=this.pict.providers["RetoldRemote-GalleryFilterSort"],a=s?s.getActiveFilterChips().length:0;n+='<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&&(n+='<span class="retold-remote-gallery-filter-count">'+a+"</span>"),n+="</button>";let l=e.SearchQuery||"";return n+='<input type="text" class="retold-remote-gallery-search" id="RetoldRemote-Gallery-Search" placeholder="Search files... (/)" value="'+this._escapeHTML(l)+'" oninput="pict.views[\'RetoldRemote-Gallery\'].onSearchInput(this.value)">',n+="</div>",n}_buildFilterPanelHTML(){let t=this.pict.AppData.RetoldRemote;if(!t.FilterPanelOpen)return"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"],i=e?e.getAvailableExtensions():[],n=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=n.Extensions||[];for(let t=0;t<i.length;t++){let e=i[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!==n.SizeMin&&void 0!==n.SizeMin?Math.round(n.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!==n.SizeMax&&void 0!==n.SizeMax?Math.round(n.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="'+(n.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="'+(n.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">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 i=0;i<t.length;i++)e+='<option value="'+i+'">'+this._escapeHTML(t[i].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 i='<div class="retold-remote-filter-chips">';for(let t=0;t<e.length;t++){let n=e[t];i+='<span class="retold-remote-filter-chip">'+this._escapeHTML(n.label)+" <button class=\"retold-remote-filter-chip-remove\" onclick=\"pict.views['RetoldRemote-Gallery'].removeFilterChip('"+this._escapeHTML(n.key)+"')\">&times;</button></span>"}return i+='<button class="retold-remote-filter-chip-clear" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear all</button>',i+="</div>",i}_buildGridHTML(t,e,i){let n='<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===i?" selected":"",l=(s.Extension||"").toLowerCase(),c=this._getCategory(l,s.Type);if(n+='<div class="retold-remote-tile'+a+'" data-index="'+e+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+e+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+e+')">',n+='<div class="retold-remote-tile-thumb">',"folder"===s.Type)n+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("folder",48):"")+"</span></div>",n+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Folder</span>';else if("image"===c&&o){let t=o.getThumbnailURL(s.Path,400,300);n+=t?'<img data-src="'+t+'" alt="'+this._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>",n+='<span class="retold-remote-tile-badge retold-remote-tile-badge-image">'+l+"</span>"}else if("video"===c){if(o){let t=o.getThumbnailURL(s.Path,400,300);n+=t?'<img data-src="'+t+'" alt="'+this._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 n+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-video",48):"")+"</span></div>";n+='<span class="retold-remote-tile-badge retold-remote-tile-badge-video">Video</span>'}else"audio"===c?(n+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIcon("file-audio",48):"")+"</span></div>",n+='<span class="retold-remote-tile-badge retold-remote-tile-badge-audio">Audio</span>'):"document"===c?(n+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIconForEntry(s,48):"")+"</span></div>",n+='<span class="retold-remote-tile-badge retold-remote-tile-badge-document">'+l+"</span>"):n+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(r?r.getIconForEntry(s,48):"")+"</span></div>";n+="</div>",n+='<div class="retold-remote-tile-label" title="'+this._escapeHTML(s.Name)+'">'+this._escapeHTML(s.Name)+"</div>","file"===s.Type&&void 0!==s.Size?n+='<div class="retold-remote-tile-meta">'+this._formatFileSize(s.Size)+"</div>":"folder"===s.Type&&(n+='<div class="retold-remote-tile-meta">Folder</div>'),n+="</div>"}return n+="</div>",n}_buildListHTML(t,e){let i='<div class="retold-remote-list">',n=this.pict.providers["RetoldRemote-Icons"];for(let o=0;o<t.length;o++){let r=t[o],s=o===e?" selected":"",a="";n&&(a='<span class="retold-remote-icon retold-remote-icon-sm">'+n.getIconForEntry(r,16)+"</span>"),i+='<div class="retold-remote-list-row'+s+'" data-index="'+o+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+o+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+o+')">',i+='<div class="retold-remote-list-icon">'+a+"</div>",i+='<div class="retold-remote-list-name">'+this._escapeHTML(r.Name)+"</div>","file"===r.Type&&void 0!==r.Size?i+='<div class="retold-remote-list-size">'+this._formatFileSize(r.Size)+"</div>":i+='<div class="retold-remote-list-size"></div>',r.Modified?i+='<div class="retold-remote-list-date">'+new Date(r.Modified).toLocaleDateString()+"</div>":i+='<div class="retold-remote-list-date"></div>',i+="</div>"}return i+="</div>",i}_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 i=t[e].target;i.src=i.getAttribute("data-src"),i.removeAttribute("data-src"),this._intersectionObserver.unobserve(i)}},{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 i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort()}onSearchInput(t){this.pict.AppData.RetoldRemote.SearchQuery=(t||"").toLowerCase();let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSortChange(t){let e=t.split(":"),i=this.pict.AppData.RetoldRemote;i.SortField=e[0],i.SortDirection=e[1]||"asc";let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];n&&n.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 i=this.pict.AppData.RetoldRemote.FilterState,n=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e)i.Extensions.length>0&&i.Extensions.push(t);else if(0===i.Extensions.length&&n){let e=n.getAvailableExtensions();i.Extensions=e.map(t=>t.ext).filter(e=>e!==t)}else i.Extensions=i.Extensions.filter(e=>e!==t);n&&n.applyFilterSort()}onSizeFilterChange(t,e){let i=this.pict.AppData.RetoldRemote.FilterState,n=e&&""!==e?1024*parseInt(e,10):null;"min"===t?i.SizeMin=n:i.SizeMax=n;let o=this.pict.providers["RetoldRemote-GalleryFilterSort"];o&&o.applyFilterSort()}onDateFilterChange(t,e){this.pict.AppData.RetoldRemote.FilterState[t]=e||null;let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.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()}_getCategory(t,e){if("folder"===e)return"folder";let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(i)return i.getCategory(t);let n=(t||"").replace(/^\./,"").toLowerCase();return"png"===n||"jpg"===n||"jpeg"===n||"gif"===n||"webp"===n?"image":"mp4"===n||"webm"===n||"mov"===n?"video":"mp3"===n||"wav"===n||"ogg"===n?"audio":"pdf"===n?"document":"other"}_formatFileSize(t){if(!t||0===t)return"0 B";let e=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(t)/Math.log(1024));return i>=e.length&&(i=e.length-1),(t/Math.pow(1024,i)).toFixed(0===i?0:1)+" "+e[i]}_escapeHTML(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}}o.default_configuration={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/* 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: 12px;\n\t\t\tpadding: 6px 12px;\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-size\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 80px;\n\t\t\ttext-align: right;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: var(--retold-text-dim);\n\t\t}\n\t\t.retold-remote-list-date\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 140px;\n\t\t\ttext-align: right;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: var(--retold-text-dim);\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:[]},e.exports=o},{"pict-view":125}],147:[function(t,e,i){const n=t("pict-view");class o extends n{constructor(t,e,i){super(t,e,i),this._zoomLevel=1,this._naturalWidth=0,this._naturalHeight=0,this._resizeHandler=null,this._indicatorTimeout=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,i=null;this._resizeHandler=function(){clearTimeout(i),i=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 i=this._getBaseSize(e),n=Math.round(i.width*this._zoomLevel),o=Math.round(i.height*this._zoomLevel);t.style.maxWidth="none",t.style.maxHeight="none",t.style.objectFit="",t.style.width=n+"px",t.style.height=o+"px",t.style.transform="",this._zoomLevel>1||n>e.clientWidth||o>e.clientHeight?t.style.cursor="zoom-out":t.style.cursor="zoom-in"}_getBaseSize(t){let e=this._naturalWidth,i=this._naturalHeight,n=t.clientWidth,o=t.clientHeight;if(!n||!o)return{width:e,height:i};let r=e/i;switch(this._getFitMode()){case"fit":{let t=n,e=n/r;return e>o&&(e=o,t=o*r),{width:t,height:e}}case"auto":{if(e<=n&&i<=o)return{width:e,height:i};let t=n,s=n/r;return s>o&&(s=o,t=o*r),{width:t,height:s}}default:return{width:e,height:i}}}_showFitModeIndicator(t){let e={fit:"Fit to Window",auto:"Original if Smaller",original:"Original Size"}[t]||t,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=e,i.classList.add("visible"),this._indicatorTimeout&&clearTimeout(this._indicatorTimeout),this._indicatorTimeout=setTimeout(function(){i.classList.remove("visible")},1200)}cleanup(){this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this._indicatorTimeout&&(clearTimeout(this._indicatorTimeout),this._indicatorTimeout=null)}}o.default_configuration={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"},e.exports=o},{"pict-view":125}],148:[function(t,e,i){const n=t("pict-view");class o extends n{constructor(t,e,i){super(t,e,i),this._sidebarDragging=!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(t&&t.SidebarWidth){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.width=t.SidebarWidth+"px")}let e=this;window.addEventListener("hashchange",()=>{e.pict.PictApplication.resolveHash()})}toggleSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t)return;t.classList.toggle("collapsed"),this.pict.AppData.RetoldRemote.SidebarCollapsed=t.classList.contains("collapsed"),this.pict.PictApplication.saveSettings();let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&setTimeout(()=>e.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"),i=document.querySelector(".content-editor-sidebar-wrap");if(!e||!i)return;let n=0,o=0;function r(e){if(!t._sidebarDragging)return;let r=o+(e.clientX-n);r=Math.max(150,Math.min(r,600)),i.style.width=r+"px"}function s(){t._sidebarDragging=!1,e.classList.remove("dragging"),document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s),t.pict.AppData.RetoldRemote.SidebarWidth=i.offsetWidth,t.pict.PictApplication.saveSettings();let n=t.pict.providers["RetoldRemote-GalleryNavigation"];n&&n.recalculateColumns()}e.addEventListener("mousedown",function(a){t._sidebarDragging=!0,n=a.clientX,o=i.offsetWidth,e.classList.add("dragging"),document.addEventListener("mousemove",r),document.addEventListener("mouseup",s),a.preventDefault()})}}o.default_configuration={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\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/* Collapse toggle */\n\t\t.content-editor-sidebar-toggle\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 8px;\n\t\t\tright: -20px;\n\t\t\twidth: 20px;\n\t\t\theight: 28px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: var(--retold-bg-tertiary);\n\t\t\tborder: 1px solid var(--retold-border);\n\t\t\tborder-left: none;\n\t\t\tborder-radius: 0 4px 4px 0;\n\t\t\tcursor: pointer;\n\t\t\tz-index: 10;\n\t\t\tcolor: var(--retold-text-muted);\n\t\t\tfont-size: 11px;\n\t\t\tline-height: 1;\n\t\t\ttransition: color 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-toggle:hover\n\t\t{\n\t\t\tcolor: var(--retold-text-primary);\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#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-breadcrumbs\n\t\t{\n\t\t\tcolor: var(--retold-text-muted);\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-breadcrumb-link\n\t\t{\n\t\t\tcolor: var(--retold-accent);\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\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-toggle" onclick="pict.views[\'ContentEditor-Layout\'].toggleSidebar()">&#9664;</div>\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</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-Layout-Shell",TemplateHash:"RetoldRemote-Layout-Shell",DestinationAddress:"#ContentEditor-Application-Container"}]},e.exports=o},{"pict-view":125}],149:[function(t,e,i){const n=t("pict-view"),o=t("pict-section-code");class r extends n{constructor(t,e,i){super(t,e,i)}showMedia(t,e){let i=this.pict.AppData.RetoldRemote;i.ActiveMode="viewer",i.CurrentViewerFile=t,i.CurrentViewerMediaType=e;let n=document.getElementById("RetoldRemote-Gallery-Container"),o=document.getElementById("RetoldRemote-Viewer-Container");n&&(n.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._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">',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)}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);let c=this.pict.views["ContentEditor-TopBar"];c&&c.updateInfo()}_buildImageHTML(t,e){return'<img src="'+t+'" alt="'+this._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){return'<video controls autoplay preload="metadata" style="max-width: 100%; max-height: 100%;" id="RetoldRemote-VideoPlayer"><source src="'+t+'">Your browser does not support the video tag.</video>'}_buildAudioHTML(t,e){let i=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(i?'<span class="retold-remote-icon retold-remote-icon-lg">'+i.getIcon("music-note",64)+"</span>":"&#127925;")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this._escapeHTML(e)+'</div><audio controls autoplay preload="metadata" id="RetoldRemote-AudioPlayer" style="width: 100%; max-width: 500px;"><source src="'+t+'">Your browser does not support the audio tag.</audio></div>'}_buildDocumentHTML(t,e,i){if("pdf"===i.replace(/^.*\./,"").toLowerCase())return'<iframe src="'+t+'" style="width: 100%; height: 100%; border: none;"></iframe>';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._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,i){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 i=this,n=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=i._getHighlightLanguage(n);if(i._activeCodeJar&&(i._activeCodeJar.destroy(),i._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 i=document.createElement("pre");return i.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%;",i.textContent=t,void e.appendChild(i)}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 c=o.createHighlighter(r);i._activeCodeJar=window.CodeJar(l,c,{tab:"\t",catchTab:!1,addClosing:!1}),l.style.whiteSpace="pre",l.style.overflowWrap="normal",i._activeCodeJar.updateCode(t),l.setAttribute("contenteditable","false");let d=t.split("\n").length,p="";for(let t=1;t<=d;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>")})}_buildFallbackHTML(t,e){let i=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(i?'<span class="retold-remote-icon retold-remote-icon-lg">'+i.getIcon("document-large",64)+"</span>":"&#128196;")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this._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.pict.providers["RetoldRemote-Provider"];e&&e.fetchMediaProbe(t,(t,e)=>{let i=document.getElementById("RetoldRemote-FileInfo-Overlay");if(!i||!e)return;let n="";if(void 0!==e.Size&&(n+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Size</span><span class="retold-remote-fileinfo-value">'+this._formatFileSize(e.Size)+"</span></div>"),e.Width&&e.Height&&(n+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Dimensions</span><span class="retold-remote-fileinfo-value">'+e.Width+" x "+e.Height+"</span></div>"),e.Duration){let t=Math.floor(e.Duration/60),i=Math.floor(e.Duration%60);n+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Duration</span><span class="retold-remote-fileinfo-value">'+t+":"+(i<10?"0":"")+i+"</span></div>"}e.Codec&&(n+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Codec</span><span class="retold-remote-fileinfo-value">'+e.Codec+"</span></div>"),e.Format&&(n+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Format</span><span class="retold-remote-fileinfo-value">'+e.Format+"</span></div>"),e.Modified&&(n+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Modified</span><span class="retold-remote-fileinfo-value">'+new Date(e.Modified).toLocaleString()+"</span></div>"),e.Path&&(n+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Path</span><span class="retold-remote-fileinfo-value">'+e.Path+"</span></div>"),i.innerHTML=n})}_formatFileSize(t){if(!t||0===t)return"0 B";let e=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(t)/Math.log(1024));return i>=e.length&&(i=e.length-1),(t/Math.pow(1024,i)).toFixed(0===i?0:1)+" "+e[i]}_escapeHTML(t){return t?t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):""}}r.default_configuration={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"},e.exports=r},{"pict-section-code":158,"pict-view":125}],150:[function(t,e,i){const n=t("pict-view");class o extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){super.onAfterRender(),this._renderSettingsContent()}_renderSettingsContent(){let t=document.getElementById("RetoldRemote-Settings-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.ServerCapabilities||{},n='<div class="retold-remote-settings">';n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Appearance</div>',n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Theme</span>',n+='<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(),i="";for(let o=0;o<t.length;o++){let r=t[o];r.category!==i&&(i&&(n+="</optgroup>"),n+='<optgroup label="'+r.category+'">',i=r.category),n+='<option value="'+r.key+'"'+(r.key===e?" selected":"")+">"+r.name+"</option>"}i&&(n+="</optgroup>")}n+="</select>",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Gallery</div>',n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Thumbnail size</span>',n+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ThumbnailSize', this.value)\">",n+='<option value="small"'+("small"===e.ThumbnailSize?" selected":"")+">Small</option>",n+='<option value="medium"'+("medium"===e.ThumbnailSize?" selected":"")+">Medium</option>",n+='<option value="large"'+("large"===e.ThumbnailSize?" selected":"")+">Large</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Default view</span>',n+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ViewMode', this.value)\">",n+='<option value="gallery"'+("gallery"===e.ViewMode?" selected":"")+">Gallery</option>",n+='<option value="list"'+("list"===e.ViewMode?" selected":"")+">List</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Show hidden files</span>',n+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.ShowHiddenFiles?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleHiddenFiles(this.checked)\">",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Nav bar in distraction-free</span>',n+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.DistractionFreeShowNav?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleDistractionFreeNav(this.checked)\">",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Server Capabilities</div>',n+='<div class="retold-remote-settings-capabilities">';let r=[{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<r.length;t++){let e=r[t],o=i[e.key];n+='<div class="retold-remote-settings-cap-row">',n+='<span class="retold-remote-settings-cap-label">'+e.label+"</span>",n+='<span class="'+(o?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(o?"Available":"Not found")+"</span>",n+="</div>"}n+='<div class="retold-remote-settings-cap-row" style="margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--retold-border);">',n+='<span class="retold-remote-settings-cap-label">Hashed filenames</span>',n+='<span class="'+(e.HashedFilenames?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(e.HashedFilenames?"Enabled":"Disabled")+"</span>",n+="</div>",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Keyboard Shortcuts</div>';let s=[{key:"Arrow keys",desc:"Navigate gallery"},{key:"Enter",desc:"Open item"},{key:"Escape",desc:"Back / close"},{key:"j / k",desc:"Next / prev in viewer"},{key:"f",desc:"Fullscreen"},{key:"i",desc:"File info"},{key:"Space",desc:"Play / pause"},{key:"+ / -",desc:"Zoom in / out"},{key:"0",desc:"Reset zoom"},{key:"g",desc:"Toggle grid / list"},{key:"/",desc:"Focus search"}];for(let t=0;t<s.length;t++)n+='<div class="retold-remote-settings-cap-row">',n+='<span class="retold-remote-settings-cap-label">'+s[t].desc+"</span>",n+='<span style="color: var(--retold-accent); font-family: var(--retold-font-mono, monospace);">'+s[t].key+"</span>",n+="</div>";n+="</div>",n+="</div>",t.innerHTML=n}changeTheme(t){let e=this.pict.providers["RetoldRemote-Theme"];e&&(e.applyTheme(t),this.pict.PictApplication.saveSettings(),this._renderSettingsContent())}changeSetting(t,e){let i=this.pict.AppData.RetoldRemote;if(i[t]=e,this.pict.PictApplication.saveSettings(),"gallery"===i.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()})}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")}}}o.default_configuration={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"},e.exports=o},{"pict-view":125}],151:[function(t,e,i){const n=t("pict-view");class o extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){super.onAfterRender(),this.updateLocation(),this.updateInfo()}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||"";if(!e)return void(t.innerHTML='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\'\')">/</span>');let i=e.split("/").filter(t=>t),n='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\'\')">/</span>';for(let t=0;t<i.length;t++){n+='<span class="retold-remote-topbar-sep">/</span>',n+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+i.slice(0,t+1).join("/")+"')\">"+i[t]+"</span>"}t.innerHTML=n}updateInfo(){let t=document.getElementById("RetoldRemote-TopBar-Info");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.FolderSummary;if("viewer"===e.ActiveMode){let i=(e.GalleryItems||[])[e.GalleryCursorIndex||0];return void(i&&(t.textContent=i.Name))}if(!i)return void(t.textContent="");let n=[];i.Folders>0&&n.push(i.Folders+" folders"),i.Images>0&&n.push(i.Images+" images"),i.Videos>0&&n.push(i.Videos+" videos"),i.Audio>0&&n.push(i.Audio+" audio"),i.Documents>0&&n.push(i.Documents+" docs"),i.Other>0&&n.push(i.Other+" other"),t.textContent=n.join(" · ")}}o.default_configuration={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-brand\n\t\t{\n\t\t\tfont-size: 0.85rem;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: var(--retold-accent);\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.retold-remote-topbar-location\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: var(--retold-text-muted);\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-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-sep\n\t\t{\n\t\t\tcolor: var(--retold-text-placeholder);\n\t\t\tmargin: 0 3px;\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",Templates:[{Hash:"RetoldRemote-TopBar",Template:'\n\t\t\t\t<div class="retold-remote-topbar">\n\t\t\t\t\t<div class="retold-remote-topbar-brand">Retold Remote</div>\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-btn" onclick="pict.views[\'ContentEditor-Layout\'].toggleSidebar()" title="Toggle Sidebar">&#9776;</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"}]},e.exports=o},{"pict-view":125}],152:[function(t,e,i){arguments[4][1][0].apply(i,arguments)},{dup:1}],153:[function(t,e,i){arguments[4][2][0].apply(i,arguments)},{"../package.json":152,dup:2}],154:[function(t,e,i){arguments[4][51][0].apply(i,arguments)},{dup:51}],155:[function(t,e,i){arguments[4][52][0].apply(i,arguments)},{"../package.json":154,dup:52,"fable-serviceproviderbase":153}],156:[function(t,e,i){arguments[4][20][0].apply(i,arguments)},{dup:20}],157:[function(t,e,i){arguments[4][21][0].apply(i,arguments)},{dup:21}],158:[function(t,e,i){const n=t("pict-view"),o=t("./Pict-Code-Highlighter.js"),r=t("./Pict-Section-Code-DefaultConfiguration.js");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},r,e),i),this.initialRenderComplete=!1,this.codeJar=null,this._highlightFunction=null,this._language=this.options.Language||"javascript"}onBeforeInitialize(){return super.onBeforeInitialize(),this._codeJarPrototype=null,this.targetElement=!1,this._highlightFunction=o(this._language),super.onBeforeInitialize()}connectCodeJarPrototype(t){if("function"!=typeof t)return"undefined"!=typeof window&&"function"==typeof window.CodeJar?(this.log.trace("PICT-Code Found CodeJar in window.CodeJar."),void(this._codeJarPrototype=window.CodeJar)):(this.log.error("PICT-Code No CodeJar prototype found. Include codejar via script tag or call connectCodeJarPrototype(CodeJar) explicitly."),!1);this._codeJarPrototype=t}onAfterRender(t){return this.pict.CSSMap.injectCSS(),this.initialRenderComplete||(this.onAfterInitialRender(),this.initialRenderComplete=!0),super.onAfterRender(t)}onAfterInitialRender(){if(this._codeJarPrototype||this.connectCodeJarPrototype(),!this._codeJarPrototype)return this.log.error("PICT-Code Cannot initialize editor; no CodeJar prototype available."),!1;if(this.codeJar)return this.log.error("PICT-Code editor is already initialized!"),!1;let t=this.services.ContentAssignment.getElement(this.options.TargetElementAddress);if(!t||t.length<1)return this.log.error("PICT-Code Could not find target element [".concat(this.options.TargetElementAddress,"]!")),this.targetElement=!1,!1;this.targetElement=t[0],this._buildEditorDOM();let e=this._resolveCodeContent(),i={};this.options.Tab&&(i.tab=this.options.Tab),this.options.IndentOn&&(i.indentOn=this.options.IndentOn),this.options.MoveToNewLine&&(i.moveToNewLine=this.options.MoveToNewLine),void 0!==this.options.AddClosing&&(i.addClosing=this.options.AddClosing),void 0!==this.options.CatchTab&&(i.catchTab=this.options.CatchTab),this.customConfigureEditorOptions(i);let n=this._editorElement;this.codeJar=this._codeJarPrototype(n,this._highlightFunction,i),this._resetEditorWrapStyles(),e&&this.codeJar.updateCode(e),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)}),this._updateLineNumbers(),this.options.ReadOnly&&n.setAttribute("contenteditable","false")}_buildEditorDOM(){this.targetElement.innerHTML="";let t=document.createElement("div");if(t.className="pict-code-editor-wrap",this.options.LineNumbers){let e=document.createElement("div");e.className="pict-code-line-numbers",t.appendChild(e),this._lineNumbersElement=e}let e=document.createElement("div");e.className="pict-code-editor language-"+this._language,this.options.LineNumbers||(e.className+=" pict-code-no-line-numbers"),t.appendChild(e),this.targetElement.appendChild(t),this._editorElement=e,this._wrapElement=t}_updateLineNumbers(){if(!this.options.LineNumbers||!this._lineNumbersElement||!this._editorElement)return;let t=(this._editorElement.textContent||"").split("\n").length,e="";for(let i=1;i<=t;i++)e+="<span>".concat(i,"</span>");this._lineNumbersElement.innerHTML=e}_resetEditorWrapStyles(){this._editorElement&&(this._editorElement.style.whiteSpace="pre",this._editorElement.style.overflowWrap="normal")}_resolveCodeContent(){if(this.options.CodeDataAddress){const t={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};let e=this.fable.manifest.getValueByHash(t,this.options.CodeDataAddress);if("string"==typeof e)return e;this.log.warn("PICT-Code Address [".concat(this.options.CodeDataAddress,"] did not return a string; it was ").concat(typeof e,"."))}return this.options.DefaultCode||""}customConfigureEditorOptions(t){}onCodeChange(t){if(this.options.CodeDataAddress){const e={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};this.fable.manifest.setValueByHash(e,this.options.CodeDataAddress,t)}}getCode(){return this.codeJar?this.codeJar.toString():(this.log.warn("PICT-Code getCode called before editor initialized."),"")}setCode(t){this.codeJar?(this.codeJar.updateCode(t),this._updateLineNumbers()):this.log.warn("PICT-Code setCode called before editor initialized.")}setLanguage(t){if(this._language=t,this._highlightFunction=o(t),this._editorElement&&(this._editorElement.className="pict-code-editor language-"+t,this.options.LineNumbers||(this._editorElement.className+=" pict-code-no-line-numbers")),this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this._resetEditorWrapStyles(),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}setHighlightFunction(t){if("function"==typeof t){if(this._highlightFunction=t,this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this._resetEditorWrapStyles(),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}else this.log.error("PICT-Code setHighlightFunction requires a function.")}setReadOnly(t){this.options.ReadOnly=t,this._editorElement&&this._editorElement.setAttribute("contenteditable",t?"false":"true")}destroy(){this.codeJar&&(this.codeJar.destroy(),this.codeJar=null)}marshalToView(){if(super.marshalToView(),this.codeJar&&this.options.CodeDataAddress){let t=this._resolveCodeContent();"string"==typeof t&&(this.codeJar.updateCode(t),this._updateLineNumbers())}}marshalFromView(){super.marshalFromView(),this.codeJar&&this.options.CodeDataAddress&&this.onCodeChange(this.codeJar.toString())}},e.exports.default_configuration=r,e.exports.createHighlighter=o},{"./Pict-Code-Highlighter.js":156,"./Pict-Section-Code-DefaultConfiguration.js":157,"pict-view":155}]},{},[140])(140)});
120
+ //# sourceMappingURL=retold-remote.min.js.map