@powerhousedao/connect 4.1.0-dev.21 → 4.1.0-dev.22

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 (68) hide show
  1. package/dist/assets/{AddDriveModal.CD236M_f.js → AddDriveModal.DZSqTSES.js} +2 -2
  2. package/dist/assets/{AddDriveModal.CD236M_f.js.map → AddDriveModal.DZSqTSES.js.map} +1 -1
  3. package/dist/assets/{CookiesPolicyModal.FF1s7vxo.js → CookiesPolicyModal.CmngOQJ0.js} +2 -2
  4. package/dist/assets/{CookiesPolicyModal.FF1s7vxo.js.map → CookiesPolicyModal.CmngOQJ0.js.map} +1 -1
  5. package/dist/assets/{CreateDocumentModal.DFAJgJSa.js → CreateDocumentModal.D0aOUvud.js} +2 -2
  6. package/dist/assets/{CreateDocumentModal.DFAJgJSa.js.map → CreateDocumentModal.D0aOUvud.js.map} +1 -1
  7. package/dist/assets/{DebugSettingsModal.vXpnO3gf.js → DebugSettingsModal.DH8afF4N.js} +2 -2
  8. package/dist/assets/{DebugSettingsModal.vXpnO3gf.js.map → DebugSettingsModal.DH8afF4N.js.map} +1 -1
  9. package/dist/assets/{DeleteDriveModal.Bw5O7v4Z.js → DeleteDriveModal.Bc5WuBbs.js} +2 -2
  10. package/dist/assets/{DeleteDriveModal.Bw5O7v4Z.js.map → DeleteDriveModal.Bc5WuBbs.js.map} +1 -1
  11. package/dist/assets/{DeleteItemModal.qQ6d94st.js → DeleteItemModal.kbH21iIM.js} +2 -2
  12. package/dist/assets/{DeleteItemModal.qQ6d94st.js.map → DeleteItemModal.kbH21iIM.js.map} +1 -1
  13. package/dist/assets/{DisclaimerModal.C6PESA51.js → DisclaimerModal.ByWNCYte.js} +2 -2
  14. package/dist/assets/{DisclaimerModal.C6PESA51.js.map → DisclaimerModal.ByWNCYte.js.map} +1 -1
  15. package/dist/assets/{DriveSettingsModal.B6QFaHSI.js → DriveSettingsModal.Drle0eFP.js} +2 -2
  16. package/dist/assets/{DriveSettingsModal.B6QFaHSI.js.map → DriveSettingsModal.Drle0eFP.js.map} +1 -1
  17. package/dist/assets/{SettingsModal.DaNF8zOc.js → SettingsModal.Prg1bwnU.js} +2 -2
  18. package/dist/assets/{SettingsModal.DaNF8zOc.js.map → SettingsModal.Prg1bwnU.js.map} +1 -1
  19. package/dist/assets/{Trans.tT3J1skx.js → Trans.Cfj7Hl8U.js} +2 -2
  20. package/dist/assets/{Trans.tT3J1skx.js.map → Trans.Cfj7Hl8U.js.map} +1 -1
  21. package/dist/assets/{UpgradeDriveModal.BP5lDPFB.js → UpgradeDriveModal.CLTqE5v0.js} +2 -2
  22. package/dist/assets/{UpgradeDriveModal.BP5lDPFB.js.map → UpgradeDriveModal.CLTqE5v0.js.map} +1 -1
  23. package/dist/assets/{atlas-import.BP-BUgaz.js → atlas-import.CE1LkueM.js} +2 -2
  24. package/dist/assets/{atlas-import.BP-BUgaz.js.map → atlas-import.CE1LkueM.js.map} +1 -1
  25. package/dist/assets/{content.BfvrMr0V.js → content.Di1_TxLo.js} +2 -2
  26. package/dist/assets/{content.BfvrMr0V.js.map → content.Di1_TxLo.js.map} +1 -1
  27. package/dist/assets/{cookie-banner.H8ltpgLH.js → cookie-banner.CN8lvPw2.js} +2 -2
  28. package/dist/assets/{cookie-banner.H8ltpgLH.js.map → cookie-banner.CN8lvPw2.js.map} +1 -1
  29. package/dist/assets/{index.CyGg9uhs.js → index.B8YpY9RS.js} +2 -2
  30. package/dist/assets/{index.CyGg9uhs.js.map → index.B8YpY9RS.js.map} +1 -1
  31. package/dist/assets/{index.DnAVSnDb.js → index.BQUHyrbF.js} +2 -2
  32. package/dist/assets/{index.DnAVSnDb.js.map → index.BQUHyrbF.js.map} +1 -1
  33. package/dist/assets/{index.BaBR0A-H.js → index.BTT7iJxn.js} +2 -2
  34. package/dist/assets/{index.BaBR0A-H.js.map → index.BTT7iJxn.js.map} +1 -1
  35. package/dist/assets/{index.DkU3u_hY.js → index.CE0NtSpX.js} +2 -2
  36. package/dist/assets/{index.DkU3u_hY.js.map → index.CE0NtSpX.js.map} +1 -1
  37. package/dist/assets/{index.gD5wGEzl.js → index.CvVLiiFL.js} +2 -2
  38. package/dist/assets/{index.gD5wGEzl.js.map → index.CvVLiiFL.js.map} +1 -1
  39. package/dist/assets/{index.Cx09-3h-.js → index.D1VdJrbu.js} +5 -5
  40. package/dist/assets/{index.Cx09-3h-.js.map → index.D1VdJrbu.js.map} +1 -1
  41. package/dist/assets/{index.BDASdl6n.js → index.ZacG98dM.js} +2 -2
  42. package/dist/assets/{index.BDASdl6n.js.map → index.ZacG98dM.js.map} +1 -1
  43. package/dist/assets/{main.Cvb9h3xm.js → main.BMn2Koxc.js} +3 -3
  44. package/dist/assets/{main.Cvb9h3xm.js.map → main.BMn2Koxc.js.map} +1 -1
  45. package/dist/assets/{modal.Bqyzi2Hr.js → modal.rCKchklN.js} +3 -3
  46. package/dist/assets/{modal.Bqyzi2Hr.js.map → modal.rCKchklN.js.map} +1 -1
  47. package/dist/assets/{modals.C51Hau9T.js → modals.BND5VgGq.js} +2 -2
  48. package/dist/assets/{modals.C51Hau9T.js.map → modals.BND5VgGq.js.map} +1 -1
  49. package/dist/assets/{nodefs.nYhQAdIV.js → nodefs.Bo5ZNHrD.js} +2 -2
  50. package/dist/assets/{nodefs.nYhQAdIV.js.map → nodefs.Bo5ZNHrD.js.map} +1 -1
  51. package/dist/assets/{nodes.CNC9HfbA.js → nodes.Dm7Ct2Qu.js} +2 -2
  52. package/dist/assets/{nodes.CNC9HfbA.js.map → nodes.Dm7Ct2Qu.js.map} +1 -1
  53. package/dist/assets/{opfs-ahp.DEI4_OMV.js → opfs-ahp.FfypeTGM.js} +2 -2
  54. package/dist/assets/{opfs-ahp.DEI4_OMV.js.map → opfs-ahp.FfypeTGM.js.map} +1 -1
  55. package/dist/assets/{registerServiceWorker.D3pB6TTq.js → registerServiceWorker.BedDSXhk.js} +2 -2
  56. package/dist/assets/{registerServiceWorker.D3pB6TTq.js.map → registerServiceWorker.BedDSXhk.js.map} +1 -1
  57. package/dist/assets/{root.Cc0x0eTC.js → root.DGk8DJK0.js} +2 -2
  58. package/dist/assets/{root.Cc0x0eTC.js.map → root.DGk8DJK0.js.map} +1 -1
  59. package/dist/assets/{useAcceptedCookies.DHQO4jEL.js → useAcceptedCookies.D1uKoy1t.js} +2 -2
  60. package/dist/assets/{useAcceptedCookies.DHQO4jEL.js.map → useAcceptedCookies.D1uKoy1t.js.map} +1 -1
  61. package/dist/assets/useDefaultDocumentModelEditor.8vdl-Z1u.js +2 -0
  62. package/dist/assets/{useDefaultDocumentModelEditor.rOh8o4If.js.map → useDefaultDocumentModelEditor.8vdl-Z1u.js.map} +1 -1
  63. package/dist/assets/{useInitSentry.BXZzeAO4.js → useInitSentry.Bb28RsdX.js} +6 -6
  64. package/dist/assets/{useInitSentry.BXZzeAO4.js.map → useInitSentry.Bb28RsdX.js.map} +1 -1
  65. package/dist/index.html +1 -1
  66. package/dist/vite-envs.sh +1 -1
  67. package/package.json +10 -10
  68. package/dist/assets/useDefaultDocumentModelEditor.rOh8o4If.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Trans.tT3J1skx.js","sources":["../../../../node_modules/.pnpm/void-elements@3.1.0/node_modules/void-elements/index.js","../../../../node_modules/.pnpm/html-parse-stringify@3.0.1/node_modules/html-parse-stringify/dist/html-parse-stringify.module.js","../../../../node_modules/.pnpm/react-i18next@13.5.0_i18next@23.16.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-i18next/dist/es/TransWithoutContext.js","../../../../node_modules/.pnpm/react-i18next@13.5.0_i18next@23.16.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-i18next/dist/es/Trans.js"],"sourcesContent":["/**\n * This file automatically generated from `pre-publish.js`.\n * Do not manually edit.\n */\n\nmodule.exports = {\n \"area\": true,\n \"base\": true,\n \"br\": true,\n \"col\": true,\n \"embed\": true,\n \"hr\": true,\n \"img\": true,\n \"input\": true,\n \"link\": true,\n \"meta\": true,\n \"param\": true,\n \"source\": true,\n \"track\": true,\n \"wbr\": true\n};\n","import e from\"void-elements\";var t=/\\s([^'\"/\\s><]+?)[\\s/>]|([^\\s=]+)=\\s?(\".*?\"|'.*?')/g;function n(n){var r={type:\"tag\",name:\"\",voidElement:!1,attrs:{},children:[]},i=n.match(/<\\/?([^\\s]+?)[/\\s>]/);if(i&&(r.name=i[1],(e[i[1]]||\"/\"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith(\"!--\"))){var s=n.indexOf(\"--\\x3e\");return{type:\"comment\",comment:-1!==s?n.slice(4,s):\"\"}}for(var a=new RegExp(t),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,\"\"];o.indexOf(\"=\")>-1&&(l=o.split(\"=\")),r.attrs[l[0]]=l[1],a.lastIndex--}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var r=/<[a-zA-Z0-9\\-\\!\\/](?:\"[^\"]*\"|'[^']*'|[^'\">])*>/g,i=/^\\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case\"text\":return e+t.content;case\"tag\":return e+=\"<\"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'=\"'+e[n]+'\"');return t.length?\" \"+t.join(\" \"):\"\"}(t.attrs):\"\")+(t.voidElement?\"/>\":\">\"),t.voidElement?e:e+t.children.reduce(a,\"\")+\"</\"+t.name+\">\";case\"comment\":return e+\"\\x3c!--\"+t.comment+\"--\\x3e\"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf(\"<\")){var u=e.indexOf(\"<\");c.push({type:\"text\",content:-1===u?e:e.substring(0,u)})}return e.replace(r,function(r,s){if(m){if(r!==\"</\"+a.name+\">\")return;m=!1}var u,f=\"/\"!==r.charAt(1),h=r.startsWith(\"\\x3c!--\"),p=s+r.length,d=e.charAt(p);if(h){var v=n(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,\"tag\"===(a=n(r)).type&&t.components[a.name]&&(a.type=\"component\",m=!0),a.voidElement||m||!d||\"<\"===d||a.children.push({type:\"text\",content:e.slice(p,e.indexOf(\"<\",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&\"<\"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf(\"<\",p),g=e.slice(p,-1===x?void 0:x);i.test(g)&&(g=\" \"),(x>-1&&l+u.length>=0||\" \"!==g)&&u.push({type:\"text\",content:g})}}),c},stringify:function(e){return e.reduce(function(e,t){return e+a(\"\",t)},\"\")}};export default c;\n//# sourceMappingURL=html-parse-stringify.module.js.map\n","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { isValidElement, cloneElement, createElement, Children } from 'react';\nimport HTML from 'html-parse-stringify';\nimport { warn, warnOnce } from './utils.js';\nimport { getDefaults } from './defaults.js';\nimport { getI18n } from './i18nInstance.js';\nfunction hasChildren(node, checkLength) {\n if (!node) return false;\n const base = node.props ? node.props.children : node.children;\n if (checkLength) return base.length > 0;\n return !!base;\n}\nfunction getChildren(node) {\n if (!node) return [];\n const children = node.props ? node.props.children : node.children;\n return node.props && node.props.i18nIsDynamicList ? getAsArray(children) : children;\n}\nfunction hasValidReactChildren(children) {\n if (Object.prototype.toString.call(children) !== '[object Array]') return false;\n return children.every(child => isValidElement(child));\n}\nfunction getAsArray(data) {\n return Array.isArray(data) ? data : [data];\n}\nfunction mergeProps(source, target) {\n const newTarget = {\n ...target\n };\n newTarget.props = Object.assign(source.props, target.props);\n return newTarget;\n}\nexport function nodesToString(children, i18nOptions) {\n if (!children) return '';\n let stringNode = '';\n const childrenArray = getAsArray(children);\n const keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];\n childrenArray.forEach((child, childIndex) => {\n if (typeof child === 'string') {\n stringNode += `${child}`;\n } else if (isValidElement(child)) {\n const childPropsCount = Object.keys(child.props).length;\n const shouldKeepChild = keepArray.indexOf(child.type) > -1;\n const childChildren = child.props.children;\n if (!childChildren && shouldKeepChild && childPropsCount === 0) {\n stringNode += `<${child.type}/>`;\n } else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {\n stringNode += `<${childIndex}></${childIndex}>`;\n } else if (child.props.i18nIsDynamicList) {\n stringNode += `<${childIndex}></${childIndex}>`;\n } else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {\n stringNode += `<${child.type}>${childChildren}</${child.type}>`;\n } else {\n const content = nodesToString(childChildren, i18nOptions);\n stringNode += `<${childIndex}>${content}</${childIndex}>`;\n }\n } else if (child === null) {\n warn(`Trans: the passed in value is invalid - seems you passed in a null child.`);\n } else if (typeof child === 'object') {\n const {\n format,\n ...clone\n } = child;\n const keys = Object.keys(clone);\n if (keys.length === 1) {\n const value = format ? `${keys[0]}, ${format}` : keys[0];\n stringNode += `{{${value}}}`;\n } else {\n warn(`react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.`, child);\n }\n } else {\n warn(`Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.`, child);\n }\n });\n return stringNode;\n}\nfunction renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {\n if (targetString === '') return [];\n const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];\n const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map(keep => `<${keep}`).join('|')).test(targetString);\n if (!children && !emptyChildrenButNeedsHandling && !shouldUnescape) return [targetString];\n const data = {};\n function getData(childs) {\n const childrenArray = getAsArray(childs);\n childrenArray.forEach(child => {\n if (typeof child === 'string') return;\n if (hasChildren(child)) getData(getChildren(child));else if (typeof child === 'object' && !isValidElement(child)) Object.assign(data, child);\n });\n }\n getData(children);\n const ast = HTML.parse(`<0>${targetString}</0>`);\n const opts = {\n ...data,\n ...combinedTOpts\n };\n function renderInner(child, node, rootReactNode) {\n const childs = getChildren(child);\n const mappedChildren = mapAST(childs, node.children, rootReactNode);\n return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props && child.props.i18nIsDynamicList ? childs : mappedChildren;\n }\n function pushTranslatedJSX(child, inner, mem, i, isVoid) {\n if (child.dummy) {\n child.children = inner;\n mem.push(cloneElement(child, {\n key: i\n }, isVoid ? undefined : inner));\n } else {\n mem.push(...Children.map([child], c => {\n const props = {\n ...c.props\n };\n delete props.i18nIsDynamicList;\n return React.createElement(c.type, _extends({}, props, {\n key: i,\n ref: c.ref\n }, isVoid ? {} : {\n children: inner\n }));\n }));\n }\n }\n function mapAST(reactNode, astNode, rootReactNode) {\n const reactNodes = getAsArray(reactNode);\n const astNodes = getAsArray(astNode);\n return astNodes.reduce((mem, node, i) => {\n const translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);\n if (node.type === 'tag') {\n let tmp = reactNodes[parseInt(node.name, 10)];\n if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name];\n if (!tmp) tmp = {};\n const child = Object.keys(node.attrs).length !== 0 ? mergeProps({\n props: node.attrs\n }, tmp) : tmp;\n const isElement = isValidElement(child);\n const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;\n const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && typeof child === 'object' && child.dummy && !isElement;\n const isKnownComponent = typeof children === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);\n if (typeof child === 'string') {\n const value = i18n.services.interpolator.interpolate(child, opts, i18n.language);\n mem.push(value);\n } else if (hasChildren(child) || isValidTranslationWithChildren) {\n const inner = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i);\n } else if (isEmptyTransWithHTML) {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i);\n } else if (Number.isNaN(parseFloat(node.name))) {\n if (isKnownComponent) {\n const inner = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i, node.voidElement);\n } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {\n if (node.voidElement) {\n mem.push(createElement(node.name, {\n key: `${node.name}-${i}`\n }));\n } else {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n mem.push(createElement(node.name, {\n key: `${node.name}-${i}`\n }, inner));\n }\n } else if (node.voidElement) {\n mem.push(`<${node.name} />`);\n } else {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n mem.push(`<${node.name}>${inner}</${node.name}>`);\n }\n } else if (typeof child === 'object' && !isElement) {\n const content = node.children[0] ? translationContent : null;\n if (content) mem.push(content);\n } else {\n pushTranslatedJSX(child, translationContent, mem, i, node.children.length !== 1 || !translationContent);\n }\n } else if (node.type === 'text') {\n const wrapTextNodes = i18nOptions.transWrapTextNodes;\n const content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);\n if (wrapTextNodes) {\n mem.push(createElement(wrapTextNodes, {\n key: `${node.name}-${i}`\n }, content));\n } else {\n mem.push(content);\n }\n }\n return mem;\n }, []);\n }\n const result = mapAST([{\n dummy: true,\n children: children || []\n }], ast, getAsArray(children || []));\n return getChildren(result[0]);\n}\nexport function Trans(_ref) {\n let {\n children,\n count,\n parent,\n i18nKey,\n context,\n tOptions = {},\n values,\n defaults,\n components,\n ns,\n i18n: i18nFromProps,\n t: tFromProps,\n shouldUnescape,\n ...additionalProps\n } = _ref;\n const i18n = i18nFromProps || getI18n();\n if (!i18n) {\n warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');\n return children;\n }\n const t = tFromProps || i18n.t.bind(i18n) || (k => k);\n if (context) tOptions.context = context;\n const reactI18nextOptions = {\n ...getDefaults(),\n ...(i18n.options && i18n.options.react)\n };\n let namespaces = ns || t.ns || i18n.options && i18n.options.defaultNS;\n namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];\n const nodeAsString = nodesToString(children, reactI18nextOptions);\n const defaultValue = defaults || nodeAsString || reactI18nextOptions.transEmptyNodeValue || i18nKey;\n const {\n hashTransKey\n } = reactI18nextOptions;\n const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue);\n if (i18n.options && i18n.options.interpolation && i18n.options.interpolation.defaultVariables) {\n values = values && Object.keys(values).length > 0 ? {\n ...values,\n ...i18n.options.interpolation.defaultVariables\n } : {\n ...i18n.options.interpolation.defaultVariables\n };\n }\n const interpolationOverride = values ? tOptions.interpolation : {\n interpolation: {\n ...tOptions.interpolation,\n prefix: '#$?',\n suffix: '?$#'\n }\n };\n const combinedTOpts = {\n ...tOptions,\n count,\n ...values,\n ...interpolationOverride,\n defaultValue,\n ns: namespaces\n };\n const translation = key ? t(key, combinedTOpts) : defaultValue;\n if (components) {\n Object.keys(components).forEach(c => {\n const comp = components[c];\n if (typeof comp.type === 'function' || !comp.props || !comp.props.children || translation.indexOf(`${c}/>`) < 0 && translation.indexOf(`${c} />`) < 0) return;\n function Componentized() {\n return React.createElement(React.Fragment, null, comp);\n }\n components[c] = React.createElement(Componentized, null);\n });\n }\n const content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);\n const useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;\n return useAsParent ? createElement(useAsParent, additionalProps, content) : content;\n}","import { useContext } from 'react';\nimport { nodesToString, Trans as TransWithoutContext } from './TransWithoutContext.js';\nimport { getI18n, I18nContext } from './context.js';\nexport { nodesToString };\nexport function Trans(_ref) {\n let {\n children,\n count,\n parent,\n i18nKey,\n context,\n tOptions = {},\n values,\n defaults,\n components,\n ns,\n i18n: i18nFromProps,\n t: tFromProps,\n shouldUnescape,\n ...additionalProps\n } = _ref;\n const {\n i18n: i18nFromContext,\n defaultNS: defaultNSFromContext\n } = useContext(I18nContext) || {};\n const i18n = i18nFromProps || i18nFromContext || getI18n();\n const t = tFromProps || i18n && i18n.t.bind(i18n);\n return TransWithoutContext({\n children,\n count,\n parent,\n i18nKey,\n context,\n tOptions,\n values,\n defaults,\n components,\n ns: ns || t && t.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS,\n i18n,\n t: tFromProps,\n shouldUnescape,\n ...additionalProps\n });\n}"],"names":["voidElements","t","n","r","i","e","s","a","c","o","l","m","u","f","h","p","d","v","x","g","hasChildren","node","checkLength","base","getChildren","children","getAsArray","hasValidReactChildren","child","isValidElement","data","mergeProps","source","target","newTarget","nodesToString","i18nOptions","stringNode","childrenArray","keepArray","childIndex","childPropsCount","shouldKeepChild","childChildren","content","warn","format","clone","keys","value","renderNodes","targetString","i18n","combinedTOpts","shouldUnescape","emptyChildrenButNeedsHandling","keep","getData","childs","ast","HTML","opts","renderInner","rootReactNode","mappedChildren","mapAST","pushTranslatedJSX","inner","mem","isVoid","cloneElement","Children","props","React","_extends","reactNode","astNode","reactNodes","translationContent","tmp","isElement","isValidTranslationWithChildren","isEmptyTransWithHTML","isKnownComponent","createElement","wrapTextNodes","result","Trans","_ref","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18nFromProps","tFromProps","additionalProps","getI18n","warnOnce","k","reactI18nextOptions","getDefaults","namespaces","nodeAsString","defaultValue","hashTransKey","key","interpolationOverride","translation","comp","Componentized","useAsParent","i18nFromContext","defaultNSFromContext","useContext","I18nContext","TransWithoutContext"],"mappings":"0QAKAA,EAAiB,CACf,KAAQ,GACR,KAAQ,GACR,GAAM,GACN,IAAO,GACP,MAAS,GACT,GAAM,GACN,IAAO,GACP,MAAS,GACT,KAAQ,GACR,KAAQ,GACR,MAAS,GACT,OAAU,GACV,MAAS,GACT,IAAO,iCCnBoB,IAAIC,GAAE,qDAAqD,SAASC,EAAEA,EAAE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SAAAC,EACA,OAAAC,EACA,SAAAC,EACA,WAAAC,EACA,GAAIC,GAAMhG,GAAKA,EAAE,IAAMoH,GAAwBjE,GAAQA,EAAK,SAAWA,EAAK,QAAQ,UACpF,KAAAA,EACA,EAAG+C,EACH,eAAA7C,EACA,GAAG8C,CACP,CAAG,CACH","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"Trans.Cfj7Hl8U.js","sources":["../../../../node_modules/.pnpm/void-elements@3.1.0/node_modules/void-elements/index.js","../../../../node_modules/.pnpm/html-parse-stringify@3.0.1/node_modules/html-parse-stringify/dist/html-parse-stringify.module.js","../../../../node_modules/.pnpm/react-i18next@13.5.0_i18next@23.16.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-i18next/dist/es/TransWithoutContext.js","../../../../node_modules/.pnpm/react-i18next@13.5.0_i18next@23.16.8_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-i18next/dist/es/Trans.js"],"sourcesContent":["/**\n * This file automatically generated from `pre-publish.js`.\n * Do not manually edit.\n */\n\nmodule.exports = {\n \"area\": true,\n \"base\": true,\n \"br\": true,\n \"col\": true,\n \"embed\": true,\n \"hr\": true,\n \"img\": true,\n \"input\": true,\n \"link\": true,\n \"meta\": true,\n \"param\": true,\n \"source\": true,\n \"track\": true,\n \"wbr\": true\n};\n","import e from\"void-elements\";var t=/\\s([^'\"/\\s><]+?)[\\s/>]|([^\\s=]+)=\\s?(\".*?\"|'.*?')/g;function n(n){var r={type:\"tag\",name:\"\",voidElement:!1,attrs:{},children:[]},i=n.match(/<\\/?([^\\s]+?)[/\\s>]/);if(i&&(r.name=i[1],(e[i[1]]||\"/\"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith(\"!--\"))){var s=n.indexOf(\"--\\x3e\");return{type:\"comment\",comment:-1!==s?n.slice(4,s):\"\"}}for(var a=new RegExp(t),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,\"\"];o.indexOf(\"=\")>-1&&(l=o.split(\"=\")),r.attrs[l[0]]=l[1],a.lastIndex--}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var r=/<[a-zA-Z0-9\\-\\!\\/](?:\"[^\"]*\"|'[^']*'|[^'\">])*>/g,i=/^\\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case\"text\":return e+t.content;case\"tag\":return e+=\"<\"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'=\"'+e[n]+'\"');return t.length?\" \"+t.join(\" \"):\"\"}(t.attrs):\"\")+(t.voidElement?\"/>\":\">\"),t.voidElement?e:e+t.children.reduce(a,\"\")+\"</\"+t.name+\">\";case\"comment\":return e+\"\\x3c!--\"+t.comment+\"--\\x3e\"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf(\"<\")){var u=e.indexOf(\"<\");c.push({type:\"text\",content:-1===u?e:e.substring(0,u)})}return e.replace(r,function(r,s){if(m){if(r!==\"</\"+a.name+\">\")return;m=!1}var u,f=\"/\"!==r.charAt(1),h=r.startsWith(\"\\x3c!--\"),p=s+r.length,d=e.charAt(p);if(h){var v=n(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,\"tag\"===(a=n(r)).type&&t.components[a.name]&&(a.type=\"component\",m=!0),a.voidElement||m||!d||\"<\"===d||a.children.push({type:\"text\",content:e.slice(p,e.indexOf(\"<\",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&\"<\"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf(\"<\",p),g=e.slice(p,-1===x?void 0:x);i.test(g)&&(g=\" \"),(x>-1&&l+u.length>=0||\" \"!==g)&&u.push({type:\"text\",content:g})}}),c},stringify:function(e){return e.reduce(function(e,t){return e+a(\"\",t)},\"\")}};export default c;\n//# sourceMappingURL=html-parse-stringify.module.js.map\n","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { isValidElement, cloneElement, createElement, Children } from 'react';\nimport HTML from 'html-parse-stringify';\nimport { warn, warnOnce } from './utils.js';\nimport { getDefaults } from './defaults.js';\nimport { getI18n } from './i18nInstance.js';\nfunction hasChildren(node, checkLength) {\n if (!node) return false;\n const base = node.props ? node.props.children : node.children;\n if (checkLength) return base.length > 0;\n return !!base;\n}\nfunction getChildren(node) {\n if (!node) return [];\n const children = node.props ? node.props.children : node.children;\n return node.props && node.props.i18nIsDynamicList ? getAsArray(children) : children;\n}\nfunction hasValidReactChildren(children) {\n if (Object.prototype.toString.call(children) !== '[object Array]') return false;\n return children.every(child => isValidElement(child));\n}\nfunction getAsArray(data) {\n return Array.isArray(data) ? data : [data];\n}\nfunction mergeProps(source, target) {\n const newTarget = {\n ...target\n };\n newTarget.props = Object.assign(source.props, target.props);\n return newTarget;\n}\nexport function nodesToString(children, i18nOptions) {\n if (!children) return '';\n let stringNode = '';\n const childrenArray = getAsArray(children);\n const keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];\n childrenArray.forEach((child, childIndex) => {\n if (typeof child === 'string') {\n stringNode += `${child}`;\n } else if (isValidElement(child)) {\n const childPropsCount = Object.keys(child.props).length;\n const shouldKeepChild = keepArray.indexOf(child.type) > -1;\n const childChildren = child.props.children;\n if (!childChildren && shouldKeepChild && childPropsCount === 0) {\n stringNode += `<${child.type}/>`;\n } else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {\n stringNode += `<${childIndex}></${childIndex}>`;\n } else if (child.props.i18nIsDynamicList) {\n stringNode += `<${childIndex}></${childIndex}>`;\n } else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {\n stringNode += `<${child.type}>${childChildren}</${child.type}>`;\n } else {\n const content = nodesToString(childChildren, i18nOptions);\n stringNode += `<${childIndex}>${content}</${childIndex}>`;\n }\n } else if (child === null) {\n warn(`Trans: the passed in value is invalid - seems you passed in a null child.`);\n } else if (typeof child === 'object') {\n const {\n format,\n ...clone\n } = child;\n const keys = Object.keys(clone);\n if (keys.length === 1) {\n const value = format ? `${keys[0]}, ${format}` : keys[0];\n stringNode += `{{${value}}}`;\n } else {\n warn(`react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.`, child);\n }\n } else {\n warn(`Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.`, child);\n }\n });\n return stringNode;\n}\nfunction renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {\n if (targetString === '') return [];\n const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];\n const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map(keep => `<${keep}`).join('|')).test(targetString);\n if (!children && !emptyChildrenButNeedsHandling && !shouldUnescape) return [targetString];\n const data = {};\n function getData(childs) {\n const childrenArray = getAsArray(childs);\n childrenArray.forEach(child => {\n if (typeof child === 'string') return;\n if (hasChildren(child)) getData(getChildren(child));else if (typeof child === 'object' && !isValidElement(child)) Object.assign(data, child);\n });\n }\n getData(children);\n const ast = HTML.parse(`<0>${targetString}</0>`);\n const opts = {\n ...data,\n ...combinedTOpts\n };\n function renderInner(child, node, rootReactNode) {\n const childs = getChildren(child);\n const mappedChildren = mapAST(childs, node.children, rootReactNode);\n return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props && child.props.i18nIsDynamicList ? childs : mappedChildren;\n }\n function pushTranslatedJSX(child, inner, mem, i, isVoid) {\n if (child.dummy) {\n child.children = inner;\n mem.push(cloneElement(child, {\n key: i\n }, isVoid ? undefined : inner));\n } else {\n mem.push(...Children.map([child], c => {\n const props = {\n ...c.props\n };\n delete props.i18nIsDynamicList;\n return React.createElement(c.type, _extends({}, props, {\n key: i,\n ref: c.ref\n }, isVoid ? {} : {\n children: inner\n }));\n }));\n }\n }\n function mapAST(reactNode, astNode, rootReactNode) {\n const reactNodes = getAsArray(reactNode);\n const astNodes = getAsArray(astNode);\n return astNodes.reduce((mem, node, i) => {\n const translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);\n if (node.type === 'tag') {\n let tmp = reactNodes[parseInt(node.name, 10)];\n if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name];\n if (!tmp) tmp = {};\n const child = Object.keys(node.attrs).length !== 0 ? mergeProps({\n props: node.attrs\n }, tmp) : tmp;\n const isElement = isValidElement(child);\n const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;\n const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && typeof child === 'object' && child.dummy && !isElement;\n const isKnownComponent = typeof children === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);\n if (typeof child === 'string') {\n const value = i18n.services.interpolator.interpolate(child, opts, i18n.language);\n mem.push(value);\n } else if (hasChildren(child) || isValidTranslationWithChildren) {\n const inner = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i);\n } else if (isEmptyTransWithHTML) {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i);\n } else if (Number.isNaN(parseFloat(node.name))) {\n if (isKnownComponent) {\n const inner = renderInner(child, node, rootReactNode);\n pushTranslatedJSX(child, inner, mem, i, node.voidElement);\n } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {\n if (node.voidElement) {\n mem.push(createElement(node.name, {\n key: `${node.name}-${i}`\n }));\n } else {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n mem.push(createElement(node.name, {\n key: `${node.name}-${i}`\n }, inner));\n }\n } else if (node.voidElement) {\n mem.push(`<${node.name} />`);\n } else {\n const inner = mapAST(reactNodes, node.children, rootReactNode);\n mem.push(`<${node.name}>${inner}</${node.name}>`);\n }\n } else if (typeof child === 'object' && !isElement) {\n const content = node.children[0] ? translationContent : null;\n if (content) mem.push(content);\n } else {\n pushTranslatedJSX(child, translationContent, mem, i, node.children.length !== 1 || !translationContent);\n }\n } else if (node.type === 'text') {\n const wrapTextNodes = i18nOptions.transWrapTextNodes;\n const content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);\n if (wrapTextNodes) {\n mem.push(createElement(wrapTextNodes, {\n key: `${node.name}-${i}`\n }, content));\n } else {\n mem.push(content);\n }\n }\n return mem;\n }, []);\n }\n const result = mapAST([{\n dummy: true,\n children: children || []\n }], ast, getAsArray(children || []));\n return getChildren(result[0]);\n}\nexport function Trans(_ref) {\n let {\n children,\n count,\n parent,\n i18nKey,\n context,\n tOptions = {},\n values,\n defaults,\n components,\n ns,\n i18n: i18nFromProps,\n t: tFromProps,\n shouldUnescape,\n ...additionalProps\n } = _ref;\n const i18n = i18nFromProps || getI18n();\n if (!i18n) {\n warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');\n return children;\n }\n const t = tFromProps || i18n.t.bind(i18n) || (k => k);\n if (context) tOptions.context = context;\n const reactI18nextOptions = {\n ...getDefaults(),\n ...(i18n.options && i18n.options.react)\n };\n let namespaces = ns || t.ns || i18n.options && i18n.options.defaultNS;\n namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];\n const nodeAsString = nodesToString(children, reactI18nextOptions);\n const defaultValue = defaults || nodeAsString || reactI18nextOptions.transEmptyNodeValue || i18nKey;\n const {\n hashTransKey\n } = reactI18nextOptions;\n const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue);\n if (i18n.options && i18n.options.interpolation && i18n.options.interpolation.defaultVariables) {\n values = values && Object.keys(values).length > 0 ? {\n ...values,\n ...i18n.options.interpolation.defaultVariables\n } : {\n ...i18n.options.interpolation.defaultVariables\n };\n }\n const interpolationOverride = values ? tOptions.interpolation : {\n interpolation: {\n ...tOptions.interpolation,\n prefix: '#$?',\n suffix: '?$#'\n }\n };\n const combinedTOpts = {\n ...tOptions,\n count,\n ...values,\n ...interpolationOverride,\n defaultValue,\n ns: namespaces\n };\n const translation = key ? t(key, combinedTOpts) : defaultValue;\n if (components) {\n Object.keys(components).forEach(c => {\n const comp = components[c];\n if (typeof comp.type === 'function' || !comp.props || !comp.props.children || translation.indexOf(`${c}/>`) < 0 && translation.indexOf(`${c} />`) < 0) return;\n function Componentized() {\n return React.createElement(React.Fragment, null, comp);\n }\n components[c] = React.createElement(Componentized, null);\n });\n }\n const content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);\n const useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;\n return useAsParent ? createElement(useAsParent, additionalProps, content) : content;\n}","import { useContext } from 'react';\nimport { nodesToString, Trans as TransWithoutContext } from './TransWithoutContext.js';\nimport { getI18n, I18nContext } from './context.js';\nexport { nodesToString };\nexport function Trans(_ref) {\n let {\n children,\n count,\n parent,\n i18nKey,\n context,\n tOptions = {},\n values,\n defaults,\n components,\n ns,\n i18n: i18nFromProps,\n t: tFromProps,\n shouldUnescape,\n ...additionalProps\n } = _ref;\n const {\n i18n: i18nFromContext,\n defaultNS: defaultNSFromContext\n } = useContext(I18nContext) || {};\n const i18n = i18nFromProps || i18nFromContext || getI18n();\n const t = tFromProps || i18n && i18n.t.bind(i18n);\n return TransWithoutContext({\n children,\n count,\n parent,\n i18nKey,\n context,\n tOptions,\n values,\n defaults,\n components,\n ns: ns || t && t.ns || defaultNSFromContext || i18n && i18n.options && i18n.options.defaultNS,\n i18n,\n t: tFromProps,\n shouldUnescape,\n ...additionalProps\n });\n}"],"names":["voidElements","t","n","r","i","e","s","a","c","o","l","m","u","f","h","p","d","v","x","g","hasChildren","node","checkLength","base","getChildren","children","getAsArray","hasValidReactChildren","child","isValidElement","data","mergeProps","source","target","newTarget","nodesToString","i18nOptions","stringNode","childrenArray","keepArray","childIndex","childPropsCount","shouldKeepChild","childChildren","content","warn","format","clone","keys","value","renderNodes","targetString","i18n","combinedTOpts","shouldUnescape","emptyChildrenButNeedsHandling","keep","getData","childs","ast","HTML","opts","renderInner","rootReactNode","mappedChildren","mapAST","pushTranslatedJSX","inner","mem","isVoid","cloneElement","Children","props","React","_extends","reactNode","astNode","reactNodes","translationContent","tmp","isElement","isValidTranslationWithChildren","isEmptyTransWithHTML","isKnownComponent","createElement","wrapTextNodes","result","Trans","_ref","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18nFromProps","tFromProps","additionalProps","getI18n","warnOnce","k","reactI18nextOptions","getDefaults","namespaces","nodeAsString","defaultValue","hashTransKey","key","interpolationOverride","translation","comp","Componentized","useAsParent","i18nFromContext","defaultNSFromContext","useContext","I18nContext","TransWithoutContext"],"mappings":"0QAKAA,EAAiB,CACf,KAAQ,GACR,KAAQ,GACR,GAAM,GACN,IAAO,GACP,MAAS,GACT,GAAM,GACN,IAAO,GACP,MAAS,GACT,KAAQ,GACR,KAAQ,GACR,MAAS,GACT,OAAU,GACV,MAAS,GACT,IAAO,iCCnBoB,IAAIC,GAAE,qDAAqD,SAASC,EAAEA,EAAE,CAAC,IAAIC,EAAE,CAAC,KAAK,MAAM,KAAK,GAAG,YAAY,GAAG,MAAM,CAAA,EAAG,SAAS,CAAA,CAAE,EAAEC,EAAEF,EAAE,MAAM,qBAAqB,EAAE,GAAGE,IAAID,EAAE,KAAKC,EAAE,CAAC,GAAGC,GAAED,EAAE,CAAC,CAAC,GAASF,EAAE,OAAOA,EAAE,OAAO,CAAC,IAAzB,OAA8BC,EAAE,YAAY,IAAIA,EAAE,KAAK,WAAW,KAAK,GAAG,CAAC,IAAIG,EAAEJ,EAAE,QAAQ,KAAQ,EAAE,MAAM,CAAC,KAAK,UAAU,QAAaI,IAAL,GAAOJ,EAAE,MAAM,EAAEI,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQC,EAAE,IA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WxF,CAAC,EAAIiE,EAAM,cAAcyC,EAAe,IAAI,CAC7D,CAAK,EAEH,MAAMtE,EAAUM,GAAY8C,GAAcvE,EAAUuF,EAAa5D,EAAMoD,EAAqBnD,EAAeC,CAAc,EACnH6D,EAAczB,IAAW,OAAYA,EAASc,EAAoB,mBACxE,OAAOW,EAAc/B,EAAc+B,EAAaf,EAAiBxD,CAAO,EAAIA,CAC9E,CCrQO,SAAS2C,GAAMC,EAAM,CAC1B,GAAI,CACF,SAAA/D,EACA,MAAAgE,EACA,OAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EAAW,CAAA,EACX,OAAAC,EACA,SAAAC,EACA,WAAAC,EACA,GAAAC,EACA,KAAMC,EACN,EAAGC,EACH,eAAA7C,EACA,GAAG8C,CACP,EAAMZ,EACJ,KAAM,CACJ,KAAM4B,EACN,UAAWC,CACf,EAAMC,EAAWC,CAAW,GAAK,CAAA,EACzBnE,EAAO8C,GAAiBkB,GAAmBf,EAAO,EAClDpG,EAAIkG,GAAc/C,GAAQA,EAAK,EAAE,KAAKA,CAAI,EAChD,OAAOoE,GAAoB,CACzB,SAAA/F,EACA,MAAAgE,EACA,OAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,OAAAC,EACA,SAAAC,EACA,WAAAC,EACA,GAAIC,GAAMhG,GAAKA,EAAE,IAAMoH,GAAwBjE,GAAQA,EAAK,SAAWA,EAAK,QAAQ,UACpF,KAAAA,EACA,EAAG+C,EACH,eAAA7C,EACA,GAAG8C,CACP,CAAG,CACH","x_google_ignoreList":[0,1,2,3]}
