@bikdotai/bik-component-library 0.0.407-beta.2 → 0.0.407-beta.20

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 (83) hide show
  1. package/dist/cjs/assets/icons/lto_icon.svg.js +1 -0
  2. package/dist/cjs/components/TablePagination/TablePagination.js +1 -1
  3. package/dist/cjs/components/button/Button.js +1 -1
  4. package/dist/cjs/components/button/Button.styled.d.ts +1 -0
  5. package/dist/cjs/components/button/Button.styled.js +1 -1
  6. package/dist/cjs/components/button/model.d.ts +1 -0
  7. package/dist/cjs/components/custom-date-time/CustomDateTime.js +1 -1
  8. package/dist/cjs/components/discount-modal/CouponExpiration/CouponExpiration.js +1 -1
  9. package/dist/cjs/components/discount-modal/DiscountModal.js +1 -1
  10. package/dist/cjs/components/input/Input.js +1 -1
  11. package/dist/cjs/components/input-with-vars/InputWithVariables.d.ts +1 -0
  12. package/dist/cjs/components/input-with-vars/InputWithVariables.js +1 -1
  13. package/dist/cjs/components/shimmer-image/ShimmerImage.d.ts +1 -1
  14. package/dist/cjs/components/tag/Tag.styled.js +1 -1
  15. package/dist/cjs/components/template-context-mapper/TemplateContextMapper.js +1 -1
  16. package/dist/cjs/components/template-context-mapper/custom-hooks/useAdditionalVariables.d.ts +8 -0
  17. package/dist/cjs/components/template-context-mapper/custom-hooks/useAdditionalVariables.js +1 -0
  18. package/dist/cjs/components/template-context-mapper/modalElements/Body.js +1 -1
  19. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
  20. package/dist/cjs/components/template-context-mapper/modalElements/EditMediaV2.js +2 -2
  21. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  22. package/dist/cjs/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  23. package/dist/cjs/components/template-context-mapper/modalElements/MobilePreview.js +3 -3
  24. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.d.ts +1 -1
  25. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
  26. package/dist/cjs/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  27. package/dist/cjs/components/template-context-mapper/modalElements/VariableEditorHeader.js +1 -1
  28. package/dist/cjs/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  29. package/dist/cjs/components/template-context-mapper/utils/getDataFromTemplateComponent.js +1 -1
  30. package/dist/cjs/components/template-context-mapper/utils/getPreviewDimension.d.ts +2 -0
  31. package/dist/cjs/components/template-context-mapper/utils/getPreviewDimension.js +1 -0
  32. package/dist/cjs/components/template-preview/WhatsApp/ChatUiV2.js +5 -5
  33. package/dist/cjs/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.d.ts +5 -0
  34. package/dist/cjs/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.js +20 -0
  35. package/dist/cjs/components/template-preview/WhatsApp/MediaCard.js +1 -1
  36. package/dist/cjs/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  37. package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.d.ts +1 -0
  38. package/dist/cjs/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  39. package/dist/cjs/components/template-preview/models/TemplateMeta.d.ts +1 -1
  40. package/dist/cjs/components/template-preview/models/WhatsAppTemplate.d.ts +12 -1
  41. package/dist/esm/assets/icons/lto_icon.svg.js +1 -0
  42. package/dist/esm/components/TablePagination/TablePagination.js +1 -1
  43. package/dist/esm/components/button/Button.js +1 -1
  44. package/dist/esm/components/button/Button.styled.d.ts +1 -0
  45. package/dist/esm/components/button/Button.styled.js +1 -1
  46. package/dist/esm/components/button/model.d.ts +1 -0
  47. package/dist/esm/components/custom-date-time/CustomDateTime.js +1 -1
  48. package/dist/esm/components/discount-modal/CouponExpiration/CouponExpiration.js +1 -1
  49. package/dist/esm/components/discount-modal/DiscountModal.js +1 -1
  50. package/dist/esm/components/input/Input.js +1 -1
  51. package/dist/esm/components/input-with-vars/InputWithVariables.d.ts +1 -0
  52. package/dist/esm/components/input-with-vars/InputWithVariables.js +2 -2
  53. package/dist/esm/components/shimmer-image/ShimmerImage.d.ts +1 -1
  54. package/dist/esm/components/tag/Tag.styled.js +1 -1
  55. package/dist/esm/components/template-context-mapper/TemplateContextMapper.js +1 -1
  56. package/dist/esm/components/template-context-mapper/custom-hooks/useAdditionalVariables.d.ts +8 -0
  57. package/dist/esm/components/template-context-mapper/custom-hooks/useAdditionalVariables.js +1 -0
  58. package/dist/esm/components/template-context-mapper/modalElements/Body.js +1 -1
  59. package/dist/esm/components/template-context-mapper/modalElements/EditMediaModal.js +1 -1
  60. package/dist/esm/components/template-context-mapper/modalElements/EditMediaV2.js +2 -2
  61. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateMediaV2.js +1 -1
  62. package/dist/esm/components/template-context-mapper/modalElements/EditWhatsAppTemplateV2.js +1 -1
  63. package/dist/esm/components/template-context-mapper/modalElements/MobilePreview.js +4 -4
  64. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.d.ts +1 -1
  65. package/dist/esm/components/template-context-mapper/modalElements/VariableConnector.js +3 -3
  66. package/dist/esm/components/template-context-mapper/modalElements/VariableConnectorWhatsApp.js +1 -1
  67. package/dist/esm/components/template-context-mapper/modalElements/VariableEditorHeader.js +1 -1
  68. package/dist/esm/components/template-context-mapper/modalElements/WhatsAppTemplateCardButtonV2.js +1 -1
  69. package/dist/esm/components/template-context-mapper/utils/getDataFromTemplateComponent.js +1 -1
  70. package/dist/esm/components/template-context-mapper/utils/getPreviewDimension.d.ts +2 -0
  71. package/dist/esm/components/template-context-mapper/utils/getPreviewDimension.js +1 -0
  72. package/dist/esm/components/template-preview/WhatsApp/ChatUiV2.js +5 -5
  73. package/dist/esm/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.d.ts +5 -0
  74. package/dist/esm/components/template-preview/WhatsApp/LimitedTimeOffer/LimitedTimeOffer.index.js +20 -0
  75. package/dist/esm/components/template-preview/WhatsApp/MediaCard.js +1 -1
  76. package/dist/esm/components/template-preview/WhatsAppTemplatePreview.js +1 -1
  77. package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.d.ts +1 -0
  78. package/dist/esm/components/template-preview/helpers/TemplateCreatorHelper.js +1 -1
  79. package/dist/esm/components/template-preview/models/TemplateMeta.d.ts +1 -1
  80. package/dist/esm/components/template-preview/models/WhatsAppTemplate.d.ts +12 -1
  81. package/package.json +1 -1
  82. package/dist/cjs/assets/icons/video_camcorder.svg.js +0 -1
  83. package/dist/esm/assets/icons/video_camcorder.svg.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";function e(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=e(require("react"));function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},a.apply(this,arguments)}var n=e=>r.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),t||(t=r.createElement("path",{fill:"#4AA189",fillRule:"evenodd",d:"M9.778 7.112a1.833 1.833 0 1 1 0-3.667 1.833 1.833 0 0 1 0 3.667ZM6.444 5.279a3.333 3.333 0 0 1 6.112-1.844A3.333 3.333 0 1 1 17.818 7.5H20a2 2 0 0 1 2 2V21.057a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9.501a2 2 0 0 1 2-2h3.293a3.32 3.32 0 0 1-.849-2.222ZM13.634 9l2.752 3.93a.75.75 0 0 0 1.228-.86L15.465 9H20a.5.5 0 0 1 .5.5v6.194h-17V9.501A.5.5 0 0 1 4 9h5.646l-2.15 3.07a.75.75 0 1 0 1.23.86l2.75-3.93h2.158ZM20.5 21.056v-2.86h-17v2.86a.5.5 0 0 0 .5.5h16a.5.5 0 0 0 .5-.5Zm-7-15.777a1.833 1.833 0 1 0 3.667 0 1.833 1.833 0 0 0-3.667 0Z",clipRule:"evenodd"})));exports.default=n;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/chevronLeft.svg.js"),t=require("../../assets/icons/chevronRight.svg.js"),n=require("./TablePagination.styled.js"),a=require("../../constants/Theme.js"),i=require("../TypographyStyle.js"),r=require("../dropdown/Dropdown.js");exports.TablePagination=o=>{let{pageNumber:l,pageSize:c,totalRows:d,updatePageNumber:g,updatePageSize:h,hidePageSizeOptions:j}=o;const p=a.DEFAULT_THEME.colorsV2,u=(l-1)*c+1,y=(l-1)*c+c,b=Math.ceil(d/c),x=1==b;let v=[];v=b>=5?l===b?[l-4,l-3,l-2,l-1,l]:1===l?[l,l+1,l+2,l+3,l+4]:2===l?[l-1,l,l+1,l+2,l+3]:l===b-1?[l-3,l-2,l-1,l,l+1]:[l-2,l-1,l,l+1,l+2]:Array.from({length:b},((e,s)=>s+1));const m=[{label:"5 rows per page",value:"5",selected:5===c},{label:"10 rows per page",value:"10",selected:10===c},{label:"20 rows per page",value:"20",selected:20===c}];return e.jsxs(n.StyledTablePaginationContainer,{children:[!j&&e.jsx("div",{children:e.jsx(r.Dropdown,{size:"small",options:m,onSelect:h,width:"162px"})}),e.jsxs("div",Object.assign({className:"paging__container"},{children:[!j&&d&&e.jsxs(i.BodySecondary,Object.assign({style:{color:p.content.placeholder,marginRight:8}},{children:["Showing ",u,"-",y>d?d:y," of"," ",d," results"]})),e.jsxs("div",Object.assign({className:"pages__buttons-container"},{children:[!x&&e.jsx(n.StyledPagingContainer,Object.assign({active:!1,onClick:()=>{1!==l&&g(Math.max(l-1,1))},disabled:1===l},{children:e.jsx(s.default,{color:p.content.secondary,height:14,width:14})})),v.map((s=>e.jsx(n.StyledPagingContainer,Object.assign({active:s==l,onClick:()=>g(s),style:{display:1==s&&d<=c?"none":"flex"}},{children:e.jsx(i.BodySecondary,Object.assign({style:{color:s==l?p.content.primaryInverse:p.content.secondary}},{children:s}))}),s))),!x&&e.jsx(n.StyledPagingContainer,Object.assign({isLast:!0,active:!1,onClick:()=>{l!==b&&g(Math.min(l+1,b))},disabled:l===b},{children:e.jsx(t.default,{color:p.content.secondary,height:14,width:14})}))]}))]}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),s=require("../../assets/icons/chevronLeft.svg.js"),t=require("../../assets/icons/chevronRight.svg.js"),n=require("./TablePagination.styled.js"),a=require("../../constants/Theme.js"),i=require("../dropdown/Dropdown.js"),r=require("../TypographyStyle.js");exports.TablePagination=o=>{let{pageNumber:l,pageSize:c,totalRows:d,updatePageNumber:g,updatePageSize:h,hidePageSizeOptions:j}=o;const p=a.DEFAULT_THEME.colorsV2,u=(l-1)*c+1,y=(l-1)*c+c,b=Math.ceil(d/c),x=1==b;let v=[];v=b>=5?l===b?[l-4,l-3,l-2,l-1,l]:1===l?[l,l+1,l+2,l+3,l+4]:2===l?[l-1,l,l+1,l+2,l+3]:l===b-1?[l-3,l-2,l-1,l,l+1]:[l-2,l-1,l,l+1,l+2]:Array.from({length:b},((e,s)=>s+1));const m=[{label:"5 rows per page",value:"5",selected:5===c},{label:"10 rows per page",value:"10",selected:10===c},{label:"20 rows per page",value:"20",selected:20===c}];return e.jsxs(n.StyledTablePaginationContainer,{children:[!j&&e.jsx("div",{children:e.jsx(i.Dropdown,{size:"small",options:m,onSelect:h,width:"162px"})}),e.jsxs("div",Object.assign({className:"paging__container"},{children:[!j&&d&&e.jsxs(r.BodySecondary,Object.assign({style:{color:p.content.placeholder,marginRight:8}},{children:["Showing ",u,"-",y>d?d:y," of"," ",d," results"]})),e.jsxs("div",Object.assign({className:"pages__buttons-container"},{children:[!x&&e.jsx(n.StyledPagingContainer,Object.assign({active:!1,onClick:()=>{1!==l&&g(Math.max(l-1,1))},disabled:1===l},{children:e.jsx(s.default,{color:p.content.secondary,height:14,width:14})})),v.map((s=>e.jsx(n.StyledPagingContainer,Object.assign({active:s==l,onClick:()=>g(s),style:{display:1==s&&d<=c?"none":"flex"}},{children:e.jsx(r.BodySecondary,Object.assign({style:{color:s==l?p.content.primaryInverse:p.content.secondary}},{children:s}))}),s))),!x&&e.jsx(n.StyledPagingContainer,Object.assign({isLast:!0,active:!1,onClick:()=>{l!==b&&g(Math.min(l+1,b))},disabled:l===b},{children:e.jsx(t.default,{color:p.content.secondary,height:14,width:14})}))]}))]}))]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),n=require("react"),s=require("../spinner/Spinner.js"),i=require("./Button.styled.js"),a=require("./themes.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(n);const c=n.forwardRef(((n,r)=>{var{version:c,id:l,buttonType:d="primary",size:u="small",buttonText:m,disabled:j,IconComponent:b,LeadingIcon:h,TrailingIcon:p,isLoading:g,inverse:x,onClick:v,matchParentWidth:f,subtitle:y,darkMode:N}=n,C=e.__rest(n,["version","id","buttonType","size","buttonText","disabled","IconComponent","LeadingIcon","TrailingIcon","isLoading","inverse","onClick","matchParentWidth","subtitle","darkMode"]);const O=a.GetButtonTextComponent(u,d),B="chip"===u?16:20,T={height:B,width:B,color:a.getButtonIconColor(u,d,x,j,g,N),style:{display:"block"},className:"icon"};return t.jsx(i.Button,Object.assign({version:c,onClick:g?()=>{}:v,ref:r,id:l,disabled:j,size:u,buttonType:d,isLoading:g,inverse:x,matchParentWidth:f,darkMode:N},C,{children:t.jsxs("div",Object.assign({className:"button-container"},{children:[d.startsWith("dash")&&t.jsx(i.ButtonCustomDashedBorder,{}),t.jsx("div",Object.assign({className:"overlay-container"},{children:g&&t.jsx(s.Spinner,{className:"spinner",size:"small",color:a.SpinnerColorMap(d,x)})})),b&&t.jsx("div",Object.assign({className:"icon-component"},{children:o.default.createElement(b,T)})),h&&t.jsx("div",Object.assign({className:"icon-leading"},{children:o.default.createElement(h,T)})),m?t.jsxs(O,Object.assign({className:"text"},{children:[m,t.jsx("div",Object.assign({className:"text-subtitle"},{children:y}))]})):t.jsx(t.Fragment,{}),p&&t.jsx("div",Object.assign({className:"icon-trailing"},{children:o.default.createElement(p,T)}))]}))}))}));c.displayName="Button",exports.Button=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),n=require("../spinner/Spinner.js"),s=require("./Button.styled.js"),a=require("./themes.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(i);const c=i.forwardRef(((i,r)=>{var{version:c,id:d,buttonType:l="primary",size:u="small",buttonText:m,disabled:j,IconComponent:b,LeadingIcon:h,TrailingIcon:p,isLoading:v,inverse:g,onClick:x,matchParentWidth:f,subtitle:y,darkMode:N,activated:C}=i,O=e.__rest(i,["version","id","buttonType","size","buttonText","disabled","IconComponent","LeadingIcon","TrailingIcon","isLoading","inverse","onClick","matchParentWidth","subtitle","darkMode","activated"]);const B=a.GetButtonTextComponent(u,l),T="chip"===u?16:20,k={height:T,width:T,color:a.getButtonIconColor(u,l,g,j,v,N),style:{display:"block"},className:"icon"};return t.jsx(s.Button,Object.assign({version:c,onClick:v?()=>{}:x,ref:r,id:d,disabled:j,size:u,buttonType:l,isLoading:v,inverse:g,matchParentWidth:f,darkMode:N,activated:C},O,{children:t.jsxs("div",Object.assign({className:"button-container"},{children:[l.startsWith("dash")&&t.jsx(s.ButtonCustomDashedBorder,{}),t.jsx("div",Object.assign({className:"overlay-container"},{children:v&&t.jsx(n.Spinner,{className:"spinner",size:"small",color:a.SpinnerColorMap(l,g)})})),b&&t.jsx("div",Object.assign({className:"icon-component"},{children:o.default.createElement(b,k)})),h&&t.jsx("div",Object.assign({className:"icon-leading"},{children:o.default.createElement(h,k)})),m?t.jsxs(B,Object.assign({className:"text"},{children:[m,t.jsx("div",Object.assign({className:"text-subtitle"},{children:y}))]})):t.jsx(t.Fragment,{}),p&&t.jsx("div",Object.assign({className:"icon-trailing"},{children:o.default.createElement(p,k)}))]}))}))}));c.displayName="Button",exports.Button=c;
@@ -12,5 +12,6 @@ export declare const Button: import("@emotion/styled").StyledComponent<{
12
12
  matchParentWidth?: boolean | undefined;
13
13
  version?: "1.0" | "2.0" | undefined;
14
14
  darkMode?: boolean | undefined;
15
+ activated?: boolean | undefined;
15
16
  }, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
