@pickaxeproject/react 0.0.12 → 0.0.14

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 (204) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/.storybook/main.d.ts +3 -0
  3. package/dist/cjs/components/Core/Button.js +1 -0
  4. package/dist/cjs/components/Core/CopyButton.js +1 -1
  5. package/dist/cjs/components/Core/ErrorAlert.js +1 -1
  6. package/dist/cjs/components/Core/Tooltip.js +1 -1
  7. package/dist/cjs/components/Icons/attach.svg.js +1 -1
  8. package/dist/cjs/components/Pickaxe/Addons/Document/List.js +1 -1
  9. package/dist/cjs/components/Pickaxe/Chat/History/index.js +1 -1
  10. package/dist/cjs/components/Pickaxe/Form/Head.js +1 -1
  11. package/dist/cjs/components/Pickaxe/Form/History/Item.js +1 -1
  12. package/dist/cjs/components/Pickaxe/Form/History/Response.js +1 -1
  13. package/dist/cjs/components/Pickaxe/Form/NewChat.js +1 -1
  14. package/dist/cjs/components/Pickaxe/Form/Questions/Document.js +1 -1
  15. package/dist/cjs/components/Pickaxe/Form/Questions/Input.js +1 -1
  16. package/dist/cjs/components/Pickaxe/Form/Questions/Option.js +1 -1
  17. package/dist/cjs/components/Pickaxe/Form/Questions/Submit.js +1 -1
  18. package/dist/cjs/components/Pickaxe/Form/index.js +1 -1
  19. package/dist/cjs/components/Pickaxe/InfoModal.js +1 -1
  20. package/dist/cjs/components/Pickaxe/Provider.js +1 -1
  21. package/dist/cjs/components/Pickaxe/common/PickaxeButton.js +1 -0
  22. package/dist/cjs/components/Pickaxe/index.js +1 -1
  23. package/dist/cjs/hooks/studio/useStyleButton.js +1 -0
  24. package/dist/cjs/hooks/studio/useStyleInput.js +1 -0
  25. package/dist/{esm → cjs/src}/components/Pickaxe/Provider.d.ts +14 -2
  26. package/dist/cjs/src/components/Pickaxe/common/PickaxeButton.d.ts +3 -0
  27. package/dist/cjs/{components → src/components}/Pickaxe/index.d.ts +1 -1
  28. package/dist/cjs/{hooks → src/hooks}/pickaxe/usePickaxeContext.d.ts +1 -0
  29. package/dist/cjs/src/hooks/studio/useStyleButton.d.ts +7 -0
  30. package/dist/cjs/src/hooks/studio/useStyleInput.d.ts +2 -0
  31. package/dist/cjs/src/types/studio.d.ts +3 -0
  32. package/dist/esm/.storybook/main.d.ts +3 -0
  33. package/dist/esm/components/Core/Button.js +1 -0
  34. package/dist/esm/components/Core/CopyButton.js +1 -1
  35. package/dist/esm/components/Core/ErrorAlert.js +1 -1
  36. package/dist/esm/components/Core/Tooltip.js +1 -1
  37. package/dist/esm/components/Icons/attach.svg.js +1 -1
  38. package/dist/esm/components/Pickaxe/Addons/Document/List.js +1 -1
  39. package/dist/esm/components/Pickaxe/Chat/History/index.js +1 -1
  40. package/dist/esm/components/Pickaxe/Form/Head.js +1 -1
  41. package/dist/esm/components/Pickaxe/Form/History/Item.js +1 -1
  42. package/dist/esm/components/Pickaxe/Form/History/Response.js +1 -1
  43. package/dist/esm/components/Pickaxe/Form/NewChat.js +1 -1
  44. package/dist/esm/components/Pickaxe/Form/Questions/Document.js +1 -1
  45. package/dist/esm/components/Pickaxe/Form/Questions/Input.js +1 -1
  46. package/dist/esm/components/Pickaxe/Form/Questions/Option.js +1 -1
  47. package/dist/esm/components/Pickaxe/Form/Questions/Submit.js +1 -1
  48. package/dist/esm/components/Pickaxe/Form/index.js +1 -1
  49. package/dist/esm/components/Pickaxe/InfoModal.js +1 -1
  50. package/dist/esm/components/Pickaxe/Provider.js +1 -1
  51. package/dist/esm/components/Pickaxe/common/PickaxeButton.js +1 -0
  52. package/dist/esm/components/Pickaxe/index.js +1 -1
  53. package/dist/esm/hooks/studio/useStyleButton.js +1 -0
  54. package/dist/esm/hooks/studio/useStyleInput.js +1 -0
  55. package/dist/{cjs → esm/src}/components/Pickaxe/Provider.d.ts +14 -2
  56. package/dist/esm/src/components/Pickaxe/common/PickaxeButton.d.ts +3 -0
  57. package/dist/esm/{components → src/components}/Pickaxe/index.d.ts +1 -1
  58. package/dist/esm/{hooks → src/hooks}/pickaxe/usePickaxeContext.d.ts +1 -0
  59. package/dist/esm/src/hooks/studio/useStyleButton.d.ts +7 -0
  60. package/dist/esm/src/hooks/studio/useStyleInput.d.ts +2 -0
  61. package/dist/esm/src/types/studio.d.ts +3 -0
  62. package/package.json +24 -3
  63. /package/dist/cjs/{common → src/common}/api/index.d.ts +0 -0
  64. /package/dist/cjs/{common → src/common}/api/streamer.d.ts +0 -0
  65. /package/dist/cjs/{common → src/common}/api/utils.d.ts +0 -0
  66. /package/dist/cjs/{common → src/common}/cn.d.ts +0 -0
  67. /package/dist/cjs/{common → src/common}/documents.d.ts +0 -0
  68. /package/dist/cjs/{common → src/common}/error.d.ts +0 -0
  69. /package/dist/cjs/{common → src/common}/renderer.d.ts +0 -0
  70. /package/dist/cjs/{common → src/common}/utils.d.ts +0 -0
  71. /package/dist/cjs/{components → src/components}/Core/Button.d.ts +0 -0
  72. /package/dist/cjs/{components → src/components}/Core/CopyButton.d.ts +0 -0
  73. /package/dist/cjs/{components → src/components}/Core/ErrorAlert.d.ts +0 -0
  74. /package/dist/cjs/{components → src/components}/Core/HtmlRenderer.d.ts +0 -0
  75. /package/dist/cjs/{components → src/components}/Core/MarkdownRenderer.d.ts +0 -0
  76. /package/dist/cjs/{components → src/components}/Core/Menu/Button.d.ts +0 -0
  77. /package/dist/cjs/{components → src/components}/Core/Menu/List.d.ts +0 -0
  78. /package/dist/cjs/{components → src/components}/Core/Menu/index.d.ts +0 -0
  79. /package/dist/cjs/{components → src/components}/Core/Modal/Body.d.ts +0 -0
  80. /package/dist/cjs/{components → src/components}/Core/Modal/CloseButton.d.ts +0 -0
  81. /package/dist/cjs/{components → src/components}/Core/Modal/index.d.ts +0 -0
  82. /package/dist/cjs/{components → src/components}/Core/PickaxeIcon.d.ts +0 -0
  83. /package/dist/cjs/{components → src/components}/Core/ScrollArea.d.ts +0 -0
  84. /package/dist/cjs/{components → src/components}/Core/Skeleton.d.ts +0 -0
  85. /package/dist/cjs/{components → src/components}/Core/Textarea.d.ts +0 -0
  86. /package/dist/cjs/{components → src/components}/Core/Tooltip.d.ts +0 -0
  87. /package/dist/cjs/{components → src/components}/Pickaxe/Addons/Document/List.d.ts +0 -0
  88. /package/dist/cjs/{components → src/components}/Pickaxe/Addons/Document/Provider.d.ts +0 -0
  89. /package/dist/cjs/{components → src/components}/Pickaxe/Addons/Document/hooks/useDocument.d.ts +0 -0
  90. /package/dist/cjs/{components → src/components}/Pickaxe/Addons/Document/hooks/useDocumentContext.d.ts +0 -0
  91. /package/dist/cjs/{components → src/components}/Pickaxe/Addons/IceBreaker/Breaker.d.ts +0 -0
  92. /package/dist/cjs/{components → src/components}/Pickaxe/Addons/IceBreaker/index.d.ts +0 -0
  93. /package/dist/cjs/{components → src/components}/Pickaxe/Addons/Scroll/Provider.d.ts +0 -0
  94. /package/dist/cjs/{components → src/components}/Pickaxe/Addons/Scroll/ScrollLockView.d.ts +0 -0
  95. /package/dist/cjs/{components → src/components}/Pickaxe/Addons/Scroll/hooks/useScroll.d.ts +0 -0
  96. /package/dist/cjs/{components → src/components}/Pickaxe/Addons/Scroll/hooks/useScrollContext.d.ts +0 -0
  97. /package/dist/cjs/{components → src/components}/Pickaxe/Chat/History/Message.d.ts +0 -0
  98. /package/dist/cjs/{components → src/components}/Pickaxe/Chat/History/index.d.ts +0 -0
  99. /package/dist/cjs/{components → src/components}/Pickaxe/Chat/Input.d.ts +0 -0
  100. /package/dist/cjs/{components → src/components}/Pickaxe/Chat/index.d.ts +0 -0
  101. /package/dist/cjs/{components → src/components}/Pickaxe/Form/Head.d.ts +0 -0
  102. /package/dist/cjs/{components → src/components}/Pickaxe/Form/History/Container.d.ts +0 -0
  103. /package/dist/cjs/{components → src/components}/Pickaxe/Form/History/Item.d.ts +0 -0
  104. /package/dist/cjs/{components → src/components}/Pickaxe/Form/History/Response.d.ts +0 -0
  105. /package/dist/cjs/{components → src/components}/Pickaxe/Form/History/index.d.ts +0 -0
  106. /package/dist/cjs/{components → src/components}/Pickaxe/Form/NewChat.d.ts +0 -0
  107. /package/dist/cjs/{components → src/components}/Pickaxe/Form/Questions/Checkbox.d.ts +0 -0
  108. /package/dist/cjs/{components → src/components}/Pickaxe/Form/Questions/Document.d.ts +0 -0
  109. /package/dist/cjs/{components → src/components}/Pickaxe/Form/Questions/Dropdown.d.ts +0 -0
  110. /package/dist/cjs/{components → src/components}/Pickaxe/Form/Questions/Input.d.ts +0 -0
  111. /package/dist/cjs/{components → src/components}/Pickaxe/Form/Questions/Option.d.ts +0 -0
  112. /package/dist/cjs/{components → src/components}/Pickaxe/Form/Questions/Submit.d.ts +0 -0
  113. /package/dist/cjs/{components → src/components}/Pickaxe/Form/Questions/index.d.ts +0 -0
  114. /package/dist/cjs/{components → src/components}/Pickaxe/Form/index.d.ts +0 -0
  115. /package/dist/cjs/{components → src/components}/Pickaxe/InfoModal.d.ts +0 -0
  116. /package/dist/cjs/{components → src/components}/Pickaxe/ResponseProvider.d.ts +0 -0
  117. /package/dist/cjs/{hooks → src/hooks}/core/useHover.d.ts +0 -0
  118. /package/dist/cjs/{hooks → src/hooks}/core/useMediaQuery.d.ts +0 -0
  119. /package/dist/cjs/{hooks → src/hooks}/core/useOutsideAlerter.d.ts +0 -0
  120. /package/dist/cjs/{hooks → src/hooks}/pickaxe/useConversation.d.ts +0 -0
  121. /package/dist/cjs/{hooks → src/hooks}/pickaxe/useHistory.d.ts +0 -0
  122. /package/dist/cjs/{hooks → src/hooks}/pickaxe/usePickaxe.d.ts +0 -0
  123. /package/dist/cjs/{hooks → src/hooks}/pickaxe/useResponseContext.d.ts +0 -0
  124. /package/dist/cjs/{hooks → src/hooks}/pickaxe/useSubmit.d.ts +0 -0
  125. /package/dist/cjs/{hooks → src/hooks}/pickaxe/useSubmitDocument.d.ts +0 -0
  126. /package/dist/cjs/{hooks → src/hooks}/pickaxe/useSubmitResult.d.ts +0 -0
  127. /package/dist/cjs/{index.d.ts → src/index.d.ts} +0 -0
  128. /package/dist/cjs/{types → src/types}/chat.d.ts +0 -0
  129. /package/dist/cjs/{types → src/types}/common.d.ts +0 -0
  130. /package/dist/cjs/{types → src/types}/document.d.ts +0 -0
  131. /package/dist/cjs/{types → src/types}/form.d.ts +0 -0
  132. /package/dist/cjs/{types → src/types}/history.d.ts +0 -0
  133. /package/dist/cjs/{types → src/types}/pickaxe.d.ts +0 -0
  134. /package/dist/esm/{common → src/common}/api/index.d.ts +0 -0
  135. /package/dist/esm/{common → src/common}/api/streamer.d.ts +0 -0
  136. /package/dist/esm/{common → src/common}/api/utils.d.ts +0 -0
  137. /package/dist/esm/{common → src/common}/cn.d.ts +0 -0
  138. /package/dist/esm/{common → src/common}/documents.d.ts +0 -0
  139. /package/dist/esm/{common → src/common}/error.d.ts +0 -0
  140. /package/dist/esm/{common → src/common}/renderer.d.ts +0 -0
  141. /package/dist/esm/{common → src/common}/utils.d.ts +0 -0
  142. /package/dist/esm/{components → src/components}/Core/Button.d.ts +0 -0
  143. /package/dist/esm/{components → src/components}/Core/CopyButton.d.ts +0 -0
  144. /package/dist/esm/{components → src/components}/Core/ErrorAlert.d.ts +0 -0
  145. /package/dist/esm/{components → src/components}/Core/HtmlRenderer.d.ts +0 -0
  146. /package/dist/esm/{components → src/components}/Core/MarkdownRenderer.d.ts +0 -0
  147. /package/dist/esm/{components → src/components}/Core/Menu/Button.d.ts +0 -0
  148. /package/dist/esm/{components → src/components}/Core/Menu/List.d.ts +0 -0
  149. /package/dist/esm/{components → src/components}/Core/Menu/index.d.ts +0 -0
  150. /package/dist/esm/{components → src/components}/Core/Modal/Body.d.ts +0 -0
  151. /package/dist/esm/{components → src/components}/Core/Modal/CloseButton.d.ts +0 -0
  152. /package/dist/esm/{components → src/components}/Core/Modal/index.d.ts +0 -0
  153. /package/dist/esm/{components → src/components}/Core/PickaxeIcon.d.ts +0 -0
  154. /package/dist/esm/{components → src/components}/Core/ScrollArea.d.ts +0 -0
  155. /package/dist/esm/{components → src/components}/Core/Skeleton.d.ts +0 -0
  156. /package/dist/esm/{components → src/components}/Core/Textarea.d.ts +0 -0
  157. /package/dist/esm/{components → src/components}/Core/Tooltip.d.ts +0 -0
  158. /package/dist/esm/{components → src/components}/Pickaxe/Addons/Document/List.d.ts +0 -0
  159. /package/dist/esm/{components → src/components}/Pickaxe/Addons/Document/Provider.d.ts +0 -0
  160. /package/dist/esm/{components → src/components}/Pickaxe/Addons/Document/hooks/useDocument.d.ts +0 -0
  161. /package/dist/esm/{components → src/components}/Pickaxe/Addons/Document/hooks/useDocumentContext.d.ts +0 -0
  162. /package/dist/esm/{components → src/components}/Pickaxe/Addons/IceBreaker/Breaker.d.ts +0 -0
  163. /package/dist/esm/{components → src/components}/Pickaxe/Addons/IceBreaker/index.d.ts +0 -0
  164. /package/dist/esm/{components → src/components}/Pickaxe/Addons/Scroll/Provider.d.ts +0 -0
  165. /package/dist/esm/{components → src/components}/Pickaxe/Addons/Scroll/ScrollLockView.d.ts +0 -0
  166. /package/dist/esm/{components → src/components}/Pickaxe/Addons/Scroll/hooks/useScroll.d.ts +0 -0
  167. /package/dist/esm/{components → src/components}/Pickaxe/Addons/Scroll/hooks/useScrollContext.d.ts +0 -0
  168. /package/dist/esm/{components → src/components}/Pickaxe/Chat/History/Message.d.ts +0 -0
  169. /package/dist/esm/{components → src/components}/Pickaxe/Chat/History/index.d.ts +0 -0
  170. /package/dist/esm/{components → src/components}/Pickaxe/Chat/Input.d.ts +0 -0
  171. /package/dist/esm/{components → src/components}/Pickaxe/Chat/index.d.ts +0 -0
  172. /package/dist/esm/{components → src/components}/Pickaxe/Form/Head.d.ts +0 -0
  173. /package/dist/esm/{components → src/components}/Pickaxe/Form/History/Container.d.ts +0 -0
  174. /package/dist/esm/{components → src/components}/Pickaxe/Form/History/Item.d.ts +0 -0
  175. /package/dist/esm/{components → src/components}/Pickaxe/Form/History/Response.d.ts +0 -0
  176. /package/dist/esm/{components → src/components}/Pickaxe/Form/History/index.d.ts +0 -0
  177. /package/dist/esm/{components → src/components}/Pickaxe/Form/NewChat.d.ts +0 -0
  178. /package/dist/esm/{components → src/components}/Pickaxe/Form/Questions/Checkbox.d.ts +0 -0
  179. /package/dist/esm/{components → src/components}/Pickaxe/Form/Questions/Document.d.ts +0 -0
  180. /package/dist/esm/{components → src/components}/Pickaxe/Form/Questions/Dropdown.d.ts +0 -0
  181. /package/dist/esm/{components → src/components}/Pickaxe/Form/Questions/Input.d.ts +0 -0
  182. /package/dist/esm/{components → src/components}/Pickaxe/Form/Questions/Option.d.ts +0 -0
  183. /package/dist/esm/{components → src/components}/Pickaxe/Form/Questions/Submit.d.ts +0 -0
  184. /package/dist/esm/{components → src/components}/Pickaxe/Form/Questions/index.d.ts +0 -0
  185. /package/dist/esm/{components → src/components}/Pickaxe/Form/index.d.ts +0 -0
  186. /package/dist/esm/{components → src/components}/Pickaxe/InfoModal.d.ts +0 -0
  187. /package/dist/esm/{components → src/components}/Pickaxe/ResponseProvider.d.ts +0 -0
  188. /package/dist/esm/{hooks → src/hooks}/core/useHover.d.ts +0 -0
  189. /package/dist/esm/{hooks → src/hooks}/core/useMediaQuery.d.ts +0 -0
  190. /package/dist/esm/{hooks → src/hooks}/core/useOutsideAlerter.d.ts +0 -0
  191. /package/dist/esm/{hooks → src/hooks}/pickaxe/useConversation.d.ts +0 -0
  192. /package/dist/esm/{hooks → src/hooks}/pickaxe/useHistory.d.ts +0 -0
  193. /package/dist/esm/{hooks → src/hooks}/pickaxe/usePickaxe.d.ts +0 -0
  194. /package/dist/esm/{hooks → src/hooks}/pickaxe/useResponseContext.d.ts +0 -0
  195. /package/dist/esm/{hooks → src/hooks}/pickaxe/useSubmit.d.ts +0 -0
  196. /package/dist/esm/{hooks → src/hooks}/pickaxe/useSubmitDocument.d.ts +0 -0
  197. /package/dist/esm/{hooks → src/hooks}/pickaxe/useSubmitResult.d.ts +0 -0
  198. /package/dist/esm/{index.d.ts → src/index.d.ts} +0 -0
  199. /package/dist/esm/{types → src/types}/chat.d.ts +0 -0
  200. /package/dist/esm/{types → src/types}/common.d.ts +0 -0
  201. /package/dist/esm/{types → src/types}/document.d.ts +0 -0
  202. /package/dist/esm/{types → src/types}/form.d.ts +0 -0
  203. /package/dist/esm/{types → src/types}/history.d.ts +0 -0
  204. /package/dist/esm/{types → src/types}/pickaxe.d.ts +0 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Pickaxe - React