@@ -1,2 +1,2 @@
1
- import{jsx as i}from"react/jsx-runtime";import{i as m}from"./index.Cx09-3h-.js";import{aX as d}from"./index.Xt1GtJTP.js";import"react-dom/client";import"react";import"./browser.BkwNmV2Z.js";import"./app-skeleton.js";import"react-dom";const f=n=>{const{open:r,onClose:e,driveId:t}=n,{t:o}=m();return i(d,{open:r,onContinue:()=>{console.log("Upgrade drive: ",t),e()},header:o("modals.upgradeDrive.header"),body:o("modals.upgradeDrive.body"),cancelLabel:o("common.cancel"),continueLabel:o("common.continue"),onOpenChange:a=>{if(!a)return e()}})};export{f as UpgradeDriveModal};
2
- //# sourceMappingURL=UpgradeDriveModal.BP5lDPFB.js.map
1
+ import{jsx as i}from"react/jsx-runtime";import{i as m}from"./index.D1VdJrbu.js";import{aX as d}from"./index.Xt1GtJTP.js";import"react-dom/client";import"react";import"./browser.BkwNmV2Z.js";import"./app-skeleton.js";import"react-dom";const f=n=>{const{open:r,onClose:e,driveId:t}=n,{t:o}=m();return i(d,{open:r,onContinue:()=>{console.log("Upgrade drive: ",t),e()},header:o("modals.upgradeDrive.header"),body:o("modals.upgradeDrive.body"),cancelLabel:o("common.cancel"),continueLabel:o("common.continue"),onOpenChange:a=>{if(!a)return e()}})};export{f as UpgradeDriveModal};
2
+ //# sourceMappingURL=UpgradeDriveModal.CLTqE5v0.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UpgradeDriveModal.BP5lDPFB.js","sources":["../../src/components/modal/modals/UpgradeDriveModal.tsx"],"sourcesContent":["import { ConnectUpgradeDriveModal } from '@powerhousedao/design-system';\nimport type React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nexport interface UpgradeDriveModalProps {\n open: boolean;\n onClose: () => void;\n driveId: string;\n}\n\nexport const UpgradeDriveModal: React.FC<UpgradeDriveModalProps> = props => {\n const { open, onClose, driveId } = props;\n\n const { t } = useTranslation();\n\n const onContinue = () => {\n // TODO: Implement upgrade drive\n console.log('Upgrade drive: ', driveId);\n onClose();\n };\n\n return (\n <ConnectUpgradeDriveModal\n open={open}\n onContinue={onContinue}\n header={t('modals.upgradeDrive.header')}\n body={t('modals.upgradeDrive.body')}\n cancelLabel={t('common.cancel')}\n continueLabel={t('common.continue')}\n onOpenChange={(status: boolean) => {\n if (!status) return onClose();\n }}\n />\n );\n};\n"],"names":["UpgradeDriveModal","props","open","onClose","driveId","t","useTranslation","jsx","ConnectUpgradeDriveModal","status"],"mappings":"0OAUO,MAAMA,EAAsDC,GAAS,CACxE,KAAM,CAAE,KAAAC,EAAM,QAAAC,EAAS,QAAAC,CAAA,EAAYH,EAE7B,CAAE,EAAAI,CAAA,EAAMC,EAAA,EAQd,OACIC,EAACC,EAAA,CACG,KAAAN,EACA,WATW,IAAM,CAErB,QAAQ,IAAI,kBAAmBE,CAAO,EACtCD,EAAA,CAAQ,EAOJ,OAAQE,EAAE,4BAA4B,EACtC,KAAMA,EAAE,0BAA0B,EAClC,YAAaA,EAAE,eAAe,EAC9B,cAAeA,EAAE,iBAAiB,EAClC,aAAeI,GAAoB,CAC/B,GAAI,CAACA,EAAQ,OAAON,EAAA,CAAQ,CAChC,CAAA,CAGZ"}
1
+ {"version":3,"file":"UpgradeDriveModal.CLTqE5v0.js","sources":["../../src/components/modal/modals/UpgradeDriveModal.tsx"],"sourcesContent":["import { ConnectUpgradeDriveModal } from '@powerhousedao/design-system';\nimport type React from 'react';\nimport { useTranslation } from 'react-i18next';\n\nexport interface UpgradeDriveModalProps {\n open: boolean;\n onClose: () => void;\n driveId: string;\n}\n\nexport const UpgradeDriveModal: React.FC<UpgradeDriveModalProps> = props => {\n const { open, onClose, driveId } = props;\n\n const { t } = useTranslation();\n\n const onContinue = () => {\n // TODO: Implement upgrade drive\n console.log('Upgrade drive: ', driveId);\n onClose();\n };\n\n return (\n <ConnectUpgradeDriveModal\n open={open}\n onContinue={onContinue}\n header={t('modals.upgradeDrive.header')}\n body={t('modals.upgradeDrive.body')}\n cancelLabel={t('common.cancel')}\n continueLabel={t('common.continue')}\n onOpenChange={(status: boolean) => {\n if (!status) return onClose();\n }}\n />\n );\n};\n"],"names":["UpgradeDriveModal","props","open","onClose","driveId","t","useTranslation","jsx","ConnectUpgradeDriveModal","status"],"mappings":"0OAUO,MAAMA,EAAsDC,GAAS,CACxE,KAAM,CAAE,KAAAC,EAAM,QAAAC,EAAS,QAAAC,CAAA,EAAYH,EAE7B,CAAE,EAAAI,CAAA,EAAMC,EAAA,EAQd,OACIC,EAACC,EAAA,CACG,KAAAN,EACA,WATW,IAAM,CAErB,QAAQ,IAAI,kBAAmBE,CAAO,EACtCD,EAAA,CAAQ,EAOJ,OAAQE,EAAE,4BAA4B,EACtC,KAAMA,EAAE,0BAA0B,EAClC,YAAaA,EAAE,eAAe,EAC9B,cAAeA,EAAE,iBAAiB,EAClC,aAAeI,GAAoB,CAC/B,GAAI,CAACA,EAAQ,OAAON,EAAA,CAAQ,CAChC,CAAA,CAGZ"}
@@ -1,6 +1,6 @@
1
- import{jsx as o,jsxs as g,Fragment as b}from"react/jsx-runtime";import*as t from"react";import{useRef as A,useState as h,useEffect as C,useCallback as v,useMemo as k}from"react";import{ay as U,aT as F,aU as I}from"./index.Xt1GtJTP.js";import{G as D,X as N,N as R}from"./index.Cx09-3h-.js";import{l as S,g as M,i as T}from"./useInitSentry.BXZzeAO4.js";import"react-dom";import"react-dom/client";import"./browser.BkwNmV2Z.js";import"./app-skeleton.js";import"./useAcceptedCookies.DHQO4jEL.js";import"./registerServiceWorker.D3pB6TTq.js";const O=e=>t.createElement("svg",{width:28,height:32,viewBox:"0 0 28 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.05092 23.7286L0.000163347 23.9993L0 23.9995L0.207853 24.067L27.6823 24.067L27.9995 23.9995L27.9161 23.6913L14.2182 0.209032L13.9998 0L13.749 0.246353L0.05092 23.7286ZM20.9994 11.9999L7.0003 11.9999L13.9998 23.999L20.9994 11.9999Z",fill:"url(#paint0_radial_319_20865)"}),t.createElement("path",{d:"M14 0L0 23.9998V7.99993L14 0Z",fill:"url(#paint1_linear_319_20865)"}),t.createElement("path",{d:"M28 24L7.82013e-05 24L14 31.9999L28 24Z",fill:"url(#paint2_linear_319_20865)"}),t.createElement("path",{d:"M14 0L28 23.9998V7.99993L14 0Z",fill:"url(#paint3_linear_319_20865)"}),t.createElement("defs",null,t.createElement("radialGradient",{id:"paint0_radial_319_20865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(13.9994 16.0344) rotate(-89.9988) scale(16.0344 16.201)"},t.createElement("stop",{offset:.181008,stopColor:"#FFCD6B"}),t.createElement("stop",{offset:1,stopColor:"#EB5EDF"})),t.createElement("linearGradient",{id:"paint1_linear_319_20865",x1:-.031454,y1:24.041,x2:13.801,y2:-.142908,gradientUnits:"userSpaceOnUse"},t.createElement("stop",{stopColor:"#4331E9"}),t.createElement("stop",{offset:1,stopColor:"#A273FF"})),t.createElement("linearGradient",{id:"paint2_linear_319_20865",x1:-.0310093,y1:24,x2:28.0444,y2:24,gradientUnits:"userSpaceOnUse"},t.createElement("stop",{stopColor:"#A273FF"}),t.createElement("stop",{offset:1,stopColor:"#4331E9"})),t.createElement("linearGradient",{id:"paint3_linear_319_20865",x1:28.0315,y1:24.041,x2:14.199,y2:-.142908,gradientUnits:"userSpaceOnUse"},t.createElement("stop",{stopColor:"#A273FF"}),t.createElement("stop",{offset:1,stopColor:"#4331E9"})))),P=e=>t.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M15.6867 8.03333C15.4933 7.83999 15.1733 7.83999 14.98 8.03333L14.6733 8.34001V8C14.6733 4.32 11.68 1.32666 7.99999 1.32666C5.96666 1.32666 4.06666 2.23999 2.79333 3.82666C2.61999 4.03999 2.65332 4.35999 2.87332 4.52665C3.08666 4.69999 3.40666 4.66666 3.57332 4.44666C4.65999 3.09332 6.27332 2.31999 7.99999 2.31999C11.1267 2.31999 13.6733 4.86666 13.6733 7.99333V8.32666L13.3667 8.02002C13.1733 7.82669 12.8533 7.82669 12.66 8.02002C12.4667 8.21335 12.4667 8.53335 12.66 8.72668L13.82 9.88668C13.8667 9.93334 13.92 9.96666 13.98 9.99333C14.04 10.02 14.1067 10.0333 14.1733 10.0333C14.24 10.0333 14.3 10.02 14.3667 9.99333C14.4267 9.96666 14.48 9.93334 14.5267 9.88668L15.6867 8.72668C15.88 8.54668 15.88 8.22666 15.6867 8.03333Z",fill:"#6C7275"}),t.createElement("path",{d:"M13.1267 11.4666C12.9133 11.2933 12.5933 11.3266 12.4267 11.5466C11.34 12.9 9.72665 13.6733 7.99998 13.6733C4.87332 13.6733 2.32665 11.1266 2.32665 7.99996V7.66663L2.63332 7.97331C2.73332 8.07331 2.85999 8.11996 2.98665 8.11996C3.11332 8.11996 3.23999 8.07331 3.33999 7.97331C3.53332 7.77998 3.53332 7.45998 3.33999 7.26664L2.17998 6.10661C2.13332 6.05994 2.07998 6.02663 2.01998 5.99996C1.89998 5.94663 1.75998 5.94663 1.63998 5.99996C1.57998 6.02663 1.52665 6.05994 1.47999 6.10661L0.319988 7.26664C0.126654 7.45998 0.126654 7.77998 0.319988 7.97331C0.513321 8.16664 0.833319 8.16664 1.02665 7.97331L1.33332 7.66663V7.99996C1.33332 11.68 4.32665 14.6733 8.00665 14.6733C10.04 14.6733 11.94 13.76 13.2133 12.1733C13.38 11.96 13.3467 11.64 13.1267 11.4666Z",fill:"#6C7275"})),Z="https://apps.powerhouse.io/sky-atlas/staging/switchboard",$=2e3;function B(){const{search:e}=T();return k(()=>{const a=new URLSearchParams(e).get("reactorUrl")??Z;return a.endsWith("/")?a:`${a}/`},[e])}async function G(e,s){const a=F`
1
+ import{jsx as o,jsxs as g,Fragment as b}from"react/jsx-runtime";import*as t from"react";import{useRef as A,useState as h,useEffect as C,useCallback as v,useMemo as k}from"react";import{ay as U,aT as F,aU as I}from"./index.Xt1GtJTP.js";import{G as D,X as N,N as R}from"./index.D1VdJrbu.js";import{l as S,g as M,i as T}from"./useInitSentry.Bb28RsdX.js";import"react-dom";import"react-dom/client";import"./browser.BkwNmV2Z.js";import"./app-skeleton.js";import"./useAcceptedCookies.D1uKoy1t.js";import"./registerServiceWorker.BedDSXhk.js";const O=e=>t.createElement("svg",{width:28,height:32,viewBox:"0 0 28 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.05092 23.7286L0.000163347 23.9993L0 23.9995L0.207853 24.067L27.6823 24.067L27.9995 23.9995L27.9161 23.6913L14.2182 0.209032L13.9998 0L13.749 0.246353L0.05092 23.7286ZM20.9994 11.9999L7.0003 11.9999L13.9998 23.999L20.9994 11.9999Z",fill:"url(#paint0_radial_319_20865)"}),t.createElement("path",{d:"M14 0L0 23.9998V7.99993L14 0Z",fill:"url(#paint1_linear_319_20865)"}),t.createElement("path",{d:"M28 24L7.82013e-05 24L14 31.9999L28 24Z",fill:"url(#paint2_linear_319_20865)"}),t.createElement("path",{d:"M14 0L28 23.9998V7.99993L14 0Z",fill:"url(#paint3_linear_319_20865)"}),t.createElement("defs",null,t.createElement("radialGradient",{id:"paint0_radial_319_20865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(13.9994 16.0344) rotate(-89.9988) scale(16.0344 16.201)"},t.createElement("stop",{offset:.181008,stopColor:"#FFCD6B"}),t.createElement("stop",{offset:1,stopColor:"#EB5EDF"})),t.createElement("linearGradient",{id:"paint1_linear_319_20865",x1:-.031454,y1:24.041,x2:13.801,y2:-.142908,gradientUnits:"userSpaceOnUse"},t.createElement("stop",{stopColor:"#4331E9"}),t.createElement("stop",{offset:1,stopColor:"#A273FF"})),t.createElement("linearGradient",{id:"paint2_linear_319_20865",x1:-.0310093,y1:24,x2:28.0444,y2:24,gradientUnits:"userSpaceOnUse"},t.createElement("stop",{stopColor:"#A273FF"}),t.createElement("stop",{offset:1,stopColor:"#4331E9"})),t.createElement("linearGradient",{id:"paint3_linear_319_20865",x1:28.0315,y1:24.041,x2:14.199,y2:-.142908,gradientUnits:"userSpaceOnUse"},t.createElement("stop",{stopColor:"#A273FF"}),t.createElement("stop",{offset:1,stopColor:"#4331E9"})))),P=e=>t.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("path",{d:"M15.6867 8.03333C15.4933 7.83999 15.1733 7.83999 14.98 8.03333L14.6733 8.34001V8C14.6733 4.32 11.68 1.32666 7.99999 1.32666C5.96666 1.32666 4.06666 2.23999 2.79333 3.82666C2.61999 4.03999 2.65332 4.35999 2.87332 4.52665C3.08666 4.69999 3.40666 4.66666 3.57332 4.44666C4.65999 3.09332 6.27332 2.31999 7.99999 2.31999C11.1267 2.31999 13.6733 4.86666 13.6733 7.99333V8.32666L13.3667 8.02002C13.1733 7.82669 12.8533 7.82669 12.66 8.02002C12.4667 8.21335 12.4667 8.53335 12.66 8.72668L13.82 9.88668C13.8667 9.93334 13.92 9.96666 13.98 9.99333C14.04 10.02 14.1067 10.0333 14.1733 10.0333C14.24 10.0333 14.3 10.02 14.3667 9.99333C14.4267 9.96666 14.48 9.93334 14.5267 9.88668L15.6867 8.72668C15.88 8.54668 15.88 8.22666 15.6867 8.03333Z",fill:"#6C7275"}),t.createElement("path",{d:"M13.1267 11.4666C12.9133 11.2933 12.5933 11.3266 12.4267 11.5466C11.34 12.9 9.72665 13.6733 7.99998 13.6733C4.87332 13.6733 2.32665 11.1266 2.32665 7.99996V7.66663L2.63332 7.97331C2.73332 8.07331 2.85999 8.11996 2.98665 8.11996C3.11332 8.11996 3.23999 8.07331 3.33999 7.97331C3.53332 7.77998 3.53332 7.45998 3.33999 7.26664L2.17998 6.10661C2.13332 6.05994 2.07998 6.02663 2.01998 5.99996C1.89998 5.94663 1.75998 5.94663 1.63998 5.99996C1.57998 6.02663 1.52665 6.05994 1.47999 6.10661L0.319988 7.26664C0.126654 7.45998 0.126654 7.77998 0.319988 7.97331C0.513321 8.16664 0.833319 8.16664 1.02665 7.97331L1.33332 7.66663V7.99996C1.33332 11.68 4.32665 14.6733 8.00665 14.6733C10.04 14.6733 11.94 13.76 13.2133 12.1733C13.38 11.96 13.3467 11.64 13.1267 11.4666Z",fill:"#6C7275"})),Z="https://apps.powerhouse.io/sky-atlas/staging/switchboard",$=2e3;function B(){const{search:e}=T();return k(()=>{const a=new URLSearchParams(e).get("reactorUrl")??Z;return a.endsWith("/")?a:`${a}/`},[e])}async function G(e,s){const a=F`
2
2
  mutation ForkAtlas($docId: PHID) {
3
3
  ForkAtlas(docId: $docId)
4
4
  }
5
5
  `;return await I(`${s}graphql`,a,{docId:e})}function ee(){const e=A("initial"),s=R(),{documentId:a}=S(),l=B(),c=M(),{addRemoteDrive:L}=D(),[n,x]=h(void 0),[d,m]=h(void 0),[p,E]=h(!0),u=e.current==="error";C(()=>{d&&(console.error("Error forking Atlas:",d),N("Error forking Atlas",{type:"error"}))},[d]);async function w(r){const i=(await G(r,l)).ForkAtlas;e.current="forked",x(i)}const y=v(()=>{n&&!p&&c(`/d/${n}`,{replace:!0})},[n,c,p]),_=v(async r=>{console.log("Adding remote drive:",r);const f=`${l}d/${r}`;try{const i=await L(f,{sharingType:"PUBLIC",availableOffline:!0,listeners:[{block:!0,callInfo:{data:f,name:"switchboard-push",transmitterType:"SwitchboardPush"},filter:{branch:["main"],documentId:["*"],documentType:["*"],scope:["global"]},label:"Switchboard Sync",listenerId:"1",system:!0}],triggers:[]});e.current="done",console.log("Added remote drive:",i),setTimeout(()=>{E(!1)},$)}catch(i){e.current="error",E(!1),m(i)}},[L,c,l]);return C(()=>{!a||e.current!=="initial"||(e.current="forking",w(a).catch(r=>{e.current="error",m(r)}))},[a,e]),C(()=>{!n||!s||e.current!=="forked"||(e.current="addingDrive",new Promise(r=>{setTimeout(r,500)}).then(()=>_(n)).catch(r=>{e.current="error",m(r)}))},[n,s,e]),o("div",{className:"bg-gray-50 size-full flex justify-center gap-x-4",children:g("div",{className:"bg-white rounded-2xl w-full max-w-[850px] drop-shadow-sm p-6",children:[o("h1",{className:"text-lg text-gray-900 font-medium",children:"Welcome to the Atlas Explorer"}),o("div",{className:"mt-4 bg-gray-50 border border-gray-200 rounded-xl p-6",children:g("div",{className:"bg-slate-50 rounded-2xl min-h-80 flex flex-col justify-center items-center",children:[o("div",{children:o(O,{})}),u?o("div",{className:"text-sm text-gray-800 mt-3",children:"Error forking Atlas scope. Please try again."}):o("div",{className:"text-sm text-gray-500 mt-3",children:"Forking Atlas scope..."}),o(U,{onClick:u?window.location.reload.bind(window.location):y,size:"small",color:"light",className:"bg-white border border-gray-200 h-9 px-3 mt-4 text-gray-600",children:u?"Retry":p?g(b,{children:[o(P,{className:"animate-spin"}),"Loading"]}):"Continue"})]})})]})})}export{ee as AtlasImport};
