@solvimon/solvimon-web 0.1.0-alpha.6 → 0.1.0-alpha.7

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 (179) hide show
  1. package/dist/Alert.vue.es-DMPvSykx.js +1 -0
  2. package/dist/Alert.vue.es-DsJ1ckRU.mjs +172 -0
  3. package/dist/Amount.vue.es-C6JE5rL8.mjs +23 -0
  4. package/dist/Amount.vue.es-h8wulbBG.js +1 -0
  5. package/dist/Avatar.vue.es-Ba8ZGfm4.mjs +93 -0
  6. package/dist/Avatar.vue.es-BbyE0AjW.js +1 -0
  7. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-C4Ndo83E.js +1 -0
  8. package/dist/{BillingInformation.vue_vue_type_script_setup_true_lang-DZ1XkSJ3.mjs → BillingInformation.vue_vue_type_script_setup_true_lang-CupcH8TZ.mjs} +6 -4
  9. package/dist/Button.vue.es-6sBk5tBL.mjs +408 -0
  10. package/dist/Button.vue.es-BC4_TItq.js +1 -0
  11. package/dist/CardContent.vue.es-ChEMrFCc.mjs +115 -0
  12. package/dist/CardContent.vue.es-i9ivuGKG.js +1 -0
  13. package/dist/Chip.vue.es-D0fkSe8a.js +1 -0
  14. package/dist/Chip.vue.es-DcW2CjUA.mjs +1576 -0
  15. package/dist/Comparators.vue.es-BdxDqU8o.js +1 -0
  16. package/dist/Comparators.vue.es-DdTKGB80.mjs +406 -0
  17. package/dist/{ContentWithAsideLayout-D_T137tN.mjs → ContentWithAsideLayout-Ct24RV-2.mjs} +1 -1
  18. package/dist/{ContentWithAsideLayout-BZJPhvLh.js → ContentWithAsideLayout-UHovpjZu.js} +1 -1
  19. package/dist/CustomerBillingInformation.vue.es-9rP7-RzN.js +1 -0
  20. package/dist/CustomerBillingInformation.vue.es-DBMl01Es.mjs +175 -0
  21. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-CYTCcMgP.js +1 -0
  22. package/dist/{CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DK6tiecN.mjs → CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-DZJ0xukI.mjs} +14 -11
  23. package/dist/Divider.vue.es-ClFG8QtG.js +1 -0
  24. package/dist/Divider.vue.es-wKkIVBgb.mjs +24 -0
  25. package/dist/DividerText.vue.es-B7oa5Xpn.mjs +72 -0
  26. package/dist/DividerText.vue.es-yiFdPQvo.js +1 -0
  27. package/dist/ErrorNotification.vue.es-Bgw0MIl8.mjs +30 -0
  28. package/dist/ErrorNotification.vue.es-FpRyg0De.js +1 -0
  29. package/dist/FormMessage.vue.es-DFQXxiSC.mjs +46 -0
  30. package/dist/FormMessage.vue.es-LeWoj774.js +1 -0
  31. package/dist/IconButton.vue.es-DNCwwH_j.mjs +825 -0
  32. package/dist/IconButton.vue.es-DiSiGPWO.js +1 -0
  33. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BDitcx8B.js +1 -0
  34. package/dist/{InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-BWXmZmGZ.mjs → InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DsrBsrtk.mjs} +3 -2
  35. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-6yi47YWd.js +1 -0
  36. package/dist/{PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BSn_Zy0Y.mjs → PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-BnKwmJ2s.mjs} +9 -5
  37. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-BE1lWOk9.mjs +1067 -0
  38. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-CC3hm3nx.js +1 -0
  39. package/dist/PaymentMethod.vue.es-DYlnmZh7.js +1 -0
  40. package/dist/PaymentMethod.vue.es-nXZoQjG3.mjs +1255 -0
  41. package/dist/{PricingGroupContent.vue_vue_type_script_setup_true_lang-X7-dfeZP.mjs → PricingGroupContent.vue_vue_type_script_setup_true_lang-BbvDXvIS.mjs} +6 -5
  42. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-CmQILA3q.js +1 -0
  43. package/dist/Section.vue.es-3-H1pUTB.mjs +79 -0
  44. package/dist/Section.vue.es-BuzTXRLP.js +1 -0
  45. package/dist/{SubscriptionsList.vue_vue_type_script_setup_true_lang-AxYjVFUM.mjs → SubscriptionsList.vue_vue_type_script_setup_true_lang-DVhJy0t8.mjs} +23 -20
  46. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-Pq3d7DTb.js +1 -0
  47. package/dist/TooltipParagraph.vue.es-DVJLF9Kv.mjs +136 -0
  48. package/dist/TooltipParagraph.vue.es-kTbRGoPF.js +1 -0
  49. package/dist/TrialChip.vue.es-BHYbW8b6.mjs +759 -0
  50. package/dist/TrialChip.vue.es-C6Xg_5rR.js +1 -0
  51. package/dist/_flatRest.es-BHFPCqZh.mjs +642 -0
  52. package/dist/_flatRest.es-dFffnTpX.js +1 -0
  53. package/dist/adyen-51SvcyqV.mjs +4 -0
  54. package/dist/adyen-DZsyEXkw.js +1 -0
  55. package/dist/api.es-B4qAAJKr.js +1 -0
  56. package/dist/api.es-UkfpLiLL.mjs +83 -0
  57. package/dist/{cloneDeep-DranHQkY.js → cloneDeep-Hs8Pp07F.js} +1 -1
  58. package/dist/cn.es-C7xoIs3C.js +1 -0
  59. package/dist/cn.es-tfxVlz02.mjs +3191 -0
  60. package/dist/component-ZRZIt3ZW.js +1 -0
  61. package/dist/component-dpA83LIN.mjs +6569 -0
  62. package/dist/components/BillingInformation/BillingInformation.ce.d.ts +1 -1
  63. package/dist/components/BillingInformation/BillingInformation.cjs.js +1 -1
  64. package/dist/components/BillingInformation/BillingInformation.es.js +14 -10
  65. package/dist/components/BillingInformationForm/BillingInformationForm.ce.d.ts +1 -1
  66. package/dist/components/BillingInformationForm/BillingInformationForm.cjs.js +1 -1
  67. package/dist/components/BillingInformationForm/BillingInformationForm.es.js +27 -23
  68. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.ce.d.ts +1 -1
  69. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.cjs.js +1 -1
  70. package/dist/components/CustomerPaymentMethods/CustomerPaymentMethods.es.js +3 -3
  71. package/dist/components/Invoice/Invoice.ce.d.ts +1 -1
  72. package/dist/components/Invoice/Invoice.cjs.js +1 -1
  73. package/dist/components/Invoice/Invoice.es.js +2612 -28
  74. package/dist/components/InvoiceDetails/InvoiceDetails.ce.d.ts +1 -1
  75. package/dist/components/InvoiceDetails/InvoiceDetails.cjs.js +1 -1
  76. package/dist/components/InvoiceDetails/InvoiceDetails.es.js +3 -3
  77. package/dist/components/InvoicesList/InvoicesList.ce.d.ts +1 -1
  78. package/dist/components/InvoicesList/InvoicesList.cjs.js +1 -1
  79. package/dist/components/InvoicesList/InvoicesList.es.js +2 -2
  80. package/dist/components/PaymentHistory/PaymentHistory.ce.d.ts +1 -1
  81. package/dist/components/PaymentHistory/PaymentHistory.cjs.js +1 -1
  82. package/dist/components/PaymentHistory/PaymentHistory.es.js +3 -3
  83. package/dist/components/PaymentMethodForm/PaymentMethodForm.ce.d.ts +1 -1
  84. package/dist/components/PaymentMethodForm/PaymentMethodForm.cjs.js +1 -1
  85. package/dist/components/PaymentMethodForm/PaymentMethodForm.es.js +10 -8
  86. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.ce.d.ts +1 -1
  87. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.cjs.js +1 -1
  88. package/dist/components/SubscriptionSchedules/SubscriptionSchedules.es.js +4820 -7
  89. package/dist/components/SubscriptionsList/SubscriptionsList.ce.d.ts +1 -1
  90. package/dist/components/SubscriptionsList/SubscriptionsList.cjs.js +1 -1
  91. package/dist/components/SubscriptionsList/SubscriptionsList.es.js +4 -4
  92. package/dist/components/WalletBalances/WalletBalances.ce.d.ts +1 -1
  93. package/dist/components/WalletBalances/WalletBalances.cjs.js +1 -1
  94. package/dist/components/WalletBalances/WalletBalances.es.js +2 -2
  95. package/dist/core/index.cjs.js +1 -1
  96. package/dist/core/index.es.js +1 -1
  97. package/dist/countryData.es--zJAd6LA.mjs +252 -0
  98. package/dist/countryData.es-D3MFzU92.js +1 -0
  99. package/dist/customer-CJrpbGX4.mjs +32 -0
  100. package/dist/customer-CcQR-JIm.js +1 -0
  101. package/dist/customer.es-D42Md24r.js +1 -0
  102. package/dist/customer.es-LIW2YmLL.mjs +30 -0
  103. package/dist/formatting.es-9hM8aHSg.js +1 -0
  104. package/dist/formatting.es-D5H_ySFv.mjs +68 -0
  105. package/dist/getCountryNameByCode.es-fP52nO_7.js +1 -0
  106. package/dist/getCountryNameByCode.es-ymC9R46j.mjs +8 -0
  107. package/dist/index-CI71bVGE.mjs +2521 -0
  108. package/dist/index-WLSPwi90.js +1 -0
  109. package/dist/index.cjs.js +1 -1
  110. package/dist/index.es-BBJF2O2l.js +1 -0
  111. package/dist/index.es-LCAKs4tH.mjs +438 -0
  112. package/dist/index.es.js +1 -1
  113. package/dist/invoices-3kVHsAXr.js +1 -0
  114. package/dist/{invoices-C7BHqB0g.mjs → invoices-CNK1Ushv.mjs} +15 -1
  115. package/dist/isEmpty.es-Bp1SbWFu.mjs +131 -0
  116. package/dist/isEmpty.es-Dycf-CD_.js +1 -0
  117. package/dist/{paymentMethods-BA7Kt8ti.mjs → paymentMethods-C-ApE-G4.mjs} +2 -1
  118. package/dist/paymentMethods-DZRf0WRl.js +1 -0
  119. package/dist/{payments-NTHUh5je.mjs → payments-CE9U7aKK.mjs} +1 -1
  120. package/dist/{payments-B8W0W6wZ.js → payments-CLt0SExf.js} +1 -1
  121. package/dist/pick.es-BgDAfhAl.js +1 -0
  122. package/dist/pick.es-DdVOyp0Q.mjs +45 -0
  123. package/dist/{registry-DgRnFEVF.mjs → registry-B99ZnfEn.mjs} +1 -2
  124. package/dist/registry-ClZ43bQn.js +1 -0
  125. package/dist/screens/Checkout/Checkout.ce.d.ts +1 -1
  126. package/dist/screens/Checkout/Checkout.cjs.js +1 -1
  127. package/dist/screens/Checkout/Checkout.es.js +1862 -162
  128. package/dist/screens/CustomerOverview/CustomerOverview.ce.d.ts +1 -1
  129. package/dist/screens/CustomerOverview/CustomerOverview.cjs.js +1 -1
  130. package/dist/screens/CustomerOverview/CustomerOverview.es.js +11 -11
  131. package/dist/screens/UpgradeSubscription/UpgradeSubscription.ce.d.ts +1 -1
  132. package/dist/screens/UpgradeSubscription/UpgradeSubscription.cjs.js +1 -1
  133. package/dist/screens/UpgradeSubscription/UpgradeSubscription.es.js +46 -40
  134. package/dist/solvimon-web.css +1 -1
  135. package/dist/subscriptions-CS8HTxzC.js +1 -0
  136. package/dist/{subscriptions-BEoXaAHw.mjs → subscriptions-CoeCrY1I.mjs} +2 -1
  137. package/dist/typeGuards.es-C4nR5FkL.js +1 -0
  138. package/dist/typeGuards.es-fwUoeMCe.mjs +12 -0
  139. package/dist/{useActionDispatchProvider-DmTJ_bqE.js → useActionDispatchProvider-CWVV_xsi.js} +1 -1
  140. package/dist/{useActionDispatchProvider-zSXRlc2S.mjs → useActionDispatchProvider-eO2qFPGv.mjs} +1 -1
  141. package/dist/useCustomer--jycAz--.mjs +25 -0
  142. package/dist/useCustomer-PthyTFLl.js +1 -0
  143. package/dist/useIncrementalLoading-CAdNW-Bf.js +1 -0
  144. package/dist/{useIncrementalLoading-Bgs0mqyb.mjs → useIncrementalLoading-CcnL3flF.mjs} +5 -1
  145. package/dist/{useInvoiceData-B6P2VShe.mjs → useInvoiceData-BiMMoVoW.mjs} +2 -2
  146. package/dist/{useInvoiceData-CS7hLTea.js → useInvoiceData-DvQO_nKz.js} +1 -1
  147. package/dist/useInvoicesList-CHkwSNO9.js +1 -0
  148. package/dist/{useInvoicesList-23Ra-23Z.mjs → useInvoicesList-DFhF_gp7.mjs} +260 -23
  149. package/dist/{usePaymentMethods-BK4unvj2.js → usePaymentMethods-BRQ7-dUr.js} +1 -1
  150. package/dist/{usePaymentMethods-B8Nft16c.mjs → usePaymentMethods-BX2RnHZN.mjs} +2 -2
  151. package/dist/{useService-D-CUtlp3.js → useService-B67YWAcN.js} +1 -1
  152. package/dist/{useService-B4qv5N2D.mjs → useService-DG_zedHV.mjs} +1 -0
  153. package/dist/useWalletBalanceItems-B5FMmoU2.mjs +308 -0
  154. package/dist/useWalletBalanceItems-BY3gq0fc.js +1 -0
  155. package/package.json +14 -8
  156. package/dist/BillingInformation.vue_vue_type_script_setup_true_lang-eRGZRjmq.js +0 -1
  157. package/dist/CustomerPaymentMethods.vue_vue_type_script_setup_true_lang-BvmKLc2H.js +0 -1
  158. package/dist/InvoiceDetailsBlock.vue_vue_type_script_setup_true_lang-DNWspHtC.js +0 -1
  159. package/dist/PaymentHistoryBlock.vue_vue_type_script_setup_true_lang-Cx4c8E4i.js +0 -1
  160. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-Ct26TY0a.js +0 -1
  161. package/dist/PaymentIntegrationForm.vue_vue_type_script_setup_true_lang-WRXecMCj.mjs +0 -6568
  162. package/dist/PricingGroupContent.vue_vue_type_script_setup_true_lang-KnhKv07X.js +0 -1
  163. package/dist/SubscriptionsList.vue_vue_type_script_setup_true_lang-D9_G7CyE.js +0 -1
  164. package/dist/component-DI3AxwdD.mjs +0 -58733
  165. package/dist/component-yWF07boR.js +0 -1
  166. package/dist/index-CzL1ZcGi.mjs +0 -85
  167. package/dist/index-DRdBmZ2-.js +0 -1
  168. package/dist/invoices-CjBHfDXp.js +0 -1
  169. package/dist/paymentMethods-A-5SBmy1.js +0 -1
  170. package/dist/registry-SwmYGFn7.js +0 -1
  171. package/dist/subscriptions-DSi93KpN.js +0 -1
  172. package/dist/useCustomer-DkrBNt5f.mjs +0 -45
  173. package/dist/useCustomer-fK-w7ifj.js +0 -1
  174. package/dist/useIncrementalLoading-BK6N8sYW.js +0 -1
  175. package/dist/useInvoicesList-CIFGVsDj.js +0 -1
  176. package/dist/useWalletBalanceItems-DreHuOra.mjs +0 -105
  177. package/dist/useWalletBalanceItems-NlFk6jPD.js +0 -1
  178. /package/dist/{sprite-DZD704h3-CCc3Mz1x.js → sprite.svg.es-CCc3Mz1x.js} +0 -0
  179. /package/dist/{sprite-DZD704h3-DZD704h3.mjs → sprite.svg.es-DZD704h3.mjs} +0 -0
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-yWF07boR.js"),n=require("../../useService-D-CUtlp3.js"),o=require("../../subscriptions-DSi93KpN.js"),r=require("../../useLoadInitialData-BRg7IWqW.js"),i=e.defineComponent({__name:"SubscriptionSchedules",props:{schedulesData:{type:Array},configuration:{type:Object},isLoading:{type:Boolean}},setup(n){const{$t:o}=t.useIntl();return(r,i)=>(e.openBlock(),e.createBlock(e.unref(t._sfc_main$1g),{"no-border":"","no-spacing":"","content-background":"none",title:e.unref(o)({defaultMessage:"Schedules",description:"Invoices list title",id:"invoices_list.title"})},{default:e.withCtx(()=>[e.createVNode(e.unref(t._sfc_main$E),{schedules:n.schedulesData},null,8,["schedules"])]),_:1},8,["title"]))}});const a=e.defineComponent({__name:"SubscriptionSchedules.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(t){const i=t,{subscription:a,withPlanData:s,get:l}=function({subscriptionId:e}){const{getSubscription:t}=o.createSubscriptionsService(),{data:r,execute:i,apiStatus:a,error:s,isPending:l}=n.useService({service:()=>t({id:e,expanded:!0})});return{subscription:r,withPlanData:e=>e.pricing_plan_schedule_infos.map(e=>({schedule:e.pricing_plan_schedule,selectedPricingPlan:e.pricing_plan_version.pricing_plan,selectedPricingPlanVersion:e.pricing_plan_version})),apiStatus:a,error:s,get:i,isPending:l}}({subscriptionId:i.configuration.subscriptionId}),{isLoading:c}=r.useLoadInitialData(l());return(t,n)=>e.renderSlot(t.$slots,"default",{schedulesData:e.unref(a)?e.unref(s)(e.unref(a)):void 0,isLoading:e.unref(c)})}}),s=e.defineComponent({__name:"SubscriptionSchedules.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(n){const o=n;return(r,s)=>{var l,p,u,d;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(c),environment:n.environment,locale:n.locale,"portal-object":n.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(p=null==(l=n.branding)?void 0:l.colors)?void 0:p.primary,"secondary-color":null==(d=null==(u=n.branding)?void 0:u.colors)?void 0:d.secondary,"experimental-features":n.experimentalFeatures,"log-level":n.logLevel,"on-log":n.onLog,onError:s[0]||(s[0]=e=>r.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(a,e.normalizeProps(e.guardReactiveProps(o)),{default:e.withCtx(({schedulesData:t,isLoading:o})=>[t?(e.openBlock(),e.createBlock(i,{key:0,"schedules-data":t,"is-loading":o,configuration:n.configuration},null,8,["schedules-data","is-loading","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),l=t.defineCustomElement(s),c=t.getComponentName("subscription-schedules");exports.COMPONENT_NAME=c,exports.SolvimonSubscriptionSchedules=l,exports.defineSolvimonSubscriptionSchedules=()=>{customElements.get(c)||customElements.define(c,l)};
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),t=require("../../component-ZRZIt3ZW.js"),i=require("../../Section.vue.es-BuzTXRLP.js"),n=require("../../formatting.es-9hM8aHSg.js"),o=require("../../Comparators.vue.es-BdxDqU8o.js"),l=require("../../CardContent.vue.es-i9ivuGKG.js"),r=require("../../Chip.vue.es-D0fkSe8a.js"),a=require("../../TrialChip.vue.es-C6Xg_5rR.js"),c=require("../../Button.vue.es-BC4_TItq.js"),s=require("../../cn.es-C7xoIs3C.js"),d=require("../../_flatRest.es-dFffnTpX.js"),p=require("../../Alert.vue.es-DMPvSykx.js"),m=require("../../Avatar.vue.es-BbyE0AjW.js"),u=require("../../DividerText.vue.es-yiFdPQvo.js"),g=require("../../Amount.vue.es-h8wulbBG.js"),f=require("../../TooltipParagraph.vue.es-kTbRGoPF.js"),v=require("../../isEmpty.es-Dycf-CD_.js"),_=require("../../typeGuards.es-C4nR5FkL.js"),y=require("../../pick.es-BgDAfhAl.js"),h=require("../../useService-B67YWAcN.js"),k=require("../../subscriptions-CS8HTxzC.js"),b=require("../../useLoadInitialData-BRg7IWqW.js"),x=(e,t=!0)=>{const i=m.getComposedString((e.products??[]).map(e=>e.name??""));return e.name?t?`${e.name} - ${i}`:e.name:i},B=e=>{var t,i;return[...(null==(t=e.enabled_pricings)?void 0:t.map(({pricing_id:e})=>e))??[],...(null==(i=e.override_pricings)?void 0:i.map(e=>"id"in e?e.id:e.original_pricing_id))??[]]},C=({schedule:e,pricingItemConfigIds:t})=>{var i,n;const o=new Date,l=new Set(t),r=null==(i=e.seats_values)?void 0:i.map((e,t)=>({seatsValue:e,index:t})).filter(({seatsValue:e})=>{if(!l.has(e.pricing_item_config_id))return!1;const t=e.set_start_at_to_now||!e.start_at||new Date(e.start_at)<=o,i=!e.end_at||new Date(e.end_at)>o;return t&&i});return null==(n=null==r?void 0:r.sort((e,t)=>{const i=e.seatsValue.set_start_at_to_now?o.getTime():e.seatsValue.start_at?new Date(e.seatsValue.start_at).getTime():0,n=t.seatsValue.set_start_at_to_now?o.getTime():t.seatsValue.start_at?new Date(t.seatsValue.start_at).getTime():0;return n!==i?n-i:t.index-e.index})[0])?void 0:n.seatsValue},V=(e,t)=>{var i;const n=e=>null==e?void 0:e.map(e=>{var t;return{...e,configs:null==(t=e.configs)?void 0:t.map(o)}}),o=e=>{var i,n,l;const r=null==(i=t.included_volumes)?void 0:i.find(t=>t.pricing_item_config_id===e.id),a=C({schedule:t,pricingItemConfigIds:[e.id]})??(null==(n=t.seats_values)?void 0:n.find(t=>t.pricing_item_config_id===e.id));return{...e,...!v.isEmpty(r)&&{default_included_volume:y.pick(r,["amount","number","reset_type"])},...!v.isEmpty(a)&&{default_seats_value:y.pick(a,"number")},conditions:e.conditions?{...e.conditions,configs:null==(l=e.conditions.configs)?void 0:l.map(o)}:void 0}};return{...e,entitlements:(e=>{var i,n,o;const l=t=>{var i;return null==(i=e.products)?void 0:i.some(e=>{var i;return null==(i=e.features)?void 0:i.some(e=>e.id===t.feature_id)})},r=(null==(n=null==(i=t.entitlements)?void 0:i.filter(e=>l(e)))?void 0:n.reduce((t,i)=>{var n,o;const l=null==(o=null==(n=e.entitlements)?void 0:n.find(e=>e.feature_id===i.feature_id))?void 0:o.feature;return l?[...t,{...i,feature:l}]:t},[]))??[];if(v.isEmpty(r))return e.entitlements;return[...(null==(o=e.entitlements)?void 0:o.filter(e=>l(e)&&!(null==r?void 0:r.some(t=>t.feature_id===e.feature_id))))??[],...r]})(e),items:null==(i=e.items)?void 0:i.map(e=>{return{...e,...e.configs&&{configs:e.configs.map(o)},...e.billing_period_configs&&{billing_period_configs:n(e.billing_period_configs)},...e.pricing_currency_configs&&{pricing_currency_configs:(t=e.pricing_currency_configs,null==t?void 0:t.map(e=>{var t;return{...e,configs:null==(t=e.configs)?void 0:t.map(o),billing_period_configs:n(e.billing_period_configs)}}))}};var t})}},N=(e,t,i={displayDisabledAddonPricings:!1})=>{var n,o;const l=e=>i.displayDisabledAddonPricings||"ADDON"!==e.product_type||((e,t)=>{var i,n;return!(!(null==(i=e.enabled_pricings)?void 0:i.some(({pricing_id:e})=>e===t.id))&&!(null==(n=e.override_pricings)?void 0:n.some(e=>"id"in e&&e.id===t.id||e.original_pricing_id===t.id)))})(t,e);return{...e,pricing_categories:null==(o=null==(n=e.pricing_categories)?void 0:n.map(e=>{var i,n,o,r;return{...e,pricing_groups:null==(n=null==(i=e.pricing_groups)?void 0:i.map(e=>{var i,n;return{...e,pricings:null==(n=null==(i=e.pricings)?void 0:i.filter(l))?void 0:n.map(e=>V(e,t))}}))?void 0:n.filter(e=>!v.isEmpty(e.pricings)),pricings:null==(r=null==(o=e.pricings)?void 0:o.filter(l))?void 0:r.map(e=>V(e,t))}}))?void 0:o.filter(e=>i.displayDisabledAddonPricings||!(v.isEmpty(e.pricing_groups)&&v.isEmpty(e.pricings)))}},E=e=>"REVENUE"===e.type,S=e=>"DEDUCTION"===e.type,w=e=>["AT_MOST_ONE","EXACTLY_ONE"].includes(e.selection_constraint),P=(e,t)=>!!e.type&&t.includes(e.type),T=e=>P(e,["FLAT_TOP_UP","TIERED_TOP_UP","STAIR_STEP_TOP_UP"]),D=e=>P(e,["TIERED","TIERED_TOP_UP"]),I=e=>P(e,["STAIR_STEP","STAIR_STEP_TOP_UP"]),$=e=>{var t,i;return[e,...(null==(i=null==(t=e.conditions)?void 0:t.configs)?void 0:i.flatMap(e=>$(e)))??[]]},O=e=>({pricing:t,item:i,config:n})=>{var l,r,a,c;return[(null==t?void 0:t.name)??(null==(r=null==(l=null==t?void 0:t.products)?void 0:l[0])?void 0:r.name),null==(c=null==(a=null==i?void 0:i.product_items)?void 0:a[0])?void 0:c.name,n&&(s=n,(null==(d=s.conditions)?void 0:d.name)?null==(p=s.conditions)?void 0:p.name:(null==(m=s.conditions)?void 0:m.meter_properties)?o.getFormattedComparatorList(e)(null==(u=s.conditions)?void 0:u.meter_properties.map(e=>{var t;return{propertyName:(null==(t=null==e?void 0:e.meter_property)?void 0:t.name)??"Unknown",comparator:e.comparator,value:e.value,values:e.values}}),{hasFormatting:!1}):void 0)].filter(Boolean).join(" - ");var s,d,p,m,u},z=e=>t=>t?t.tier_top_bound&&_.isBandNumber(t.tier_top_bound)?e.formatNumber(+t.tier_top_bound.number):_.isBandCount(t.tier_top_bound)?e.formatNumber(+t.tier_top_bound.count):_.isBandAmount(t.tier_top_bound)?n.formatAmount(t.tier_top_bound.amount):void 0:0,L=e=>(t,i,o)=>o===i.length-1?e.infinite:t.tier_top_bound&&"number"in t.tier_top_bound&&_.isBandNumber(t.tier_top_bound)?e.formatNumber(+t.tier_top_bound.number):t.tier_top_bound&&"count"in t.tier_top_bound&&_.isBandCount(t.tier_top_bound)?e.formatNumber(+t.tier_top_bound.count):t.tier_top_bound&&"amount"in t.tier_top_bound&&_.isBandAmount(t.tier_top_bound)?n.formatAmount(t.tier_top_bound.amount):void 0,R=(e,t)=>{var i,n;return null==(n=null==(i=e.markup)?void 0:i.pricing_item_configs)?void 0:n.find(({ids:e})=>null==e?void 0:e.includes(t.id))},Z={class:"grow items-center truncate"},A=e.defineComponent({__name:"CardHeader",props:{icon:{},iconVariant:{default:"neutral"},title:{},subTitle:{},spacing:{default:"md"},size:{default:"sm"},variant:{default:"default"},uppercase:{type:Boolean,default:!0},cardVariant:{default:"default"}},setup(t){const i=t,n=e.computed(()=>{switch(i.cardVariant){case"error":return"border-red-100";case"dark":return"border-gray-600";default:return"border-gray-100"}});return(i,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex items-center",{"px-2 pt-2":"xs"===t.spacing,"px-4 pt-2":"sm"===t.spacing,"pb-2":["xs","sm"].includes(t.spacing)&&"bordered"===t.variant,"px-4 pt-4":"md"===t.spacing,"pb-4":"md"===t.spacing&&"bordered"===t.variant,"px-8 pt-6":"lg"===t.spacing,"pb-6":"lg"===t.spacing&&"bordered"===t.variant,"border-b":"bordered"===t.variant,[n.value]:"bordered"===t.variant}])},[e.createElementVNode("div",Z,[e.createVNode(e.unref(o._sfc_main$1),{icon:t.icon,title:t.title,"sub-title":t.subTitle,variant:t.iconVariant,size:t.size,uppercase:t.uppercase},{prefix:e.withCtx(()=>[e.renderSlot(i.$slots,"prefix")]),default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),subTitle:e.withCtx(()=>[e.renderSlot(i.$slots,"subTitle")]),suffix:e.withCtx(()=>[e.renderSlot(i.$slots,"title-suffix")]),_:3},8,["icon","title","sub-title","variant","size","uppercase"])]),e.renderSlot(i.$slots,"right")],2))}}),M={class:"grow min-w-0"},F={key:0},U=e.defineComponent({__name:"CollapsibleCard",props:{isOpen:{type:Boolean,default:!1},isControlled:{type:Boolean},title:{},icon:{},iconVariant:{},spacing:{default:"md"},borderStyle:{},isExpandContentHidden:{type:Boolean,default:!1},withLeftAccent:{type:Boolean,default:!1},cappedWidth:{type:Boolean},variant:{default:"default"},shadowSize:{},borderRadius:{},rootClass:{},wrapperClass:{}},emits:["toggle","toggled"],setup(t,{emit:i}){const n=t,o=i,[r,p]=d.useToggle(!n.isOpen),m=()=>{n.isControlled?o("toggle"):p()};e.watch(()=>r.value,e=>{o("toggled",e)}),e.watch(()=>n.isOpen,e=>{n.isControlled&&p(!e)});const u=e.computed(()=>{switch(n.variant){case"error":return"border-red-50 bg-red-50";case"dark":return"bg-gray-800";default:return""}}),g=e.computed(()=>"error"===n.variant?"bg-red-200":""),f=e.computed(()=>["ease-in-out duration-200 hover:shadow-md",u.value].join(" "));return(i,n)=>(e.openBlock(),e.createBlock(l._sfc_main,{spacing:"none","root-class":f.value,"border-style":t.borderStyle},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(s.cn)(t.withLeftAccent?"flex p-1":""))},[t.withLeftAccent?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["mr-2 w-1 rounded-md",g.value])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",M,[e.renderSlot(i.$slots,"pre-header"),e.createVNode(A,{"data-testid":"card-header",title:t.title,icon:t.icon,"icon-variant":t.iconVariant,spacing:t.spacing,class:e.normalizeClass(["cursor-pointer",{"pb-4":"md"===t.spacing,"pb-6":"lg"===t.spacing}]),variant:"bordered",tabindex:"0","card-variant":t.variant,onClick:e.withModifiers(m,["stop"]),onKeyup:e.withKeys(m,["enter"])},e.createSlots({prefix:e.withCtx(()=>[e.renderSlot(i.$slots,"title-prefix")]),default:e.withCtx(()=>[e.renderSlot(i.$slots,"title")]),"title-suffix":e.withCtx(()=>[e.renderSlot(i.$slots,"title-suffix")]),_:2},[t.isExpandContentHidden?void 0:{name:"right",fn:e.withCtx(()=>[i.$slots.right?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:n[0]||(n[0]=e.withModifiers(()=>{},["stop"])),onKeyup:n[1]||(n[1]=e.withKeys(e.withModifiers(()=>{},["stop"]),["enter"]))},[e.renderSlot(i.$slots,"right")],32)):e.createCommentVNode("",!0),e.createVNode(c._sfc_main$1,{icon:e.unref(r)?"unfold_more":"unfold_less",size:"md",class:e.normalizeClass({"text-white":"dark"===t.variant})},null,8,["icon","class"])]),key:"0"}]),1032,["title","icon","icon-variant","spacing","class","card-variant"]),t.isExpandContentHidden?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(a._sfc_main,{key:0},{default:e.withCtx(()=>[e.unref(r)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",F,[e.createVNode(l._sfc_main$1,{spacing:t.spacing,class:"pt-0"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},8,["spacing"])]))]),_:3}))])],2)]),_:3},8,["root-class","border-style"]))}}),G="w-6",H=e.defineComponent({__name:"CollapsibleList",props:{type:{default:"ordered"},hasAddButton:{type:Boolean},i18n:{}},emits:["add"],setup(t){const i=t,n=e.computed(()=>"ordered"===i.type?"ol":"ul");return(i,o)=>{var l;return e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value),null,{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3})),e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col items-center justify-center",e.unref(G)])},[t.hasAddButton?(e.openBlock(),e.createBlock(e.unref(c._sfc_main),{key:0,square:"","aria-label":(null==(l=t.i18n)?void 0:l.addButtonLabel)??"Add item",color:"gray",variant:"outline",size:"sm","icon-prefix":"add",onClick:o[0]||(o[0]=e=>i.$emit("add"))},null,8,["aria-label"])):e.createCommentVNode("",!0)],2)])}}}),j={tooltipCollapse:"Close",tooltipExpand:"Open"},q={class:"flex flex-col"},W=["aria-label"],K={class:"flex grow justify-between items-center select-none"},J={class:"flex gap-2 items-center"},X={key:0},Y={class:"flex gap-6"},Q={class:"pt-5 grow"},ee={key:0,class:"pb-6"},te=e.defineComponent({__name:"CollapsibleListItem",props:{hasContinuedPreline:{type:Boolean,default:!0},itemNumber:{default:1},i18n:{default:()=>j},isOpen:{type:Boolean},hideCollapseIcon:{type:Boolean,default:!1}},emits:["toggle"],setup(i){const n=i,o=e.computed(()=>n.isOpen?"unfold_less":"unfold_more");return(n,l)=>(e.openBlock(),e.createElementBlock("li",q,[e.createElementVNode("button",{type:"button",class:"flex gap-6 items-center","aria-label":i.isOpen?i.i18n.tooltipCollapse:i.i18n.tooltipExpand,onClick:l[0]||(l[0]=e.withModifiers(e=>n.$emit("toggle"),["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center justify-center border rounded bg-white h-6 shadow-sm select-none",e.unref(G)])},[e.renderSlot(n.$slots,"icon",{},()=>[e.createVNode(t._sfc_main,{tag:"span",variant:"body-xs",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.itemNumber),1)]),_:1})])],2),e.createElementVNode("div",K,[e.createElementVNode("div",null,[e.renderSlot(n.$slots,"left")]),e.createElementVNode("div",J,[n.$slots.right?(e.openBlock(),e.createElementBlock("div",X,[e.renderSlot(n.$slots,"right")])):e.createCommentVNode("",!0),i.hideCollapseIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c._sfc_main$1,{key:1,icon:o.value,size:"sm",class:"h-6"},null,8,["icon"]))])])],8,W),e.createElementVNode("div",Y,[e.createElementVNode("div",{class:e.normalizeClass(["flex justify-center relative shrink-0",e.unref(G)])},[e.createElementVNode("div",{class:e.normalizeClass(["w-0.5 h-full pointer-events-none",[i.hasContinuedPreline?"bg-gray-100":"bg-gradient-to-b from-gray-100 to-transparent"]])},null,2)],2),e.createElementVNode("div",Q,[e.createVNode(a._sfc_main,null,{default:e.withCtx(()=>[i.isOpen?(e.openBlock(),e.createElementBlock("div",ee,[e.renderSlot(n.$slots,"default")])):e.createCommentVNode("",!0)]),_:3})])])]))}}),ie=e.defineComponent({__name:"CombinedVolumeChip",props:{i18n:{},placement:{}},setup:t=>(i,n)=>(e.openBlock(),e.createBlock(f._sfc_main,{offset:4,placement:t.placement},{default:e.withCtx(()=>[e.createVNode(r._sfc_main,{color:"dark"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.i18n.combinedVolume),1)]),_:1})]),tooltip:e.withCtx(()=>[e.createVNode(f.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(f._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.i18n.description),1)]),_:1})]),_:1})]),_:1},8,["placement"]))}),ne={class:"flex flex-col gap-1"},oe={class:"text-base text-gray-900"},le=e.defineComponent({__name:"PricingItemHeader",props:{item:{},creditTypesById:{}},setup:i=>(n,o)=>(e.openBlock(),e.createElementBlock("div",ne,[e.createElementVNode("h4",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.item.product_items,i=>(e.openBlock(),e.createBlock(t._sfc_main,{key:i.id,tag:"span",class:"flex flex-wrap items-center gap-3",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.name),1)]),_:2},1024))),128))])]))}),re={defaultPricing:"Pricing",combinedVolume:{combinedVolume:"Combined volume",description:"Total volume sets the tier, applied proportionally to the selected rules."},topUpChip:{topUp:"Top up",defaultTooltip:"Top up allows moving unused volume over to the next billing cycle",tieredTooltip:{blockSize:"Includes prior volume to determine the tier and unused volume will move over",nonBlockSize:"Includes prior volume to determine the tier"},rollover:{title:"Rollover",tooltip:"Top up is applied to the next following schedule's billing cycles"}},splitBy:"Split by"},ae={tiered:{nonBlockSize:{rolloverDescription:"Includes prior volume to determine the tier, including volume from prior schedule's billing cycles",nonRolloverDescription:"Prior volume is included to determine the tier"},blockSize:{rolloverDescription:"Includes prior volume to determine the tier and unused volume will move over, including volume from adjacent schedule's billing cycles",nonRolloverDescription:"Includes prior volume to determine the tier and unused volume will move over to the following billing cycles"}},nonRolloverDescription:"Unused volume will be moved over to the next billing cycle",rolloverDescription:"Unused volume will be moved over to the next billing cycle, including the next schedule's billing cycle"},ce={...re,formatBillingPeriod:n.formatBillingPeriod,formatAmount:n.formatAmount,formatNumber:e=>new Intl.NumberFormat("en-US").format(e),billed:"Billed",from:"From",upTo:"Up to",feeFloor:"Fee floor",feeCap:"Fee cap",price:"Price",pricePerStep:()=>"Price / Step",pricePerUnit:()=>"Price / Unit",percentage:"Percentage",per:"Per",infinite:"infinite",topUpDescription:ae,fixedAmount:"Fixed amount"},se={...re,topUpDescription:ae,notBilled:"Not billed",passThrough:"Pass through",perNumberOfUnits:(e,t)=>"per "+(Number(e)>1?`${e} ${(null==t?void 0:t.plural)??"units"}`:`${(null==t?void 0:t.singular)??"unit"}`),ofAmount:()=>"of amount",with:"with",aMinimumOf:"a minimum of",and:"and",aMaximumOf:"a maximum of",perSeat:"per seat",billedInAdvance:"billed in advance",oneOff:"one-off",formatBillingPeriod:n.formatBillingPeriod},de={...se,...ce,includedVolumeAmountPerSchedule:e=>`with <strong class="text-primary-600">${new Intl.NumberFormat("en-US",{style:"currency",currencyDisplay:"symbol",currency:e.currency,maximumFractionDigits:10}).format(Number(e.quantity))}</strong> free amount per schedule included`,includedVolumeAmountPerBillingPeriod:e=>`with <strong class="text-primary-600">${new Intl.NumberFormat("en-US",{style:"currency",currencyDisplay:"symbol",currency:e.currency,maximumFractionDigits:10}).format(Number(e.quantity))}</strong> free amount per billing period included`,includedVolumeUnitsPerSchedule:e=>`with <strong class="text-primary-600">${e} unit${"1"===e?"":"s"}</strong> per schedule included`,includedVolumeUnitsPerBillingPeriod:e=>`with <strong class="text-primary-600">${e} unit${"1"===e?"":"s"}</strong> per billing period included`,includedSeats:e=>`with default <strong class="text-primary-600">${e}</strong> seat${"1"===e?"":"s"}`},pe={class:"inline-flex items-center"},me=e.defineComponent({__name:"TopUpChip",props:{i18n:{},placement:{},hasTooltip:{type:Boolean},pricingItemConfig:{}},setup(t){const i=t,n=e.computed(()=>{var e,t;return!!(null==(t=null==(e=i.pricingItemConfig)?void 0:e.top_up)?void 0:t.rollover)}),o=e.computed(()=>({color:"dark",hasChipAfter:n.value})),l={color:"dark",dark:!0,hasChipBefore:!0},a=e.computed(()=>{var e,t;return null==(t=null==(e=i.pricingItemConfig)?void 0:e.bands)?void 0:t.some(e=>e.block_size)}),c=e.computed(()=>D(i.pricingItemConfig)&&a.value?i.i18n.tieredTooltip.blockSize:D(i.pricingItemConfig)&&!a.value?i.i18n.tieredTooltip.nonBlockSize:i.i18n.defaultTooltip);return(i,a)=>(e.openBlock(),e.createElementBlock("span",pe,[t.hasTooltip?(e.openBlock(),e.createBlock(f._sfc_main,{key:0,offset:4,placement:t.placement},{default:e.withCtx(()=>[e.createVNode(r._sfc_main,e.normalizeProps(e.guardReactiveProps(o.value)),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.i18n.topUp),1)]),_:1},16)]),tooltip:e.withCtx(()=>[e.createVNode(f.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(f._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})]),_:1})]),_:1},8,["placement"])):(e.openBlock(),e.createBlock(r._sfc_main,e.normalizeProps(e.mergeProps({key:1},o.value)),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.i18n.topUp),1)]),_:1},16)),n.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[t.hasTooltip?(e.openBlock(),e.createBlock(f._sfc_main,{key:0,offset:4,placement:t.placement},{default:e.withCtx(()=>[e.createVNode(r._sfc_main,e.normalizeProps(e.guardReactiveProps(l)),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.i18n.rollover.title),1)]),_:1},16)]),tooltip:e.withCtx(()=>[e.createVNode(f.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(f._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.i18n.rollover.tooltip),1)]),_:1})]),_:1})]),_:1},8,["placement"])):(e.openBlock(),e.createBlock(r._sfc_main,e.normalizeProps(e.mergeProps({key:1},l)),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.i18n.rollover.title),1)]),_:1},16))],64)):e.createCommentVNode("",!0)]))}}),ue={class:"flex items-center gap-2"},ge={class:"flex items-center gap-2"},fe={key:0},ve=e.defineComponent({__name:"PricingItemConfigHeader",props:{config:{},i18n:{},hasTooltip:{type:Boolean,default:!0},isCombinedPricing:{type:Boolean}},setup(i){const n=i,l=e.computed(()=>n.i18n??re),r=e.computed(()=>{var e,t;return!v.isEmpty(null==(t=null==(e=n.config)?void 0:e.conditions)?void 0:t.meter_properties)});return(n,a)=>(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",ge,[e.createVNode(t._sfc_main,{class:"line-clamp-1","no-spacing":"",shade:"light",variant:"body",weight:"semibold"},{default:e.withCtx(()=>{var n,a,s,d,p,m;return[(null==(n=i.config.conditions)?void 0:n.name)||r.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(null==(a=i.config.conditions)?void 0:a.name)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(null==(s=i.config.conditions)?void 0:s.name),1)],64)):e.createCommentVNode("",!0),r.value&&(null==(p=null==(d=i.config)?void 0:d.conditions)?void 0:p.meter_properties)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[i.hasTooltip&&(null==(m=i.config.conditions)?void 0:m.name)?(e.openBlock(),e.createBlock(f._sfc_main,{key:0,variant:"outline",class:"ml-1"},{default:e.withCtx(()=>[e.createVNode(c._sfc_main$1,{icon:"help",size:"2xs",class:"rounded drop-shadow-sm hover:bg-gray-50 hover:cursor-default"})]),tooltip:e.withCtx(()=>[e.createVNode(f.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(t._sfc_main,{variant:"body-sm","no-spacing":"",shade:"light"},{default:e.withCtx(()=>{var t,n;return[e.createVNode(o._sfc_main,{comparators:null==(n=null==(t=i.config)?void 0:t.conditions)?void 0:n.meter_properties},null,8,["comparators"])]}),_:1})]),_:1})]),_:1})):(e.openBlock(),e.createBlock(t._sfc_main,{key:1,weight:"normal",shade:"light",tag:"span"},{default:e.withCtx(()=>{var t,n,l;return[(null==(t=i.config.conditions)?void 0:t.name)?(e.openBlock(),e.createElementBlock("span",fe," - ")):e.createCommentVNode("",!0),e.createVNode(o._sfc_main,{comparators:null==(l=null==(n=i.config)?void 0:n.conditions)?void 0:l.meter_properties,display:"inline"},null,8,["comparators"])]}),_:1}))],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.value.defaultPricing),1)],64))]}),_:1}),i.config.volume_group_reference?(e.openBlock(),e.createBlock(ie,{key:0,i18n:l.value.combinedVolume},null,8,["i18n"])):e.createCommentVNode("",!0),e.unref(T)(i.config)?(e.openBlock(),e.createBlock(me,{key:1,i18n:l.value.topUpChip,"pricing-item-config":i.config},null,8,["i18n","pricing-item-config"])):e.createCommentVNode("",!0)]),e.renderSlot(n.$slots,"override-tooltip")]))}}),_e=e.defineComponent({__name:"TopUpDescription",props:{i18n:{},pricingItemConfig:{}},setup(i){const n=i,o=e.computed(()=>{var e;return!!(null==(e=n.pricingItemConfig.top_up)?void 0:e.rollover)}),l=e.computed(()=>{var e;return null==(e=n.pricingItemConfig.bands)?void 0:e.some(e=>!!e.block_size)}),r=e.computed(()=>D(n.pricingItemConfig)&&l.value?o.value?n.i18n.tiered.blockSize.rolloverDescription:n.i18n.tiered.blockSize.nonRolloverDescription:D(n.pricingItemConfig)&&!l.value?o.value?n.i18n.tiered.nonBlockSize.rolloverDescription:n.i18n.tiered.nonBlockSize.nonRolloverDescription:o.value?n.i18n.rolloverDescription:n.i18n.nonRolloverDescription);return(i,n)=>(e.openBlock(),e.createBlock(t._sfc_main,{variant:"body-xs",class:"italic text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1}))}}),ye={class:"flex justify-between items-start"},he={key:0,class:"flex items-center gap-2"},ke={class:"flex flex-col gap-1"},be={class:"flex items-center gap-2"},xe={key:0,class:"flex justify-center gap-2"},Be={key:0,class:"text-gray-600 ml-auto"},Ce={key:1,class:"text-gray-600 ml-auto"},Ve={key:0,class:"ml-4 text-gray-600 flex flex-col empty:hidden shrink-0"},Ne={class:"flex justify-end items-center"},Ee={"data-testid":"flat-fixed-none-amount"},Se={"data-testid":"flat-fixed-none-per-units",class:"pl-1"},we={key:0,class:"pl-1"},Pe={"data-testid":"flat-fixed-none-credits-label",class:"text-primary-600 font-semibold"},Te={"data-testid":"flat-fixed-none-per-units",class:"pl-1"},De={key:0,class:"pl-1"},Ie={class:"text-primary-600 font-semibold"},$e={class:"pl-1"},Oe={key:0,class:"pl-1"},ze={key:1,class:"mr-1"},Le={key:3,class:"mr-1"},Re={key:3,class:"ml-2 flex items-center"},Ze={key:0,class:"text-gray-600 flex flex-col shrink-0"},Ae={class:"flex items-center"},Me={key:2,class:"pl-1"},Fe={key:3,class:"pl-1"},Ue={key:4,class:"italic pl-1 shrink-9"},Ge={key:5,class:"ml-2 flex items-center"},He={key:1,class:"text-gray-600 flex flex-col shrink-0"},je={class:"flex items-center"},qe={class:"pl-1"},We={key:0,class:"italic"},Ke={key:2,class:"ml-2 flex items-center"},Je={key:2,class:"text-gray-600 flex flex-col shrink-0"},Xe={class:"flex items-center"},Ye={class:"pl-1"},Qe={key:1,class:"pl-1"},et={key:2,class:"italic pl-1"},tt={key:3,class:"ml-2 flex items-center"},it=e.defineComponent({__name:"FlatFixedNonePricingRule",props:{config:{},item:{},areNonBillableItemsVisible:{type:Boolean},i18n:{},isCombinedPricing:{type:Boolean},showConfigHeader:{type:Boolean,default:!0},showDefaultValues:{type:Boolean,default:!0},creditTypesById:{}},setup(i){const n=i,{formatMessage:o}=t.useIntl(),l=e.computed(()=>n.i18n??se),r=e.computed(()=>T(n.config)),a=o({defaultMessage:"unit",id:"lWOCGz",description:"Fallback singular unit label for pricing rule display"}),s=o({defaultMessage:"units",id:"Vl9vDx",description:"Fallback plural unit label for pricing rule display"}),d=e.computed(()=>n.item.product_items&&n.item.product_items[0]),p=e.computed(()=>{var e,t,i,o,l,r,c,p;if("CREDITS"===(null==(e=d.value)?void 0:e.model_type)){const e=null==(t=d.value.credits)?void 0:t.credit_type_id,l=e?null==(o=null==(i=n.creditTypesById)?void 0:i[e])?void 0:o.unit_name:void 0;return{singular:(null==l?void 0:l.singular)||a,plural:(null==l?void 0:l.plural)||s}}return{singular:(null==(r=null==(l=d.value)?void 0:l.unit_name)?void 0:r.singular)||a,plural:(null==(p=null==(c=d.value)?void 0:c.unit_name)?void 0:p.plural)||s}}),m=e.computed(()=>{var e,t,i,n;return{singular:(null==(t=null==(e=d.value)?void 0:e.unit_name)?void 0:t.singular)||a,plural:(null==(n=null==(i=d.value)?void 0:i.unit_name)?void 0:n.plural)||s}}),u=e.computed(()=>{var e,t,i,o;return null==(o=null==(i=null==(t=null==(e=n.config.split_pricing)?void 0:e.meter_properties)?void 0:t.map(e=>{var t;return null==(t=e.meter_property)?void 0:t.name}))?void 0:i.filter(e=>!!e))?void 0:o.join(",")}),v=e.computed(()=>n.showConfigHeader||n.config.split_pricing),y=e.computed(()=>!!n.config.use_fallback_currency&&!!n.config.fallback_currency),h=e.computed(()=>`Based on fallback currency – ${n.config.fallback_currency}`),k=e.computed(()=>{var e,t;return null==(t=null==(e=n.config.bands)?void 0:e[0])?void 0:t.credits}),b=e.computed(()=>{var e,t,i,o,l,r;const a=null==(e=k.value)?void 0:e.credit_type_id,c=null==(t=k.value)?void 0:t.quantity;if(!c)return"";const s=a?null==(i=n.creditTypesById)?void 0:i[a]:void 0;if(!s)return c;const d=1===Number(c)?(null==(o=s.unit_name)?void 0:o.singular)??s.name:(null==(l=s.unit_name)?void 0:l.plural)??(null==(r=s.unit_name)?void 0:r.singular)??s.name;return d?`${c} ${d}`:c});return(n,o)=>{var a,s,k,x,B,C,V;return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",ye,[v.value?(e.openBlock(),e.createElementBlock("div",he,[e.createElementVNode("div",ke,[e.createElementVNode("div",be,[i.showConfigHeader?(e.openBlock(),e.createBlock(ve,{key:0,config:i.config,i18n:l.value},{"override-tooltip":e.withCtx(()=>[e.renderSlot(n.$slots,"override-tooltip")]),_:3},8,["config","i18n"])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createBlock(f._sfc_main,{key:1,variant:"outline",placement:"top"},{tooltip:e.withCtx(()=>[e.createVNode(f.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(f._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(c._sfc_main$1,{icon:"change_circle",class:"text-gray-500"})]),_:1})):e.createCommentVNode("",!0)]),i.config.split_pricing?(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(t._sfc_main,{variant:"label",tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.splitBy),1)]),_:1}),e.createVNode(t._sfc_main,{tag:"span",variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.value),1)]),_:1})])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),["NONE","PASS_THROUGH"].includes(i.config.type)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},["NONE"===i.config.type?(e.openBlock(),e.createElementBlock("div",Be,e.toDisplayString(l.value.notBilled),1)):e.createCommentVNode("",!0),"PASS_THROUGH"===i.config.type?(e.openBlock(),e.createElementBlock("div",Ce,e.toDisplayString(l.value.passThrough),1)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},["USAGE_BASED"===d.value.model_type||"CREDITS"===d.value.model_type?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",null,[e.createElementVNode("div",Ne,[i.config.bands&&i.config.bands[0].amount?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Ee,[e.createVNode(g._sfc_main,{value:i.config.bands[0].amount,highlighted:""},null,8,["value"])]),e.createElementVNode("span",Se,e.toDisplayString(l.value.perNumberOfUnits((null==(a=i.config.bands[0])?void 0:a.block_size)&&e.unref(_.isBandNumber)(i.config.bands[0].block_size)?i.config.bands[0].block_size.number:"1",p.value)),1),i.config.billing_period?(e.openBlock(),e.createElementBlock("span",we,e.toDisplayString(l.value.formatBillingPeriod(i.config.billing_period)),1)):e.createCommentVNode("",!0)],64)):i.config.bands&&(null==(s=i.config.bands[0].credits)?void 0:s.quantity)&&(null==(k=i.config.bands[0].credits)?void 0:k.credit_type_id)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",Pe,e.toDisplayString(b.value),1),e.createElementVNode("span",Te,e.toDisplayString(l.value.perNumberOfUnits((null==(x=i.config.bands[0])?void 0:x.block_size)&&e.unref(_.isBandNumber)(i.config.bands[0].block_size)?i.config.bands[0].block_size.number:"1",m.value)),1),i.config.billing_period?(e.openBlock(),e.createElementBlock("span",De,e.toDisplayString(l.value.formatBillingPeriod(i.config.billing_period)),1)):e.createCommentVNode("",!0)],64)):i.config.bands&&"string"==typeof i.config.bands[0].percentage?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("span",Ie,e.toDisplayString(i.config.bands[0].percentage)+"% ",1),e.createElementVNode("span",$e,e.toDisplayString(l.value.ofAmount(null==(B=d.value.unit_name)?void 0:B.singular)),1),i.config.billing_period?(e.openBlock(),e.createElementBlock("span",Oe,e.toDisplayString(l.value.formatBillingPeriod(i.config.billing_period)),1)):e.createCommentVNode("",!0),i.config.bands[0].minimum_amount||i.config.bands[0].maximum_amount?(e.openBlock(),e.createElementBlock("span",ze," , "+e.toDisplayString(l.value.with),1)):e.createCommentVNode("",!0),i.config.bands[0].minimum_amount?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(l.value.aMinimumOf)+" ",1),e.createVNode(g._sfc_main,{value:i.config.bands[0].minimum_amount,highlighted:"",class:"mx-1"},null,8,["value"])],64)):e.createCommentVNode("",!0),i.config.bands[0].minimum_amount&&i.config.bands[0].maximum_amount?(e.openBlock(),e.createElementBlock("span",Le,e.toDisplayString(l.value.and),1)):e.createCommentVNode("",!0),i.config.bands[0].maximum_amount?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(l.value.aMaximumOf)+" ",1),e.createVNode(g._sfc_main,{value:i.config.bands[0].maximum_amount,highlighted:"",class:"ml-1"},null,8,["value"])],64)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),n.$slots["price-line-additions"]?(e.openBlock(),e.createElementBlock("span",Re,[e.renderSlot(n.$slots,"price-line-additions")])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"included")])])):e.createCommentVNode("",!0),i.isCombinedPricing?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},["RECURRING"===d.value.model_type?(e.openBlock(),e.createElementBlock("div",Ze,[e.createElementVNode("div",null,[e.createElementVNode("div",Ae,[i.config.bands&&i.config.bands[0].amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:i.config.bands[0].amount,highlighted:""},null,8,["value"])):i.config.bands&&i.config.bands[0].fixed_amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:1,value:i.config.bands[0].fixed_amount,highlighted:""},null,8,["value"])):e.createCommentVNode("",!0),(null==(C=i.config.billing_period)?void 0:C.type)?(e.openBlock(),e.createElementBlock("div",Me,e.toDisplayString(l.value.formatBillingPeriod(i.config.billing_period)),1)):(e.openBlock(),e.createElementBlock("div",Fe,"per billing period")),i.config.billing_in_advance?(e.openBlock(),e.createElementBlock("span",Ue," ("+e.toDisplayString(l.value.billedInAdvance)+") ",1)):e.createCommentVNode("",!0),n.$slots["price-line-additions"]?(e.openBlock(),e.createElementBlock("span",Ge,[e.renderSlot(n.$slots,"price-line-additions")])):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"included")])):e.createCommentVNode("",!0),"ONE_OFF"===d.value.model_type?(e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("div",null,[e.createElementVNode("div",je,[i.config.bands&&i.config.bands[0].amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:i.config.bands[0].amount,highlighted:""},null,8,["value"])):i.config.bands&&i.config.bands[0].fixed_amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:1,value:i.config.bands[0].fixed_amount,highlighted:""},null,8,["value"])):e.createCommentVNode("",!0),e.createElementVNode("div",qe,[e.createTextVNode(e.toDisplayString(l.value.oneOff)+" ",1),i.config.billing_in_advance?(e.openBlock(),e.createElementBlock("span",We," ("+e.toDisplayString(l.value.billedInAdvance)+") ",1)):e.createCommentVNode("",!0)]),n.$slots["price-line-additions"]?(e.openBlock(),e.createElementBlock("span",Ke,[e.renderSlot(n.$slots,"price-line-additions")])):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"included")])):e.createCommentVNode("",!0),"PER_SEAT"===d.value.model_type?(e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("div",null,[e.createElementVNode("div",Xe,[i.config.bands&&i.config.bands[0].amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:i.config.bands[0].amount,highlighted:""},null,8,["value"])):e.createCommentVNode("",!0),e.createElementVNode("span",Ye,e.toDisplayString(l.value.perSeat),1),(null==(V=i.config.billing_period)?void 0:V.type)?(e.openBlock(),e.createElementBlock("div",Qe,e.toDisplayString(l.value.formatBillingPeriod(i.config.billing_period)),1)):e.createCommentVNode("",!0),i.config.billing_in_advance?(e.openBlock(),e.createElementBlock("span",et," ("+e.toDisplayString(l.value.billedInAdvance)+") ",1)):e.createCommentVNode("",!0),n.$slots["price-line-additions"]?(e.openBlock(),e.createElementBlock("span",tt,[e.renderSlot(n.$slots,"price-line-additions")])):e.createCommentVNode("",!0)])]),e.renderSlot(n.$slots,"included")])):e.createCommentVNode("",!0)],64))],64)):e.createCommentVNode("",!0)],64))]),r.value?(e.openBlock(),e.createBlock(_e,{key:0,i18n:l.value.topUpDescription,class:"mt-1","pricing-item-config":i.config},null,8,["i18n","pricing-item-config"])):e.createCommentVNode("",!0)])}}}),nt={class:"flex items-start justify-between"},ot={key:0,class:"flex gap-2"},lt={key:1,class:"flex justify-center gap-2"},rt={class:"mt-3 overflow-clip rounded border"},at={class:"w-full table-auto text-gray-600"},ct=["colspan"],st={class:"border-t"},dt={class:"px-2 py-1 text-left"},pt={class:"px-2 py-1 text-left"},mt={key:0,class:"px-2 py-1 text-right"},ut={key:1,class:"px-2 py-1 text-right"},gt={key:2,class:"px-2 py-1 text-right"},ft={class:"px-2 py-1 text-left"},vt={class:"px-2 py-1 text-left"},_t={key:4,class:"pr-2 text-right"},yt={class:"px-2 py-1"},ht={class:"px-2 py-1"},kt={key:0,class:"px-2 py-1 text-right"},bt={key:1,class:"px-2 py-1 text-right"},xt={key:2,class:"px-2 py-1 text-right"},Bt={class:"px-2 py-1"},Ct={class:"px-2 py-1"},Vt={key:4,class:"px-2 py-1 text-right"},Nt={key:1,class:"mt-2"},Et=e.defineComponent({__name:"TieredSteppedPricingRule",props:{config:{},itemIndex:{},configIndex:{},item:{},i18n:{},isCombinedPricing:{type:Boolean},showConfigHeader:{type:Boolean,default:!0},creditTypesById:{}},setup(i){const o=i;e.useSlots();const l=e.computed(()=>o.i18n??ce),r=e.computed(()=>{var e,t,i,n,l,r;return(null==(i=null==(t=null==(e=o.config.bands)?void 0:e.find(e=>{var t;return null==(t=e.credits)?void 0:t.credit_type_id}))?void 0:t.credits)?void 0:i.credit_type_id)??(null==(r=null==(l=null==(n=o.item.product_items)?void 0:n[0])?void 0:l.credits)?void 0:r.credit_type_id)}),a=e.computed(()=>{var e,t,i,n,l;if(r.value){const i=null==(e=o.creditTypesById)?void 0:e[r.value];if(i)return(null==(t=i.unit_name)?void 0:t.singular)||"unit"}return(null==(l=null==(n=null==(i=o.item.product_items)?void 0:i[0])?void 0:n.unit_name)?void 0:l.singular)||"unit"}),s=e.computed(()=>{if(["TIERED","TOP_TIERED"].includes(o.config.type)&&o.config.bands)for(const e of o.config.bands)if(e.minimum_amount||e.maximum_amount)return!0;return!1}),d=e.computed(()=>D(o.config)?"TIERED":I(o.config)?"STAIR_STEP":o.config.type),p=e.computed(()=>T(o.config)),m=e.computed(()=>{var e;return null==(e=o.config.bands)?void 0:e.some(e=>e.block_size)}),u=e.computed(()=>{var e;return null==(e=o.config.bands)?void 0:e.some(e=>e.fixed_amount)}),v=e.computed(()=>{var e;return null==(e=o.config.bands)?void 0:e.some(e=>e.amount)}),y=e.computed(()=>{var e;return null==(e=o.config.bands)?void 0:e.some(e=>e.percentage)}),h=e.computed(()=>{var e,t,i,n;return null==(n=null==(i=null==(t=null==(e=o.config.split_pricing)?void 0:e.meter_properties)?void 0:t.map(e=>{var t;return null==(t=e.meter_property)?void 0:t.name}))?void 0:i.filter(e=>!!e))?void 0:n.join(", ")}),k=e.computed(()=>o.showConfigHeader||o.config.split_pricing),b=e.computed(()=>!!o.config.use_fallback_currency&&!!o.config.fallback_currency),x=e.computed(()=>`Based on fallback currency – ${o.config.fallback_currency}`),B=e.computed(()=>2+(u.value?1:0)+(v.value?1:0)+(y.value?1:0)+(s.value?2:0)+(m.value?1:0));return(o,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",nt,[k.value?(e.openBlock(),e.createElementBlock("div",ot,[e.createVNode(ve,{config:i.config,i18n:l.value},{"override-tooltip":e.withCtx(()=>[e.renderSlot(o.$slots,"override-tooltip")]),_:3},8,["config","i18n"]),b.value?(e.openBlock(),e.createBlock(f._sfc_main,{key:0,variant:"outline",placement:"top"},{tooltip:e.withCtx(()=>[e.createVNode(f.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(f._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.value),1)]),_:1})]),_:1})]),default:e.withCtx(()=>[e.createVNode(c._sfc_main$1,{icon:"change_circle",class:"text-gray-500"})]),_:1})):e.createCommentVNode("",!0),i.config.split_pricing?(e.openBlock(),e.createElementBlock("div",lt,[e.createVNode(t._sfc_main,{variant:"label",tag:"span"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.splitBy),1)]),_:1}),e.createVNode(t._sfc_main,{tag:"span",variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value),1)]),_:1})])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),p.value?(e.openBlock(),e.createBlock(e.unref(_e),{key:0,class:"mb-3 mt-1",i18n:l.value.topUpDescription,"pricing-item-config":i.config},null,8,["i18n","pricing-item-config"])):e.createCommentVNode("",!0),e.createElementVNode("div",rt,[e.createElementVNode("table",at,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",{colspan:B.value,class:"bg-gray-50 px-2 text-left"},[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n.formatEnum)(d.value)),1)]),_:1})],8,ct)]),e.createElementVNode("tr",st,[e.createElementVNode("th",dt,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.from),1)]),_:1})]),e.createElementVNode("th",pt,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.upTo),1)]),_:1})]),u.value?(e.openBlock(),e.createElementBlock("th",mt,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.fixedAmount),1)]),_:1})])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("th",ut,["STAIR_STEP"===d.value?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"caps-heading"},{default:e.withCtx(()=>{var t,n,o;return[e.createTextVNode(e.toDisplayString(l.value.pricePerStep(null==(o=null==(n=null==(t=i.item.product_items)?void 0:t[0])?void 0:n.unit_name)?void 0:o.plural)),1)]}),_:1})):m.value?(e.openBlock(),e.createBlock(t._sfc_main,{key:1,variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.price),1)]),_:1})):(e.openBlock(),e.createBlock(t._sfc_main,{key:2,variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.pricePerUnit(a.value)),1)]),_:1}))])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("th",gt,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.percentage),1)]),_:1})])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("th",ft,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.feeFloor),1)]),_:1})]),e.createElementVNode("th",vt,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.feeCap),1)]),_:1})])],64)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("th",_t,[e.createVNode(t._sfc_main,{variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value.per),1)]),_:1})])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.config.bands,(t,n)=>(e.openBlock(),e.createElementBlock("tr",{key:n,class:"border-t"},[e.createElementVNode("td",yt,[i.config.bands?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(z)(l.value)(i.config.bands[n-1])),1)],64)):e.createCommentVNode("",!0)]),e.createElementVNode("td",ht,[i.config.bands?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(L)(l.value)(t,i.config.bands,n)),1)],64)):e.createCommentVNode("",!0)]),u.value?(e.openBlock(),e.createElementBlock("td",kt,[t.fixed_amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:t.fixed_amount,highlighted:""},null,8,["value"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("td",bt,[t.amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:t.amount,highlighted:""},null,8,["value"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("td",xt,[t.percentage?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.percentage)+"% ",1)],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("td",Bt,[t.minimum_amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:t.minimum_amount},null,8,["value"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(" ")],64))]),e.createElementVNode("td",Ct,[t.maximum_amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:t.maximum_amount},null,8,["value"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(" ")],64))])],64)):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("td",Vt,[e.unref(_.isBandAmount)(t.block_size)?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:t.block_size.amount},null,8,["value"])):e.unref(_.isBandNumber)(t.block_size)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.value.formatNumber(+t.block_size.number)),1)],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),128))])])]),o.$slots.included?(e.openBlock(),e.createElementBlock("div",Nt,[e.renderSlot(o.$slots,"included")])):e.createCommentVNode("",!0)]))}}),St={class:"conditions-root"},wt=["innerHTML"],Pt=["innerHTML"],Tt=["innerHTML"],Dt=["innerHTML"],It=["innerHTML"],$t=["innerHTML"],Ot={key:2,class:"mt-3"},zt={key:0,class:"-transform-x-1/2 context-menu-wrapper absolute -top-2 right-0 opacity-0 transition-opacity"},Lt={key:0,class:"nested-conditions-border before:background-repeat-y before:content[''] relative mb-4 w-full pl-4 before:absolute before:inset-0 before:right-auto before:w-1 before:content-['']"},Rt=e.defineComponent({__name:"PricingItemConfig",props:{areNonBillableItemsVisible:{type:Boolean},rootConfig:{},config:{},configIndex:{},item:{},itemIndex:{},pricing:{},i18n:{},rootClass:{},showConfigHeader:{type:Boolean,default:!0},showDefaultValues:{type:Boolean,default:!0},schedule:{},creditTypesById:{}},setup(t){const i=t,n=e.computed(()=>i.i18n??de),l=e.useSlots(),r=e=>(e=>P(e,["FLAT","FLAT_TOP_UP"]))(e)||"FIXED"===e.type||"PASS_THROUGH"===e.type||"NONE"===e.type&&i.areNonBillableItemsVisible,a=e=>P(e,["TIERED","TIERED_TOP_UP","TOP_TIERED"])||I(e),c=e=>{var t,i,n,o,l;return"AMOUNT"===(null==(l=null==(o=null==(n=null==(i=null==(t=e.product_items)?void 0:t[0])?void 0:i.usage_based)?void 0:n.meter_value_calculation)?void 0:o.meter_value)?void 0:l.type)},s=e=>{var t,i,n,o,l;return"NUMBER"===(null==(l=null==(o=null==(n=null==(i=null==(t=e.product_items)?void 0:t[0])?void 0:i.usage_based)?void 0:n.meter_value_calculation)?void 0:o.meter_value)?void 0:l.type)},d=(e,t)=>{var i,n;return"PER_SEAT"===(null==(n=null==(i=e.product_items)?void 0:i[0])?void 0:n.model_type)&&"NONE"!==t.type},p=e.computed(()=>({pricing:i.pricing,item:i.item,config:i.config})),m=e.computed(()=>{var e;return null==(e=i.config.conditions)?void 0:e.configs}),u=e.computed(()=>!!l["pricing-item-config-settings"]&&!o.isVnodeEmpty(l["pricing-item-config-settings"](p.value))),g=e.computed(()=>i.rootConfig??i.config),f=e.computed(()=>{var e,t,n;const o=i.config.original_pricing_item_config_id;return i.schedule?(null==(e=C({schedule:i.schedule,pricingItemConfigIds:[i.config.id,...o?[o]:[]]}))?void 0:e.number)??(null==(t=i.config.default_seats_value)?void 0:t.number):null==(n=i.config.default_seats_value)?void 0:n.number});return(l,_)=>{var y,h,k;const b=e.resolveComponent("PricingItemConfig",!0);return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative",{[`${t.rootClass}`]:t.rootClass,"mb-4 last:mb-0":r(t.config)&&((null==(y=t.config.conditions)?void 0:y.meter_properties)||0===t.configIndex&&t.item.configs&&t.item.configs.length>0),"mb-6 last:mb-0":a(t.config)}])},[e.createElementVNode("div",St,[e.createElementVNode("div",{class:e.normalizeClass({"transition-padding conditions-with-context-menu":u.value})},[t.config.bands||t.config.type?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[r(t.config)?(e.openBlock(),e.createBlock(e.unref(it),{key:0,"is-combined-pricing":t.pricing.products&&t.pricing.products.length>1,"are-non-billable-items-visible":t.areNonBillableItemsVisible,config:t.config,item:t.item,class:e.normalizeClass({"mt-3":!t.rootClass}),i18n:n.value,"show-config-header":t.showConfigHeader,"show-default-values":t.showDefaultValues,"credit-types-by-id":t.creditTypesById},{"override-tooltip":e.withCtx(()=>[e.renderSlot(l.$slots,"override-tooltip",e.normalizeProps(e.guardReactiveProps(i)),void 0,!0)]),"price-line-additions":e.withCtx(()=>[e.renderSlot(l.$slots,"pricing-item-config-price-line-additions",e.normalizeProps(e.guardReactiveProps(p.value)),void 0,!0)]),included:e.withCtx(()=>{var i,o,l,r;return[c(t.item)&&(null==(i=t.config.default_included_volume)?void 0:i.amount)?(e.openBlock(),e.createElementBlock("span",{key:0,class:"mt-1 text-right text-gray-600",innerHTML:"BILLING_PERIOD"===t.config.default_included_volume.reset_type?n.value.includedVolumeAmountPerBillingPeriod(t.config.default_included_volume.amount):n.value.includedVolumeAmountPerSchedule(t.config.default_included_volume.amount)},null,8,wt)):e.createCommentVNode("",!0),s(t.item)&&(null==(o=t.config.default_included_volume)?void 0:o.number)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"mt-1 text-right text-gray-600",innerHTML:"BILLING_PERIOD"===t.config.default_included_volume.reset_type?n.value.includedVolumeUnitsPerBillingPeriod(t.config.default_included_volume.number,null==(l=t.item.product_items)?void 0:l[0].unit_name):n.value.includedVolumeUnitsPerSchedule(t.config.default_included_volume.number,null==(r=t.item.product_items)?void 0:r[0].unit_name)},null,8,Pt)):e.createCommentVNode("",!0),t.showDefaultValues&&d(t.item,t.config)&&f.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:"mt-1 text-right text-gray-600",innerHTML:n.value.includedSeats(f.value)},null,8,Tt)):e.createCommentVNode("",!0)]}),_:3},8,["is-combined-pricing","are-non-billable-items-visible","config","item","class","i18n","show-config-header","show-default-values","credit-types-by-id"])):a(t.config)?(e.openBlock(),e.createBlock(e.unref(Et),{key:1,"is-combined-pricing":t.pricing.products&&t.pricing.products.length>1,config:t.config,"item-index":t.itemIndex,"config-index":t.configIndex,item:t.item,"credit-types-by-id":t.creditTypesById,class:"mt-3",i18n:n.value,"show-config-header":t.showConfigHeader},{"override-tooltip":e.withCtx(()=>[e.renderSlot(l.$slots,"override-tooltip",e.normalizeProps(e.guardReactiveProps(i)),void 0,!0)]),"price-line-additions":e.withCtx(()=>[e.renderSlot(l.$slots,"pricing-item-config-price-line-additions",e.normalizeProps(e.guardReactiveProps(p.value)),void 0,!0)]),included:e.withCtx(()=>{var i,o,l,r;return[c(t.item)&&(null==(i=t.config.default_included_volume)?void 0:i.amount)?(e.openBlock(),e.createElementBlock("span",{key:0,class:"mt-1 text-right text-gray-600",innerHTML:"BILLING_PERIOD"===t.config.default_included_volume.reset_type?n.value.includedVolumeAmountPerBillingPeriod(t.config.default_included_volume.amount):n.value.includedVolumeAmountPerSchedule(t.config.default_included_volume.amount)},null,8,Dt)):e.createCommentVNode("",!0),s(t.item)&&(null==(o=t.config.default_included_volume)?void 0:o.number)?(e.openBlock(),e.createElementBlock("span",{key:1,class:"mt-1 text-right text-gray-600",innerHTML:"BILLING_PERIOD"===t.config.default_included_volume.reset_type?n.value.includedVolumeUnitsPerBillingPeriod(t.config.default_included_volume.number,null==(l=t.item.product_items)?void 0:l[0].unit_name):n.value.includedVolumeUnitsPerSchedule(t.config.default_included_volume.number,null==(r=t.item.product_items)?void 0:r[0].unit_name)},null,8,It)):e.createCommentVNode("",!0),t.showDefaultValues&&d(t.item,t.config)&&f.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:"mt-1 text-right text-gray-600",innerHTML:n.value.includedSeats(f.value)},null,8,$t)):e.createCommentVNode("",!0)]}),_:3},8,["is-combined-pricing","config","item-index","config-index","item","credit-types-by-id","i18n","show-config-header"])):e.createCommentVNode("",!0),l.$slots["pricing-item-config-additions"]&&!e.unref(o.isVnodeEmpty)(null==(k=(h=l.$slots)["pricing-item-config-additions"])?void 0:k.call(h,p.value))?(e.openBlock(),e.createElementBlock("div",Ot,[e.renderSlot(l.$slots,"pricing-item-config-additions",e.normalizeProps(e.guardReactiveProps(p.value)),void 0,!0)])):e.createCommentVNode("",!0)],64)):t.showConfigHeader?(e.openBlock(),e.createBlock(ve,{key:1,"is-combined-pricing":t.pricing.products&&t.pricing.products.length>1,config:t.config,i18n:n.value,class:"mt-3"},{"override-tooltip":e.withCtx(()=>[e.renderSlot(l.$slots,"override-tooltip",e.normalizeProps(e.guardReactiveProps(i)),void 0,!0)]),_:3},8,["is-combined-pricing","config","i18n"])):e.createCommentVNode("",!0)],2),u.value?(e.openBlock(),e.createElementBlock("div",zt,[e.renderSlot(l.$slots,"pricing-item-config-settings",e.mergeProps(p.value,{rootConfig:g.value}),void 0,!0)])):e.createCommentVNode("",!0)]),m.value&&!e.unref(v.isEmpty)(m.value)?(e.openBlock(),e.createElementBlock("ul",Lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList([...m.value].sort((e,t)=>t.order-e.order),(i,o)=>(e.openBlock(),e.createElementBlock("li",{key:i.id},[e.createVNode(b,{pricing:t.pricing,item:t.item,"item-index":t.itemIndex,config:i,"config-index":o,"are-non-billable-items-visible":t.areNonBillableItemsVisible,i18n:n.value,"root-class":t.rootClass,"root-config":g.value,"credit-types-by-id":t.creditTypesById},{"pricing-item-config-settings":e.withCtx(t=>[e.renderSlot(l.$slots,"pricing-item-config-settings",e.mergeProps({ref_for:!0},t),void 0,!0)]),"override-tooltip":e.withCtx(t=>[e.renderSlot(l.$slots,"pricing-item-config-override-tooltip",e.mergeProps({ref_for:!0},t),void 0,!0)]),"pricing-item-config-additions":e.withCtx(t=>[e.renderSlot(l.$slots,"pricing-item-config-additions",e.mergeProps({ref_for:!0},t),void 0,!0)]),"pricing-item-config-price-line-additions":e.withCtx(t=>[e.renderSlot(l.$slots,"pricing-item-config-price-line-additions",e.mergeProps({ref_for:!0},t),void 0,!0)]),_:3},8,["pricing","item","item-index","config","config-index","are-non-billable-items-visible","i18n","root-class","root-config","credit-types-by-id"])]))),128))])):e.createCommentVNode("",!0)],2)}}}),Zt=r._export_sfc(Rt,[["__scopeId","data-v-6310fe1d"]]),At=["onClick"],Mt={class:"ml-1 text-gray-500"},Ft={key:0,class:"px-4 pb-3"},Ut=e.defineComponent({__name:"PricingDetail",props:{itemClass:{},rootClass:{},titleWithIcon:{type:Boolean},pricing:{},groupedPricingItemIds:{},areNonBillableItemsVisible:{type:Boolean},i18n:{},schedule:{},creditTypesById:{}},setup(i){const n=t.useIntl(),l=i,r=e.ref({}),s=e=>!r.value[e],d=(e,t)=>{if(!t)return null;const i=new Map;return e.forEach(e=>{var t;if(!e.billing_period)return;const n=(o=e.billing_period)?`${o.type}:${o.value}`:"none";var o;i.has(n)||i.set(n,{billingPeriod:e.billing_period,configs:[]}),null==(t=i.get(n))||t.configs.push(e)}),Array.from(i.entries()).map(([e,t])=>({key:e,...t}))},p=e=>[...e].sort((e,t)=>t.order-e.order),m=e=>{var t,i;return(null==(t=e.configs)?void 0:t.length)?e.configs:(null==(i=e.billing_period_configs)?void 0:i.flatMap(e=>(e.configs??[]).map(t=>({...t,billing_period:e.billing_period}))))??[]},u=e=>{var t,i;return((null==(t=e.billing_period_configs)?void 0:t.length)??0)>0||((null==(i=l.groupedPricingItemIds)?void 0:i.includes(e.id))??!1)},g=e.computed(()=>{var e;return(null==(e=l.pricing.items)?void 0:e.map(e=>({id:e.id,groups:d(m(e),u(e))})))??[]}),f=e=>{const t=m(e),i=t.some(e=>"NONE"!==e.type),n=t.some(e=>"NONE"===e.type);return i||n&&!!l.areNonBillableItemsVisible};return(t,l)=>(e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.pricing.items,(l,d)=>{var u;return e.openBlock(),e.createElementBlock(e.Fragment,{key:d},[f(l)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["pb-5 last:pb-3",{[`${i.itemClass}`]:i.itemClass}])},[e.createVNode(o._sfc_main$1,{icon:i.titleWithIcon?"inventory_2":void 0,variant:"neutral",size:"sm"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"pricing-item-header",{item:l},()=>[e.createVNode(le,{item:l,"credit-types-by-id":i.creditTypesById},null,8,["item","credit-types-by-id"])])]),_:2},1032,["icon"]),(null==(u=g.value[d])?void 0:u.groups)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(g.value[d].groups,o=>{var m,u,g;return e.openBlock(),e.createElementBlock("div",{key:o.key,class:"mt-3 rounded border border-gray-100"},[e.createElementVNode("button",{type:"button",class:"flex w-full items-center justify-between px-4 py-2 text-left text-sm font-semibold text-gray-700",onClick:e=>{return t=o.key,void(r.value={...r.value,[t]:!r.value[t]});var t}},[e.createElementVNode("span",null,[e.createTextVNode(e.toDisplayString((null==(m=i.i18n)?void 0:m.formatBillingPeriod)?e.unref(n).$t({defaultMessage:"Billing cycle",id:"pricing_detail.billing_cycle",description:"The billing cycle in the pricing detail card"}):"Billing cycle")+" ",1),e.createElementVNode("span",Mt,e.toDisplayString(null==(g=null==(u=i.i18n)?void 0:u.formatBillingPeriod)?void 0:g.call(u,o.billingPeriod)),1)]),e.createVNode(c._sfc_main$1,{icon:s(o.key)?"unfold_less":"unfold_more",size:"sm"},null,8,["icon"])],8,At),e.createVNode(a._sfc_main,null,{default:e.withCtx(()=>[s(o.key)?(e.openBlock(),e.createElementBlock("div",Ft,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p(o.configs),(n,o)=>(e.openBlock(),e.createBlock(Zt,{key:n.id,pricing:i.pricing,item:l,"item-index":d,config:n,"config-index":o,"are-non-billable-items-visible":i.areNonBillableItemsVisible,i18n:i.i18n,"root-class":i.rootClass,schedule:i.schedule,"credit-types-by-id":i.creditTypesById},{"pricing-item-config-settings":e.withCtx(i=>[e.renderSlot(t.$slots,"pricing-item-config-settings",e.mergeProps({ref_for:!0},i))]),"override-tooltip":e.withCtx(i=>[e.renderSlot(t.$slots,"pricing-item-config-override-tooltip",e.mergeProps({ref_for:!0},i))]),"pricing-item-config-additions":e.withCtx(i=>[e.renderSlot(t.$slots,"pricing-item-config-additions",e.mergeProps({ref_for:!0},i))]),"pricing-item-config-price-line-additions":e.withCtx(i=>[e.renderSlot(t.$slots,"pricing-item-config-price-line-additions",e.mergeProps({ref_for:!0},i))]),_:3},8,["pricing","item","item-index","config","config-index","are-non-billable-items-visible","i18n","root-class","schedule","credit-types-by-id"]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)])}),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(p(m(l)??[]),(n,o)=>(e.openBlock(),e.createBlock(Zt,{key:n.id,pricing:i.pricing,item:l,"item-index":d,config:n,"config-index":o,"are-non-billable-items-visible":i.areNonBillableItemsVisible,i18n:i.i18n,"root-class":i.rootClass,schedule:i.schedule,"credit-types-by-id":i.creditTypesById},{"pricing-item-config-settings":e.withCtx(i=>[e.renderSlot(t.$slots,"pricing-item-config-settings",e.mergeProps({ref_for:!0},i))]),"override-tooltip":e.withCtx(i=>[e.renderSlot(t.$slots,"pricing-item-config-override-tooltip",e.mergeProps({ref_for:!0},i))]),"pricing-item-config-additions":e.withCtx(i=>[e.renderSlot(t.$slots,"pricing-item-config-additions",e.mergeProps({ref_for:!0},i))]),"pricing-item-config-price-line-additions":e.withCtx(i=>[e.renderSlot(t.$slots,"pricing-item-config-price-line-additions",e.mergeProps({ref_for:!0},i))]),_:3},8,["pricing","item","item-index","config","config-index","are-non-billable-items-visible","i18n","root-class","schedule","credit-types-by-id"]))),128))],2)):e.createCommentVNode("",!0)],64)}),128))]))}});var Gt=(e=>(e.ENUM="ENUM",e.SWITCH="SWITCH",e.NUMBER="NUMBER",e.AMOUNT="AMOUNT",e.STRING="STRING",e))(Gt||{});const Ht={...{...de},revenueItems:"Revenue items",deductionItems:"Deduction items",features:"Features"},jt={class:"text-gray-500 uppercase text-xs font-semibold"},qt={class:"text-gray-500 uppercase text-xs font-semibold"},Wt={key:2,class:"mt-2 group"},Kt={class:"text-gray-500 uppercase text-xs font-semibold"},Jt={key:0,class:"absolute right-0 top-1/2 -translate-y-1/2 transition opacity-0 group-hover:opacity-100 bg-white z-10"},Xt={class:"pl-4"},Yt={class:"mt-2"},Qt={class:"font-bold text-gray-700"},ei={key:1,class:"font-bold text-primary-600"},ti={key:2,class:"font-bold text-primary-600"},ii={key:4,class:"font-bold text-primary-600"},ni=e.defineComponent({__name:"PricingInfo",props:{pricing:{},groupedPricingItemIds:{},areNonBillableItemsVisible:{type:Boolean},i18n:{},schedule:{},creditTypesById:{}},setup(t){const i=t;e.provide("pricingId",i.pricing.id);const n=e.computed(()=>i.i18n??Ht),o=e.computed(()=>{var e;return null==(e=i.pricing.items)?void 0:e.filter(e=>{return!!(null==(t=e.product_items)?void 0:t.every(E));var t})}),l=e.computed(()=>{var e;return null==(e=i.pricing.items)?void 0:e.filter(e=>{return!!(t=e.product_items)&&t.length>0&&(null==t?void 0:t.every(S));var t})});return(i,r)=>(e.openBlock(),e.createElementBlock("div",null,[e.renderSlot(i.$slots,"pricing-item-warning"),e.unref(v.isEmpty)(o.value)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.unref(v.isEmpty)(t.pricing.items)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(u._sfc_main,{key:0,class:"my-3"},{default:e.withCtx(()=>[e.createElementVNode("h3",jt,e.toDisplayString(n.value.revenueItems),1)]),_:1})),e.createVNode(Ut,{pricing:{...t.pricing,items:o.value},"grouped-pricing-item-ids":t.groupedPricingItemIds,i18n:n.value,"are-non-billable-items-visible":t.areNonBillableItemsVisible,schedule:t.schedule,"credit-types-by-id":t.creditTypesById},{"pricing-item-header":e.withCtx(({item:t})=>[e.renderSlot(i.$slots,"pricing-item-header",{item:t})]),"pricing-item-config-settings":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-settings",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-override-tooltip":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-override-tooltip",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-additions":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-additions",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-price-line-additions":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-price-line-additions",e.normalizeProps(e.guardReactiveProps(t)))]),_:3},8,["pricing","grouped-pricing-item-ids","i18n","are-non-billable-items-visible","schedule","credit-types-by-id"])],64)),e.unref(v.isEmpty)(l.value)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.pricing.items&&t.pricing.items.length>0?(e.openBlock(),e.createBlock(u._sfc_main,{key:0,class:"mt-6 mb-3"},{default:e.withCtx(()=>[e.createElementVNode("h3",qt,e.toDisplayString(n.value.deductionItems),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(Ut,{pricing:{...t.pricing,items:l.value},"grouped-pricing-item-ids":t.groupedPricingItemIds,i18n:n.value,"are-non-billable-items-visible":t.areNonBillableItemsVisible,"credit-types-by-id":t.creditTypesById},{"pricing-item-header":e.withCtx(({item:t})=>[e.renderSlot(i.$slots,"pricing-item-header",{item:t})]),"pricing-item-config-settings":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-settings",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-override-tooltip":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-override-tooltip",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-additions":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-additions",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-price-line-additions":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-price-line-additions",e.normalizeProps(e.guardReactiveProps(t)))]),_:3},8,["pricing","grouped-pricing-item-ids","i18n","are-non-billable-items-visible","credit-types-by-id"])],64)),e.unref(v.isEmpty)(t.pricing.entitlements)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Wt,[e.createVNode(u._sfc_main,{class:"relative"},{default:e.withCtx(()=>[e.createElementVNode("h3",Kt,e.toDisplayString(n.value.features),1),i.$slots["pricing-entitlements-settings"]?(e.openBlock(),e.createElementBlock("div",Jt,[e.createElementVNode("div",Xt,[e.renderSlot(i.$slots,"pricing-entitlements-settings",{pricing:t.pricing})])])):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("ul",Yt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pricing.entitlements,t=>(e.openBlock(),e.createElementBlock("li",{key:t.feature_id,class:"py-2 flex justify-between items-center"},[e.createElementVNode("span",Qt,e.toDisplayString(t.feature.name),1),t.feature.type===e.unref(Gt).AMOUNT&&t.amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:t.amount,highlighted:""},null,8,["value"])):e.createCommentVNode("",!0),t.feature.type===e.unref(Gt).NUMBER&&t.number?(e.openBlock(),e.createElementBlock("span",ei,e.toDisplayString(t.number),1)):e.createCommentVNode("",!0),t.feature.type===e.unref(Gt).STRING&&t.string?(e.openBlock(),e.createElementBlock("span",ti,e.toDisplayString(t.string),1)):e.createCommentVNode("",!0),t.feature.type===e.unref(Gt).SWITCH&&"switch"in t?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["text-white rounded-full leading-[0.5] inline-block",t.switch?"bg-primary-600":"bg-red-500"])},[e.createVNode(c._sfc_main$1,{icon:t.switch?"check":"close",size:"xs"},null,8,["icon"])],2)):e.createCommentVNode("",!0),t.feature.type===e.unref(Gt).ENUM&&t.enum?(e.openBlock(),e.createElementBlock("span",ii,e.toDisplayString(t.enum),1)):e.createCommentVNode("",!0)]))),128))])]))]))}}),oi=e=>"cancellationDate"in e,li=e=>"schedule"in e,ri={...Ht,volumePooling:"Volume pooling",addon:"Addon",someItemsDeprecatedWarning:"Some of the product items are deprecated. They cannot be used for pricing and needs to be deleted",allItemsDeprecatedWarning:"All product items are deprecated, this pricing needs to be deleted"},ai={addon:ri.addon,singleSelect:"Single select",multiSelect:"Multi select"},ci={...ai,...ri,productsCount:e=>0===e?"no products":1===e?"1 product":`${e} products`},si={...o.comparatorI18nDefaults,and:"and"},di={...si,product:"product",revenueItem:"revenue item",pricingRule:"price rule",discountBody:(e,t,i)=>`Discount on ${e} <strong>${t}</strong> ${i}`,startOfSchedule:"Start of schedule",endOfSchedule:"End of schedule",discountOnInvoice:e=>`Discount on <strong>Invoice</strong> ${e}`,or:"or",unsupported:"unsupported",unknown:"unknown"},pi={...di,title:"Discounts",orderOfApplicationExplanation:"Discounts are applied before commitments on invoices",description:"Add price reductions for a defined period or specific terms.",selectPricingPlanHint:"Please select a pricing plan to add discounts",addItemLabel:"Add",notEditableExplanation:"Discounts can't be edited for active schedules"},mi={...si,or:"or",unsupported:"unsupported",product:"product",revenueItem:"revenue item",commitmentBody:(e,t,i)=>`Commitment on ${e} <strong>${t}</strong> ${i}`,startOfSchedule:"Start of schedule",endOfSchedule:"End of schedule",unknown:"unknown",products:e=>1===e?"product":"products",pluralRevenueItems:e=>1===e?"revenue item":"revenue items",pricingRule:"price rule",invoice:"invoice",units:e=>`${e} units`,commitmentOnInvoice:e=>`Commitment on <strong>Invoice</strong> ${e}`,basedOnMeterValue:"based on meter value"},ui={...mi,title:"Commitments",orderOfApplicationExplanation:"Commitments are applied after discounts on invoices",description:"Setup a minimum usage per an agreed-upon time period.",selectPricingPlanHint:"Please select a pricing plan to add commitments",addItemLabel:"Add commitment",notEditableExplanation:"Commitments can't be edited for active schedules"},gi={...mi,...si,markupBody:(e,t,i)=>`Markup on ${e} <strong>${t}</strong> ${i}`},fi={...gi,title:"Markups",orderOfApplicationExplanation:"Markups are applied before commitments on invoices",description:"Add price markups for a defined period or specific terms.",selectPricingPlanHint:"Please select a pricing plan to add markups",addItemLabel:"Add",notEditableExplanation:"Markups can't be edited for active schedules"},vi={startOfSchedule:ui.startOfSchedule,endOfSchedule:ui.endOfSchedule,markupPercentage:e=>`${e}% markup`},_i={...pi,...ui,...fi,...ci,...vi,commitmentsTitle:ui.title,discountsTitle:pi.title,markupsTitle:fi.title,commitmentsOrderOfApplicationExplanation:ui.orderOfApplicationExplanation,discountsOrderOfApplicationExplanation:pi.orderOfApplicationExplanation,markupsOrderOfApplicationExplanation:fi.orderOfApplicationExplanation,scheduleNumber:e=>`Schedule ${e}`,versionNumber:e=>`Version ${e}`,subscriptionCancelled:e=>`Subscription cancelled from ${e}`},yi={class:"inline-block ml-2"},hi={key:0,class:"mb-2"},ki=e.defineComponent({__name:"PricingCard",props:{pricing:{},groupedPricingItemIds:{},pricingPlanId:{},pricingPlanVersionId:{},isCustomizedPlan:{type:Boolean},subscriptionId:{},showNonBillable:{type:Boolean},defaultExpanded:{type:Boolean},i18n:{},showAddonChip:{type:Boolean,default:!0},isEnabled:{type:Boolean,default:!0},schedule:{},creditTypesById:{}},setup(i){const n=i,o=e.computed(()=>n.i18n??ri);e.provide("pricingId",n.pricing.id);const a=e=>"DEPRECATED"===e.status,c=e.computed(()=>(n.pricing.items||[]).flatMap(e=>e.product_items||[]).some(a)),s=e.computed(()=>(n.pricing.items||[]).flatMap(e=>e.product_items||[]).every(a));return(n,a)=>(e.openBlock(),e.createBlock(U,{class:"flex flex-col justify-between","capped-width":"","is-open":i.defaultExpanded,"data-testid":`pricing-${i.pricing.id}`,spacing:"sm",onToggled:a[0]||(a[0]=e=>n.$emit("pricing-toggled",e)),onToggle:a[1]||(a[1]=e=>n.$emit("pricing-toggle",i.pricing.id))},{"pre-header":e.withCtx(()=>[e.renderSlot(n.$slots,"pre-header")]),"title-prefix":e.withCtx(()=>[e.renderSlot(n.$slots,"title-prefix")]),title:e.withCtx(()=>[e.createVNode(t._sfc_main,{weight:"semibold",tag:"span",variant:"body-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(x)(i.pricing,!(i.pricing.products&&i.pricing.products.length>1))),1)]),_:1})]),"title-suffix":e.withCtx(()=>[i.pricing.products&&i.pricing.products.length>1?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,color:"green",class:"ml-2 align-middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value.volumePooling),1)]),_:1})):e.createCommentVNode("",!0),i.showAddonChip&&i.pricing.product_type&&"ADDON"===i.pricing.product_type?(e.openBlock(),e.createBlock(r._sfc_main,{key:1,color:"indigo",class:"ml-2 align-middle"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value.addon),1)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("span",yi,[e.renderSlot(n.$slots,"id")])]),right:e.withCtx(()=>[e.renderSlot(n.$slots,"right")]),default:e.withCtx(()=>[e.createVNode(l._sfc_main$1,{spacing:"none"},{default:e.withCtx(()=>[n.$slots["pricing-note"]?(e.openBlock(),e.createElementBlock("div",hi,[e.renderSlot(n.$slots,"pricing-note")])):e.createCommentVNode("",!0),e.createVNode(ni,{pricing:i.pricing,"grouped-pricing-item-ids":i.groupedPricingItemIds,i18n:o.value,"are-non-billable-items-visible":i.showNonBillable,schedule:i.schedule,"credit-types-by-id":i.creditTypesById},{"pricing-item-header":e.withCtx(({item:t})=>[e.renderSlot(n.$slots,"pricing-item-header",{item:t})]),"pricing-item-warning":e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(p._sfc_main,{key:0,type:"warning"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value.allItemsDeprecatedWarning),1)]),_:1})):c.value?(e.openBlock(),e.createBlock(p._sfc_main,{key:1,type:"warning"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.value.someItemsDeprecatedWarning),1)]),_:1})):e.createCommentVNode("",!0)]),"pricing-item-config-settings":e.withCtx(t=>[e.renderSlot(n.$slots,"pricing-item-config-settings",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-entitlements-settings":e.withCtx(t=>[e.renderSlot(n.$slots,"pricing-entitlements-settings",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-override-tooltip":e.withCtx(t=>[e.renderSlot(n.$slots,"pricing-item-config-override-tooltip",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-additions":e.withCtx(t=>[e.renderSlot(n.$slots,"pricing-item-config-additions",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-price-line-additions":e.withCtx(t=>[e.renderSlot(n.$slots,"pricing-item-config-price-line-additions",e.normalizeProps(e.guardReactiveProps(t)))]),_:3},8,["pricing","grouped-pricing-item-ids","i18n","are-non-billable-items-visible","schedule","credit-types-by-id"])]),_:3})]),_:3},8,["is-open","data-testid"]))}}),bi={class:"inline-block"},xi=e.defineComponent({__name:"PricingGroupCard",props:{pricingGroup:{},i18n:{default:()=>ai},isEnabled:{type:Boolean}},setup:t=>(i,n)=>(e.openBlock(),e.createBlock(l._sfc_main,{spacing:t.isEnabled?"sm":"none","border-style":t.isEnabled?"solid":"dashed"},{default:e.withCtx(()=>[e.createVNode(A,{spacing:"none",title:t.pricingGroup.name},{"title-suffix":e.withCtx(()=>[t.pricingGroup.product_type&&"ADDON"===t.pricingGroup.product_type?(e.openBlock(),e.createBlock(r._sfc_main,{key:0,color:"indigo",class:"align-middle ml-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.i18n.addon),1)]),_:1})):e.createCommentVNode("",!0),e.createVNode(r._sfc_main,{color:"dark",class:"align-middle mx-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(w)(t.pricingGroup)?t.i18n.singleSelect:t.i18n.multiSelect),1)]),_:1}),e.createElementVNode("span",bi,[e.renderSlot(i.$slots,"id")])]),right:e.withCtx(()=>[e.renderSlot(i.$slots,"settings")]),_:3},8,["title"]),e.createVNode(l._sfc_main$1,{spacing:"none",class:"mt-2"},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"pricings")]),_:3})]),_:3},8,["spacing","border-style"]))}),Bi=e.defineComponent({__name:"PricingGroupSingleSelectCard",props:{pricingGroup:{},pricingPlanVersion:{},schedule:{},showNonBillable:{type:Boolean},isEnabled:{type:Boolean},isControlled:{type:Boolean}},emits:["update-enabled-pricing"],setup(i,{emit:n}){var o,l,r;const c=i,s=n,d=e.ref(null==(r=null==(l=null==(o=c.schedule)?void 0:o.enabled_pricings)?void 0:l.find(e=>c.pricingGroup.pricings.some(t=>t.id===e.pricing_id)))?void 0:r.pricing_id),p=e.computed(()=>c.pricingGroup.pricings.map(e=>({value:e.id}))),m=e.computed({get:()=>d.value||c.pricingGroup.pricings[0].id,set:e=>{d.value=e}}),u=e.computed(()=>c.pricingGroup.pricings.find(e=>e.id===m.value)),{renderPricingForPricingItem:g}=a.usePricingItem(),f=e.computed(()=>{var e,t,i,n;return(null==(t=null==(e=u.value)?void 0:e.items)?void 0:t[0])?g({pricingItem:null==(n=null==(i=u.value)?void 0:i.items)?void 0:n[0]}):""}),v=e.computed(()=>Object.fromEntries((c.pricingPlanVersion.credit_types??[]).map(e=>[e.id,e])));return e.watch(m,(e,t)=>{s("update-enabled-pricing",t,e)},{immediate:!0}),e.watch(()=>c.schedule,e=>{var t,i;d.value=null==(i=null==(t=null==e?void 0:e.enabled_pricings)?void 0:t.find(e=>c.pricingGroup.pricings.some(t=>t.id===e.pricing_id)))?void 0:i.pricing_id},{immediate:!0}),(n,o)=>(e.openBlock(),e.createBlock(e.unref(xi),{"pricing-group":i.pricingGroup,"is-enabled":i.isEnabled},{id:e.withCtx(()=>[e.renderSlot(n.$slots,"id",{id:i.pricingGroup.id})]),settings:e.withCtx(()=>[e.renderSlot(n.$slots,"pricing-group-settings",{pricingGroup:i.pricingGroup})]),pricings:e.withCtx(()=>[u.value?(e.openBlock(),e.createBlock(e.unref(ki),{key:0,"default-expanded":!0,pricing:u.value,"pricing-plan-version-id":i.pricingPlanVersion.id,"pricing-plan-id":i.pricingPlanVersion.pricing_plan_id,"show-non-billable":i.showNonBillable,"is-customized-plan":!!i.pricingPlanVersion.copied_from_pricing_plan_version_id,class:"flex flex-col","is-controlled":i.isControlled,"show-addon-chip":!1,"is-enabled":i.isEnabled,schedule:i.schedule,"credit-types-by-id":v.value},{"pre-header":e.withCtx(()=>[e.createVNode(a._sfc_main$2,{modelValue:m.value,"onUpdate:modelValue":o[0]||(o[0]=e=>m.value=e),options:p.value,name:"pricing-group-single-select",variant:"stepped-ghost",size:"lg",class:"border-b"},null,8,["modelValue","options"])]),"pricing-note":e.withCtx(()=>[e.renderSlot(n.$slots,"pricing-note",e.normalizeProps(e.guardReactiveProps({pricing:u.value})))]),"title-prefix":e.withCtx(()=>[e.renderSlot(n.$slots,"pricing-group-pricing-title-prefix",{pricingGroup:i.pricingGroup,pricing:u.value})]),id:e.withCtx(()=>[e.renderSlot(n.$slots,"pricing-title-suffix",{id:u.value.id})]),right:e.withCtx(()=>[f.value?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"body-xs",shade:"lighter",class:"mr-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value),1)]),_:1})):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"pricing-group-pricing-settings",{pricing:u.value,pricingGroup:i.pricingGroup})]),"pricing-item-header":e.withCtx(({item:t})=>[e.renderSlot(n.$slots,"pricing-item-header",{item:t})]),"pricing-entitlements-settings":e.withCtx(t=>[e.renderSlot(n.$slots,"pricing-entitlements-settings",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-settings":e.withCtx(t=>[e.renderSlot(n.$slots,"pricing-item-config-settings",e.mergeProps(t,{pricingGroup:i.pricingGroup}))]),"pricing-item-config-override-tooltip":e.withCtx(t=>[e.renderSlot(n.$slots,"pricing-item-config-override-tooltip",e.normalizeProps(e.guardReactiveProps(t)))]),"pricing-item-config-additions":e.withCtx(t=>[e.renderSlot(n.$slots,"pricing-item-config-additions",e.normalizeProps(e.guardReactiveProps(t)))]),_:3},8,["pricing","pricing-plan-version-id","pricing-plan-id","show-non-billable","is-customized-plan","is-controlled","is-enabled","schedule","credit-types-by-id"])):e.createCommentVNode("",!0)]),_:3},8,["pricing-group","is-enabled"]))}}),Ci={key:0,class:"mb-2 flex items-center gap-2 text-sm"},Vi={class:"font-bold"},Ni={class:"flex flex-col gap-2"},Ei={class:"flex flex-col"},Si=e.defineComponent({__name:"PricingPlanVersionContent",props:{pricingPlanVersion:{},groupedPricingItemIdsByPricing:{},defaultExpanded:{type:Boolean},showNonBillable:{type:Boolean},expandedPricings:{},enabledPricings:{},isControlled:{type:Boolean},i18n:{},schedule:{},enablePricingGroupSelection:{type:Boolean,default:!1}},emits:["pricing-toggle","pricing-toggled","delete-pricing","update-enabled-pricing"],setup(t){const i=t,n=e.computed(()=>i.i18n??ci),o=e.computed(()=>i.enabledPricings??[]),l=e.computed(()=>{var e;return Object.fromEntries(((null==(e=i.pricingPlanVersion)?void 0:e.credit_types)??[]).map(e=>[e.id,e]))}),a=e=>"DEFAULT"===e.product_type||e.pricings.some(e=>o.value.includes(e.id)),c=e=>"DEFAULT"===e.product_type||o.value.includes(e.id);return(i,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(i.$slots,"header"),!t.pricingPlanVersion||t.pricingPlanVersion.pricing_categories&&0!==t.pricingPlanVersion.pricing_categories.length?t.pricingPlanVersion?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.pricingPlanVersion.pricing_categories??[],(s,d)=>{var p,m;return e.openBlock(),e.createElementBlock("div",{key:s.product_category_id,class:e.normalizeClass({"mt-6":d>0})},[(null==(p=s.product_category)?void 0:p.name)?(e.openBlock(),e.createElementBlock("h2",Ci,[e.createElementVNode("span",Vi,e.toDisplayString(null==(m=s.product_category)?void 0:m.name),1),e.createElementVNode("div",null,[e.createVNode(r._sfc_main,{size:"sm",color:"dark",class:"rounded-2xl font-semibold uppercase text-gray-600"},{default:e.withCtx(()=>{var t,i;return[e.createTextVNode(e.toDisplayString(n.value.productsCount(((null==(t=s.pricing_groups)?void 0:t.length)??0)+((null==(i=s.pricings)?void 0:i.length)??0))),1)]}),_:2},1024)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.pricing_groups,r=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r.id},[t.enablePricingGroupSelection&&"EXACTLY_ONE"===r.selection_constraint&&r.pricings.length>=7?(e.openBlock(),e.createBlock(Bi,{key:0,"pricing-group":r,"pricing-plan-version":t.pricingPlanVersion,"is-enabled":a(r),i18n:n.value,schedule:t.schedule,"show-non-billable":t.showNonBillable,"is-controlled":t.isControlled,onUpdateEnabledPricing:o[0]||(o[0]=(e,t)=>i.$emit("update-enabled-pricing",e,t))},{id:e.withCtx(()=>[e.renderSlot(i.$slots,"id",{id:r.id})]),"pricing-group-settings":e.withCtx(()=>[e.renderSlot(i.$slots,"pricing-group-settings",{pricingGroup:r})]),_:2},1032,["pricing-group","pricing-plan-version","is-enabled","i18n","schedule","show-non-billable","is-controlled"])):(e.openBlock(),e.createBlock(e.unref(xi),{key:1,"pricing-group":r,"is-enabled":a(r),i18n:n.value},{id:e.withCtx(()=>[e.renderSlot(i.$slots,"id",{id:r.id})]),settings:e.withCtx(()=>[e.renderSlot(i.$slots,"pricing-group-settings",{pricingGroup:r})]),pricings:e.withCtx(()=>[e.createElementVNode("div",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.pricings,a=>{var s,d;return e.openBlock(),e.createBlock(e.unref(ki),{key:a.id,"default-expanded":!0===t.defaultExpanded||(null==(s=t.expandedPricings)?void 0:s.includes(a.id)),pricing:a,"pricing-plan-version-id":t.pricingPlanVersion.id,"pricing-plan-id":t.pricingPlanVersion.pricing_plan_id,"show-non-billable":t.showNonBillable,"is-customized-plan":!!t.pricingPlanVersion.copied_from_pricing_plan_version_id,"grouped-pricing-item-ids":null==(d=t.groupedPricingItemIdsByPricing)?void 0:d[a.id],class:"flex flex-col","is-controlled":t.isControlled,i18n:n.value,"show-addon-chip":!1,"is-enabled":c(a),"credit-types-by-id":l.value,onPricingToggled:e=>i.$emit("pricing-toggled",a.id,e),onPricingToggle:o[1]||(o[1]=e=>i.$emit("pricing-toggle",e))},{"pricing-note":e.withCtx(()=>[e.renderSlot(i.$slots,"pricing-note",e.mergeProps({ref_for:!0},{pricing:a}))]),"title-prefix":e.withCtx(()=>[e.renderSlot(i.$slots,"pricing-group-pricing-title-prefix",{pricingGroup:r,pricing:a})]),id:e.withCtx(()=>[e.renderSlot(i.$slots,"pricing-title-suffix",{id:a.id})]),right:e.withCtx(()=>[e.renderSlot(i.$slots,"pricing-group-pricing-settings",{pricing:a,pricingGroup:r})]),"pricing-item-header":e.withCtx(({item:t})=>[e.renderSlot(i.$slots,"pricing-item-header",{item:t})]),"pricing-entitlements-settings":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-entitlements-settings",e.mergeProps({ref_for:!0},t))]),"pricing-item-config-settings":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-settings",e.mergeProps({ref_for:!0},t,{pricingGroup:r}))]),"pricing-item-config-override-tooltip":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-override-tooltip",e.mergeProps({ref_for:!0},t))]),"pricing-item-config-additions":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-additions",e.mergeProps({ref_for:!0},t))]),"pricing-item-config-price-line-additions":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-price-line-additions",e.mergeProps({ref_for:!0},t))]),_:2},1032,["default-expanded","pricing","pricing-plan-version-id","pricing-plan-id","show-non-billable","is-customized-plan","grouped-pricing-item-ids","is-controlled","i18n","is-enabled","credit-types-by-id","onPricingToggled"])}),128))])]),_:2},1032,["pricing-group","is-enabled","i18n"]))],64))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.pricings,r=>{var a,s;return e.openBlock(),e.createBlock(e.unref(ki),{key:r.id,"default-expanded":!0===t.defaultExpanded||(null==(a=t.expandedPricings)?void 0:a.includes(r.id)),pricing:r,"pricing-plan-version-id":t.pricingPlanVersion.id,"pricing-plan-id":t.pricingPlanVersion.pricing_plan_id,"grouped-pricing-item-ids":null==(s=t.groupedPricingItemIdsByPricing)?void 0:s[r.id],"show-non-billable":t.showNonBillable,"is-customized-plan":!!t.pricingPlanVersion.copied_from_pricing_plan_version_id,class:"flex flex-col","is-controlled":t.isControlled,i18n:n.value,"is-enabled":c(r),"credit-types-by-id":l.value,schedule:t.schedule,onPricingToggled:e=>i.$emit("pricing-toggled",r.id,e),onPricingToggle:o[2]||(o[2]=e=>i.$emit("pricing-toggle",e))},{id:e.withCtx(()=>[e.renderSlot(i.$slots,"pricing-title-suffix",{id:r.id})]),right:e.withCtx(()=>[e.renderSlot(i.$slots,"pricing-settings",{pricing:r})]),"pricing-note":e.withCtx(()=>[e.renderSlot(i.$slots,"pricing-note",e.mergeProps({ref_for:!0},{pricing:r}))]),"pricing-item-header":e.withCtx(({item:t})=>[e.renderSlot(i.$slots,"pricing-item-header",{item:t})]),"pricing-entitlements-settings":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-entitlements-settings",e.mergeProps({ref_for:!0},t))]),"pricing-item-config-settings":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-settings",e.mergeProps({ref_for:!0},t,{pricingGroup:void 0}))]),"pricing-item-config-override-tooltip":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-override-tooltip",e.mergeProps({ref_for:!0},t))]),"pricing-item-config-additions":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-additions",e.mergeProps({ref_for:!0},t))]),"pricing-item-config-price-line-additions":e.withCtx(t=>[e.renderSlot(i.$slots,"pricing-item-config-price-line-additions",e.mergeProps({ref_for:!0},t))]),_:2},1032,["default-expanded","pricing","pricing-plan-version-id","pricing-plan-id","grouped-pricing-item-ids","show-non-billable","is-customized-plan","is-controlled","i18n","is-enabled","credit-types-by-id","schedule","onPricingToggled"])}),128))])],2)}),128)):e.createCommentVNode("",!0):e.renderSlot(i.$slots,"empty-state",{key:0})],64))}}),wi={class:"flex justify-between items-center"},Pi={class:"flex items-center gap-2"},Ti={key:0,class:"ml-3 flex gap-3 opacity-0 group-hover:opacity-100 focus-within:opacity-100 transition-opacity"},Di=e.defineComponent({__name:"CommitmentDiscountItem",props:{icon:{},iconColor:{},isEditable:{type:Boolean},isRemovable:{type:Boolean},error:{}},emits:["edit","delete"],setup:i=>(o,r)=>(e.openBlock(),e.createBlock(l._sfc_main,{spacing:"none","root-class":"p-2 pr-3 group"},{default:e.withCtx(()=>[e.createElementVNode("div",wi,[e.createElementVNode("div",Pi,[e.createVNode(c._sfc_main$1,{icon:i.icon,size:"sm",variant:"contained",class:e.normalizeClass(["p-1",{"bg-orange-50 text-orange-700":"orange"===i.iconColor,"bg-yellow-50 text-yellow-700":"yellow"===i.iconColor}])},null,8,["icon","class"]),e.createVNode(t._sfc_main,{variant:"body-sm","no-spacing":""},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"body")]),_:3})]),i.isEditable||i.isRemovable?(e.openBlock(),e.createElementBlock("div",Ti,[i.isEditable?(e.openBlock(),e.createBlock(c._sfc_main,{key:0,variant:"ghost",color:"gray",square:"","icon-prefix":"edit",onClick:r[0]||(r[0]=e=>o.$emit("edit"))})):e.createCommentVNode("",!0),i.isRemovable?(e.openBlock(),e.createBlock(c._sfc_main,{key:1,variant:"ghost",color:"red",square:"","icon-prefix":"delete",onClick:r[1]||(r[1]=e=>o.$emit("delete"))})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createVNode(a._sfc_main,null,{default:e.withCtx(()=>[i.error?(e.openBlock(),e.createBlock(p._sfc_main,{key:0,type:"danger",class:"mt-2 -mb-2 -mr-3 -ml-2 rounded-tl-none rounded-tr-none rounded-bl-md rounded-br-md"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(n.capitalize)(i.error)),1)]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:3}))}),Ii={class:"font-semibold"},$i={key:2,class:"text-primary-600 font-semibold"},Oi=["innerHTML"],zi=["innerHTML"],Li={key:2},Ri=e.defineComponent({__name:"SubscriptionCommitmentItem",props:{commitment:{},pricingPlanVersion:{},isEditable:{type:Boolean},isRemovable:{type:Boolean},error:{},i18n:{},timezone:{}},emits:["edit","delete"],setup(i){const n=i,o=e.computed(()=>n.i18n??mi),{getCommitmentBody:l,getFormattedDuration:r}=((i,n=mi,o)=>{const{formatDate:l}=t.useIntl(),r=e.computed(()=>{var e,t;return(null==(t=null==(e=i.value)?void 0:e.pricing_categories)?void 0:t.flatMap(e=>{var t;return[...(null==(t=e.pricing_groups)?void 0:t.flatMap(e=>e.pricings))??[],...e.pricings??[]]}))??[]}),a=e.computed(()=>r.value.map(e=>{var t;return{pricing:e,product:null==(t=e.products)?void 0:t[0],pricingId:e.id}})),c=e.computed(()=>{var e;return(null==(e=r.value)?void 0:e.flatMap(e=>{var t;return(null==(t=e.items)?void 0:t.map(e=>{var t;return{productItem:null==(t=e.product_items)?void 0:t[0],pricingItemId:e.id}}))??[]}))??[]}),s=e=>{var t,i,o,l,s;switch(e.commitmentLevel){case"PRODUCTS":{const i=null==(t=e.ids)?void 0:t.map(e=>a.value.find(t=>t.pricingId===e));return d((null==i?void 0:i.map(e=>{var t;return(null==e?void 0:e.pricing.name)??((null==(t=null==e?void 0:e.product)?void 0:t.name)||"")}))??[])}case"REVENUE_ITEMS":{const t=null==(i=e.ids)?void 0:i.map(e=>{var t;return null==(t=c.value.find(t=>t.pricingItemId===e))?void 0:t.productItem});return d((null==t?void 0:t.map(e=>(null==e?void 0:e.name)||""))??[])}case"PRICING_RULE":{const t=t=>{var i;return t.id===(null==(i=e.ids)?void 0:i[0])},i=e=>{var n,o;return t(e)||!!(null==(o=null==(n=e.conditions)?void 0:n.configs)?void 0:o.some(i))},a=e=>{var t;return null==(t=e.configs)?void 0:t.some(i)},c=e=>{var t;return null==(t=e.items)?void 0:t.some(a)},d=null==(o=r.value)?void 0:o.find(c),p=null==(l=null==d?void 0:d.items)?void 0:l.find(a),m=null==(s=null==p?void 0:p.configs)?void 0:s.flatMap($),u=null==m?void 0:m.find(t);return`<strong>${O(n)({pricing:d,item:p,config:u})}</strong>`}}},d=e=>e.reduce((t,i,n)=>{const o=`<strong>${i}</strong>`;return 0===n?o:n===e.length-1?[t,o].join(" and "):[t,o].join(", ")},""),p=e=>{var t,i;switch(e.commitmentLevel){case"PRODUCTS":return n.products((null==(t=e.ids)?void 0:t.length)??0);case"REVENUE_ITEMS":return n.pluralRevenueItems((null==(i=e.ids)?void 0:i.length)??0);case"PRICING_RULE":return n.pricingRule;case"INVOICE":return n.invoice}},m=e=>{if(!e.start_at&&!e.end_at)return"";let t,i;return e.start_at||(t=n.startOfSchedule),e.end_at||(i=n.endOfSchedule),e.start_at&&(t=l(o?{date:e.start_at,format:"date",offsetType:"offsetted",timezone:o}:{date:e.start_at,format:"date",offsetType:"local",showTimezone:!1})),e.end_at&&(i=l(o?{date:e.end_at,format:"date",offsetType:"offsetted",timezone:o}:{date:e.end_at,format:"date",offsetType:"local",showTimezone:!1})),`(${t} - ${i})`};return{getCommitmentBody:e=>n.commitmentBody(p(e),s(e)??"",m(e)),getFormattedDuration:m}})(e.computed(()=>n.pricingPlanVersion),o.value,n.timezone);return(t,n)=>(e.openBlock(),e.createBlock(Di,{icon:"handshake","icon-color":"orange","is-editable":i.isEditable,"is-removable":i.isRemovable,error:i.error,onEdit:n[0]||(n[0]=e=>t.$emit("edit")),onDelete:n[1]||(n[1]=e=>t.$emit("delete"))},{body:e.withCtx(()=>{var t;return[e.createElementVNode("span",Ii,[i.commitment.amount?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:i.commitment.amount,highlighted:""},null,8,["value"])):"meter_value_calculation"in i.commitment&&(null==(t=i.commitment.meter_value_calculation)?void 0:t.amount)?(e.openBlock(),e.createBlock(g._sfc_main,{key:1,value:i.commitment.meter_value_calculation.amount,highlighted:""},null,8,["value"])):"meter_value_calculation"in i.commitment&&i.commitment.meter_value_calculation&&"number"in i.commitment.meter_value_calculation?(e.openBlock(),e.createElementBlock("span",$i,e.toDisplayString(i.commitment.meter_value_calculation.number&&o.value.units(i.commitment.meter_value_calculation.number)),1)):e.createCommentVNode("",!0)]),n[2]||(n[2]=e.createTextVNode(" ",-1)),"INVOICE"===i.commitment.commitmentLevel?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:o.value.commitmentOnInvoice(e.unref(r)(i.commitment))},null,8,Oi)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:e.unref(l)(i.commitment)},null,8,zi)),"meter_value_calculation"in i.commitment&&i.commitment.meter_value_calculation&&"amount"in i.commitment.meter_value_calculation?(e.openBlock(),e.createElementBlock("span",Li,e.toDisplayString(" ")+"("+e.toDisplayString(o.value.basedOnMeterValue)+")",1)):e.createCommentVNode("",!0)]}),_:1},8,["is-editable","is-removable","error"]))}}),Zi=({isEditable:t,isRemovable:i})=>({isEditableFlag:e.computed(()=>"function"==typeof t||!!t),isItemEditable:e=>"function"==typeof t?t(e):!!t,isItemRemovable:e=>"function"==typeof i?i(e):"boolean"!=typeof i||i}),Ai={class:"flex justify-between items-center gap-4"},Mi={class:"flex gap-4 items-center"},Fi={class:"flex items-center gap-1"},Ui={class:"mt-1 text-xs text-gray-500"},Gi={class:"flex justify-between items-center gap-4"},Hi={class:"flex items-center gap-1"},ji={class:"text-xs uppercase font-bold text-gray-700"},qi={class:"mt-1 flex flex-col gap-2"},Wi=e.defineComponent({__name:"CommitmentDiscountsSection",props:{title:{},orderOfApplicationExplanation:{},description:{},selectPricingPlanHint:{},addItemLabel:{},notEditableExplanation:{},hasItems:{type:Boolean},pricingPlanVersionIsSelected:{type:Boolean},isEditable:{type:Boolean},isCreatable:{type:Boolean}},emits:["add"],setup:i=>(n,o)=>(e.openBlock(),e.createElementBlock("section",null,[i.hasItems?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("header",Gi,[e.createElementVNode("div",Hi,[e.createElementVNode("h2",ji,e.toDisplayString(i.title),1),e.createVNode(f._sfc_main,{variant:"outline",placement:"bottom-start"},{default:e.withCtx(()=>[e.createVNode(c._sfc_main$1,{icon:"help",class:"drop-shadow-sm hover:bg-gray-50 hover:cursor-default",size:"xs"})]),tooltip:e.withCtx(()=>[e.createVNode(f.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(f._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.orderOfApplicationExplanation),1)]),_:1})]),_:1})]),_:1})])]),e.createElementVNode("ul",qi,[e.renderSlot(n.$slots,"list-items")])],64)):(e.openBlock(),e.createBlock(l._sfc_main,{key:0},{default:e.withCtx(()=>[e.createElementVNode("div",Ai,[e.createElementVNode("div",Mi,[e.renderSlot(n.$slots,"icon"),e.createElementVNode("div",null,[e.createElementVNode("div",Fi,[e.createVNode(t._sfc_main,{tag:"h2",variant:"caps-heading"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.title),1)]),_:1}),e.createVNode(f._sfc_main,{variant:"outline",placement:"bottom-start"},{default:e.withCtx(()=>[e.createVNode(c._sfc_main$1,{icon:"help",class:"drop-shadow-sm hover:bg-gray-50 hover:cursor-default",size:"xs"})]),tooltip:e.withCtx(()=>[e.createVNode(f.TooltipContent,null,{default:e.withCtx(()=>[e.createVNode(f._sfc_main$1,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.orderOfApplicationExplanation),1)]),_:1})]),_:1})]),_:1})]),e.createElementVNode("p",Ui,e.toDisplayString(i.description),1)])]),i.isEditable?(e.openBlock(),e.createBlock(f._sfc_main,{key:0,variant:"outline"},{tooltip:e.withCtx(()=>[e.createVNode(f.TooltipContent,null,{default:e.withCtx(()=>[i.pricingPlanVersionIsSelected?i.isEditable?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(t._sfc_main,{key:1,variant:"body-sm","no-spacing":"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.notEditableExplanation),1)]),_:1})):(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"body-sm","no-spacing":"",class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.selectPricingPlanHint),1)]),_:1}))]),_:1})]),_:1})):e.createCommentVNode("",!0)])]),_:3}))]))}),Ki=["src"],Ji=e.defineComponent({__name:"SubscriptionCommitments",props:{pricingPlanVersion:{},commitment:{},i18n:{},isCreatable:{type:Boolean},isEditable:{type:[Boolean,Function]},isRemovable:{type:[Boolean,Function]},error:{},timezone:{}},setup(t){const i=t,n=e.computed(()=>i.i18n??ui),{isEditableFlag:o,isItemEditable:l,isItemRemovable:r}=Zi({isEditable:i.isEditable,isRemovable:i.isRemovable}),a=e.computed(()=>{if("error"in i)return(e=>{const t=Object.entries(e||{});if(0===t.length)return;const[i,n]=t[0],[o,l,r]=i.split(".");return{commitmentLevel:o,index:parseInt(l,10),fieldName:r,message:n}})(i.error)}),c=e.computed(()=>{var e,t,n,o,l,r,c,s;return[...(null==(t=null==(e=i.commitment)?void 0:e.pricing_item_configs)?void 0:t.map((e,t)=>{var i,n;return{item:{commitmentLevel:"PRICING_RULE",...e},error:t===(null==(i=a.value)?void 0:i.index)&&"pricing_item_configs"===(null==(n=a.value)?void 0:n.commitmentLevel)?a.value.message:void 0}}))||[],...(null==(o=null==(n=i.commitment)?void 0:n.pricing_items)?void 0:o.map((e,t)=>{var i,n;return{item:{commitmentLevel:"REVENUE_ITEMS",...e},error:t===(null==(i=a.value)?void 0:i.index)&&"pricing_items"===(null==(n=a.value)?void 0:n.commitmentLevel)?a.value.message:void 0}}))||[],...(null==(r=null==(l=i.commitment)?void 0:l.pricings)?void 0:r.map((e,t)=>{var i,n;return{item:{commitmentLevel:"PRODUCTS",...e},error:t===(null==(i=a.value)?void 0:i.index)&&"pricings"===(null==(n=a.value)?void 0:n.commitmentLevel)?a.value.message:void 0}}))||[],...(null==(s=null==(c=i.commitment)?void 0:c.totals)?void 0:s.map((e,t)=>{var i,n;return{item:{commitmentLevel:"INVOICE",...e},error:t===(null==(i=a.value)?void 0:i.index)&&"totals"===(null==(n=a.value)?void 0:n.commitmentLevel)?a.value.message:void 0}}))||[]]});return(i,a)=>(e.openBlock(),e.createBlock(Wi,{title:n.value.title,"order-of-application-explanation":n.value.orderOfApplicationExplanation,description:n.value.description,"pricing-plan-version-is-selected":!!t.pricingPlanVersion,"select-pricing-plan-hint":n.value.selectPricingPlanHint,"add-item-label":n.value.addItemLabel,"not-editable-explanation":n.value.notEditableExplanation,"is-creatable":!!t.isCreatable,"is-editable":e.unref(o),"has-items":c.value.length>0,onAdd:a[0]||(a[0]=e=>i.$emit("add"))},{icon:e.withCtx(()=>[e.createElementVNode("img",{src:e.unref("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='44'%20height='44'%20fill='none'%3e%3cmask%20id='a'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='44'%20height='44'%3e%3cpath%20fill='%23D9D9D9'%20d='M0%200h44v44H0z'/%3e%3c/mask%3e%3cg%20mask='url(%23a)'%3e%3cmask%20id='e'%20fill='%23fff'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.922%2015.593A6%206%200%200%200%208.03%208.816c-.072-.516.251-1.035.767-1.108l21.957-3.086c.516-.072.97.338%201.043.854a6%206%200%200%200%206.776%205.106c.589-.082%201.19.281%201.273.87L42.06%2027.22c.083.589-.395%201.104-.984%201.186a6%206%200%200%200-5.106%206.777c.074.525-.255%201.055-.78%201.13l-21.925%203.08c-.526.074-.988-.344-1.062-.87a6%206%200%200%200-6.776-5.107c-.452.064-.901-.223-.965-.674L2.182%2016.507c-.064-.451.29-.85.74-.914Z'/%3e%3c/mask%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.922%2015.593A6%206%200%200%200%208.03%208.816c-.072-.516.251-1.035.767-1.108l21.957-3.086c.516-.072.97.338%201.043.854a6%206%200%200%200%206.776%205.106c.589-.082%201.19.281%201.273.87L42.06%2027.22c.083.589-.395%201.104-.984%201.186a6%206%200%200%200-5.106%206.777c.074.525-.255%201.055-.78%201.13l-21.925%203.08c-.526.074-.988-.344-1.062-.87a6%206%200%200%200-6.776-5.107c-.452.064-.901-.223-.965-.674L2.182%2016.507c-.064-.451.29-.85.74-.914Z'%20fill='%23D9D9D9'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.922%2015.593A6%206%200%200%200%208.03%208.816c-.072-.516.251-1.035.767-1.108l21.957-3.086c.516-.072.97.338%201.043.854a6%206%200%200%200%206.776%205.106c.589-.082%201.19.281%201.273.87L42.06%2027.22c.083.589-.395%201.104-.984%201.186a6%206%200%200%200-5.106%206.777c.074.525-.255%201.055-.78%201.13l-21.925%203.08c-.526.074-.988-.344-1.062-.87a6%206%200%200%200-6.776-5.107c-.452.064-.901-.223-.965-.674L2.182%2016.507c-.064-.451.29-.85.74-.914Z'%20fill='%23BFEAFB'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.922%2015.593A6%206%200%200%200%208.03%208.816c-.072-.516.251-1.035.767-1.108l21.957-3.086c.516-.072.97.338%201.043.854a6%206%200%200%200%206.776%205.106c.589-.082%201.19.281%201.273.87L42.06%2027.22c.083.589-.395%201.104-.984%201.186a6%206%200%200%200-5.106%206.777c.074.525-.255%201.055-.78%201.13l-21.925%203.08c-.526.074-.988-.344-1.062-.87a6%206%200%200%200-6.776-5.107c-.452.064-.901-.223-.965-.674L2.182%2016.507c-.064-.451.29-.85.74-.914Z'%20fill='url(%23b)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M2.922%2015.593A6%206%200%200%200%208.03%208.816c-.072-.516.251-1.035.767-1.108l21.957-3.086c.516-.072.97.338%201.043.854a6%206%200%200%200%206.776%205.106c.589-.082%201.19.281%201.273.87L42.06%2027.22c.083.589-.395%201.104-.984%201.186a6%206%200%200%200-5.106%206.777c.074.525-.255%201.055-.78%201.13l-21.925%203.08c-.526.074-.988-.344-1.062-.87a6%206%200%200%200-6.776-5.107c-.452.064-.901-.223-.965-.674L2.182%2016.507c-.064-.451.29-.85.74-.914Z'%20fill='url(%23c)'/%3e%3cpath%20d='m39.845%2011.452-1.09.153%201.09-.153Zm-9.092-6.83.153%201.09-.153-1.09Zm11.308%2022.599%201.09-.153-1.09.153ZM8.796%207.708%208.643%206.62l.153%201.09ZM6.94%208.97a4.9%204.9%200%200%201-4.17%205.534l.306%202.179a7.1%207.1%200%200%200%206.042-8.019l-2.178.306ZM30.6%203.533%208.643%206.62l.306%202.179%2021.957-3.086-.306-2.179Zm7.819%205.96a4.9%204.9%200%200%201-5.534-4.17l-2.179.306a7.1%207.1%200%200%200%208.02%206.043l-.307-2.179Zm4.731%2017.575-2.216-15.77-2.179.307%202.217%2015.769%202.178-.306Zm-6.09%207.963a4.9%204.9%200%200%201%204.17-5.534l-.306-2.179a7.1%207.1%200%200%200-6.043%208.019l2.179-.306Zm-23.641%205.453%2021.924-3.081-.306-2.179-21.924%203.081.306%202.179ZM5.58%2034.507a4.9%204.9%200%200%201%205.534%204.17l2.178-.306a7.1%207.1%200%200%200-8.018-6.043l.306%202.179ZM1.092%2016.66l2.282%2016.236%202.179-.306L3.27%2016.354l-2.179.306Zm2.179-.306a.333.333%200%200%201-.066.254.202.202%200%200%201-.13.074l-.306-2.179c-.95.134-1.838%201.008-1.677%202.157l2.179-.306Zm9.841%2021.951a.244.244%200%200%201%20.105.009c.031.01.05.023.06.03.014.013.016.02.017.027l-2.179.306c.142%201.008%201.064%201.981%202.304%201.807l-.306-2.179Zm21.77-2.968c-.002-.006-.002-.014.009-.03a.168.168%200%200%201%20.048-.046.244.244%200%200%201%20.098-.037l.306%202.179c1.24-.175%201.859-1.365%201.717-2.372l-2.179.306Zm3.843-23.665a.117.117%200%200%201%20.069.012c.003.002-.005-.002-.015-.017a.153.153%200%200%201-.024-.062l2.179-.306c-.185-1.317-1.46-1.954-2.515-1.806l.306%202.179ZM5.275%2032.328a.202.202%200%200%201%20.144.036.332.332%200%200%201%20.134.226l-2.179.306c.162%201.15%201.255%201.745%202.207%201.61l-.306-2.178ZM30.906%205.712a.258.258%200%200%201-.11-.01.186.186%200%200%201-.065-.033c-.019-.016-.023-.028-.025-.04l2.179-.306c-.14-1-1.057-1.963-2.285-1.79l.306%202.179Zm10.066%2021.662a.153.153%200%200%201%20.005-.066c.006-.018.012-.024.01-.02a.115.115%200%200%201-.062.03l.305%202.179c1.056-.149%202.105-1.112%201.92-2.43l-2.178.307ZM9.118%208.663c.002.012.001.025-.012.045a.186.186%200%200%201-.053.05.258.258%200%200%201-.104.04l-.306-2.179c-1.229.173-1.844%201.35-1.703%202.35l2.178-.306Z'%20fill='url(%23d)'%20fill-opacity='.1'%20mask='url(%23e)'/%3e%3cg%20opacity='.5'%3e%3cmask%20id='f'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='10'%20y='10'%20width='24'%20height='24'%3e%3cpath%20transform='rotate(-8%2010.706%2013.489)'%20fill='%23D9D9D9'%20d='M10.706%2013.489h20v20h-20z'/%3e%3c/mask%3e%3cg%20mask='url(%23f)'%3e%3cpath%20d='M22.825%2028.616a.486.486%200%200%200%20.271-.164l5.816-7.718a1.54%201.54%200%200%200%20.283-.608%201.804%201.804%200%200%200-.176-1.248%201.375%201.375%200%200%200-.435-.475l-4-3.014a1.376%201.376%200%200%200-.577-.288%201.775%201.775%200%200%200-1.248.176%201.54%201.54%200%200%200-.506.44l-.195.258%201.744%201.333c.233.163.416.362.547.596.13.234.215.489.254.764.081.577-.047%201.09-.383%201.537-.337.447-.795.711-1.372.792a2.245%202.245%200%200%201-.815-.033%201.895%201.895%200%200%201-.731-.339l-1.762-1.309-3.103%204.118a.393.393%200%200%200-.083.306c.015.11.07.204.166.282a.386.386%200%200%200%20.307.094.484.484%200%200%200%20.271-.164l2.412-3.201%201.318.993-2.391%203.197a.394.394%200%200%200-.083.306.4.4%200%200%200%20.164.272.4.4%200%200%200%20.306.083.486.486%200%200%200%20.271-.164l2.415-3.18%201.318.993-2.39%203.197a.25.25%200%200%200-.076.137.472.472%200%200%200-.008.17.4.4%200%200%200%20.164.27.4.4%200%200%200%20.578-.08l2.414-3.18%201.318.993-2.412%203.2a.394.394%200%200%200-.083.306c.016.11.074.2.175.27.101.07.207.098.317.082Zm.21%201.654a2.033%202.033%200%200%201-1.422-.316%201.99%201.99%200%200%201-.869-1.172%202.054%202.054%200%200%201-1.257-.412%202.054%202.054%200%200%201-.743-1.095%201.979%201.979%200%200%201-1.248-.424%202.12%202.12%200%200%201-.731-1.086%201.982%201.982%200%200%201-1.375-.5%202.046%202.046%200%200%201-.687-1.293%202.119%202.119%200%200%201%20.043-.816c.068-.269.184-.513.35-.733l4.116-5.438%203.083%202.323a.25.25%200%200%200%20.137.075.47.47%200%200%200%20.169.008.445.445%200%200%200%20.294-.157.39.39%200%200%200%20.081-.317.473.473%200%200%200-.054-.16.25.25%200%200%200-.11-.111l-3.365-2.536a1.377%201.377%200%200%200-.577-.287%201.778%201.778%200%200%200-1.248.176%201.538%201.538%200%200%200-.506.44l-2.497%203.337c-.107.142-.19.3-.249.477-.06.177-.091.35-.095.518a1.57%201.57%200%200%200%20.304.968l-1.029%201.364a3.313%203.313%200%200%201-.662-.969%203.273%203.273%200%200%201-.154-2.293c.114-.387.295-.746.543-1.075l2.5-3.318c.286-.363.62-.655%201.003-.877a3.316%203.316%200%200%201%203.68.219l.26.195.195-.259c.285-.363.62-.655%201.002-.877a3.316%203.316%200%200%201%203.68.219l3.977%202.996a3.393%203.393%200%200%201%201.3%202.216c.06.426.036.854-.072%201.283a3.282%203.282%200%200%201-.57%201.185l-5.818%207.697c-.166.22-.368.402-.607.548a2.002%202.002%200%200%201-.771.277Z'%20fill='%23222B35'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='b'%20x1='1.097'%20y1='10.89'%20x2='36.001'%20y2='44.744'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF6200'/%3e%3cstop%20offset='1'%20stop-color='%23FF6200'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='c'%20x1='40.312'%20y1='5.379'%20x2='16.092'%20y2='47.542'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23fff'/%3e%3cstop%20offset='1'%20stop-color='%23fff'%20stop-opacity='.4'/%3e%3c/linearGradient%3e%3clinearGradient%20id='d'%20x1='24.991'%20y1='38.635'%20x2='20.304'%20y2='5.283'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%230C0E41'/%3e%3cstop%20offset='1'%20stop-color='%230C0E41'%20stop-opacity='.5'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e"),alt:""},null,8,Ki)]),"list-items":e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,({item:o,error:a})=>(e.openBlock(),e.createElementBlock("li",{key:JSON.stringify(o)},[e.createVNode(Ri,{timezone:t.timezone,commitment:o,error:a,"is-editable":e.unref(l)(o),"is-removable":e.unref(r)(o),"pricing-plan-version":t.pricingPlanVersion,i18n:n.value,onEdit:e=>i.$emit("edit",o),onDelete:e=>i.$emit("delete",o)},null,8,["timezone","commitment","error","is-editable","is-removable","pricing-plan-version","i18n","onEdit","onDelete"])]))),128))]),_:1},8,["title","order-of-application-explanation","description","pricing-plan-version-is-selected","select-pricing-plan-hint","add-item-label","not-editable-explanation","is-creatable","is-editable","has-items"]))}}),Xi=(i,n,o)=>{const{formatDate:l}=t.useIntl(),r=e.computed(()=>{var e,t;return null==(t=null==(e=i.value)?void 0:e.pricing_categories)?void 0:t.flatMap(e=>{var t;return[...(null==(t=e.pricing_groups)?void 0:t.flatMap(e=>e.pricings))??[],...e.pricings??[]]})}),a=e=>{if(!e.start_at&&!e.end_at)return"";let t,i;return e.start_at||(t=n.startOfSchedule),e.end_at||(i=n.endOfSchedule),e.start_at&&(t=l(o?{date:e.start_at,format:"date",offsetType:"offsetted",timezone:o}:{date:e.start_at,format:"date",offsetType:"local",showTimezone:!1})),e.end_at&&(i=l(o?{date:e.end_at,format:"date",offsetType:"offsetted",timezone:o}:{date:e.end_at,format:"date",offsetType:"local",showTimezone:!1})),`(${t} - ${i})`};return{getDiscountBody:e=>{let t;switch(e.discountLevel){case"PRODUCT":t=n.product;break;case"REVENUE_ITEM":t=n.revenueItem;break;case"PRICING_RULE":t=n.pricingRule}return n.discountBody(t??"",(e=>{var t,i,o,l,a,c,s,d,p,m;let u,g;switch(e.discountLevel){case"PRODUCT":u=null==(t=r.value)?void 0:t.find(t=>{var i;return t.id===(null==(i=e.ids)?void 0:i[0])});break;case"REVENUE_ITEM":{const t=t=>{var i;return t.id===(null==(i=e.ids)?void 0:i[0])};u=null==(i=r.value)?void 0:i.find(e=>{var i;return null==(i=e.items)?void 0:i.some(t)}),g=null==(o=null==u?void 0:u.items)?void 0:o.find(t);break}case"PRICING_RULE":{const t=t=>{var i;return t.id===(null==(i=e.ids)?void 0:i[0])},i=e=>{var n,o;return t(e)||!!(null==(o=null==(n=e.conditions)?void 0:n.configs)?void 0:o.some(i))},o=e=>{var t;return null==(t=e.configs)?void 0:t.some(i)},s=e=>{var t;return null==(t=e.items)?void 0:t.some(o)},d=null==(l=r.value)?void 0:l.find(s),p=null==(a=null==d?void 0:d.items)?void 0:a.find(o),m=null==(c=null==p?void 0:p.configs)?void 0:c.flatMap($),u=null==m?void 0:m.find(t);return`<strong>${O(n)({pricing:d,item:p,config:u})}</strong>`}}return[(null==u?void 0:u.name)??(null==(d=null==(s=null==u?void 0:u.products)?void 0:s[0])?void 0:d.name),null==(m=null==(p=null==g?void 0:g.product_items)?void 0:p[0])?void 0:m.name].filter(Boolean).join(" - ")})(e)??"",a(e))},getFormattedDuration:a}},Yi={class:"font-semibold"},Qi={key:1,class:"text-primary-600"},en=["innerHTML"],tn=["innerHTML"],nn=e.defineComponent({__name:"SubscriptionDiscountItem",props:{discount:{},pricingPlanVersion:{},isEditable:{type:Boolean},isRemovable:{type:Boolean},i18n:{},error:{},timezone:{}},emits:["edit","delete"],setup(t,{emit:i}){const n=t,o=i,l=e.computed(()=>n.i18n??di),{getDiscountBody:r,getFormattedDuration:a}=Xi(e.toRef(()=>n.pricingPlanVersion),l.value,n.timezone);return(i,n)=>(e.openBlock(),e.createBlock(Di,{icon:"south_east","icon-color":"yellow","is-editable":t.isEditable,"is-removable":t.isRemovable,error:t.error,onEdit:n[0]||(n[0]=e=>o("edit")),onDelete:n[1]||(n[1]=e=>o("delete"))},{body:e.withCtx(()=>{var i,o,c;return[e.createElementVNode("span",Yi,[(null==(i=t.discount.amount)?void 0:i.quantity)?(e.openBlock(),e.createBlock(g._sfc_main,{key:0,value:t.discount.amount,highlighted:""},null,8,["value"])):t.discount.percentage?(e.openBlock(),e.createElementBlock("span",Qi,e.toDisplayString(t.discount.percentage)+"%",1)):e.createCommentVNode("",!0)]),n[2]||(n[2]=e.createTextVNode(" ",-1)),"INVOICE"===t.discount.discountLevel?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:null==(c=(o=l.value).discountOnInvoice)?void 0:c.call(o,e.unref(a)(t.discount))},null,8,en)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:e.unref(r)(t.discount)},null,8,tn))]}),_:1},8,["is-editable","is-removable","error"]))}}),on=["src"],ln=e.defineComponent({__name:"SubscriptionDiscounts",props:{i18n:{},discount:{},pricingPlanVersion:{},isEditable:{type:[Boolean,Function]},isCreatable:{type:Boolean},isRemovable:{type:[Boolean,Function]},scheduleStart:{},billingPeriod:{},billingTime:{},isDraftSubscription:{type:Boolean,default:!1},error:{},timezone:{}},emits:["add","edit","delete"],setup(t){const i=t,n=e.computed(()=>i.i18n??pi),o=e.computed(()=>{if("error"in i)return(e=>{const t=Object.entries(e||{});if(0===t.length)return;const[i,n]=t[0],[o,l,r]=i.split(".");return{discountLevel:o,index:parseInt(l,10),fieldName:r,message:n}})(i.error)}),{isEditableFlag:l,isItemEditable:r,isItemRemovable:a}=Zi({isEditable:i.isEditable,isRemovable:i.isRemovable}),c=e.computed(()=>{var e,t,n,l,r,a,c,s;return[...(null==(t=null==(e=i.discount)?void 0:e.pricing_item_configs)?void 0:t.map((e,t)=>{var i,n;return{item:{...e,discountLevel:"PRICING_RULE"},error:t===(null==(i=o.value)?void 0:i.index)&&"pricing_item_configs"===(null==(n=o.value)?void 0:n.discountLevel)?o.value.message:void 0}}))||[],...(null==(l=null==(n=i.discount)?void 0:n.pricing_items)?void 0:l.map((e,t)=>{var i,n;return{item:{...e,discountLevel:"REVENUE_ITEM"},error:t===(null==(i=o.value)?void 0:i.index)&&"pricing_items"===(null==(n=o.value)?void 0:n.discountLevel)?o.value.message:void 0}}))||[],...(null==(a=null==(r=i.discount)?void 0:r.pricings)?void 0:a.map((e,t)=>{var i,n;return{item:{...e,discountLevel:"PRODUCT"},error:t===(null==(i=o.value)?void 0:i.index)&&"pricings"===(null==(n=o.value)?void 0:n.discountLevel)?o.value.message:void 0}}))||[],...(null==(s=null==(c=i.discount)?void 0:c.totals)?void 0:s.map((e,t)=>{var i,n;return{item:{...e,discountLevel:"INVOICE"},error:t===(null==(i=o.value)?void 0:i.index)&&"totals"===(null==(n=o.value)?void 0:n.discountLevel)?o.value.message:void 0}}))||[]]});return(i,o)=>(e.openBlock(),e.createBlock(Wi,e.mergeProps(i.$attrs,{title:n.value.title,"order-of-application-explanation":n.value.orderOfApplicationExplanation,description:n.value.description,"pricing-plan-version-is-selected":!!t.pricingPlanVersion,"select-pricing-plan-hint":n.value.selectPricingPlanHint,"add-item-label":n.value.addItemLabel,"is-editable":e.unref(l),"is-creatable":!!t.isCreatable,"not-editable-explanation":n.value.notEditableExplanation,"has-items":c.value.length>0,onAdd:o[0]||(o[0]=e=>i.$emit("add"))}),{icon:e.withCtx(()=>[e.createElementVNode("img",{src:e.unref("data:image/svg+xml,%3csvg%20width='44'%20height='44'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='a'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='44'%20height='44'%3e%3cpath%20fill='%23D9D9D9'%20d='M0%200h44v44H0z'/%3e%3c/mask%3e%3cg%20mask='url(%23a)'%3e%3cmask%20id='e'%20fill='%23fff'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='m18.55%2039.32%203.45%203.4%203.46-3.41%204.48%201.85%201.86-4.5h4.87v-4.84l4.47-1.9-1.82-4.47%203.4-3.45-3.41-3.46%201.85-4.48-4.5-1.86V7.33h-4.84l-1.9-4.47-4.47%201.82L22%201.28%2018.54%204.7l-4.48-1.85-1.86%204.5H7.33v4.84l-4.47%201.9%201.82%204.47L1.28%2022l3.41%203.46-1.85%204.48%204.5%201.86v4.87h4.84l1.9%204.47%204.47-1.82Z'/%3e%3c/mask%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='m18.55%2039.32%203.45%203.4%203.46-3.41%204.48%201.85%201.86-4.5h4.87v-4.84l4.47-1.9-1.82-4.47%203.4-3.45-3.41-3.46%201.85-4.48-4.5-1.86V7.33h-4.84l-1.9-4.47-4.47%201.82L22%201.28%2018.54%204.7l-4.48-1.85-1.86%204.5H7.33v4.84l-4.47%201.9%201.82%204.47L1.28%2022l3.41%203.46-1.85%204.48%204.5%201.86v4.87h4.84l1.9%204.47%204.47-1.82Z'%20fill='%23BFEAFB'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='m18.55%2039.32%203.45%203.4%203.46-3.41%204.48%201.85%201.86-4.5h4.87v-4.84l4.47-1.9-1.82-4.47%203.4-3.45-3.41-3.46%201.85-4.48-4.5-1.86V7.33h-4.84l-1.9-4.47-4.47%201.82L22%201.28%2018.54%204.7l-4.48-1.85-1.86%204.5H7.33v4.84l-4.47%201.9%201.82%204.47L1.28%2022l3.41%203.46-1.85%204.48%204.5%201.86v4.87h4.84l1.9%204.47%204.47-1.82Z'%20fill='url(%23b)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='m18.55%2039.32%203.45%203.4%203.46-3.41%204.48%201.85%201.86-4.5h4.87v-4.84l4.47-1.9-1.82-4.47%203.4-3.45-3.41-3.46%201.85-4.48-4.5-1.86V7.33h-4.84l-1.9-4.47-4.47%201.82L22%201.28%2018.54%204.7l-4.48-1.85-1.86%204.5H7.33v4.84l-4.47%201.9%201.82%204.47L1.28%2022l3.41%203.46-1.85%204.48%204.5%201.86v4.87h4.84l1.9%204.47%204.47-1.82Z'%20fill='url(%23c)'/%3e%3cpath%20d='m22%2042.72-.7.7.7.7.7-.7-.7-.7Zm-3.45-3.4.7-.71-.46-.46-.61.25.37.92Zm6.91-.01.38-.93-.6-.25-.48.47.7.7Zm4.48%201.85-.38.93.92.38.38-.92-.92-.39Zm1.86-4.5v-1h-.67l-.25.62.92.39Zm4.87%200v1h1v-1h-1Zm0-4.84-.4-.92-.6.26v.66h1Zm4.47-1.9.39.93.9-.39-.36-.9-.93.37Zm-1.82-4.47-.7-.7-.47.46.25.61.92-.37Zm3.4-3.45.7.7.7-.7-.7-.7-.7.7Zm-3.41-3.46-.93-.38-.25.61.47.47.7-.7Zm1.85-4.48.93.39.38-.93-.92-.38-.39.92Zm-4.5-1.86h-1v.67l.62.25.39-.92Zm0-4.87h1v-1h-1v1Zm-4.84%200-.92.4.26.6h.66v-1Zm-1.9-4.47.93-.39-.38-.9-.92.36.38.93Zm-4.47%201.82-.7.71.46.46.61-.25-.37-.92ZM22%201.28l.7-.7-.7-.7-.7.7.7.7ZM18.54%204.7l-.38.93.61.25.47-.47-.7-.7Zm-4.48-1.85.39-.93-.93-.38-.38.92.92.39Zm-1.86%204.5v1h.67l.25-.62-.92-.39Zm-4.87%200v-1h-1v1h1Zm0%204.84.4.92.6-.26v-.66h-1Zm-4.47%201.9-.39-.93-.9.38.36.92.93-.38Zm1.82%204.47.71.7.46-.46-.25-.61-.92.37ZM1.28%2022l-.7-.7-.7.7.7.7.7-.7Zm3.41%203.46.93.38.25-.61-.47-.47-.7.7Zm-1.85%204.48-.93-.39-.38.93.92.38.39-.92Zm4.5%201.86h1v-.67l-.62-.25-.39.92Zm0%204.87h-1v1h1v-1Zm4.84%200%20.92-.4-.26-.6h-.66v1Zm1.9%204.47-.93.39.39.9.9-.36-.37-.93Zm8.62.86-3.44-3.39-1.4%201.42%203.44%203.4L22.7%2042Zm2.06-3.4L21.3%2042l1.4%201.43%203.46-3.41-1.4-1.42Zm5.56%201.64-4.48-1.86-.76%201.85%204.48%201.86.76-1.85Zm.56-3.96L29%2040.78l1.85.77%201.86-4.5-1.84-.77Zm5.79-.61H31.8v2h4.87v-2Zm-1-3.85v4.85h2v-4.85h-2Zm5.08-2.81-4.47%201.89.78%201.84%204.47-1.9-.78-1.83Zm-2.35-3.19%201.81%204.48%201.86-.75-1.82-4.48-1.85.75ZM42%2021.3l-3.39%203.44%201.43%201.4%203.39-3.44L42%2021.3Zm-3.4-2.06L42%2022.7l1.43-1.4-3.4-3.46-1.43%201.4Zm1.64-5.56-1.86%204.48%201.85.76%201.86-4.47-1.85-.77Zm-3.96-.56%204.5%201.87.77-1.85-4.5-1.86-.77%201.84Zm-.61-5.79v4.87h2V7.33h-2Zm-3.85%201h4.85v-2h-4.85v2Zm-2.81-5.08%201.89%204.47%201.84-.78-1.9-4.47-1.83.78ZM25.82%205.6%2030.3%203.8l-.75-1.86-4.48%201.82.75%201.85ZM21.3%202l3.44%203.39%201.4-1.42L22.7.57%2021.3%202Zm-2.06%203.4L22.7%202%2021.3.57l-3.46%203.4%201.4%201.43Zm-5.56-1.64%204.48%201.86.76-1.85-4.47-1.86-.77%201.85Zm-.56%203.96L15%203.22l-1.85-.77-1.86%204.5%201.84.77Zm-5.79.61h4.87v-2H7.33v2Zm1%203.85V7.33h-2v4.85h2Zm-5.08%202.81%204.47-1.89-.78-1.84-4.47%201.9.78%201.83Zm2.35%203.19L3.8%2013.7l-1.86.75%201.82%204.48%201.85-.75ZM2%2022.7l3.39-3.44-1.42-1.4-3.4%203.44L2%2022.7Zm3.4%202.06L2%2021.3.57%2022.7l3.41%203.46%201.42-1.4Zm-1.64%205.56%201.86-4.48-1.85-.76-1.86%204.47%201.85.77Zm3.96.56L3.22%2029l-.77%201.85%204.5%201.86.77-1.84Zm.61%205.79V31.8h-2v4.87h2Zm3.85-1H7.33v2h4.85v-2Zm2.81%205.08-1.89-4.47-1.84.78%201.9%204.47%201.83-.78Zm3.19-2.35L13.7%2040.2l.75%201.86%204.48-1.82-.75-1.85Z'%20fill='url(%23d)'%20fill-opacity='.1'%20mask='url(%23e)'/%3e%3cg%20opacity='.5'%3e%3cmask%20id='f'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='12'%20y='12'%20width='20'%20height='20'%3e%3cpath%20fill='%23D9D9D9'%20d='M12%2012h20v20H12z'/%3e%3c/mask%3e%3cg%20mask='url(%23f)'%3e%3cpath%20d='M19.5%2027.83v-1.66H25l-9.67-9.67%201.17-1.17L26.17%2025v-5.5h1.66v8.33H19.5Z'%20fill='%23222B35'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='b'%20x1='1.28'%20y1='1.28'%20x2='42.72'%20y2='42.72'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F6D449'/%3e%3cstop%20offset='1'%20stop-color='%23F6D449'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='c'%20x1='42.72'%20y1='1.28'%20x2='1.28'%20y2='42.72'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23fff'/%3e%3cstop%20offset='1'%20stop-color='%23fff'%20stop-opacity='.4'/%3e%3c/linearGradient%3e%3clinearGradient%20id='d'%20x1='22'%20y1='42.72'%20x2='22'%20y2='-2.59'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%230C0E41'/%3e%3cstop%20offset='1'%20stop-color='%230C0E41'%20stop-opacity='.5'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e"),alt:""},null,8,on)]),"list-items":e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,({item:o,error:l})=>(e.openBlock(),e.createElementBlock("li",{key:JSON.stringify(o)},[e.createVNode(nn,{discount:o,error:l,"is-editable":e.unref(r)(o),"is-removable":e.unref(a)(o),"pricing-plan-version":t.pricingPlanVersion,i18n:n.value,timezone:t.timezone,onEdit:e=>i.$emit("edit",o),onDelete:e=>i.$emit("delete",o)},null,8,["discount","error","is-editable","is-removable","pricing-plan-version","i18n","timezone","onEdit","onDelete"])]))),128))]),_:1},16,["title","order-of-application-explanation","description","pricing-plan-version-is-selected","select-pricing-plan-hint","add-item-label","is-editable","is-creatable","not-editable-explanation","has-items"]))}}),rn={class:"font-semibold text-primary-600"},an=["innerHTML"],cn=e.defineComponent({__name:"SubscriptionMarkupItem",props:{markup:{},pricingPlanVersion:{},isEditable:{type:Boolean},isRemovable:{type:Boolean},i18n:{},error:{},timezone:{}},emits:["edit","delete"],setup(i,{emit:n}){const o=i,l=n,r=e.computed(()=>o.i18n??gi),{getMarkupBody:a}=((i,n=gi,o)=>{const{formatDate:l}=t.useIntl(),r=e.computed(()=>{var e,t;return(null==(t=null==(e=i.value)?void 0:e.pricing_categories)?void 0:t.flatMap(e=>{var t;return[...(null==(t=e.pricing_groups)?void 0:t.flatMap(e=>e.pricings))??[],...e.pricings??[]]}))??[]}),a=e=>{var t,i;const o=t=>{var i;return t.id===(null==(i=e.ids)?void 0:i[0])},l=e=>{var t,i;return o(e)||!!(null==(i=null==(t=e.conditions)?void 0:t.configs)?void 0:i.some(o))},a=e=>{var t;return null==(t=e.configs)?void 0:t.some(l)},c=null==(t=r.value)?void 0:t.find(e=>{var t;return null==(t=e.items)?void 0:t.some(a)}),s=null==(i=null==c?void 0:c.items)?void 0:i.find(a),d=(null==s?void 0:s.configs)&&(null==s?void 0:s.configs.flatMap($)),p=null==d?void 0:d.find(o);return`<strong>${O(n)({pricing:c,item:s,config:p})}</strong>`},c=e=>{if(!e.start_at&&!e.end_at)return"";let t,i;return e.start_at||(t=n.startOfSchedule),e.end_at||(i=n.endOfSchedule),e.start_at&&(t=l(o?{date:e.start_at,format:"date",offsetType:"offsetted",timezone:o}:{date:e.start_at,format:"date",offsetType:"local",showTimezone:!1})),e.end_at&&(i=l(o?{date:e.end_at,format:"date",offsetType:"offsetted",timezone:o}:{date:e.end_at,format:"date",offsetType:"local",showTimezone:!1})),`(${t} - ${i})`};return{getMarkupBody:e=>n.markupBody(n.pricingRule,a(e)??"",c(e)),getFormattedDuration:c}})(e.toRef(()=>o.pricingPlanVersion),r.value,o.timezone);return(t,n)=>(e.openBlock(),e.createBlock(Di,{icon:"north_east","icon-color":"teal","is-editable":i.isEditable,"is-removable":i.isRemovable,error:i.error,onEdit:n[0]||(n[0]=e=>l("edit")),onDelete:n[1]||(n[1]=e=>l("delete"))},{body:e.withCtx(()=>[e.createElementVNode("span",rn,e.toDisplayString(i.markup.percentage)+"%"+e.toDisplayString(" "),1),e.createElementVNode("span",{innerHTML:e.unref(a)(i.markup)},null,8,an)]),_:1},8,["is-editable","is-removable","error"]))}}),sn=["src"],dn=e.defineComponent({__name:"SubscriptionMarkups",props:{i18n:{},markup:{},pricingPlanVersion:{},isCreatable:{type:Boolean},isEditable:{type:[Boolean,Function]},isRemovable:{type:[Boolean,Function]},error:{},timezone:{}},emits:["add","edit","delete"],setup(t){const i=t,n=e.computed(()=>i.i18n??fi),{isEditableFlag:o,isItemEditable:l,isItemRemovable:r}=Zi({isEditable:i.isEditable,isRemovable:i.isRemovable}),a=e.computed(()=>{if("error"in i)return(e=>{const t=Object.entries(e||{});if(0===t.length)return;const[i,n]=t[0],[o,l,r]=i.split(".");return{markupLevel:o,index:parseInt(l,10),fieldName:r,message:n}})(i.error)}),c=e.computed(()=>{var e,t;return(null==(t=null==(e=i.markup)?void 0:e.pricing_item_configs)?void 0:t.map((e,t)=>{var i,n;return{item:e,error:t===(null==(i=a.value)?void 0:i.index)&&"pricing_item_configs"===(null==(n=a.value)?void 0:n.markupLevel)?a.value.message:void 0}}))??[]});return(i,a)=>(e.openBlock(),e.createBlock(Wi,e.mergeProps(i.$attrs,{title:n.value.title,"order-of-application-explanation":n.value.orderOfApplicationExplanation,description:n.value.description,"pricing-plan-version-is-selected":!!t.pricingPlanVersion,"select-pricing-plan-hint":n.value.selectPricingPlanHint,"add-item-label":n.value.addItemLabel,"is-editable":e.unref(o),"is-creatable":!!t.isCreatable,"not-editable-explanation":n.value.notEditableExplanation,"has-items":c.value.length>0,onAdd:a[0]||(a[0]=e=>i.$emit("add"))}),{icon:e.withCtx(()=>[e.createElementVNode("img",{src:e.unref("data:image/svg+xml,%3csvg%20width='44'%20height='44'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='a'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='44'%20height='44'%3e%3cpath%20fill='%23D9D9D9'%20d='M0%200h44v44H0z'/%3e%3c/mask%3e%3cg%20mask='url(%23a)'%3e%3cmask%20id='e'%20fill='%23fff'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.76%2040.05a2.94%202.94%200%200%201%203.17.63%202.96%202.96%200%200%200%204.15%200%202.93%202.93%200%200%201%203.17-.63c1.48.61%203.19-.1%203.8-1.58a2.92%202.92%200%200%201%202.7-1.8c1.61%200%202.92-1.3%202.92-2.92%200-1.17.7-2.23%201.78-2.69a2.96%202.96%200%200%200%201.6-3.82%202.94%202.94%200%200%201%20.63-3.17%202.96%202.96%200%200%200%200-4.15%202.93%202.93%200%200%201-.63-3.16c.61-1.5-.1-3.2-1.58-3.81a2.92%202.92%200%200%201-1.8-2.7c0-1.61-1.3-2.92-2.92-2.92a2.93%202.93%200%200%201-2.69-1.78%202.96%202.96%200%200%200-3.82-1.6c-1.09.44-2.34.2-3.17-.63a2.96%202.96%200%200%200-4.15%200%202.93%202.93%200%200%201-3.16.63c-1.5-.61-3.2.1-3.81%201.58a2.92%202.92%200%200%201-2.7%201.8%202.92%202.92%200%200%200-2.92%202.92c0%201.17-.7%202.23-1.78%202.69a2.96%202.96%200%200%200-1.6%203.82c.44%201.09.2%202.34-.63%203.17a2.96%202.96%200%200%200%20.01%204.15c.82.83%201.07%202.08.62%203.16-.61%201.5.1%203.2%201.58%203.81a2.92%202.92%200%200%201%201.8%202.7c0%201.61%201.3%202.92%202.92%202.92%201.17%200%202.23.7%202.69%201.78a2.96%202.96%200%200%200%203.82%201.6Z'/%3e%3c/mask%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.76%2040.05a2.94%202.94%200%200%201%203.17.63%202.96%202.96%200%200%200%204.15%200%202.93%202.93%200%200%201%203.17-.63c1.48.61%203.19-.1%203.8-1.58a2.92%202.92%200%200%201%202.7-1.8c1.61%200%202.92-1.3%202.92-2.92%200-1.17.7-2.23%201.78-2.69a2.96%202.96%200%200%200%201.6-3.82%202.94%202.94%200%200%201%20.63-3.17%202.96%202.96%200%200%200%200-4.15%202.93%202.93%200%200%201-.63-3.16c.61-1.5-.1-3.2-1.58-3.81a2.92%202.92%200%200%201-1.8-2.7c0-1.61-1.3-2.92-2.92-2.92a2.93%202.93%200%200%201-2.69-1.78%202.96%202.96%200%200%200-3.82-1.6c-1.09.44-2.34.2-3.17-.63a2.96%202.96%200%200%200-4.15%200%202.93%202.93%200%200%201-3.16.63c-1.5-.61-3.2.1-3.81%201.58a2.92%202.92%200%200%201-2.7%201.8%202.92%202.92%200%200%200-2.92%202.92c0%201.17-.7%202.23-1.78%202.69a2.96%202.96%200%200%200-1.6%203.82c.44%201.09.2%202.34-.63%203.17a2.96%202.96%200%200%200%20.01%204.15c.82.83%201.07%202.08.62%203.16-.61%201.5.1%203.2%201.58%203.81a2.92%202.92%200%200%201%201.8%202.7c0%201.61%201.3%202.92%202.92%202.92%201.17%200%202.23.7%202.69%201.78a2.96%202.96%200%200%200%203.82%201.6Z'%20fill='%23BFEAFB'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.76%2040.05a2.94%202.94%200%200%201%203.17.63%202.96%202.96%200%200%200%204.15%200%202.93%202.93%200%200%201%203.17-.63c1.48.61%203.19-.1%203.8-1.58a2.92%202.92%200%200%201%202.7-1.8c1.61%200%202.92-1.3%202.92-2.92%200-1.17.7-2.23%201.78-2.69a2.96%202.96%200%200%200%201.6-3.82%202.94%202.94%200%200%201%20.63-3.17%202.96%202.96%200%200%200%200-4.15%202.93%202.93%200%200%201-.63-3.16c.61-1.5-.1-3.2-1.58-3.81a2.92%202.92%200%200%201-1.8-2.7c0-1.61-1.3-2.92-2.92-2.92a2.93%202.93%200%200%201-2.69-1.78%202.96%202.96%200%200%200-3.82-1.6c-1.09.44-2.34.2-3.17-.63a2.96%202.96%200%200%200-4.15%200%202.93%202.93%200%200%201-3.16.63c-1.5-.61-3.2.1-3.81%201.58a2.92%202.92%200%200%201-2.7%201.8%202.92%202.92%200%200%200-2.92%202.92c0%201.17-.7%202.23-1.78%202.69a2.96%202.96%200%200%200-1.6%203.82c.44%201.09.2%202.34-.63%203.17a2.96%202.96%200%200%200%20.01%204.15c.82.83%201.07%202.08.62%203.16-.61%201.5.1%203.2%201.58%203.81a2.92%202.92%200%200%201%201.8%202.7c0%201.61%201.3%202.92%202.92%202.92%201.17%200%202.23.7%202.69%201.78a2.96%202.96%200%200%200%203.82%201.6Z'%20fill='url(%23b)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.76%2040.05a2.94%202.94%200%200%201%203.17.63%202.96%202.96%200%200%200%204.15%200%202.93%202.93%200%200%201%203.17-.63c1.48.61%203.19-.1%203.8-1.58a2.92%202.92%200%200%201%202.7-1.8c1.61%200%202.92-1.3%202.92-2.92%200-1.17.7-2.23%201.78-2.69a2.96%202.96%200%200%200%201.6-3.82%202.94%202.94%200%200%201%20.63-3.17%202.96%202.96%200%200%200%200-4.15%202.93%202.93%200%200%201-.63-3.16c.61-1.5-.1-3.2-1.58-3.81a2.92%202.92%200%200%201-1.8-2.7c0-1.61-1.3-2.92-2.92-2.92a2.93%202.93%200%200%201-2.69-1.78%202.96%202.96%200%200%200-3.82-1.6c-1.09.44-2.34.2-3.17-.63a2.96%202.96%200%200%200-4.15%200%202.93%202.93%200%200%201-3.16.63c-1.5-.61-3.2.1-3.81%201.58a2.92%202.92%200%200%201-2.7%201.8%202.92%202.92%200%200%200-2.92%202.92c0%201.17-.7%202.23-1.78%202.69a2.96%202.96%200%200%200-1.6%203.82c.44%201.09.2%202.34-.63%203.17a2.96%202.96%200%200%200%20.01%204.15c.82.83%201.07%202.08.62%203.16-.61%201.5.1%203.2%201.58%203.81a2.92%202.92%200%200%201%201.8%202.7c0%201.61%201.3%202.92%202.92%202.92%201.17%200%202.23.7%202.69%201.78a2.96%202.96%200%200%200%203.82%201.6Z'%20fill='url(%23c)'/%3e%3cpath%20d='M12.02%2038.84a3.96%203.96%200%200%200%205.12%202.14l-.75-1.86c-.98.4-2.12-.07-2.53-1.05l-1.84.77Zm-1.77-1.17c.76%200%201.46.46%201.77%201.17l1.84-.78a3.93%203.93%200%200%200-3.61-2.4v2Zm-3.92-3.92a3.92%203.92%200%200%200%203.92%203.92v-2a1.92%201.92%200%200%201-1.92-1.92h-2Zm-1.18-1.77c.72.3%201.18%201%201.18%201.77h2c0-1.58-.95-3.01-2.42-3.62l-.76%201.85Zm-2.12-5.12c-.83%202%20.12%204.29%202.12%205.12l.76-1.85a1.92%201.92%200%200%201-1.03-2.5l-1.85-.77Zm-.41-2.08c.54.55.7%201.37.4%202.08l1.86.77c.6-1.46.26-3.14-.84-4.25l-1.42%201.4Zm-.01-5.55a3.96%203.96%200%200%200%200%205.55l1.43-1.4a1.96%201.96%200%200%201%200-2.75l-1.43-1.4Zm.41-2.1c.3.73.13%201.55-.41%202.1l1.42%201.4a3.94%203.94%200%200%200%20.85-4.25l-1.86.76Zm2.14-5.11a3.96%203.96%200%200%200-2.14%205.12l1.86-.76c-.4-.97.07-2.1%201.06-2.52l-.78-1.84Zm1.17-1.77c0%20.76-.46%201.46-1.17%201.77l.78%201.84a3.93%203.93%200%200%200%202.4-3.61h-2Zm3.92-3.92a3.92%203.92%200%200%200-3.92%203.92h2c0-1.06.86-1.92%201.92-1.92v-2Zm1.77-1.18c-.3.72-1%201.18-1.77%201.18v2c1.58%200%203.01-.95%203.62-2.42l-1.85-.76Zm5.12-2.12c-2-.83-4.29.12-5.12%202.12l1.85.76a1.92%201.92%200%200%201%202.5-1.03l.77-1.85Zm2.08-.41c-.55.54-1.37.7-2.08.4l-.77%201.86c1.46.6%203.14.26%204.26-.84l-1.4-1.42Zm5.55-.01a3.96%203.96%200%200%200-5.55%200l1.4%201.43a1.96%201.96%200%200%201%202.75%200l1.4-1.43Zm2.1.41c-.72.3-1.55.13-2.1-.41l-1.4%201.42a3.94%203.94%200%200%200%204.25.85l-.76-1.86Zm5.12%202.14a3.96%203.96%200%200%200-5.13-2.14l.76%201.86c.97-.4%202.1.07%202.52%201.05L32%205.16Zm1.76%201.17c-.76%200-1.46-.46-1.76-1.17l-1.85.77a3.93%203.93%200%200%200%203.61%202.4v-2Zm3.92%203.92a3.92%203.92%200%200%200-3.92-3.92v2c1.06%200%201.92.86%201.92%201.92h2Zm1.18%201.77c-.71-.3-1.18-1-1.18-1.77h-2c0%201.58.95%203.01%202.42%203.62l.76-1.85Zm2.12%205.12c.83-2-.12-4.29-2.12-5.12l-.76%201.85c.97.4%201.44%201.53%201.03%202.5l1.85.77Zm.41%202.08a1.93%201.93%200%200%201-.4-2.08l-1.86-.77a3.93%203.93%200%200%200%20.84%204.25l1.42-1.4Zm.01%205.55a3.96%203.96%200%200%200%200-5.55l-1.43%201.4c.75.77.75%202%200%202.74l1.43%201.4Zm-.41%202.1c-.3-.73-.13-1.55.41-2.1l-1.42-1.4a3.94%203.94%200%200%200-.85%204.25l1.86-.76Zm-2.14%205.11a3.96%203.96%200%200%200%202.14-5.12l-1.86.76c.4.97-.07%202.1-1.05%202.52l.77%201.84Zm-1.17%201.77c0-.76.46-1.46%201.17-1.77l-.77-1.84a3.93%203.93%200%200%200-2.4%203.61h2Zm-3.92%203.92a3.92%203.92%200%200%200%203.92-3.92h-2c0%201.06-.86%201.92-1.92%201.92v2Zm-1.77%201.18c.3-.72%201-1.18%201.77-1.18v-2c-1.58%200-3.01.95-3.62%202.42l1.85.76Zm-5.12%202.12c2%20.83%204.3-.12%205.12-2.12l-1.85-.76a1.92%201.92%200%200%201-2.5%201.03l-.77%201.85Zm-2.08.41c.55-.54%201.38-.7%202.08-.4l.77-1.86a3.93%203.93%200%200%200-4.25.84l1.4%201.42Zm-4.14-1.41a3.94%203.94%200%200%200-4.25-.85l.75%201.86c.72-.3%201.54-.13%202.1.41l1.4-1.42Zm-1.4%201.42a3.96%203.96%200%200%200%205.54%200l-1.4-1.43c-.77.75-2%20.75-2.74%200l-1.4%201.43Z'%20fill='url(%23d)'%20fill-opacity='.1'%20mask='url(%23e)'/%3e%3cg%20opacity='.5'%3e%3cmask%20id='f'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='12'%20y='12'%20width='20'%20height='20'%3e%3cpath%20fill='%23D9D9D9'%20d='M12%2012h20v20H12z'/%3e%3c/mask%3e%3cg%20mask='url(%23f)'%3e%3cpath%20d='m16.5%2028.67-1.17-1.17L25%2017.83h-5.5v-1.66h8.33v8.33h-1.66V19l-9.67%209.67Z'%20fill='%23222B35'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='b'%20x1='1.28'%20y1='1.28'%20x2='42.72'%20y2='42.72'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23395E6D'/%3e%3cstop%20offset='1'%20stop-color='%23395E6D'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='c'%20x1='42.72'%20y1='1.28'%20x2='1.28'%20y2='42.72'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23fff'/%3e%3cstop%20offset='1'%20stop-color='%23fff'%20stop-opacity='.4'/%3e%3c/linearGradient%3e%3clinearGradient%20id='d'%20x1='22'%20y1='42.72'%20x2='22'%20y2='-2.59'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%230C0E41'/%3e%3cstop%20offset='1'%20stop-color='%230C0E41'%20stop-opacity='.5'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e"),alt:""},null,8,sn)]),"list-items":e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,({item:o,error:a})=>(e.openBlock(),e.createElementBlock("li",{key:JSON.stringify(o)},[e.createVNode(cn,{markup:o,error:a,"is-editable":e.unref(l)(o),"is-removable":e.unref(r)(o),"pricing-plan-version":t.pricingPlanVersion,i18n:n.value,timezone:t.timezone,onEdit:e=>i.$emit("edit",o),onDelete:e=>i.$emit("delete",o)},null,8,["markup","error","is-editable","is-removable","pricing-plan-version","i18n","timezone","onEdit","onDelete"])]))),128))]),_:1},16,["title","order-of-application-explanation","description","pricing-plan-version-is-selected","select-pricing-plan-hint","add-item-label","is-editable","is-creatable","not-editable-explanation","has-items"]))}}),pn={class:"flex gap-2 items-center"},mn=e.defineComponent({__name:"SubscriptionScheduleConfigMarkup",props:{markup:{},i18n:{}},setup(i){const n=i,o=e.computed(()=>n.i18n??vi),{formatDate:l}=t.useIntl();return(t,n)=>(e.openBlock(),e.createBlock(r._sfc_main,{color:"teal-light"},{default:e.withCtx(()=>[e.createElementVNode("div",pn,[e.createVNode(c._sfc_main$1,{icon:"north_east",size:"xs"}),e.createElementVNode("span",null,[i.markup.percentage?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(o.value.markupPercentage(i.markup.percentage)),1)],64)):e.createCommentVNode("",!0),i.markup.start_at||i.markup.end_at?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(" ")+"("+e.toDisplayString(i.markup.start_at?e.unref(l)({date:i.markup.start_at,format:"date",offsetType:"local",showTimezone:!1}):o.value.startOfSchedule)+" - "+e.toDisplayString(i.markup.end_at?e.unref(l)({date:i.markup.end_at,format:"date",offsetType:"local",showTimezone:!1}):o.value.endOfSchedule)+") ",1)],64)):e.createCommentVNode("",!0)])])]),_:1}))}}),un={class:"flex items-center gap-2"},gn={key:0,class:"flex items-center gap-2 mb-8"},fn={class:"text-base font-semibold"},vn={key:1,class:"transition-opacity-300"},_n=e.defineComponent({__name:"PricingPlanSchedules",props:{schedules:{},isEditable:{type:Boolean},openScheduleId:{},i18n:{},displayDisabledAddonPricings:{type:Boolean,default:!1},isExpandedByDefault:{type:Boolean},timezone:{},cancellationDate:{},enablePricingGroupSelection:{type:Boolean,default:!1}},emits:["add-schedule","toggle-schedule"],setup(i,{emit:n}){var l;const s=i,d=n,p=e.computed(()=>s.i18n??_i),{formatDate:u}=t.useIntl(),{getIsOpen:g,toggle:f}=o.useToggleList({closeOthers:!0,initialToggledItems:[null==(l=s.schedules[0])?void 0:l.schedule.id]}),v=e.computed(()=>s.schedules.map((e,t)=>({...e,inferredPricingPlanVersion:e.selectedPricingPlanVersion&&N(e.selectedPricingPlanVersion,e.schedule,{displayDisabledAddonPricings:s.displayDisabledAddonPricings}),scheduleNumber:t+1,cancelled:!1}))),_=e.computed(()=>{let e=[...v.value.map((e,t)=>({...e,inferredPricingPlanVersion:e.selectedPricingPlanVersion&&N(e.selectedPricingPlanVersion,e.schedule,{displayDisabledAddonPricings:s.displayDisabledAddonPricings}),scheduleNumber:t+1}))];if(s.cancellationDate){let t=0;const i={cancellationDate:s.cancellationDate},n=e.findLastIndex(e=>li(e)&&(e.schedule.start_at??"")<(s.cancellationDate??""));if(-1===n)e=[i,...e];else{const o=e[n];t=li(o)&&(o.schedule.end_at??"")>=(s.cancellationDate??"")?n:n+1,t===s.schedules.length+1?e=[...e,i]:e.splice(t,0,i)}return e.map((e,i)=>li(e)?{...e,cancelled:i>t}:e)}return e}),y=e.computed(()=>void 0===s.openScheduleId);return(n,o)=>(e.openBlock(),e.createBlock(H,e.mergeProps(n.$attrs,{"has-add-button":i.isEditable,onAdd:o[0]||(o[0]=e=>n.$emit("add-schedule"))}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(o,l)=>{return e.openBlock(),e.createElementBlock(e.Fragment,{key:l},[e.unref(oi)(o)?(e.openBlock(),e.createBlock(te,{key:0,"hide-collapse-icon":""},{icon:e.withCtx(()=>[e.createVNode(c._sfc_main$1,{icon:"cancel",class:"text-red-600"})]),left:e.withCtx(()=>[e.createVNode(t._sfc_main,{variant:"body-sm",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value.subscriptionCancelled(i.timezone?e.unref(u)({date:o.cancellationDate,format:"date",offsetType:"offsetted",timezone:i.timezone}):e.unref(u)({date:o.cancellationDate,format:"dateTime",offsetType:"local"}))),1)]),_:2},1024)]),_:2},1024)):e.createCommentVNode("",!0),e.unref(li)(o)?(e.openBlock(),e.createBlock(te,{key:1,"item-number":o.scheduleNumber,"is-open":(_=o.schedule,y.value?g(_.id):s.openScheduleId===_.id),"has-continued-preline":!!i.isEditable||o.scheduleNumber-1!=v.value.length-1,class:e.normalizeClass({"opacity-60":o.cancelled}),onToggle:e=>(e=>{y.value?f(e.id):d("toggle-schedule",e.id)})(o.schedule)},{left:e.withCtx(()=>[e.createElementVNode("div",un,[e.createVNode(t._sfc_main,{tag:"h3",weight:"semibold"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.value.scheduleNumber(o.scheduleNumber)),1)]),_:2},1024),"TRIAL"===o.schedule.type&&o.schedule.start_at&&o.schedule.end_at?(e.openBlock(),e.createBlock(a._sfc_main$1,{key:0,"trial-period":e.unref(a.convertDateRangeToTimePeriod)(new Date(o.schedule.start_at),new Date(o.schedule.end_at))},null,8,["trial-period"])):e.createCommentVNode("",!0),e.renderSlot(n.$slots,"id",{id:o.schedule.id})])]),right:e.withCtx(()=>[e.renderSlot(n.$slots,"schedule-right",{item:o,itemIndex:o.scheduleNumber-1},()=>[i.timezone?(e.openBlock(),e.createBlock(t._sfc_main,{key:0,variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.schedule.start_at?e.unref(u)({date:o.schedule.start_at,format:"dateTime",offsetType:"offsetted",timezone:i.timezone}):p.value.startOfSchedule)+" - "+e.toDisplayString(o.schedule.end_at?e.unref(u)({date:o.schedule.end_at,format:"dateTime",offsetType:"offsetted",timezone:i.timezone}):p.value.endOfSchedule),1)]),_:2},1024)):(e.openBlock(),e.createBlock(t._sfc_main,{key:1,variant:"body-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.schedule.start_at?e.unref(u)({date:o.schedule.start_at,format:"dateTime",offsetType:"local"}):p.value.startOfSchedule)+" - "+e.toDisplayString(o.schedule.end_at?e.unref(u)({date:o.schedule.end_at,format:"dateTime",offsetType:"local"}):p.value.endOfSchedule),1)]),_:2},1024))])]),default:e.withCtx(()=>[e.renderSlot(n.$slots,"schedule",{item:o,previousItem:v.value.find(e=>e.scheduleNumber===o.scheduleNumber-1),nextItem:v.value.find(e=>e.scheduleNumber===o.scheduleNumber+1),timezone:i.timezone},()=>[o.selectedPricingPlan?(e.openBlock(),e.createElementBlock("div",gn,[e.createVNode(m._sfc_main,{initials:o.selectedPricingPlan.name[0],"color-hash":o.selectedPricingPlan.id,size:"lg"},null,8,["initials","color-hash"]),e.createElementVNode("h2",fn,e.toDisplayString(o.selectedPricingPlan.name),1),e.createVNode(r._sfc_main,{color:"teal"},{default:e.withCtx(()=>{var t;return[e.createTextVNode(e.toDisplayString(p.value.versionNumber((null==(t=o.inferredPricingPlanVersion)?void 0:t.version)??1)),1)]}),_:2},1024)])):e.createCommentVNode("",!0),o.inferredPricingPlanVersion?(e.openBlock(),e.createElementBlock("div",vn,[e.createVNode(Si,{"pricing-plan-version":o.inferredPricingPlanVersion,"enabled-pricings":e.unref(B)(o.schedule),"default-expanded":i.isExpandedByDefault,i18n:p.value,"enable-pricing-group-selection":i.enablePricingGroupSelection,"show-non-billable":""},{"pricing-item-config-additions":e.withCtx(({config:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList([e.unref(R)(o.schedule,t)],(t,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t?(e.openBlock(),e.createBlock(mn,{key:i,markup:t,i18n:p.value},null,8,["markup","i18n"])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(n.$slots,"pricing-item-config-additions",{config:t,item:o,pricingPlanVersion:o.inferredPricingPlanVersion})]),_:2},1032,["pricing-plan-version","enabled-pricings","default-expanded","i18n","enable-pricing-group-selection"])])):e.createCommentVNode("",!0),o.schedule.discount?(e.openBlock(),e.createBlock(ln,{key:2,discount:o.schedule.discount,"read-only":"","pricing-plan-version":o.inferredPricingPlanVersion,timezone:i.timezone,i18n:{...p.value,title:p.value.discountsTitle,orderOfApplicationExplanation:p.value.discountsOrderOfApplicationExplanation}},null,8,["discount","pricing-plan-version","timezone","i18n"])):e.createCommentVNode("",!0),o.schedule.markup?(e.openBlock(),e.createBlock(dn,{key:3,markup:o.schedule.markup,"pricing-plan-version":o.inferredPricingPlanVersion,timezone:i.timezone,i18n:{...p.value,title:p.value.markupsTitle,orderOfApplicationExplanation:p.value.markupsOrderOfApplicationExplanation}},null,8,["markup","pricing-plan-version","timezone","i18n"])):e.createCommentVNode("",!0),o.schedule&&o.schedule.commitment?(e.openBlock(),e.createBlock(Ji,{key:4,class:"mt-2",commitment:o.schedule.commitment,"read-only":"","pricing-plan-version":o.inferredPricingPlanVersion,timezone:i.timezone,i18n:{...p.value,title:p.value.commitmentsTitle,orderOfApplicationExplanation:p.value.commitmentsOrderOfApplicationExplanation}},null,8,["commitment","pricing-plan-version","timezone","i18n"])):e.createCommentVNode("",!0)])]),_:2},1032,["item-number","is-open","has-continued-preline","class","onToggle"])):e.createCommentVNode("",!0)],64);var _}),128))]),_:3},16,["has-add-button"]))}}),yn=e.defineComponent({__name:"SubscriptionSchedules",props:{schedulesData:{type:Array},configuration:{type:Object},isLoading:{type:Boolean}},setup(n){const{$t:o}=t.useIntl();return(t,l)=>(e.openBlock(),e.createBlock(e.unref(i._sfc_main),{"no-border":"","no-spacing":"","content-background":"none",title:e.unref(o)({defaultMessage:"Schedules",description:"Invoices list title",id:"invoices_list.title"})},{default:e.withCtx(()=>[e.createVNode(e.unref(_n),{schedules:n.schedulesData},null,8,["schedules"])]),_:1},8,["title"]))}});const hn=e.defineComponent({__name:"SubscriptionSchedules.entry.view",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(t){const i=t,{subscription:n,withPlanData:o,get:l}=function({subscriptionId:e}){const{getSubscription:t}=k.createSubscriptionsService(),{data:i,execute:n,apiStatus:o,error:l,isPending:r}=h.useService({service:()=>t({id:e,expanded:!0})});return{subscription:i,withPlanData:e=>e.pricing_plan_schedule_infos.map(e=>({schedule:e.pricing_plan_schedule,selectedPricingPlan:e.pricing_plan_version.pricing_plan,selectedPricingPlanVersion:e.pricing_plan_version})),apiStatus:o,error:l,get:n,isPending:r}}({subscriptionId:i.configuration.subscriptionId}),{isLoading:r}=b.useLoadInitialData(l());return(t,i)=>e.renderSlot(t.$slots,"default",{schedulesData:e.unref(n)?e.unref(o)(e.unref(n)):void 0,isLoading:e.unref(r)})}}),kn=e.defineComponent({__name:"SubscriptionSchedules.entry",props:{environment:{type:String},locale:{type:String},dateLocale:{type:String},messages:{type:Object},showTimezones:{type:Boolean},primaryColor:{type:String},secondaryColor:{type:String},isShadowRoot:{type:Boolean},experimentalFeatures:{type:Array},logLevel:{type:String},onLog:{type:Function},allowedPortalTypes:{type:Array},portalObject:{type:Object},customElementName:{type:String},branding:{type:Object},configuration:{type:Object}},setup(i){const n=i;return(o,l)=>{var r,a,c,s;return e.openBlock(),e.createBlock(e.unref(t._sfc_main$1),{"custom-element-name":e.unref(xn),environment:i.environment,locale:i.locale,"portal-object":i.portalObject,"allowed-portal-types":["CUSTOMER"],"primary-color":null==(a=null==(r=i.branding)?void 0:r.colors)?void 0:a.primary,"secondary-color":null==(s=null==(c=i.branding)?void 0:c.colors)?void 0:s.secondary,"experimental-features":i.experimentalFeatures,"log-level":i.logLevel,"on-log":i.onLog,onError:l[0]||(l[0]=e=>o.$emit("error",e))},{default:e.withCtx(()=>[e.createVNode(hn,e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(({schedulesData:t,isLoading:n})=>[t?(e.openBlock(),e.createBlock(yn,{key:0,"schedules-data":t,"is-loading":n,configuration:i.configuration},null,8,["schedules-data","is-loading","configuration"])):e.createCommentVNode("",!0)]),_:1},16)]),_:1},8,["custom-element-name","environment","locale","portal-object","primary-color","secondary-color","experimental-features","log-level","on-log"])}}}),bn=t.defineCustomElement(kn),xn=t.getComponentName("subscription-schedules");exports.COMPONENT_NAME=xn,exports.SolvimonSubscriptionSchedules=bn,exports.defineSolvimonSubscriptionSchedules=()=>{customElements.get(xn)||customElements.define(xn,bn)};