2
2
 
3
- > Client utility library for Pickaxe display
3
+ > Client utility library for Pickaxe
4
4
 
5
5
  ## How to publish
6
6
 
@@ -0,0 +1,3 @@
1
+ import type { StorybookConfig } from "@storybook/react-vite";
2
+ declare const config: StorybookConfig;
3
+ export default config;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),i=require("../../common/cn.js");const r=n.forwardRef(((r,o)=>{var{style:a,variant:s="primary",className:l,loadingText:c="Loading",isDisabled:d=!1,isLoading:u=!1}=r,p=e.__rest(r,["style","variant","className","loadingText","isDisabled","isLoading"]);const m=n.useMemo((()=>d||u?{"aria-disabled":!0,disabled:!0,style:Object.assign({cursor:"not-allowed",opacity:.5},a),onClick:e=>{e.preventDefault()}}:{style:a}),[a,d,u]),x=n.useMemo((()=>u?Array.isArray(p.children)&&p.children.length>1?{children:t.jsxs(t.Fragment,{children:[p.children[0],c]})}:{children:c}:{}),[u,c]);return t.jsx("button",Object.assign({ref:o,className:i.default("primary"===s&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-c-blue bg-c-blue px-4 text-sm font-semibold text-white outline-none duration-300 hover:opacity-70 active:opacity-100","secondary"===s&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm bg-c-light-blue p-1 px-4 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","outline"===s&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-c-blue p-1 px-4 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","transparent"===s&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-transparent bg-transparent px-4 py-1 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","transparent-text"===s&&"flex select-none items-center justify-center gap-x-2 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","menu-item"===s&&"flex w-full select-none items-center gap-2 px-4 py-2 text-left text-sm font-semilight outline-none duration-300 hover:opacity-70 active:opacity-100",l)},p,m,x))}));r.displayName="Button",exports.default=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("react"),a=require("copy-to-clipboard"),o=require("../Icons/copied.svg.js"),i=require("../Icons/copy.svg.js"),s=require("../../common/cn.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(a);exports.default=a=>{var{className:c="",inactiveColor:n="text-c-dark-gray hover:text-c-blue",activeColor:u="text-c-blue",size:d=16,text:f=""}=a,h=e.__rest(a,["className","inactiveColor","activeColor","size","text"]);const[p,m]=r.useState(f),[v,j]=r.useState(!1);r.useEffect((()=>{m(f)}),[f]);return t.jsx("button",Object.assign({style:Object.assign(Object.assign({},h),{width:`${d}px`,height:`${d}px`,cursor:v?"default":"pointer"}),className:s.default("outline-none hover:duration-300",c),onClick:t=>{t.preventDefault(),t.stopPropagation(),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{if(v)return;j(!0);const t=null!==(e=[...Array.from(f.matchAll(/https:\/\/streaming\.pickaxeproject\.com\/api\/function_call_results\?.*?&name=[^&]+/g)),...Array.from(f.matchAll(/https:\/\/utils\.pickaxe\.chat\/api\/fn\/result\?.*?&name=[^&]+/g))].map((e=>e[0])))&&void 0!==e?e:[],r=[];if(t.length){for(const e of t)try{const t=yield fetch(e),a=yield t.json(),o=a.text||a.url||"";r.push(o)}catch(e){console.error(e)}r.length&&m(r.join("\n"))}l.default(r.length>0?r.join("\n"):p),yield new Promise((e=>setTimeout(e,1500))),j(!1)}catch(e){console.error(e)}finally{j(!1)}}))}},{children:v?t.jsx(o.default,{className:s.default(u),width:d,height:d}):t.jsx(i.default,{className:s.default(n),width:d,height:d})}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("react"),o=require("copy-to-clipboard"),i=require("../Icons/copied.svg.js"),a=require("../Icons/copy.svg.js"),s=require("../../common/cn.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=n(o);exports.default=o=>{var{className:n="",inactiveColor:l="text-[#6A747C] hover:text-[#228DD7]",activeColor:u="text-[#228DD7]",size:f=16,text:d=""}=o,h=e.__rest(o,["className","inactiveColor","activeColor","size","text"]);const[p,m]=r.useState(d),[v,j]=r.useState(!1);r.useEffect((()=>{m(d)}),[d]);return t.jsx("button",Object.assign({style:Object.assign(Object.assign({},h),{width:`${f}px`,height:`${f}px`,cursor:v?"default":"pointer"}),className:s.default("outline-none hover:duration-300",n),onClick:t=>{t.preventDefault(),t.stopPropagation(),e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{if(v)return;j(!0);const t=null!==(e=[...Array.from(d.matchAll(/https:\/\/streaming\.pickaxeproject\.com\/api\/function_call_results\?.*?&name=[^&]+/g)),...Array.from(d.matchAll(/https:\/\/utils\.pickaxe\.chat\/api\/fn\/result\?.*?&name=[^&]+/g))].map((e=>e[0])))&&void 0!==e?e:[],r=[];if(t.length){for(const e of t)try{const t=yield fetch(e),o=yield t.json(),i=o.text||o.url||"";r.push(i)}catch(e){console.error(e)}r.length&&m(r.join("\n"))}c.default(r.length>0?r.join("\n"):p),yield new Promise((e=>setTimeout(e,1500))),j(!1)}catch(e){console.error(e)}finally{j(!1)}}))}},{children:v?t.jsx(i.default,{className:s.default(u),width:f,height:f}):t.jsx(a.default,{className:s.default(l),width:f,height:f})}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../Icons/circle-exclamation.svg.js"),r=require("./HtmlRenderer.js"),a=require("../../common/cn.js");exports.default=({error:t,className:l,iconClassName:c,htmlClassName:i})=>t?e.jsxs("div",Object.assign({className:a.default("flex items-center gap-2 text-red-500",l)},{children:[e.jsx(s.default,{className:a.default("h-5 w-5 shrink-0",c)}),e.jsx(r.default,{className:a.default("danger-error text-sm font-semibold",i),html:t})]})):null;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../Icons/circle-exclamation.svg.js"),r=require("./HtmlRenderer.js"),t=require("../../common/cn.js");exports.default=({error:a,className:l,iconClassName:c,htmlClassName:i})=>a?e.jsxs("div",Object.assign({className:t.default("flex items-center gap-2 text-red-500",l)},{children:[e.jsx(s.default,{className:t.default("h-5 w-5 shrink-0",c)}),e.jsx(r.default,{className:t.default("text-sm font-semibold",i),html:a})]})):null;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../Icons/circle-info.svg.js"),t=require("./Menu/index.js"),r=require("./Menu/Button.js"),i=require("./Menu/List.js"),n=require("../../common/cn.js");exports.default=({id:a,label:l="",icon:c=s.default,className:o,contentClassName:d,size:u=20,width:j="300px",border:x,align:h="right-start"})=>e.jsxs(t.default,Object.assign({id:a},{children:[e.jsx(r.default,{children:e.jsx(c,{className:n.default("shrink-0 cursor-help text-black/40 outline-none duration-300 hover:text-black/80 hover:duration-200",o),style:{width:u,height:u},onClick:e=>e.stopPropagation()})}),e.jsx(i.default,Object.assign({width:j,align:h,className:n.default("p-6",d)},x&&{border:x},{children:"string"==typeof l?e.jsx("div",Object.assign({className:"select-none px-2 py-1 text-[13px]"},{children:e.jsx("p",{children:l})})):l}))]}));
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../Icons/circle-info.svg.js"),t=require("./Menu/index.js"),i=require("./Menu/Button.js"),r=require("./Menu/List.js"),n=require("../../common/cn.js");exports.default=({id:a,label:l="",icon:o=s.default,className:c,contentClassName:d,size:u=20,width:j="300px",border:h,align:p="right-start"})=>e.jsxs(t.default,Object.assign({id:a},{children:[e.jsx(i.default,{children:e.jsx(o,{className:n.default("shrink-0 cursor-help outline-none duration-300 hover:opacity-80 hover:duration-200",c),style:{width:u,height:u},onClick:e=>e.stopPropagation()})}),e.jsx(r.default,Object.assign({width:j,align:p,className:n.default("p-6",d)},h&&{border:h},{children:"string"==typeof l?e.jsx("div",Object.assign({className:"select-none px-2 py-1 text-[13px]"},{children:e.jsx("p",{children:l})})):l}))]}));
@@ -1 +1 @@
1
- "use strict";function e(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}Object.defineProperty(exports,"__esModule",{value:!0});var r,t=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n.apply(null,arguments)}var a=e=>t.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),r||(r=t.createElement("path",{stroke:"#288DD7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m21.44 11.05-9.19 9.19a6.003 6.003 0 1 1-8.49-8.49l9.19-9.19a4.002 4.002 0 0 1 5.66 5.66l-9.2 9.19a2.001 2.001 0 1 1-2.83-2.83l8.49-8.48"})));exports.default=a;
1
+ "use strict";function e(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}Object.defineProperty(exports,"__esModule",{value:!0});var r,t=e(require("react"));function n(){return n=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},n.apply(null,arguments)}var o=e=>t.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),r||(r=t.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m21.44 11.05-9.19 9.19a6.003 6.003 0 1 1-8.49-8.49l9.19-9.19a4.002 4.002 0 0 1 5.66 5.66l-9.2 9.19a2.001 2.001 0 1 1-2.83-2.83l8.49-8.48"})));exports.default=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),r=require("./hooks/useDocumentContext.js"),t=require("framer-motion"),a=require("../../../Icons/document.svg.js"),i=require("../../../Icons/link.svg.js"),n=require("../../../Icons/youtube.svg.js"),o=require("../../../Icons/trash.svg.js"),c=require("../../../Icons/spinner-lines.svg.js"),l=require("../../../Core/Tooltip.js"),u=require("../../../../common/cn.js");exports.default=({className:d})=>{const{documents:m,isShowList:x,setDocuments:h}=r.useDocumentContext(),p=s.useCallback((e=>e.length>85?`${e.slice(0,25)}...${e.slice(-10)}`:e),[]);return e.jsx(t.AnimatePresence,{children:x&&e.jsx(t.motion.div,Object.assign({className:u.default("flex w-full flex-col gap-1",d),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},{children:m.filter((e=>!e.isInsertedAsRaw)).map((({type:s,name:r,status:t,error:u},d)=>e.jsxs("div",Object.assign({className:"group flex cursor-pointer justify-between gap-2 rounded-sm border border-transparent bg-white px-3 py-2 hover:border-[#E8EDF2] hover:shadow-sm hover:duration-300"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-2"},{children:["uploading"===t?e.jsx(c.default,{className:"h-6 w-6 shrink-0 animate-spin text-c-dark-gray"}):"failed"===t?e.jsx(l.default,{id:`document-upload-failed-${d}`,label:null!=u?u:"Upload failed. Please try again.",className:"text-c-red"}):"website"===s?e.jsx(i.default,{className:"h-6 w-6 shrink-0 text-c-dark-gray"}):"youtube"===s?e.jsx(n.default,{className:"h-6 w-6 shrink-0 text-c-dark-gray"}):e.jsx(a.default,{className:"h-6 w-6 shrink-0 text-c-dark-gray"}),e.jsx("p",Object.assign({className:"line-clamp-1 text-[14px] font-semilight text-black/70"},{children:p(r)}))]})),e.jsx("button",Object.assign({className:"opacity-0 outline-none group-hover:opacity-100 group-hover:duration-300",onClick:()=>{return e=d,void h((s=>s.filter(((s,r)=>r!==e))));var e}},{children:e.jsx(o.default,{className:"h-6 w-6 shrink-0 text-c-dark-gray hover:opacity-80 hover:duration-300"})}))]}),d)))}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),r=require("./hooks/useDocumentContext.js"),t=require("framer-motion"),a=require("../../../Icons/document.svg.js"),i=require("../../../Icons/link.svg.js"),n=require("../../../Icons/youtube.svg.js"),o=require("../../../Icons/trash.svg.js"),c=require("../../../Icons/spinner-lines.svg.js"),l=require("../../../Core/Tooltip.js"),u=require("../../../../common/cn.js");exports.default=({className:d})=>{const{documents:m,isShowList:p,setDocuments:x}=r.useDocumentContext(),h=s.useCallback((e=>e.length>85?`${e.slice(0,25)}...${e.slice(-10)}`:e),[]);return e.jsx(t.AnimatePresence,{children:p&&e.jsx(t.motion.div,Object.assign({className:u.default("flex w-full flex-col gap-1",d),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},{children:m.filter((e=>!e.isInsertedAsRaw)).map((({type:s,name:r,status:t,error:u},d)=>e.jsxs("div",Object.assign({className:"group flex cursor-pointer justify-between gap-2 rounded-sm border border-transparent bg-white px-3 py-2 hover:border-[#E8EDF2] hover:shadow-sm hover:duration-300"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-2"},{children:["uploading"===t?e.jsx(c.default,{className:"h-6 w-6 shrink-0 animate-spin text-c-dark-gray"}):"failed"===t?e.jsx(l.default,{id:`document-upload-failed-${d}`,label:null!=u?u:"Upload failed. Please try again.",className:"text-c-red"}):"website"===s?e.jsx(i.default,{className:"h-6 w-6 shrink-0 text-c-dark-gray"}):"youtube"===s?e.jsx(n.default,{className:"h-6 w-6 shrink-0 text-c-dark-gray"}):e.jsx(a.default,{className:"h-6 w-6 shrink-0 text-c-dark-gray"}),e.jsx("p",Object.assign({className:"line-clamp-1 text-[14px] font-semilight opacity-70"},{children:h(r)}))]})),e.jsx("button",Object.assign({className:"opacity-0 outline-none group-hover:opacity-100 group-hover:duration-300",onClick:()=>{return e=d,void x((s=>s.filter(((s,r)=>r!==e))));var e}},{children:e.jsx(o.default,{className:"h-6 w-6 shrink-0 text-c-dark-gray hover:opacity-80 hover:duration-300"})}))]}),d)))}))})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),l=require("../../../../hooks/pickaxe/useConversation.js"),i=require("../../../Icons/circle-info.svg.js"),c=require("../../../Core/PickaxeIcon.js"),n=require("../../Addons/Scroll/ScrollLockView.js"),r=require("../../InfoModal.js"),o=require("./Message.js"),d=require("../../../../common/cn.js"),x=require("../../../Core/HtmlRenderer.js");exports.default=()=>{var u;const{pickaxe:m,colors:j,isNewChat:f}=a.usePickaxeContext(),{messages:p,status:g,error:h}=t.useResponseContext(),b=l.useConversation(),[v,w]=s.useState(!1),N=s.useMemo((()=>!!b.data&&!(b.data.messages.length<=1)),[b.data]),k=s.useMemo((()=>b.isSuccess&&f&&!N),[b.isSuccess,f,N]);return e.jsxs("div",Object.assign({className:"relative flex flex-grow flex-col justify-end"},{children:[v&&e.jsx(r.default,{isOpen:v,onChangeIsOpen:w}),e.jsxs("div",Object.assign({className:d.default("absolute left-1/2 top-5 flex w-full max-w-[400px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",k&&"top-1/3 opacity-100")},{children:[e.jsx(c.default,{src:null==m?void 0:m.coverphoto,alt:`${null==m?void 0:m.formtitle}'s Profile Picture`,width:64,height:64,className:"h-16 w-16 rounded-full"}),e.jsxs("div",Object.assign({className:"flex flex-col items-center"},{children:[e.jsxs("h2",Object.assign({className:"mt-6 text-center text-lg font-semibold text-black/70 max-[767px]:text-base"},{children:[`${null==m?void 0:m.formtitle.slice(0,130)}${(null!==(u=null==m?void 0:m.formtitle)&&void 0!==u?u:"").length>130?"...":""}`,e.jsx("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>w(!0)},{children:e.jsx(i.default,{className:"h-5 w-5 shrink-0",style:{color:j.accent}})}))]})),e.jsx("p",Object.assign({className:"mt-2 line-clamp-3 whitespace-pre-line max-w-[600px] text-center font-semilight text-black/70"},{children:null==m?void 0:m.formdescription}))]}))]})),e.jsx("div",Object.assign({className:"flex w-full justify-center"},{children:b.isLoading?e.jsxs("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[e.jsx("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-gray-200"}),e.jsx("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-gray-200"})]})):b.isError?e.jsx("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e.jsxs("p",Object.assign({className:"text-center text-xl font-semibold"},{children:["Something went wrong. Please try again, or"," ",e.jsx("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help"},{children:"contact us"}))," ","for help."]}))})):e.jsxs("div",Object.assign({className:"relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-10 max-[767px]:pt-6"},{children:[b.data.messages.map(((s,a)=>e.jsx(o.default,{message:s},a))),p.map(((s,a)=>e.jsx(o.default,{message:s},a))),"fetching"===g?e.jsxs("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==m?void 0:m.chaticon)&&e.jsx(c.default,{src:null==m?void 0:m.chaticon,alt:`${null==m?void 0:m.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6"}),e.jsxs("div",Object.assign({className:"flex items-center gap-x-2 rounded bg-blue-100/50 px-4 py-4"},{children:[e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full bg-black/60"}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full bg-black/60"}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full bg-black/60"})]}))]})):h?e.jsxs("div",Object.assign({className:"flex max-w-[80%] gap-x-3"},{children:[e.jsx(i.default,{className:"mt-2 h-6 w-6 shrink-0 text-red-500"}),e.jsx(x.default,{className:"x-4 py-2 font-semibold text-red-500",html:h})]})):null,e.jsx(n.default,{className:"absolute bottom-0 left-0 w-full"})]}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),a=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),l=require("../../../../hooks/pickaxe/useConversation.js"),i=require("../../../Icons/circle-info.svg.js"),c=require("../../../Core/PickaxeIcon.js"),n=require("../../Addons/Scroll/ScrollLockView.js"),r=require("../../InfoModal.js"),o=require("./Message.js"),d=require("../../../../common/cn.js"),x=require("../../../Core/HtmlRenderer.js");exports.default=()=>{var u;const{pickaxe:m,colors:j,isNewChat:f}=a.usePickaxeContext(),{messages:p,status:g,error:h}=t.useResponseContext(),b=l.useConversation(),[v,w]=s.useState(!1),N=s.useMemo((()=>!!b.data&&!(b.data.messages.length<=1)),[b.data]),y=s.useMemo((()=>b.isSuccess&&f&&!N),[b.isSuccess,f,N]);return e.jsxs("div",Object.assign({className:"relative flex flex-grow flex-col justify-end"},{children:[v&&e.jsx(r.default,{isOpen:v,onChangeIsOpen:w}),e.jsxs("div",Object.assign({className:d.default("absolute left-1/2 top-5 flex w-full max-w-[400px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",y&&"top-1/3 opacity-100")},{children:[e.jsx(c.default,{src:null==m?void 0:m.coverphoto,alt:`${null==m?void 0:m.formtitle}'s Profile Picture`,width:64,height:64,className:"h-16 w-16 rounded-full"}),e.jsxs("div",Object.assign({className:"flex flex-col items-center"},{children:[e.jsxs("h2",Object.assign({className:"mt-6 text-center text-lg font-semibold opacity-70 max-[767px]:text-base"},{children:[`${null==m?void 0:m.formtitle.slice(0,130)}${(null!==(u=null==m?void 0:m.formtitle)&&void 0!==u?u:"").length>130?"...":""}`,e.jsx("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>w(!0)},{children:e.jsx(i.default,{className:"h-5 w-5 shrink-0",style:{color:j.accent}})}))]})),e.jsx("p",Object.assign({className:"mt-2 line-clamp-3 whitespace-pre-line max-w-[600px] text-center font-semilight opacity-70"},{children:null==m?void 0:m.formdescription}))]}))]})),e.jsx("div",Object.assign({className:"flex w-full justify-center"},{children:b.isLoading?e.jsxs("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[e.jsx("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-gray-200"}),e.jsx("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-gray-200"}),e.jsx("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-gray-200"})]})):b.isError?e.jsx("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e.jsxs("p",Object.assign({className:"text-center text-xl font-semibold"},{children:["Something went wrong. Please try again, or"," ",e.jsx("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help"},{children:"contact us"}))," ","for help."]}))})):e.jsxs("div",Object.assign({className:"relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-10 max-[767px]:pt-6"},{children:[b.data.messages.map(((s,a)=>e.jsx(o.default,{message:s},a))),p.map(((s,a)=>e.jsx(o.default,{message:s},a))),"fetching"===g?e.jsxs("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==m?void 0:m.chaticon)&&e.jsx(c.default,{src:null==m?void 0:m.chaticon,alt:`${null==m?void 0:m.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6"}),e.jsxs("div",Object.assign({className:"flex items-center gap-x-2 rounded bg-blue-100/50 px-4 py-4"},{children:[e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full bg-black/60"}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full bg-black/60"}),e.jsx("div",{className:"h-1.5 w-1.5 animate-dot rounded-full bg-black/60"})]}))]})):h?e.jsxs("div",Object.assign({className:"flex max-w-[80%] gap-x-3"},{children:[e.jsx(i.default,{className:"mt-2 h-6 w-6 shrink-0 text-red-500"}),e.jsx(x.default,{className:"x-4 py-2 font-semibold text-red-500",html:h})]})):null,e.jsx(n.default,{className:"absolute bottom-0 left-0 w-full"})]}))}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../Icons/circle-info.svg.js"),l=require("../../Core/PickaxeIcon.js"),r=require("../InfoModal.js");exports.default=()=>{var c;const{pickaxe:n}=i.usePickaxeContext(),[o,a]=t.useState(!1);return e.jsxs("div",Object.assign({className:"flex flex-col items-center"},{children:[o&&e.jsx(r.default,{isOpen:o,onChangeIsOpen:a}),e.jsx(l.default,{src:null==n?void 0:n.coverphoto,alt:`${null==n?void 0:n.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"}),e.jsxs("h2",Object.assign({className:"mt-6 text-center text-[18px] font-semibold text-black/70 max-[767px]:text-base"},{children:[`${null==n?void 0:n.formtitle.slice(0,130)}${(null!==(c=null==n?void 0:n.formtitle)&&void 0!==c?c:"").length>130?"...":""}`,e.jsx("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>a(!0)},{children:e.jsx(s.default,{className:"h-5 w-5 shrink-0 text-c-blue"})}))]})),e.jsx("p",Object.assign({className:"mt-2 max-w-[600px] line-clamp-3 whitespace-pre-line text-center font-semilight text-black/70"},{children:null==n?void 0:n.formdescription}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../Icons/circle-info.svg.js"),l=require("../../Core/PickaxeIcon.js"),o=require("../InfoModal.js");exports.default=()=>{var r;const{pickaxe:c}=i.usePickaxeContext(),[n,a]=t.useState(!1);return e.jsxs("div",Object.assign({className:"flex flex-col items-center"},{children:[n&&e.jsx(o.default,{isOpen:n,onChangeIsOpen:a}),e.jsx(l.default,{src:null==c?void 0:c.coverphoto,alt:`${null==c?void 0:c.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"}),e.jsxs("h2",Object.assign({className:"mt-6 text-center text-[18px] font-semibold opacity-70 max-[767px]:text-base"},{children:[`${null==c?void 0:c.formtitle.slice(0,130)}${(null!==(r=null==c?void 0:c.formtitle)&&void 0!==r?r:"").length>130?"...":""}`,e.jsx("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>a(!0)},{children:e.jsx(s.default,{className:"h-5 w-5 shrink-0 text-c-blue"})}))]})),e.jsx("p",Object.assign({className:"mt-2 max-w-[600px] line-clamp-3 whitespace-pre-line text-center font-semilight opacity-70"},{children:null==c?void 0:c.formdescription}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),l=require("date-fns"),r=require("../../../Icons/message-square-notes.svg.js"),a=require("../../../Icons/visitor.svg.js"),i=require("../../../Core/PickaxeIcon.js"),n=require("../../../Core/CopyButton.js"),o=require("../../../Core/MarkdownRenderer.js");exports.default=({item:c})=>{const{pickaxe:d,colors:u,setChatId:x,setIsNewChat:h}=t.usePickaxeContext(),m=s.useMemo((()=>l.format(c.createdAt,"hh:mm a MMM dd, yy")),[c]),p=s.useMemo((()=>c&&c.messages?c.messages.length:0),[c]),f=s.useMemo((()=>{var e,s,t,l;if("form"===c.type){return(null!==(e=c.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}return null!==(l=null===(t=null===(s=c.messages)||void 0===s?void 0:s[0])||void 0===t?void 0:t.message)&&void 0!==l?l:""}),[c]),j=s.useMemo((()=>{var e,s,t,l;return"form"===c.type?null!==(e=c.questionResponse)&&void 0!==e?e:"":null!==(l=null===(t=null===(s=c.messages)||void 0===s?void 0:s[1])||void 0===t?void 0:t.message)&&void 0!==l?l:""}),[c]);return e.jsxs("div",Object.assign({className:"flex flex-co transition hover:shadow"},{children:[e.jsxs("div",Object.assign({className:"flex gap-x-3 overflow-hidden bg-white px-4 py-5"},{children:[e.jsx("div",Object.assign({className:"shrink-0 pt-1"},{children:e.jsx(a.default,{className:"h-6 w-6"})})),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[e.jsx("input",{id:`${c.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:f.length<280}),e.jsx("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:f}}),e.jsx("label",Object.assign({htmlFor:`${c.responseId}-input`,className:"mt-1 flex shrink-0 whitespace-nowrap text-sm font-semibold peer-checked:hidden hover:cursor-pointer",style:{color:u.accent}},{children:"See input"})),e.jsx("label",Object.assign({htmlFor:`${c.responseId}-input`,className:"hidden shrink-0 whitespace-nowrap text-sm font-semibold peer-checked:flex hover:cursor-pointer",style:{color:u.accent}},{children:"Hide input"}))]}))]})),e.jsxs("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:u.secondary,color:u.secondaryText}},{children:[e.jsx(i.default,{src:null==d?void 0:d.chaticon,alt:`${null==d?void 0:d.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1"}),e.jsxs("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[e.jsx(o.default,{className:"overflow-x-auto pb-2 font-light text-black/90 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]",html:j}),e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==d?void 0:d.enablechatresponses)&&e.jsxs("button",Object.assign({className:"flex items-center gap-x-1 hover:cursor-pointer hover:text-c-blue",onClick:()=>{return e=c.responseId,h(!1),void x(e);var e}},{children:[e.jsx(r.default,{className:"h-4 w-4"}),e.jsx("p",Object.assign({className:"text-sm font-semibold"},{children:p+1}))]})),e.jsx(n.default,{text:j})]})),e.jsx("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:e.jsx("p",Object.assign({className:"text-sm font-semibold uppercase opacity-30"},{children:m}))}))]}))]}))]}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),l=require("date-fns"),r=require("../../../Icons/message-square-notes.svg.js"),a=require("../../../Icons/visitor.svg.js"),i=require("../../../Core/PickaxeIcon.js"),n=require("../../../Core/CopyButton.js"),o=require("../../../Core/MarkdownRenderer.js");exports.default=({item:c})=>{const{pickaxe:d,colors:u,setChatId:x,setIsNewChat:h}=t.usePickaxeContext(),m=s.useMemo((()=>l.format(c.createdAt,"hh:mm a MMM dd, yy")),[c]),p=s.useMemo((()=>c&&c.messages?c.messages.length:0),[c]),f=s.useMemo((()=>{var e,s,t,l;if("form"===c.type){return(null!==(e=c.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}return null!==(l=null===(t=null===(s=c.messages)||void 0===s?void 0:s[0])||void 0===t?void 0:t.message)&&void 0!==l?l:""}),[c]),j=s.useMemo((()=>{var e,s,t,l;return"form"===c.type?null!==(e=c.questionResponse)&&void 0!==e?e:"":null!==(l=null===(t=null===(s=c.messages)||void 0===s?void 0:s[1])||void 0===t?void 0:t.message)&&void 0!==l?l:""}),[c]);return e.jsxs("div",Object.assign({className:"flex flex-co transition hover:shadow"},{children:[e.jsxs("div",Object.assign({className:"flex gap-x-3 overflow-hidden bg-white px-4 py-5"},{children:[e.jsx("div",Object.assign({className:"shrink-0 pt-1"},{children:e.jsx(a.default,{className:"h-6 w-6"})})),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[e.jsx("input",{id:`${c.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:f.length<280}),e.jsx("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:f}}),e.jsx("label",Object.assign({htmlFor:`${c.responseId}-input`,className:"mt-1 flex shrink-0 whitespace-nowrap text-sm font-semibold peer-checked:hidden hover:cursor-pointer",style:{color:u.accent}},{children:"See input"})),e.jsx("label",Object.assign({htmlFor:`${c.responseId}-input`,className:"hidden shrink-0 whitespace-nowrap text-sm font-semibold peer-checked:flex hover:cursor-pointer",style:{color:u.accent}},{children:"Hide input"}))]}))]})),e.jsxs("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:u.secondary,color:u.secondaryText}},{children:[e.jsx(i.default,{src:null==d?void 0:d.chaticon,alt:`${null==d?void 0:d.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1"}),e.jsxs("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[e.jsx(o.default,{className:"overflow-x-auto pb-2 font-light opacity-90 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]",html:j}),e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==d?void 0:d.enablechatresponses)&&e.jsxs("button",Object.assign({className:"flex items-center gap-x-1 hover:cursor-pointer hover:text-c-blue",onClick:()=>{return e=c.responseId,h(!1),void x(e);var e}},{children:[e.jsx(r.default,{className:"h-4 w-4"}),e.jsx("p",Object.assign({className:"text-sm font-semibold"},{children:p+1}))]})),e.jsx(n.default,{text:j})]})),e.jsx("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:e.jsx("p",Object.assign({className:"text-sm font-semibold uppercase opacity-30"},{children:m}))}))]}))]}))]}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),r=require("../../../../hooks/pickaxe/useResponseContext.js"),a=require("date-fns"),l=require("../../../Icons/message-square-notes.svg.js"),n=require("../../../Icons/visitor.svg.js"),o=require("../../../Core/PickaxeIcon.js"),i=require("../../../Core/CopyButton.js"),c=require("../../../Core/MarkdownRenderer.js"),d=require("../../Addons/Scroll/ScrollLockView.js");exports.default=()=>{var x;const{pickaxe:h,colors:u,setChatId:p,setIsNewChat:m}=t.usePickaxeContext(),{response:j}=r.useResponseContext(),f=s.useMemo((()=>j?a.format(j.createdAt,"hh:mm a MMM dd, yy"):a.format(new Date,"hh:mm a MMM dd, yy")),[j]),b=s.useMemo((()=>{var e;if(!j)return"";return(null!==(e=j.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}),[j]);return j?e.jsxs("div",Object.assign({className:"flex flex-col shadow-black transition hover:shadow"},{children:[e.jsxs("div",Object.assign({className:"flex gap-x-3 overflow-hidden bg-white px-4 py-5"},{children:[e.jsx("div",Object.assign({className:"shrink-0 pt-1"},{children:e.jsx(n.default,{className:"h-6 w-6 text-black"})})),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[e.jsx("input",{id:`${j.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:b.length<280}),e.jsx("div",{className:"danger-html hidden flex-col text-black/50 peer-checked:flex",dangerouslySetInnerHTML:{__html:b}}),e.jsx("label",Object.assign({htmlFor:`${j.responseId}-input`,className:"mt-1 flex shrink-0 whitespace-nowrap text-sm font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer",style:{color:u.accent}},{children:"See input"})),e.jsx("label",Object.assign({htmlFor:`${j.responseId}-input`,className:"hidden shrink-0 whitespace-nowrap text-sm font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer",style:{color:u.accent}},{children:"Hide input"}))]}))]})),e.jsxs("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:u.secondary,color:u.secondaryText}},{children:[e.jsx(o.default,{src:null==h?void 0:h.chaticon,alt:`${null==h?void 0:h.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1"}),e.jsxs("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[e.jsx(c.default,{className:"overflow-x-auto pb-2 font-light text-black/90 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]",html:j.questionResponse}),e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==h?void 0:h.enablechatresponses)&&e.jsxs("button",Object.assign({className:"flex items-center gap-x-1 hover:cursor-pointer hover:text-c-blue",onClick:()=>{return e=j.responseId,m(!1),void p(e);var e}},{children:[e.jsx(l.default,{className:"h-4 w-4"}),e.jsx("p",Object.assign({className:"text-sm font-semibold"},{children:j.messages.length+1}))]})),e.jsx(i.default,{text:null!==(x=j.questionResponse)&&void 0!==x?x:""})]})),e.jsx("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:e.jsx("p",Object.assign({className:"text-sm font-semibold uppercase opacity-30"},{children:f}))}))]}))]}))]})),e.jsx(d.default,{})]})):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),r=require("../../../../hooks/pickaxe/useResponseContext.js"),a=require("date-fns"),l=require("../../../Icons/message-square-notes.svg.js"),n=require("../../../Icons/visitor.svg.js"),o=require("../../../Core/PickaxeIcon.js"),i=require("../../../Core/CopyButton.js"),c=require("../../../Core/MarkdownRenderer.js"),d=require("../../Addons/Scroll/ScrollLockView.js");exports.default=()=>{var x;const{pickaxe:h,colors:p,setChatId:u,setIsNewChat:m}=t.usePickaxeContext(),{response:j}=r.useResponseContext(),f=s.useMemo((()=>j?a.format(j.createdAt,"hh:mm a MMM dd, yy"):a.format(new Date,"hh:mm a MMM dd, yy")),[j]),b=s.useMemo((()=>{var e;if(!j)return"";return(null!==(e=j.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}),[j]);return j?e.jsxs("div",Object.assign({className:"flex flex-col shadow-black transition hover:shadow"},{children:[e.jsxs("div",Object.assign({className:"flex gap-x-3 overflow-hidden bg-white px-4 py-5"},{children:[e.jsx("div",Object.assign({className:"shrink-0 pt-1"},{children:e.jsx(n.default,{className:"h-6 w-6"})})),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[e.jsx("input",{id:`${j.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:b.length<280}),e.jsx("div",{className:"danger-html hidden flex-col opacity-50 peer-checked:flex",dangerouslySetInnerHTML:{__html:b}}),e.jsx("label",Object.assign({htmlFor:`${j.responseId}-input`,className:"mt-1 flex shrink-0 whitespace-nowrap text-sm font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer",style:{color:p.accent}},{children:"See input"})),e.jsx("label",Object.assign({htmlFor:`${j.responseId}-input`,className:"hidden shrink-0 whitespace-nowrap text-sm font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer",style:{color:p.accent}},{children:"Hide input"}))]}))]})),e.jsxs("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:p.secondary,color:p.secondaryText}},{children:[e.jsx(o.default,{src:null==h?void 0:h.chaticon,alt:`${null==h?void 0:h.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1"}),e.jsxs("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[e.jsx(c.default,{className:"overflow-x-auto pb-2 font-light opacity-90 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]",html:j.questionResponse}),e.jsxs("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==h?void 0:h.enablechatresponses)&&e.jsxs("button",Object.assign({className:"flex items-center gap-x-1 hover:cursor-pointer hover:text-c-blue",onClick:()=>{return e=j.responseId,m(!1),void u(e);var e}},{children:[e.jsx(l.default,{className:"h-4 w-4"}),e.jsx("p",Object.assign({className:"text-sm font-semibold"},{children:j.messages.length+1}))]})),e.jsx(i.default,{text:null!==(x=j.questionResponse)&&void 0!==x?x:""})]})),e.jsx("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:e.jsx("p",Object.assign({className:"text-sm font-semibold uppercase opacity-30"},{children:f}))}))]}))]}))]})),e.jsx(d.default,{})]})):null};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../../common/utils.js");exports.default=()=>{const{isShowHistory:i,setChatId:r,setIsNewChat:a,setIsShowHistory:o}=t.usePickaxeContext();return e.jsxs("div",Object.assign({className:"mt-6 flex flex-wrap gap-2"},{children:[e.jsx("button",Object.assign({onClick:()=>{return e=s.generateId(20),a(!0),void r(e);var e},className:"flex h-[48px] w-full max-w-[140px] items-center justify-center gap-2 rounded-sm bg-c-blue px-4 font-semibold text-white hover:opacity-80 hover:duration-300 disabled:cursor-wait disabled:opacity-60"},{children:e.jsx("span",Object.assign({className:"font-semibold"},{children:"New chat"}))})),!i&&e.jsx("button",Object.assign({className:"flex h-[48px] w-full max-w-[140px] items-center justify-center px-4 font-semibold hover:text-black/70 hover:duration-300",onClick:()=>o(!0)},{children:"See history"}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../../common/utils.js");exports.default=()=>{const{isShowHistory:i,setChatId:r,setIsNewChat:a,setIsShowHistory:o}=t.usePickaxeContext();return e.jsxs("div",Object.assign({className:"mt-6 flex flex-wrap gap-2"},{children:[e.jsx("button",Object.assign({onClick:()=>{return e=s.generateId(20),a(!0),void r(e);var e},className:"flex h-[48px] w-full max-w-[140px] items-center justify-center gap-2 rounded-sm bg-c-blue px-4 font-semibold text-white hover:opacity-80 hover:duration-300 disabled:cursor-wait disabled:opacity-60"},{children:e.jsx("span",Object.assign({className:"font-semibold"},{children:"New chat"}))})),!i&&e.jsx("button",Object.assign({className:"flex h-[48px] w-full max-w-[140px] items-center justify-center px-4 font-semibold hover:opacity-70 hover:duration-300",onClick:()=>o(!0)},{children:"See history"}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),a=require("react"),i=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../Addons/Document/hooks/useDocument.js"),r=require("../../../../common/documents.js"),l=require("../../../Icons/attach.svg.js"),n=require("../../../Icons/check.svg.js"),o=require("../../../Icons/x.svg.js"),c=require("../../../Core/ErrorAlert.js"),d=require("../../Addons/Document/List.js"),u=require("../../../../common/cn.js");exports.default=({field:m,update:j})=>{const{colors:b}=i.usePickaxeContext(),{documentError:x,websiteLink:p,isUploading:f,isImageUploadAllowed:g,setDocumentError:h,setWebsiteLink:v,onFileUpload:y,onWebsiteUpload:k}=t.useDocument({onQuestionChange:e=>{j(Object.assign(Object.assign({},m),e))}}),[w,N]=a.useState(!1),O=a.useRef(null);return s.jsxs("div",Object.assign({className:"flex flex-col gap-y-1"},{children:[s.jsxs("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[s.jsxs("div",Object.assign({className:"flex items-center gap-2"},{children:[s.jsx("p",Object.assign({className:"text-sm font-semibold opacity-70"},{children:m.main})),m.isRequired&&s.jsx("span",Object.assign({className:"select-none font-semibold",style:{color:b.error}},{children:"*"}))]})),s.jsxs("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[s.jsx("input",{ref:O,type:"file",accept:[...r.allowedFileMimeTypes,...g?r.allowedImageMimeTypes:[]].join(", "),id:m.id,hidden:!0,className:"hidden",onChange:s=>e.__awaiter(void 0,void 0,void 0,(function*(){yield y(Array.from(s.target.files||[])),s.target.value=""})),disabled:f}),s.jsxs("div",Object.assign({className:u.default("flex items-center justify-between rounded-sm border border-transparent bg-white py-3 pl-4 pr-3 shadow duration-300 hover:border-black/25",w&&"border-black/70 shadow-none hover:border-black/70")},{children:[s.jsx("input",{type:"text",value:p,className:"w-full outline-none",placeholder:"Paste a website/video link or drag a file",onChange:e=>v(e.target.value),onDrop:s=>e.__awaiter(void 0,void 0,void 0,(function*(){s.preventDefault(),yield y(Array.from(s.dataTransfer.files||[]))})),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),k(p))},onFocus:()=>N(!0),onBlur:()=>N(!1)}),s.jsx("div",Object.assign({className:"flex items-center gap-3 pl-4"},{children:p.length>0?s.jsxs(s.Fragment,{children:[s.jsx("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:f,onClick:()=>k(p)},{children:s.jsx(n.default,{className:"h-5 w-5 shrink-0",style:{color:b.accent}})})),s.jsx("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:f,onClick:()=>{v(""),h("")}},{children:s.jsx(o.default,{className:"h-6 w-6 shrink-0",style:{color:b.accent}})}))]}):s.jsx("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:f,onClick:()=>{var e;null===(e=O.current)||void 0===e||e.click()}},{children:s.jsx(l.default,{className:"h-6 w-6 shrink-0",style:{color:b.accent}})}))}))]}))]}))]})),s.jsx(d.default,{className:"mt-2"}),x&&s.jsx(c.default,{error:x,className:"mt-3"})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),a=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),i=require("../../../../hooks/studio/useStyleInput.js"),r=require("../../Addons/Document/hooks/useDocument.js"),l=require("../../../../common/documents.js"),n=require("../../../Icons/attach.svg.js"),o=require("../../../Icons/check.svg.js"),c=require("../../../Icons/x.svg.js"),d=require("../../../Core/ErrorAlert.js"),u=require("../../Addons/Document/List.js"),j=require("../../../../common/cn.js");exports.default=({field:m,update:b})=>{const{colors:p}=t.usePickaxeContext(),{documentError:x,websiteLink:f,isUploading:g,isImageUploadAllowed:h,setDocumentError:v,setWebsiteLink:y,onFileUpload:k,onWebsiteUpload:w}=r.useDocument({onQuestionChange:e=>{b(Object.assign(Object.assign({},m),e))}}),[N,q]=a.useState(!1),O=a.useRef(null),C=i.useStyleInput();return s.jsxs("div",Object.assign({className:"flex flex-col gap-y-1"},{children:[s.jsxs("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[s.jsxs("div",Object.assign({className:"flex items-center gap-2"},{children:[s.jsx("p",Object.assign({className:"text-sm font-semibold opacity-70"},{children:m.main})),m.isRequired&&s.jsx("span",Object.assign({className:"select-none font-semibold",style:{color:p.error}},{children:"*"}))]})),s.jsxs("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[s.jsx("input",{ref:O,type:"file",accept:[...l.allowedFileMimeTypes,...h?l.allowedImageMimeTypes:[]].join(", "),id:m.id,hidden:!0,className:"hidden",onChange:s=>e.__awaiter(void 0,void 0,void 0,(function*(){yield k(Array.from(s.target.files||[])),s.target.value=""})),disabled:g}),s.jsxs("div",Object.assign({className:j.default("flex items-center justify-between rounded-sm border border-transparent bg-white py-3 pl-4 pr-3 shadow duration-300 hover:border-black/25",N&&"border-black/70 shadow-none hover:border-black/70"),style:C},{children:[s.jsx("input",{type:"text",value:f,className:"w-full outline-none bg-transparent",placeholder:"Paste a website/video link or drag a file",onChange:e=>y(e.target.value),onDrop:s=>e.__awaiter(void 0,void 0,void 0,(function*(){s.preventDefault(),yield k(Array.from(s.dataTransfer.files||[]))})),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),w(f))},onFocus:()=>q(!0),onBlur:()=>q(!1)}),s.jsx("div",Object.assign({className:"flex items-center gap-3 pl-4"},{children:f.length>0?s.jsxs(s.Fragment,{children:[s.jsx("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:g,onClick:()=>w(f)},{children:s.jsx(o.default,{className:"h-5 w-5 shrink-0",style:{color:p.accent}})})),s.jsx("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:g,onClick:()=>{y(""),v("")}},{children:s.jsx(c.default,{className:"h-6 w-6 shrink-0",style:{color:p.accent}})}))]}):s.jsx("button",Object.assign({className:"outline-none disabled:cursor-wait disabled:opacity-80",disabled:g,onClick:()=>{var e;null===(e=O.current)||void 0===e||e.click()}},{children:s.jsx(n.default,{className:"h-6 w-6 shrink-0",style:{color:p.accent}})}))}))]}))]}))]})),s.jsx(u.default,{className:"mt-2"}),x&&s.jsx(d.default,{error:x,className:"mt-3"})]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),a=require("@nem035/gpt-3-encoder"),r=require("../../../Core/Textarea.js"),n=require("../../../../common/cn.js");exports.default=({field:o,update:c})=>{const{setError:i}=t.useResponseContext(),[l,d]=s.useState(!1);return e.jsxs("div",Object.assign({className:"group relative flex flex-col gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-2"},{children:[e.jsx("p",Object.assign({className:"text-[14px] font-semibold text-black/70"},{children:o.main})),o.isRequired&&e.jsx("span",Object.assign({className:"select-none font-semibold text-c-red"},{children:"*"}))]})),e.jsx(r.default,{className:n.default("rounded-sm border border-transparent bg-white px-4 py-3 shadow duration-300 hover:border-black/25 focus:border-black/70 focus:shadow-none",o.maxLength<10&&"max-w-[400px]"),placeholder:o.example,rows:o.maxLength>500?3:1,value:o.input,tabIndex:o.order,onChange:e=>{i("");const s=a.encode(e).length;c(Object.assign(Object.assign({},o),{input:e,length:s}))},onFocus:()=>d(!0),onBlur:()=>d(!1)})]})),e.jsx("div",Object.assign({className:"pointer-events-none absolute bottom-0 right-0 p-1 px-2"},{children:e.jsxs("p",Object.assign({className:n.default("text-[14px] font-semibold text-black/20 opacity-0 group-hover:opacity-100 group-hover:duration-200",o.length>o.maxLength&&"text-c-red opacity-100",l&&"opacity-100")},{children:[o.length,"/",o.maxLength]}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("react"),t=require("../../../../hooks/pickaxe/usePickaxeContext.js"),o=require("../../../../hooks/pickaxe/useResponseContext.js"),r=require("../../../../hooks/studio/useStyleInput.js"),a=require("@nem035/gpt-3-encoder"),n=require("../../../Core/Textarea.js"),i=require("../../../../common/cn.js");exports.default=({field:c,update:l})=>{const{colors:u}=t.usePickaxeContext(),{setError:d}=o.useResponseContext(),[x,p]=s.useState(!1),g=r.useStyleInput();return e.jsxs("div",Object.assign({className:"group relative flex flex-col gap-y-1"},{children:[e.jsxs("div",Object.assign({className:"flex flex-col gap-y-2"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-2"},{children:[e.jsx("p",Object.assign({className:"text-sm font-semibold opacity-70"},{children:c.main})),c.isRequired&&e.jsx("span",Object.assign({className:"select-none font-semibold",style:{color:u.error}},{children:"*"}))]})),e.jsx(n.default,{className:i.default("rounded-sm border border-transparent bg-white px-4 py-3 shadow duration-300 hover:border-black/25 focus:border-black/70 focus:shadow-none",c.maxLength<10&&"max-w-[400px]"),style:g,placeholder:c.example,rows:c.maxLength>500?3:1,value:c.input,tabIndex:c.order,onChange:e=>{d("");const s=a.encode(e).length;l(Object.assign(Object.assign({},c),{input:e,length:s}))},onFocus:()=>p(!0),onBlur:()=>p(!1)})]})),e.jsx("div",Object.assign({className:"pointer-events-none absolute bottom-0 right-0 p-1 px-2"},{children:e.jsxs("p",Object.assign({className:i.default("text-[14px] font-semibold opacity-20 opacity-0 group-hover:opacity-100 group-hover:duration-200",c.length>c.maxLength&&"text-c-red opacity-100",x&&"opacity-100")},{children:[c.length,"/",c.maxLength]}))}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),i=require("./Dropdown.js");exports.default=({field:n,update:r})=>{const{colors:a}=s.usePickaxeContext(),{setError:c}=t.useResponseContext();return e.jsxs("div",Object.assign({className:"flex flex-col gap-y-3"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-2"},{children:[e.jsx("p",Object.assign({className:"text-sn font-semibold opacity-70"},{children:n.main})),n.isRequired&&e.jsx("span",Object.assign({className:"select-none font-semibold",style:{color:a.error}},{children:"*"}))]})),e.jsx(i.default,Object.assign({id:n.id.replace(/[^A-Za-z]+/g,""),value:n.input,placeholder:"Select an option",closeOnSelect:!1,maxToken:n.maxLength,isDropdown:n.isDropdown},{children:e.jsx("div",Object.assign({className:"flex flex-col items-start gap-y-3"},{children:n.example.split("S3P32X").map(((s,t)=>e.jsxs("div",Object.assign({className:"flex items-center gap-x-2 hover:cursor-pointer",onClick:()=>{return e=s,c(""),void r(Object.assign(Object.assign({},n),{input:e}));var e}},{children:[e.jsx("div",Object.assign({className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border-2 border-black bg-white"},{children:n.input===s&&e.jsx("div",{className:"h-4 w-4 rounded-full",style:{backgroundColor:a.accent}})})),e.jsx("p",Object.assign({className:"select-none max-lg:text-sm"},{children:s}))]}),t)))}))}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../../../hooks/pickaxe/usePickaxeContext.js"),t=require("../../../../hooks/pickaxe/useResponseContext.js"),i=require("./Dropdown.js");exports.default=({field:r,update:a})=>{const{colors:n}=s.usePickaxeContext(),{setError:c}=t.useResponseContext();return e.jsxs("div",Object.assign({className:"flex flex-col gap-y-3"},{children:[e.jsxs("div",Object.assign({className:"flex items-center gap-2"},{children:[e.jsx("p",Object.assign({className:"text-sm font-semibold opacity-70"},{children:r.main})),r.isRequired&&e.jsx("span",Object.assign({className:"select-none font-semibold",style:{color:n.error}},{children:"*"}))]})),e.jsx(i.default,Object.assign({id:r.id.replace(/[^A-Za-z]+/g,""),value:r.input,placeholder:"Select an option",closeOnSelect:!1,maxToken:r.maxLength,isDropdown:r.isDropdown},{children:e.jsx("div",Object.assign({className:"flex flex-col items-start gap-y-3"},{children:r.example.split("S3P32X").map(((s,t)=>e.jsxs("div",Object.assign({className:"flex items-center gap-x-2 hover:cursor-pointer",onClick:()=>{return e=s,c(""),void a(Object.assign(Object.assign({},r),{input:e}));var e}},{children:[e.jsx("div",Object.assign({className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border-2 border-black bg-white"},{children:r.input===s&&e.jsx("div",{className:"h-4 w-4 rounded-full",style:{backgroundColor:n.accent}})})),e.jsx("p",Object.assign({className:"select-none max-lg:text-sm"},{children:s}))]}),t)))}))}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),s=require("react"),o=require("../../../../hooks/pickaxe/usePickaxeContext.js"),r=require("../../../../hooks/pickaxe/useResponseContext.js"),i=require("../../../../hooks/pickaxe/useSubmit.js"),n=require("../../../../hooks/pickaxe/useSubmitResult.js"),u=require("../../Addons/Document/hooks/useDocument.js"),l=require("../../Addons/Scroll/hooks/useScroll.js"),d=require("../../../../common/api/streamer.js"),a=require("../../../../common/utils.js"),c=require("@nem035/gpt-3-encoder"),m=require("../../../../common/error.js");exports.default=({questions:p})=>{const{formId:h,pickaxe:f,isShowHistory:g,setIsShowHistory:x}=o.usePickaxeContext(),{status:b,setResponse:w,setStatus:j,setError:y}=r.useResponseContext(),{documents:q,websiteLink:k,isUploading:v,onWebsiteUpload:I,setDocumentError:S}=u.useDocument(),{isScrollIncreasing:R,scrollToContainer:O,scrollToBottom:E,scrollStart:U,scrollEnd:C}=l.useScroll(),P=i.useSubmit(),A=n.useSubmitResult(),[D,_]=s.useState(!1);return t.jsxs("div",Object.assign({className:"mt-4 flex flex-wrap gap-2"},{children:[t.jsx("button",Object.assign({onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{if(v||D||"fetching"===b||"streaming"===b)return;S("");const t="enduserupload"===(null==f?void 0:f.documentuploadtype),s=p.some((e=>"userinput:documentupload"===e.id&&e.isRequired)),o=q.filter((e=>"finished"===e.status)),r=a.extractUrlsFromText(k),i=q.map((e=>e.name)),n=r.filter((e=>!i.includes(e)));if(n.length){const e=n[n.length-1],t=yield I(e);t&&(o.push(t),_(!0),yield new Promise((e=>setTimeout(e,5e3))),_(!1))}else if(s&&t&&!o.length)return void S("Please paste a valid website/video link or drag a file to add to the knowledge base.");y("");const u=["Multiple Choice","Checkbox"];for(const e of p){if(c.encode(e.input).length>e.maxLength&&!u.includes(e.type))throw new Error("One or more of your responses is too long!");if(e.isRequired&&!e.input.trim()&&"userinput:documentupload"!==e.id)throw new Error("You must fill out all required fields.")}const l=o.length?o[o.length-1]:null;let m={};p.forEach((e=>m=Object.assign(Object.assign({},m),{[e.id]:"Knowledge Upload"===e.type||e.id.includes("documentupload")?(null==l?void 0:l.name)||"":e.input}))),j("fetching");const{success:g,responseId:x,data:O,usedDocumentIds:C,rawUserInput:T,error:L}=yield P.mutateAsync(Object.assign({formId:h,valueObj:m},t&&l&&{documentId:null!==(e=l.documentId)&&void 0!==e?e:""}));if(!g)throw new Error(null!=L?L:"An error occurred, please try again.");U();const N=(yield d.streamer({formId:h,responseId:x,data:O})).body;if(!N)throw new Error("Streaming error");const H=N.getReader(),B=new TextDecoder;let F="",M=!0;w(null);const W=p.map((e=>({id:e.id,question:e.main,answer:e.input})));for(;M;){const{value:e,done:t}=yield H.read();M=!t;if(F+=B.decode(e),F)j("streaming"),w({formId:h,responseId:x,documentIds:C,messages:[],questions:W,questionPrompt:T,questionResponse:F,createdAt:new Date}),R&&E();else if(!M&&!F)throw new Error("Server error")}F&&(E(),j("idle"),yield A.mutateAsync({formId:h,responseId:x,documentIds:C,studioUserId:"USER68RFBSHU4YS2I4L",questions:W,questionPrompt:T,questionResponse:F}))}catch(e){let t=m.default(e);t.includes("Unexpected token 'A',")&&(t="Oops! We're experiencing high traffic at the moment. Please try again later."),y(t),_(!1),O()}finally{j("idle"),C()}})),tabIndex:p.length+1,className:"flex h-[48px] w-full max-w-[176px] items-center justify-center gap-2 rounded-sm bg-c-blue px-4 font-semibold text-white hover:opacity-80 hover:duration-300 disabled:cursor-wait disabled:opacity-60",disabled:v||D||"fetching"===b||"streaming"===b},{children:t.jsx("p",Object.assign({className:"font-semibold"},{children:D?"Processing...":v?"Uploading...":"fetching"===b||"streaming"===b?"Loading...":"Submit"}))})),!g&&t.jsx("button",Object.assign({tabIndex:p.length+2,className:"flex h-[48px] w-full max-w-[176px] items-center justify-center px-4 font-semibold hover:text-black/70 hover:duration-300",onClick:()=>x(!0)},{children:"See history"}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("react"),o=require("../../../../hooks/pickaxe/usePickaxeContext.js"),r=require("../../../../hooks/pickaxe/useResponseContext.js"),i=require("../../../../hooks/pickaxe/useSubmit.js"),n=require("../../../../hooks/pickaxe/useSubmitResult.js"),u=require("../../Addons/Document/hooks/useDocument.js"),l=require("../../Addons/Scroll/hooks/useScroll.js"),a=require("../../../../common/api/streamer.js"),d=require("../../../../common/utils.js"),c=require("@nem035/gpt-3-encoder"),m=require("../../common/PickaxeButton.js"),p=require("../../../../common/error.js");exports.default=({questions:f})=>{const{formId:g,pickaxe:h,isShowHistory:x,setIsShowHistory:w}=o.usePickaxeContext(),{status:q,setResponse:j,setStatus:b,setError:k}=r.useResponseContext(),{documents:y,websiteLink:S,isUploading:I,onWebsiteUpload:v,setDocumentError:R}=u.useDocument(),{isScrollIncreasing:E,scrollToContainer:O,scrollToBottom:P,scrollStart:U,scrollEnd:C}=l.useScroll(),D=i.useSubmit(),A=n.useSubmitResult(),[_,T]=t.useState(!1);return s.jsxs("div",Object.assign({className:"mt-4 flex flex-wrap gap-2"},{children:[s.jsx(m.default,Object.assign({className:"w-full max-w-[176px]",isDisabled:I||_||"fetching"===q||"streaming"===q,onClick:()=>e.__awaiter(void 0,void 0,void 0,(function*(){var e;try{if(I||_||"fetching"===q||"streaming"===q)return;R("");const s="enduserupload"===(null==h?void 0:h.documentuploadtype),t=f.some((e=>"userinput:documentupload"===e.id&&e.isRequired)),o=y.filter((e=>"finished"===e.status)),r=d.extractUrlsFromText(S),i=y.map((e=>e.name)),n=r.filter((e=>!i.includes(e)));if(n.length){const e=n[n.length-1],s=yield v(e);s&&(o.push(s),T(!0),yield new Promise((e=>setTimeout(e,5e3))),T(!1))}else if(t&&s&&!o.length)return void R("Please paste a valid website/video link or drag a file to add to the knowledge base.");k("");const u=["Multiple Choice","Checkbox"];for(const e of f){if(c.encode(e.input).length>e.maxLength&&!u.includes(e.type))throw new Error("One or more of your responses is too long!");if(e.isRequired&&!e.input.trim()&&"userinput:documentupload"!==e.id)throw new Error("You must fill out all required fields.")}const l=o.length?o[o.length-1]:null;let m={};f.forEach((e=>m=Object.assign(Object.assign({},m),{[e.id]:"Knowledge Upload"===e.type||e.id.includes("documentupload")?(null==l?void 0:l.name)||"":e.input}))),b("fetching");const{success:p,responseId:x,data:w,usedDocumentIds:O,rawUserInput:C,error:L}=yield D.mutateAsync(Object.assign({formId:g,valueObj:m},s&&l&&{documentId:null!==(e=l.documentId)&&void 0!==e?e:""}));if(!p)throw new Error(null!=L?L:"An error occurred, please try again.");U();const B=(yield a.streamer({formId:g,responseId:x,data:w})).body;if(!B)throw new Error("Streaming error");const H=B.getReader(),N=new TextDecoder;let F="",M=!0;j(null);const W=f.map((e=>({id:e.id,question:e.main,answer:e.input})));for(;M;){const{value:e,done:s}=yield H.read();M=!s;if(F+=N.decode(e),F)b("streaming"),j({formId:g,responseId:x,documentIds:O,messages:[],questions:W,questionPrompt:C,questionResponse:F,createdAt:new Date}),E&&P();else if(!M&&!F)throw new Error("Server error")}F&&(P(),b("idle"),yield A.mutateAsync({formId:g,responseId:x,documentIds:O,studioUserId:"USER68RFBSHU4YS2I4L",questions:W,questionPrompt:C,questionResponse:F}))}catch(e){let s=p.default(e);s.includes("Unexpected token 'A',")&&(s="Oops! We're experiencing high traffic at the moment. Please try again later."),k(s),T(!1),O()}finally{b("idle"),C()}}))},{children:_?"Processing...":I?"Uploading...":"fetching"===q||"streaming"===q?"Loading...":"Submit"})),!x&&s.jsx(m.default,Object.assign({variant:"transparent-text",className:"w-full max-w-[176px]",onClick:()=>w(!0)},{children:"See history"}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../../hooks/pickaxe/usePickaxeContext.js"),l=require("./Head.js"),t=require("./History/index.js"),x=require("./NewChat.js"),a=require("./Questions/index.js");exports.default=()=>{const{pickaxe:i}=s.usePickaxeContext();return e.jsx("div",Object.assign({className:"flex w-full flex-col items-center px-4 pb-40 max-[899px]:pb-10"},{children:e.jsxs("div",Object.assign({className:"flex w-full max-w-[700px] flex-col"},{children:[e.jsx(l.default,{}),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-8 lg:mt-4"},{children:[(null==i?void 0:i.chatflag)?e.jsx(x.default,{}):e.jsx(a.default,{}),e.jsx(t.default,{})]}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../../hooks/pickaxe/usePickaxeContext.js"),l=require("./Head.js"),t=require("./History/index.js"),x=require("./NewChat.js"),a=require("./Questions/index.js");exports.default=()=>{const{pickaxe:i}=s.usePickaxeContext();return e.jsx("div",Object.assign({className:"flex w-full flex-col items-center pt-12 px-4 pb-40 max-[899px]:pb-10"},{children:e.jsxs("div",Object.assign({className:"flex w-full max-w-[700px] flex-col"},{children:[e.jsx(l.default,{}),e.jsxs("div",Object.assign({className:"flex flex-col gap-y-8 lg:mt-4"},{children:[(null==i?void 0:i.chatflag)?e.jsx(x.default,{}):e.jsx(a.default,{}),e.jsx(t.default,{})]}))]}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../hooks/pickaxe/usePickaxeContext.js"),t=require("../Icons/x.svg.js"),i=require("../Core/Modal/index.js"),l=require("../Core/Modal/Body.js"),a=require("../Core/PickaxeIcon.js");exports.default=({isOpen:c,onChangeIsOpen:r})=>{const{pickaxe:n}=s.usePickaxeContext();return e.jsx(i.default,Object.assign({isOpen:c,onChange:r},{children:e.jsxs(l.default,Object.assign({className:"relative flex w-full max-w-[480px] flex-col px-8 py-[26px] max-[767px]:max-w-full",avoidOverflow:!0},{children:[e.jsx("div",Object.assign({className:"flex items-start justify-end gap-4"},{children:e.jsx("button",Object.assign({className:"outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>r(!1)},{children:e.jsx(t.default,{className:"h-6 w-6 shrink-0"})}))})),e.jsx("div",Object.assign({className:"mt-8 flex flex-col items-center"},{children:e.jsxs("div",Object.assign({className:"flex w-full max-w-[360px] flex-col items-center text-center"},{children:[e.jsx(a.default,{src:null==n?void 0:n.coverphoto,alt:`${null==n?void 0:n.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"}),e.jsx("h2",Object.assign({className:"mt-6 text-center text-[18px] font-semibold text-black/70 max-[767px]:text-base"},{children:null==n?void 0:n.formtitle})),e.jsx("p",Object.assign({className:"mt-4 font-semilight text-black/70"},{children:null==n?void 0:n.formdescription}))]}))}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../hooks/pickaxe/usePickaxeContext.js"),t=require("../Icons/x.svg.js"),i=require("../Core/Modal/index.js"),l=require("../Core/Modal/Body.js"),a=require("../Core/PickaxeIcon.js");exports.default=({isOpen:c,onChangeIsOpen:r})=>{const{pickaxe:n}=s.usePickaxeContext();return e.jsx(i.default,Object.assign({isOpen:c,onChange:r},{children:e.jsxs(l.default,Object.assign({className:"relative flex w-full max-w-[480px] flex-col px-8 py-[26px] max-[767px]:max-w-full",avoidOverflow:!0},{children:[e.jsx("div",Object.assign({className:"flex items-start justify-end gap-4"},{children:e.jsx("button",Object.assign({className:"outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>r(!1)},{children:e.jsx(t.default,{className:"h-6 w-6 shrink-0"})}))})),e.jsx("div",Object.assign({className:"mt-8 flex flex-col items-center"},{children:e.jsxs("div",Object.assign({className:"flex w-full max-w-[360px] flex-col items-center text-center"},{children:[e.jsx(a.default,{src:null==n?void 0:n.coverphoto,alt:`${null==n?void 0:n.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"}),e.jsx("h2",Object.assign({className:"mt-6 text-center text-[18px] font-semibold opacity-70 max-[767px]:text-base"},{children:null==n?void 0:n.formtitle})),e.jsx("p",Object.assign({className:"mt-4 font-semilight opacity-70"},{children:null==n?void 0:n.formdescription}))]}))}))]}))}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./Addons/Document/Provider.js"),s=require("./ResponseProvider.js");const a=t.createContext({});exports.PickaxeContext=a,exports.PickaxeProvider=({colors:o,children:c})=>{const[i,n]=t.useState(""),[d,u]=t.useState(""),[F,x]=t.useState(null),[l,h]=t.useState(!0),[S,j]=t.useState(!0),[I,P]=t.useState(!1);return e.jsx(a.Provider,Object.assign({value:{formId:i,chatId:d,pickaxe:F,colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#FF0000"},o),isNewChat:l,isShowIceBreaker:S,isShowHistory:I,setFormId:n,setChatId:u,setPickaxe:x,setIsNewChat:h,setIsShowIceBreaker:j,setIsShowHistory:P}},{children:e.jsx(s.default,{children:e.jsx(r.default,{children:c})})}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./Addons/Document/Provider.js"),s=require("./ResponseProvider.js");const o=t.createContext({});exports.PickaxeContext=o,exports.PickaxeProvider=({styles:a,colors:i,children:c})=>{const[n,d]=t.useState(""),[l,u]=t.useState(""),[F,x]=t.useState(null),[h,S]=t.useState(!0),[j,y]=t.useState(!0),[I,P]=t.useState(!1);return e.jsx(o.Provider,Object.assign({value:{formId:n,chatId:l,pickaxe:F,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},a),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},i),isNewChat:h,isShowIceBreaker:j,isShowHistory:I,setFormId:d,setChatId:u,setPickaxe:x,setIsNewChat:S,setIsShowIceBreaker:y,setIsShowHistory:P}},{children:e.jsx(s.default,{children:e.jsx(r.default,{children:c})})}))};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),r=require("../../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../../hooks/studio/useStyleButton.js"),a=require("../../Core/Button.js"),i=require("../../../common/cn.js");exports.default=o=>{var{variant:u,className:n}=o,c=e.__rest(o,["variant","className"]);const{styles:l}=r.usePickaxeContext(),v=s.useStyleButton({variant:u});return t.jsx(a.default,Object.assign({variant:u,className:i.default("min-h-[48px]",n,("primary"===u||"secondary"===u)&&"hover:opacity-90","outlined"===l.btnStyle&&"hover:opacity-70"),style:v},c))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../hooks/pickaxe/usePickaxe.js"),t=require("react"),a=require("../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../common/utils.js"),c=require("./Addons/Scroll/Provider.js"),o=require("./Chat/index.js"),i=require("./Form/index.js"),u=require("../../common/cn.js");exports.Pickaxe=({formId:d,chatId:l,className:x})=>{const{chatId:n,colors:f,setFormId:j,setChatId:k,setPickaxe:m}=a.usePickaxeContext(),h=r.usePickaxe();return t.useEffect((()=>{j(d)}),[d]),t.useEffect((()=>{"string"==typeof l&&k(l)}),[l]),t.useEffect((()=>{h.data&&(k(h.data.chatflag?s.generateId(15):""),m(h.data))}),[h.data]),e.jsx(c.default,{children:e.jsx("div",Object.assign({className:u.default("relative @container/pickaxe-root flex flex-col flex-grow w-full",x),style:{backgroundColor:f.primary,color:f.text}},{children:n?e.jsx(o.default,{}):e.jsx(i.default,{})}))})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("../../hooks/pickaxe/usePickaxe.js"),t=require("react"),a=require("../../hooks/pickaxe/usePickaxeContext.js"),s=require("../../common/utils.js"),c=require("./Addons/Scroll/Provider.js"),o=require("./Chat/index.js"),i=require("./Form/index.js"),l=require("../../common/cn.js");exports.Pickaxe=({formId:u,chatId:d,className:x})=>{const{chatId:n,styles:f,colors:j,setFormId:k,setChatId:m,setPickaxe:h}=a.usePickaxeContext(),q=r.usePickaxe();return t.useEffect((()=>{k(u)}),[u]),t.useEffect((()=>{"string"==typeof d&&m(d)}),[d]),t.useEffect((()=>{q.data&&(m(q.data.chatflag?s.generateId(15):""),h(q.data))}),[q.data]),q.data?e.jsx(c.default,{children:e.jsx("div",Object.assign({className:l.default("relative @container/pickaxe-root flex flex-col flex-grow w-full h-full",x,"dark"===f.theme&&"dark"),style:{backgroundColor:j.primary,color:j.text}},{children:n?e.jsx(o.default,{}):e.jsx(i.default,{})}))}):null};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("../pickaxe/usePickaxeContext.js");exports.useStyleButton=({variant:t="primary"})=>{const{styles:o,colors:n}=r.usePickaxeContext();return e.useMemo((()=>Object.assign(Object.assign(Object.assign({},"primary"===t&&Object.assign(Object.assign(Object.assign({borderWidth:`${o.outlineThickness}px`},"filled"===o.btnStyle&&{borderColor:n.accent,backgroundColor:n.accent,color:n.accentText}),"outlined"===o.btnStyle&&{color:n.accent,backgroundColor:"transparent",borderColor:n.accent}),"transparent"===o.btnStyle&&{color:n.accent,backgroundColor:"transparent",borderColor:"transparent"})),"secondary"===t&&{backgroundColor:"transparent",color:n.accent}),"transparent-text"===t&&{color:n.accent})),[o,n,t])};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),o=require("../pickaxe/usePickaxeContext.js");exports.useStyleInput=()=>{const{styles:r,colors:t}=o.usePickaxeContext();return e.useMemo((()=>Object.assign(Object.assign(Object.assign({borderWidth:`${r.outlineThickness}px`,borderRadius:`${r.cornerRadius}px`,background:"transparent"},"minimal"===r.formFieldStyle&&{borderBottomColor:t.secondary,color:t.text}),"box"===r.formFieldStyle&&{borderColor:t.secondary+"AA",color:t.text}),"block"===r.formFieldStyle&&{backgroundColor:t.secondary,color:t.secondaryText})),[r,t])};
@@ -1,6 +1,16 @@
1
1
  import type { SetState } from "../../types/common";
2
2
  import type { Pickaxe } from "../../types/pickaxe";
3
+ import type { StudioFontSize, StudioFormFieldStyle, StudioButtonStyle } from "../../types/studio";
3
4
  import { type ReactNode } from "react";
5
+ export type PickaxeProviderStyles = {
6
+ theme: "light" | "dark";
7
+ font: string;
8
+ fontSize: StudioFontSize;
9
+ formFieldStyle: StudioFormFieldStyle;
10
+ btnStyle: StudioButtonStyle;
11
+ outlineThickness: number;
12
+ cornerRadius: number;
13
+ };
4
14
  export type PickaxeProviderColors = {
5
15
  primary: string;
6
16
  text: string;
@@ -14,6 +24,7 @@ type PickaxeContextType = {
14
24
  formId: string;
15
25
  chatId: string;
16
26
  pickaxe: Pickaxe | null;
27
+ styles: PickaxeProviderStyles;
17
28
  colors: PickaxeProviderColors;
18
29
  isNewChat: boolean;
19
30
  isShowIceBreaker: boolean;
@@ -25,10 +36,11 @@ type PickaxeContextType = {
25
36
  setIsShowIceBreaker: SetState<boolean>;
26
37
  setIsShowHistory: SetState<boolean>;
27
38
  };
28
- interface IPickaxeProviderProps {
39
+ export interface IPickaxeProviderProps {
40
+ styles?: Partial<PickaxeProviderStyles>;
29
41
  colors?: Partial<PickaxeProviderColors>;
30
42
  children: ReactNode;
31
43
  }
32
44
  export declare const PickaxeContext: import("react").Context<PickaxeContextType>;
33
- export declare const PickaxeProvider: ({ colors, children, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
45
+ export declare const PickaxeProvider: ({ styles, colors, children, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
34
46
  export {};
@@ -0,0 +1,3 @@
1
+ import { ButtonProps } from "../../Core/Button";
2
+ declare const PickaxeButton: ({ variant, className, ...props }: Omit<ButtonProps, "ref">) => import("react/jsx-runtime").JSX.Element;
3
+ export default PickaxeButton;
@@ -3,4 +3,4 @@ export interface PickaxeProps {
3
3
  chatId?: string;
4
4
  className?: string;
5
5
  }
6
- export declare const Pickaxe: ({ formId: _formId, chatId: _chatId, className, }: PickaxeProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const Pickaxe: ({ formId: _formId, chatId: _chatId, className, }: PickaxeProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -2,6 +2,7 @@ export declare const usePickaxeContext: () => {
2
2
  formId: string;
3
3
  chatId: string;
4
4
  pickaxe: import("../../types/pickaxe").Pickaxe | null;
5
+ styles: import("../../components/Pickaxe/Provider").PickaxeProviderStyles;
5
6
  colors: import("../../components/Pickaxe/Provider").PickaxeProviderColors;
6
7
  isNewChat: boolean;
7
8
  isShowIceBreaker: boolean;
@@ -0,0 +1,7 @@
1
+ import { ButtonProps } from "../../components/Core/Button";
2
+ import { type CSSProperties } from "react";
3
+ interface UseStyleButtonOptions {
4
+ variant?: ButtonProps["variant"];
5
+ }
6
+ export declare const useStyleButton: ({ variant, }: UseStyleButtonOptions) => CSSProperties;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { type CSSProperties } from "react";
2
+ export declare const useStyleInput: () => Omit<CSSProperties, "height">;
@@ -0,0 +1,3 @@
1
+ export type StudioFontSize = "sm" | "md" | "lg" | "xl";
2
+ export type StudioFormFieldStyle = "minimal" | "box" | "block";
3
+ export type StudioButtonStyle = "filled" | "outlined" | "transparent";
@@ -0,0 +1,3 @@
1
+ import type { StorybookConfig } from "@storybook/react-vite";
2
+ declare const config: StorybookConfig;
3
+ export default config;
@@ -0,0 +1 @@
1
+ import{__rest as e}from"../../_virtual/_tslib.js";import{jsxs as t,Fragment as n,jsx as i}from"react/jsx-runtime";import{forwardRef as o,useMemo as r}from"react";import a from"../../common/cn.js";const s=o(((o,s)=>{var{style:l,variant:c="primary",className:d,loadingText:m="Loading",isDisabled:p=!1,isLoading:u=!1}=o,x=e(o,["style","variant","className","loadingText","isDisabled","isLoading"]);const b=r((()=>p||u?{"aria-disabled":!0,disabled:!0,style:Object.assign({cursor:"not-allowed",opacity:.5},l),onClick:e=>{e.preventDefault()}}:{style:l}),[l,p,u]),y=r((()=>u?Array.isArray(x.children)&&x.children.length>1?{children:t(n,{children:[x.children[0],m]})}:{children:m}:{}),[u,m]);return i("button",Object.assign({ref:s,className:a("primary"===c&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-c-blue bg-c-blue px-4 text-sm font-semibold text-white outline-none duration-300 hover:opacity-70 active:opacity-100","secondary"===c&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm bg-c-light-blue p-1 px-4 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","outline"===c&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-c-blue p-1 px-4 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","transparent"===c&&"flex min-h-[36px] select-none items-center justify-center gap-x-2 rounded-sm border-2 border-transparent bg-transparent px-4 py-1 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","transparent-text"===c&&"flex select-none items-center justify-center gap-x-2 text-sm font-semibold text-c-blue outline-none duration-300 hover:opacity-70 active:opacity-100","menu-item"===c&&"flex w-full select-none items-center gap-2 px-4 py-2 text-left text-sm font-semilight outline-none duration-300 hover:opacity-70 active:opacity-100",d)},x,b,y))}));s.displayName="Button";export{s as default};
@@ -1 +1 @@
1
- import{__rest as t,__awaiter as o}from"../../_virtual/_tslib.js";import{jsx as e}from"react/jsx-runtime";import{useState as r,useEffect as i}from"react";import c from"copy-to-clipboard";import s from"../Icons/copied.svg.js";import a from"../Icons/copy.svg.js";import n from"../../common/cn.js";const l=l=>{var{className:m="",inactiveColor:p="text-c-dark-gray hover:text-c-blue",activeColor:h="text-c-blue",size:u=16,text:f=""}=l,d=t(l,["className","inactiveColor","activeColor","size","text"]);const[g,v]=r(f),[j,x]=r(!1);i((()=>{v(f)}),[f]);return e("button",Object.assign({style:Object.assign(Object.assign({},d),{width:`${u}px`,height:`${u}px`,cursor:j?"default":"pointer"}),className:n("outline-none hover:duration-300",m),onClick:t=>{t.preventDefault(),t.stopPropagation(),o(void 0,void 0,void 0,(function*(){var t;try{if(j)return;x(!0);const o=null!==(t=[...Array.from(f.matchAll(/https:\/\/streaming\.pickaxeproject\.com\/api\/function_call_results\?.*?&name=[^&]+/g)),...Array.from(f.matchAll(/https:\/\/utils\.pickaxe\.chat\/api\/fn\/result\?.*?&name=[^&]+/g))].map((t=>t[0])))&&void 0!==t?t:[],e=[];if(o.length){for(const t of o)try{const o=yield fetch(t),r=yield o.json(),i=r.text||r.url||"";e.push(i)}catch(t){console.error(t)}e.length&&v(e.join("\n"))}c(e.length>0?e.join("\n"):g),yield new Promise((t=>setTimeout(t,1500))),x(!1)}catch(t){console.error(t)}finally{x(!1)}}))}},{children:j?e(s,{className:n(h),width:u,height:u}):e(a,{className:n(p),width:u,height:u})}))};export{l as default};
1
+ import{__rest as t,__awaiter as o}from"../../_virtual/_tslib.js";import{jsx as e}from"react/jsx-runtime";import{useState as r,useEffect as i}from"react";import s from"copy-to-clipboard";import n from"../Icons/copied.svg.js";import a from"../Icons/copy.svg.js";import c from"../../common/cn.js";const l=l=>{var{className:m="",inactiveColor:p="text-[#6A747C] hover:text-[#228DD7]",activeColor:h="text-[#228DD7]",size:f=16,text:u=""}=l,d=t(l,["className","inactiveColor","activeColor","size","text"]);const[v,g]=r(u),[j,x]=r(!1);i((()=>{g(u)}),[u]);return e("button",Object.assign({style:Object.assign(Object.assign({},d),{width:`${f}px`,height:`${f}px`,cursor:j?"default":"pointer"}),className:c("outline-none hover:duration-300",m),onClick:t=>{t.preventDefault(),t.stopPropagation(),o(void 0,void 0,void 0,(function*(){var t;try{if(j)return;x(!0);const o=null!==(t=[...Array.from(u.matchAll(/https:\/\/streaming\.pickaxeproject\.com\/api\/function_call_results\?.*?&name=[^&]+/g)),...Array.from(u.matchAll(/https:\/\/utils\.pickaxe\.chat\/api\/fn\/result\?.*?&name=[^&]+/g))].map((t=>t[0])))&&void 0!==t?t:[],e=[];if(o.length){for(const t of o)try{const o=yield fetch(t),r=yield o.json(),i=r.text||r.url||"";e.push(i)}catch(t){console.error(t)}e.length&&g(e.join("\n"))}s(e.length>0?e.join("\n"):v),yield new Promise((t=>setTimeout(t,1500))),x(!1)}catch(t){console.error(t)}finally{x(!1)}}))}},{children:j?e(n,{className:c(h),width:f,height:f}):e(a,{className:c(p),width:f,height:f})}))};export{l as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import r from"../Icons/circle-exclamation.svg.js";import m from"./HtmlRenderer.js";import t from"../../common/cn.js";const a=({error:a,className:o,iconClassName:l,htmlClassName:c})=>a?e("div",Object.assign({className:t("flex items-center gap-2 text-red-500",o)},{children:[s(r,{className:t("h-5 w-5 shrink-0",l)}),s(m,{className:t("danger-error text-sm font-semibold",c),html:a})]})):null;export{a as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import m from"../Icons/circle-exclamation.svg.js";import r from"./HtmlRenderer.js";import t from"../../common/cn.js";const a=({error:a,className:o,iconClassName:l,htmlClassName:c})=>a?e("div",Object.assign({className:t("flex items-center gap-2 text-red-500",o)},{children:[s(m,{className:t("h-5 w-5 shrink-0",l)}),s(r,{className:t("text-sm font-semibold",c),html:a})]})):null;export{a as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import i from"../Icons/circle-info.svg.js";import o from"./Menu/index.js";import r from"./Menu/Button.js";import n from"./Menu/List.js";import s from"../../common/cn.js";const a=({id:a,label:c="",icon:l=i,className:m,contentClassName:d,size:p=20,width:h="300px",border:g,align:u="right-start"})=>e(o,Object.assign({id:a},{children:[t(r,{children:t(l,{className:s("shrink-0 cursor-help text-black/40 outline-none duration-300 hover:text-black/80 hover:duration-200",m),style:{width:p,height:p},onClick:e=>e.stopPropagation()})}),t(n,Object.assign({width:h,align:u,className:s("p-6",d)},g&&{border:g},{children:"string"==typeof c?t("div",Object.assign({className:"select-none px-2 py-1 text-[13px]"},{children:t("p",{children:c})})):c}))]}));export{a as default};
1
+ import{jsxs as e,jsx as i}from"react/jsx-runtime";import t from"../Icons/circle-info.svg.js";import o from"./Menu/index.js";import r from"./Menu/Button.js";import n from"./Menu/List.js";import s from"../../common/cn.js";const a=({id:a,label:c="",icon:l=t,className:m,contentClassName:p,size:d=20,width:h="300px",border:g,align:u="right-start"})=>e(o,Object.assign({id:a},{children:[i(r,{children:i(l,{className:s("shrink-0 cursor-help outline-none duration-300 hover:opacity-80 hover:duration-200",m),style:{width:d,height:d},onClick:e=>e.stopPropagation()})}),i(n,Object.assign({width:h,align:u,className:s("p-6",p)},g&&{border:g},{children:"string"==typeof c?i("div",Object.assign({className:"select-none px-2 py-1 text-[13px]"},{children:i("p",{children:c})})):c}))]}));export{a as default};
@@ -1 +1 @@
1
- import*as r from"react";var e;function t(){return t=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},t.apply(null,arguments)}var n=n=>r.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},n),e||(e=r.createElement("path",{stroke:"#288DD7",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m21.44 11.05-9.19 9.19a6.003 6.003 0 1 1-8.49-8.49l9.19-9.19a4.002 4.002 0 0 1 5.66 5.66l-9.2 9.19a2.001 2.001 0 1 1-2.83-2.83l8.49-8.48"})));export{n as default};
1
+ import*as r from"react";var e;function t(){return t=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},t.apply(null,arguments)}var n=n=>r.createElement("svg",t({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},n),e||(e=r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m21.44 11.05-9.19 9.19a6.003 6.003 0 1 1-8.49-8.49l9.19-9.19a4.002 4.002 0 0 1 5.66 5.66l-9.2 9.19a2.001 2.001 0 1 1-2.83-2.83l8.49-8.48"})));export{n as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useCallback as o}from"react";import{useDocumentContext as r}from"./hooks/useDocumentContext.js";import{AnimatePresence as s,motion as i}from"framer-motion";import a from"../../../Icons/document.svg.js";import n from"../../../Icons/link.svg.js";import c from"../../../Icons/youtube.svg.js";import m from"../../../Icons/trash.svg.js";import l from"../../../Icons/spinner-lines.svg.js";import p from"../../../Core/Tooltip.js";import d from"../../../../common/cn.js";const u=({className:u})=>{const{documents:h,isShowList:f,setDocuments:g}=r(),v=o((e=>e.length>85?`${e.slice(0,25)}...${e.slice(-10)}`:e),[]);return e(s,{children:f&&e(i.div,Object.assign({className:d("flex w-full flex-col gap-1",u),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},{children:h.filter((e=>!e.isInsertedAsRaw)).map((({type:o,name:r,status:s,error:i},d)=>t("div",Object.assign({className:"group flex cursor-pointer justify-between gap-2 rounded-sm border border-transparent bg-white px-3 py-2 hover:border-[#E8EDF2] hover:shadow-sm hover:duration-300"},{children:[t("div",Object.assign({className:"flex items-center gap-2"},{children:["uploading"===s?e(l,{className:"h-6 w-6 shrink-0 animate-spin text-c-dark-gray"}):"failed"===s?e(p,{id:`document-upload-failed-${d}`,label:null!=i?i:"Upload failed. Please try again.",className:"text-c-red"}):e("website"===o?n:"youtube"===o?c:a,{className:"h-6 w-6 shrink-0 text-c-dark-gray"}),e("p",Object.assign({className:"line-clamp-1 text-[14px] font-semilight text-black/70"},{children:v(r)}))]})),e("button",Object.assign({className:"opacity-0 outline-none group-hover:opacity-100 group-hover:duration-300",onClick:()=>{return e=d,void g((t=>t.filter(((t,o)=>o!==e))));var e}},{children:e(m,{className:"h-6 w-6 shrink-0 text-c-dark-gray hover:opacity-80 hover:duration-300"})}))]}),d)))}))})};export{u as default};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useCallback as t}from"react";import{useDocumentContext as r}from"./hooks/useDocumentContext.js";import{AnimatePresence as s,motion as i}from"framer-motion";import a from"../../../Icons/document.svg.js";import n from"../../../Icons/link.svg.js";import c from"../../../Icons/youtube.svg.js";import m from"../../../Icons/trash.svg.js";import l from"../../../Icons/spinner-lines.svg.js";import p from"../../../Core/Tooltip.js";import d from"../../../../common/cn.js";const u=({className:u})=>{const{documents:h,isShowList:f,setDocuments:g}=r(),v=t((e=>e.length>85?`${e.slice(0,25)}...${e.slice(-10)}`:e),[]);return e(s,{children:f&&e(i.div,Object.assign({className:d("flex w-full flex-col gap-1",u),initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3}},{children:h.filter((e=>!e.isInsertedAsRaw)).map((({type:t,name:r,status:s,error:i},d)=>o("div",Object.assign({className:"group flex cursor-pointer justify-between gap-2 rounded-sm border border-transparent bg-white px-3 py-2 hover:border-[#E8EDF2] hover:shadow-sm hover:duration-300"},{children:[o("div",Object.assign({className:"flex items-center gap-2"},{children:["uploading"===s?e(l,{className:"h-6 w-6 shrink-0 animate-spin text-c-dark-gray"}):"failed"===s?e(p,{id:`document-upload-failed-${d}`,label:null!=i?i:"Upload failed. Please try again.",className:"text-c-red"}):e("website"===t?n:"youtube"===t?c:a,{className:"h-6 w-6 shrink-0 text-c-dark-gray"}),e("p",Object.assign({className:"line-clamp-1 text-[14px] font-semilight opacity-70"},{children:v(r)}))]})),e("button",Object.assign({className:"opacity-0 outline-none group-hover:opacity-100 group-hover:duration-300",onClick:()=>{return e=d,void g((o=>o.filter(((o,t)=>t!==e))));var e}},{children:e(m,{className:"h-6 w-6 shrink-0 text-c-dark-gray hover:opacity-80 hover:duration-300"})}))]}),d)))}))})};export{u as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useState as t,useMemo as a}from"react";import{usePickaxeContext as l}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as i}from"../../../../hooks/pickaxe/useResponseContext.js";import{useConversation as o}from"../../../../hooks/pickaxe/useConversation.js";import c from"../../../Icons/circle-info.svg.js";import n from"../../../Core/PickaxeIcon.js";import r from"../../Addons/Scroll/ScrollLockView.js";import m from"../../InfoModal.js";import d from"./Message.js";import p from"../../../../common/cn.js";import f from"../../../Core/HtmlRenderer.js";const x=()=>{var x;const{pickaxe:u,colors:g,isNewChat:h}=l(),{messages:b,status:v,error:j}=i(),w=o(),[N,k]=t(!1),y=a((()=>!!w.data&&!(w.data.messages.length<=1)),[w.data]),O=a((()=>w.isSuccess&&h&&!y),[w.isSuccess,h,y]);return e("div",Object.assign({className:"relative flex flex-grow flex-col justify-end"},{children:[N&&s(m,{isOpen:N,onChangeIsOpen:k}),e("div",Object.assign({className:p("absolute left-1/2 top-5 flex w-full max-w-[400px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",O&&"top-1/3 opacity-100")},{children:[s(n,{src:null==u?void 0:u.coverphoto,alt:`${null==u?void 0:u.formtitle}'s Profile Picture`,width:64,height:64,className:"h-16 w-16 rounded-full"}),e("div",Object.assign({className:"flex flex-col items-center"},{children:[e("h2",Object.assign({className:"mt-6 text-center text-lg font-semibold text-black/70 max-[767px]:text-base"},{children:[`${null==u?void 0:u.formtitle.slice(0,130)}${(null!==(x=null==u?void 0:u.formtitle)&&void 0!==x?x:"").length>130?"...":""}`,s("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>k(!0)},{children:s(c,{className:"h-5 w-5 shrink-0",style:{color:g.accent}})}))]})),s("p",Object.assign({className:"mt-2 line-clamp-3 whitespace-pre-line max-w-[600px] text-center font-semilight text-black/70"},{children:null==u?void 0:u.formdescription}))]}))]})),s("div",Object.assign({className:"flex w-full justify-center"},{children:w.isLoading?e("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[s("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-gray-200"}),s("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-gray-200"}),s("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-gray-200"})]})):w.isError?s("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e("p",Object.assign({className:"text-center text-xl font-semibold"},{children:["Something went wrong. Please try again, or"," ",s("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help"},{children:"contact us"}))," ","for help."]}))})):e("div",Object.assign({className:"relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-10 max-[767px]:pt-6"},{children:[w.data.messages.map(((e,t)=>s(d,{message:e},t))),b.map(((e,t)=>s(d,{message:e},t))),"fetching"===v?e("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==u?void 0:u.chaticon)&&s(n,{src:null==u?void 0:u.chaticon,alt:`${null==u?void 0:u.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6"}),e("div",Object.assign({className:"flex items-center gap-x-2 rounded bg-blue-100/50 px-4 py-4"},{children:[s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full bg-black/60"}),s("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full bg-black/60"}),s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full bg-black/60"})]}))]})):j?e("div",Object.assign({className:"flex max-w-[80%] gap-x-3"},{children:[s(c,{className:"mt-2 h-6 w-6 shrink-0 text-red-500"}),s(f,{className:"x-4 py-2 font-semibold text-red-500",html:j})]})):null,s(r,{className:"absolute bottom-0 left-0 w-full"})]}))}))]}))};export{x as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useState as a,useMemo as t}from"react";import{usePickaxeContext as l}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as i}from"../../../../hooks/pickaxe/useResponseContext.js";import{useConversation as o}from"../../../../hooks/pickaxe/useConversation.js";import c from"../../../Icons/circle-info.svg.js";import n from"../../../Core/PickaxeIcon.js";import r from"../../Addons/Scroll/ScrollLockView.js";import m from"../../InfoModal.js";import d from"./Message.js";import p from"../../../../common/cn.js";import f from"../../../Core/HtmlRenderer.js";const x=()=>{var x;const{pickaxe:u,colors:g,isNewChat:h}=l(),{messages:b,status:v,error:j}=i(),w=o(),[N,y]=a(!1),k=t((()=>!!w.data&&!(w.data.messages.length<=1)),[w.data]),O=t((()=>w.isSuccess&&h&&!k),[w.isSuccess,h,k]);return e("div",Object.assign({className:"relative flex flex-grow flex-col justify-end"},{children:[N&&s(m,{isOpen:N,onChangeIsOpen:y}),e("div",Object.assign({className:p("absolute left-1/2 top-5 flex w-full max-w-[400px] -translate-x-1/2 -translate-y-1/3 transform flex-col items-center px-4 opacity-0 duration-300",O&&"top-1/3 opacity-100")},{children:[s(n,{src:null==u?void 0:u.coverphoto,alt:`${null==u?void 0:u.formtitle}'s Profile Picture`,width:64,height:64,className:"h-16 w-16 rounded-full"}),e("div",Object.assign({className:"flex flex-col items-center"},{children:[e("h2",Object.assign({className:"mt-6 text-center text-lg font-semibold opacity-70 max-[767px]:text-base"},{children:[`${null==u?void 0:u.formtitle.slice(0,130)}${(null!==(x=null==u?void 0:u.formtitle)&&void 0!==x?x:"").length>130?"...":""}`,s("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>y(!0)},{children:s(c,{className:"h-5 w-5 shrink-0",style:{color:g.accent}})}))]})),s("p",Object.assign({className:"mt-2 line-clamp-3 whitespace-pre-line max-w-[600px] text-center font-semilight opacity-70"},{children:null==u?void 0:u.formdescription}))]}))]})),s("div",Object.assign({className:"flex w-full justify-center"},{children:w.isLoading?e("div",Object.assign({className:"grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-6 pt-10"},{children:[s("div",{className:"h-10 w-[70%] animate-pulse justify-self-end rounded bg-gray-200"}),s("div",{className:"h-[150px] w-[70%] animate-pulse rounded bg-gray-200"}),s("div",{className:"h-10 w-[50%] animate-pulse justify-self-end rounded bg-gray-200"})]})):w.isError?s("div",Object.assign({className:"flex w-full max-w-[800px] justify-center pt-10"},{children:e("p",Object.assign({className:"text-center text-xl font-semibold"},{children:["Something went wrong. Please try again, or"," ",s("a",Object.assign({href:"mailto:info@pickaxeproject.com?subject=Help"},{children:"contact us"}))," ","for help."]}))})):e("div",Object.assign({className:"relative grid w-full max-w-[800px] grid-cols-1 gap-y-6 px-4 pt-10 max-[767px]:pt-6"},{children:[w.data.messages.map(((e,a)=>s(d,{message:e},a))),b.map(((e,a)=>s(d,{message:e},a))),"fetching"===v?e("div",Object.assign({className:"flex max-w-[80%] items-center gap-x-3"},{children:["NONE"!==(null==u?void 0:u.chaticon)&&s(n,{src:null==u?void 0:u.chaticon,alt:`${null==u?void 0:u.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6"}),e("div",Object.assign({className:"flex items-center gap-x-2 rounded bg-blue-100/50 px-4 py-4"},{children:[s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full bg-black/60"}),s("div",{className:"h-1.5 w-1.5 animate-dot-down rounded-full bg-black/60"}),s("div",{className:"h-1.5 w-1.5 animate-dot rounded-full bg-black/60"})]}))]})):j?e("div",Object.assign({className:"flex max-w-[80%] gap-x-3"},{children:[s(c,{className:"mt-2 h-6 w-6 shrink-0 text-red-500"}),s(f,{className:"x-4 py-2 font-semibold text-red-500",html:j})]})):null,s(r,{className:"absolute bottom-0 left-0 w-full"})]}))}))]}))};export{x as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as i}from"react";import{usePickaxeContext as o}from"../../../hooks/pickaxe/usePickaxeContext.js";import l from"../../Icons/circle-info.svg.js";import n from"../../Core/PickaxeIcon.js";import c from"../InfoModal.js";const s=()=>{var s;const{pickaxe:r}=o(),[a,m]=i(!1);return e("div",Object.assign({className:"flex flex-col items-center"},{children:[a&&t(c,{isOpen:a,onChangeIsOpen:m}),t(n,{src:null==r?void 0:r.coverphoto,alt:`${null==r?void 0:r.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"}),e("h2",Object.assign({className:"mt-6 text-center text-[18px] font-semibold text-black/70 max-[767px]:text-base"},{children:[`${null==r?void 0:r.formtitle.slice(0,130)}${(null!==(s=null==r?void 0:r.formtitle)&&void 0!==s?s:"").length>130?"...":""}`,t("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>m(!0)},{children:t(l,{className:"h-5 w-5 shrink-0 text-c-blue"})}))]})),t("p",Object.assign({className:"mt-2 max-w-[600px] line-clamp-3 whitespace-pre-line text-center font-semilight text-black/70"},{children:null==r?void 0:r.formdescription}))]}))};export{s as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useState as i}from"react";import{usePickaxeContext as o}from"../../../hooks/pickaxe/usePickaxeContext.js";import l from"../../Icons/circle-info.svg.js";import n from"../../Core/PickaxeIcon.js";import c from"../InfoModal.js";const s=()=>{var s;const{pickaxe:r}=o(),[a,m]=i(!1);return e("div",Object.assign({className:"flex flex-col items-center"},{children:[a&&t(c,{isOpen:a,onChangeIsOpen:m}),t(n,{src:null==r?void 0:r.coverphoto,alt:`${null==r?void 0:r.formtitle}'s Profile Picture`,width:90,height:90,className:"h-[90px] w-[90px] rounded-full"}),e("h2",Object.assign({className:"mt-6 text-center text-[18px] font-semibold opacity-70 max-[767px]:text-base"},{children:[`${null==r?void 0:r.formtitle.slice(0,130)}${(null!==(s=null==r?void 0:r.formtitle)&&void 0!==s?s:"").length>130?"...":""}`,t("button",Object.assign({className:"ml-2 inline-block outline-none hover:opacity-70 hover:duration-300 active:opacity-100",onClick:()=>m(!0)},{children:t(l,{className:"h-5 w-5 shrink-0 text-c-blue"})}))]})),t("p",Object.assign({className:"mt-2 max-w-[600px] line-clamp-3 whitespace-pre-line text-center font-semilight opacity-70"},{children:null==r?void 0:r.formdescription}))]}))};export{s as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useMemo as t}from"react";import{usePickaxeContext as o}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{format as l}from"date-fns";import r from"../../../Icons/message-square-notes.svg.js";import a from"../../../Icons/visitor.svg.js";import i from"../../../Core/PickaxeIcon.js";import n from"../../../Core/CopyButton.js";import c from"../../../Core/MarkdownRenderer.js";const d=({item:d})=>{const{pickaxe:m,colors:p,setChatId:h,setIsNewChat:f}=o(),u=t((()=>l(d.createdAt,"hh:mm a MMM dd, yy")),[d]),g=t((()=>d&&d.messages?d.messages.length:0),[d]),x=t((()=>{var e,s,t,o;if("form"===d.type){return(null!==(e=d.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}return null!==(o=null===(t=null===(s=d.messages)||void 0===s?void 0:s[0])||void 0===t?void 0:t.message)&&void 0!==o?o:""}),[d]),v=t((()=>{var e,s,t,o;return"form"===d.type?null!==(e=d.questionResponse)&&void 0!==e?e:"":null!==(o=null===(t=null===(s=d.messages)||void 0===s?void 0:s[1])||void 0===t?void 0:t.message)&&void 0!==o?o:""}),[d]);return e("div",Object.assign({className:"flex flex-co transition hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden bg-white px-4 py-5"},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(a,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[s("input",{id:`${d.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:x.length<280}),s("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:x}}),s("label",Object.assign({htmlFor:`${d.responseId}-input`,className:"mt-1 flex shrink-0 whitespace-nowrap text-sm font-semibold peer-checked:hidden hover:cursor-pointer",style:{color:p.accent}},{children:"See input"})),s("label",Object.assign({htmlFor:`${d.responseId}-input`,className:"hidden shrink-0 whitespace-nowrap text-sm font-semibold peer-checked:flex hover:cursor-pointer",style:{color:p.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:p.secondary,color:p.secondaryText}},{children:[s(i,{src:null==m?void 0:m.chaticon,alt:`${null==m?void 0:m.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1"}),e("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(c,{className:"overflow-x-auto pb-2 font-light text-black/90 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]",html:v}),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==m?void 0:m.enablechatresponses)&&e("button",Object.assign({className:"flex items-center gap-x-1 hover:cursor-pointer hover:text-c-blue",onClick:()=>{return e=d.responseId,f(!1),void h(e);var e}},{children:[s(r,{className:"h-4 w-4"}),s("p",Object.assign({className:"text-sm font-semibold"},{children:g+1}))]})),s(n,{text:v})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:"text-sm font-semibold uppercase opacity-30"},{children:u}))}))]}))]}))]}))]}))};export{d as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useMemo as t}from"react";import{usePickaxeContext as o}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{format as l}from"date-fns";import r from"../../../Icons/message-square-notes.svg.js";import a from"../../../Icons/visitor.svg.js";import i from"../../../Core/PickaxeIcon.js";import n from"../../../Core/CopyButton.js";import c from"../../../Core/MarkdownRenderer.js";const d=({item:d})=>{const{pickaxe:m,colors:p,setChatId:h,setIsNewChat:f}=o(),u=t((()=>l(d.createdAt,"hh:mm a MMM dd, yy")),[d]),g=t((()=>d&&d.messages?d.messages.length:0),[d]),x=t((()=>{var e,s,t,o;if("form"===d.type){return(null!==(e=d.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}return null!==(o=null===(t=null===(s=d.messages)||void 0===s?void 0:s[0])||void 0===t?void 0:t.message)&&void 0!==o?o:""}),[d]),v=t((()=>{var e,s,t,o;return"form"===d.type?null!==(e=d.questionResponse)&&void 0!==e?e:"":null!==(o=null===(t=null===(s=d.messages)||void 0===s?void 0:s[1])||void 0===t?void 0:t.message)&&void 0!==o?o:""}),[d]);return e("div",Object.assign({className:"flex flex-co transition hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden bg-white px-4 py-5"},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(a,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-1.5 scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[s("input",{id:`${d.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:x.length<280}),s("div",{className:"danger-html hidden flex-col peer-checked:flex",dangerouslySetInnerHTML:{__html:x}}),s("label",Object.assign({htmlFor:`${d.responseId}-input`,className:"mt-1 flex shrink-0 whitespace-nowrap text-sm font-semibold peer-checked:hidden hover:cursor-pointer",style:{color:p.accent}},{children:"See input"})),s("label",Object.assign({htmlFor:`${d.responseId}-input`,className:"hidden shrink-0 whitespace-nowrap text-sm font-semibold peer-checked:flex hover:cursor-pointer",style:{color:p.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:p.secondary,color:p.secondaryText}},{children:[s(i,{src:null==m?void 0:m.chaticon,alt:`${null==m?void 0:m.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1"}),e("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(c,{className:"overflow-x-auto pb-2 font-light opacity-90 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]",html:v}),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==m?void 0:m.enablechatresponses)&&e("button",Object.assign({className:"flex items-center gap-x-1 hover:cursor-pointer hover:text-c-blue",onClick:()=>{return e=d.responseId,f(!1),void h(e);var e}},{children:[s(r,{className:"h-4 w-4"}),s("p",Object.assign({className:"text-sm font-semibold"},{children:g+1}))]})),s(n,{text:v})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:"text-sm font-semibold uppercase opacity-30"},{children:u}))}))]}))]}))]}))]}))};export{d as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useMemo as t}from"react";import{usePickaxeContext as o}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{format as l}from"date-fns";import a from"../../../Icons/message-square-notes.svg.js";import n from"../../../Icons/visitor.svg.js";import i from"../../../Core/PickaxeIcon.js";import c from"../../../Core/CopyButton.js";import d from"../../../Core/MarkdownRenderer.js";import m from"../../Addons/Scroll/ScrollLockView.js";const p=()=>{var p;const{pickaxe:h,colors:x,setChatId:f,setIsNewChat:u}=o(),{response:b}=r(),g=t((()=>l(b?b.createdAt:new Date,"hh:mm a MMM dd, yy")),[b]),v=t((()=>{var e;if(!b)return"";return(null!==(e=b.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}),[b]);return b?e("div",Object.assign({className:"flex flex-col shadow-black transition hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden bg-white px-4 py-5"},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(n,{className:"h-6 w-6 text-black"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[s("input",{id:`${b.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:v.length<280}),s("div",{className:"danger-html hidden flex-col text-black/50 peer-checked:flex",dangerouslySetInnerHTML:{__html:v}}),s("label",Object.assign({htmlFor:`${b.responseId}-input`,className:"mt-1 flex shrink-0 whitespace-nowrap text-sm font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer",style:{color:x.accent}},{children:"See input"})),s("label",Object.assign({htmlFor:`${b.responseId}-input`,className:"hidden shrink-0 whitespace-nowrap text-sm font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer",style:{color:x.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:x.secondary,color:x.secondaryText}},{children:[s(i,{src:null==h?void 0:h.chaticon,alt:`${null==h?void 0:h.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1"}),e("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(d,{className:"overflow-x-auto pb-2 font-light text-black/90 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]",html:b.questionResponse}),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==h?void 0:h.enablechatresponses)&&e("button",Object.assign({className:"flex items-center gap-x-1 hover:cursor-pointer hover:text-c-blue",onClick:()=>{return e=b.responseId,u(!1),void f(e);var e}},{children:[s(a,{className:"h-4 w-4"}),s("p",Object.assign({className:"text-sm font-semibold"},{children:b.messages.length+1}))]})),s(c,{text:null!==(p=b.questionResponse)&&void 0!==p?p:""})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:"text-sm font-semibold uppercase opacity-30"},{children:g}))}))]}))]}))]})),s(m,{})]})):null};export{p as default};
1
+ import{jsxs as e,jsx as s}from"react/jsx-runtime";import{useMemo as t}from"react";import{usePickaxeContext as o}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as r}from"../../../../hooks/pickaxe/useResponseContext.js";import{format as l}from"date-fns";import a from"../../../Icons/message-square-notes.svg.js";import n from"../../../Icons/visitor.svg.js";import i from"../../../Core/PickaxeIcon.js";import c from"../../../Core/CopyButton.js";import d from"../../../Core/MarkdownRenderer.js";import p from"../../Addons/Scroll/ScrollLockView.js";const m=()=>{var m;const{pickaxe:h,colors:x,setChatId:f,setIsNewChat:u}=o(),{response:g}=r(),b=t((()=>l(g?g.createdAt:new Date,"hh:mm a MMM dd, yy")),[g]),v=t((()=>{var e;if(!g)return"";return(null!==(e=g.questions)&&void 0!==e?e:[]).map((e=>`<div style="display: flex; flex-direction: column; margin-bottom: 1em;">\n <p style="font-weight: 500;">${e.question}</p>\n <p>${e.answer||"n/a"}</p>\n</div>`)).join("")}),[g]);return g?e("div",Object.assign({className:"flex flex-col shadow-black transition hover:shadow"},{children:[e("div",Object.assign({className:"flex gap-x-3 overflow-hidden bg-white px-4 py-5"},{children:[s("div",Object.assign({className:"shrink-0 pt-1"},{children:s(n,{className:"h-6 w-6"})})),e("div",Object.assign({className:"flex flex-col gap-y-1 overflow-x-auto pb-[6px] scrollbar-track-gray-100 scrollbar-thumb-[#4A4A4B] lg:max-w-[520px] lg:scrollbar-thin"},{children:[s("input",{id:`${g.responseId}-input`,type:"checkbox",className:"peer hidden",defaultChecked:v.length<280}),s("div",{className:"danger-html hidden flex-col opacity-50 peer-checked:flex",dangerouslySetInnerHTML:{__html:v}}),s("label",Object.assign({htmlFor:`${g.responseId}-input`,className:"mt-1 flex shrink-0 whitespace-nowrap text-sm font-semibold text-[#228DD7] peer-checked:hidden hover:cursor-pointer",style:{color:x.accent}},{children:"See input"})),s("label",Object.assign({htmlFor:`${g.responseId}-input`,className:"hidden shrink-0 whitespace-nowrap text-sm font-semibold text-[#228DD7] peer-checked:flex hover:cursor-pointer",style:{color:x.accent}},{children:"Hide input"}))]}))]})),e("div",Object.assign({className:"flex gap-x-3 px-4 py-5",style:{backgroundColor:x.secondary,color:x.secondaryText}},{children:[s(i,{src:null==h?void 0:h.chaticon,alt:`${null==h?void 0:h.formtitle}'s Chat Icon`,width:24,height:24,className:"h-6 w-6 pt-1"}),e("div",Object.assign({className:"flex w-full flex-col gap-y-2 overflow-hidden"},{children:[s(d,{className:"overflow-x-auto pb-2 font-light opacity-90 scrollbar-thin scrollbar-track-white scrollbar-thumb-[#4A4A4B]",html:g.questionResponse}),e("div",Object.assign({className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1"},{children:[e("div",Object.assign({className:"flex items-center gap-3"},{children:[(null==h?void 0:h.enablechatresponses)&&e("button",Object.assign({className:"flex items-center gap-x-1 hover:cursor-pointer hover:text-c-blue",onClick:()=>{return e=g.responseId,u(!1),void f(e);var e}},{children:[s(a,{className:"h-4 w-4"}),s("p",Object.assign({className:"text-sm font-semibold"},{children:g.messages.length+1}))]})),s(c,{text:null!==(m=g.questionResponse)&&void 0!==m?m:""})]})),s("div",Object.assign({className:"flex shrink-0 grow justify-end"},{children:s("p",Object.assign({className:"text-sm font-semibold uppercase opacity-30"},{children:b}))}))]}))]}))]})),s(p,{})]})):null};export{m as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{usePickaxeContext as s}from"../../../hooks/pickaxe/usePickaxeContext.js";import{generateId as o}from"../../../common/utils.js";const i=()=>{const{isShowHistory:i,setChatId:a,setIsNewChat:r,setIsShowHistory:c}=s();return e("div",Object.assign({className:"mt-6 flex flex-wrap gap-2"},{children:[t("button",Object.assign({onClick:()=>{return e=o(20),r(!0),void a(e);var e},className:"flex h-[48px] w-full max-w-[140px] items-center justify-center gap-2 rounded-sm bg-c-blue px-4 font-semibold text-white hover:opacity-80 hover:duration-300 disabled:cursor-wait disabled:opacity-60"},{children:t("span",Object.assign({className:"font-semibold"},{children:"New chat"}))})),!i&&t("button",Object.assign({className:"flex h-[48px] w-full max-w-[140px] items-center justify-center px-4 font-semibold hover:text-black/70 hover:duration-300",onClick:()=>c(!0)},{children:"See history"}))]}))};export{i as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{usePickaxeContext as s}from"../../../hooks/pickaxe/usePickaxeContext.js";import{generateId as o}from"../../../common/utils.js";const i=()=>{const{isShowHistory:i,setChatId:a,setIsNewChat:r,setIsShowHistory:c}=s();return e("div",Object.assign({className:"mt-6 flex flex-wrap gap-2"},{children:[t("button",Object.assign({onClick:()=>{return e=o(20),r(!0),void a(e);var e},className:"flex h-[48px] w-full max-w-[140px] items-center justify-center gap-2 rounded-sm bg-c-blue px-4 font-semibold text-white hover:opacity-80 hover:duration-300 disabled:cursor-wait disabled:opacity-60"},{children:t("span",Object.assign({className:"font-semibold"},{children:"New chat"}))})),!i&&t("button",Object.assign({className:"flex h-[48px] w-full max-w-[140px] items-center justify-center px-4 font-semibold hover:opacity-70 hover:duration-300",onClick:()=>c(!0)},{children:"See history"}))]}))};export{i as default};