6
- //# sourceMappingURL=atlas-import.BP-BUgaz.js.map
6
+ //# sourceMappingURL=atlas-import.CE1LkueM.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"atlas-import.BP-BUgaz.js","sources":["../../assets/icons/Atlas-Logomark.svg?react","../../assets/icons/refresh.svg?react","../../src/components/demo/atlas-import.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgAtlasLogomark = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 28, height: 32, viewBox: \"0 0 28 32\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M0.05092 23.7286L0.000163347 23.9993L0 23.9995L0.207853 24.067L27.6823 24.067L27.9995 23.9995L27.9161 23.6913L14.2182 0.209032L13.9998 0L13.749 0.246353L0.05092 23.7286ZM20.9994 11.9999L7.0003 11.9999L13.9998 23.999L20.9994 11.9999Z\", fill: \"url(#paint0_radial_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 0L0 23.9998V7.99993L14 0Z\", fill: \"url(#paint1_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M28 24L7.82013e-05 24L14 31.9999L28 24Z\", fill: \"url(#paint2_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 0L28 23.9998V7.99993L14 0Z\", fill: \"url(#paint3_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"radialGradient\", { id: \"paint0_radial_319_20865\", cx: 0, cy: 0, r: 1, gradientUnits: \"userSpaceOnUse\", gradientTransform: \"translate(13.9994 16.0344) rotate(-89.9988) scale(16.0344 16.201)\" }, /* @__PURE__ */ React.createElement(\"stop\", { offset: 0.181008, stopColor: \"#FFCD6B\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#EB5EDF\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint1_linear_319_20865\", x1: -0.031454, y1: 24.041, x2: 13.801, y2: -0.142908, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#4331E9\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#A273FF\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint2_linear_319_20865\", x1: -0.0310093, y1: 24, x2: 28.0444, y2: 24, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#A273FF\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#4331E9\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint3_linear_319_20865\", x1: 28.0315, y1: 24.041, x2: 14.199, y2: -0.142908, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#A273FF\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#4331E9\" }))));\nexport default SvgAtlasLogomark;\n","import * as React from \"react\";\nconst SvgRefresh = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 16, height: 16, viewBox: \"0 0 16 16\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M15.6867 8.03333C15.4933 7.83999 15.1733 7.83999 14.98 8.03333L14.6733 8.34001V8C14.6733 4.32 11.68 1.32666 7.99999 1.32666C5.96666 1.32666 4.06666 2.23999 2.79333 3.82666C2.61999 4.03999 2.65332 4.35999 2.87332 4.52665C3.08666 4.69999 3.40666 4.66666 3.57332 4.44666C4.65999 3.09332 6.27332 2.31999 7.99999 2.31999C11.1267 2.31999 13.6733 4.86666 13.6733 7.99333V8.32666L13.3667 8.02002C13.1733 7.82669 12.8533 7.82669 12.66 8.02002C12.4667 8.21335 12.4667 8.53335 12.66 8.72668L13.82 9.88668C13.8667 9.93334 13.92 9.96666 13.98 9.99333C14.04 10.02 14.1067 10.0333 14.1733 10.0333C14.24 10.0333 14.3 10.02 14.3667 9.99333C14.4267 9.96666 14.48 9.93334 14.5267 9.88668L15.6867 8.72668C15.88 8.54668 15.88 8.22666 15.6867 8.03333Z\", fill: \"#6C7275\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M13.1267 11.4666C12.9133 11.2933 12.5933 11.3266 12.4267 11.5466C11.34 12.9 9.72665 13.6733 7.99998 13.6733C4.87332 13.6733 2.32665 11.1266 2.32665 7.99996V7.66663L2.63332 7.97331C2.73332 8.07331 2.85999 8.11996 2.98665 8.11996C3.11332 8.11996 3.23999 8.07331 3.33999 7.97331C3.53332 7.77998 3.53332 7.45998 3.33999 7.26664L2.17998 6.10661C2.13332 6.05994 2.07998 6.02663 2.01998 5.99996C1.89998 5.94663 1.75998 5.94663 1.63998 5.99996C1.57998 6.02663 1.52665 6.05994 1.47999 6.10661L0.319988 7.26664C0.126654 7.45998 0.126654 7.77998 0.319988 7.97331C0.513321 8.16664 0.833319 8.16664 1.02665 7.97331L1.33332 7.66663V7.99996C1.33332 11.68 4.32665 14.6733 8.00665 14.6733C10.04 14.6733 11.94 13.76 13.2133 12.1733C13.38 11.96 13.3467 11.64 13.1267 11.4666Z\", fill: \"#6C7275\" }));\nexport default SvgRefresh;\n","import AtlasIcon from '#assets/icons/Atlas-Logomark.svg?react';\nimport RefreshIcon from '#assets/icons/refresh.svg?react';\nimport { useDocumentDriveServer } from '#hooks';\nimport { Button } from '@powerhousedao/design-system';\nimport { useReactor } from '@powerhousedao/state';\nimport { gql, request } from 'graphql-request';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useLocation, useNavigate, useParams } from 'react-router-dom';\nimport { toast } from '../../services/toast';\n\nconst REACTOR_URL = 'https://apps.powerhouse.io/sky-atlas/staging/switchboard';\nconst MIN_LOADING_TIME = 2000;\n\nfunction useReactorUrl() {\n const { search } = useLocation();\n return useMemo(() => {\n const params = new URLSearchParams(search);\n const url = params.get('reactorUrl') ?? REACTOR_URL;\n return url.endsWith('/') ? url : `${url}/`;\n }, [search]);\n}\n\nasync function forkAtlas(\n docId: string,\n reactorUrl: string,\n): Promise<{ ForkAtlas: string }> {\n const document = gql`\n mutation ForkAtlas($docId: PHID) {\n ForkAtlas(docId: $docId)\n }\n `;\n return await request(`${reactorUrl}graphql`, document, { docId });\n}\n\nexport function AtlasImport() {\n const status = useRef<\n 'initial' | 'forking' | 'forked' | 'addingDrive' | 'done' | 'error'\n >('initial');\n const reactor = useReactor();\n const { documentId } = useParams();\n const reactorUrl = useReactorUrl();\n const navigate = useNavigate();\n const { addRemoteDrive } = useDocumentDriveServer();\n const [driveId, setDriveId] = useState<string | undefined>(undefined);\n const [error, setError] = useState<unknown>(undefined);\n const [loading, setLoading] = useState(true);\n const hasError = status.current === 'error';\n\n useEffect(() => {\n if (error) {\n console.error('Error forking Atlas:', error);\n toast('Error forking Atlas', { type: 'error' });\n }\n }, [error]);\n\n async function forkAtlasDocument(documentId: string) {\n const result = await forkAtlas(documentId, reactorUrl);\n const driveId = result.ForkAtlas;\n status.current = 'forked';\n setDriveId(driveId);\n }\n\n const redirectToDrive = useCallback(() => {\n if (driveId && !loading) {\n navigate(`/d/${driveId}`, { replace: true });\n }\n }, [driveId, navigate, loading]);\n\n const addForkDrive = useCallback(\n async (driveId: string) => {\n console.log('Adding remote drive:', driveId);\n const driveUrl = `${reactorUrl}d/${driveId}`;\n try {\n const addedDrive = await addRemoteDrive(driveUrl, {\n sharingType: 'PUBLIC',\n availableOffline: true,\n listeners: [\n {\n block: true,\n callInfo: {\n data: driveUrl,\n name: 'switchboard-push',\n transmitterType: 'SwitchboardPush',\n },\n filter: {\n branch: ['main'],\n documentId: ['*'],\n documentType: ['*'],\n scope: ['global'],\n },\n label: 'Switchboard Sync',\n listenerId: '1',\n system: true,\n },\n ],\n triggers: [],\n });\n status.current = 'done';\n console.log('Added remote drive:', addedDrive);\n setTimeout(() => {\n setLoading(false);\n }, MIN_LOADING_TIME);\n } catch (error) {\n status.current = 'error';\n setLoading(false);\n setError(error);\n }\n },\n [addRemoteDrive, navigate, reactorUrl],\n );\n\n useEffect(() => {\n if (!documentId || status.current !== 'initial') return;\n status.current = 'forking';\n forkAtlasDocument(documentId).catch(error => {\n status.current = 'error';\n setError(error);\n });\n }, [documentId, status]);\n\n useEffect(() => {\n if (!driveId || !reactor || status.current !== 'forked') return;\n status.current = 'addingDrive';\n new Promise<void>(resolve => {\n setTimeout(resolve, 500);\n })\n .then(() => addForkDrive(driveId))\n .catch(error => {\n status.current = 'error';\n setError(error);\n });\n }, [driveId, reactor, status]);\n\n return (\n <div className=\"bg-gray-50 size-full flex justify-center gap-x-4\">\n <div className=\"bg-white rounded-2xl w-full max-w-[850px] drop-shadow-sm p-6\">\n <h1 className=\"text-lg text-gray-900 font-medium\">\n Welcome to the Atlas Explorer\n </h1>\n <div className=\"mt-4 bg-gray-50 border border-gray-200 rounded-xl p-6\">\n <div className=\"bg-slate-50 rounded-2xl min-h-80 flex flex-col justify-center items-center\">\n <div>\n <AtlasIcon />\n </div>\n {hasError ? (\n <div className=\"text-sm text-gray-800 mt-3\">\n Error forking Atlas scope. Please try again.\n </div>\n ) : (\n <div className=\"text-sm text-gray-500 mt-3\">\n Forking Atlas scope...\n </div>\n )}\n <Button\n onClick={\n hasError\n ? window.location.reload.bind(\n window.location,\n )\n : redirectToDrive\n }\n size=\"small\"\n color=\"light\"\n className=\"bg-white border border-gray-200 h-9 px-3 mt-4 text-gray-600\"\n >\n {hasError ? (\n 'Retry'\n ) : loading ? (\n <>\n <RefreshIcon className=\"animate-spin\" />\n Loading\n </>\n ) : (\n 'Continue'\n )}\n </Button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"names":["SvgAtlasLogomark","props","React","SvgRefresh","REACTOR_URL","MIN_LOADING_TIME","useReactorUrl","search","useLocation","useMemo","url","forkAtlas","docId","reactorUrl","document","gql","request","AtlasImport","status","useRef","reactor","useReactor","documentId","useParams","navigate","useNavigate","addRemoteDrive","useDocumentDriveServer","driveId","setDriveId","useState","error","setError","loading","setLoading","hasError","useEffect","toast","forkAtlasDocument","redirectToDrive","useCallback","addForkDrive","driveUrl","addedDrive","resolve","jsxs","jsx","AtlasIcon","Button","Fragment","RefreshIcon"],"mappings":"uhBACA,MAAMA,EAAoBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,SAAU,UAAW,SAAU,UAAW,EAAG,2OAA4O,KAAM,+BAA+B,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,EAAG,gCAAiC,KAAM,gCAAiC,EAAmBA,EAAM,cAAc,OAAQ,CAAE,EAAG,0CAA2C,KAAM,+BAA+B,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,EAAG,iCAAkC,KAAM,+BAA+B,CAAE,EAAmBA,EAAM,cAAc,OAAQ,KAAsBA,EAAM,cAAc,iBAAkB,CAAE,GAAI,0BAA2B,GAAI,EAAG,GAAI,EAAG,EAAG,EAAG,cAAe,iBAAkB,kBAAmB,mEAAmE,EAAoBA,EAAM,cAAc,OAAQ,CAAE,OAAQ,QAAU,UAAW,SAAS,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,OAAQ,EAAG,UAAW,SAAS,CAAE,CAAC,EAAmBA,EAAM,cAAc,iBAAkB,CAAE,GAAI,0BAA2B,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I,UAAU,6BAA6B,SAAA,yBAE5C,EAEJA,EAACE,EAAA,CACG,QACIb,EACM,OAAO,SAAS,OAAO,KACnB,OAAO,QAAA,EAEXI,EAEV,KAAK,QACL,MAAM,QACN,UAAU,8DAET,SAAAJ,EACG,QACAF,EACAY,EAAAI,EAAA,CACI,SAAA,CAAAH,EAACI,EAAA,CAAY,UAAU,cAAA,CAAe,EAAE,SAAA,CAAA,CAE5C,EAEA,UAAA,CAAA,CAER,CAAA,CACJ,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,CACJ,CAER"}
1
+ {"version":3,"file":"atlas-import.CE1LkueM.js","sources":["../../assets/icons/Atlas-Logomark.svg?react","../../assets/icons/refresh.svg?react","../../src/components/demo/atlas-import.tsx"],"sourcesContent":["import * as React from \"react\";\nconst SvgAtlasLogomark = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 28, height: 32, viewBox: \"0 0 28 32\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { fillRule: \"evenodd\", clipRule: \"evenodd\", d: \"M0.05092 23.7286L0.000163347 23.9993L0 23.9995L0.207853 24.067L27.6823 24.067L27.9995 23.9995L27.9161 23.6913L14.2182 0.209032L13.9998 0L13.749 0.246353L0.05092 23.7286ZM20.9994 11.9999L7.0003 11.9999L13.9998 23.999L20.9994 11.9999Z\", fill: \"url(#paint0_radial_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 0L0 23.9998V7.99993L14 0Z\", fill: \"url(#paint1_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M28 24L7.82013e-05 24L14 31.9999L28 24Z\", fill: \"url(#paint2_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M14 0L28 23.9998V7.99993L14 0Z\", fill: \"url(#paint3_linear_319_20865)\" }), /* @__PURE__ */ React.createElement(\"defs\", null, /* @__PURE__ */ React.createElement(\"radialGradient\", { id: \"paint0_radial_319_20865\", cx: 0, cy: 0, r: 1, gradientUnits: \"userSpaceOnUse\", gradientTransform: \"translate(13.9994 16.0344) rotate(-89.9988) scale(16.0344 16.201)\" }, /* @__PURE__ */ React.createElement(\"stop\", { offset: 0.181008, stopColor: \"#FFCD6B\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#EB5EDF\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint1_linear_319_20865\", x1: -0.031454, y1: 24.041, x2: 13.801, y2: -0.142908, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#4331E9\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#A273FF\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint2_linear_319_20865\", x1: -0.0310093, y1: 24, x2: 28.0444, y2: 24, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#A273FF\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#4331E9\" })), /* @__PURE__ */ React.createElement(\"linearGradient\", { id: \"paint3_linear_319_20865\", x1: 28.0315, y1: 24.041, x2: 14.199, y2: -0.142908, gradientUnits: \"userSpaceOnUse\" }, /* @__PURE__ */ React.createElement(\"stop\", { stopColor: \"#A273FF\" }), /* @__PURE__ */ React.createElement(\"stop\", { offset: 1, stopColor: \"#4331E9\" }))));\nexport default SvgAtlasLogomark;\n","import * as React from \"react\";\nconst SvgRefresh = (props) => /* @__PURE__ */ React.createElement(\"svg\", { width: 16, height: 16, viewBox: \"0 0 16 16\", fill: \"none\", xmlns: \"http://www.w3.org/2000/svg\", ...props }, /* @__PURE__ */ React.createElement(\"path\", { d: \"M15.6867 8.03333C15.4933 7.83999 15.1733 7.83999 14.98 8.03333L14.6733 8.34001V8C14.6733 4.32 11.68 1.32666 7.99999 1.32666C5.96666 1.32666 4.06666 2.23999 2.79333 3.82666C2.61999 4.03999 2.65332 4.35999 2.87332 4.52665C3.08666 4.69999 3.40666 4.66666 3.57332 4.44666C4.65999 3.09332 6.27332 2.31999 7.99999 2.31999C11.1267 2.31999 13.6733 4.86666 13.6733 7.99333V8.32666L13.3667 8.02002C13.1733 7.82669 12.8533 7.82669 12.66 8.02002C12.4667 8.21335 12.4667 8.53335 12.66 8.72668L13.82 9.88668C13.8667 9.93334 13.92 9.96666 13.98 9.99333C14.04 10.02 14.1067 10.0333 14.1733 10.0333C14.24 10.0333 14.3 10.02 14.3667 9.99333C14.4267 9.96666 14.48 9.93334 14.5267 9.88668L15.6867 8.72668C15.88 8.54668 15.88 8.22666 15.6867 8.03333Z\", fill: \"#6C7275\" }), /* @__PURE__ */ React.createElement(\"path\", { d: \"M13.1267 11.4666C12.9133 11.2933 12.5933 11.3266 12.4267 11.5466C11.34 12.9 9.72665 13.6733 7.99998 13.6733C4.87332 13.6733 2.32665 11.1266 2.32665 7.99996V7.66663L2.63332 7.97331C2.73332 8.07331 2.85999 8.11996 2.98665 8.11996C3.11332 8.11996 3.23999 8.07331 3.33999 7.97331C3.53332 7.77998 3.53332 7.45998 3.33999 7.26664L2.17998 6.10661C2.13332 6.05994 2.07998 6.02663 2.01998 5.99996C1.89998 5.94663 1.75998 5.94663 1.63998 5.99996C1.57998 6.02663 1.52665 6.05994 1.47999 6.10661L0.319988 7.26664C0.126654 7.45998 0.126654 7.77998 0.319988 7.97331C0.513321 8.16664 0.833319 8.16664 1.02665 7.97331L1.33332 7.66663V7.99996C1.33332 11.68 4.32665 14.6733 8.00665 14.6733C10.04 14.6733 11.94 13.76 13.2133 12.1733C13.38 11.96 13.3467 11.64 13.1267 11.4666Z\", fill: \"#6C7275\" }));\nexport default SvgRefresh;\n","import AtlasIcon from '#assets/icons/Atlas-Logomark.svg?react';\nimport RefreshIcon from '#assets/icons/refresh.svg?react';\nimport { useDocumentDriveServer } from '#hooks';\nimport { Button } from '@powerhousedao/design-system';\nimport { useReactor } from '@powerhousedao/state';\nimport { gql, request } from 'graphql-request';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { useLocation, useNavigate, useParams } from 'react-router-dom';\nimport { toast } from '../../services/toast';\n\nconst REACTOR_URL = 'https://apps.powerhouse.io/sky-atlas/staging/switchboard';\nconst MIN_LOADING_TIME = 2000;\n\nfunction useReactorUrl() {\n const { search } = useLocation();\n return useMemo(() => {\n const params = new URLSearchParams(search);\n const url = params.get('reactorUrl') ?? REACTOR_URL;\n return url.endsWith('/') ? url : `${url}/`;\n }, [search]);\n}\n\nasync function forkAtlas(\n docId: string,\n reactorUrl: string,\n): Promise<{ ForkAtlas: string }> {\n const document = gql`\n mutation ForkAtlas($docId: PHID) {\n ForkAtlas(docId: $docId)\n }\n `;\n return await request(`${reactorUrl}graphql`, document, { docId });\n}\n\nexport function AtlasImport() {\n const status = useRef<\n 'initial' | 'forking' | 'forked' | 'addingDrive' | 'done' | 'error'\n >('initial');\n const reactor = useReactor();\n const { documentId } = useParams();\n const reactorUrl = useReactorUrl();\n const navigate = useNavigate();\n const { addRemoteDrive } = useDocumentDriveServer();\n const [driveId, setDriveId] = useState<string | undefined>(undefined);\n const [error, setError] = useState<unknown>(undefined);\n const [loading, setLoading] = useState(true);\n const hasError = status.current === 'error';\n\n useEffect(() => {\n if (error) {\n console.error('Error forking Atlas:', error);\n toast('Error forking Atlas', { type: 'error' });\n }\n }, [error]);\n\n async function forkAtlasDocument(documentId: string) {\n const result = await forkAtlas(documentId, reactorUrl);\n const driveId = result.ForkAtlas;\n status.current = 'forked';\n setDriveId(driveId);\n }\n\n const redirectToDrive = useCallback(() => {\n if (driveId && !loading) {\n navigate(`/d/${driveId}`, { replace: true });\n }\n }, [driveId, navigate, loading]);\n\n const addForkDrive = useCallback(\n async (driveId: string) => {\n console.log('Adding remote drive:', driveId);\n const driveUrl = `${reactorUrl}d/${driveId}`;\n try {\n const addedDrive = await addRemoteDrive(driveUrl, {\n sharingType: 'PUBLIC',\n availableOffline: true,\n listeners: [\n {\n block: true,\n callInfo: {\n data: driveUrl,\n name: 'switchboard-push',\n transmitterType: 'SwitchboardPush',\n },\n filter: {\n branch: ['main'],\n documentId: ['*'],\n documentType: ['*'],\n scope: ['global'],\n },\n label: 'Switchboard Sync',\n listenerId: '1',\n system: true,\n },\n ],\n triggers: [],\n });\n status.current = 'done';\n console.log('Added remote drive:', addedDrive);\n setTimeout(() => {\n setLoading(false);\n }, MIN_LOADING_TIME);\n } catch (error) {\n status.current = 'error';\n setLoading(false);\n setError(error);\n }\n },\n [addRemoteDrive, navigate, reactorUrl],\n );\n\n useEffect(() => {\n if (!documentId || status.current !== 'initial') return;\n status.current = 'forking';\n forkAtlasDocument(documentId).catch(error => {\n status.current = 'error';\n setError(error);\n });\n }, [documentId, status]);\n\n useEffect(() => {\n if (!driveId || !reactor || status.current !== 'forked') return;\n status.current = 'addingDrive';\n new Promise<void>(resolve => {\n setTimeout(resolve, 500);\n })\n .then(() => addForkDrive(driveId))\n .catch(error => {\n status.current = 'error';\n setError(error);\n });\n }, [driveId, reactor, status]);\n\n return (\n <div className=\"bg-gray-50 size-full flex justify-center gap-x-4\">\n <div className=\"bg-white rounded-2xl w-full max-w-[850px] drop-shadow-sm p-6\">\n <h1 className=\"text-lg text-gray-900 font-medium\">\n Welcome to the Atlas Explorer\n </h1>\n <div className=\"mt-4 bg-gray-50 border border-gray-200 rounded-xl p-6\">\n <div className=\"bg-slate-50 rounded-2xl min-h-80 flex flex-col justify-center items-center\">\n <div>\n <AtlasIcon />\n </div>\n {hasError ? (\n <div className=\"text-sm text-gray-800 mt-3\">\n Error forking Atlas scope. Please try again.\n </div>\n ) : (\n <div className=\"text-sm text-gray-500 mt-3\">\n Forking Atlas scope...\n </div>\n )}\n <Button\n onClick={\n hasError\n ? window.location.reload.bind(\n window.location,\n )\n : redirectToDrive\n }\n size=\"small\"\n color=\"light\"\n className=\"bg-white border border-gray-200 h-9 px-3 mt-4 text-gray-600\"\n >\n {hasError ? (\n 'Retry'\n ) : loading ? (\n <>\n <RefreshIcon className=\"animate-spin\" />\n Loading\n </>\n ) : (\n 'Continue'\n )}\n </Button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n"],"names":["SvgAtlasLogomark","props","React","SvgRefresh","REACTOR_URL","MIN_LOADING_TIME","useReactorUrl","search","useLocation","useMemo","url","forkAtlas","docId","reactorUrl","document","gql","request","AtlasImport","status","useRef","reactor","useReactor","documentId","useParams","navigate","useNavigate","addRemoteDrive","useDocumentDriveServer","driveId","setDriveId","useState","error","setError","loading","setLoading","hasError","useEffect","toast","forkAtlasDocument","redirectToDrive","useCallback","addForkDrive","driveUrl","addedDrive","resolve","jsxs","jsx","AtlasIcon","Button","Fragment","RefreshIcon"],"mappings":"uhBACA,MAAMA,EAAoBC,GAA0BC,EAAM,cAAc,MAAO,CAAE,MAAO,GAAI,OAAQ,GAAI,QAAS,YAAa,KAAM,OAAQ,MAAO,6BAA8B,GAAGD,CAAK,EAAoBC,EAAM,cAAc,OAAQ,CAAE,SAAU,UAAW,SAAU,UAAW,EAAG,2OAA4O,KAAM,+BAA+B,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,EAAG,gCAAiC,KAAM,gCAAiC,EAAmBA,EAAM,cAAc,OAAQ,CAAE,EAAG,0CAA2C,KAAM,+BAA+B,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,EAAG,iCAAkC,KAAM,+BAA+B,CAAE,EAAmBA,EAAM,cAAc,OAAQ,KAAsBA,EAAM,cAAc,iBAAkB,CAAE,GAAI,0BAA2B,GAAI,EAAG,GAAI,EAAG,EAAG,EAAG,cAAe,iBAAkB,kBAAmB,mEAAmE,EAAoBA,EAAM,cAAc,OAAQ,CAAE,OAAQ,QAAU,UAAW,SAAS,CAAE,EAAmBA,EAAM,cAAc,OAAQ,CAAE,OAAQ,EAAG,UAAW,SAAS,CAAE,CAAC,EAAmBA,EAAM,cAAc,iBAAkB,CAAE,GAAI,0BAA2B,GAAI,SAAW,GAAI,OAAQ,GA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5C,EAEJA,EAACE,EAAA,CACG,QACIb,EACM,OAAO,SAAS,OAAO,KACnB,OAAO,QAAA,EAEXI,EAEV,KAAK,QACL,MAAM,QACN,UAAU,8DAET,SAAAJ,EACG,QACAF,EACAY,EAAAI,EAAA,CACI,SAAA,CAAAH,EAACI,EAAA,CAAY,UAAU,cAAA,CAAe,EAAE,SAAA,CAAA,CAE5C,EAEA,UAAA,CAAA,CAER,CAAA,CACJ,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,CACJ,CAER"}
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index.CbJoiyjo.js","./index.Xt1GtJTP.js","./style-BkLV0sfQ.css"])))=>i.map(i=>d[i]);
2
- import{jsx as d,jsxs as C,Fragment as ft}from"react/jsx-runtime";import mt,{createContext as ce,useContext as le,useRef as q,useState as F,useCallback as b,useEffect as M,useMemo as I,Suspense as ht,useLayoutEffect as pt}from"react";import{o as yt,d as ue,p as gt,e as vt,q as wt,f as bt,t as Dt,i as j,v as _,w as Et,x as St,y as fe,z as me,A as he,B as W,C as Oe,D as Pe,E as Re,F as ze,G as $,H as Nt,I as xt,J as Q,K as Ct,L as At,g as Lt,M as kt,N as Tt,O as Ft,P as It,Q as Mt,S as Ht,u as Ot}from"./index.Cx09-3h-.js";import{av as Pt,aw as Rt,ax as zt,_ as Ce,ay as V,az as Bt,aA as Ae,aB as _t,aC as G,aD as Be,aE as Le,aF as Kt,aG as Ut,aH as K,aI as Vt,aJ as $t,ad as jt,af as Wt,aK as Gt,aL as _e,aM as Ke,aN as qt,aO as Qt,l as Ue,z as Jt,x as Xt,H as Yt,aP as Zt,aQ as en}from"./index.Xt1GtJTP.js";import{E as Ve,u as tn,a as nn,D as on}from"./modals.C51Hau9T.js";import{u as rn}from"./useDefaultDocumentModelEditor.rOh8o4If.js";import{c as $e,d as sn,D as ne,A as oe,f as an,g as dn,i as cn}from"./useInitSentry.BXZzeAO4.js";import{useModal as J}from"./modal.Bqyzi2Hr.js";import{u as ln,a as un,b as pe,c as fn,d as X,e as ye,f as mn,g as hn,h as pn,i as yn,j as gn}from"./nodes.CNC9HfbA.js";import"react-dom/client";import"./browser.BkwNmV2Z.js";import"./app-skeleton.js";import"react-dom";import"./i18next.CqOP20KE.js";import"./useAcceptedCookies.DHQO4jEL.js";import"./registerServiceWorker.D3pB6TTq.js";const vn=e=>window.open(e,"_blank");var He;const wn=((He=window.electronAPI)==null?void 0:He.openURL)??vn,je=e=>{const t=[];if(e.header.documentType!=="powerhouse/document-model")return t;const n=e,o=n.state.global.specifications[0],r=Object.keys(o.state).reduce((l,u)=>{const c=u;return[...l,...Pt(o.state[c].initialValue,c!=="global").map(p=>({...p,message:`${p.message}. Scope: ${c}`,details:{...p.details,scope:c}}))]},[]),a=Object.keys(o.state).reduce((l,u)=>{var g;const c=u,p=c==="global";return[...l,...Rt(o.state[c].schema,n.header.name||((g=n.state.global)==null?void 0:g.name)||"",p?"":c,!p).map(y=>({...y,message:`${y.message}. Scope: ${c}`,details:{...y.details,scope:c}}))]},[]),i=zt(o.modules);return[...r,...a,...i]},We=yt("theme","light",e=>{var t;typeof window<"u"&&((t=window.electronAPI)==null||t.setTheme(e))});async function bn(){const e=await Ce(()=>import("./index.CbJoiyjo.js"),__vite__mapDeps([0,1]),import.meta.url);return await Ce(()=>Promise.resolve({}),__vite__mapDeps([2]),import.meta.url),[e.documentModelEditorModule]}function Dn(e){return e.map(t=>t.editors).reduce((t,n)=>t.concat(n),[])}const Ge=wt(bn);Ge.debugLabel="baseEditorsAtomInConnect";const ge=vt(async e=>{const t=await e(Ge),n=await e(bt);return Dn(n).concat(t)});ge.debugLabel="editorsAtomInConnect";const qe=gt(ge);qe.debugLabel="unwrappedEditorsAtomInConnect";const En=Dt(ge);En.debugLabel="loadableEditorsAtomInConnect";const Sn=()=>ue(qe),Nn=(e,t,n)=>{if(!e)return null;const o=t.find(a=>a.config.id===n&&a.documentTypes.includes(e));return o||t.find(a=>a.documentTypes.includes(e))||t.find(a=>a.documentTypes.includes("*"))||null},Qe=()=>{const e=Sn(),[t]=rn();return n=>e?Nn(n,e,t.value):void 0},Je=ce(void 0),xn=({value:e,children:t})=>d(Je.Provider,{value:e,children:t});function Cn(){const e=le(Je);if(!e)throw new Error("useDriveContext must be used within a DriveContextProvider");return e}function An(e){return"documentModelState"in e?e.documentModelState:e.documentModel}const Ln=({documentModels:e,createDocument:t})=>C("div",{className:"px-6",children:[d("h3",{className:"mb-3 mt-4 text-xl font-bold text-gray-600",children:"New document"}),d("div",{className:"flex w-full flex-wrap gap-4",children:e==null?void 0:e.map(n=>{const o=An(n);return d(V,{color:"light",title:o.name,"aria-description":o.description,onClick:()=>t(n),children:d("span",{className:"text-sm",children:o.name})},o.id)})})]}),U=8,re=256,ke=48,kn=420;function Tn(e){const t=q(null),{t:n}=j(),o=Bt(),{fileNodes:r}=e,a=o.innerWidth-kn,i=Math.floor(a/(re+U))||1,l=Math.ceil(r.length/i),u=Ae({count:l,getScrollElement:()=>t.current,estimateSize:s=>s>0?ke+U:ke,overscan:5}),c=Ae({horizontal:!0,count:i,getScrollElement:()=>t.current,estimateSize:s=>s>0?re+U:re,overscan:5}),p=(s,m)=>s*i+m,g=(s,m)=>{const v=p(s,m);return r[v]||null};if(r.length===0)return d("div",{className:"mb-8 text-sm text-gray-400",children:n("folderView.sections.documents.empty",{defaultValue:"No documents or files 📄"})});const y=(s,m)=>{const v=g(s,m);return v?d("div",{style:{marginLeft:m===0?0:U},children:d(_t,{fileNode:v,...e},v.id)}):null};return d("div",{ref:t,style:{height:"400px",width:"100%",overflow:"auto"},children:d("div",{style:{height:`${u.getTotalSize()}px`,width:`${c.getTotalSize()}px`,position:"relative"},children:u.getVirtualItems().map(s=>d(mt.Fragment,{children:c.getVirtualItems().map(m=>d("div",{style:{position:"absolute",top:0,left:0,marginTop:s.index===0?0:U,width:`${m.size}px`,height:`${s.size}px`,transform:`translateX(${m.start}px) translateY(${s.start}px)`},children:y(s.index,m.index)},m.key))},s.key))})})}function k({children:e,className:t,...n}){return d(k.Container,{className:t,...n,children:e})}k.Container=function({children:t,className:n,containerProps:o,...r}){return d("div",{className:G("flex grow flex-col overflow-auto rounded-2xl bg-gray-50 p-2",n),...o,...r,children:t})};k.Header=function({children:t,className:n,containerProps:o,...r}){return d("div",{className:G("flex-0",n),...o,...r,children:t})};k.Content=function({children:t,className:n,containerProps:o,...r}){return d("div",{className:G("mb-5 flex-1 px-4",n),...o,...r,children:t})};k.ContentSection=function({title:t,children:n,className:o,containerProps:r,...a}){return C("div",{className:G(o),...r,...a,children:[t&&d("div",{className:"mb-4 text-base font-semibold text-gray-600",children:t}),d("div",{className:"flex flex-wrap gap-2",children:n})]})};k.Footer=function({children:t,className:n,containerProps:o,...r}){return d("div",{className:G("flex-0",n),...o,...r,children:t})};function Fn(e){const{node:t,isAllowedToCreateDocuments:n,className:o,containerProps:r,sharingType:a,getSyncStatusSync:i,setSelectedNode:l,onAddFile:u,onCopyNode:c,onMoveNode:p,onRenameNode:g,onDuplicateNode:y,onAddFolder:s,onAddAndSelectNewFolder:m,showDeleteNodeModal:v}=e,{t:h}=j(),f=ln(t==null?void 0:t.id),w=un(t==null?void 0:t.id),{isDropTarget:D,dropProps:A}=Be({node:t,onAddFile:u,onCopyNode:c,onMoveNode:p});return C("div",{className:Le("rounded-md border-2 border-transparent p-2",D&&"border-dashed border-blue-100",o),...r,...A,children:[d(k.ContentSection,{title:h("folderView.sections.folders.title",{defaultValue:"Folders"}),className:"mb-4",children:f.length>0?f.map(S=>d(Kt,{folderNode:S,isAllowedToCreateDocuments:n,sharingType:a,getSyncStatusSync:i,setSelectedNode:l,onAddFile:u,onCopyNode:c,onMoveNode:p,onRenameNode:g,onDuplicateNode:y,onAddFolder:s,onAddAndSelectNewFolder:m,showDeleteNodeModal:v},S.id)):d("div",{className:"mb-8 text-sm text-gray-400",children:h("folderView.sections.folders.empty",{defaultValue:"No documents or files 📄"})})}),d(k.ContentSection,{title:h("folderView.sections.documents.title",{defaultValue:"Documents and files"}),children:d("div",{className:Le("w-full",w.length>0?"min-h-[400px]":"min-h-14"),children:d(Tn,{fileNodes:w,isAllowedToCreateDocuments:n,sharingType:a,getSyncStatusSync:i,setSelectedNode:l,showDeleteNodeModal:v,onAddFile:u,onCopyNode:c,onMoveNode:p,onRenameNode:g,onDuplicateNode:y,onAddFolder:s,onAddAndSelectNewFolder:m})})})]})}const In=[{id:"project",label:".project",icon:d(K,{name:"Project",color:"#FF6A55",size:16})},{id:"budget",label:".budget",icon:d(K,{name:"BarChart",color:"#8E55EA",size:16})},{id:"profile",label:".profile",icon:d(K,{name:"Person",color:"#3E90F0",size:16})},{id:"legal",label:".legal",icon:d(K,{name:"Briefcase",color:"#4BAB71",size:16})},{id:"atlas",label:".Atlas",icon:d(K,{name:"Globe",color:"#FF8A00",size:16})}],Mn=()=>{const{t:e}=j(),[t,n]=F("");return d(Ut,{className:"max-w-searchbar-width m-4 shrink-0 bg-gray-100",placeholder:e("searchbar.placeholder"),filterLabel:e("searchbar.filterLabel"),filterItems:In,value:t,onChange:n})};function Hn(e){const{document:t,className:n,children:o}=e,{showSearchBar:r,isAllowedToCreateDocuments:a,documentModels:i,getSyncStatusSync:l,showCreateDocumentModal:u,onRenameNode:c,onDuplicateNode:p,onAddFolder:g,onAddFile:y,onCopyNode:s,onMoveNode:m,onAddAndSelectNewFolder:v,showDeleteNodeModal:h}=Cn(),f=_(),w=pe(),D=St(f),A=fn(),S=X(),E=b(T=>{u(T)},[u]),{isDropTarget:N,dropProps:L}=Be({node:D,onAddFile:y,onCopyNode:s,onMoveNode:m}),{breadcrumbs:x,onBreadcrumbSelected:H}=Vt({selectedNodePath:A,setSelectedNode:S}),R=Et(t);return f?C(k,{className:n,children:[o,C(k.Header,{children:[d($t,{breadcrumbs:x,createEnabled:a,onCreate:v,onBreadcrumbSelected:H}),r&&d(Mn,{})]}),d(k.Content,{...L,className:N?"rounded-xl bg-blue-100":"",children:d(Fn,{node:w??D,sharingType:R,getSyncStatusSync:l,setSelectedNode:S,onRenameNode:c,onDuplicateNode:p,onAddFolder:g,onAddFile:y,onCopyNode:s,onMoveNode:m,onAddAndSelectNewFolder:v,showDeleteNodeModal:h,isAllowedToCreateDocuments:a})}),d(k.Footer,{children:a&&d(Ln,{documentModels:i,createDocument:E})})]}):d("div",{children:"Drive not found"})}function On(e){return d(xn,{value:e.context,children:d(Hn,{...e})})}const Pn={Component:On};function Rn(e){const{queryFn:t,...n}=e,{data:o}=$e(),{data:r}=sn(),a="enabled"in n?n.enabled:!!o&&!!r;return Wt({...n,enabled:a,queryFn:async()=>{if(!o||!r)throw new Error("No analytics store available. Use within an AnalyticsProvider.");return await t({store:o,engine:r})}})}const zn=200;function Bn(e,t){const{data:n}=$e(),o=jt(),r=(t==null?void 0:t.sources)??[],a=Rn({queryKey:["analytics","query",e],queryFn:({engine:i})=>i.execute(e),...t});return M(()=>{if(!r.length||!n)return;const i=new Array;let l=null;const u=()=>{l&&clearTimeout(l),l=setTimeout(()=>{o.invalidateQueries({queryKey:["analytics","query",e]}).catch(c=>{console.error(c)})},zn)};return r.forEach(c=>{const p=n.subscribeToSource(c,u);i.push(p)}),()=>{i.forEach(c=>c())}},[e,n,r]),a}const Te=e=>e<=0?0:e>0&&e<=50?1:e>50&&e<=100?2:e>100&&e<=250?3:4;function _n(e){if(!e.length)return[];const t=[];return e.forEach((n,o)=>{if(t.push(n),o<e.length-1){const r=new Date(n.startDate),a=new Date(e[o+1].startDate),i=r.getHours(),l=a.getHours(),u=r.toDateString(),c=a.toDateString();(u!==c||u===c&&Math.abs(l-i)>1)&&t.push({id:`divider-${n.id}-${e[o+1].id}`,type:"divider",revision:0})}}),t}function Kn(e){if(!e)return[];const t=e.sort((n,o)=>{const r=new Date(n.start),a=new Date(o.start);return r.getTime()-a.getTime()}).filter(n=>n.rows.every(o=>o.value>0)).map(n=>{const{additions:o,deletions:r}=n.rows.reduce((i,l)=>(l.dimensions.changes.path==="ph/diff/changes/add"?i.additions+=l.value:l.dimensions.changes.path==="ph/diff/changes/remove"&&(i.deletions+=l.value),i),{additions:0,deletions:0}),a=new Date(n.start);return{id:a.toISOString(),type:"bar",addSize:Te(o),delSize:Te(r),additions:o,deletions:r,timestamp:a.toISOString(),startDate:a,endDate:new Date(n.end),revision:0}});return _n(t)}const Un=(e,t,n)=>{const o=t?ne.fromISO(t):ne.now().startOf("day");return Bn({start:o,end:ne.now().endOf("day"),granularity:an.Hourly,metrics:["Count"],select:{changes:[oe.fromString("ph/diff/changes")],document:[oe.fromString(`ph/diff/document/${e}`)]},lod:{changes:4}},{sources:[oe.fromString(`ph/diff/${n}/${e}`)],select:Kn})},Vn=(e,t,n=[])=>{if(!e||!t)return 0;const o=n.find(r=>{const a=new Date(r.timestamp);return a>=e&&a<=t});return o?o.index:0};function Fe(e){const[t,n]=F(!1);if(M(()=>{setTimeout(()=>{n(!0)},e.loadingTimeout??200)},[e]),!t)return null;const{customEditorLoader:o,...r}=e;return o?d(ft,{children:o}):d(Gt,{...r})}function ae({message:e}){return d("div",{className:"flex size-full items-center justify-center",children:d("h3",{className:"text-lg font-semibold",children:e})})}function $n(e){const t=e.error instanceof Error?e.error.message:e.error;return d(ae,{message:t})}const jn=e=>{const{document:t,onClose:n,onExport:o,onAddOperation:r,onOpenSwitchboardLink:a}=e,i=t.header.id,[l,u]=F(null),[c,p]=F(!1),g=ue(We),y=fe()||void 0,s=me(),{sign:m}=he(),v=W(),h=Qe(),f=t.header.documentType,w=I(()=>f?v(f):void 0,[f,v]),D=I(()=>f?h(f):void 0,[f,h]),[,A,S]=Oe(w==null?void 0:w.reducer,t),E=I(()=>({theme:g,user:y}),[g,y]),N=Pe(),L=Un(i,t.header.createdAtUtcIso),x=b((B,te)=>{const dt=(Ne,ct)=>{if(!i)return;const{prevState:lt}=ct;ze(Ne,m,i,lt,w==null?void 0:w.reducer,y).then(ut=>{var xe;return(xe=window.documentEditorDebugTools)==null||xe.pushOperation(Ne),r(ut)}).catch(Ue.error)};A(Re(B,s,y),dt,te)},[A,s,w==null?void 0:w.reducer,r,i,m,y]),H=b(()=>p(!0),[]),R=b(()=>p(!1),[]),T=b(()=>{x(_e())},[x]),Y=b(()=>{x(Ke())},[x]),nt=D===void 0||D&&!D.documentTypes.includes(t.header.documentType)&&!D.documentTypes.includes("*"),Z=t.header.revision.global>0||t.header.revision.local>0,ee=!!(t!=null&&t.clipboard.length);So({undo:T,redo:Y,canUndo:Z,canRedo:ee}),M(()=>()=>{var B;(B=window.documentEditorDebugTools)==null||B.clear()},[]);const we=dn(),{showModal:be}=J(),[z,De]=F(void 0);M(()=>{z&&z.documentId!==i&&De(void 0)},[z,i]);const ot=b((B,te)=>{De({error:B,documentId:i,info:te})},[i]);if(nt)return d(Fe,{message:"Loading editor"});if(!w)return d(ae,{message:C("div",{className:"text-center leading-10",children:[C("p",{children:['Unable to open the document because the document model "',f,'" is not supported.']}),C("p",{children:["Go to the"," ",d("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{be("settingsModal",{onRefresh:()=>we(0)})},children:"package manager"})," ","to install this document model"]})]})});if(!D)return d(ae,{message:C("div",{className:"text-center leading-10",children:[d("p",{children:"Unable to open the document because no editor has been found"}),C("p",{children:["Go to the"," ",d("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{be("settingsModal",{onRefresh:()=>we(0)})},children:"package manager"})," ",'an editor for the "$',f,'" document type']})]})});const rt=D.Component,{disableExternalControls:Ee,documentToolbarEnabled:st,showSwitchboardLink:it,timelineEnabled:at}=D.config,Se=it!==!1?a:void 0;return C("div",{className:"relative h-full",id:"document-editor-context",children:[st&&Ee&&!c&&d(qt,{onClose:n,onExport:o,onShowRevisionHistory:H,title:t.header.name,onSwitchboardLinkClick:Se,timelineButtonVisible:at,timelineItems:L.data,onTimelineItemClick:u}),!Ee&&C("div",{className:"mb-4 flex justify-end gap-10",children:[d(V,{onClick:o,children:"Export"}),C("div",{className:"flex gap-4",children:[d(V,{onClick:T,disabled:!Z,children:"Undo"}),d(V,{onClick:Y,disabled:!ee,children:"Redo"})]}),d("div",{className:"flex gap-4",children:d(V,{onClick:n,children:"Close"})})]}),c?d(Qt,{documentTitle:t.header.name,documentId:t.header.id,globalOperations:t.operations.global,localOperations:t.operations.local,onClose:R},i):d(ht,{fallback:d(Fe,{}),name:"EditorLoader",children:d(Ve,{fallbackRender:$n,onError:ot,children:!(z!=null&&z.error)&&d(rt,{error:S,context:{...E,readMode:!!l,selectedTimelineRevision:Vn(l==null?void 0:l.startDate,l==null?void 0:l.endDate,t.operations.global)},document:t,documentNodeName:t.header.name,dispatch:x,onClose:n,onExport:o,canUndo:Z,canRedo:ee,undo:T,redo:Y,onSwitchboardLinkClick:Se,onShowRevisionHistory:H,isAllowedToCreateDocuments:(N==null?void 0:N.isAllowedToCreateDocuments)??!1,isAllowedToEditDocuments:(N==null?void 0:N.isAllowedToEditDocuments)??!1},i)},i)})]})};function Wn(){const{t:e}=j(),{showModal:t}=J(),{addDocumentOperations:n}=$(),o=_(),r=ye(),a=mn(r==null?void 0:r.header.id),i=r==null?void 0:r.header.documentType,l=Nt(o==null?void 0:o.header.id),u=xt(o==null?void 0:o.header.id),c=W(),p=i?c(i):void 0,g=X(),y=b(async f=>{r!=null&&r.header.id&&await n(r.header.id,[f])},[n,r]),s=b(()=>{g(a)},[a,g]),m=b(f=>{const w=je(f);if(w.length)t("confirmationModal",{title:e("modals.exportDocumentWithErrors.title"),body:C("div",{children:[d("p",{children:e("modals.exportDocumentWithErrors.body")}),d("ul",{className:"mt-4 flex list-disc flex-col items-start px-4 text-xs",children:w.map((D,A)=>d("li",{children:D.message},A))})]}),cancelLabel:e("common.cancel"),continueLabel:e("common.export"),onCancel(D){D()},onContinue(D){return D(),Q(f,c)}});else return Q(f,c)},[c,t,e]),v=b(()=>{if(r)return m(r)},[m,r]),h=I(()=>l?async()=>{if(!(r!=null&&r.header.id)){console.error("No selected document");return}if(!u){console.error("No remote drive url found");return}if(!p){console.error("No document model found");return}const f=Ct(u,r.header.id,p.documentModel);try{await wn(f)}catch(w){console.error("Error opening switchboard link",w)}}:void 0,[l,u,r,p]);return r?d("div",{className:"flex-1 rounded-2xl bg-gray-50 p-4",children:d(jn,{document:r,onClose:s,onExport:v,onAddOperation:y,onOpenSwitchboardLink:h})}):null}function Gn({error:e}){return C("div",{className:"mx-auto flex max-w-[80%] flex-1 flex-col items-center justify-center",children:[d("h1",{className:"mb-2 text-xl font-semibold",children:"Error"}),d("i",{children:e instanceof Error?e.message:e}),d("pre",{children:JSON.stringify(e,null,2)})]})}function qn(){var N;const{addDriveOperation:e,getSyncStatusSync:t}=$(),n=_(),o=ye(),r=io(),[,a,i]=Oe(Jt.reducer,n),l=b(async L=>{if(!(n!=null&&n.header.id))throw new Error("No drive selected");await e(n.header.id,L)},[e,n==null?void 0:n.header.id]),u=so(n,a,l),{isAllowedToCreateDocuments:c}=u,{showModal:p}=J(),g=b(L=>{p("createDocument",{documentModel:L})},[p]),y=tn(),{addFile:s,addDocument:m}=$(),v=At()??[],h=W(),f=Qe(),w=Lt.analytics.databaseName,D=!1,A=I(()=>({...r,showSearchBar:D,isAllowedToCreateDocuments:c,documentModels:v,analyticsDatabaseName:w,getSyncStatusSync:t,getDocumentModelModule:h,getEditor:f,addFile:s,showCreateDocumentModal:g,showDeleteNodeModal:y,useDocumentEditorProps:oo,addDocument:m}),[r,c,v,s,m,t,h,f,y,g]),S=kt((N=n==null?void 0:n.header.meta)==null?void 0:N.preferredEditor),E=(S==null?void 0:S.Component)??Pn.Component;return o||!n?null:d(Ve,{fallbackRender:Gn,children:d(E,{...u,context:{...u.context,...A},onSwitchboardLinkClick:void 0,document:n,error:i})},n.header.id)}function Qn(){return{isAllowedToCreateDocuments:!0,isAllowedToEditDocuments:!0}}function Jn(e,t={}){const{documentId:n,documentType:o}=t,[r,a]=F(),i=b(l=>{if(!e)throw new Error("Reactor is not loaded");return e.on("strandUpdate",l)},[e]);return M(()=>{e&&(!n||!o||e.getDocument(n).then(a).catch(console.error))},[n,o,e]),M(()=>!e||!n||!o?void 0:i(u=>{u.documentId===n&&e.getDocument(n).then(a).catch(console.error)}),[i,n,o]),r}async function Xn(e,t,n,o,r){var i,l;return!r||!((l=(i=e.action)==null?void 0:i.context)!=null&&l.signer)?e:o?await Xt(e.action,o,n,e.action.context.signer,t):(console.error(`Document model '${n.header.documentType}' does not have a reducer`),e)}function Yn(e,t,n){return n?{context:{signer:{app:{name:"Connect",key:t||""},user:{address:n.address,networkId:n.networkId,chainId:n.chainId},signatures:[]}},...e}:e}function Zn(e,t=50){let n;const o=[];return r=>{n&&clearTimeout(n);const a=o.findIndex(i=>i.action.scope===r.action.scope&&i.index===r.index);if(a>-1){const i=o[a];i.action.type===r.action.type&&JSON.stringify(r.action.input)===JSON.stringify(i.action.input)||console.warn("Two conflicting operations were dispatched:",i,r),o[a]=r}else o.push(r);return new Promise((i,l)=>{n=setTimeout(()=>{e(o).then(i).catch(l)},t)})}}function eo(e,t){const{documentId:n}=t,{isAllowedToEditDocuments:o}=Qn()||{isAllowedToEditDocuments:!1},r=b(async(i,l)=>{if(!o)throw new Error("User is not allowed to edit documents");if(!e)throw new Error("Reactor is not loaded");if(!i)throw new Error("Document id is not set");return(await e.queueOperations(i,l)).document},[o,e]);return I(()=>Zn(i=>r(n,i)),[r,n])}function to(e,t,n=console.error){const[o,r]=F(t),[a,i]=F(),l=c=>{i(c),n(c)};return M(()=>{r(t)},[t]),[o,(c,p,g)=>{i(void 0),r(y=>{if(!e||!y)return y;try{const s=e(y,c),m=c.scope??"global",v=s.operations[m],h=v[v.length-1];if(h.error){const f=new Error(h.error);l(f),g==null||g(f)}return p==null||p(h,{prevState:{...y},newState:{...s}}),s}catch(s){return l(s),g==null||g(s),y}})},a]}function no(e,t){const{nodeId:n,documentModelModule:o,document:r,user:a,connectDid:i,sign:l}=t,u=eo(e,{documentId:n}),[c,p,g]=to(o==null?void 0:o.reducer,r);function y(s,m){const v=(h,f)=>{const{prevState:w}=f;if(!n)throw new Error("Node id is not set");Xn(h,l,w,o==null?void 0:o.reducer,a).then(D=>u(D)).catch(console.error)};p(Yn(s,i,a),v,m)}return{dispatch:y,document:c,error:g}}function oo(e){const{documentId:t,documentType:n,documentModelModule:o,user:r}=e,a=Tt(),i=me(),{sign:l}=he(),u=Jn(a,{documentId:t,documentType:n});return no(a,{nodeId:t,document:u,documentModelModule:o,connectDid:i,sign:l,user:r})}function ro(e,t,n){const o=fe()||void 0,r=me(),{sign:a}=he(),i=e==null?void 0:e.header.documentType,l=W(),u=I(()=>i?l(i):void 0,[i,l]);return b((p,g)=>{const y=(s,m)=>{if(!(e!=null&&e.header.id))return;const{prevState:v}=m;ze(s,a,e.header.id,v,u==null?void 0:u.reducer,o).then(h=>{var f;return(f=window.documentEditorDebugTools)==null||f.pushOperation(s),n(h)}).catch(Ue.error)};t(Re(p,r,o),y,g)},[t,r,u==null?void 0:u.reducer,n,e==null?void 0:e.header.id,a,o])}function so(e,t,n){const{t:o}=j(),{showModal:r}=J(),a=ue(We),i=fe()||void 0,l=Pe();_();const u=hn(e==null?void 0:e.header.id),c=X(),p=I(()=>({theme:a,user:i}),[a,i]),g=W(),y=!!e&&(e.header.revision.global>0||e.header.revision.local>0),s=!!(e!=null&&e.clipboard.length),m=ro(e,t,n),v=b(()=>{m(_e())},[m]),h=b(()=>{m(Ke())},[m]),f=b(()=>{c(u==null?void 0:u.id)},[u,c]),w=b(N=>{const L=je(N);if(L.length)r("confirmationModal",{title:o("modals.exportDocumentWithErrors.title"),body:C("div",{children:[d("p",{children:o("modals.exportDocumentWithErrors.body")}),d("ul",{className:"mt-4 flex list-disc flex-col items-start px-4 text-xs",children:L.map((x,H)=>d("li",{children:x.message},H))})]}),cancelLabel:o("common.cancel"),continueLabel:o("common.export"),onCancel(x){x()},onContinue(x){return x(),Q(N,g)}});else return Q(N,g)},[g,r,o]),D=b(()=>{if(e)return w(e)},[w,e]),[A,S]=F(!1),E=b(()=>S(!0),[]);return{dispatch:m,revisionHistoryVisible:A,context:p,canUndo:y,canRedo:s,undo:v,redo:h,onClose:f,onExport:D,onShowRevisionHistory:E,isAllowedToCreateDocuments:(l==null?void 0:l.isAllowedToCreateDocuments)??!1,isAllowedToEditDocuments:(l==null?void 0:l.isAllowedToEditDocuments)??!1}}function io(){const e=_(),t=pe(),n=pn(),o=X(),{addFolder:r,addFile:a,renameNode:i,copyNode:l,moveNode:u}=$(),c=b(async(h,f)=>{if(!(e!=null&&e.header.id))return;const w=h.name.replace(/\.zip$/gim,"");return await a(h,e.header.id,w,f==null?void 0:f.id)},[a,e==null?void 0:e.header.id]),p=b(async(h,f)=>{if(e!=null&&e.header.id)return await r(e.header.id,h,f==null?void 0:f.id)},[r,e==null?void 0:e.header.id]),g=b(async(h,f)=>{if(e!=null&&e.header.id)return await i(e.header.id,f.id,h)},[i,e==null?void 0:e.header.id]),y=b(async(h,f)=>{await l(h,f)},[l]),s=b(async(h,f)=>{await u(h,f)},[u]),m=b(async h=>{await l(h,t??n)},[l,t,n]),v=b(async h=>{if(!h)return;const f=await p(h,t??n);f&&o(f.id)},[p,t,n,o]);return I(()=>({onAddFile:c,onAddFolder:p,onRenameNode:g,onCopyNode:y,onMoveNode:s,onDuplicateNode:m,onAddAndSelectNewFolder:v}),[p,c,y,s,g,m,v])}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},de.apply(null,arguments)}var Xe=["shift","alt","meta","mod","ctrl"],ao={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function O(e){return(e&&ao[e]||e||"").trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function co(e){return Xe.includes(e)}function se(e,t){return t===void 0&&(t=","),e.split(t)}function ie(e,t,n){t===void 0&&(t="+");var o=e.toLocaleLowerCase().split(t).map(function(i){return O(i)}),r={alt:o.includes("alt"),ctrl:o.includes("ctrl")||o.includes("control"),shift:o.includes("shift"),meta:o.includes("meta"),mod:o.includes("mod")},a=o.filter(function(i){return!Xe.includes(i)});return de({},r,{keys:a,description:n,hotkey:e})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&Ye([O(e.key),O(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&Ze([O(e.key),O(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){P.clear()})})();var P=new Set;function ve(e){return Array.isArray(e)}function lo(e,t){t===void 0&&(t=",");var n=ve(e)?e:e.split(t);return n.every(function(o){return P.has(o.trim().toLowerCase())})}function Ye(e){var t=Array.isArray(e)?e:[e];P.has("meta")&&P.forEach(function(n){return!co(n)&&P.delete(n.toLowerCase())}),t.forEach(function(n){return P.add(n.toLowerCase())})}function Ze(e){var t=Array.isArray(e)?e:[e];e==="meta"?P.clear():t.forEach(function(n){return P.delete(n.toLowerCase())})}function uo(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function fo(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function mo(e){return et(e,["input","textarea","select"])}function et(e,t){t===void 0&&(t=!1);var n=e.target,o=e.composed,r=null;return ho(n)&&o?r=e.composedPath()[0]&&e.composedPath()[0].tagName:r=n&&n.tagName,ve(t)?!!(r&&t&&t.some(function(a){var i;return a.toLowerCase()===((i=r)==null?void 0:i.toLowerCase())})):!!(r&&t&&t)}function ho(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function po(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var yo=function(t,n,o){o===void 0&&(o=!1);var r=n.alt,a=n.meta,i=n.mod,l=n.shift,u=n.ctrl,c=n.keys,p=t.key,g=t.code,y=t.ctrlKey,s=t.metaKey,m=t.shiftKey,v=t.altKey,h=O(g),f=p.toLowerCase();if(!(c!=null&&c.includes(h))&&!(c!=null&&c.includes(f))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(h))return!1;if(!o){if(r===!v&&f!=="alt"||l===!m&&f!=="shift")return!1;if(i){if(!s&&!y)return!1}else if(a===!s&&f!=="meta"&&f!=="os"||u===!y&&f!=="ctrl"&&f!=="control")return!1}return c&&c.length===1&&(c.includes(f)||c.includes(h))?!0:c?lo(c):!c},go=ce(void 0),vo=function(){return le(go)};function tt(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,o){return n&&tt(e[o],t[o])},!0):e===t}var wo=ce({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),bo=function(){return le(wo)};function Do(e){var t=q(void 0);return tt(t.current,e)||(t.current=e),t.current}var Ie=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},Eo=typeof window<"u"?pt:M;function Me(e,t,n,o){var r=F(null),a=r[0],i=r[1],l=q(!1),u=n instanceof Array?o instanceof Array?void 0:o:n,c=ve(e)?e.join(u==null?void 0:u.splitKey):e,p=n instanceof Array?n:o instanceof Array?o:void 0,g=b(t,p??[]),y=q(g);p?y.current=g:y.current=t;var s=Do(u),m=bo(),v=m.enabledScopes,h=vo();return Eo(function(){if(!((s==null?void 0:s.enabled)===!1||!po(v,s==null?void 0:s.scopes))){var f=function(E,N){var L;if(N===void 0&&(N=!1),!(mo(E)&&!et(E,s==null?void 0:s.enableOnFormTags))){if(a!==null){var x=a.getRootNode();if((x instanceof Document||x instanceof ShadowRoot)&&x.activeElement!==a&&!a.contains(x.activeElement)){Ie(E);return}}(L=E.target)!=null&&L.isContentEditable&&!(s!=null&&s.enableOnContentEditable)||se(c,s==null?void 0:s.splitKey).forEach(function(H){var R,T=ie(H,s==null?void 0:s.combinationKey);if(yo(E,T,s==null?void 0:s.ignoreModifiers)||(R=T.keys)!=null&&R.includes("*")){if(s!=null&&s.ignoreEventWhen!=null&&s.ignoreEventWhen(E)||N&&l.current)return;if(uo(E,T,s==null?void 0:s.preventDefault),!fo(E,T,s==null?void 0:s.enabled)){Ie(E);return}y.current(E,T),N||(l.current=!0)}})}},w=function(E){E.key!==void 0&&(Ye(O(E.code)),((s==null?void 0:s.keydown)===void 0&&(s==null?void 0:s.keyup)!==!0||s!=null&&s.keydown)&&f(E))},D=function(E){E.key!==void 0&&(Ze(O(E.code)),l.current=!1,s!=null&&s.keyup&&f(E,!0))},A=a||(u==null?void 0:u.document)||document;return A.addEventListener("keyup",D,u==null?void 0:u.eventListenerOptions),A.addEventListener("keydown",w,u==null?void 0:u.eventListenerOptions),h&&se(c,s==null?void 0:s.splitKey).forEach(function(S){return h.addHotkey(ie(S,s==null?void 0:s.combinationKey,s==null?void 0:s.description))}),function(){A.removeEventListener("keyup",D,u==null?void 0:u.eventListenerOptions),A.removeEventListener("keydown",w,u==null?void 0:u.eventListenerOptions),h&&se(c,s==null?void 0:s.splitKey).forEach(function(S){return h.removeHotkey(ie(S,s==null?void 0:s.combinationKey,s==null?void 0:s.description))})}}},[a,c,s,v]),i}const So=e=>{var u;const{undo:t,redo:n,canRedo:o,canUndo:r}=e,{isMac:a}=((u=window.electronAPI)==null?void 0:u.platformInfo)||{};let i="ctrl+z",l="ctrl+y";a&&(i="mod+z",l="mod+shift+z"),Me(i,c=>{c.preventDefault(),r&&t()},{},[r,t]),Me(l,c=>{c.preventDefault(),o&&n()},{},[o,n])};function Uo(){const{addFile:e}=$(),t=_(),n=pe(),o=ye();return M(()=>{var r;return(r=window.electronAPI)==null?void 0:r.handleFileOpen(async a=>{!(t!=null&&t.header.id)||!(o!=null&&o.header.id)||await e(a.content,t.header.id,a.name,n==null?void 0:n.id)})},[t==null?void 0:t.header.id,n==null?void 0:n.id,o==null?void 0:o.header.id,e]),C(No,{children:[d(Wn,{}),d(qn,{}),d(xo,{})]})}function No({children:e}){return d("div",{className:"flex h-full flex-col overflow-auto",id:"content-view",children:e})}function xo(){const{pathname:e}=cn(),t=Ft(),n=It(),o=yn(),r=gn(),a=nn(),i=Mt(),l=Ht(),[u]=Ot(),c=b(m=>{i(m.header.id)},[i]),p=b(()=>{a()},[a]),g=n.state==="loading"||o.state==="loading"||r.state==="loading",y=n.state==="hasError"||o.state==="hasError"||r.state==="hasError",s=!g&&!y&&(!!n.data||!!o.data||!!r.data);return e!=="/"||s?null:C(Yt,{children:[t==null?void 0:t.map(m=>{var f;const v=(f=m.header.meta)==null?void 0:f.preferredEditor,h=v?l(v):void 0;return d(Zt,{title:m.state.global.name,description:h||"Drive Explorer App",icon:d(on,{drive:m}),onClick:()=>c(m)},m.header.id)}),u.drives.addDriveEnabled&&d(en,{onClick:p})]})}export{Uo as default};
3
- //# sourceMappingURL=content.BfvrMr0V.js.map
2
+ import{jsx as d,jsxs as C,Fragment as ft}from"react/jsx-runtime";import mt,{createContext as ce,useContext as le,useRef as q,useState as F,useCallback as b,useEffect as M,useMemo as I,Suspense as ht,useLayoutEffect as pt}from"react";import{o as yt,d as ue,p as gt,e as vt,q as wt,f as bt,t as Dt,i as j,v as _,w as Et,x as St,y as fe,z as me,A as he,B as W,C as Oe,D as Pe,E as Re,F as ze,G as $,H as Nt,I as xt,J as Q,K as Ct,L as At,g as Lt,M as kt,N as Tt,O as Ft,P as It,Q as Mt,S as Ht,u as Ot}from"./index.D1VdJrbu.js";import{av as Pt,aw as Rt,ax as zt,_ as Ce,ay as V,az as Bt,aA as Ae,aB as _t,aC as G,aD as Be,aE as Le,aF as Kt,aG as Ut,aH as K,aI as Vt,aJ as $t,ad as jt,af as Wt,aK as Gt,aL as _e,aM as Ke,aN as qt,aO as Qt,l as Ue,z as Jt,x as Xt,H as Yt,aP as Zt,aQ as en}from"./index.Xt1GtJTP.js";import{E as Ve,u as tn,a as nn,D as on}from"./modals.BND5VgGq.js";import{u as rn}from"./useDefaultDocumentModelEditor.8vdl-Z1u.js";import{c as $e,d as sn,D as ne,A as oe,f as an,g as dn,i as cn}from"./useInitSentry.Bb28RsdX.js";import{useModal as J}from"./modal.rCKchklN.js";import{u as ln,a as un,b as pe,c as fn,d as X,e as ye,f as mn,g as hn,h as pn,i as yn,j as gn}from"./nodes.Dm7Ct2Qu.js";import"react-dom/client";import"./browser.BkwNmV2Z.js";import"./app-skeleton.js";import"react-dom";import"./i18next.CqOP20KE.js";import"./useAcceptedCookies.D1uKoy1t.js";import"./registerServiceWorker.BedDSXhk.js";const vn=e=>window.open(e,"_blank");var He;const wn=((He=window.electronAPI)==null?void 0:He.openURL)??vn,je=e=>{const t=[];if(e.header.documentType!=="powerhouse/document-model")return t;const n=e,o=n.state.global.specifications[0],r=Object.keys(o.state).reduce((l,u)=>{const c=u;return[...l,...Pt(o.state[c].initialValue,c!=="global").map(p=>({...p,message:`${p.message}. Scope: ${c}`,details:{...p.details,scope:c}}))]},[]),a=Object.keys(o.state).reduce((l,u)=>{var g;const c=u,p=c==="global";return[...l,...Rt(o.state[c].schema,n.header.name||((g=n.state.global)==null?void 0:g.name)||"",p?"":c,!p).map(y=>({...y,message:`${y.message}. Scope: ${c}`,details:{...y.details,scope:c}}))]},[]),i=zt(o.modules);return[...r,...a,...i]},We=yt("theme","light",e=>{var t;typeof window<"u"&&((t=window.electronAPI)==null||t.setTheme(e))});async function bn(){const e=await Ce(()=>import("./index.CbJoiyjo.js"),__vite__mapDeps([0,1]),import.meta.url);return await Ce(()=>Promise.resolve({}),__vite__mapDeps([2]),import.meta.url),[e.documentModelEditorModule]}function Dn(e){return e.map(t=>t.editors).reduce((t,n)=>t.concat(n),[])}const Ge=wt(bn);Ge.debugLabel="baseEditorsAtomInConnect";const ge=vt(async e=>{const t=await e(Ge),n=await e(bt);return Dn(n).concat(t)});ge.debugLabel="editorsAtomInConnect";const qe=gt(ge);qe.debugLabel="unwrappedEditorsAtomInConnect";const En=Dt(ge);En.debugLabel="loadableEditorsAtomInConnect";const Sn=()=>ue(qe),Nn=(e,t,n)=>{if(!e)return null;const o=t.find(a=>a.config.id===n&&a.documentTypes.includes(e));return o||t.find(a=>a.documentTypes.includes(e))||t.find(a=>a.documentTypes.includes("*"))||null},Qe=()=>{const e=Sn(),[t]=rn();return n=>e?Nn(n,e,t.value):void 0},Je=ce(void 0),xn=({value:e,children:t})=>d(Je.Provider,{value:e,children:t});function Cn(){const e=le(Je);if(!e)throw new Error("useDriveContext must be used within a DriveContextProvider");return e}function An(e){return"documentModelState"in e?e.documentModelState:e.documentModel}const Ln=({documentModels:e,createDocument:t})=>C("div",{className:"px-6",children:[d("h3",{className:"mb-3 mt-4 text-xl font-bold text-gray-600",children:"New document"}),d("div",{className:"flex w-full flex-wrap gap-4",children:e==null?void 0:e.map(n=>{const o=An(n);return d(V,{color:"light",title:o.name,"aria-description":o.description,onClick:()=>t(n),children:d("span",{className:"text-sm",children:o.name})},o.id)})})]}),U=8,re=256,ke=48,kn=420;function Tn(e){const t=q(null),{t:n}=j(),o=Bt(),{fileNodes:r}=e,a=o.innerWidth-kn,i=Math.floor(a/(re+U))||1,l=Math.ceil(r.length/i),u=Ae({count:l,getScrollElement:()=>t.current,estimateSize:s=>s>0?ke+U:ke,overscan:5}),c=Ae({horizontal:!0,count:i,getScrollElement:()=>t.current,estimateSize:s=>s>0?re+U:re,overscan:5}),p=(s,m)=>s*i+m,g=(s,m)=>{const v=p(s,m);return r[v]||null};if(r.length===0)return d("div",{className:"mb-8 text-sm text-gray-400",children:n("folderView.sections.documents.empty",{defaultValue:"No documents or files 📄"})});const y=(s,m)=>{const v=g(s,m);return v?d("div",{style:{marginLeft:m===0?0:U},children:d(_t,{fileNode:v,...e},v.id)}):null};return d("div",{ref:t,style:{height:"400px",width:"100%",overflow:"auto"},children:d("div",{style:{height:`${u.getTotalSize()}px`,width:`${c.getTotalSize()}px`,position:"relative"},children:u.getVirtualItems().map(s=>d(mt.Fragment,{children:c.getVirtualItems().map(m=>d("div",{style:{position:"absolute",top:0,left:0,marginTop:s.index===0?0:U,width:`${m.size}px`,height:`${s.size}px`,transform:`translateX(${m.start}px) translateY(${s.start}px)`},children:y(s.index,m.index)},m.key))},s.key))})})}function k({children:e,className:t,...n}){return d(k.Container,{className:t,...n,children:e})}k.Container=function({children:t,className:n,containerProps:o,...r}){return d("div",{className:G("flex grow flex-col overflow-auto rounded-2xl bg-gray-50 p-2",n),...o,...r,children:t})};k.Header=function({children:t,className:n,containerProps:o,...r}){return d("div",{className:G("flex-0",n),...o,...r,children:t})};k.Content=function({children:t,className:n,containerProps:o,...r}){return d("div",{className:G("mb-5 flex-1 px-4",n),...o,...r,children:t})};k.ContentSection=function({title:t,children:n,className:o,containerProps:r,...a}){return C("div",{className:G(o),...r,...a,children:[t&&d("div",{className:"mb-4 text-base font-semibold text-gray-600",children:t}),d("div",{className:"flex flex-wrap gap-2",children:n})]})};k.Footer=function({children:t,className:n,containerProps:o,...r}){return d("div",{className:G("flex-0",n),...o,...r,children:t})};function Fn(e){const{node:t,isAllowedToCreateDocuments:n,className:o,containerProps:r,sharingType:a,getSyncStatusSync:i,setSelectedNode:l,onAddFile:u,onCopyNode:c,onMoveNode:p,onRenameNode:g,onDuplicateNode:y,onAddFolder:s,onAddAndSelectNewFolder:m,showDeleteNodeModal:v}=e,{t:h}=j(),f=ln(t==null?void 0:t.id),w=un(t==null?void 0:t.id),{isDropTarget:D,dropProps:A}=Be({node:t,onAddFile:u,onCopyNode:c,onMoveNode:p});return C("div",{className:Le("rounded-md border-2 border-transparent p-2",D&&"border-dashed border-blue-100",o),...r,...A,children:[d(k.ContentSection,{title:h("folderView.sections.folders.title",{defaultValue:"Folders"}),className:"mb-4",children:f.length>0?f.map(S=>d(Kt,{folderNode:S,isAllowedToCreateDocuments:n,sharingType:a,getSyncStatusSync:i,setSelectedNode:l,onAddFile:u,onCopyNode:c,onMoveNode:p,onRenameNode:g,onDuplicateNode:y,onAddFolder:s,onAddAndSelectNewFolder:m,showDeleteNodeModal:v},S.id)):d("div",{className:"mb-8 text-sm text-gray-400",children:h("folderView.sections.folders.empty",{defaultValue:"No documents or files 📄"})})}),d(k.ContentSection,{title:h("folderView.sections.documents.title",{defaultValue:"Documents and files"}),children:d("div",{className:Le("w-full",w.length>0?"min-h-[400px]":"min-h-14"),children:d(Tn,{fileNodes:w,isAllowedToCreateDocuments:n,sharingType:a,getSyncStatusSync:i,setSelectedNode:l,showDeleteNodeModal:v,onAddFile:u,onCopyNode:c,onMoveNode:p,onRenameNode:g,onDuplicateNode:y,onAddFolder:s,onAddAndSelectNewFolder:m})})})]})}const In=[{id:"project",label:".project",icon:d(K,{name:"Project",color:"#FF6A55",size:16})},{id:"budget",label:".budget",icon:d(K,{name:"BarChart",color:"#8E55EA",size:16})},{id:"profile",label:".profile",icon:d(K,{name:"Person",color:"#3E90F0",size:16})},{id:"legal",label:".legal",icon:d(K,{name:"Briefcase",color:"#4BAB71",size:16})},{id:"atlas",label:".Atlas",icon:d(K,{name:"Globe",color:"#FF8A00",size:16})}],Mn=()=>{const{t:e}=j(),[t,n]=F("");return d(Ut,{className:"max-w-searchbar-width m-4 shrink-0 bg-gray-100",placeholder:e("searchbar.placeholder"),filterLabel:e("searchbar.filterLabel"),filterItems:In,value:t,onChange:n})};function Hn(e){const{document:t,className:n,children:o}=e,{showSearchBar:r,isAllowedToCreateDocuments:a,documentModels:i,getSyncStatusSync:l,showCreateDocumentModal:u,onRenameNode:c,onDuplicateNode:p,onAddFolder:g,onAddFile:y,onCopyNode:s,onMoveNode:m,onAddAndSelectNewFolder:v,showDeleteNodeModal:h}=Cn(),f=_(),w=pe(),D=St(f),A=fn(),S=X(),E=b(T=>{u(T)},[u]),{isDropTarget:N,dropProps:L}=Be({node:D,onAddFile:y,onCopyNode:s,onMoveNode:m}),{breadcrumbs:x,onBreadcrumbSelected:H}=Vt({selectedNodePath:A,setSelectedNode:S}),R=Et(t);return f?C(k,{className:n,children:[o,C(k.Header,{children:[d($t,{breadcrumbs:x,createEnabled:a,onCreate:v,onBreadcrumbSelected:H}),r&&d(Mn,{})]}),d(k.Content,{...L,className:N?"rounded-xl bg-blue-100":"",children:d(Fn,{node:w??D,sharingType:R,getSyncStatusSync:l,setSelectedNode:S,onRenameNode:c,onDuplicateNode:p,onAddFolder:g,onAddFile:y,onCopyNode:s,onMoveNode:m,onAddAndSelectNewFolder:v,showDeleteNodeModal:h,isAllowedToCreateDocuments:a})}),d(k.Footer,{children:a&&d(Ln,{documentModels:i,createDocument:E})})]}):d("div",{children:"Drive not found"})}function On(e){return d(xn,{value:e.context,children:d(Hn,{...e})})}const Pn={Component:On};function Rn(e){const{queryFn:t,...n}=e,{data:o}=$e(),{data:r}=sn(),a="enabled"in n?n.enabled:!!o&&!!r;return Wt({...n,enabled:a,queryFn:async()=>{if(!o||!r)throw new Error("No analytics store available. Use within an AnalyticsProvider.");return await t({store:o,engine:r})}})}const zn=200;function Bn(e,t){const{data:n}=$e(),o=jt(),r=(t==null?void 0:t.sources)??[],a=Rn({queryKey:["analytics","query",e],queryFn:({engine:i})=>i.execute(e),...t});return M(()=>{if(!r.length||!n)return;const i=new Array;let l=null;const u=()=>{l&&clearTimeout(l),l=setTimeout(()=>{o.invalidateQueries({queryKey:["analytics","query",e]}).catch(c=>{console.error(c)})},zn)};return r.forEach(c=>{const p=n.subscribeToSource(c,u);i.push(p)}),()=>{i.forEach(c=>c())}},[e,n,r]),a}const Te=e=>e<=0?0:e>0&&e<=50?1:e>50&&e<=100?2:e>100&&e<=250?3:4;function _n(e){if(!e.length)return[];const t=[];return e.forEach((n,o)=>{if(t.push(n),o<e.length-1){const r=new Date(n.startDate),a=new Date(e[o+1].startDate),i=r.getHours(),l=a.getHours(),u=r.toDateString(),c=a.toDateString();(u!==c||u===c&&Math.abs(l-i)>1)&&t.push({id:`divider-${n.id}-${e[o+1].id}`,type:"divider",revision:0})}}),t}function Kn(e){if(!e)return[];const t=e.sort((n,o)=>{const r=new Date(n.start),a=new Date(o.start);return r.getTime()-a.getTime()}).filter(n=>n.rows.every(o=>o.value>0)).map(n=>{const{additions:o,deletions:r}=n.rows.reduce((i,l)=>(l.dimensions.changes.path==="ph/diff/changes/add"?i.additions+=l.value:l.dimensions.changes.path==="ph/diff/changes/remove"&&(i.deletions+=l.value),i),{additions:0,deletions:0}),a=new Date(n.start);return{id:a.toISOString(),type:"bar",addSize:Te(o),delSize:Te(r),additions:o,deletions:r,timestamp:a.toISOString(),startDate:a,endDate:new Date(n.end),revision:0}});return _n(t)}const Un=(e,t,n)=>{const o=t?ne.fromISO(t):ne.now().startOf("day");return Bn({start:o,end:ne.now().endOf("day"),granularity:an.Hourly,metrics:["Count"],select:{changes:[oe.fromString("ph/diff/changes")],document:[oe.fromString(`ph/diff/document/${e}`)]},lod:{changes:4}},{sources:[oe.fromString(`ph/diff/${n}/${e}`)],select:Kn})},Vn=(e,t,n=[])=>{if(!e||!t)return 0;const o=n.find(r=>{const a=new Date(r.timestamp);return a>=e&&a<=t});return o?o.index:0};function Fe(e){const[t,n]=F(!1);if(M(()=>{setTimeout(()=>{n(!0)},e.loadingTimeout??200)},[e]),!t)return null;const{customEditorLoader:o,...r}=e;return o?d(ft,{children:o}):d(Gt,{...r})}function ae({message:e}){return d("div",{className:"flex size-full items-center justify-center",children:d("h3",{className:"text-lg font-semibold",children:e})})}function $n(e){const t=e.error instanceof Error?e.error.message:e.error;return d(ae,{message:t})}const jn=e=>{const{document:t,onClose:n,onExport:o,onAddOperation:r,onOpenSwitchboardLink:a}=e,i=t.header.id,[l,u]=F(null),[c,p]=F(!1),g=ue(We),y=fe()||void 0,s=me(),{sign:m}=he(),v=W(),h=Qe(),f=t.header.documentType,w=I(()=>f?v(f):void 0,[f,v]),D=I(()=>f?h(f):void 0,[f,h]),[,A,S]=Oe(w==null?void 0:w.reducer,t),E=I(()=>({theme:g,user:y}),[g,y]),N=Pe(),L=Un(i,t.header.createdAtUtcIso),x=b((B,te)=>{const dt=(Ne,ct)=>{if(!i)return;const{prevState:lt}=ct;ze(Ne,m,i,lt,w==null?void 0:w.reducer,y).then(ut=>{var xe;return(xe=window.documentEditorDebugTools)==null||xe.pushOperation(Ne),r(ut)}).catch(Ue.error)};A(Re(B,s,y),dt,te)},[A,s,w==null?void 0:w.reducer,r,i,m,y]),H=b(()=>p(!0),[]),R=b(()=>p(!1),[]),T=b(()=>{x(_e())},[x]),Y=b(()=>{x(Ke())},[x]),nt=D===void 0||D&&!D.documentTypes.includes(t.header.documentType)&&!D.documentTypes.includes("*"),Z=t.header.revision.global>0||t.header.revision.local>0,ee=!!(t!=null&&t.clipboard.length);So({undo:T,redo:Y,canUndo:Z,canRedo:ee}),M(()=>()=>{var B;(B=window.documentEditorDebugTools)==null||B.clear()},[]);const we=dn(),{showModal:be}=J(),[z,De]=F(void 0);M(()=>{z&&z.documentId!==i&&De(void 0)},[z,i]);const ot=b((B,te)=>{De({error:B,documentId:i,info:te})},[i]);if(nt)return d(Fe,{message:"Loading editor"});if(!w)return d(ae,{message:C("div",{className:"text-center leading-10",children:[C("p",{children:['Unable to open the document because the document model "',f,'" is not supported.']}),C("p",{children:["Go to the"," ",d("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{be("settingsModal",{onRefresh:()=>we(0)})},children:"package manager"})," ","to install this document model"]})]})});if(!D)return d(ae,{message:C("div",{className:"text-center leading-10",children:[d("p",{children:"Unable to open the document because no editor has been found"}),C("p",{children:["Go to the"," ",d("button",{type:"button",className:"cursor-pointer underline",onClick:()=>{be("settingsModal",{onRefresh:()=>we(0)})},children:"package manager"})," ",'an editor for the "$',f,'" document type']})]})});const rt=D.Component,{disableExternalControls:Ee,documentToolbarEnabled:st,showSwitchboardLink:it,timelineEnabled:at}=D.config,Se=it!==!1?a:void 0;return C("div",{className:"relative h-full",id:"document-editor-context",children:[st&&Ee&&!c&&d(qt,{onClose:n,onExport:o,onShowRevisionHistory:H,title:t.header.name,onSwitchboardLinkClick:Se,timelineButtonVisible:at,timelineItems:L.data,onTimelineItemClick:u}),!Ee&&C("div",{className:"mb-4 flex justify-end gap-10",children:[d(V,{onClick:o,children:"Export"}),C("div",{className:"flex gap-4",children:[d(V,{onClick:T,disabled:!Z,children:"Undo"}),d(V,{onClick:Y,disabled:!ee,children:"Redo"})]}),d("div",{className:"flex gap-4",children:d(V,{onClick:n,children:"Close"})})]}),c?d(Qt,{documentTitle:t.header.name,documentId:t.header.id,globalOperations:t.operations.global,localOperations:t.operations.local,onClose:R},i):d(ht,{fallback:d(Fe,{}),name:"EditorLoader",children:d(Ve,{fallbackRender:$n,onError:ot,children:!(z!=null&&z.error)&&d(rt,{error:S,context:{...E,readMode:!!l,selectedTimelineRevision:Vn(l==null?void 0:l.startDate,l==null?void 0:l.endDate,t.operations.global)},document:t,documentNodeName:t.header.name,dispatch:x,onClose:n,onExport:o,canUndo:Z,canRedo:ee,undo:T,redo:Y,onSwitchboardLinkClick:Se,onShowRevisionHistory:H,isAllowedToCreateDocuments:(N==null?void 0:N.isAllowedToCreateDocuments)??!1,isAllowedToEditDocuments:(N==null?void 0:N.isAllowedToEditDocuments)??!1},i)},i)})]})};function Wn(){const{t:e}=j(),{showModal:t}=J(),{addDocumentOperations:n}=$(),o=_(),r=ye(),a=mn(r==null?void 0:r.header.id),i=r==null?void 0:r.header.documentType,l=Nt(o==null?void 0:o.header.id),u=xt(o==null?void 0:o.header.id),c=W(),p=i?c(i):void 0,g=X(),y=b(async f=>{r!=null&&r.header.id&&await n(r.header.id,[f])},[n,r]),s=b(()=>{g(a)},[a,g]),m=b(f=>{const w=je(f);if(w.length)t("confirmationModal",{title:e("modals.exportDocumentWithErrors.title"),body:C("div",{children:[d("p",{children:e("modals.exportDocumentWithErrors.body")}),d("ul",{className:"mt-4 flex list-disc flex-col items-start px-4 text-xs",children:w.map((D,A)=>d("li",{children:D.message},A))})]}),cancelLabel:e("common.cancel"),continueLabel:e("common.export"),onCancel(D){D()},onContinue(D){return D(),Q(f,c)}});else return Q(f,c)},[c,t,e]),v=b(()=>{if(r)return m(r)},[m,r]),h=I(()=>l?async()=>{if(!(r!=null&&r.header.id)){console.error("No selected document");return}if(!u){console.error("No remote drive url found");return}if(!p){console.error("No document model found");return}const f=Ct(u,r.header.id,p.documentModel);try{await wn(f)}catch(w){console.error("Error opening switchboard link",w)}}:void 0,[l,u,r,p]);return r?d("div",{className:"flex-1 rounded-2xl bg-gray-50 p-4",children:d(jn,{document:r,onClose:s,onExport:v,onAddOperation:y,onOpenSwitchboardLink:h})}):null}function Gn({error:e}){return C("div",{className:"mx-auto flex max-w-[80%] flex-1 flex-col items-center justify-center",children:[d("h1",{className:"mb-2 text-xl font-semibold",children:"Error"}),d("i",{children:e instanceof Error?e.message:e}),d("pre",{children:JSON.stringify(e,null,2)})]})}function qn(){var N;const{addDriveOperation:e,getSyncStatusSync:t}=$(),n=_(),o=ye(),r=io(),[,a,i]=Oe(Jt.reducer,n),l=b(async L=>{if(!(n!=null&&n.header.id))throw new Error("No drive selected");await e(n.header.id,L)},[e,n==null?void 0:n.header.id]),u=so(n,a,l),{isAllowedToCreateDocuments:c}=u,{showModal:p}=J(),g=b(L=>{p("createDocument",{documentModel:L})},[p]),y=tn(),{addFile:s,addDocument:m}=$(),v=At()??[],h=W(),f=Qe(),w=Lt.analytics.databaseName,D=!1,A=I(()=>({...r,showSearchBar:D,isAllowedToCreateDocuments:c,documentModels:v,analyticsDatabaseName:w,getSyncStatusSync:t,getDocumentModelModule:h,getEditor:f,addFile:s,showCreateDocumentModal:g,showDeleteNodeModal:y,useDocumentEditorProps:oo,addDocument:m}),[r,c,v,s,m,t,h,f,y,g]),S=kt((N=n==null?void 0:n.header.meta)==null?void 0:N.preferredEditor),E=(S==null?void 0:S.Component)??Pn.Component;return o||!n?null:d(Ve,{fallbackRender:Gn,children:d(E,{...u,context:{...u.context,...A},onSwitchboardLinkClick:void 0,document:n,error:i})},n.header.id)}function Qn(){return{isAllowedToCreateDocuments:!0,isAllowedToEditDocuments:!0}}function Jn(e,t={}){const{documentId:n,documentType:o}=t,[r,a]=F(),i=b(l=>{if(!e)throw new Error("Reactor is not loaded");return e.on("strandUpdate",l)},[e]);return M(()=>{e&&(!n||!o||e.getDocument(n).then(a).catch(console.error))},[n,o,e]),M(()=>!e||!n||!o?void 0:i(u=>{u.documentId===n&&e.getDocument(n).then(a).catch(console.error)}),[i,n,o]),r}async function Xn(e,t,n,o,r){var i,l;return!r||!((l=(i=e.action)==null?void 0:i.context)!=null&&l.signer)?e:o?await Xt(e.action,o,n,e.action.context.signer,t):(console.error(`Document model '${n.header.documentType}' does not have a reducer`),e)}function Yn(e,t,n){return n?{context:{signer:{app:{name:"Connect",key:t||""},user:{address:n.address,networkId:n.networkId,chainId:n.chainId},signatures:[]}},...e}:e}function Zn(e,t=50){let n;const o=[];return r=>{n&&clearTimeout(n);const a=o.findIndex(i=>i.action.scope===r.action.scope&&i.index===r.index);if(a>-1){const i=o[a];i.action.type===r.action.type&&JSON.stringify(r.action.input)===JSON.stringify(i.action.input)||console.warn("Two conflicting operations were dispatched:",i,r),o[a]=r}else o.push(r);return new Promise((i,l)=>{n=setTimeout(()=>{e(o).then(i).catch(l)},t)})}}function eo(e,t){const{documentId:n}=t,{isAllowedToEditDocuments:o}=Qn()||{isAllowedToEditDocuments:!1},r=b(async(i,l)=>{if(!o)throw new Error("User is not allowed to edit documents");if(!e)throw new Error("Reactor is not loaded");if(!i)throw new Error("Document id is not set");return(await e.queueOperations(i,l)).document},[o,e]);return I(()=>Zn(i=>r(n,i)),[r,n])}function to(e,t,n=console.error){const[o,r]=F(t),[a,i]=F(),l=c=>{i(c),n(c)};return M(()=>{r(t)},[t]),[o,(c,p,g)=>{i(void 0),r(y=>{if(!e||!y)return y;try{const s=e(y,c),m=c.scope??"global",v=s.operations[m],h=v[v.length-1];if(h.error){const f=new Error(h.error);l(f),g==null||g(f)}return p==null||p(h,{prevState:{...y},newState:{...s}}),s}catch(s){return l(s),g==null||g(s),y}})},a]}function no(e,t){const{nodeId:n,documentModelModule:o,document:r,user:a,connectDid:i,sign:l}=t,u=eo(e,{documentId:n}),[c,p,g]=to(o==null?void 0:o.reducer,r);function y(s,m){const v=(h,f)=>{const{prevState:w}=f;if(!n)throw new Error("Node id is not set");Xn(h,l,w,o==null?void 0:o.reducer,a).then(D=>u(D)).catch(console.error)};p(Yn(s,i,a),v,m)}return{dispatch:y,document:c,error:g}}function oo(e){const{documentId:t,documentType:n,documentModelModule:o,user:r}=e,a=Tt(),i=me(),{sign:l}=he(),u=Jn(a,{documentId:t,documentType:n});return no(a,{nodeId:t,document:u,documentModelModule:o,connectDid:i,sign:l,user:r})}function ro(e,t,n){const o=fe()||void 0,r=me(),{sign:a}=he(),i=e==null?void 0:e.header.documentType,l=W(),u=I(()=>i?l(i):void 0,[i,l]);return b((p,g)=>{const y=(s,m)=>{if(!(e!=null&&e.header.id))return;const{prevState:v}=m;ze(s,a,e.header.id,v,u==null?void 0:u.reducer,o).then(h=>{var f;return(f=window.documentEditorDebugTools)==null||f.pushOperation(s),n(h)}).catch(Ue.error)};t(Re(p,r,o),y,g)},[t,r,u==null?void 0:u.reducer,n,e==null?void 0:e.header.id,a,o])}function so(e,t,n){const{t:o}=j(),{showModal:r}=J(),a=ue(We),i=fe()||void 0,l=Pe();_();const u=hn(e==null?void 0:e.header.id),c=X(),p=I(()=>({theme:a,user:i}),[a,i]),g=W(),y=!!e&&(e.header.revision.global>0||e.header.revision.local>0),s=!!(e!=null&&e.clipboard.length),m=ro(e,t,n),v=b(()=>{m(_e())},[m]),h=b(()=>{m(Ke())},[m]),f=b(()=>{c(u==null?void 0:u.id)},[u,c]),w=b(N=>{const L=je(N);if(L.length)r("confirmationModal",{title:o("modals.exportDocumentWithErrors.title"),body:C("div",{children:[d("p",{children:o("modals.exportDocumentWithErrors.body")}),d("ul",{className:"mt-4 flex list-disc flex-col items-start px-4 text-xs",children:L.map((x,H)=>d("li",{children:x.message},H))})]}),cancelLabel:o("common.cancel"),continueLabel:o("common.export"),onCancel(x){x()},onContinue(x){return x(),Q(N,g)}});else return Q(N,g)},[g,r,o]),D=b(()=>{if(e)return w(e)},[w,e]),[A,S]=F(!1),E=b(()=>S(!0),[]);return{dispatch:m,revisionHistoryVisible:A,context:p,canUndo:y,canRedo:s,undo:v,redo:h,onClose:f,onExport:D,onShowRevisionHistory:E,isAllowedToCreateDocuments:(l==null?void 0:l.isAllowedToCreateDocuments)??!1,isAllowedToEditDocuments:(l==null?void 0:l.isAllowedToEditDocuments)??!1}}function io(){const e=_(),t=pe(),n=pn(),o=X(),{addFolder:r,addFile:a,renameNode:i,copyNode:l,moveNode:u}=$(),c=b(async(h,f)=>{if(!(e!=null&&e.header.id))return;const w=h.name.replace(/\.zip$/gim,"");return await a(h,e.header.id,w,f==null?void 0:f.id)},[a,e==null?void 0:e.header.id]),p=b(async(h,f)=>{if(e!=null&&e.header.id)return await r(e.header.id,h,f==null?void 0:f.id)},[r,e==null?void 0:e.header.id]),g=b(async(h,f)=>{if(e!=null&&e.header.id)return await i(e.header.id,f.id,h)},[i,e==null?void 0:e.header.id]),y=b(async(h,f)=>{await l(h,f)},[l]),s=b(async(h,f)=>{await u(h,f)},[u]),m=b(async h=>{await l(h,t??n)},[l,t,n]),v=b(async h=>{if(!h)return;const f=await p(h,t??n);f&&o(f.id)},[p,t,n,o]);return I(()=>({onAddFile:c,onAddFolder:p,onRenameNode:g,onCopyNode:y,onMoveNode:s,onDuplicateNode:m,onAddAndSelectNewFolder:v}),[p,c,y,s,g,m,v])}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)({}).hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},de.apply(null,arguments)}var Xe=["shift","alt","meta","mod","ctrl"],ao={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function O(e){return(e&&ao[e]||e||"").trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function co(e){return Xe.includes(e)}function se(e,t){return t===void 0&&(t=","),e.split(t)}function ie(e,t,n){t===void 0&&(t="+");var o=e.toLocaleLowerCase().split(t).map(function(i){return O(i)}),r={alt:o.includes("alt"),ctrl:o.includes("ctrl")||o.includes("control"),shift:o.includes("shift"),meta:o.includes("meta"),mod:o.includes("mod")},a=o.filter(function(i){return!Xe.includes(i)});return de({},r,{keys:a,description:n,hotkey:e})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(e){e.key!==void 0&&Ye([O(e.key),O(e.code)])}),document.addEventListener("keyup",function(e){e.key!==void 0&&Ze([O(e.key),O(e.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){P.clear()})})();var P=new Set;function ve(e){return Array.isArray(e)}function lo(e,t){t===void 0&&(t=",");var n=ve(e)?e:e.split(t);return n.every(function(o){return P.has(o.trim().toLowerCase())})}function Ye(e){var t=Array.isArray(e)?e:[e];P.has("meta")&&P.forEach(function(n){return!co(n)&&P.delete(n.toLowerCase())}),t.forEach(function(n){return P.add(n.toLowerCase())})}function Ze(e){var t=Array.isArray(e)?e:[e];e==="meta"?P.clear():t.forEach(function(n){return P.delete(n.toLowerCase())})}function uo(e,t,n){(typeof n=="function"&&n(e,t)||n===!0)&&e.preventDefault()}function fo(e,t,n){return typeof n=="function"?n(e,t):n===!0||n===void 0}function mo(e){return et(e,["input","textarea","select"])}function et(e,t){t===void 0&&(t=!1);var n=e.target,o=e.composed,r=null;return ho(n)&&o?r=e.composedPath()[0]&&e.composedPath()[0].tagName:r=n&&n.tagName,ve(t)?!!(r&&t&&t.some(function(a){var i;return a.toLowerCase()===((i=r)==null?void 0:i.toLowerCase())})):!!(r&&t&&t)}function ho(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}function po(e,t){return e.length===0&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):t?e.some(function(n){return t.includes(n)})||e.includes("*"):!0}var yo=function(t,n,o){o===void 0&&(o=!1);var r=n.alt,a=n.meta,i=n.mod,l=n.shift,u=n.ctrl,c=n.keys,p=t.key,g=t.code,y=t.ctrlKey,s=t.metaKey,m=t.shiftKey,v=t.altKey,h=O(g),f=p.toLowerCase();if(!(c!=null&&c.includes(h))&&!(c!=null&&c.includes(f))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(h))return!1;if(!o){if(r===!v&&f!=="alt"||l===!m&&f!=="shift")return!1;if(i){if(!s&&!y)return!1}else if(a===!s&&f!=="meta"&&f!=="os"||u===!y&&f!=="ctrl"&&f!=="control")return!1}return c&&c.length===1&&(c.includes(f)||c.includes(h))?!0:c?lo(c):!c},go=ce(void 0),vo=function(){return le(go)};function tt(e,t){return e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,o){return n&&tt(e[o],t[o])},!0):e===t}var wo=ce({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),bo=function(){return le(wo)};function Do(e){var t=q(void 0);return tt(t.current,e)||(t.current=e),t.current}var Ie=function(t){t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},Eo=typeof window<"u"?pt:M;function Me(e,t,n,o){var r=F(null),a=r[0],i=r[1],l=q(!1),u=n instanceof Array?o instanceof Array?void 0:o:n,c=ve(e)?e.join(u==null?void 0:u.splitKey):e,p=n instanceof Array?n:o instanceof Array?o:void 0,g=b(t,p??[]),y=q(g);p?y.current=g:y.current=t;var s=Do(u),m=bo(),v=m.enabledScopes,h=vo();return Eo(function(){if(!((s==null?void 0:s.enabled)===!1||!po(v,s==null?void 0:s.scopes))){var f=function(E,N){var L;if(N===void 0&&(N=!1),!(mo(E)&&!et(E,s==null?void 0:s.enableOnFormTags))){if(a!==null){var x=a.getRootNode();if((x instanceof Document||x instanceof ShadowRoot)&&x.activeElement!==a&&!a.contains(x.activeElement)){Ie(E);return}}(L=E.target)!=null&&L.isContentEditable&&!(s!=null&&s.enableOnContentEditable)||se(c,s==null?void 0:s.splitKey).forEach(function(H){var R,T=ie(H,s==null?void 0:s.combinationKey);if(yo(E,T,s==null?void 0:s.ignoreModifiers)||(R=T.keys)!=null&&R.includes("*")){if(s!=null&&s.ignoreEventWhen!=null&&s.ignoreEventWhen(E)||N&&l.current)return;if(uo(E,T,s==null?void 0:s.preventDefault),!fo(E,T,s==null?void 0:s.enabled)){Ie(E);return}y.current(E,T),N||(l.current=!0)}})}},w=function(E){E.key!==void 0&&(Ye(O(E.code)),((s==null?void 0:s.keydown)===void 0&&(s==null?void 0:s.keyup)!==!0||s!=null&&s.keydown)&&f(E))},D=function(E){E.key!==void 0&&(Ze(O(E.code)),l.current=!1,s!=null&&s.keyup&&f(E,!0))},A=a||(u==null?void 0:u.document)||document;return A.addEventListener("keyup",D,u==null?void 0:u.eventListenerOptions),A.addEventListener("keydown",w,u==null?void 0:u.eventListenerOptions),h&&se(c,s==null?void 0:s.splitKey).forEach(function(S){return h.addHotkey(ie(S,s==null?void 0:s.combinationKey,s==null?void 0:s.description))}),function(){A.removeEventListener("keyup",D,u==null?void 0:u.eventListenerOptions),A.removeEventListener("keydown",w,u==null?void 0:u.eventListenerOptions),h&&se(c,s==null?void 0:s.splitKey).forEach(function(S){return h.removeHotkey(ie(S,s==null?void 0:s.combinationKey,s==null?void 0:s.description))})}}},[a,c,s,v]),i}const So=e=>{var u;const{undo:t,redo:n,canRedo:o,canUndo:r}=e,{isMac:a}=((u=window.electronAPI)==null?void 0:u.platformInfo)||{};let i="ctrl+z",l="ctrl+y";a&&(i="mod+z",l="mod+shift+z"),Me(i,c=>{c.preventDefault(),r&&t()},{},[r,t]),Me(l,c=>{c.preventDefault(),o&&n()},{},[o,n])};function Uo(){const{addFile:e}=$(),t=_(),n=pe(),o=ye();return M(()=>{var r;return(r=window.electronAPI)==null?void 0:r.handleFileOpen(async a=>{!(t!=null&&t.header.id)||!(o!=null&&o.header.id)||await e(a.content,t.header.id,a.name,n==null?void 0:n.id)})},[t==null?void 0:t.header.id,n==null?void 0:n.id,o==null?void 0:o.header.id,e]),C(No,{children:[d(Wn,{}),d(qn,{}),d(xo,{})]})}function No({children:e}){return d("div",{className:"flex h-full flex-col overflow-auto",id:"content-view",children:e})}function xo(){const{pathname:e}=cn(),t=Ft(),n=It(),o=yn(),r=gn(),a=nn(),i=Mt(),l=Ht(),[u]=Ot(),c=b(m=>{i(m.header.id)},[i]),p=b(()=>{a()},[a]),g=n.state==="loading"||o.state==="loading"||r.state==="loading",y=n.state==="hasError"||o.state==="hasError"||r.state==="hasError",s=!g&&!y&&(!!n.data||!!o.data||!!r.data);return e!=="/"||s?null:C(Yt,{children:[t==null?void 0:t.map(m=>{var f;const v=(f=m.header.meta)==null?void 0:f.preferredEditor,h=v?l(v):void 0;return d(Zt,{title:m.state.global.name,description:h||"Drive Explorer App",icon:d(on,{drive:m}),onClick:()=>c(m)},m.header.id)}),u.drives.addDriveEnabled&&d(en,{onClick:p})]})}export{Uo as default};
3
+ //# sourceMappingURL=content.Di1_TxLo.js.map