!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("preact/compat"));else if("function"==typeof define&&define.amd)define(["preact/compat"],o);else{var t="object"==typeof exports?o(require("preact/compat")):o(e.PreactCompat);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(Depicter,(e=>(()=>{"use strict";var o={314:o=>{o.exports=e}},t={};function r(e){var p=t[e];if(void 0!==p)return p.exports;var c=t[e]={exports:{}};return o[e](c,c.exports,r),c.exports}r.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return r.d(o,{a:o}),o},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return(()=>{r.r(p),r.d(p,{dpcCouponBox:()=>t});var e=r(314),o=r.n(e);const t={component:t=>{const{className:r,coupon:p,showButton:c=!0,buttonLabel:n="Copy",copiedLabel:a="Copied!",renderLabel:u}=t,[i,d]=o().useState(!1),s=(0,e.useCallback)((()=>{(!window).Depicter||(window.Depicter.utils.copyTextToClipboard(p),d(!0),setTimeout((()=>{d(!1)}),2e3))}),[p]),l=c?p:i?a:p,b=i?a:n;return Depicter.h("div",{className:`dpc-coupon-box ${r}`,onClick:c?void 0:s},u?.(p,"coupon","dpc-coupon-box-text")??Depicter.h("div",{className:"dpc-coupon-box-text"},l),(c&&u?.(n,"buttonLabel","dpc-coupon-box-button"))??Depicter.h("button",{type:"button",className:"dpc-coupon-box-button",onClick:s},b))},async:!1}})(),p})()));