16
17
  export declare const ButtonCustomDashedBorder: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@emotion/styled/base"),c=require("react/jsx-runtime"),d=require("../../constants/Theme.js"),n=require("./themes.js");function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}const e=l(t).default("button","production"===process.env.NODE_ENV?{target:"exlualr0"}:{target:"exlualr0",label:"Button"})("all:unset;cursor:pointer;display:flex;gap:8.83px;border-radius:",(t=>"text"==t.buttonType?"0":"4px"),";overflow:hidden;",(t=>t.matchParentWidth?"flex-grow: 1;":"")," background-color:",(t=>n.getBackgroundColor(t.buttonType,t.size,t.inverse,t.darkMode)),";",(t=>{var c;return t.buttonType.startsWith("dash")?`.button-container {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t${t.matchParentWidth?"justify-content: center;":""}\n\t\t\t\t\tpadding: ${n.getPadding(t.buttonType,t.size)};\n\t\t\t\t}`:`padding: ${n.getPadding(t.buttonType,t.size)};\n\t${n.getBorder(null!==(c=t.version)&&void 0!==c?c:"1.0",t.buttonType,t.size,t.inverse)}`})," .icon-component{height:",(t=>"chip"===t.size?"16px":"20px"),";width:",(t=>"chip"===t.size?"16px":"20px"),";}.icon-trailing{height:",(t=>"chip"===t.size?"16px":"20px"),";width:",(t=>"chip"===t.size?"16px":"20px"),";}.text{color:",(t=>n.getColor(t.buttonType,t.size,t.inverse,t.darkMode)),";}.icon-leading{height:",(t=>"chip"===t.size?"16px":"20px"),";width:",(t=>"chip"===t.size?"16px":"20px"),";}",(t=>n.getDashedBorderStyling(t.buttonType,t.size,t.isLoading?d.COLORS.stroke.brandLightAlt:void 0))," .overlay-container{display:none;}:disabled{cursor:",(t=>"text"===t.buttonType?"auto":"not-allowed"),";",(t=>n.getDashedBorderStyling(t.buttonType,t.size,d.COLORS.stroke.primary)),";.overlay-container{display:none!important;}",(t=>n.generateDisabledStyling(t.buttonType,t.size,t.inverse))," .text{color:",(t=>n.getDisabledTextColor(t.inverse)),"!important;}}",(t=>!t.disabled&&!t.isLoading&&`:active {\n\t\t\t\t.button-container {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t${t.matchParentWidth?"justify-content: center;":""}\n\t\t\t\t\tposition: relative;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\t.overlay-container {\n\t\t\t\t\t\tdisplay: none !important;\n\t\t\t\t\t}\n\t\t\t\t\t${"chip"===t.size&&`.text {\n\t\t\t\t\t\tcolor: ${d.COLORS.background.inverseLight} !important;\n\t\t\t\t\t}\n\t\t\t\t\t.icon {\n\t\t\t\t\t\tcolor: ${d.COLORS.background.inverseLight};\n\t\t\t\t\t}\n\t\t\t\t\t`}\n\t\t\t\t}\n\n\n\t\t\t${n.getClickEffect(t.buttonType,t.size,t.inverse)}\n\t\t\t${n.getDashedBorderStyling(t.buttonType,t.size,d.COLORS.content.brand)}\n\t\t}`)," ",(t=>t.isLoading?`\n\t\t\tcursor: not-allowed;\n\t\t\tpadding: 0;\n\t\t${n.getLoadingBorder(t.buttonType,t.size,t.inverse)}\n\n\t\t.button-container {\n\t\t\tdisplay: flex;\n\t\t\tposition: relative;\n\t\t\twidth: 100%;\n\t\t\t.text {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tpadding: ${n.getPadding(t.buttonType,t.size)};\n\t\t\t.overlay-container {\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tpadding: 0;\n\t\t\t\tpadding-top: 1px;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\t${n.getLoadingBackground(t.buttonType,t.size,t.inverse)}\n\t\t\t\t.spinner {\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\ttop: calc(50% - 14px);\n\t\t\t\t\tleft: calc(50% - 7px);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}`:`:not(:active):not(:disabled):hover {\n\t\t\tpadding: 0;\n\t\t\t.button-container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\t${t.matchParentWidth?"justify-content: center;":""}\n\t\t\t\tpadding: ${n.getPadding(t.buttonType,t.size)};\n\t\t\t\t.overlay-container {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tpadding: 0;\n\t\t\t\t\ttop: 0;\n\t\t\t\t\tleft: 0;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\t${n.getHoverButtonBackground(t.buttonType,t.inverse)}\n\t\t\t\t}\n\t\t\t\t${"chip"===t.size&&"text"!==t.buttonType?t.darkMode?`background-color: ${d.COLORS.stroke.primary};`:`background-color: ${d.COLORS.surface.hovered};`:""}\n\t\t\t\t${"primary"!==t.buttonType||"chip"===t.size||t.inverse?"":`background-color: ${d.COLORS.background.inverse};`}\n\t\t\t}\n\t\t\t${"text"===t.buttonType?n.getHoverButtonTextDecorationStyle(t.buttonType,t.disabled):""}\n\t\t\t${t.inverse?n.generateInverseHoverBackground(t.buttonType,t.disabled):""}\n\t\t}`)," .button-container{display:flex;gap:8.33px;",(t=>t.matchParentWidth?"margin: auto;":""),";}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkJ1dHRvbi5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlvQyIsImZpbGUiOiJCdXR0b24uc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGpzeCBhcyBfanN4LCBGcmFnbWVudCBhcyBfRnJhZ21lbnQsIGpzeHMgYXMgX2pzeHMgfSBmcm9tIFwicmVhY3QvanN4LXJ1bnRpbWVcIjtcclxuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xyXG5pbXBvcnQgeyBDT0xPUlMgfSBmcm9tIFwiLi4vLi4vY29uc3RhbnRzL1RoZW1lXCI7XHJcbmltcG9ydCB7IGdlbmVyYXRlRGlzYWJsZWRTdHlsaW5nLCBnZW5lcmF0ZUludmVyc2VIb3ZlckJhY2tncm91bmQsIGdldEJhY2tncm91bmRDb2xvciwgZ2V0Qm9yZGVyLCBnZXRDbGlja0VmZmVjdCwgZ2V0Q29sb3IsIGdldERhc2hlZEJvcmRlclN0eWxpbmcsIGdldERpc2FibGVkVGV4dENvbG9yLCBnZXRIb3ZlckJ1dHRvbkJhY2tncm91bmQsIGdldEhvdmVyQnV0dG9uVGV4dERlY29yYXRpb25TdHlsZSwgZ2V0TG9hZGluZ0JhY2tncm91bmQsIGdldExvYWRpbmdCb3JkZXIsIGdldFBhZGRpbmcsIH0gZnJvbSAnLi90aGVtZXMnO1xyXG5leHBvcnQgY29uc3QgQnV0dG9uID0gc3R5bGVkLmJ1dHRvbiBgXG5cdGFsbDogdW5zZXQ7XG5cdGN1cnNvcjogcG9pbnRlcjtcbl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bmdCYWNrZ3JvdW5kKHByb3BzLmJ1dHRvblR5cGUsIHByb3BzLnNpemUsIHByb3BzLmludmVyc2UpfVxuXHRcdFx0XHQuc3Bpbm5lciB7XG5cdFx0XHRcdFx0cG9zaXRpb246IGFic29sdXRlO1xuXHRcdFx0XHRcdHRvcDogY2FsYyg1MCUgLSAxNHB4KTtcblx0XHRcdFx0XHRsZWZ0OiBjYWxjKDUwJSAtIDdweCk7XG5cdFx0XHRcdH1cblxuXHRcdFx0fVxuXHRcdH1gfVxuXG5cdFx0LmJ1dHRvbi1jb250YWluZXIge1xuXHRcdGRpc3BsYXk6IGZsZXg7XG5cdFx0Z2FwOiA4LjMzcHg7XG5cdFx0JHsocHJvcHMpID0+IChwcm9wcy5tYXRjaFBhcmVudFdpZHRoID8gJ21hcmdpbjogYXV0bzsnIDogJycpfVxuXHR9XG5gO1xyXG5leHBvcnQgY29uc3QgQnV0dG9uQ3VzdG9tRGFzaGVkQm9yZGVyID0gKCkgPT4ge1xyXG4gICAgcmV0dXJuIChfanN4cyhfRnJhZ21lbnQsIHsgY2hpbGRyZW46IFtfanN4KFwiZGl2XCIsIHsgY2xhc3NOYW1lOiBcImxpbmUtdG9wXCIgfSksIF9qc3goXCJkaXZcIiwgeyBjbGFzc05hbWU6IFwibGluZS1sZWZ0XCIgfSksIF9qc3goXCJkaXZcIiwgeyBjbGFzc05hbWU6IFwibGluZS1ib3R0b21cIiB9KSwgX2pzeChcImRpdlwiLCB7IGNsYXNzTmFtZTogXCJsaW5lLXJpZ2h0XCIgfSldIH0pKTtcclxufTtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9QnV0dG9uLnN0eWxlZC5qcy5tYXAiXX0= */"));exports.Button=e,exports.ButtonCustomDashedBorder=()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"line-top"}),c.jsx("div",{className:"line-left"}),c.jsx("div",{className:"line-bottom"}),c.jsx("div",{className:"line-right"})]});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@emotion/styled/base"),c=require("react/jsx-runtime"),d=require("../../constants/Theme.js"),n=require("./themes.js");function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}const H=l(t).default("button","production"===process.env.NODE_ENV?{target:"exlualr0"}:{target:"exlualr0",label:"Button"})("all:unset;cursor:pointer;display:flex;gap:8.83px;border-radius:",(t=>"text"==t.buttonType?"0":"4px"),";overflow:hidden;",(t=>t.matchParentWidth?"flex-grow: 1;":"")," background-color:",(t=>n.getBackgroundColor(t.buttonType,t.size,t.inverse,t.darkMode)),";",(t=>{var c;return t.buttonType.startsWith("dash")?`.button-container {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\tposition: relative;\n\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t${t.matchParentWidth?"justify-content: center;":""}\n\t\t\t\t\tpadding: ${n.getPadding(t.buttonType,t.size)};\n\t\t\t\t}`:`padding: ${n.getPadding(t.buttonType,t.size)};\n\t${n.getBorder(null!==(c=t.version)&&void 0!==c?c:"1.0",t.buttonType,t.size,t.inverse)}`})," .icon-component{height:",(t=>"chip"===t.size?"16px":"20px"),";width:",(t=>"chip"===t.size?"16px":"20px"),";}.icon-trailing{height:",(t=>"chip"===t.size?"16px":"20px"),";width:",(t=>"chip"===t.size?"16px":"20px"),";}.text{color:",(t=>n.getColor(t.buttonType,t.size,t.inverse,t.darkMode)),";}.icon-leading{height:",(t=>"chip"===t.size?"16px":"20px"),";width:",(t=>"chip"===t.size?"16px":"20px"),";}",(t=>n.getDashedBorderStyling(t.buttonType,t.size,t.isLoading?d.COLORS.stroke.brandLightAlt:void 0))," .overlay-container{display:none;}",(t=>!t.disabled&&!t.isLoading&&t.activated&&("dashBold"==t.buttonType||"dashRegular"==t.buttonType)&&`\n\t.button-container {\n\t\tdisplay: flex;\n\t\t${t.matchParentWidth?"justify-content: center;":""}\n\t\tposition: relative;\n\t\twidth: 100%;\n\t\t.overlay-container {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\t.text {\n\t\t\tcolor: ${d.COLORS.content.brand} !important;\n\t\t}\n\t\t.icon {\n\t\t\tcolor: ${d.COLORS.background.brand};\n\t\t}\n\t\t\n\t}\n\t${n.getClickEffect(t.buttonType,t.size,t.inverse)}\n\t${n.getDashedBorderStyling(t.buttonType,t.size,d.COLORS.content.brand)}\n\t`)," :disabled{cursor:",(t=>"text"===t.buttonType?"auto":"not-allowed"),";",(t=>n.getDashedBorderStyling(t.buttonType,t.size,d.COLORS.stroke.primary)),";.overlay-container{display:none!important;}",(t=>n.generateDisabledStyling(t.buttonType,t.size,t.inverse))," .text{color:",(t=>n.getDisabledTextColor(t.inverse)),"!important;}}",(t=>!t.disabled&&!t.isLoading&&`:active {\n\t\t\t\t.button-container {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\t${t.matchParentWidth?"justify-content: center;":""}\n\t\t\t\t\tposition: relative;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\t.overlay-container {\n\t\t\t\t\t\tdisplay: none !important;\n\t\t\t\t\t}\n\t\t\t\t\t${"chip"===t.size&&`.text {\n\t\t\t\t\t\tcolor: ${d.COLORS.background.inverseLight} !important;\n\t\t\t\t\t}\n\t\t\t\t\t.icon {\n\t\t\t\t\t\tcolor: ${d.COLORS.background.inverseLight};\n\t\t\t\t\t}\n\t\t\t\t\t`}\n\t\t\t\t}\n\n\n\t\t\t${n.getClickEffect(t.buttonType,t.size,t.inverse)}\n\t\t\t${n.getDashedBorderStyling(t.buttonType,t.size,d.COLORS.content.brand)}\n\t\t}`)," ",(t=>t.isLoading?`\n\t\t\tcursor: not-allowed;\n\t\t\tpadding: 0;\n\t\t${n.getLoadingBorder(t.buttonType,t.size,t.inverse)}\n\n\t\t.button-container {\n\t\t\tdisplay: flex;\n\t\t\tposition: relative;\n\t\t\twidth: 100%;\n\t\t\t.text {\n\t\t\t\topacity: 0;\n\t\t\t}\n\t\t\tpadding: ${n.getPadding(t.buttonType,t.size)};\n\t\t\t.overlay-container {\n\t\t\t\tdisplay: block;\n\t\t\t\tposition: absolute;\n\t\t\t\tpadding: 0;\n\t\t\t\tpadding-top: 1px;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\t${n.getLoadingBackground(t.buttonType,t.size,t.inverse)}\n\t\t\t\t.spinner {\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\ttop: calc(50% - 14px);\n\t\t\t\t\tleft: calc(50% - 7px);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}`:`:not(:active):not(:disabled):hover {\n\t\t\tpadding: 0;\n\t\t\t.button-container {\n\t\t\t\tdisplay: flex;\n\t\t\t\tposition: relative;\n\t\t\t\twidth: 100%;\n\t\t\t\t${t.matchParentWidth?"justify-content: center;":""}\n\t\t\t\tpadding: ${n.getPadding(t.buttonType,t.size)};\n\t\t\t\t.overlay-container {\n\t\t\t\t\tdisplay: block;\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tpadding: 0;\n\t\t\t\t\ttop: 0;\n\t\t\t\t\tleft: 0;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t\theight: 100%;\n\t\t\t\t\t${n.getHoverButtonBackground(t.buttonType,t.inverse)}\n\t\t\t\t}\n\t\t\t\t${"chip"===t.size&&"text"!==t.buttonType?t.darkMode?`background-color: ${d.COLORS.stroke.primary};`:`background-color: ${d.COLORS.surface.hovered};`:""}\n\t\t\t\t${"primary"!==t.buttonType||"chip"===t.size||t.inverse?"":`background-color: ${d.COLORS.background.inverse};`}\n\t\t\t}\n\t\t\t${"text"===t.buttonType?n.getHoverButtonTextDecorationStyle(t.buttonType,t.disabled):""}\n\t\t\t${t.inverse?n.generateInverseHoverBackground(t.buttonType,t.disabled):""}\n\t\t}`)," .button-container{display:flex;gap:8.33px;",(t=>t.matchParentWidth?"margin: auto;":""),";}"+("production"===process.env.NODE_ENV?"":"/*# sourceMapp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b24tY29udGFpbmVyIHtcblx0XHRkaXNwbGF5OiBmbGV4O1xuXHRcdGdhcDogOC4zM3B4O1xuXHRcdCR7KHByb3BzKSA9PiAocHJvcHMubWF0Y2hQYXJlbnRXaWR0aCA/ICdtYXJnaW46IGF1dG87JyA6ICcnKX1cblx0fVxuYDtcclxuZXhwb3J0IGNvbnN0IEJ1dHRvbkN1c3RvbURhc2hlZEJvcmRlciA9ICgpID0+IHtcclxuICAgIHJldHVybiAoX2pzeHMoX0ZyYWdtZW50LCB7IGNoaWxkcmVuOiBbX2pzeChcImRpdlwiLCB7IGNsYXNzTmFtZTogXCJsaW5lLXRvcFwiIH0pLCBfanN4KFwiZGl2XCIsIHsgY2xhc3NOYW1lOiBcImxpbmUtbGVmdFwiIH0pLCBfanN4KFwiZGl2XCIsIHsgY2xhc3NOYW1lOiBcImxpbmUtYm90dG9tXCIgfSksIF9qc3goXCJkaXZcIiwgeyBjbGFzc05hbWU6IFwibGluZS1yaWdodFwiIH0pXSB9KSk7XHJcbn07XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPUJ1dHRvbi5zdHlsZWQuanMubWFwIl19 */"));exports.Button=H,exports.ButtonCustomDashedBorder=()=>c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"line-top"}),c.jsx("div",{className:"line-left"}),c.jsx("div",{className:"line-bottom"}),c.jsx("div",{className:"line-right"})]});
@@ -62,4 +62,5 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
62
62
  subtitle?: string;
63
63
  version?: '1.0' | '2.0';
64
64
  darkMode?: boolean;
