@pickaxeproject/react 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_virtual/index3.js +1 -0
- package/dist/cjs/_virtual/index4.js +1 -0
- package/dist/cjs/_virtual/react-is.development.js +1 -0
- package/dist/cjs/_virtual/react-is.production.min.js +1 -0
- package/dist/cjs/common/utils.js +1 -1
- package/dist/cjs/common/validation.js +1 -0
- package/dist/cjs/components/Icons/collapse-new.svg.js +1 -0
- package/dist/cjs/components/Icons/copy-new.svg.js +1 -0
- package/dist/cjs/components/Icons/download-new.svg.js +1 -0
- package/dist/cjs/components/Icons/history.svg.js +1 -0
- package/dist/cjs/components/Icons/pencil.svg.js +1 -0
- package/dist/cjs/components/Pickaxe/Addons/Artifact/Renderer/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Auth/Provider.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Auth/hooks/useAuth.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Navbar/NavPill.js +1 -0
- package/dist/cjs/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/Questions/Submit.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Provider.js +1 -1
- package/dist/cjs/components/Pickaxe/common/AccessGroupCardPreview.js +1 -0
- package/dist/cjs/components/Pickaxe/common/PickaxeAvatar.js +1 -0
- package/dist/cjs/components/Pickaxe/common/PickaxeCommon.js +1 -0
- package/dist/cjs/components/Pickaxe/common/PickaxeCurrency.js +1 -0
- package/dist/cjs/components/Pickaxe/common/PickaxeUpgradeCard.js +1 -1
- package/dist/cjs/components/Pickaxe/index.js +1 -1
- package/dist/cjs/hooks/studio/useStudio.js +1 -0
- package/dist/cjs/node_modules/.pnpm/@stripe_react-stripe-js@4.0.2_@stripe_stripe-js@7.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs.js +1 -0
- package/dist/cjs/node_modules/.pnpm/@stripe_stripe-js@7.9.0/node_modules/@stripe/stripe-js/dist/index.mjs.js +1 -0
- package/dist/cjs/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js +7 -0
- package/dist/cjs/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js +1 -0
- package/dist/cjs/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js +1 -0
- package/dist/cjs/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js +1 -0
- package/dist/cjs/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -0
- package/dist/cjs/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js +1 -0
- package/dist/cjs/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js +1 -0
- package/dist/cjs/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +9 -0
- package/dist/cjs/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +9 -0
- package/dist/cjs/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -0
- package/dist/cjs/src/common/utils.d.ts +2 -0
- package/dist/cjs/src/common/validation.d.ts +7 -0
- package/dist/cjs/src/components/Pickaxe/Addons/Auth/Provider.d.ts +4 -0
- package/dist/cjs/src/components/Pickaxe/Addons/Auth/hooks/useAuthContext.d.ts +4 -0
- package/dist/cjs/src/components/Pickaxe/Addons/Navbar/NavPill.d.ts +22 -0
- package/dist/cjs/src/components/Pickaxe/Provider.d.ts +25 -4
- package/dist/cjs/src/components/Pickaxe/ResponseProvider.d.ts +7 -3
- package/dist/cjs/src/components/Pickaxe/common/AccessGroupCardPreview.d.ts +9 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeAvatar.d.ts +16 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeCommon.d.ts +2 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeCurrency.d.ts +7 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeUpgradeCard.d.ts +1 -1
- package/dist/cjs/src/hooks/pickaxe/usePickaxeContext.d.ts +14 -1
- package/dist/cjs/src/hooks/studio/useStudio.d.ts +5 -0
- package/dist/cjs/src/types/response.d.ts +8 -0
- package/dist/esm/_virtual/index3.js +1 -0
- package/dist/esm/_virtual/index4.js +1 -0
- package/dist/esm/_virtual/react-is.development.js +1 -0
- package/dist/esm/_virtual/react-is.production.min.js +1 -0
- package/dist/esm/common/utils.js +1 -1
- package/dist/esm/common/validation.js +1 -0
- package/dist/esm/components/Icons/collapse-new.svg.js +1 -0
- package/dist/esm/components/Icons/copy-new.svg.js +1 -0
- package/dist/esm/components/Icons/download-new.svg.js +1 -0
- package/dist/esm/components/Icons/history.svg.js +1 -0
- package/dist/esm/components/Icons/pencil.svg.js +1 -0
- package/dist/esm/components/Pickaxe/Addons/Artifact/Renderer/index.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Auth/Provider.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Auth/hooks/useAuth.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Navbar/NavPill.js +1 -0
- package/dist/esm/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/index.js +1 -1
- package/dist/esm/components/Pickaxe/Form/Questions/Submit.js +1 -1
- package/dist/esm/components/Pickaxe/Form/index.js +1 -1
- package/dist/esm/components/Pickaxe/Provider.js +1 -1
- package/dist/esm/components/Pickaxe/common/AccessGroupCardPreview.js +1 -0
- package/dist/esm/components/Pickaxe/common/PickaxeAvatar.js +1 -0
- package/dist/esm/components/Pickaxe/common/PickaxeCommon.js +1 -0
- package/dist/esm/components/Pickaxe/common/PickaxeCurrency.js +1 -0
- package/dist/esm/components/Pickaxe/common/PickaxeUpgradeCard.js +1 -1
- package/dist/esm/components/Pickaxe/index.js +1 -1
- package/dist/esm/hooks/studio/useStudio.js +1 -0
- package/dist/esm/node_modules/.pnpm/@stripe_react-stripe-js@4.0.2_@stripe_stripe-js@7.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs.js +1 -0
- package/dist/esm/node_modules/.pnpm/@stripe_stripe-js@7.9.0/node_modules/@stripe/stripe-js/dist/index.mjs.js +1 -0
- package/dist/esm/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js +6 -0
- package/dist/esm/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js +1 -0
- package/dist/esm/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js +1 -0
- package/dist/esm/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js +1 -0
- package/dist/esm/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -0
- package/dist/esm/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js +1 -0
- package/dist/esm/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js +1 -0
- package/dist/esm/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js +9 -0
- package/dist/esm/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js +9 -0
- package/dist/esm/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -0
- package/dist/esm/src/common/utils.d.ts +2 -0
- package/dist/esm/src/common/validation.d.ts +7 -0
- package/dist/esm/src/components/Pickaxe/Addons/Auth/Provider.d.ts +4 -0
- package/dist/esm/src/components/Pickaxe/Addons/Auth/hooks/useAuthContext.d.ts +4 -0
- package/dist/esm/src/components/Pickaxe/Addons/Navbar/NavPill.d.ts +22 -0
- package/dist/esm/src/components/Pickaxe/Provider.d.ts +25 -4
- package/dist/esm/src/components/Pickaxe/ResponseProvider.d.ts +7 -3
- package/dist/esm/src/components/Pickaxe/common/AccessGroupCardPreview.d.ts +9 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeAvatar.d.ts +16 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeCommon.d.ts +2 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeCurrency.d.ts +7 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeUpgradeCard.d.ts +1 -1
- package/dist/esm/src/hooks/pickaxe/usePickaxeContext.d.ts +14 -1
- package/dist/esm/src/hooks/studio/useStudio.d.ts +5 -0
- package/dist/esm/src/types/response.d.ts +8 -0
- package/package.json +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../hooks/pickaxe/usePickaxe.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),s=require("react/jsx-runtime"),t=require("../../hooks/pickaxe/usePickaxe.js"),a=require("react"),i=require("../../hooks/pickaxe/usePickaxeContext.js"),r=require("./Addons/Auth/hooks/useAuthContext.js"),l=require("../../hooks/pickaxe/useResponseContext.js"),o=require("./Addons/Document/hooks/useDocumentContext.js"),c=require("./Addons/Artifact/hooks/useArtifactContext.js"),n=require("uuid"),d=require("./Addons/Scroll/Provider.js"),u=require("./common/PickaxeSkeleton.js"),x=require("./Chat/index.js"),m=require("./Form/index.js"),p=require("./Addons/Auth/index.js"),f=require("../../common/cn.js"),j=require("../../common/api/pickaxe.js"),h=require("../../common/validation.js"),v=require("./common/AccessGroupCardPreview.js"),g=require("./common/PickaxeAvatar.js"),b=require("../Icons/lock.svg.js"),k=require("../../node_modules/.pnpm/@stripe_react-stripe-js@4.0.2_@stripe_stripe-js@7.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs.js"),y=require("../../node_modules/.pnpm/@stripe_stripe-js@7.9.0/node_modules/@stripe/stripe-js/dist/index.mjs.js");const w=({className:e})=>s.jsx("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e},{children:s.jsx("polyline",{points:"15 18 9 12 15 6"})}));exports.Pickaxe=({pickaxeId:N,className:O})=>{const{sessionId:q,styles:_,colors:C,responsiveBy:A,deploymentType:I,isNewChat:S,isEmbed:P,opacity:E,deploymentId:U,sender:R,portalId:T,validationStatus:G,validationUpgradeGroups:L,validationUpgradeUrl:D,stripeAccountId:F,clientSecret:M,preventInitialSessionId:B,setClientSecret:V,setStripeAccountId:$,setValidationStatus:W,setValidationUpgradeGroups:z,setValidationUpgradeUrl:H,setContextId:J,setPickaxeId:K,setSessionId:X,setPickaxe:Y,setAccessGroup:Q}=i.usePickaxeContext(),{isSent:Z,token:ee}=r.useAuthContext(),{setMessages:se,setResponse:te,setError:ae,setLimitData:ie,setIsSwitchedToChat:re}=l.useResponseContext(),{setDocumentError:le}=o.useDocumentContext(),{setCurrentArtifact:oe}=c.useArtifactContext(),[ce,ne]=a.useState(!1),de=t.usePickaxe(),ue="chat-input"===I&&S&&!Z,xe=a.useMemo((()=>F?y.loadStripe(process.env.NEXT_PUBLIC_STRIPE_KEY,{stripeAccount:F}):null),[F]);a.useEffect((()=>{K(N)}),[N]);a.useEffect((()=>{if(!U&&!T||!de.data)return;if("stripe_checkout"===G)return;e.__awaiter(void 0,void 0,void 0,(function*(){var e;W("loading");try{const s=yield j.default.post("/validate_studio_deployment",{data:{deploymentId:U,sender:R||void 0,studioSessionToken:ee,portalId:T,studioId:null===(e=de.data)||void 0===e?void 0:e.studioid}});if(s.data.success)W("success"),z([]),H(null),Q(s.data.accessGroup);else{const e=h.getValidationFailure(s.data);if(!e)return W("login_required"),z([]),void H(null);W(e.status),z(e.upgradeGroups),H(e.upgradeUrl),ne(!0)}}catch(e){console.error("Failed to validate deployment:",e),W("success")}}))}),[U,R,ee,T,de.data]),a.useEffect((()=>{if(!de.data)return;const e=de.data.chatflag;B||X(e?n.v4():""),J(n.v4()),e?se([]):te(null),ae(""),le(""),ie(null),oe(null),re(!1),Y(de.data),ne(!0)}),[de.data]),a.useEffect((()=>{ae(""),le(""),ie(null),se([]),te(null),oe(null)}),[q]);const me=a.useMemo((()=>{const e=null!=E?E:1;if(!C.primary||!C.primary.startsWith("#")||e<0||e>1)return C.primary;const s=Math.round(255*e).toString(16).padStart(2,"0");return`${C.primary}${s}`}),[C.primary,E]);if(!de.data)return null;return s.jsx("div",Object.assign({className:f.default("relative @container/pickaxe-root flex flex-col flex-grow w-full h-full","dark"===_.theme&&"dark",O),style:Object.assign({backgroundColor:ue?"transparent":me,color:C.text},_.font&&"Real Head Pro"!==_.font&&{fontFamily:_.font})},{children:"stripe_checkout"===G&&M&&xe?s.jsxs("div",Object.assign({className:"absolute inset-0 z-[999] flex flex-col w-full h-full overflow-hidden",style:{backgroundColor:C.secondary||"#ffffff",color:C.secondaryText||"#000000"}},{children:[s.jsx("div",Object.assign({className:"flex items-center p-4 border-b border-gray-100 shrink-0"},{children:s.jsxs("button",Object.assign({onClick:()=>{V&&V(null),$&&$(null),W("success")},className:"flex items-center gap-2 text-sm font-semibold opacity-70 hover:opacity-100 transition-opacity",style:{color:C.text}},{children:[s.jsx(w,{className:"w-5 h-5"}),s.jsx("span",{children:"Back"})]}))})),s.jsx("div",Object.assign({className:"flex-1 w-full h-full overflow-y-auto [&>div]:h-full"},{children:s.jsx(k.EmbeddedCheckoutProvider,Object.assign({stripe:xe,options:{clientSecret:M}},{children:s.jsx(k.EmbeddedCheckout,{})}))}))]})):de.isLoading||!ce||"loading"===G?s.jsx("div",Object.assign({className:f.default("flex items-center flex-col w-full pt-12 px-4 pb-10","viewport"===A?"min-[767px]:pb-40":"@[767px]/pickaxe-root:pb-40")},{children:s.jsxs("div",Object.assign({className:"flex w-full items-center max-w-[700px] flex-col"},{children:[s.jsx(u.default,{className:"w-[72px] h-[72px]"}),s.jsx(u.default,{className:"h-[20px] mt-6 w-full"}),s.jsx(u.default,{className:"h-[20px] mt-2 w-full"}),s.jsx(u.default,{className:"h-[20px] mt-2 w-full max-w-[400px]"}),s.jsx("div",Object.assign({className:"flex flex-col gap-y-8 w-full mt-6"},{children:s.jsx(u.default,{className:f.default("w-full min-h-[48px]","viewport"===A?"min-[767px]:max-w-[176px]":"@[767px]/pickaxe-root:max-w-[176px]")})}))]}))})):"upgrade_required"===G?s.jsx("div",Object.assign({className:"flex flex-col items-center justify-center w-full h-full p-4 overflow-y-auto"},{children:L&&L.length>0?s.jsxs("div",Object.assign({className:"flex flex-col items-center gap-6 w-full max-w-4xl"},{children:[s.jsxs("div",Object.assign({className:"text-center"},{children:[s.jsx("h2",Object.assign({className:"text-2xl font-bold mb-2"},{children:"Upgrade Required"})),s.jsx("p",Object.assign({className:"opacity-80"},{children:"Please upgrade to continue using this tool."}))]})),s.jsx("div",Object.assign({className:"flex flex-wrap justify-center gap-4 w-full"},{children:L.map(((e,t)=>s.jsx(v.default,{data:e,upgradeUrl:D},e.id||t)))}))]})):s.jsxs("div",Object.assign({className:"text-center mb-8"},{children:[s.jsx("h2",Object.assign({className:"text-2xl font-bold mb-2"},{children:"Access Locked"})),s.jsx("p",Object.assign({className:"opacity-80"},{children:"This tool is locked to use. Contact owner for more information."}))]}))})):"login_required"===G&&P?s.jsx(p.default,{}):"login_required"!==G||P?"access_denied"===G?s.jsxs("div",Object.assign({className:"flex flex-col items-center justify-center w-full h-full p-4 overflow-y-auto"},{children:[s.jsxs(g.Avatar,Object.assign({className:"h-[68px] w-[68px] mb-4"},{children:[s.jsx(g.AvatarImage,{src:null===(pe=de.data)||void 0===pe?void 0:pe.coverphoto,alt:`${null===(fe=de.data)||void 0===fe?void 0:fe.formtitle} Logo`}),s.jsx(g.AvatarFallback,{})]})),s.jsxs("div",Object.assign({className:"text-center mb-6"},{children:[s.jsx("h2",Object.assign({className:"text-2xl font-bold mb-2"},{children:"Access Denied"})),s.jsxs("div",Object.assign({className:"w-[400px] text-xl flex justify-center items-start"},{children:[s.jsx(b.default,{className:"h-6 w-6 mr-[-20px] shrink-0"}),s.jsx("p",Object.assign({className:"ml-1"},{children:"It looks like you don't have access to these resources. Please request access to continue."}))]}))]})),s.jsx("button",Object.assign({className:"px-6 py-2 font-medium rounded-md transition-colors",style:{backgroundColor:C.accent,color:C.accentText,borderRadius:_.cornerRadius},onClick:()=>{e.__awaiter(void 0,void 0,void 0,(function*(){var e,s;const t=L.map((e=>e.accessGroupId));try{const a=yield j.default.post("/request_access",{data:{sender:R||void 0,studioSessionToken:ee,studioId:null===(e=de.data)||void 0===e?void 0:e.studioid,message:JSON.stringify({toolId:null===(s=de.data)||void 0===s?void 0:s.formid,deploymentId:U,accessGroupIds:t})}});a.data.success?alert("Successfully requested access!"):alert(a.data.error)}catch(e){alert(`Couldn't request access. Error: ${e}`)}}))}},{children:"Request Access"})),s.jsx("span",Object.assign({className:"mt-4 mb-2"},{children:"or"})),s.jsx("span",Object.assign({className:"font-medium text-lg"},{children:"Sign in with a different account"}))]})):q?s.jsx(d.ScrollProvider,{children:s.jsx(x.default,{})}):s.jsx(d.ScrollProvider,{children:s.jsx(m.default,{})}):s.jsx("div",Object.assign({className:"flex flex-col items-center justify-center w-full h-full p-4 overflow-y-auto"},{children:s.jsxs("div",Object.assign({className:"text-center mb-8"},{children:[s.jsx("h2",Object.assign({className:"text-2xl font-bold mb-2"},{children:"Access Denied"})),s.jsx("p",Object.assign({className:"opacity-80"},{children:"Login is required."}))]}))}))}));var pe,fe};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../common/api/pickaxe.js"),r=require("../pickaxe/usePickaxeContext.js"),t=require("@tanstack/react-query");exports.useStudio=()=>{const{pickaxe:i}=r.usePickaxeContext(),u=null==i?void 0:i.studioid,{data:s,isLoading:a,error:o}=t.useQuery({queryKey:["studio",u],queryFn:()=>e.default.get("get_studio",{params:{studioId:u},withCredentials:!1}),enabled:!!u});return{studio:s,isLoading:a,error:o}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("../../../../../prop-types@15.8.1/node_modules/prop-types/index.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(e);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,o,u=[],a=!0,c=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(u.push(r.value),!t||u.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(c)throw o}}return u}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var d=function(e,t,n){var o=!!n,u=r.default.useRef(n);r.default.useEffect((function(){u.current=n}),[n]),r.default.useEffect((function(){if(!o||!e)return function(){};var n=function(){u.current&&u.current.apply(u,arguments)};return e.on(t,n),function(){e.off(t,n)}}),[o,t,e,u])},f=function(e){var t=r.default.useRef(e);return r.default.useEffect((function(){t.current=e}),[e]),t.current},p=function(e){return null!==e&&"object"===a(e)},m="[object Object]",h=function e(t,n){if(!p(t)||!p(n))return t===n;var r=Array.isArray(t);if(r!==Array.isArray(n))return!1;var o=Object.prototype.toString.call(t)===m;if(o!==(Object.prototype.toString.call(n)===m))return!1;if(!o&&!r)return t===n;var u=Object.keys(t),a=Object.keys(n);if(u.length!==a.length)return!1;for(var c={},i=0;i<u.length;i+=1)c[u[i]]=!0;for(var l=0;l<a.length;l+=1)c[a[l]]=!0;var s=Object.keys(c);if(s.length!==u.length)return!1;var d=t,f=n;return s.every((function(t){return e(d[t],f[t])}))},y=function(e,t,n){return p(e)?Object.keys(e).reduce((function(r,o){var a=!p(t)||!h(e[o],t[o]);return n.includes(o)?(a&&console.warn("Unsupported prop change: options.".concat(o," is not a mutable property.")),r):a?u(u({},r||{}),{},c({},o,e[o])):r}),null):null},g="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",v=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g;if(null===e||p(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;throw new Error(n)},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g;if(function(e){return p(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then((function(e){return v(e,t)}))};var n=v(e,t);return null===n?{tag:"empty"}:{tag:"sync",stripe:n}},C=r.default.createContext(null);C.displayName="ElementsContext";t.default.any,t.default.object,t.default.func.isRequired;var E=r.default.createContext(null);E.displayName="CheckoutContext",t.default.any,t.default.shape({fetchClientSecret:t.default.func.isRequired,elementsOptions:t.default.object}).isRequired;var k=function(e){var t=r.default.useContext(E),n=r.default.useContext(C);if(t){if(n)throw new Error("You cannot wrap the part of your app that ".concat(e," in both <CheckoutProvider> and <Elements> providers."));return t}return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(n,e)},S=["mode"],w=function(e,n){var o,u="".concat((o=e).charAt(0).toUpperCase()+o.slice(1),"Element"),a=n?function(e){k("mounts <".concat(u,">"));var t=e.id,n=e.className;return r.default.createElement("div",{id:t,className:n})}:function(t){var n,o=t.id,a=t.className,c=t.options,s=void 0===c?{}:c,p=t.onBlur,m=t.onFocus,h=t.onReady,g=t.onChange,v=t.onEscape,b=t.onClick,C=t.onLoadError,E=t.onLoaderStart,w=t.onNetworksChange,j=t.onConfirm,P=t.onCancel,O=t.onShippingAddressChange,x=t.onShippingRateChange,A=t.onSavedPaymentMethodRemove,R=t.onSavedPaymentMethodUpdate,I=k("mounts <".concat(u,">")),N="elements"in I?I.elements:null,U="checkoutState"in I?I.checkoutState:null,M="success"===(null==U?void 0:U.type)?U.checkout:null,Y=l(r.default.useState(null),2),L=Y[0],B=Y[1],D=r.default.useRef(null),q=r.default.useRef(null);d(L,"blur",p),d(L,"focus",m),d(L,"escape",v),d(L,"click",b),d(L,"loaderror",C),d(L,"loaderstart",E),d(L,"networkschange",w),d(L,"confirm",j),d(L,"cancel",P),d(L,"shippingaddresschange",O),d(L,"shippingratechange",x),d(L,"savedpaymentmethodremove",A),d(L,"savedpaymentmethodupdate",R),d(L,"change",g),h&&(n="expressCheckout"===e?h:function(){h(L)}),d(L,"ready",n),r.default.useLayoutEffect((function(){if(null===D.current&&null!==q.current&&(N||M)){var t=null;if(M)switch(e){case"payment":t=M.createPaymentElement(s);break;case"address":if(!("mode"in s))throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");var n=s.mode,r=i(s,S);if("shipping"===n)t=M.createShippingAddressElement(r);else{if("billing"!==n)throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");t=M.createBillingAddressElement(r)}break;case"expressCheckout":t=M.createExpressCheckoutElement(s);break;case"currencySelector":t=M.createCurrencySelectorElement();break;case"taxId":t=M.createTaxIdElement(s);break;default:throw new Error("Invalid Element type ".concat(u,". You must use either the <PaymentElement />, <AddressElement options={{mode: 'shipping'}} />, <AddressElement options={{mode: 'billing'}} />, or <ExpressCheckoutElement />."))}else N&&(t=N.create(e,s));D.current=t,B(t),t&&t.mount(q.current)}}),[N,M,s]);var _=f(s);return r.default.useEffect((function(){if(D.current){var e=y(s,_,["paymentRequest"]);e&&"update"in D.current&&D.current.update(e)}}),[s,_]),r.default.useLayoutEffect((function(){return function(){if(D.current&&"function"==typeof D.current.destroy)try{D.current.destroy(),D.current=null}catch(e){}}}),[]),r.default.createElement("div",{id:o,className:a,ref:q})};return a.propTypes={id:t.default.string,className:t.default.string,onChange:t.default.func,onBlur:t.default.func,onFocus:t.default.func,onReady:t.default.func,onEscape:t.default.func,onClick:t.default.func,onLoadError:t.default.func,onLoaderStart:t.default.func,onNetworksChange:t.default.func,onConfirm:t.default.func,onCancel:t.default.func,onShippingAddressChange:t.default.func,onShippingRateChange:t.default.func,onSavedPaymentMethodRemove:t.default.func,onSavedPaymentMethodUpdate:t.default.func,options:t.default.object},a.displayName=u,a.__elementType=e,a},j="undefined"==typeof window,P=r.default.createContext(null);P.displayName="EmbeddedCheckoutProviderContext";var O=function(){var e=r.default.useContext(P);if(!e)throw new Error("<EmbeddedCheckout> must be used within <EmbeddedCheckoutProvider>");return e},x=j?function(e){var t=e.id,n=e.className;return O(),r.default.createElement("div",{id:t,className:n})}:function(e){var t=e.id,n=e.className,o=O().embeddedCheckout,u=r.default.useRef(!1),a=r.default.useRef(null);return r.default.useLayoutEffect((function(){return!u.current&&o&&null!==a.current&&(o.mount(a.current),u.current=!0),function(){if(u.current&&o)try{o.unmount(),u.current=!1}catch(e){}}}),[o]),r.default.createElement("div",{ref:a,id:t,className:n})};w("auBankAccount",j),w("card",j),w("cardNumber",j),w("cardExpiry",j),w("cardCvc",j),w("fpxBank",j),w("iban",j),w("idealBank",j),w("p24Bank",j),w("epsBank",j),w("payment",j),w("expressCheckout",j),w("paymentRequestButton",j),w("linkAuthentication",j),w("address",j),w("shippingAddress",j),w("paymentMethodMessaging",j),w("affirmMessage",j),w("afterpayClearpayMessage",j),w("taxId",j),exports.EmbeddedCheckout=x,exports.EmbeddedCheckoutProvider=function(e){var t=e.stripe,n=e.options,o=e.children,u=r.default.useMemo((function(){return b(t,"Invalid prop `stripe` supplied to `EmbeddedCheckoutProvider`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.")}),[t]),a=r.default.useRef(null),c=r.default.useRef(null),i=l(r.default.useState({embeddedCheckout:null}),2),s=i[0],d=i[1];r.default.useEffect((function(){if(!c.current&&!a.current){var e=function(e){c.current||a.current||(c.current=e,a.current=c.current.initEmbeddedCheckout(n).then((function(e){d({embeddedCheckout:e})})))};"async"!==u.tag||c.current||!n.clientSecret&&!n.fetchClientSecret?"sync"!==u.tag||c.current||!n.clientSecret&&!n.fetchClientSecret||e(u.stripe):u.stripePromise.then((function(t){t&&e(t)}))}}),[u,n,s,c]),r.default.useEffect((function(){return function(){s.embeddedCheckout?(a.current=null,s.embeddedCheckout.destroy()):a.current&&a.current.then((function(){a.current=null,s.embeddedCheckout&&s.embeddedCheckout.destroy()}))}}),[s.embeddedCheckout]),r.default.useEffect((function(){var e;(e=c)&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"4.0.2"}),e.registerAppInfo({name:"react-stripe-js",version:"4.0.2",url:"https://stripe.com/docs/stripe-js/react"}))}),[c]);var p=f(t);r.default.useEffect((function(){null!==p&&p!==t&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the `stripe` prop after setting it.")}),[p,t]);var m=f(n);return r.default.useEffect((function(){null!=m&&(null!=n?(void 0===n.clientSecret&&void 0===n.fetchClientSecret&&console.warn("Invalid props passed to EmbeddedCheckoutProvider: You must provide one of either `options.fetchClientSecret` or `options.clientSecret`."),null!=m.clientSecret&&n.clientSecret!==m.clientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the client secret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=m.fetchClientSecret&&n.fetchClientSecret!==m.fetchClientSecret&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change fetchClientSecret after setting it. Unmount and create a new instance of EmbeddedCheckoutProvider instead."),null!=m.onComplete&&n.onComplete!==m.onComplete&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onComplete option after setting it."),null!=m.onShippingDetailsChange&&n.onShippingDetailsChange!==m.onShippingDetailsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onShippingDetailsChange option after setting it."),null!=m.onLineItemsChange&&n.onLineItemsChange!==m.onLineItemsChange&&console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot change the onLineItemsChange option after setting it.")):console.warn("Unsupported prop change on EmbeddedCheckoutProvider: You cannot unset options after setting them."))}),[m,n]),r.default.createElement(P.Provider,{value:s},o)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t="basil",r="https://js.stripe.com",n="".concat(r,"/").concat(t,"/stripe.js"),o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,i=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,s="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",a=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(n).concat(t);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(r),r},c=null,u=null,l=null,d=function(e){return null!==c?c:(c=new Promise((function(t,n){if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(s),window.Stripe)t(window.Stripe);else try{var c=function(){for(var e,t=document.querySelectorAll('script[src^="'.concat(r,'"]')),n=0;n<t.length;n++){var s=t[n];if(e=s.src,o.test(e)||i.test(e))return s}return null}();if(c&&e)console.warn(s);else if(c){if(c&&null!==l&&null!==u){var d;c.removeEventListener("load",l),c.removeEventListener("error",u),null===(d=c.parentNode)||void 0===d||d.removeChild(c),c=a(e)}}else c=a(e);l=function(e,t){return function(){window.Stripe?e(window.Stripe):t(new Error("Stripe.js not available"))}}(t,n),u=function(e){return function(t){e(new Error("Failed to load Stripe.js",{cause:t}))}}(n),c.addEventListener("load",l),c.addEventListener("error",u)}catch(e){return void n(e)}else t(null)}))).catch((function(e){return c=null,Promise.reject(e)}))},p=!1,f=function(){return e||(e=d(null).catch((function(t){return e=null,Promise.reject(t)})))};Promise.resolve().then((function(){return f()})).catch((function(e){p||console.warn(e)}));exports.loadStripe=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];p=!0;var o=Date.now();return f().then((function(e){return function(e,r,n){if(null===e)return null;var o=r[0].match(/^pk_test/),i=function(e){return 3===e?"v3":e}(e.version),s=t;o&&i!==s&&console.warn("Stripe.js@".concat(i," was loaded on the page, but @stripe/stripe-js@").concat("7.9.0"," expected Stripe.js@").concat(s,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var a=e.apply(void 0,r);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"7.9.0",startTime:t})}(a,n),a}(e,r,o)}))};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
object-assign
|
|
4
|
+
(c) Sindre Sorhus
|
|
5
|
+
@license MIT
|
|
6
|
+
*/
|
|
7
|
+
var r,e;Object.defineProperty(exports,"__esModule",{value:!0}),exports.__require=function(){if(e)return r;e=1;var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;return r=function(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de","5"===Object.getOwnPropertyNames(r)[0])return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(r){return e[r]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(r){n[r]=r})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(r){return!1}}()?Object.assign:function(r,e){for(var c,i,a=function(r){if(null==r)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}(r),u=1;u<arguments.length;u++){for(var f in c=Object(arguments[u]))n.call(c,f)&&(a[f]=c[f]);if(t){i=t(c);for(var s=0;s<i.length;s++)o.call(c,i[s])&&(a[i[s]]=c[i[s]])}}return a}};
|
package/dist/cjs/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r,n=require("./lib/ReactPropTypesSecret.js"),t=require("./lib/has.js");exports.__require=function(){if(r)return e;r=1;var o=function(){};if("production"!==process.env.NODE_ENV){var a=n.__require(),i={},s=t.__require();o=function(e){var r="Warning: "+e;"undefined"!=typeof console&&console.error(r);try{throw new Error(r)}catch(e){}}}function c(e,r,n,t,c){if("production"!==process.env.NODE_ENV)for(var u in e)if(s(e,u)){var f;try{if("function"!=typeof e[u]){var p=Error((t||"React class")+": "+n+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}f=e[u](r,u,t,n,null,a)}catch(e){f=e}if(!f||f instanceof Error||o((t||"React class")+": type specification of "+n+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in i)){i[f.message]=!0;var l=c?c():"";o("Failed "+n+" type: "+f.message+(null!=l?l:""))}}}return c.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(i={})},e=c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r,t=require("./lib/ReactPropTypesSecret.js");exports.__require=function(){if(r)return e;r=1;var n=t.__require();function o(){}function a(){}return a.resetWarningCache=o,e=function(){function e(e,r,t,o,a,i){if(i!==n){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}function r(){return e}e.isRequired=e;var t={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:r,element:e,elementType:e,instanceOf:r,node:e,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:a,resetWarningCache:o};return t.PropTypes=t,t}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,n,r=require("../../../react-is@16.13.1/node_modules/react-is/index.js"),t=require("../../../object-assign@4.1.1/node_modules/object-assign/index.js"),o=require("./lib/ReactPropTypesSecret.js"),i=require("./lib/has.js"),a=require("./checkPropTypes.js");exports.__require=function(){if(n)return e;n=1;var u=r.__require(),c=t.__require(),f=o.__require(),p=i.__require(),s=a.__require(),l=function(){};function d(){return null}return"production"!==process.env.NODE_ENV&&(l=function(e){var n="Warning: "+e;"undefined"!=typeof console&&console.error(n);try{throw new Error(n)}catch(e){}}),e=function(e,n){var r="function"==typeof Symbol&&Symbol.iterator;var t="<<anonymous>>",o={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:y(d),arrayOf:function(e){return y((function(n,r,t,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+t+"` has invalid PropType notation inside arrayOf.");var u=n[r];if(!Array.isArray(u))return new a("Invalid "+o+" `"+i+"` of type `"+g(u)+"` supplied to `"+t+"`, expected an array.");for(var c=0;c<u.length;c++){var p=e(u,c,t,o,i+"["+c+"]",f);if(p instanceof Error)return p}return null}))},element:y((function(n,r,t,o,i){var u=n[r];return e(u)?null:new a("Invalid "+o+" `"+i+"` of type `"+g(u)+"` supplied to `"+t+"`, expected a single ReactElement.")})),elementType:y((function(e,n,r,t,o){var i=e[n];return u.isValidElementType(i)?null:new a("Invalid "+t+" `"+o+"` of type `"+g(i)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return y((function(n,r,o,i,u){if(!(n[r]instanceof e)){var c=e.name||t;return new a("Invalid "+i+" `"+u+"` of type `"+(((f=n[r]).constructor&&f.constructor.name?f.constructor.name:t)+"` supplied to `")+o+"`, expected instance of `"+c+"`.")}var f;return null}))},node:y((function(e,n,r,t,o){return m(e[n])?null:new a("Invalid "+t+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return y((function(n,r,t,o,i){if("function"!=typeof e)return new a("Property `"+i+"` of component `"+t+"` has invalid PropType notation inside objectOf.");var u=n[r],c=g(u);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+t+"`, expected an object.");for(var s in u)if(p(u,s)){var l=e(u,s,t,o,i+"."+s,f);if(l instanceof Error)return l}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&l(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),d;return y((function(n,r,t,o,u){for(var c=n[r],f=0;f<e.length;f++)if(i(c,e[f]))return null;var p=JSON.stringify(e,(function(e,n){return"symbol"===h(n)?String(n):n}));return new a("Invalid "+o+" `"+u+"` of value `"+String(c)+"` supplied to `"+t+"`, expected one of "+p+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&l("Invalid argument supplied to oneOfType, expected an instance of array."),d;for(var n=0;n<e.length;n++){var r=e[n];if("function"!=typeof r)return l("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+x(r)+" at index "+n+"."),d}return y((function(n,r,t,o,i){for(var u=[],c=0;c<e.length;c++){var s=(0,e[c])(n,r,t,o,i,f);if(null==s)return null;s.data&&p(s.data,"expectedType")&&u.push(s.data.expectedType)}return new a("Invalid "+o+" `"+i+"` supplied to `"+t+"`"+(u.length>0?", expected one of type ["+u.join(", ")+"]":"")+".")}))},shape:function(e){return y((function(n,r,t,o,i){var u=n[r],c=g(u);if("object"!==c)return new a("Invalid "+o+" `"+i+"` of type `"+c+"` supplied to `"+t+"`, expected `object`.");for(var p in e){var s=e[p];if("function"!=typeof s)return b(t,o,i,p,h(s));var l=s(u,p,t,o,i+"."+p,f);if(l)return l}return null}))},exact:function(e){return y((function(n,r,t,o,i){var u=n[r],s=g(u);if("object"!==s)return new a("Invalid "+o+" `"+i+"` of type `"+s+"` supplied to `"+t+"`, expected `object`.");var l=c({},n[r],e);for(var d in l){var y=e[d];if(p(e,d)&&"function"!=typeof y)return b(t,o,i,d,h(y));if(!y)return new a("Invalid "+o+" `"+i+"` key `"+d+"` supplied to `"+t+"`.\nBad object: "+JSON.stringify(n[r],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=y(u,d,t,o,i+"."+d,f);if(v)return v}return null}))}};function i(e,n){return e===n?0!==e||1/e==1/n:e!=e&&n!=n}function a(e,n){this.message=e,this.data=n&&"object"==typeof n?n:{},this.stack=""}function y(e){if("production"!==process.env.NODE_ENV)var r={},o=0;function i(i,u,c,p,s,d,y){if(p=p||t,d=d||c,y!==f){if(n){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var b=p+":"+c;!r[b]&&o<3&&(l("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+p+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),r[b]=!0,o++)}}return null==u[c]?i?null===u[c]?new a("The "+s+" `"+d+"` is marked as required in `"+p+"`, but its value is `null`."):new a("The "+s+" `"+d+"` is marked as required in `"+p+"`, but its value is `undefined`."):null:e(u,c,p,s,d)}var u=i.bind(null,!1);return u.isRequired=i.bind(null,!0),u}function v(e){return y((function(n,r,t,o,i,u){var c=n[r];return g(c)!==e?new a("Invalid "+o+" `"+i+"` of type `"+h(c)+"` supplied to `"+t+"`, expected `"+e+"`.",{expectedType:e}):null}))}function b(e,n,r,t,o){return new a((e||"React class")+": "+n+" type `"+r+"."+t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(n){switch(typeof n){case"number":case"string":case"undefined":return!0;case"boolean":return!n;case"object":if(Array.isArray(n))return n.every(m);if(null===n||e(n))return!0;var t=function(e){var n=e&&(r&&e[r]||e["@@iterator"]);if("function"==typeof n)return n}(n);if(!t)return!1;var o,i=t.call(n);if(t!==n.entries){for(;!(o=i.next()).done;)if(!m(o.value))return!1}else for(;!(o=i.next()).done;){var a=o.value;if(a&&!m(a[1]))return!1}return!0;default:return!1}}function g(e){var n=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,n){return"symbol"===e||!!n&&("Symbol"===n["@@toStringTag"]||"function"==typeof Symbol&&n instanceof Symbol)}(n,e)?"symbol":n}function h(e){if(null==e)return""+e;var n=g(e);if("object"===n){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return n}function x(e){var n=h(e);switch(n){case"array":case"object":return"an "+n;case"boolean":case"date":case"regexp":return"a "+n;default:return n}}return a.prototype=Error.prototype,o.checkPropTypes=s,o.resetWarningCache=s.resetWarningCache,o.PropTypes=o,o}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_commonjsHelpers.js"),r=require("../../../../../_virtual/index3.js"),s=require("../../../react-is@16.13.1/node_modules/react-is/index.js"),i=require("./factoryWithTypeCheckers.js"),t=require("./factoryWithThrowingShims.js");if("production"!==process.env.NODE_ENV){var o=s.__require();r.__module.exports=i.__require()(o.isElement,!0)}else r.__module.exports=t.__require()();var u=r.__module.exports,_=e.getDefaultExportFromCjs(u);exports.default=_;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,_;Object.defineProperty(exports,"__esModule",{value:!0}),exports.__require=function(){return _?e:(_=1,e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,r;Object.defineProperty(exports,"__esModule",{value:!0}),exports.__require=function(){return r?e:(r=1,e=Function.call.bind(Object.prototype.hasOwnProperty))};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("../../../../../../_virtual/react-is.development.js");
|
|
2
|
+
/** @license React v16.13.1
|
|
3
|
+
* react-is.development.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/exports.__require=function(){return e||(e=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,o=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,c=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,f=e?Symbol.for("react.context"):60110,_=e?Symbol.for("react.async_mode"):60111,p=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,i=e?Symbol.for("react.suspense"):60113,l=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,x=e?Symbol.for("react.block"):60121,d=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function $(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case t:var l=e.type;switch(l){case _:case p:case n:case c:case s:case i:return l;default:var x=l&&l.$$typeof;switch(x){case f:case u:case m:case y:case a:return x;default:return r}}case o:return r}}}var v=_,M=p,C=f,w=a,P=t,h=u,j=n,E=m,R=y,g=o,A=c,F=s,I=i,z=!1;function O(e){return $(e)===p}r.__exports.AsyncMode=v,r.__exports.ConcurrentMode=M,r.__exports.ContextConsumer=C,r.__exports.ContextProvider=w,r.__exports.Element=P,r.__exports.ForwardRef=h,r.__exports.Fragment=j,r.__exports.Lazy=E,r.__exports.Memo=R,r.__exports.Portal=g,r.__exports.Profiler=A,r.__exports.StrictMode=F,r.__exports.Suspense=I,r.__exports.isAsyncMode=function(e){return z||(z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),O(e)||$(e)===_},r.__exports.isConcurrentMode=O,r.__exports.isContextConsumer=function(e){return $(e)===f},r.__exports.isContextProvider=function(e){return $(e)===a},r.__exports.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},r.__exports.isForwardRef=function(e){return $(e)===u},r.__exports.isFragment=function(e){return $(e)===n},r.__exports.isLazy=function(e){return $(e)===m},r.__exports.isMemo=function(e){return $(e)===y},r.__exports.isPortal=function(e){return $(e)===o},r.__exports.isProfiler=function(e){return $(e)===c},r.__exports.isStrictMode=function(e){return $(e)===s},r.__exports.isSuspense=function(e){return $(e)===i},r.__exports.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===p||e===c||e===s||e===i||e===l||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===y||e.$$typeof===a||e.$$typeof===f||e.$$typeof===u||e.$$typeof===d||e.$$typeof===b||e.$$typeof===S||e.$$typeof===x)},r.__exports.typeOf=$}()),r.__exports};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("../../../../../../_virtual/react-is.production.min.js");
|
|
2
|
+
/** @license React v16.13.1
|
|
3
|
+
* react-is.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/exports.__require=function(){if(e)return r.__exports;e=1;var t="function"==typeof Symbol&&Symbol.for,o=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,s=t?Symbol.for("react.fragment"):60107,c=t?Symbol.for("react.strict_mode"):60108,f=t?Symbol.for("react.profiler"):60114,_=t?Symbol.for("react.provider"):60109,p=t?Symbol.for("react.context"):60110,u=t?Symbol.for("react.async_mode"):60111,i=t?Symbol.for("react.concurrent_mode"):60111,a=t?Symbol.for("react.forward_ref"):60112,y=t?Symbol.for("react.suspense"):60113,l=t?Symbol.for("react.suspense_list"):60120,m=t?Symbol.for("react.memo"):60115,x=t?Symbol.for("react.lazy"):60116,b=t?Symbol.for("react.block"):60121,S=t?Symbol.for("react.fundamental"):60117,$=t?Symbol.for("react.responder"):60118,d=t?Symbol.for("react.scope"):60119;function M(e){if("object"==typeof e&&null!==e){var r=e.$$typeof;switch(r){case o:switch(e=e.type){case u:case i:case s:case f:case c:case y:return e;default:switch(e=e&&e.$$typeof){case p:case a:case x:case m:case _:return e;default:return r}}case n:return r}}}function v(e){return M(e)===i}return r.__exports.AsyncMode=u,r.__exports.ConcurrentMode=i,r.__exports.ContextConsumer=p,r.__exports.ContextProvider=_,r.__exports.Element=o,r.__exports.ForwardRef=a,r.__exports.Fragment=s,r.__exports.Lazy=x,r.__exports.Memo=m,r.__exports.Portal=n,r.__exports.Profiler=f,r.__exports.StrictMode=c,r.__exports.Suspense=y,r.__exports.isAsyncMode=function(e){return v(e)||M(e)===u},r.__exports.isConcurrentMode=v,r.__exports.isContextConsumer=function(e){return M(e)===p},r.__exports.isContextProvider=function(e){return M(e)===_},r.__exports.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},r.__exports.isForwardRef=function(e){return M(e)===a},r.__exports.isFragment=function(e){return M(e)===s},r.__exports.isLazy=function(e){return M(e)===x},r.__exports.isMemo=function(e){return M(e)===m},r.__exports.isPortal=function(e){return M(e)===n},r.__exports.isProfiler=function(e){return M(e)===f},r.__exports.isStrictMode=function(e){return M(e)===c},r.__exports.isSuspense=function(e){return M(e)===y},r.__exports.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===i||e===f||e===c||e===y||e===l||"object"==typeof e&&null!==e&&(e.$$typeof===x||e.$$typeof===m||e.$$typeof===_||e.$$typeof===p||e.$$typeof===a||e.$$typeof===S||e.$$typeof===$||e.$$typeof===d||e.$$typeof===b)},r.__exports.typeOf=M,r.__exports};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("../../../../../_virtual/index4.js"),o=require("./cjs/react-is.production.min.js"),s=require("./cjs/react-is.development.js");exports.__require=function(){return e||(e=1,"production"===process.env.NODE_ENV?r.__module.exports=o.__require():r.__module.exports=s.__require()),r.__module.exports};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Ref } from "react";
|
|
2
|
+
export declare const COOKIE_USER_ID = "PXE-uid";
|
|
2
3
|
export declare const generateId: (length: number, prefix?: string, suffix?: string) => string;
|
|
3
4
|
export declare const randomStr: (len: number, charOnly?: boolean) => string;
|
|
4
5
|
export declare const extractUrlsFromText: (text: string) => string[];
|
|
5
6
|
export declare const formatBytes: (bytes: number, decimals?: number) => string;
|
|
6
7
|
export declare const getCookie: (name: string) => string | null;
|
|
7
8
|
export declare const deleteCookie: (name: string) => void;
|
|
9
|
+
export declare const initializeEmbedUserId: () => string;
|
|
8
10
|
export declare const getAuthToken: (studioId: string) => string | null;
|
|
9
11
|
export declare const setAuthToken: (name: string, token: string) => void;
|
|
10
12
|
export declare const deleteAuthToken: (name: string) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type PickaxeValidationFailureStatus = "login_required" | "upgrade_required" | "access_denied";
|
|
2
|
+
export type PickaxeValidationFailure = {
|
|
3
|
+
status: PickaxeValidationFailureStatus;
|
|
4
|
+
upgradeGroups: any[];
|
|
5
|
+
upgradeUrl: string | null;
|
|
6
|
+
};
|
|
7
|
+
export declare const getValidationFailure: (payload: unknown) => PickaxeValidationFailure | null;
|
|
@@ -2,6 +2,7 @@ import type { SetState } from "../../../../types/common";
|
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
type AuthContextType = {
|
|
4
4
|
emailInput: string;
|
|
5
|
+
redirectUrl: string | null;
|
|
5
6
|
token: string | null;
|
|
6
7
|
isLoggedIn: boolean;
|
|
7
8
|
isLoggedOut: boolean;
|
|
@@ -9,12 +10,15 @@ type AuthContextType = {
|
|
|
9
10
|
isSending: boolean;
|
|
10
11
|
isResendDisabled: boolean;
|
|
11
12
|
isSent: boolean;
|
|
13
|
+
isPricingAuth: boolean;
|
|
12
14
|
setEmailInput: SetState<string>;
|
|
13
15
|
setToken: SetState<string | null>;
|
|
14
16
|
setIsLoggingIn: SetState<boolean>;
|
|
15
17
|
setIsSending: SetState<boolean>;
|
|
16
18
|
setIsResendDisabled: SetState<boolean>;
|
|
17
19
|
setIsSent: SetState<boolean>;
|
|
20
|
+
setIsPricingAuth: SetState<boolean>;
|
|
21
|
+
setRedirectUrl: SetState<string | null>;
|
|
18
22
|
};
|
|
19
23
|
export interface IAuthProviderProps {
|
|
20
24
|
children: ReactNode;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const useAuthContext: () => {
|
|
2
2
|
emailInput: string;
|
|
3
|
+
redirectUrl: string | null;
|
|
3
4
|
token: string | null;
|
|
4
5
|
isLoggedIn: boolean;
|
|
5
6
|
isLoggedOut: boolean;
|
|
@@ -7,10 +8,13 @@ export declare const useAuthContext: () => {
|
|
|
7
8
|
isSending: boolean;
|
|
8
9
|
isResendDisabled: boolean;
|
|
9
10
|
isSent: boolean;
|
|
11
|
+
isPricingAuth: boolean;
|
|
10
12
|
setEmailInput: import("../../../../../types/common").SetState<string>;
|
|
11
13
|
setToken: import("../../../../../types/common").SetState<string | null>;
|
|
12
14
|
setIsLoggingIn: import("../../../../../types/common").SetState<boolean>;
|
|
13
15
|
setIsSending: import("../../../../../types/common").SetState<boolean>;
|
|
14
16
|
setIsResendDisabled: import("../../../../../types/common").SetState<boolean>;
|
|
15
17
|
setIsSent: import("../../../../../types/common").SetState<boolean>;
|
|
18
|
+
setIsPricingAuth: import("../../../../../types/common").SetState<boolean>;
|
|
19
|
+
setRedirectUrl: import("../../../../../types/common").SetState<string | null>;
|
|
16
20
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface NavPillProps {
|
|
3
|
+
text: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const NavPill: ({ text, icon, className, onClick }: NavPillProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
interface EditableNavPillProps extends NavPillProps {
|
|
10
|
+
sessionId: string;
|
|
11
|
+
onRename: (newName: string) => Promise<void>;
|
|
12
|
+
onDelete: () => Promise<void>;
|
|
13
|
+
isDarkGlass?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const EditableNavPill: ({ text, className, onRename, onDelete, isDarkGlass, }: EditableNavPillProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
interface HistoryPillProps {
|
|
17
|
+
icon: React.ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const HistoryPill: ({ icon, className, onClick }: HistoryPillProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -10,6 +10,7 @@ export type PickaxeTranslations = {
|
|
|
10
10
|
};
|
|
11
11
|
export type PickaxeProviderStyles = {
|
|
12
12
|
theme: "light" | "dark";
|
|
13
|
+
portalTheme?: "light" | "dark";
|
|
13
14
|
font: string;
|
|
14
15
|
fontSize: StudioFontSize;
|
|
15
16
|
formFieldStyle: StudioFormFieldStyle;
|
|
@@ -35,7 +36,8 @@ export type PickaxeMisc = {
|
|
|
35
36
|
isDescription: boolean;
|
|
36
37
|
isHistory?: boolean;
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
+
type ValidationStatus = "loading" | "success" | "login_required" | "upgrade_required" | "access_denied" | "stripe_checkout";
|
|
40
|
+
export type PickaxeDeploymentEmbedType = "inline" | "fab" | "popup" | "chat-input" | "direct-link";
|
|
39
41
|
export type PickaxeDeploymentDimensions = {
|
|
40
42
|
width: {
|
|
41
43
|
value: number;
|
|
@@ -53,6 +55,10 @@ export type PickaxeDeploymentMisc = {
|
|
|
53
55
|
popupText?: string;
|
|
54
56
|
fabImage?: string;
|
|
55
57
|
};
|
|
58
|
+
export type AccessGroup = {
|
|
59
|
+
limit: number;
|
|
60
|
+
accessGroupId: string;
|
|
61
|
+
};
|
|
56
62
|
type PickaxeContextType = {
|
|
57
63
|
origin: PickaxeHistoryOriginType;
|
|
58
64
|
contextId: string;
|
|
@@ -63,8 +69,13 @@ type PickaxeContextType = {
|
|
|
63
69
|
senderType: PickaxeHistorySenderType;
|
|
64
70
|
deploymentId?: string;
|
|
65
71
|
deploymentType?: PickaxeDeploymentEmbedType;
|
|
72
|
+
validationStatus: ValidationStatus;
|
|
73
|
+
validationUpgradeGroups: any[];
|
|
74
|
+
validationUpgradeUrl: string | null;
|
|
66
75
|
deploymentDimensions?: PickaxeDeploymentDimensions;
|
|
67
76
|
deploymentMisc?: PickaxeDeploymentMisc;
|
|
77
|
+
portalId?: string;
|
|
78
|
+
accessGroup?: AccessGroup | null;
|
|
68
79
|
pickaxe: LimitedPickaxe | null;
|
|
69
80
|
styles: PickaxeProviderStyles;
|
|
70
81
|
colors: PickaxeProviderColors;
|
|
@@ -86,12 +97,18 @@ type PickaxeContextType = {
|
|
|
86
97
|
isRtl: boolean;
|
|
87
98
|
isEmbed: boolean;
|
|
88
99
|
isDropShadow: boolean;
|
|
89
|
-
isEmailLogin: boolean;
|
|
90
100
|
allowGuestUsage: boolean;
|
|
101
|
+
stripeAccountId: string | null;
|
|
102
|
+
clientSecret: string | null;
|
|
103
|
+
preventInitialSessionId: boolean;
|
|
91
104
|
setContextId: SetState<string>;
|
|
92
105
|
setPickaxeId: SetState<string>;
|
|
93
106
|
setSessionId: SetState<string>;
|
|
107
|
+
setAccessGroup: SetState<AccessGroup | null>;
|
|
94
108
|
setLastSessionId: SetState<string>;
|
|
109
|
+
setValidationStatus: SetState<ValidationStatus>;
|
|
110
|
+
setValidationUpgradeGroups: SetState<any[]>;
|
|
111
|
+
setValidationUpgradeUrl: SetState<string | null>;
|
|
95
112
|
setSender: SetState<string | undefined>;
|
|
96
113
|
setSenderType: SetState<PickaxeHistorySenderType>;
|
|
97
114
|
setPickaxe: SetState<LimitedPickaxe | null>;
|
|
@@ -99,6 +116,8 @@ type PickaxeContextType = {
|
|
|
99
116
|
setIsNewChat: SetState<boolean>;
|
|
100
117
|
setIsShowIceBreaker: SetState<boolean>;
|
|
101
118
|
setIsShowFeedbackMessage: SetState<boolean>;
|
|
119
|
+
setStripeAccountId: SetState<string | null>;
|
|
120
|
+
setClientSecret: SetState<string | null>;
|
|
102
121
|
onGenerateComplete?: (responseId: string) => void;
|
|
103
122
|
};
|
|
104
123
|
export interface IPickaxeProviderProps {
|
|
@@ -107,6 +126,7 @@ export interface IPickaxeProviderProps {
|
|
|
107
126
|
sender?: string;
|
|
108
127
|
senderType: PickaxeHistorySenderType;
|
|
109
128
|
deploymentId?: string;
|
|
129
|
+
portalId?: string;
|
|
110
130
|
deploymentType?: PickaxeDeploymentEmbedType;
|
|
111
131
|
deploymentDimensions?: PickaxeDeploymentDimensions;
|
|
112
132
|
deploymentMisc?: PickaxeDeploymentMisc;
|
|
@@ -127,10 +147,11 @@ export interface IPickaxeProviderProps {
|
|
|
127
147
|
isRtl?: boolean;
|
|
128
148
|
isEmbed?: boolean;
|
|
129
149
|
isDropShadow?: boolean;
|
|
130
|
-
isEmailLogin?: boolean;
|
|
131
150
|
allowGuestUsage?: boolean;
|
|
151
|
+
preventInitialSessionId?: boolean;
|
|
132
152
|
onGenerateComplete?: (responseId: string) => void;
|
|
153
|
+
onSessionIdChange?: (sessionId: string) => void;
|
|
133
154
|
}
|
|
134
155
|
export declare const PickaxeContext: import("react").Context<PickaxeContextType>;
|
|
135
|
-
export declare const PickaxeProvider: ({ children, origin, sender: _sender, senderType: _senderType, deploymentId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, isDropShadow,
|
|
156
|
+
export declare const PickaxeProvider: ({ children, origin, sender: _sender, senderType: _senderType, deploymentId, portalId, deploymentType, deploymentDimensions, deploymentMisc, styles, colors, limits, misc, translations, artifact, responsiveBy, locale, opacity, forceMobile, disableHtml, disableJs, disableCss, loadFont, isRtl, isEmbed, isDropShadow, allowGuestUsage, preventInitialSessionId, onGenerateComplete, onSessionIdChange, }: IPickaxeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
136
157
|
export {};
|
|
@@ -3,9 +3,13 @@ import type { MemoryStoredChatMessage, MemoryStoredFormResponse } from "../../ty
|
|
|
3
3
|
import { type ReactNode } from "react";
|
|
4
4
|
export type ResponseStatus = "fetching" | "streaming" | "idle";
|
|
5
5
|
export type PickaxeLimitData = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
limitMessage: string;
|
|
7
|
+
buyUses?: any[];
|
|
8
|
+
upgradeGroups?: any[];
|
|
9
|
+
limitLink?: string;
|
|
10
|
+
customLink?: string;
|
|
11
|
+
limitCTA: string;
|
|
12
|
+
accessGroupId: string;
|
|
9
13
|
};
|
|
10
14
|
type ResponseContextType = {
|
|
11
15
|
messages: MemoryStoredChatMessage[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface AccessGroupCardPreviewProps {
|
|
3
|
+
data: any;
|
|
4
|
+
accessGroupId?: string;
|
|
5
|
+
upgradeUrl?: string | null;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const AccessGroupCardPreview: ({ data, children, upgradeUrl, }: AccessGroupCardPreviewProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default AccessGroupCardPreview;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
3
|
+
declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
4
|
+
declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
|
|
5
|
+
declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
export type AvatarGroupItem = {
|
|
7
|
+
src?: string;
|
|
8
|
+
initials: string;
|
|
9
|
+
};
|
|
10
|
+
export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
data: AvatarGroupItem[];
|
|
12
|
+
max?: number;
|
|
13
|
+
avatarClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup };
|
|
@@ -3,5 +3,5 @@ interface PickaxeUpgradeCardProps {
|
|
|
3
3
|
iconClassName?: string;
|
|
4
4
|
htmlClassName?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const PickaxeUpgradeCard: ({ className, iconClassName, htmlClassName, }: PickaxeUpgradeCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const PickaxeUpgradeCard: ({ className, iconClassName, htmlClassName, }: PickaxeUpgradeCardProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
export default PickaxeUpgradeCard;
|
|
@@ -8,8 +8,13 @@ export declare const usePickaxeContext: () => {
|
|
|
8
8
|
senderType: import("../../types/history").PickaxeHistorySenderType;
|
|
9
9
|
deploymentId?: string | undefined;
|
|
10
10
|
deploymentType?: import("../../components/Pickaxe/Provider").PickaxeDeploymentEmbedType | undefined;
|
|
11
|
+
validationStatus: "loading" | "success" | "login_required" | "upgrade_required" | "access_denied" | "stripe_checkout";
|
|
12
|
+
validationUpgradeGroups: any[];
|
|
13
|
+
validationUpgradeUrl: string | null;
|
|
11
14
|
deploymentDimensions?: import("../../components/Pickaxe/Provider").PickaxeDeploymentDimensions | undefined;
|
|
12
15
|
deploymentMisc?: import("../../components/Pickaxe/Provider").PickaxeDeploymentMisc | undefined;
|
|
16
|
+
portalId?: string | undefined;
|
|
17
|
+
accessGroup?: import("../../components/Pickaxe/Provider").AccessGroup | null | undefined;
|
|
13
18
|
pickaxe: import("../../types/pickaxe").LimitedPickaxe | null;
|
|
14
19
|
styles: import("../../components/Pickaxe/Provider").PickaxeProviderStyles;
|
|
15
20
|
colors: import("../../components/Pickaxe/Provider").PickaxeProviderColors;
|
|
@@ -31,12 +36,18 @@ export declare const usePickaxeContext: () => {
|
|
|
31
36
|
isRtl: boolean;
|
|
32
37
|
isEmbed: boolean;
|
|
33
38
|
isDropShadow: boolean;
|
|
34
|
-
isEmailLogin: boolean;
|
|
35
39
|
allowGuestUsage: boolean;
|
|
40
|
+
stripeAccountId: string | null;
|
|
41
|
+
clientSecret: string | null;
|
|
42
|
+
preventInitialSessionId: boolean;
|
|
36
43
|
setContextId: import("../../types/common").SetState<string>;
|
|
37
44
|
setPickaxeId: import("../../types/common").SetState<string>;
|
|
38
45
|
setSessionId: import("../../types/common").SetState<string>;
|
|
46
|
+
setAccessGroup: import("../../types/common").SetState<import("../../components/Pickaxe/Provider").AccessGroup | null>;
|
|
39
47
|
setLastSessionId: import("../../types/common").SetState<string>;
|
|
48
|
+
setValidationStatus: import("../../types/common").SetState<"loading" | "success" | "login_required" | "upgrade_required" | "access_denied" | "stripe_checkout">;
|
|
49
|
+
setValidationUpgradeGroups: import("../../types/common").SetState<any[]>;
|
|
50
|
+
setValidationUpgradeUrl: import("../../types/common").SetState<string | null>;
|
|
40
51
|
setSender: import("../../types/common").SetState<string | undefined>;
|
|
41
52
|
setSenderType: import("../../types/common").SetState<import("../../types/history").PickaxeHistorySenderType>;
|
|
42
53
|
setPickaxe: import("../../types/common").SetState<import("../../types/pickaxe").LimitedPickaxe | null>;
|
|
@@ -44,5 +55,7 @@ export declare const usePickaxeContext: () => {
|
|
|
44
55
|
setIsNewChat: import("../../types/common").SetState<boolean>;
|
|
45
56
|
setIsShowIceBreaker: import("../../types/common").SetState<boolean>;
|
|
46
57
|
setIsShowFeedbackMessage: import("../../types/common").SetState<boolean>;
|
|
58
|
+
setStripeAccountId: import("../../types/common").SetState<string | null>;
|
|
59
|
+
setClientSecret: import("../../types/common").SetState<string | null>;
|
|
47
60
|
onGenerateComplete?: ((responseId: string) => void) | undefined;
|
|
48
61
|
};
|
|
@@ -9,3 +9,11 @@ export type MemoryStoredFormResponse = {
|
|
|
9
9
|
messageCount: number;
|
|
10
10
|
sentAt: Date;
|
|
11
11
|
};
|
|
12
|
+
export interface LimitData {
|
|
13
|
+
limitMessage: string;
|
|
14
|
+
buyUses?: any[];
|
|
15
|
+
upgradeGroups?: any[];
|
|
16
|
+
limitLink?: string;
|
|
17
|
+
accessGroupId?: string;
|
|
18
|
+
limitCTA?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={exports:{}};export{e as __module};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={exports:{}};export{e as __module};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r={};export{r as __exports};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r={};export{r as __exports};
|
package/dist/esm/common/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
import{parse as t}from"tldts";const e="PXE-uid",o=(t,e="",o="")=>{let r="";for(let e=0;e<t;e++){r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(36*Math.random())]}return e+r+o},r=(t,e=!1)=>{let o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";e&&(o=o.replace(/[0-9]/g,""));let r="";for(let e=0;e<t;e++)r+=o.charAt(Math.floor(Math.random()*o.length));return r},n=t=>{const e=t.match(/(https?:\/\/[^\s]+)/g)||[];return Array.from(new Set(e))},l=(t,e=2)=>{if(!+t)return"0 Bytes";const o=e<0?0:e,r=Math.floor(Math.log(t)/Math.log(1024));return`${parseFloat((t/Math.pow(1024,r)).toFixed(o))} ${["Bytes","KB","MB","PB","EB"][r]}`},c=t=>{try{const e=document.cookie.split("; ");for(const o of e){const[e,r]=o.split("=");if(e===t)return r}return null}catch(t){return console.error("[pxe] failed to get cookie",t),null}},a=t=>{document.cookie=t+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"},i=()=>{try{const o=c(e);if(!o){const o=r(28),n=new Date;n.setFullYear(n.getFullYear()+1);let l=window.location.hostname;const c=t(l).domain;if(c)l=`.${c}`;else{const t=l.split(":")[0],e=t.split(".");l=t,e.length>=2&&(l=`.${e.slice(-2).join(".")}`)}return document.cookie=`${e}=${o};Path=/; Domain=${l}; Expires=${n.toUTCString()}`,o}return o}catch(t){return console.error("[pxe-embed] failed to initialized embed user id",t),r(28)}},u=t=>{try{if("undefined"==typeof window)return null;let e=null;return e=new URLSearchParams(window.location.search).get("pxtoken"),e||(e=localStorage.getItem(`PXE-token-${t}`)),e||(e=c(`PXE-token-${t}`)),e||(e=c(`__Secure-PS-${t}.session-token`)),e?decodeURIComponent(e):null}catch(t){return null}},s=(t,e)=>{try{if("undefined"==typeof window)return;localStorage.setItem(t,e)}catch(t){console.error("[pxe] failed to set auth token",t)}},d=t=>{try{if("undefined"==typeof window)return;localStorage.removeItem(t)}catch(t){console.error("[pxe] failed to delete auth token",t)}};function f(...t){return e=>{for(const o of t)o&&("function"==typeof o?o(e):o.current=e)}}const h=()=>{if("undefined"==typeof window)return!1;try{return window.self!==window.top}catch(t){return!0}},p=t=>{try{return JSON.parse(t)}catch(t){return null}};export{e as COOKIE_USER_ID,d as deleteAuthToken,a as deleteCookie,n as extractUrlsFromText,l as formatBytes,o as generateId,u as getAuthToken,c as getCookie,i as initializeEmbedUserId,h as isInIframe,f as mergeRefs,r as randomStr,p as safeJSONParse,s as setAuthToken};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r={"login required":"login_required","upgrade required":"upgrade_required","access denied":"access_denied"},e=e=>{var u;if("string"!=typeof e)return null;const l=e.trim().toLowerCase().replace(/[.!]+$/g,"");return null!==(u=r[l])&&void 0!==u?u:null},u=r=>{var u;if("string"==typeof r){const u=e(r);return u?{status:u,upgradeGroups:[],upgradeUrl:null}:null}if(!r||"object"!=typeof r)return null;const l=r,n=null!==(u=e(l.message))&&void 0!==u?u:e(l.error);return n?{status:n,upgradeGroups:Array.isArray(l.upgradeGroups)?l.upgradeGroups:[],upgradeUrl:"string"==typeof l.upgradeUrl?l.upgradeUrl:null}:null};export{u as getValidationFailure};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as r from"react";var e,t;function n(){return n=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},n.apply(null,arguments)}var o=o=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},o),e||(e=r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 17a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1zM4 12V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6"})),t||(t=r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 13h-4V9M11 13l5-5"})));export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as r from"react";var e,t;function n(){return n=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},n.apply(null,arguments)}var o=o=>r.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},o),e||(e=r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 9h-9a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2"})),t||(t=r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})));export{o as default};
|
|
@@ -0,0 +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",{fill:"currentColor",d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5z"})));export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as a from"react";var t;function r(){return r=Object.assign?Object.assign.bind():function(a){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var e in r)({}).hasOwnProperty.call(r,e)&&(a[e]=r[e])}return a},r.apply(null,arguments)}var e=e=>a.createElement("svg",r({xmlns:"http://www.w3.org/2000/svg",width:20,height:20,fill:"none"},e),t||(t=a.createElement("path",{fill:"#000",d:"M20 10c0-5.523-4.477-10-10-10a9.97 9.97 0 0 0-7 2.859V1.75a.75.75 0 0 0-1.5 0v3.5c0 .414.336.75.75.75h3.5a.75.75 0 0 0 0-1.5H3.519a8.5 8.5 0 1 1 2.348 12.93l-.27-.15-3.986 1.111 1.113-3.984-.151-.27A8.46 8.46 0 0 1 1.5 10c0-.675.079-1.332.227-1.962.08-.301.065-.888-.536-1.02-.613-.134-.87.355-.935.719h.001A10 10 0 0 0 0 10a9.96 9.96 0 0 0 1.115 4.592L.047 18.415a1.25 1.25 0 0 0 1.54 1.54l3.826-1.067A9.96 9.96 0 0 0 10 20c5.523 0 10-4.477 10-10M10 6.75a.75.75 0 0 0-1.5 0v4.5c0 .414.336.75.75.75h3a.75.75 0 0 0 0-1.5H10z"})));export{e as default};
|
|
@@ -0,0 +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 18 18"},n),e||(e=r.createElement("path",{fill:"currentColor",d:"m11.06 6.02.92.92L2.92 16H2v-.92zM14.66 0c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83a.996.996 0 0 0 0-1.41L15.37.29c-.2-.2-.45-.29-.71-.29m-3.6 3.19L0 14.25V18h3.75L14.81 6.94z"})));export{n as default};
|