65
+ activated?: boolean;
65
66
  }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("date-fns"),t=require("react"),o=require("./DateSelector/DateSelector.js"),s=require("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("../dropdown/ChipDropdown.js"),require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js");require("../../constants/Theme.js"),require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var i=require("../input/Input.js");require("../dropdown/MenuItem/MenuItem.js");var d=require("../../utils/DateUtils.js"),u=require("../../assets/icons/chevronDown.svg.js"),a=require("../../assets/icons/clock.svg.js"),l=require("./CustomDateTime.styled.js");const c=()=>{const e=[];for(let r=0;r<2;r++)for(let t=0;t<12;t++){let o;o=0===t?"12":t<10?`0${t}`:`${t}`;const s=`${o}:00 ${0===r?"AM":"PM"}`,n=`${o}:30 ${0===r?"AM":"PM"}`;e.push({label:s,value:s,selected:!1},{label:n,value:n,selected:!1})}return e};exports.CustomDateTime=p=>{const[m,j]=t.useState(p.time),[D,w]=t.useState(p.date);t.useEffect((()=>{p.setError(void 0);const e=d.default.convert12HourTimeTo24Hour(m),t=r.format(new Date,"HH:mm:ss");if(r.isToday(D)&&e<t)return void p.setError("Selected time should be later than current time");p.setError(void 0);const[o,s]=e.split(":"),n=new Date(D.getTime());n.setHours(+o,+s),p.onChange(n)}),[D,m]);return e.jsxs(l.CustomDateTimeStyle,{children:[e.jsxs("div",Object.assign({style:{display:"flex",gap:16}},{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(o.default,{customDate:D,setCustomDate:w,placement:p.placement,minDate:p.minDate})})),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(s.DropdownPopover,Object.assign({options:c(),onSelect:e=>{j(e.value)}},{children:e.jsx(i.Input,{value:m,leftIcon:{icon:a.default},rightIcon:{icon:u.default},onChangeText:e=>(e=>{if(d.default.timeFormatValidation(e)){const t=d.default.convert12HourTimeTo24Hour(e),o=r.format(new Date,"HH:mm:ss");if(r.isToday(D)&&t<o)return void p.setError("Selected time should be later than current time");p.setError(void 0),j(e)}else p.setError('Format of time should be "HH:MM AM" or "HH:MM PM"')})(e)})}))}))]})),p.error&&e.jsx(n.BodySecondary,Object.assign({style:{paddingTop:8}},{children:p.error}))]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("date-fns"),t=require("react"),o=require("./DateSelector/DateSelector.js"),s=require("../dropdown/DropdownPopover/index.js");require("../dropdown/Dropdown.js"),require("../dropdown/ChipDropdown.js"),require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js");require("../../constants/Theme.js"),require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js");var i=require("../input/Input.js");require("../dropdown/MenuItem/MenuItem.js");var d=require("../../utils/DateUtils.js"),u=require("../../assets/icons/chevronDown.svg.js"),a=require("../../assets/icons/clock.svg.js"),l=require("./CustomDateTime.styled.js");const c=e=>{const r=[];for(let t=0;t<2;t++)for(let o=0;o<12;o++){let s;s=0===o?"12":o<10?`0${o}`:`${o}`;const n=`${s}:00 ${0===t?"AM":"PM"}`,i=`${s}:30 ${0===t?"AM":"PM"}`;r.push({label:n,value:n,selected:n===e},{label:i,value:i,selected:i===e})}return r};exports.CustomDateTime=p=>{const[m,j]=t.useState(p.time),[D,w]=t.useState(p.date);t.useEffect((()=>{p.setError(void 0);const e=d.default.convert12HourTimeTo24Hour(m),t=r.format(new Date,"HH:mm:ss");if(r.isToday(D)&&e<t)return void p.setError("Selected time should be later than current time");p.setError(void 0);const[o,s]=e.split(":"),n=new Date(D.getTime());n.setHours(+o,+s),p.onChange(n)}),[D,m]);return e.jsxs(l.CustomDateTimeStyle,{children:[e.jsxs("div",Object.assign({style:{display:"flex",gap:16}},{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(o.default,{customDate:D,setCustomDate:w,placement:p.placement,minDate:p.minDate})})),e.jsx("div",Object.assign({style:{flex:1}},{children:e.jsx(s.DropdownPopover,Object.assign({options:c(m),onSelect:e=>{j(e.value)}},{children:e.jsx(i.Input,{value:m,leftIcon:{icon:a.default},rightIcon:{icon:u.default},onChangeText:e=>(e=>{if(d.default.timeFormatValidation(e)){const t=d.default.convert12HourTimeTo24Hour(e),o=r.format(new Date,"HH:mm:ss");if(r.isToday(D)&&t<o)return void p.setError("Selected time should be later than current time");p.setError(void 0),j(e)}else p.setError('Format of time should be "HH:MM AM" or "HH:MM PM"')})(e)})}))}))]})),p.error&&e.jsx(n.BodySecondary,Object.assign({style:{paddingTop:8}},{children:p.error}))]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react/jsx-runtime"),i=require("date-fns"),a=require("react"),s=require("../../custom-date-time/CustomDateTime.js"),r=require("../../input/Input.js"),o=require("../../radioButton/RadioButton.js"),n=require("../../TypographyStyle.js");exports.COUPON_EXPIRATION=void 0,(e=exports.COUPON_EXPIRATION||(exports.COUPON_EXPIRATION={})).FIXED_EXPIRATION="fixedExpiration",e.DYNAMIC_EXPIRATION="dynamicExpiration";exports.CouponExpiration=e=>{var I;const[O,d]=a.useState(e.discountData.expireAt?exports.COUPON_EXPIRATION.FIXED_EXPIRATION:e.discountData.expireAfter?exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION:void 0),[p,x]=a.useState(),[u,c]=a.useState(),A=(new Date).setDate((new Date).getDate()+1);a.useEffect((()=>{(null==O||p||u)&&e.setDiscountData(Object.assign(Object.assign({},e.discountData),{expireAfter:void 0,expireAt:void 0})),O&&(p||u)&&(O===exports.COUPON_EXPIRATION.FIXED_EXPIRATION?c(void 0):x(void 0))}),[O,p,u]);return t.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:13}},{children:[t.jsx(n.TitleRegular,{children:"Coupon expiration (optional)"}),t.jsxs("div",Object.assign({style:{display:"flex",gap:18}},{children:[t.jsx(o.RadioButton,{isActive:O===exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION,onValueChange:()=>{c(void 0),d(O===exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION?void 0:exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION)}}),t.jsx(n.BodySecondary,{children:"Validity days from coupon claim"})]})),O===exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION&&t.jsx(r.Input,{errorMessage:u,value:null===(I=e.discountData.expireAfter)||void 0===I?void 0:I.toString(),placeholder:"Enter the number of days",width:"400px",type:"number",onChangeText:t=>{(t=>{c(void 0);const i=Number.parseInt(t);i>0?e.setDiscountData(Object.assign(Object.assign({},e.discountData),{expireAfter:i,expireAt:void 0})):c("Please enter valid input")})(t)}}),t.jsxs("div",Object.assign({style:{display:"flex",gap:18}},{children:[t.jsx(o.RadioButton,{isActive:O===exports.COUPON_EXPIRATION.FIXED_EXPIRATION,onValueChange:()=>{d(O===exports.COUPON_EXPIRATION.FIXED_EXPIRATION?void 0:exports.COUPON_EXPIRATION.FIXED_EXPIRATION)}}),t.jsx(n.BodySecondary,{children:"Fixed expiry date"})]})),O===exports.COUPON_EXPIRATION.FIXED_EXPIRATION&&t.jsxs(t.Fragment,{children:[t.jsx(n.BodySecondary,{children:"Ending on"}),t.jsx(s.CustomDateTime,{placement:"bottom-start",time:e.discountData.expireAt?i.format(new Date(e.discountData.expireAt),"hh:mm a"):i.format(new Date(A),"hh:mm a"),date:e.discountData.expireAt?new Date(e.discountData.expireAt):new Date(A),error:p,setError:x,onChange:t=>{e.setDiscountData(Object.assign(Object.assign({},e.discountData),{expireAt:t,expireAfter:void 0}))},minDate:new Date(A)})]})]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react/jsx-runtime"),i=require("date-fns"),a=require("react"),r=require("../../custom-date-time/CustomDateTime.js"),s=require("../../input/Input.js"),o=require("../../radioButton/RadioButton.js"),n=require("../../TypographyStyle.js");exports.COUPON_EXPIRATION=void 0,(e=exports.COUPON_EXPIRATION||(exports.COUPON_EXPIRATION={})).FIXED_EXPIRATION="fixedExpiration",e.DYNAMIC_EXPIRATION="dynamicExpiration";exports.CouponExpiration=e=>{var I;const[O,d]=a.useState(e.discountData.expireAt?exports.COUPON_EXPIRATION.FIXED_EXPIRATION:e.discountData.expireAfter?exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION:void 0),[p,x]=a.useState(),[u,A]=a.useState(),c=(new Date).setDate((new Date).getDate()+1);a.useEffect((()=>{d(e.discountData.expireAt?exports.COUPON_EXPIRATION.FIXED_EXPIRATION:e.discountData.expireAfter?exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION:void 0)}),[e.discountData.expireAt,e.discountData.expireAfter]),a.useEffect((()=>{(null==O||p||u)&&e.setDiscountData(Object.assign(Object.assign({},e.discountData),{expireAfter:void 0,expireAt:void 0})),O&&(p||u)&&(O===exports.COUPON_EXPIRATION.FIXED_EXPIRATION?A(void 0):x(void 0))}),[O,p,u]);return t.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:13}},{children:[t.jsx(n.TitleRegular,{children:"Coupon expiration (optional)"}),t.jsxs("div",Object.assign({style:{display:"flex",gap:18}},{children:[t.jsx(o.RadioButton,{isActive:O===exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION,onValueChange:()=>{A(void 0),d(O===exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION?void 0:exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION)}}),t.jsx(n.BodySecondary,{children:"Validity days from coupon claim"})]})),O===exports.COUPON_EXPIRATION.DYNAMIC_EXPIRATION&&t.jsx(s.Input,{errorMessage:u,value:null===(I=e.discountData.expireAfter)||void 0===I?void 0:I.toString(),placeholder:"Enter the number of days",width:"400px",type:"number",onChangeText:t=>{(t=>{A(void 0);const i=Number.parseInt(t);i>0?e.setDiscountData(Object.assign(Object.assign({},e.discountData),{expireAfter:i,expireAt:void 0})):A("Please enter valid input")})(t)}}),t.jsxs("div",Object.assign({style:{display:"flex",gap:18}},{children:[t.jsx(o.RadioButton,{isActive:O===exports.COUPON_EXPIRATION.FIXED_EXPIRATION,onValueChange:()=>{d(O===exports.COUPON_EXPIRATION.FIXED_EXPIRATION?void 0:exports.COUPON_EXPIRATION.FIXED_EXPIRATION)}}),t.jsx(n.BodySecondary,{children:"Fixed expiry date"})]})),O===exports.COUPON_EXPIRATION.FIXED_EXPIRATION&&t.jsxs(t.Fragment,{children:[t.jsx(n.BodySecondary,{children:"Ending on"}),t.jsx(r.CustomDateTime,{placement:"bottom-start",time:e.discountData.expireAt?i.format(new Date(e.discountData.expireAt),"hh:mm a"):i.format(new Date(c),"hh:mm a"),date:e.discountData.expireAt?new Date(e.discountData.expireAt):new Date(c),error:p,setError:x,onChange:t=>{e.setDiscountData(Object.assign(Object.assign({},e.discountData),{expireAt:t,expireAfter:void 0}))},minDate:new Date(c)})]})]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("./type.js");require("../dropdown/DropdownPopover/index.js");var i=require("../dropdown/Dropdown.js");require("../dropdown/ChipDropdown.js"),require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js"),r=require("../../constants/Theme.js");require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../input/Input.js"),require("../dropdown/MenuItem/MenuItem.js");var s=require("../modals/styledModal.js"),d=require("../product-picker/ProductPickerModal.js"),c=require("../tag/Tag.js"),l=require("../tooltips/Tooltip.js"),a=require("../../assets/icons/triangle_error.svg.js"),u=require("../product-picker-v2/modal.js"),p=require("./DiscountModal.styled.js"),T=require("./DiscountUtils.js"),C=require("./DynamicCoupon/DynamicCoupon.js"),S=require("./StaticCoupon/StaticCoupon.js");exports.DiscountModal=E=>{var I,O,P,v,_,D,N,h,b,y;const[U,j]=t.useState(),[g,f]=t.useState(),[m,q]=t.useState(null!==(I=E.data)&&void 0!==I?I:"string"==typeof E.hideOption?{isStaticCoupon:"dynamic"===E.hideOption}:{isStaticCoupon:!1}),[A,R]=t.useState(!0),[x,k]=t.useState(),[w,F]=t.useState((null===(O=E.data)||void 0===O?void 0:O.minAmount)?o.MIN_PURCHASE_REQUIREMENT.AMOUNT:(null===(P=E.data)||void 0===P?void 0:P.minQuantity)?o.MIN_PURCHASE_REQUIREMENT.QUANTITY:o.MIN_PURCHASE_REQUIREMENT.NA),[M,L]=t.useState(void 0),[Y,G]=t.useState(void 0),[B,H]=t.useState(void 0),[V,X]=t.useState(void 0),[Q,z]=t.useState(0);t.useEffect((()=>{let e;const{tempCouponData:t,discountType:o}=K();k(o),q(Object.assign({},t)),E.hideProbability||(e=Z()),R(T.validateDiscountData(t,w,o,E.hideProbability||!1,e,!!t.isStaticCoupon)),E.hideProbability||Z()}),[]),t.useEffect((()=>{let e;E.hideProbability||(e=Z()),R(T.validateDiscountData(m,w,x,E.hideProbability||!1,e,!!m.isStaticCoupon))}),[m,Q,x,w]),t.useEffect((()=>{var e,t,o,i,n,r,s;if(!E.newPickerConf&&((null===(e=E.products)||void 0===e?void 0:e.length)||(null===(t=E.collection)||void 0===t?void 0:t.length))){if(E.products&&(null===(o=E.products)||void 0===o?void 0:o.length)){if(null===(i=E.data)||void 0===i?void 0:i.entitledProductIds){const e=E.products.filter((e=>{var t,o;return null===(o=null===(t=E.data)||void 0===t?void 0:t.entitledProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));G(e)}if(null===(n=E.data)||void 0===n?void 0:n.prerequisiteProductIds){const e=E.products.filter((e=>{var t,o;return null===(o=null===(t=E.data)||void 0===t?void 0:t.prerequisiteProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));L(e)}}if(E.collection&&E.collection.length){if(null===(r=E.data)||void 0===r?void 0:r.entitledCollectionIds){const e=E.collection.filter((e=>{var t,o;return null===(o=null===(t=E.data)||void 0===t?void 0:t.entitledCollectionIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));X(e)}if(null===(s=E.data)||void 0===s?void 0:s.prerequisiteCollectionIds){const e=E.collection.filter((e=>{var t,o;return null===(o=null===(t=E.data)||void 0===t?void 0:t.prerequisiteCollectionIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));H(e)}}}}),[E.products,E.collection]),t.useEffect((()=>{var e,t,o,i,n,r,s,d;(null===(t=null===(e=E.data)||void 0===e?void 0:e.productsConf)||void 0===t?void 0:t.entitledProducts)&&G(E.data.productsConf.entitledProducts),(null===(i=null===(o=E.data)||void 0===o?void 0:o.productsConf)||void 0===i?void 0:i.prerequisiteProducts)&&L(E.data.productsConf.prerequisiteProducts),(null===(r=null===(n=E.data)||void 0===n?void 0:n.collectionsConf)||void 0===r?void 0:r.entitledCollections)&&X(E.data.collectionsConf.entitledCollections),(null===(d=null===(s=E.data)||void 0===s?void 0:s.collectionsConf)||void 0===d?void 0:d.prerequisiteCollections)&&H(E.data.collectionsConf.prerequisiteCollections)}),[null===(v=E.data)||void 0===v?void 0:v.productsConf,null===(_=E.data)||void 0===_?void 0:_.collectionsConf]),t.useEffect((()=>{if(!Y)return;if(E.newPickerConf){const e=[];return Object.values(Y).forEach((t=>{t.products&&Object.keys(t.products).forEach((t=>{e.push(parseInt(t))}))})),void q(Object.assign(Object.assign({},m),{entitledProductIds:e}))}const e=Y.map((e=>parseInt(e.id)));q(Object.assign(Object.assign({},m),{entitledProductIds:e}))}),[Y]),t.useEffect((()=>{if(!M)return;if(E.newPickerConf){const e=[];return Object.values(M).forEach((t=>{t.products&&Object.keys(t.products).forEach((t=>{e.push(parseInt(t))}))})),void q(Object.assign(Object.assign({},m),{prerequisiteProductIds:e}))}const e=M.map((e=>parseInt(e.id)));q(Object.assign(Object.assign({},m),{prerequisiteProductIds:e}))}),[M]),t.useEffect((()=>{if(!V)return;if(E.newPickerConf){(null==V?void 0:V.isCustom)&&delete V.isCustom;const e=Object.keys(V).map((e=>parseInt(e)));return void q(Object.assign(Object.assign({},m),{entitledCollectionIds:e}))}const e=V.map((e=>parseInt(e.id)));q(Object.assign(Object.assign({},m),{entitledCollectionIds:e}))}),[V]),t.useEffect((()=>{if(!B)return;if(E.newPickerConf){(null==B?void 0:B.isCustom)&&delete B.isCustom;const e=Object.keys(B).map((e=>parseInt(e)));return void q(Object.assign(Object.assign({},m),{prerequisiteCollectionIds:e}))}const e=B.map((e=>parseInt(e.id)));q(Object.assign(Object.assign({},m),{prerequisiteCollectionIds:e}))}),[B]);const K=()=>{var e,t;let i,n=m;return m.isStaticCoupon||(m.targetType===o.DISCOUNT_TARGET_TYPES.SHIPPING_LINE?i=o.DISCOUNT_TYPES.FREE_SHIPPING:m.targetType===o.DISCOUNT_TARGET_TYPES.LINE_ITEM?i=m.targetSelection===o.DISCOUNT_TARGET_SELECTION.ENTITLED?(null===(e=m.prerequisiteProductIds)||void 0===e?void 0:e.length)||(null===(t=m.prerequisiteCollectionIds)||void 0===t?void 0:t.length)?o.DISCOUNT_TYPES.BUY_X_GET_Y:o.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS:o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER:(n=Object.assign(Object.assign({},n),{targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,valueType:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT}),i=o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER)),{discountType:i,tempCouponData:n}},$=[{value:o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:x===o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER},{value:o.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:x===o.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS},{value:o.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:x===o.DISCOUNT_TYPES.BUY_X_GET_Y},{value:o.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:x===o.DISCOUNT_TYPES.FREE_SHIPPING}],Z=()=>{if(!E.quadrant||!E.probability)return;const e=[...E.probability];let t=[];e.length>=E.quadrant&&e.splice(E.quadrant-1,1),t=e;const o=t.reduce(((e,t)=>e+t),0)+(m.probability||0);return z(parseFloat(o.toFixed(4))),parseFloat(o.toFixed(4))},J=e=>{var t,i,n,r;const s=e.value;k(s),L([]),G([]),H([]),X([]),F(o.MIN_PURCHASE_REQUIREMENT.NA),s===o.DISCOUNT_TYPES.FREE_SHIPPING?q({value:100,targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.SHIPPING_LINE,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE,quadrant:m.quadrant,isStaticCoupon:!1,title:""}):s===o.DISCOUNT_TYPES.BUY_X_GET_Y?q({targetSelection:o.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE,quadrant:m.quadrant,isStaticCoupon:!1,title:""}):s===o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER?q({targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:null!==(i=null===(t=E.data)||void 0===t?void 0:t.valueType)&&void 0!==i?i:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,quadrant:m.quadrant,isStaticCoupon:!1,title:""}):s===o.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS&&q({targetSelection:o.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:null!==(r=null===(n=E.data)||void 0===n?void 0:n.valueType)&&void 0!==r?r:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,quadrant:m.quadrant,isStaticCoupon:!1,title:""})};return e.jsxs(s.StyledModal,Object.assign({width:(g||U)&&E.newPickerConf?"25px":"750px",open:E.isOpen,headingTitle:U?"Select Products":E.title,headingSubtitle:U?void 0:E.subTitle,footerLeftCustomElement:E.errorMsg?E.errorMsg&&e.jsx(c.Tag,{theme:"light",tagText:E.errorMsg,type:"negative"}):!E.quadrant||E.hideProbability?e.jsx(e.Fragment,{}):Q<=1?e.jsx(c.Tag,{theme:"light",tagText:`Current probability sum: ${Q}`,type:"white"}):e.jsx(l.Tooltip,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e.jsx("div",{children:e.jsx(c.Tag,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${Q}`,type:"negative",LeadingIcon:a.default})})})),headerRightCustomElement:E.allowStaticCoupon||U?void 0:e.jsx(i.Dropdown,{options:$,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{J(e)}}),onClose:E.onClose,footerShadow:!0,primaryButton:U?{buttonType:"primary",onClick:()=>{j(void 0)},buttonText:"Add"}:g?{buttonType:"primary",onClick:()=>{f(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Add code",disabled:A,isLoading:null!==(D=E.loading)&&void 0!==D&&D,onClick:()=>{var e,t;m.isStaticCoupon?E.onSaveClicked({quadrant:m.quadrant,couponCode:m.couponCode,description:m.description,isStaticCoupon:m.isStaticCoupon,probability:m.probability,title:m.title}):E.onSaveClicked(Object.assign(Object.assign({},m),{description:T.descriptionBuilder(m,E.currency,null!==(e=E.products)&&void 0!==e?e:[],null!==(t=E.collection)&&void 0!==t?t:[]),productsConf:{entitledProducts:Y,prerequisiteProducts:M},collectionsConf:{entitledCollections:V,prerequisiteCollections:B}}))}},secondaryButton:U?{buttonType:"tertiaryGray",onClick:()=>{j(void 0)},buttonText:"Back"}:g?{buttonType:"tertiaryGray",onClick:()=>{f(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:E.onClose,buttonText:"Close"}},{children:[!U&&!g&&e.jsxs(p.StyledDiscountDialogueContainer,{children:[E.allowStaticCoupon&&!U&&e.jsxs(p.CouponTypeContainerStyled,Object.assign({selectedDiv:m.isStaticCoupon?1:2},{children:["static"===E.hideOption?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{m.isStaticCoupon||q({isStaticCoupon:!0,quadrant:m.quadrant})}},{children:[e.jsx(n.TitleSmall,Object.assign({style:m.isStaticCoupon?{color:r.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"Static code"})),e.jsx(n.BodyCaption,Object.assign({style:m.isStaticCoupon?{color:r.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"One static code for all customers"}))]})),"dynamic"===E.hideOption?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{m.isStaticCoupon&&(k(o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER),q({isStaticCoupon:!1,quadrant:m.quadrant,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,valueType:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT}))}},{children:[e.jsx(n.TitleSmall,Object.assign({style:m.isStaticCoupon?{}:{color:r.DEFAULT_THEME.colorsV2.content.brand}},{children:"Dynamic code"})),e.jsx(n.BodyCaption,Object.assign({style:m.isStaticCoupon?{}:{color:r.DEFAULT_THEME.colorsV2.content.brand}},{children:"New code generated for everyone"}))]}))]})),m.isStaticCoupon&&!U&&e.jsx(S.default,{discountData:m,setDiscountData:q,hideProbability:E.hideProbability||!1,discountAdminUrl:E.discountAdminUrl}),!m.isStaticCoupon&&!U&&!g&&e.jsx(C.default,{currency:E.currency,entitledProducts:null!=Y?Y:[],prerequisiteProducts:null!=M?M:[],setEntitledProducts:G,setPrerequisiteProducts:L,discountData:m,productPickerOpen:U,setIsProductPickerOpen:j,setDiscountData:q,selectedCouponType:x,setSelectedCouponType:k,selectedMinimumRequirement:w,setSelectedMinimumRequirement:F,hideProbability:E.hideProbability||!1,hideExpiration:E.hideExpiration||!1,allowStaticCoupon:E.allowStaticCoupon,onChangeCouponType:J,collectionPickerOpen:g,entitledCollections:null!=V?V:[],prerequisiteCollections:null!=B?B:[],setIsCollectionPickerOpen:f,setEntitledCollections:X,setPrerequisiteCollections:H,useNewPicker:!!E.newPickerConf})]}),!!U&&e.jsxs(e.Fragment,{children:[!E.newPickerConf&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsx(d.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(N=E.products)&&void 0!==N?N:[],title:"Select Products",onClose:()=>{j(void 0)},selectedProducts:null!==(h=U===C.DISCOUNT_PRODUCTS.ENTITLED?Y:M)&&void 0!==h?h:[],setSelectedProducts:U===C.DISCOUNT_PRODUCTS.ENTITLED?G:L,onSearchKeyChange:E.onProductSearch})})),E.newPickerConf&&e.jsx(u.ProductPickerModal,{visible:!0,onClose:()=>j(void 0),collectionFetcher:E.newPickerConf.fetchCollections,productFetcher:E.newPickerConf.fetchProducts,selectedItems:U===C.DISCOUNT_PRODUCTS.ENTITLED?Y:M,onAdd:e=>{U===C.DISCOUNT_PRODUCTS.ENTITLED?G(e):L(e),j(void 0)},zIndex:200,storeId:E.newPickerConf.storeId,searchInCollectionFetcher:E.newPickerConf.searchInCollection,customCollectionRestriction:!1,searchFetcher:E.newPickerConf.searchProducts,hideCollectionCheckbox:!0,hideVariantCheckbox:!0,selectProductsFromCustomCollection:!0,hideSelectionCount:!0})]}),!!g&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsxs(e.Fragment,{children:[E.newPickerConf&&e.jsx(u.ProductPickerModal,{visible:!0,onClose:()=>f(void 0),collectionFetcher:E.newPickerConf.fetchCollections,productFetcher:E.newPickerConf.fetchProducts,selectedItems:g===C.DISCOUNT_PRODUCTS.ENTITLED?V:B,onAdd:e=>{Object.values(e).forEach((e=>{e.products&&delete e.products})),g===C.DISCOUNT_PRODUCTS.ENTITLED?X(e):H(e),f(void 0)},customCollectionRestriction:!1,zIndex:200,storeId:E.newPickerConf.storeId,searchInCollectionFetcher:E.newPickerConf.searchInCollection,searchFetcher:E.newPickerConf.searchProducts,hideProductCheckbox:!0,hideVariantCheckbox:!0,title:"Select Collections",hideGlobalSearch:!0,hideSelectionCount:!0}),!E.newPickerConf&&e.jsx(d.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(b=E.collection)&&void 0!==b?b:[],title:"Select Products",onClose:()=>{f(void 0)},selectedProducts:null!==(y=g===C.DISCOUNT_PRODUCTS.ENTITLED?V:B)&&void 0!==y?y:[],setSelectedProducts:g===C.DISCOUNT_PRODUCTS.ENTITLED?X:H,onSearchKeyChange:E.onCollectionSearch,searchPlaceholder:"Search collections..."})]})}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("./type.js");require("../dropdown/DropdownPopover/index.js");var i=require("../dropdown/Dropdown.js");require("../dropdown/ChipDropdown.js"),require("../zeroState/ZeroState.js");var n=require("../TypographyStyle.js"),r=require("../../constants/Theme.js");require("../dropdown/OpenedDropdown/components/description/Description.styled.js"),require("../checkBox/CheckBox.styled.js"),require("../list-item/ListItem.js"),require("../dropdown/OpenedDropdown/components/menu/FreeFormMenu.styled.js"),require("../dropdown/OpenedDropdown/components/menu/MenuItem.js"),require("../dropdown/OpenedDropdown/components/menu/MenuList.styled.js"),require("../button/Button.js"),require("../dropdown/OpenedDropdown/components/multiSelect/MultiSelectDropdownBottomBar.styled.js"),require("../dropdown/OpenedDropdown/components/OpennedDropdown.styled.js"),require("../input/Input.js"),require("../dropdown/MenuItem/MenuItem.js");var s=require("../modals/styledModal.js"),d=require("../product-picker/ProductPickerModal.js"),c=require("../tag/Tag.js"),l=require("../tooltips/Tooltip.js"),a=require("../../assets/icons/triangle_error.svg.js"),u=require("../product-picker-v2/modal.js"),p=require("./DiscountModal.styled.js"),T=require("./DiscountUtils.js"),C=require("./DynamicCoupon/DynamicCoupon.js"),S=require("./StaticCoupon/StaticCoupon.js");exports.DiscountModal=E=>{var v,I,O,P,_,D,N,h,b,y;const[U,j]=t.useState(),[f,g]=t.useState(),[m,A]=t.useState(null!==(v=E.data)&&void 0!==v?v:"string"==typeof E.hideOption?{isStaticCoupon:"dynamic"===E.hideOption}:{isStaticCoupon:!1}),[q,x]=t.useState(!0),[R,k]=t.useState(),[w,F]=t.useState((null===(I=E.data)||void 0===I?void 0:I.minAmount)?o.MIN_PURCHASE_REQUIREMENT.AMOUNT:(null===(O=E.data)||void 0===O?void 0:O.minQuantity)?o.MIN_PURCHASE_REQUIREMENT.QUANTITY:o.MIN_PURCHASE_REQUIREMENT.NA),[M,L]=t.useState(void 0),[Y,G]=t.useState(void 0),[B,H]=t.useState(void 0),[V,X]=t.useState(void 0),[Q,z]=t.useState(0);t.useEffect((()=>{let e;const{tempCouponData:t,discountType:o}=K();k(o),A(Object.assign({},t)),E.hideProbability||(e=Z()),x(T.validateDiscountData(t,w,o,E.hideProbability||!1,e,!!t.isStaticCoupon)),E.hideProbability||Z()}),[]),t.useEffect((()=>{let e;E.hideProbability||(e=Z()),x(T.validateDiscountData(m,w,R,E.hideProbability||!1,e,!!m.isStaticCoupon))}),[m,Q,R,w]),t.useEffect((()=>{var e,t,o,i,n,r,s;if(!E.newPickerConf&&((null===(e=E.products)||void 0===e?void 0:e.length)||(null===(t=E.collection)||void 0===t?void 0:t.length))){if(E.products&&(null===(o=E.products)||void 0===o?void 0:o.length)){if(null===(i=E.data)||void 0===i?void 0:i.entitledProductIds){const e=E.products.filter((e=>{var t,o;return null===(o=null===(t=E.data)||void 0===t?void 0:t.entitledProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));G(e)}if(null===(n=E.data)||void 0===n?void 0:n.prerequisiteProductIds){const e=E.products.filter((e=>{var t,o;return null===(o=null===(t=E.data)||void 0===t?void 0:t.prerequisiteProductIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));L(e)}}if(E.collection&&E.collection.length){if(null===(r=E.data)||void 0===r?void 0:r.entitledCollectionIds){const e=E.collection.filter((e=>{var t,o;return null===(o=null===(t=E.data)||void 0===t?void 0:t.entitledCollectionIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));X(e)}if(null===(s=E.data)||void 0===s?void 0:s.prerequisiteCollectionIds){const e=E.collection.filter((e=>{var t,o;return null===(o=null===(t=E.data)||void 0===t?void 0:t.prerequisiteCollectionIds)||void 0===o?void 0:o.includes(parseInt(e.id))}));H(e)}}}}),[E.products,E.collection]),t.useEffect((()=>{var e,t,o,i,n,r,s,d;(null===(t=null===(e=E.data)||void 0===e?void 0:e.productsConf)||void 0===t?void 0:t.entitledProducts)&&G(E.data.productsConf.entitledProducts),(null===(i=null===(o=E.data)||void 0===o?void 0:o.productsConf)||void 0===i?void 0:i.prerequisiteProducts)&&L(E.data.productsConf.prerequisiteProducts),(null===(r=null===(n=E.data)||void 0===n?void 0:n.collectionsConf)||void 0===r?void 0:r.entitledCollections)&&X(E.data.collectionsConf.entitledCollections),(null===(d=null===(s=E.data)||void 0===s?void 0:s.collectionsConf)||void 0===d?void 0:d.prerequisiteCollections)&&H(E.data.collectionsConf.prerequisiteCollections)}),[null===(P=E.data)||void 0===P?void 0:P.productsConf,null===(_=E.data)||void 0===_?void 0:_.collectionsConf]),t.useEffect((()=>{if(!Y)return;if(E.newPickerConf){const e=[];return Object.values(Y).forEach((t=>{t.products&&Object.keys(t.products).forEach((t=>{e.push(parseInt(t))}))})),void A(Object.assign(Object.assign({},m),{entitledProductIds:e}))}const e=Y.map((e=>parseInt(e.id)));A(Object.assign(Object.assign({},m),{entitledProductIds:e}))}),[Y]),t.useEffect((()=>{if(!M)return;if(E.newPickerConf){const e=[];return Object.values(M).forEach((t=>{t.products&&Object.keys(t.products).forEach((t=>{e.push(parseInt(t))}))})),void A(Object.assign(Object.assign({},m),{prerequisiteProductIds:e}))}const e=M.map((e=>parseInt(e.id)));A(Object.assign(Object.assign({},m),{prerequisiteProductIds:e}))}),[M]),t.useEffect((()=>{if(!V)return;if(E.newPickerConf){(null==V?void 0:V.isCustom)&&delete V.isCustom;const e=Object.keys(V).map((e=>parseInt(e)));return void A(Object.assign(Object.assign({},m),{entitledCollectionIds:e}))}const e=V.map((e=>parseInt(e.id)));A(Object.assign(Object.assign({},m),{entitledCollectionIds:e}))}),[V]),t.useEffect((()=>{if(!B)return;if(E.newPickerConf){(null==B?void 0:B.isCustom)&&delete B.isCustom;const e=Object.keys(B).map((e=>parseInt(e)));return void A(Object.assign(Object.assign({},m),{prerequisiteCollectionIds:e}))}const e=B.map((e=>parseInt(e.id)));A(Object.assign(Object.assign({},m),{prerequisiteCollectionIds:e}))}),[B]);const K=()=>{var e,t;let i,n=m;return m.isStaticCoupon||(m.targetType===o.DISCOUNT_TARGET_TYPES.SHIPPING_LINE?i=o.DISCOUNT_TYPES.FREE_SHIPPING:m.targetType===o.DISCOUNT_TARGET_TYPES.LINE_ITEM?i=m.targetSelection===o.DISCOUNT_TARGET_SELECTION.ENTITLED?(null===(e=m.prerequisiteProductIds)||void 0===e?void 0:e.length)||(null===(t=m.prerequisiteCollectionIds)||void 0===t?void 0:t.length)?o.DISCOUNT_TYPES.BUY_X_GET_Y:o.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS:o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER:(n=Object.assign(Object.assign({},n),{targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,valueType:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT}),i=o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER)),{discountType:i,tempCouponData:n}},$=[{value:o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER,label:"Amount off on order",selected:R===o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER},{value:o.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS,label:"Amount off on products",selected:R===o.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS},{value:o.DISCOUNT_TYPES.BUY_X_GET_Y,label:"Buy X Get Y FREE",selected:R===o.DISCOUNT_TYPES.BUY_X_GET_Y},{value:o.DISCOUNT_TYPES.FREE_SHIPPING,label:"Free shipping",selected:R===o.DISCOUNT_TYPES.FREE_SHIPPING}],Z=()=>{if(!E.quadrant||!E.probability)return;const e=[...E.probability];let t=[];e.length>=E.quadrant&&e.splice(E.quadrant-1,1),t=e;const o=t.reduce(((e,t)=>e+t),0)+(m.probability||0);return z(parseFloat(o.toFixed(4))),parseFloat(o.toFixed(4))},J=e=>{var t,i,n,r;const s=e.value;k(s),L([]),G([]),H([]),X([]),F(o.MIN_PURCHASE_REQUIREMENT.NA),s===o.DISCOUNT_TYPES.FREE_SHIPPING?A({value:100,targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.SHIPPING_LINE,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE,quadrant:m.quadrant,isStaticCoupon:!1,title:"",expireAt:void 0,expireAfter:void 0}):s===o.DISCOUNT_TYPES.BUY_X_GET_Y?A({targetSelection:o.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:o.DISCOUNT_VALUE_TYPES.PERCENTAGE,quadrant:m.quadrant,isStaticCoupon:!1,title:"",expireAt:void 0,expireAfter:void 0}):s===o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER?A({targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:null!==(i=null===(t=E.data)||void 0===t?void 0:t.valueType)&&void 0!==i?i:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,quadrant:m.quadrant,isStaticCoupon:!1,title:"",expireAt:void 0,expireAfter:void 0}):s===o.DISCOUNT_TYPES.AMOUNT_OFF_PRODUCTS&&A({targetSelection:o.DISCOUNT_TARGET_SELECTION.ENTITLED,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,valueType:null!==(r=null===(n=E.data)||void 0===n?void 0:n.valueType)&&void 0!==r?r:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT,quadrant:m.quadrant,isStaticCoupon:!1,title:"",expireAt:void 0,expireAfter:void 0})};return e.jsxs(s.StyledModal,Object.assign({width:(f||U)&&E.newPickerConf?"25px":"750px",open:E.isOpen,headingTitle:U?"Select Products":E.title,headingSubtitle:U?void 0:E.subTitle,footerLeftCustomElement:E.errorMsg?E.errorMsg&&e.jsx(c.Tag,{theme:"light",tagText:E.errorMsg,type:"negative"}):!E.quadrant||E.hideProbability?e.jsx(e.Fragment,{}):Q<=1?e.jsx(c.Tag,{theme:"light",tagText:`Current probability sum: ${Q}`,type:"white"}):e.jsx(l.Tooltip,Object.assign({body:"Probability sum should not exceed 1",placement:"top"},{children:e.jsx("div",{children:e.jsx(c.Tag,{style:{cursor:"pointer"},theme:"light",tagText:`Current probability sum: ${Q}`,type:"negative",LeadingIcon:a.default})})})),headerRightCustomElement:E.allowStaticCoupon||U?void 0:e.jsx(i.Dropdown,{options:$,width:"200px",placement:"bottom-start",size:"small",onSelect:e=>{J(e)}}),onClose:E.onClose,footerShadow:!0,primaryButton:U?{buttonType:"primary",onClick:()=>{j(void 0)},buttonText:"Add"}:f?{buttonType:"primary",onClick:()=>{g(void 0)},buttonText:"Add"}:{buttonType:"primary",buttonText:"Add code",disabled:q,isLoading:null!==(D=E.loading)&&void 0!==D&&D,onClick:()=>{var e,t;m.isStaticCoupon?E.onSaveClicked({quadrant:m.quadrant,couponCode:m.couponCode,description:m.description,isStaticCoupon:m.isStaticCoupon,probability:m.probability,title:m.title}):E.onSaveClicked(Object.assign(Object.assign({},m),{description:T.descriptionBuilder(m,E.currency,null!==(e=E.products)&&void 0!==e?e:[],null!==(t=E.collection)&&void 0!==t?t:[]),productsConf:{entitledProducts:Y,prerequisiteProducts:M},collectionsConf:{entitledCollections:V,prerequisiteCollections:B}}))}},secondaryButton:U?{buttonType:"tertiaryGray",onClick:()=>{j(void 0)},buttonText:"Back"}:f?{buttonType:"tertiaryGray",onClick:()=>{g(void 0)},buttonText:"Back"}:{buttonType:"tertiaryGray",onClick:E.onClose,buttonText:"Close"}},{children:[!U&&!f&&e.jsxs(p.StyledDiscountDialogueContainer,{children:[E.allowStaticCoupon&&!U&&e.jsxs(p.CouponTypeContainerStyled,Object.assign({selectedDiv:m.isStaticCoupon?1:2},{children:["static"===E.hideOption?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{m.isStaticCoupon||A({isStaticCoupon:!0,quadrant:m.quadrant})}},{children:[e.jsx(n.TitleSmall,Object.assign({style:m.isStaticCoupon?{color:r.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"Static code"})),e.jsx(n.BodyCaption,Object.assign({style:m.isStaticCoupon?{color:r.DEFAULT_THEME.colorsV2.content.brand}:{}},{children:"One static code for all customers"}))]})),"dynamic"===E.hideOption?e.jsx(e.Fragment,{}):e.jsxs("div",Object.assign({className:"coupon-type__container",onClick:()=>{m.isStaticCoupon&&(k(o.DISCOUNT_TYPES.AMOUNT_OFF_ORDER),A({isStaticCoupon:!1,quadrant:m.quadrant,targetType:o.DISCOUNT_TARGET_TYPES.LINE_ITEM,targetSelection:o.DISCOUNT_TARGET_SELECTION.ALL,valueType:o.DISCOUNT_VALUE_TYPES.FIXED_AMOUNT}))}},{children:[e.jsx(n.TitleSmall,Object.assign({style:m.isStaticCoupon?{}:{color:r.DEFAULT_THEME.colorsV2.content.brand}},{children:"Dynamic code"})),e.jsx(n.BodyCaption,Object.assign({style:m.isStaticCoupon?{}:{color:r.DEFAULT_THEME.colorsV2.content.brand}},{children:"New code generated for everyone"}))]}))]})),m.isStaticCoupon&&!U&&e.jsx(S.default,{discountData:m,setDiscountData:A,hideProbability:E.hideProbability||!1,discountAdminUrl:E.discountAdminUrl}),!m.isStaticCoupon&&!U&&!f&&e.jsx(C.default,{currency:E.currency,entitledProducts:null!=Y?Y:[],prerequisiteProducts:null!=M?M:[],setEntitledProducts:G,setPrerequisiteProducts:L,discountData:m,productPickerOpen:U,setIsProductPickerOpen:j,setDiscountData:A,selectedCouponType:R,setSelectedCouponType:k,selectedMinimumRequirement:w,setSelectedMinimumRequirement:F,hideProbability:E.hideProbability||!1,hideExpiration:E.hideExpiration||!1,allowStaticCoupon:E.allowStaticCoupon,onChangeCouponType:J,collectionPickerOpen:f,entitledCollections:null!=V?V:[],prerequisiteCollections:null!=B?B:[],setIsCollectionPickerOpen:g,setEntitledCollections:X,setPrerequisiteCollections:H,useNewPicker:!!E.newPickerConf})]}),!!U&&e.jsxs(e.Fragment,{children:[!E.newPickerConf&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsx(d.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(N=E.products)&&void 0!==N?N:[],title:"Select Products",onClose:()=>{j(void 0)},selectedProducts:null!==(h=U===C.DISCOUNT_PRODUCTS.ENTITLED?Y:M)&&void 0!==h?h:[],setSelectedProducts:U===C.DISCOUNT_PRODUCTS.ENTITLED?G:L,onSearchKeyChange:E.onProductSearch})})),E.newPickerConf&&e.jsx(u.ProductPickerModal,{visible:!0,onClose:()=>j(void 0),collectionFetcher:E.newPickerConf.fetchCollections,productFetcher:E.newPickerConf.fetchProducts,selectedItems:U===C.DISCOUNT_PRODUCTS.ENTITLED?Y:M,onAdd:e=>{U===C.DISCOUNT_PRODUCTS.ENTITLED?G(e):L(e),j(void 0)},zIndex:200,storeId:E.newPickerConf.storeId,searchInCollectionFetcher:E.newPickerConf.searchInCollection,customCollectionRestriction:!1,searchFetcher:E.newPickerConf.searchProducts,hideCollectionCheckbox:!0,hideVariantCheckbox:!0,selectProductsFromCustomCollection:!0,hideSelectionCount:!0})]}),!!f&&e.jsx("div",Object.assign({style:{padding:"12px 0"}},{children:e.jsxs(e.Fragment,{children:[E.newPickerConf&&e.jsx(u.ProductPickerModal,{visible:!0,onClose:()=>g(void 0),collectionFetcher:E.newPickerConf.fetchCollections,productFetcher:E.newPickerConf.fetchProducts,selectedItems:f===C.DISCOUNT_PRODUCTS.ENTITLED?V:B,onAdd:e=>{Object.values(e).forEach((e=>{e.products&&delete e.products})),f===C.DISCOUNT_PRODUCTS.ENTITLED?X(e):H(e),g(void 0)},customCollectionRestriction:!1,zIndex:200,storeId:E.newPickerConf.storeId,searchInCollectionFetcher:E.newPickerConf.searchInCollection,searchFetcher:E.newPickerConf.searchProducts,hideProductCheckbox:!0,hideVariantCheckbox:!0,title:"Select Collections",hideGlobalSearch:!0,hideSelectionCount:!0}),!E.newPickerConf&&e.jsx(d.ProductPickerContent,{show:!0,onSave:()=>{},products:null!==(b=E.collection)&&void 0!==b?b:[],title:"Select Products",onClose:()=>{g(void 0)},selectedProducts:null!==(y=f===C.DISCOUNT_PRODUCTS.ENTITLED?V:B)&&void 0!==y?y:[],setSelectedProducts:f===C.DISCOUNT_PRODUCTS.ENTITLED?X:H,onSearchKeyChange:E.onCollectionSearch,searchPlaceholder:"Search collections..."})]})}))]}))};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../button/Button.js"),i=require("./Input-helper.js"),r=require("../TypographyStyle.js"),s=require("../../assets/icons/errorInfo.svg.js"),l=require("./context/InputStyleProvider.js"),o=require("./Input.styled.js");const a=t.forwardRef(((a,u)=>{var c,d,v,h,p;const{placeholder:f,leftIcon:x,rightIcon:g,labelText:j,maxCharLimit:y,isRequired:b,hintText:I,type:C,state:m,validate:w,variant:E,button:S,suffixText:O,prefixText:k,onChangeText:q,value:F,noErrorHint:H,reset:L,rangeValidation:M,noKeyDownChange:T,version:B,noMaxCharCheck:D}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},a),R=null==x?void 0:x.icon,A=null==g?void 0:g.icon,[z,K]=t.useState(!1),[P,W]=t.useState(!1),[_,N]=t.useState(),V="small"===E?"18px":"22px",G=t.useContext(l.InputStyleContext),[J,Q]=t.useState(),U=t.useRef(null),X=null!=u?u:U;t.useEffect((()=>{Q(F)}),[F]),t.useEffect((()=>{var e;X.current&&(null===(e=a.onReferenceInit)||void 0===e||e.call(a,X.current))}),[X]),t.useEffect((()=>{const e=X.current;if(e)return e.addEventListener("wheel",ee,{passive:!1}),()=>{e.removeEventListener("wheel",ee)}}),[]),t.useEffect((()=>{L&&Q("")}),[L]),t.useEffect((()=>{var e;W(!!a.isActive),a.isActive&&(null===(e=X.current)||void 0===e||e.focus())}),[a.isActive]),t.useEffect((()=>{N(a.errorMessage)}),[a.errorMessage]),t.useEffect((()=>{var e;K(!1),("invalid"===a.state||_)&&K(!0),"active"===a.state&&(null===(e=X.current)||void 0===e||e.focus())}),[a.state,_]),t.useEffect((()=>{K(!!_)}),[_]);const Y=function(e){if(i.isFunction(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e(...n)}},Z=()=>"zip"===C?6:60,$=e=>{const t=y||Z();if(T||q(F||"",e),D)return;const n=e.target.value;![8].includes(e.which)&&t>0&&n.length>=t&&e.preventDefault()},ee=e=>{e.preventDefault()},te=e=>{const t=e.target.value,n=y||Z();if(!D&&n>0&&t.length>=n)return void e.preventDefault();q(t,e),a.textControl||Q(t);const r=w||i.validateInput;if(!r||!i.isFunction(r))return;const[s,l]=r(t,C,M);K(!s),N(a.errorMessage?a.errorMessage:l)},ne=e=>{var t;a.skipFocus||W(!0),Y(null===(t=a.onFocus)||void 0===t?void 0:t.call(a,e))},ie=e=>{var t;a.skipFocus||W(!1),Y(null===(t=a.onBlur)||void 0===t?void 0:t.call(a,e))},re=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==C&&e.jsx("input",{id:a.id,style:null!==(t=null==G?void 0:G.input)&&void 0!==t?t:{},ref:X,type:["phonenumber","zip","number"].includes(C)?"number":C,value:J,onFocus:e=>ne(e),onBlur:e=>ie(e),placeholder:f||"Enter here",onChange:te,onKeyDown:e=>$(e)}),"multiline"===C&&e.jsx("textarea",{value:J,ref:X,onFocus:e=>ne(e),onBlur:e=>ie(e),placeholder:f||"Enter here",onChange:te,onKeyDown:e=>$(e),maxLength:y>0?y:void 0})]})};return e.jsxs(o.RootContainer,Object.assign({width:a.width,height:a.height,state:m,type:C,style:null!==(c=null==G?void 0:G.RootContainer)&&void 0!==c?c:{}},{children:[!H&&(!!I||!!_)&&e.jsxs(o.InputFooter,Object.assign({invalid:!!_},{children:[!!_&&e.jsx(s.default,{width:16,height:16}),_||I]})),e.jsxs(o.InputWrapper,Object.assign({variant:E,state:m,width:a.width,isActive:"active"===m||P,isInvalid:z,style:null!==(d=null==G?void 0:G.InputWrapper)&&void 0!==d?d:{},version:B,height:a.height},{children:[!!R&&e.jsx(o.IconHolder,Object.assign({variant:E,iconSize:V,onClick:()=>Y(null==x?void 0:x.callback),isLeft:!0,style:null!==(v=null==G?void 0:G.IconHolder)&&void 0!==v?v:{}},{children:e.jsx(R,{})})),!!k&&e.jsx(o.PrefixHolder,Object.assign({variant:E},{children:k})),"default"===E&&e.jsx(o.InputContainer,Object.assign({height:a.height,type:a.type},{children:re()})),"small"===E&&e.jsx(o.InputContainerSmall,Object.assign({height:a.height,type:a.type},{children:re()})),!!A&&e.jsx(o.IconHolder,Object.assign({variant:E,iconSize:V,onClick:()=>Y(null==g?void 0:g.callback),isLeft:!1},{children:e.jsx(A,{})})),!!O&&e.jsx(o.SuffixHolder,Object.assign({variant:E},{children:O})),S&&S.text&&e.jsx(n.Button,{buttonText:S.text,onClick:()=>Y(null==S?void 0:S.onClick)})]})),(!!j||!!y)&&e.jsxs(o.InputHeader,Object.assign({invalid:z},{children:[e.jsxs(r.BodySecondary,{children:[j,b?e.jsx("span",{children:"*"}):""]}),y>0&&e.jsxs(o.MaxCharStyle,{children:[null!==(p=null===(h=a.value)||void 0===h?void 0:h.length)&&void 0!==p?p:0,"/",y]})]}))]}))}));a.displayName="Input",exports.Input=a;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../button/Button.js"),i=require("./Input-helper.js"),r=require("../TypographyStyle.js"),s=require("../../assets/icons/errorInfo.svg.js"),l=require("./context/InputStyleProvider.js"),o=require("./Input.styled.js");const a=t.forwardRef(((a,u)=>{var c,d,v,h,p;const{placeholder:f,leftIcon:x,rightIcon:g,labelText:j,maxCharLimit:y,isRequired:b,hintText:I,type:C,state:m,validate:w,variant:E,button:S,suffixText:O,prefixText:k,onChangeText:q,value:F,noErrorHint:H,reset:L,rangeValidation:M,noKeyDownChange:T,version:B,noMaxCharCheck:D}=Object.assign({maxCharLimit:0,type:"text",variant:"default"},a),R=null==x?void 0:x.icon,A=null==g?void 0:g.icon,[z,K]=t.useState(!1),[P,W]=t.useState(!1),[_,N]=t.useState(),V="small"===E?"18px":"22px",G=t.useContext(l.InputStyleContext),[J,Q]=t.useState(),U=t.useRef(null),X=null!=u?u:U;t.useEffect((()=>{Q(F)}),[F]),t.useEffect((()=>{var e;X.current&&(null===(e=a.onReferenceInit)||void 0===e||e.call(a,X.current))}),[X]),t.useEffect((()=>{const e=X.current;if(e)return e.addEventListener("wheel",ee,{passive:!1}),()=>{e.removeEventListener("wheel",ee)}}),[]),t.useEffect((()=>{L&&Q("")}),[L]),t.useEffect((()=>{var e;W(!!a.isActive),a.isActive&&(null===(e=X.current)||void 0===e||e.focus())}),[a.isActive]),t.useEffect((()=>{N(a.errorMessage)}),[a.errorMessage]),t.useEffect((()=>{var e;K(!1),("invalid"===a.state||_)&&K(!0),"active"===a.state&&(null===(e=X.current)||void 0===e||e.focus())}),[a.state,_]),t.useEffect((()=>{K(!!_)}),[_]);const Y=function(e){if(i.isFunction(e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e(...n)}},Z=()=>"zip"===C?6:60,$=e=>{const t=0!==y?y:Z();if(T||q(F||"",e),D)return;const n=e.target.value;![8].includes(e.which)&&t>0&&n.length>=t&&e.preventDefault()},ee=e=>{e.preventDefault()},te=e=>{const t=e.target.value,n=0!==y?y+1:Z();if(!D&&n>0&&t.length>=n)return void e.preventDefault();q(t,e),a.textControl||Q(t);const r=w||i.validateInput;if(!r||!i.isFunction(r))return;const[s,l]=r(t,C,M);K(!s),N(a.errorMessage?a.errorMessage:l)},ne=e=>{var t;a.skipFocus||W(!0),Y(null===(t=a.onFocus)||void 0===t?void 0:t.call(a,e))},ie=e=>{var t;a.skipFocus||W(!1),Y(null===(t=a.onBlur)||void 0===t?void 0:t.call(a,e))},re=()=>{var t;return e.jsxs(e.Fragment,{children:["multiline"!==C&&e.jsx("input",{id:a.id,style:null!==(t=null==G?void 0:G.input)&&void 0!==t?t:{},ref:X,type:["phonenumber","zip","number"].includes(C)?"number":C,value:J,onFocus:e=>ne(e),onBlur:e=>ie(e),placeholder:f||"Enter here",onChange:te,onKeyDown:e=>$(e)}),"multiline"===C&&e.jsx("textarea",{value:J,ref:X,onFocus:e=>ne(e),onBlur:e=>ie(e),placeholder:f||"Enter here",onChange:te,onKeyDown:e=>$(e),maxLength:y>0?y:void 0})]})};return e.jsxs(o.RootContainer,Object.assign({width:a.width,height:a.height,state:m,type:C,style:null!==(c=null==G?void 0:G.RootContainer)&&void 0!==c?c:{}},{children:[!H&&(!!I||!!_)&&e.jsxs(o.InputFooter,Object.assign({invalid:!!_},{children:[!!_&&e.jsx(s.default,{width:16,height:16}),_||I]})),e.jsxs(o.InputWrapper,Object.assign({variant:E,state:m,width:a.width,isActive:"active"===m||P,isInvalid:z,style:null!==(d=null==G?void 0:G.InputWrapper)&&void 0!==d?d:{},version:B,height:a.height},{children:[!!R&&e.jsx(o.IconHolder,Object.assign({variant:E,iconSize:V,onClick:()=>Y(null==x?void 0:x.callback),isLeft:!0,style:null!==(v=null==G?void 0:G.IconHolder)&&void 0!==v?v:{}},{children:e.jsx(R,{})})),!!k&&e.jsx(o.PrefixHolder,Object.assign({variant:E},{children:k})),"default"===E&&e.jsx(o.InputContainer,Object.assign({height:a.height,type:a.type},{children:re()})),"small"===E&&e.jsx(o.InputContainerSmall,Object.assign({height:a.height,type:a.type},{children:re()})),!!A&&e.jsx(o.IconHolder,Object.assign({variant:E,iconSize:V,onClick:()=>Y(null==g?void 0:g.callback),isLeft:!1},{children:e.jsx(A,{})})),!!O&&e.jsx(o.SuffixHolder,Object.assign({variant:E},{children:O})),S&&S.text&&e.jsx(n.Button,{buttonText:S.text,onClick:()=>Y(null==S?void 0:S.onClick)})]})),(!!j||!!y)&&e.jsxs(o.InputHeader,Object.assign({invalid:z},{children:[e.jsxs(r.BodySecondary,{children:[j,b?e.jsx("span",{children:"*"}):""]}),y>0&&e.jsxs(o.MaxCharStyle,{children:[null!==(p=null===(h=a.value)||void 0===h?void 0:h.length)&&void 0!==p?p:0,"/",y]})]}))]}))}));a.displayName="Input",exports.Input=a;
@@ -15,6 +15,7 @@ interface InputWithVariablesProps {
15
15
  showAddButton?: boolean;
16
16
  errorMessage?: string;
17
17
  showSideModal?: boolean;
18
+ noMaxCharCheck?: boolean;
18
19
  }
19
20
  export declare const InputWithVariables: React.FC<InputWithVariablesProps>;
20
21
  export {};
@@ -3,4 +3,4 @@
3
3
  input {
4
4
  color: ${e=>e.isVar?t.COLORS.stroke.brand:"black"};
5
5
  }
6
- `;exports.InputWithVariables=r=>{let{addVarBoxRight:t,allowMix:c,onChange:b,prevVariable:g,variablesList:V,onBlur:p,onlyVariables:h,placeHolder:j,showAddButton:x=!0,showHelp:T,showSideVariablePanel:y,errorMessage:f,showSideModal:m}=r;const S=l.useRef(null),[q,w]=l.useState(!1),[A]=l.useState(i.v4()),[B,O]=l.useState(),[C,I]=l.useState(g),[N,L]=l.useState(!1),[M,k]=l.useState(!1),[E,F]=l.useState(f||"");return l.useEffect((()=>{B&&B.actualValue&&I(c?e=>({actualValue:e.actualValue+B.actualValue,variableType:"string"}):e=>({actualValue:B.actualValue,variableType:B.variableType,needsFetching:B.needsFetching}))}),[B]),l.useEffect((()=>{b(C)}),[C]),e.jsxs(e.Fragment,{children:[e.jsxs(v,Object.assign({isVar:/^{{.*}}$/.test(C.actualValue)},{children:[e.jsx(o.Input,{id:A,ref:S,skipFocus:!0,textControl:!0,isActive:q,value:C.actualValue,validate:e=>[!0,""],errorMessage:E,placeholder:j||"Add a value",onChangeText:(e,a)=>{if(F(""),h){const e=(null==a?void 0:a.keyCode)||(null==a?void 0:a.charCode);8!==e&&46!==e||I({actualValue:"",variableType:"string"})}else I(c?{actualValue:e,variableType:"string"}:{actualValue:e.replace(/{{.*}}/,""),variableType:"string"})},onReferenceInit:()=>{},onFocus:e=>{w(!0),k(!0),document.getElementById("varList")&&!N&&L(!0)},onBlur:e=>{var a,l,r,i,t,d;null==p||p(e,C),"addVar"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||"varList"===(null===(l=e.relatedTarget)||void 0===l?void 0:l.id)||(null===(i=null===(r=e.relatedTarget)||void 0===r?void 0:r.className)||void 0===i?void 0:i.includes("exlualr0"))||(null===(d=null===(t=e.relatedTarget)||void 0===t?void 0:t.className)||void 0===d?void 0:d.includes("sc-dZoequ "))?(S.current&&S.current.focus(),w(!0)):document.getElementById("varList")?w(!0):(w(!1),L(!1),k(!1))}}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[C.actualValue&&T&&e.jsx("div",Object.assign({style:{marginTop:4}},{children:e.jsx(n.BodyCaption,{children:`This value is of type ${C.variableType}`})})),x&&M&&e.jsx("div",Object.assign({style:{marginTop:f?"-24px":"0px"}},{children:e.jsx(u.AddVariableStyled,Object.assign({right:t,id:"addVar",onClick:()=>{L(!N)}},{children:e.jsxs("div",Object.assign({className:"add"},{children:[e.jsx(a.default,{color:"white"}),e.jsx("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))}))]})),!y&&N&&e.jsx(s.AddVariableV2,{data:V,showVariable:!0,setShowVariable:()=>{L(!1)},variableValue:B,setVariableValue:O,placeholder:"",pickerSize:"large",enableVariable:!0,selectWithTypes:!0,onSearchBlur:e=>{var a,l,r,i,t,d;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(t=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===t?void 0:t.includes("sc-dZoequ "))?S.current.focus():"Enter here"===(null===(d=e.relatedTarget)||void 0===d?void 0:d.placeholder)?e.relatedTarget.id!==A&&(L(!1),k(!1),w(!1)):(L(!1),k(!1),w(!1))}})]})),y&&N&&e.jsx(d.AddVariableV2SideModal,{zIndex:2e3,data:null!=V?V:[],showVariable:N,setShowVariable:()=>{L(!1)},placeholder:"Add a variable",customTrigger:e=>{O({actualValue:e.actualValue,variableType:"string"}),I(e)},onSearchBlur:e=>{var a,l,r,i,t,d;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(t=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===t?void 0:t.includes("sc-dZoequ "))?S.current.focus():"Enter here"===(null===(d=e.relatedTarget)||void 0===d?void 0:d.placeholder)?e.relatedTarget.id!==A&&(L(!1),k(!1),w(!1)):(L(!1),k(!1),w(!1))}})]})};
6
+ `;exports.InputWithVariables=r=>{let{addVarBoxRight:t,allowMix:c,onChange:b,prevVariable:g,variablesList:V,onBlur:h,onlyVariables:p,placeHolder:x,showAddButton:j=!0,showHelp:T,showSideVariablePanel:y,errorMessage:f,showSideModal:m,noMaxCharCheck:S}=r;const q=l.useRef(null),[C,w]=l.useState(!1),[A]=l.useState(i.v4()),[B,O]=l.useState(),[M,k]=l.useState(g),[I,N]=l.useState(!1),[L,E]=l.useState(!1),[F,R]=l.useState(f||"");return l.useEffect((()=>{B&&B.actualValue&&k(c?e=>({actualValue:e.actualValue+B.actualValue,variableType:"string"}):e=>({actualValue:B.actualValue,variableType:B.variableType,needsFetching:B.needsFetching}))}),[B]),l.useEffect((()=>{b(M)}),[M]),e.jsxs(e.Fragment,{children:[e.jsxs(v,Object.assign({isVar:/^{{.*}}$/.test(M.actualValue)},{children:[e.jsx(o.Input,{id:A,ref:q,skipFocus:!0,textControl:!0,isActive:C,value:M.actualValue,validate:e=>[!0,""],errorMessage:F,placeholder:x||"Add a value",onChangeText:(e,a)=>{if(R(""),p){const e=(null==a?void 0:a.keyCode)||(null==a?void 0:a.charCode);8!==e&&46!==e||k({actualValue:"",variableType:"string"})}else k(c?{actualValue:e,variableType:"string"}:{actualValue:e.replace(/{{.*}}/,""),variableType:"string"})},onReferenceInit:()=>{},onFocus:e=>{w(!0),E(!0),document.getElementById("varList")&&!I&&N(!0)},onBlur:e=>{var a,l,r,i,t,d;null==h||h(e,M),"addVar"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||"varList"===(null===(l=e.relatedTarget)||void 0===l?void 0:l.id)||(null===(i=null===(r=e.relatedTarget)||void 0===r?void 0:r.className)||void 0===i?void 0:i.includes("exlualr0"))||(null===(d=null===(t=e.relatedTarget)||void 0===t?void 0:t.className)||void 0===d?void 0:d.includes("sc-dZoequ "))?(q.current&&q.current.focus(),w(!0)):document.getElementById("varList")?w(!0):(w(!1),N(!1),E(!1))},noMaxCharCheck:S}),e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"row",justifyContent:"space-between"}},{children:[M.actualValue&&T&&e.jsx("div",Object.assign({style:{marginTop:4}},{children:e.jsx(n.BodyCaption,{children:`This value is of type ${M.variableType}`})})),j&&L&&e.jsx("div",Object.assign({style:{marginTop:f?"-24px":"0px"}},{children:e.jsx(u.AddVariableStyled,Object.assign({right:t,id:"addVar",onClick:()=>{N(!I)}},{children:e.jsxs("div",Object.assign({className:"add"},{children:[e.jsx(a.default,{color:"white"}),e.jsx("div",Object.assign({className:"variable"},{children:"Add variable"}))]}))}))}))]})),!y&&I&&e.jsx(s.AddVariableV2,{data:V,showVariable:!0,setShowVariable:()=>{N(!1)},variableValue:B,setVariableValue:O,placeholder:"",pickerSize:"large",enableVariable:!0,selectWithTypes:!0,onSearchBlur:e=>{var a,l,r,i,t,d;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(t=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===t?void 0:t.includes("sc-dZoequ "))?q.current.focus():"Enter here"===(null===(d=e.relatedTarget)||void 0===d?void 0:d.placeholder)?e.relatedTarget.id!==A&&(N(!1),E(!1),w(!1)):(N(!1),E(!1),w(!1))}})]})),y&&I&&e.jsx(d.AddVariableV2SideModal,{zIndex:2e3,data:null!=V?V:[],showVariable:I,setShowVariable:()=>{N(!1)},placeholder:"Add a variable",customTrigger:e=>{O({actualValue:e.actualValue,variableType:"string"}),k(e)},onSearchBlur:e=>{var a,l,r,i,t,d;"varList"===(null===(a=e.relatedTarget)||void 0===a?void 0:a.id)||(null===(r=null===(l=e.relatedTarget)||void 0===l?void 0:l.className)||void 0===r?void 0:r.includes("exlualr0"))||(null===(t=null===(i=e.relatedTarget)||void 0===i?void 0:i.className)||void 0===t?void 0:t.includes("sc-dZoequ "))?q.current.focus():"Enter here"===(null===(d=e.relatedTarget)||void 0===d?void 0:d.placeholder)?e.relatedTarget.id!==A&&(N(!1),E(!1),w(!1)):(N(!1),E(!1),w(!1))}})]})};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export type ShimmerImageProps = {
3
3
  imageUrl: string;
4
- width: number;
4
+ width: number | string;
5
5
  height: number;
6
6
  alt?: string;
7
7
  borderRadius?: number;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("@emotion/styled/base"),e=require("./themes.js");function l(c){return c&&"object"==typeof c&&"default"in c?c:{default:c}}const d=l(c).default("div","production"===process.env.NODE_ENV?{target:"e930jd90"}:{target:"e930jd90",label:"Tag"})("cursor:",(c=>{var e;return null!==(e=c.cursor)&&void 0!==e?e:"default"}),";",(c=>"regular"===c.variant?"display: block;\n\t\t height: 26px;\n\t\t":"height: 20px;")," .container{display:flex;align-items:center;gap:6px;padding:",(c=>e.getPadding(c.variant)),";background-color:",(c=>e.getBackgroundColor(c.theme,c.type)),";border-radius:",(c=>"regular"===c.variant?"4px":"12px"),";",(c=>"light"===c.theme&&`border: ${"2.0"===c.version?.5:1}px solid ${e.generateBorder(c.type)};`)," .text{color:",(c=>e.getTextColor(c.theme,c.type)),";}.icon-trailing{all:unset;display:flex;}.icon-leading{all:unset;display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhZy5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJUYWcuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcclxuaW1wb3J0IHsgZ2VuZXJhdGVCb3JkZXIsIGdldEJhY2tncm91b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2xvcihwcm9wcy50aGVtZSwgcHJvcHMudHlwZSl9O1xuXHRcdH1cblxuXHRcdC5pY29uLXRyYWlsaW5nIHtcblx0XHRcdGFsbDogdW5zZXQ7XG5cdFx0XHRkaXNwbGF5OiBmbGV4O1xuXHRcdH1cblxuXHRcdC5pY29uLWxlYWRpbmcge1xuXHRcdFx0YWxsOiB1bnNldDtcblx0XHRcdGRpc3BsYXk6IGZsZXg7XG5cdFx0fVxuXHR9XG5gO1xyXG4vLyMgc291cmNlTWFwcGluZ1VSTD1UYWcuc3R5bGVkLmpzLm1hcCJdfQ== */"));exports.Tag=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("@emotion/styled/base"),e=require("./themes.js");function l(c){return c&&"object"==typeof c&&"default"in c?c:{default:c}}const t=l(c).default("div","production"===process.env.NODE_ENV?{target:"e930jd90"}:{target:"e930jd90",label:"Tag"})("cursor:",(c=>{var e;return null!==(e=c.cursor)&&void 0!==e?e:"default"}),";",(c=>"regular"===c.variant?"display: block;\n\t\t min-height: 26px;\n\t\t":"min-height: 20px;")," .container{display:flex;align-items:center;gap:6px;padding:",(c=>e.getPadding(c.variant)),";background-color:",(c=>e.getBackgroundColor(c.theme,c.type)),";border-radius:",(c=>"regular"===c.variant?"4px":"12px"),";",(c=>"light"===c.theme&&`border: ${"2.0"===c.version?.5:1}px solid ${e.generateBorder(c.type)};`)," .text{color:",(c=>e.getTextColor(c.theme,c.type)),";}.icon-trailing{all:unset;display:flex;}.icon-leading{all:unset;display:flex;}}"+("production"===process.env.NODE_ENV?"":"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlRhZy5zdHlsZWQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUU4QiIsImZpbGUiOiJUYWcuc3R5bGVkLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R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X07YH1cblxuXHRcdC50ZXh0IHtcblx0XHRcdGNvbG9yOiAkeyhwcm9wcykgPT4gZ2V0VGV4dENvbG9yKHByb3BzLnRoZW1lLCBwcm9wcy50eXBlKX07XG5cdFx0fVxuXG5cdFx0Lmljb24tdHJhaWxpbmcge1xuXHRcdFx0YWxsOiB1bnNldDtcblx0XHRcdGRpc3BsYXk6IGZsZXg7XG5cdFx0fVxuXG5cdFx0Lmljb24tbGVhZGluZyB7XG5cdFx0XHRhbGw6IHVuc2V0O1xuXHRcdFx0ZGlzcGxheTogZmxleDtcblx0XHR9XG5cdH1cbmA7XHJcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPVRhZy5zdHlsZWQuanMubWFwIl19 */"));exports.Tag=t;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("../../utils/StringUtils.js"),a=require("../modals/styledModal.js"),s=require("../template-preview/models/Channels.js"),i=require("./context/templateModalContext.js"),o=require("./modalElements/Footer.js"),r=require("./modalElements/TemplateSelectModalContent.js"),n=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=d=>{let{selectedTemplate:u,closeDialog:c,showVariableMapping:p,channel:m,htmlContent:h,templateVariables:b,onTemplateSelect:g,globalPlaceholders:v,showOnlyContent:C,whatsappSpecificPickerMeta:S,zIndex:x,showVariableModal:T,variableList:E,discountCode:j,setDiscountCode:M,onBackPress:P,enabledCustomText:L,variableListForImage:w,showSampleValues:f,disableEditVariable:V,pod:q,extras:y}=d;var A,N;t.useEffect((()=>{_(h)}),[h]);const[I,k]=t.useState(m===s.CHANNEL_TYPE.EMAIL?"desktop":"mobile"),[D,_]=t.useState(h),[H,O]=t.useState(!1),[F,B]=t.useState(u),[Y,z]=t.useState(null!=b?b:[]),[$,U]=t.useState(!1);const W=t.useMemo((()=>n.convertPlaceholdersToBikDropdown(v)),[v]);return e.jsx(i.TemplateModalContext.Provider,Object.assign({value:{template:F,setTemplate:B,device:I,setDevice:k,display_content:D,setDisplayContent:_,originalVariableList:Y,setOriginalVariableList:z,isError:H,setIsError:O,channel:m,globalNormalizedPlaceholders:W,templateSelectionTriggered:$,setTemplateSelectionTriggered:U,enabledCustomText:L,disableEditVariable:V,pod:q,extras:y}},{children:C?e.jsx(r.default,{channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:x,centralContainerStyles:{width:m===s.CHANNEL_TYPE.EMAIL&&p?1e3:700},open:!0,onClose:()=>{null==c||c()},headingTitle:null==F?void 0:F.label,headingSubtitle:m===s.CHANNEL_TYPE.WHATSAPP?`${l.default.capitaliseFirstLetterOfString(null!==(A=null==F?void 0:F.category)&&void 0!==A?A:"")} • ${null!==(N=null==F?void 0:F.templateCategory)&&void 0!==N?N:""}`:"",onBackPress:()=>{null==P||P()}},{children:[e.jsx(r.default,{showSampleValues:f,showVariableMapping:p,channel:m,whatsappSpecificPickerMeta:S,showVariableModal:T,variableList:E,discountCode:j,setDiscountCode:M,variableListForImage:w&&(null==w?void 0:w.length)>0?w:E}),g?e.jsx(o.default,{onSelect:function(){const e=null==g?void 0:g(F,Y,null!=D?D:"");e?O(!!e):U(!0)}}):e.jsx(e.Fragment,{})]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),l=require("../../utils/StringUtils.js"),a=require("../modals/styledModal.js"),s=require("../template-preview/models/Channels.js"),i=require("./context/templateModalContext.js"),o=require("./modalElements/Footer.js"),r=require("./modalElements/TemplateSelectModalContent.js"),n=require("./utils/convertPlaceholdersToBikDropdown.js");exports.TemplateContextMapper=d=>{let{selectedTemplate:u,closeDialog:c,showVariableMapping:p,channel:m,htmlContent:h,templateVariables:b,onTemplateSelect:g,globalPlaceholders:v,showOnlyContent:C,whatsappSpecificPickerMeta:S,zIndex:x,showVariableModal:T,variableList:E,discountCode:j,setDiscountCode:M,onBackPress:P,enabledCustomText:L,variableListForImage:w,showSampleValues:f,disableEditVariable:V,pod:q,extras:y}=d;var A,N;t.useEffect((()=>{_(h)}),[h]);const[I,k]=t.useState(m===s.CHANNEL_TYPE.EMAIL?"desktop":"mobile"),[D,_]=t.useState(h),[H,O]=t.useState(!1),[F,B]=t.useState(u),[Y,z]=t.useState(null!=b?b:[]),[$,U]=t.useState(!1);const W=t.useMemo((()=>n.convertPlaceholdersToBikDropdown(v)),[v]);return e.jsx(i.TemplateModalContext.Provider,Object.assign({value:{template:F,setTemplate:B,device:I,setDevice:k,display_content:D,setDisplayContent:_,originalVariableList:Y,setOriginalVariableList:z,isError:H,setIsError:O,channel:m,globalNormalizedPlaceholders:W,templateSelectionTriggered:$,setTemplateSelectionTriggered:U,enabledCustomText:L,disableEditVariable:V,pod:q,extras:y}},{children:C?e.jsx(r.default,{channel:s.CHANNEL_TYPE.EMAIL,hideHeader:!0}):e.jsxs(a.StyledModal,Object.assign({zIndex:x,centralContainerStyles:{width:m===s.CHANNEL_TYPE.EMAIL&&p?1e3:800},open:!0,onClose:()=>{null==c||c()},headingTitle:null==F?void 0:F.label,headingSubtitle:m===s.CHANNEL_TYPE.WHATSAPP?`${l.default.capitaliseFirstLetterOfString(null!==(A=null==F?void 0:F.category)&&void 0!==A?A:"")} • ${null!==(N=null==F?void 0:F.templateCategory)&&void 0!==N?N:""}`:"",onBackPress:()=>{null==P||P()}},{children:[e.jsx(r.default,{showSampleValues:f,showVariableMapping:p,channel:m,whatsappSpecificPickerMeta:S,showVariableModal:T,variableList:E,discountCode:j,setDiscountCode:M,variableListForImage:w&&(null==w?void 0:w.length)>0?w:E}),g?e.jsx(o.default,{onSelect:function(){const e=null==g?void 0:g(F,Y,null!=D?D:"");e?O(!!e):U(!0)}}):e.jsx(e.Fragment,{})]}))}))};
@@ -0,0 +1,8 @@
1
+ import { VariableListInterfaceV2 } from "../../add-variableV2/AddVariableV2";
2
+ export type AdditionalVariableProps = {
3
+ variableList?: VariableListInterfaceV2[];
4
+ categoryDisplayName: string;
5
+ variableDisplayName: string;
6
+ variableValue: string;
7
+ };
8
+ export declare const useAdditionalVariables: (props: AdditionalVariableProps) => VariableListInterfaceV2[] | undefined;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.useAdditionalVariables=a=>{const{variableList:e,categoryDisplayName:i,variableDisplayName:r,variableValue:l}=a;return e?[...e,{description:"",displayName:i,orderId:1,variables:{variableDisplayName:{description:void 0,displayName:r,actualValue:l,variableType:"any",isAvailable:!0}}}].sort(((a,e)=>a.orderId-e.orderId)):e};
@@ -3,7 +3,7 @@
3
3
  // height: 100%;
4
4
  `,f=h.default.div`
5
5
  padding: 16px 14px;
6
- max-width: 350px;
6
+ max-width: 450px;
7
7
 
8
8
  height: ${e=>e.channel===o.CHANNEL_TYPE.WHATSAPP?"500px":"475px"};
9
9
  overflow-y: 'auto';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../button/Button.js"),s=require("../../input-with-vars/InputWithVariables.js"),a=require("../../modals/styledModal.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var i=require("../../../constants/Theme.js"),r=require("../../template-preview/models/TemplateMeta.js");require("../../template-preview/models/WhatsAppTemplate.js");var l=require("../../TypographyStyle.js"),d=require("../../../assets/icons/file.svg.js"),o=require("../../../assets/icons/filePdf.svg.js"),n=require("../../../assets/icons/image.svg.js"),u=require("../../../assets/icons/upload.svg.js");exports.default=c=>{let{setOpenEditMedia:p,mediaComponentFormat:h,variableListForImage:j,openEditMedia:E,uploadMedia:g}=c;return e.jsx(a.StyledModal,Object.assign({open:E,zIndex:2e3,onClose:()=>p(!1),width:"440px"},{children:e.jsxs("div",Object.assign({style:{padding:24,borderRadius:4}},{children:[e.jsx(l.TitleMedium,Object.assign({style:{marginBottom:16}},{children:"Update media"})),e.jsxs("div",Object.assign({style:{padding:24,border:`1px dashed ${i.DEFAULT_THEME.colorsV2.stroke.primary}`,backgroundColor:i.DEFAULT_THEME.colorsV2.surface.subdued}},{children:[e.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16}},{children:[e.jsx("div",Object.assign({style:{height:80,width:80,borderRadius:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i.DEFAULT_THEME.colorsV2.background.base}},{children:h===r.HEADER_TYPES.IMAGE?e.jsx(n.default,{width:40,height:40}):h===r.HEADER_TYPES.VIDEO?e.jsx(d.default,{width:40,height:40}):e.jsx(o.default,{width:40,height:40})})),e.jsx(l.TitleMedium,{children:h===r.HEADER_TYPES.IMAGE?"Upload an image":h===r.HEADER_TYPES.VIDEO?"Upload a video":"Upload a document"}),e.jsx(l.BodySecondary,{children:h===r.HEADER_TYPES.IMAGE?"JPEG/ PNG format • Max 5MB":h===r.HEADER_TYPES.VIDEO?"MP4 format video • Max 16MB":"PDF format a document • Max 100MB"})]})),e.jsxs("div",Object.assign({style:{marginBottom:16}},{children:[e.jsx(l.BodyRegular,{children:"Media"}),e.jsx(s.InputWithVariables,{addVarBoxRight:"46px",allowMix:!1,onChange:e=>{},prevVariable:{actualValue:"",variableType:"string"},variablesList:j,showSideVariablePanel:!0,placeHolder:"Enter URL or add variable...",onBlur:(e,t)=>{t&&t.actualValue&&g(t.actualValue)},showAddButton:[r.HEADER_TYPES.IMAGE,r.HEADER_TYPES.VIDEO,r.HEADER_TYPES.DOCUMENT].includes(h)})]})),e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4}},{children:[e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}}),e.jsx(l.BodyCaption,Object.assign({style:{flex:1}},{children:"Or upload media from device"})),e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}})]})),e.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsx(t.Button,{matchParentWidth:!0,buttonText:"Upload",buttonType:"secondary",LeadingIcon:u.default,onClick:()=>g()})}))]}))]}))}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../button/Button.js"),a=require("../../input-with-vars/InputWithVariables.js"),s=require("../../modals/styledModal.js");require("../../template-preview/TemplatePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js");var i=require("../../../constants/Theme.js"),r=require("../../template-preview/models/TemplateMeta.js"),l=require("../../template-preview/models/WhatsAppTemplate.js"),d=require("../../TypographyStyle.js"),o=require("../../../assets/icons/file.svg.js"),n=require("../../../assets/icons/filePdf.svg.js"),p=require("../../../assets/icons/image.svg.js"),c=require("../../../assets/icons/upload.svg.js"),u=require("../context/templateModalContext.js");exports.default=h=>{let{setOpenEditMedia:j,mediaComponentFormat:x,variableListForImage:g,openEditMedia:m,uploadMedia:E}=h;const{pod:b}=u.useTemplateModalContext();return e.jsx(s.StyledModal,Object.assign({open:m,zIndex:2e3,onClose:()=>j(!1),width:"440px"},{children:e.jsxs("div",Object.assign({style:{padding:24,borderRadius:4}},{children:[e.jsx(d.TitleMedium,Object.assign({style:{marginBottom:16}},{children:"Update media"})),e.jsxs("div",Object.assign({style:{padding:24,border:`1px dashed ${i.DEFAULT_THEME.colorsV2.stroke.primary}`,backgroundColor:i.DEFAULT_THEME.colorsV2.surface.subdued}},{children:[e.jsxs("div",Object.assign({style:{marginBottom:24,display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center",gap:16}},{children:[e.jsx("div",Object.assign({style:{height:80,width:80,borderRadius:"100%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i.DEFAULT_THEME.colorsV2.background.base}},{children:x===r.HEADER_TYPES.IMAGE?e.jsx(p.default,{width:40,height:40}):x===r.HEADER_TYPES.VIDEO?e.jsx(o.default,{width:40,height:40}):e.jsx(n.default,{width:40,height:40})})),e.jsx(d.TitleMedium,{children:x===r.HEADER_TYPES.IMAGE?"Upload an image":x===r.HEADER_TYPES.VIDEO?"Upload a video":"Upload a document"}),e.jsx(d.BodySecondary,{children:x===r.HEADER_TYPES.IMAGE?"JPEG/ PNG format • Max 5MB":x===r.HEADER_TYPES.VIDEO?"MP4 format video • Max 16MB":"PDF format a document • Max 100MB"})]})),e.jsxs("div",Object.assign({style:{marginBottom:16}},{children:[e.jsx(d.BodyRegular,{children:"Media"}),e.jsx(a.InputWithVariables,{noMaxCharCheck:!0,addVarBoxRight:"46px",allowMix:!1,onChange:e=>{},prevVariable:{actualValue:"",variableType:"string"},variablesList:g,showSideVariablePanel:!0,placeHolder:"Enter URL or add variable...",onBlur:(e,t)=>{t&&t.actualValue&&E(t.actualValue)},showAddButton:b!==l.POD.CAMPAIGN||x===r.HEADER_TYPES.IMAGE})]})),e.jsxs("div",Object.assign({style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:4}},{children:[e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}}),e.jsx(d.BodyCaption,Object.assign({style:{flex:1}},{children:"Or upload media from device"})),e.jsx("hr",{style:{height:"2px",flex:.5,backgroundColor:"black"}})]})),e.jsx("div",Object.assign({style:{display:"flex",width:"100%"}},{children:e.jsx(t.Button,{matchParentWidth:!0,buttonText:"Upload",buttonType:"secondary",LeadingIcon:c.default,onClick:()=>E()})}))]}))]}))}))};
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("../../../assets/icons/document_pdf.svg.js"),i=require("../../../assets/icons/edit.svg.js"),s=require("../../../assets/icons/refresh.svg.js"),r=require("../../../assets/icons/video_camcorder.svg.js"),n=require("styled-components"),o=require("../../spinner/Spinner.js"),l=require("../../template-preview/models/TemplateMeta.js"),d=require("../../TypographyStyle.js"),a=require("../../../utils/StringUtils.js"),c=require("../../../constants/Theme.js"),u=require("./EditMediaV2.style.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const g=h(n).default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),i=require("../../../assets/icons/document_pdf.svg.js"),t=require("../../../assets/icons/edit.svg.js"),s=require("../../../assets/icons/refresh.svg.js"),r=require("styled-components"),n=require("../../shimmer-image/ShimmerImage.js"),l=require("../../spinner/Spinner.js"),o=require("../../template-preview/models/TemplateMeta.js"),a=require("../../TypographyStyle.js"),d=require("../../../utils/StringUtils.js"),c=require("../../../constants/Theme.js"),g=require("./EditMediaV2.style.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const u=h(r).default.div`
2
2
  padding-left: 14px;
3
3
  padding-right: 6px;
4
4
  width: 44px;
5
5
  height: 24px;
6
6
  border-left: 1px solid ${c.COLORS.stroke.primary};
7
7
  cursor: pointer;
8
- `;exports.default=n=>{const{imageName:h,error:j,isLoading:p,mediaType:x,handleImageChange:O,disableEditVariable:y,selectedVariable:m,setOpenEditMedia:f}=n,v=null==h?void 0:h[0].split("/"),C=null==v?void 0:v[v.length-1];return e.jsxs(u.Container,{children:[e.jsx(u.ImageContainer,Object.assign({error:!!j,onClick:j?O:void 0},{children:j?e.jsx(s.default,{color:c.COLORS.content.brand,width:32,height:32}):p?e.jsx(o.Spinner,{size:"small"}):x===l.HEADER_TYPES.IMAGE?e.jsx("img",{alt:"",src:null==h?void 0:h[0],style:{width:"100%",height:"56px",borderRadius:8,objectFit:"cover"}}):x===l.HEADER_TYPES.VIDEO?e.jsx(r.default,{width:18,height:22,color:c.COLORS.content.placeholder}):e.jsx(t.default,{width:18,height:22,color:c.COLORS.content.placeholder})})),e.jsxs(u.RightComponent,{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:h&&j?e.jsx(e.Fragment,{}):p?e.jsx(d.BodyCaption,Object.assign({style:{marginLeft:8}},{children:"Your media is getting loaded..."})):e.jsx(d.BodySecondary,Object.assign({style:{color:c.COLORS.content.primary,marginLeft:8}},{children:m||a.default.toCapitilize(null==x?void 0:x.toLowerCase())||C}))})),!!j&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",marginLeft:8}},{children:[e.jsxs(d.BodySecondary,Object.assign({style:{color:c.COLORS.content.negative}},{children:["Error loading this ",null==x?void 0:x.toLowerCase(),". Retry"]})),e.jsx(d.Caption,Object.assign({style:{color:c.COLORS.content.secondary}},{children:j}))]})),!y&&!j&&!p&&e.jsx(g,Object.assign({onClick:()=>null==f?void 0:f(!0),onKeyDown:()=>null==f?void 0:f(!0),role:"presentation"},{children:e.jsx(i.default,{width:24,height:24,color:c.COLORS.content.placeholder})}))]})]})};
8
+ `;exports.default=r=>{const{imageName:h,error:j,isLoading:p,mediaType:m,disableEditVariable:x,selectedVariable:y,setOpenEditMedia:O}=r,f=null==h?void 0:h[0].split("/"),v=null==f?void 0:f[f.length-1];return e.jsxs(g.Container,{children:[e.jsx(g.ImageContainer,Object.assign({error:!!j,onClick:()=>null==O?void 0:O(!0)},{children:j?e.jsx(s.default,{color:c.COLORS.content.brand,width:32,height:32}):p?e.jsx(l.Spinner,{size:"small"}):m===o.HEADER_TYPES.IMAGE?e.jsx(n.ShimmerImage,{imageUrl:null==h?void 0:h[0],width:56,height:56}):m===o.HEADER_TYPES.VIDEO?e.jsx("video",Object.assign({src:h[0],style:{width:56,height:56}},{children:e.jsx("track",{default:!0,kind:"captions",srcLang:"en",src:h[0]})})):e.jsx(i.default,{width:18,height:22,color:c.COLORS.content.placeholder})})),e.jsxs(g.RightComponent,{children:[e.jsx("div",Object.assign({style:{flex:1}},{children:h&&j?e.jsx(e.Fragment,{}):p?e.jsx(a.BodyCaption,Object.assign({style:{marginLeft:8}},{children:"Your media is getting loaded..."})):e.jsx(a.BodySecondary,Object.assign({style:{color:c.COLORS.content.primary,marginLeft:8}},{children:y||d.default.toCapitilize(null==m?void 0:m.toLowerCase())||v}))})),!!j&&e.jsxs("div",Object.assign({style:{display:"flex",flexDirection:"column",marginLeft:8}},{children:[e.jsxs(a.BodySecondary,Object.assign({style:{color:c.COLORS.content.negative}},{children:["Error loading this ",null==m?void 0:m.toLowerCase(),". Retry"]})),e.jsx(a.Caption,Object.assign({style:{color:c.COLORS.content.secondary}},{children:j}))]})),!x&&!j&&!p&&e.jsx(u,Object.assign({onClick:()=>null==O?void 0:O(!0),onKeyDown:()=>null==O?void 0:O(!0),role:"presentation"},{children:e.jsx(t.default,{width:24,height:24,color:c.COLORS.content.placeholder})}))]})]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),a=require("../../helpers/FileUploaderHelper.js"),r=require("../../image-cropper/BikImageCropper.js");require("../../image-compress/ImageCompress.js"),require("../../states/StateComponent.js"),require("../../../constants/zindex.js"),require("../../modals/styledModal.js"),require("../../spinner/Spinner.js");var n=require("../../shimmer-image/ShimmerImage.js"),o=require("../../template-preview/models/TemplateMeta.js"),l=require("../context/templateModalContext.js"),s=require("./EditMediaModal.js"),d=require("./EditMediaV2.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=c(i);exports.default=c=>{let{mediaComponent:p,template:m,updateTemplateImageUrl:f,whatsappSpecificPickerMeta:v,variableListForImage:E}=c;var g,j,h;const{disableEditVariable:b}=l.useTemplateModalContext(),[M,_]=i.useState(void 0),[A,I]=i.useState(),[S,T]=i.useState(),[x,y]=i.useState(!1),C=u.default.createRef(),[q,R]=i.useState(!1),[D,O]=i.useState(""),{template:w,setTemplate:H}=l.useTemplateModalContext();let F;function P(){var e;(null===(e=null==C?void 0:C.current)||void 0===e?void 0:e.click)&&C.current.click()}function k(t){var i;return e.__awaiter(this,void 0,void 0,(function*(){const e=new a.FileUploaderHelper;if(t instanceof Blob){const a=e.validate(t);if(a)O(a),R(!1);else{const e=p.format===o.HEADER_TYPES.IMAGE,a=yield v.uploadMediaFiles({file:t,fileName:M,isImage:e});if(a.success){const[e]=t.type.split("/");f(null!==(i=a.url)&&void 0!==i?i:"","application"===e?o.HEADER_TYPES.DOCUMENT:o.HEADER_TYPES[e.toUpperCase()])}else O("An unknown technical error occured");R(!1)}}else O("An unknown technical error occured"),R(!1)}))}return F=p.format===o.HEADER_TYPES.IMAGE?"image/png, image/jpeg":p.format===o.HEADER_TYPES.VIDEO?"video/mp4":"application/pdf",t.jsxs(t.Fragment,{children:[t.jsx(s.default,{mediaComponentFormat:null!==(g=p.format)&&void 0!==g?g:o.HEADER_TYPES.IMAGE,uploadMedia:function(t){var i;return e.__awaiter(this,void 0,void 0,(function*(){if(O(""),T(""),y(!1),t)if(t.startsWith("https"))try{R(!0);const e=yield fetch(t),i=yield e.blob();yield k(i)}catch(e){O("An unknown technical error occurred")}else if(/^{{.*}}$/.test(t)){T(t);const e=Object.assign({},w);if(e.components){const t=null===(i=null==e?void 0:e.components)||void 0===i?void 0:i.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==t&&t>-1&&(null==e?void 0:e.components[t])){const i=Object.assign(Object.assign({},e.components[t]),{format:p.format,example:{header_handle:[n.DEFAULT_IMAGE]}}),a=[...e.components];a[t]=i,e.components=a}}e.mapping&&(e.mapping=Object.assign(Object.assign({},e.mapping),{header:[t]})),R(!1),null==H||H(Object.assign({},e))}else R(!1),O("Invalid URL or variable");else P()}))},variableListForImage:E||[],setOpenEditMedia:y,openEditMedia:x}),!!A&&t.jsx(r.BikImageCropper,{aspectRatio:15/8,src:A,onCropComplete:function(t){return e.__awaiter(this,void 0,void 0,(function*(){R(!1),O("");const e=yield fetch(t);k(yield e.blob()).then((()=>{I(void 0)}))}))},onCancel:()=>{R(!1),I(""),C.current&&(C.current.value="")}}),t.jsx("input",{ref:C,style:{display:"none"},type:"file",onChange:function(e){var t;O(""),R(!0);const i=null===(t=e.target.files)||void 0===t?void 0:t[0];if(p.format===o.HEADER_TYPES.IMAGE){const e=new FileReader;I(""),_(""),e.onload=()=>{I(e.result),_(null==i?void 0:i.name)},i&&e.readAsDataURL(i)}else k(i)},accept:F}),t.jsx(d.default,{imageName:null!==(h=null===(j=null==p?void 0:p.example)||void 0===j?void 0:j.header_handle)&&void 0!==h?h:[],handleImageChange:P,mediaType:null==p?void 0:p.format,error:D,isLoading:q,setOpenEditMedia:y,selectedVariable:S,disableEditVariable:b})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_tslib.js"),t=require("react/jsx-runtime"),i=require("react"),a=require("../../helpers/FileUploaderHelper.js"),n=require("../../image-cropper/BikImageCropper.js");require("../../image-compress/ImageCompress.js"),require("../../states/StateComponent.js"),require("../../../constants/zindex.js"),require("../../modals/styledModal.js"),require("../../spinner/Spinner.js");var o=require("../../template-preview/models/TemplateMeta.js"),r=require("../context/templateModalContext.js"),l=require("./EditMediaModal.js"),s=require("./EditMediaV2.js");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=d(i);const c=e=>/^{{.*}}$/.test(e);exports.default=d=>{let{mediaComponent:p,template:m,updateTemplateImageUrl:v,whatsappSpecificPickerMeta:f,variableListForImage:E}=d;var g,h,j,b,_,M,x,y;const{disableEditVariable:A}=r.useTemplateModalContext(),[C,S]=i.useState(void 0),[T,I]=i.useState(),[q,R]=i.useState(),[O,D]=i.useState(!1),w=u.default.createRef(),[H,P]=i.useState(!1),[k,F]=i.useState(""),{template:U,setTemplate:Y}=r.useTemplateModalContext();let L;function N(){var e;(null===(e=null==w?void 0:w.current)||void 0===e?void 0:e.click)&&w.current.click()}function V(t){var i;return e.__awaiter(this,void 0,void 0,(function*(){const e=new a.FileUploaderHelper;if(t instanceof Blob){const a=e.validate(t);if(a)F(a),P(!1);else{const e=p.format===o.HEADER_TYPES.IMAGE,a=yield f.uploadMediaFiles({file:t,fileName:C,isImage:e});if(a.success){const[e]=t.type.split("/");v(null!==(i=a.url)&&void 0!==i?i:"","application"===e?o.HEADER_TYPES.DOCUMENT:o.HEADER_TYPES[e.toUpperCase()])}else F("An unknown technical error occured");P(!1)}}else F("An unknown technical error occured"),P(!1)}))}return L=p.format===o.HEADER_TYPES.IMAGE?"image/png, image/jpeg":p.format===o.HEADER_TYPES.VIDEO?"video/mp4":"application/pdf",t.jsxs(t.Fragment,{children:[t.jsx(l.default,{mediaComponentFormat:null!==(g=p.format)&&void 0!==g?g:o.HEADER_TYPES.IMAGE,uploadMedia:function(t){var i;return e.__awaiter(this,void 0,void 0,(function*(){if(F(""),R(""),D(!1),t)if(t.startsWith("https"))try{P(!0);const e=yield fetch(t),i=yield e.blob();yield V(i)}catch(e){F("An unknown technical error occurred")}else if(c(t)){R(t);const e=Object.assign({},U);if(e.components){const a=null===(i=null==e?void 0:e.components)||void 0===i?void 0:i.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==a&&a>-1&&(null==e?void 0:e.components[a])){const i=Object.assign(Object.assign({},e.components[a]),{format:p.format,example:{header_handle:[t]}}),n=[...e.components];n[a]=i,e.components=n}}e.mapping&&(e.mapping=Object.assign(Object.assign({},e.mapping),{header:[t]})),P(!1),null==Y||Y(Object.assign({},e))}else P(!1),F("Invalid URL or variable");else N()}))},variableListForImage:E||[],setOpenEditMedia:D,openEditMedia:O}),!!T&&t.jsx(n.BikImageCropper,{aspectRatio:15/8,src:T,onCropComplete:function(t){return e.__awaiter(this,void 0,void 0,(function*(){P(!1),F("");const e=yield fetch(t);V(yield e.blob()).then((()=>{I(void 0)}))}))},onCancel:()=>{P(!1),I(""),w.current&&(w.current.value="")}}),t.jsx("input",{ref:w,style:{display:"none"},type:"file",onChange:function(e){var t;F(""),P(!0);const i=null===(t=e.target.files)||void 0===t?void 0:t[0];if(p.format===o.HEADER_TYPES.IMAGE){const e=new FileReader;I(""),S(""),e.onload=()=>{I(e.result),S(null==i?void 0:i.name)},i&&e.readAsDataURL(i)}else V(i)},accept:L}),t.jsx(s.default,{imageName:null!==(j=null===(h=null==p?void 0:p.example)||void 0===h?void 0:h.header_handle)&&void 0!==j?j:[],handleImageChange:N,mediaType:null==p?void 0:p.format,error:k,isLoading:H,setOpenEditMedia:D,selectedVariable:c(null!==(M=null===(_=null===(b=null==p?void 0:p.example)||void 0===b?void 0:b.header_handle)||void 0===_?void 0:_[0])&&void 0!==M?M:"")?null===(y=null===(x=null==p?void 0:p.example)||void 0===x?void 0:x.header_handle)||void 0===y?void 0:y[0]:q,disableEditVariable:A})]})};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("../../template-preview/models/WhatsAppTemplate.js"),n=require("../context/templateModalContext.js"),i=require("../utils/getDataFromTemplateComponent.js"),a=require("./BackTrackComponent.js"),l=require("./DiscountCodeComponent.js"),s=require("./EditMediaV2.style.js"),d=require("./EditWhatsAppTemplateMediaV2.js"),r=require("./VariableConnector.js"),u=require("./VariableConnectorsPanel.js"),c=require("./VariableConnectorWhatsApp.js"),p=require("./VariableEditorHeader.js"),v=require("./WhatsAppTemplateCardButtonV2.js");exports.default=b=>{let{template:m,onTemplateChange:g,whatsappSpecificPickerMeta:h,showVariableModal:f,variableList:x,variableListForImage:j,discountCode:T,setDiscountCode:C}=b;var O,y,E,k,V,I,L,B,w,q,M,A,D,U,N,P,R;const{originalVariableList:S,pod:H,extras:_}=n.useTemplateModalContext(),{descriptionComponents:Q,urlBtns:F,qrbBtns:W,imageComponent:Y,bodyVariables:K,headerVariables:$}=i.getAllDataFromTemplateComponent(m),[X,z]=t.useState(!1);function G(e,t){var o,n,i,a,l;const s=Object.assign({},m),d=null==s?void 0:s.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==d&&d>-1){const l=null===(o=null==s?void 0:s.components[d].buttons)||void 0===o?void 0:o.findIndex((e=>"URL"===e.type));if(void 0!==l&&l>-1){const o="custom"===t&&"string"==typeof e,r=[...null!==(a=null===(i=null===(n=s.components)||void 0===n?void 0:n[d])||void 0===i?void 0:i.buttons)&&void 0!==a?a:[]];r[l]=Object.assign(Object.assign({},r[l]),{url:"https://d.bik.ai/{{1}}",example:[o?e:"string"!=typeof e?e.defaultValue:""]});const u=Object.assign(Object.assign({},s.components[d]),{buttons:r}),c=Object.assign(Object.assign({},s.mapping),{buttons:o?["((customBtnPlaceholder))"]:"string"!=typeof e?[e.placeHolder]:void 0});s.mapping=c;const p=[...s.components];p[d]=u,s.components=p}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(l=e.placeHolder)||void 0===l?void 0:l.slice(2,-2))?z(!0):(z(!1),null==C||C(""))}null==g||g(s)}function J(e,t,o){var n;const i=Object.assign({},m),a=null==i?void 0:i.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==a&&a>-1){const t=null===(n=null==i?void 0:i.components[a].buttons)||void 0===n?void 0:n.filter((e=>"QUICK_REPLY"===e.type));t&&(t[o]=Object.assign(Object.assign({},t[o]),{flowId:e.flowId,flowName:e.flowName}));const l=Object.assign(Object.assign({},i.components[a]),{buttons:t}),s=[...i.components];s[a]=l,i.components=s}null==g||g(i)}t.useEffect((()=>{var e;const t=null===(e=m.mapping.buttons)||void 0===e?void 0:e[0];"checkout.checkoutUrl"===(null==t?void 0:t.slice(2,-2))?z(!0):(z(!1),null==C||C(""))}),[m]);const Z=t.useCallback((()=>x?[...x,{description:"",displayName:"Custom variables",orderId:1,variables:{"Custom text":{description:void 0,displayName:"Custom text",actualValue:"{{custom.text}}",variableType:"any",isAvailable:!0}}}].sort(((e,t)=>e.orderId-t.orderId)):x),[x]),ee=t.useMemo((()=>Z()),[Z]);return e.jsxs(u.Container,Object.assign({style:{flexDirection:"column",maxHeight:460}},{children:[!!Y&&e.jsx(s.EditTemplateMediaContainer,{children:e.jsx(d.default,{whatsappSpecificPickerMeta:h,mediaComponent:Y,updateTemplateImageUrl:function(e,t){var o;let n=Object.assign({},m);const i=null===(o=null==n?void 0:n.components)||void 0===o?void 0:o.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==i&&i>-1&&(null==n?void 0:n.components[i])){const o=Object.assign(Object.assign({},n.components[i]),{format:t,example:{header_handle:[e]}}),a=[...n.components];a[i]=o,n=Object.assign(Object.assign({},n),{components:a})}n.mapping&&(n.mapping=Object.assign(Object.assign({},n.mapping),{header:void 0})),null==g||g(Object.assign({},n))},template:m,variableListForImage:j})}),(K.length>0||$.length>0)&&e.jsx(p.default,{containerStyle:{paddingTop:Y?24:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}),null==Q?void 0:Q.map(((t,o)=>e.jsx(c.default,{originalVariableList:S,type:t.type,descriptionComponent:t.component,variableMapping:"HEADER"===t.type?m.mapping.header:m.mapping.body,showVariableModal:f,variableList:x},o))),(null===(y=null===(O=F[0])||void 0===O?void 0:O.component)||void 0===y?void 0:y.buttons)&&(null===(V=null===(k=null===(E=F[0])||void 0===E?void 0:E.component)||void 0===k?void 0:k.buttons)||void 0===V?void 0:V.length)>0&&e.jsx(p.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(I=null==S?void 0:S.buttons)||void 0===I?void 0:I.map(((t,o)=>{if("URL"===t.type)return e.jsx(v.default,{variableListIndex:o,CTAoptions:null==h?void 0:h.CTAoptions,button:t,originalVariableList:S,updateSelectedURLTemplateBtn:G,variableList:x},`${o}`)})),(null===(B=null===(L=W[0])||void 0===L?void 0:L.component)||void 0===B?void 0:B.buttons)&&(null===(M=null===(q=null===(w=W[0])||void 0===w?void 0:w.component)||void 0===q?void 0:q.buttons)||void 0===M?void 0:M.length)>0&&(H!==o.POD.CHATBOT?e.jsx(p.default,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):e.jsx(a.BackTrackComponent,{backTrackMessage:null===(A=null==_?void 0:_.backTrackExtra)||void 0===A?void 0:A[0],setBackTrackMessage:null===(D=null==_?void 0:_.backTrackExtra)||void 0===D?void 0:D[1]})),null===(U=null==S?void 0:S.buttons)||void 0===U?void 0:U.map(((t,o)=>{if("QUICK_REPLY"===t.type)return e.jsx(v.default,{variableListIndex:o,QRBoptions:null==h?void 0:h.QRBoptions,button:t,originalVariableList:S,updateSelectedQRBTemplateBtn:J},`${o}`)})),H===o.POD.CHATBOT&&X&&e.jsx(l.DiscountCodeComponent,{discountCode:null===(N=null==_?void 0:_.discountCodeExtra)||void 0===N?void 0:N[0],setDiscountCode:null===(P=null==_?void 0:_.discountCodeExtra)||void 0===P?void 0:P[1],variableList:x}),null===(R=null==S?void 0:S.buttons)||void 0===R?void 0:R.map(((t,o)=>{var n,i,a;if("COPY_CODE"===t.type)return e.jsx(r.default,{index:o,variable:{variableName:null!==(n=t.text)&&void 0!==n?n:"",updatedValue:null!==(i=t.buttonVariable)&&void 0!==i?i:"",type:"string",isEditableVariable:!0,index:null!==(a=t.index)&&void 0!==a?a:0},showVariableModal:!0,variableList:ee,componentType:"BUTTONS"},o)}))]}))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("../../template-preview/models/WhatsAppTemplate.js"),i=require("../context/templateModalContext.js"),n=require("../custom-hooks/useAdditionalVariables.js"),a=require("../utils/getDataFromTemplateComponent.js"),l=require("./BackTrackComponent.js"),s=require("./DiscountCodeComponent.js"),d=require("./EditMediaV2.style.js"),r=require("./EditWhatsAppTemplateMediaV2.js"),u=require("./VariableConnector.js"),c=require("./VariableConnectorsPanel.js"),p=require("./VariableConnectorWhatsApp.js"),v=require("./VariableEditorHeader.js"),b=require("./WhatsAppTemplateCardButtonV2.js");exports.default=m=>{let{template:g,onTemplateChange:h,whatsappSpecificPickerMeta:f,showVariableModal:j,variableList:x,variableListForImage:T,discountCode:C,setDiscountCode:O}=m;var y,E,V,k,L,w,B,q,I,A,D,M,U,N,P,R,S;const{originalVariableList:H,pod:_,extras:Q}=i.useTemplateModalContext(),{descriptionComponents:F,urlBtns:W,qrbBtns:Y,imageComponent:K,bodyVariables:$,headerVariables:X}=a.getAllDataFromTemplateComponent(g),[z,G]=t.useState(!1);function J(e,t){var o,i,n,a,l;const s=Object.assign({},g),d=null==s?void 0:s.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==d&&d>-1){const l=null===(o=null==s?void 0:s.components[d].buttons)||void 0===o?void 0:o.findIndex((e=>"URL"===e.type));if(void 0!==l&&l>-1){const o="custom"===t&&"string"==typeof e,r=[...null!==(a=null===(n=null===(i=s.components)||void 0===i?void 0:i[d])||void 0===n?void 0:n.buttons)&&void 0!==a?a:[]];r[l]=Object.assign(Object.assign({},r[l]),{url:"https://d.bik.ai/{{1}}",example:[o?e:"string"!=typeof e?e.defaultValue:""]});const u=Object.assign(Object.assign({},s.components[d]),{buttons:r}),c=Object.assign(Object.assign({},s.mapping),{buttons:o?["((customBtnPlaceholder))"]:"string"!=typeof e?[e.placeHolder]:void 0});s.mapping=c;const p=[...s.components];p[d]=u,s.components=p}}if("string"!=typeof e){"checkout.checkoutUrl"===(null===(l=e.placeHolder)||void 0===l?void 0:l.slice(2,-2))?G(!0):(G(!1),null==O||O(""))}null==h||h(s)}function Z(e,t,o){var i;const n=Object.assign({},g),a=null==n?void 0:n.components.findIndex((e=>"BUTTONS"===e.type));if(void 0!==a&&a>-1){const t=null===(i=null==n?void 0:n.components[a].buttons)||void 0===i?void 0:i.filter((e=>"QUICK_REPLY"===e.type));t&&(t[o]=Object.assign(Object.assign({},t[o]),{flowId:e.flowId,flowName:e.flowName}));const l=Object.assign(Object.assign({},n.components[a]),{buttons:t}),s=[...n.components];s[a]=l,n.components=s}null==h||h(n)}t.useEffect((()=>{var e;const t=null===(e=g.mapping.buttons)||void 0===e?void 0:e[0];"checkout.checkoutUrl"===(null==t?void 0:t.slice(2,-2))?G(!0):(G(!1),null==O||O(""))}),[g]);const ee=n.useAdditionalVariables({variableList:x,categoryDisplayName:"Custom Variables",variableDisplayName:"Custom Text",variableValue:"{{custom.text}}"});return e.jsxs(c.Container,Object.assign({style:{flexDirection:"column",width:400,maxHeight:460}},{children:[!!K&&e.jsx(d.EditTemplateMediaContainer,{children:e.jsx(r.default,{whatsappSpecificPickerMeta:f,mediaComponent:K,updateTemplateImageUrl:function(e,t){var o;let i=Object.assign({},g);const n=null===(o=null==i?void 0:i.components)||void 0===o?void 0:o.findIndex((e=>{if("HEADER"===e.type&&"NONE"!==e.format&&"TEXT"!==e.format)return!0}));if(void 0!==n&&n>-1&&(null==i?void 0:i.components[n])){const o=Object.assign(Object.assign({},i.components[n]),{format:t,example:{header_handle:[e]}}),a=[...i.components];a[n]=o,i=Object.assign(Object.assign({},i),{components:a})}i.mapping&&(i.mapping=Object.assign(Object.assign({},i.mapping),{header:void 0})),null==h||h(Object.assign({},i))},template:g,variableListForImage:T})}),($.length>0||X.length>0)&&e.jsx(v.default,{containerStyle:{paddingTop:K?24:8},headerText:"Edit variable values",subText:"Edit values for the variables used in template",toolTipInfo:"Variables are placeholder texts which can either be filled through data or custom texts. These can be edited through the dropdowns below"}),null==F?void 0:F.map(((t,o)=>e.jsx(p.default,{originalVariableList:H,type:t.type,descriptionComponent:t.component,variableMapping:"HEADER"===t.type?g.mapping.header:g.mapping.body,showVariableModal:j,variableList:x},o))),(null===(E=null===(y=W[0])||void 0===y?void 0:y.component)||void 0===E?void 0:E.buttons)&&(null===(L=null===(k=null===(V=W[0])||void 0===V?void 0:V.component)||void 0===k?void 0:k.buttons)||void 0===L?void 0:L.length)>0&&e.jsx(v.default,{headerText:"Edit buttons",subText:"Edit the link connected to the CTA button"}),null===(w=null==H?void 0:H.buttons)||void 0===w?void 0:w.map(((t,o)=>{if("URL"===t.type)return e.jsx(b.default,{variableListIndex:o,CTAoptions:null==f?void 0:f.CTAoptions,button:t,originalVariableList:H,updateSelectedURLTemplateBtn:J,variableList:x},`${o}`)})),(null===(q=null===(B=Y[0])||void 0===B?void 0:B.component)||void 0===q?void 0:q.buttons)&&(null===(D=null===(A=null===(I=Y[0])||void 0===I?void 0:I.component)||void 0===A?void 0:A.buttons)||void 0===D?void 0:D.length)>0&&(_!==o.POD.CHATBOT?e.jsx(v.default,{headerText:"Edit buttons",subText:"Edit the chatflows triggered on clicking the buttons",toolTipInfo:"There is an option to trigger chatflows through the buttons which can keep the user engaged"}):e.jsx(l.BackTrackComponent,{backTrackMessage:null===(M=null==Q?void 0:Q.backTrackExtra)||void 0===M?void 0:M[0],setBackTrackMessage:null===(U=null==Q?void 0:Q.backTrackExtra)||void 0===U?void 0:U[1]})),null===(N=null==H?void 0:H.buttons)||void 0===N?void 0:N.map(((t,o)=>{if("QUICK_REPLY"===t.type)return e.jsx(b.default,{variableListIndex:o,QRBoptions:null==f?void 0:f.QRBoptions,button:t,originalVariableList:H,updateSelectedQRBTemplateBtn:Z},`${o}`)})),_===o.POD.CHATBOT&&z&&e.jsx(s.DiscountCodeComponent,{discountCode:null===(P=null==Q?void 0:Q.discountCodeExtra)||void 0===P?void 0:P[0],setDiscountCode:null===(R=null==Q?void 0:Q.discountCodeExtra)||void 0===R?void 0:R[1],variableList:x}),null===(S=null==H?void 0:H.buttons)||void 0===S?void 0:S.map(((t,o)=>{var i,n,a;if("COPY_CODE"===t.type)return e.jsx(u.default,{index:o,variable:{variableName:null!==(i=t.text)&&void 0!==i?i:"",updatedValue:null!==(n=t.buttonVariable)&&void 0!==n?n:"",type:"string",isEditableVariable:!0,index:null!==(a=t.index)&&void 0!==a?a:0},showVariableModal:!0,variableList:ee,componentType:"BUTTONS"},o)}))]}))};
@@ -1,8 +1,8 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),a=require("styled-components"),i=require("../../template-preview/TemplatePreview.js");require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../constants/Theme.js"),require("../../template-preview/models/TemplateMeta.js");var r=require("../../template-preview/models/WhatsAppTemplate.js"),o=require("../../template-preview/models/Channels.js"),s=require("../context/templateModalContext.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=l(t),n=l(a);const d=n.default.div`
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),i=require("styled-components"),a=require("../../template-preview/TemplatePreview.js");require("../../template-preview/WhatsApp/WhatsAppLikePreview.js"),require("../../template-preview/WhatsApp/WhatsAppLikePreviewV2.js"),require("../../../constants/Theme.js"),require("../../template-preview/models/TemplateMeta.js");var r=require("../../template-preview/models/WhatsAppTemplate.js"),o=require("../context/templateModalContext.js"),s=require("../utils/getPreviewDimension.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=l(t),n=l(i);const d=n.default.div`
2
2
  position: relative;
3
3
  height: 100%;
4
4
  border-radius: 31px;
5
- width: ${e=>e.channel===o.CHANNEL_TYPE.WHATSAPP?"236px":"300px"};
5
+ width: ${e=>s.getPreviewWidth(e.channel)}px;
6
6
  background-color: white;
7
7
  margin: auto;
8
8
  overflow-y: auto;
@@ -17,4 +17,4 @@
17
17
  height: calc(100% - 17px);
18
18
  border-radius: 16px;
19
19
  overflow-y: auto;
20
- `,h=p.default.forwardRef(((t,a)=>{let{display_content:l,channel:p,template:n,showSampleValues:h}=t;const{pod:m}=s.useTemplateModalContext();return e.jsx("div",{children:e.jsxs(d,Object.assign({channel:p},{children:[e.jsx("img",{alt:"",src:"https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FkNwEVoGlLpVjOsXoO1M8WgvWicP2%2F6f07b850-8b4b-4d58-96cc-8ba6df7b4e4a-Device___Frame.jpg?alt=media&token=253f1bfe-8481-4f54-bdef-3c0a73697d6a",style:{width:p===o.CHANNEL_TYPE.WHATSAPP?236:300,height:443}}),e.jsx(c,Object.assign({ref:a},{children:e.jsx(i.TemplatePreview,{showSampleValues:h,template:n,channel:p,smsSpecificMeta:{smsDisplayContent:l},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:m!==r.POD.CHATBOT,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426,width:236}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:l,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}}})}))]}))})}));h.displayName="MobilePreview",exports.default=h;
20
+ `,h=p.default.forwardRef(((t,i)=>{let{display_content:l,channel:p,template:n,showSampleValues:h}=t;const{pod:m}=o.useTemplateModalContext();return e.jsx("div",{children:e.jsxs(d,Object.assign({channel:p},{children:[e.jsx("img",{alt:"",src:"https://firebasestorage.googleapis.com/v0/b/staging-bikayi.appspot.com/o/bik%2FkNwEVoGlLpVjOsXoO1M8WgvWicP2%2F6f07b850-8b4b-4d58-96cc-8ba6df7b4e4a-Device___Frame.jpg?alt=media&token=253f1bfe-8481-4f54-bdef-3c0a73697d6a",style:{width:s.getPreviewWidth(p),height:443}}),e.jsx(c,Object.assign({ref:i},{children:e.jsx(a.TemplatePreview,{showSampleValues:h,template:n,channel:p,smsSpecificMeta:{smsDisplayContent:l},whatsAppSpecificMeta:{showWhatsAppHeader:!0,whatsAppExtras:m!==r.POD.CHATBOT,containerStyle:{border:"none",borderBottomRightRadius:0,borderBottomLeftRadius:0,minHeight:426,width:240}},size:"small",hideHeader:!0,emailSpecificMeta:{emailDisplayContent:l,hideViewButtonForEmail:!0,emailHtmlContainerId:"template_html_mobile",containerStyle:{height:"100%",width:"100%"},templateContainerStyles:{height:"100%"}}})}))]}))})}));h.displayName="MobilePreview",exports.default=h;
@@ -14,7 +14,7 @@ export interface VariableConnectorProps {
14
14
  showVariableModal?: boolean;
15
15
  variableList?: VariableListInterfaceV2[];
16
16
  setShowDiscountCheckBox?: any;
17
- componentType?: 'HEADER' | 'BODY' | 'BUTTONS' | 'FOOTER';
17
+ componentType?: 'HEADER' | 'BODY' | 'BUTTONS' | 'FOOTER' | 'limited_time_offer';
18
18
  CTAoptions?: ButtonPlaceHolderOptions[];
19
19
  }
20
20
  declare const VariableConnector: React.FC<VariableConnectorProps>;