ku4web-components 6.7.14 → 6.7.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. package/angular/index.js +1 -1
  2. package/angular/index.mjs +1 -1
  3. package/dist/cjs/{index-15875e65.js → index-2b30e3d6.js} +1 -1
  4. package/dist/cjs/{index-3f6b12f6.js → index-ac83f10f.js} +1 -1
  5. package/dist/cjs/{index-69919a4f.js → index-dbadf919.js} +1 -1
  6. package/dist/cjs/ku4-carousel-controls.cjs.entry.js +3 -2
  7. package/dist/cjs/ku4-carousel-slide.cjs.entry.js +3 -1
  8. package/dist/cjs/ku4-carousel.cjs.entry.js +4 -17
  9. package/dist/cjs/ku4-col.cjs.entry.js +11 -7
  10. package/dist/cjs/ku4-drawer.cjs.entry.js +6 -4
  11. package/dist/cjs/ku4-feature.cjs.entry.js +3 -7
  12. package/dist/cjs/ku4-focus-trap.cjs.entry.js +8 -6
  13. package/dist/cjs/ku4-form.cjs.entry.js +13 -7
  14. package/dist/cjs/ku4-grid.cjs.entry.js +14 -20
  15. package/dist/cjs/ku4-label.cjs.entry.js +5 -2
  16. package/dist/cjs/ku4-mask.cjs.entry.js +3 -32
  17. package/dist/cjs/ku4-modal.cjs.entry.js +4 -14
  18. package/dist/cjs/ku4-panel.cjs.entry.js +1 -4
  19. package/dist/cjs/ku4-preview.cjs.entry.js +14 -4
  20. package/dist/cjs/ku4-tab-list.cjs.entry.js +4 -4
  21. package/dist/cjs/ku4-tab-panel.cjs.entry.js +4 -6
  22. package/dist/cjs/ku4-tab.cjs.entry.js +4 -6
  23. package/dist/cjs/ku4-table.cjs.entry.js +1 -9
  24. package/dist/cjs/ku4-tooltip.cjs.entry.js +8 -2
  25. package/dist/cjs/ku4-validation.cjs.entry.js +10 -34
  26. package/dist/cjs/ku4web-components.cjs.js +3 -3
  27. package/dist/cjs/loader.cjs.js +3 -3
  28. package/dist/cjs/{shadow-css-346c0795.js → shadow-css-bf3843d2.js} +1 -1
  29. package/dist/cjs/{uid-682bb993.js → uid-fc57e900.js} +1 -1
  30. package/dist/esm/{index-adc31e97.js → index-607d2abb.js} +1 -1
  31. package/dist/esm/{index-b9d8468a.js → index-87a580e3.js} +1 -1
  32. package/dist/esm/{index-906433aa.js → index-fd7b1964.js} +1 -1
  33. package/dist/esm/ku4-carousel-controls.entry.js +3 -2
  34. package/dist/esm/ku4-carousel-slide.entry.js +3 -1
  35. package/dist/esm/ku4-carousel.entry.js +4 -17
  36. package/dist/esm/ku4-col.entry.js +11 -7
  37. package/dist/esm/ku4-drawer.entry.js +6 -4
  38. package/dist/esm/ku4-feature.entry.js +3 -7
  39. package/dist/esm/ku4-focus-trap.entry.js +8 -6
  40. package/dist/esm/ku4-form.entry.js +13 -7
  41. package/dist/esm/ku4-grid.entry.js +14 -20
  42. package/dist/esm/ku4-label.entry.js +5 -2
  43. package/dist/esm/ku4-mask.entry.js +3 -32
  44. package/dist/esm/ku4-modal.entry.js +4 -14
  45. package/dist/esm/ku4-panel.entry.js +1 -4
  46. package/dist/esm/ku4-preview.entry.js +14 -4
  47. package/dist/esm/ku4-tab-list.entry.js +4 -4
  48. package/dist/esm/ku4-tab-panel.entry.js +4 -6
  49. package/dist/esm/ku4-tab.entry.js +4 -6
  50. package/dist/esm/ku4-table.entry.js +1 -9
  51. package/dist/esm/ku4-tooltip.entry.js +8 -2
  52. package/dist/esm/ku4-validation.entry.js +10 -34
  53. package/dist/esm/ku4web-components.js +3 -3
  54. package/dist/esm/loader.js +3 -3
  55. package/dist/esm/{shadow-css-b18e99d7.js → shadow-css-ed4599f8.js} +1 -1
  56. package/dist/esm/{uid-a87782ca.js → uid-7ad94b61.js} +1 -1
  57. package/dist/esm-es5/{index-adc31e97.js → index-607d2abb.js} +1 -1
  58. package/dist/esm-es5/{index-b9d8468a.js → index-87a580e3.js} +1 -1
  59. package/dist/esm-es5/{index-906433aa.js → index-fd7b1964.js} +1 -1
  60. package/dist/esm-es5/ku4-carousel-controls.entry.js +1 -1
  61. package/dist/esm-es5/ku4-carousel-slide.entry.js +1 -1
  62. package/dist/esm-es5/ku4-carousel.entry.js +1 -1
  63. package/dist/esm-es5/ku4-col.entry.js +1 -1
  64. package/dist/esm-es5/ku4-drawer.entry.js +1 -1
  65. package/dist/esm-es5/ku4-feature.entry.js +1 -1
  66. package/dist/esm-es5/ku4-focus-trap.entry.js +1 -1
  67. package/dist/esm-es5/ku4-form.entry.js +1 -1
  68. package/dist/esm-es5/ku4-grid.entry.js +1 -1
  69. package/dist/esm-es5/ku4-label.entry.js +1 -1
  70. package/dist/esm-es5/ku4-mask.entry.js +1 -1
  71. package/dist/esm-es5/ku4-modal.entry.js +1 -1
  72. package/dist/esm-es5/ku4-panel.entry.js +1 -1
  73. package/dist/esm-es5/ku4-preview.entry.js +1 -1
  74. package/dist/esm-es5/ku4-tab-list.entry.js +1 -1
  75. package/dist/esm-es5/ku4-tab-panel.entry.js +1 -1
  76. package/dist/esm-es5/ku4-tab.entry.js +1 -1
  77. package/dist/esm-es5/ku4-table.entry.js +1 -1
  78. package/dist/esm-es5/ku4-tooltip.entry.js +1 -1
  79. package/dist/esm-es5/ku4-validation.entry.js +1 -1
  80. package/dist/esm-es5/ku4web-components.js +1 -1
  81. package/dist/esm-es5/loader.js +1 -1
  82. package/dist/esm-es5/{shadow-css-b18e99d7.js → shadow-css-ed4599f8.js} +0 -0
  83. package/dist/esm-es5/uid-7ad94b61.js +1 -0
  84. package/dist/ku4web-components/ku4web-components.esm.js +1 -1
  85. package/dist/ku4web-components/ku4web-components.js +1 -1
  86. package/dist/ku4web-components/p-00796b28.entry.js +1 -0
  87. package/dist/ku4web-components/p-05663408.entry.js +1 -0
  88. package/dist/ku4web-components/{p-62691d31.system.entry.js → p-08db8a51.system.entry.js} +1 -1
  89. package/dist/ku4web-components/p-12840da6.entry.js +1 -0
  90. package/dist/ku4web-components/p-15ddc753.system.js +1 -0
  91. package/dist/ku4web-components/{p-d21d1e0e.entry.js → p-18385bcd.entry.js} +1 -1
  92. package/dist/ku4web-components/p-19280d05.system.entry.js +1 -0
  93. package/dist/ku4web-components/p-192cc7ec.entry.js +1 -0
  94. package/dist/ku4web-components/{p-f134bec3.js → p-1e3ad132.js} +1 -1
  95. package/dist/ku4web-components/p-1e7500fe.system.entry.js +1 -0
  96. package/dist/ku4web-components/p-20b0c3af.system.entry.js +1 -0
  97. package/dist/ku4web-components/p-24502002.entry.js +1 -0
  98. package/dist/ku4web-components/p-276e6c07.entry.js +1 -0
  99. package/dist/ku4web-components/p-27a18858.entry.js +1 -0
  100. package/dist/ku4web-components/p-294cf7e0.entry.js +1 -0
  101. package/dist/ku4web-components/p-2f695f98.system.js +1 -0
  102. package/dist/ku4web-components/p-30f5a209.system.entry.js +1 -0
  103. package/dist/ku4web-components/{p-ae5e23b4.entry.js → p-337e2775.entry.js} +1 -1
  104. package/dist/ku4web-components/p-44016f81.entry.js +1 -0
  105. package/dist/ku4web-components/{p-4ae67f1f.system.entry.js → p-4a182db9.system.entry.js} +1 -1
  106. package/dist/ku4web-components/p-4f5877f6.entry.js +1 -0
  107. package/dist/ku4web-components/{p-e9482cb1.system.js → p-5759a316.system.js} +1 -1
  108. package/dist/ku4web-components/p-578d319b.entry.js +1 -0
  109. package/dist/ku4web-components/{p-0c80849a.system.entry.js → p-59a00f71.system.entry.js} +1 -1
  110. package/dist/ku4web-components/p-6052f997.entry.js +1 -0
  111. package/dist/ku4web-components/p-65fe013e.system.entry.js +1 -0
  112. package/dist/ku4web-components/{p-f26ed61d.js → p-8364475f.js} +0 -0
  113. package/dist/ku4web-components/{p-517fec9b.system.entry.js → p-888dc65b.system.entry.js} +1 -1
  114. package/dist/ku4web-components/{p-6a27b43f.system.entry.js → p-899da567.system.entry.js} +1 -1
  115. package/dist/ku4web-components/{p-570177e8.system.entry.js → p-8c808d2d.system.entry.js} +1 -1
  116. package/dist/ku4web-components/p-9396fca3.js +1 -0
  117. package/dist/ku4web-components/p-95b5d9c1.entry.js +1 -0
  118. package/dist/ku4web-components/p-9c75e9f5.entry.js +1 -0
  119. package/dist/ku4web-components/{p-54fb5b7d.js → p-9f6d3640.js} +1 -1
  120. package/dist/ku4web-components/p-a6bf9aa9.system.entry.js +1 -0
  121. package/dist/ku4web-components/p-aafc7a3f.system.entry.js +1 -0
  122. package/dist/ku4web-components/{p-5d8e9dd5.js → p-ae9a5549.js} +1 -1
  123. package/dist/ku4web-components/{p-4038362a.system.entry.js → p-b039a9c0.system.entry.js} +1 -1
  124. package/dist/ku4web-components/p-b29dfde1.system.entry.js +1 -0
  125. package/dist/ku4web-components/p-c3bfb723.entry.js +1 -0
  126. package/dist/ku4web-components/p-c651de1a.system.entry.js +1 -0
  127. package/dist/ku4web-components/{p-9f434bd7.system.entry.js → p-c93e2e58.system.entry.js} +1 -1
  128. package/dist/ku4web-components/{p-6d14ef68.system.entry.js → p-d06458e5.system.entry.js} +1 -1
  129. package/dist/ku4web-components/{p-4143d5d6.entry.js → p-d4e53284.entry.js} +1 -1
  130. package/dist/ku4web-components/{p-c7ab12de.system.js → p-d7289b1a.system.js} +1 -1
  131. package/dist/ku4web-components/{p-8e03322a.system.js → p-d808aef5.system.js} +1 -1
  132. package/dist/ku4web-components/{p-c37c000c.system.entry.js → p-e5ef511a.system.entry.js} +1 -1
  133. package/dist/ku4web-components/{p-88092d06.system.js → p-f39f347c.system.js} +0 -0
  134. package/dist/ku4web-components/{p-2e8bdcac.entry.js → p-f4b0fbee.entry.js} +1 -1
  135. package/dist/ku4web-components/p-fc58b7ce.system.entry.js +1 -0
  136. package/dist/ku4web-components/p-ff1f9fba.entry.js +1 -0
  137. package/dist/types/components/ku4-form/ku4-form.d.ts +3 -1
  138. package/dist/types/components/ku4-preview/ku4-preview.d.ts +1 -1
  139. package/dist/types/components.d.ts +5 -3
  140. package/dist/types/stencil-public-runtime.d.ts +5 -0
  141. package/mask/index.js +1 -1
  142. package/mask/index.mjs +1 -1
  143. package/package.json +45 -45
  144. package/react/index.js +1 -1
  145. package/react/index.mjs +1 -1
  146. package/vue/index.js +1 -1
  147. package/vue/index.mjs +1 -1
  148. package/vue3/index.js +1 -1
  149. package/vue3/index.mjs +1 -1
  150. package/dist/esm-es5/uid-a87782ca.js +0 -1
  151. package/dist/ku4web-components/p-2e259be8.system.entry.js +0 -1
  152. package/dist/ku4web-components/p-321ff189.entry.js +0 -1
  153. package/dist/ku4web-components/p-3afb47cc.system.entry.js +0 -1
  154. package/dist/ku4web-components/p-3ee2a2dd.system.entry.js +0 -1
  155. package/dist/ku4web-components/p-47690d76.entry.js +0 -1
  156. package/dist/ku4web-components/p-4c41bbdd.entry.js +0 -1
  157. package/dist/ku4web-components/p-557f0053.entry.js +0 -1
  158. package/dist/ku4web-components/p-608ec081.system.entry.js +0 -1
  159. package/dist/ku4web-components/p-6343daaa.entry.js +0 -1
  160. package/dist/ku4web-components/p-667063a1.system.entry.js +0 -1
  161. package/dist/ku4web-components/p-6fc8ef40.entry.js +0 -1
  162. package/dist/ku4web-components/p-8091c9a5.js +0 -1
  163. package/dist/ku4web-components/p-92c72bf8.system.entry.js +0 -1
  164. package/dist/ku4web-components/p-98f05ada.system.entry.js +0 -1
  165. package/dist/ku4web-components/p-990790af.entry.js +0 -1
  166. package/dist/ku4web-components/p-ad57c6a3.system.js +0 -1
  167. package/dist/ku4web-components/p-bd8e14e8.entry.js +0 -1
  168. package/dist/ku4web-components/p-ca08f742.entry.js +0 -1
  169. package/dist/ku4web-components/p-cfa2430c.entry.js +0 -1
  170. package/dist/ku4web-components/p-d19c1792.entry.js +0 -1
  171. package/dist/ku4web-components/p-d66a1733.entry.js +0 -1
  172. package/dist/ku4web-components/p-ea728fd5.entry.js +0 -1
  173. package/dist/ku4web-components/p-eace27f8.system.entry.js +0 -1
  174. package/dist/ku4web-components/p-ebacc2e9.entry.js +0 -1
  175. package/dist/ku4web-components/p-f0744d75.system.entry.js +0 -1
  176. package/dist/ku4web-components/p-f1b64863.system.entry.js +0 -1
  177. package/dist/ku4web-components/p-f1df904f.entry.js +0 -1
  178. package/dist/ku4web-components/p-f7873ccb.system.js +0 -1
  179. package/dist/ku4web-components/p-feef17a2.entry.js +0 -1
package/react/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";function t(){t=function(){return r};var r={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{u({},"")}catch(t){u=function(t,r,e){return t[r]=e}}function c(t,r,e,n){var i=r&&r.prototype instanceof f?r:f,o=Object.create(i.prototype),s=new E(n||[]);return o._invoke=function(t,r,e){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(e.method=i,e.arg=o;;){var s=e.delegate;if(s){var a=b(s,e);if(a){if(a===h)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var u=l(t,r,e);if("normal"===u.type){if(n=e.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n="completed",e.method="throw",e.arg=u.arg)}}}(t,e,s),o}function l(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=c;var h={};function f(){}function p(){}function d(){}var y={};u(y,o,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(F([])));g&&g!==e&&n.call(g,o)&&(y=g);var v=d.prototype=f.prototype=Object.create(y);function _(t){["next","throw","return"].forEach((function(r){u(t,r,(function(t){return this._invoke(r,t)}))}))}function w(t,r){function e(i,o,s,a){var u=l(t[i],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?r.resolve(h.__await).then((function(t){e("next",t,s,a)}),(function(t){e("throw",t,s,a)})):r.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return e("throw",t,s,a)}))}a(u.arg)}var i;this._invoke=function(t,n){function o(){return new r((function(r,i){e(t,n,r,i)}))}return i=i?i.then(o,o):o()}}function b(t,r){var e=t.iterator[r.method];if(void 0===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,b(t,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(e,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,h;var i=n.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function N(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function x(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function F(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,i=function r(){for(;++e<t.length;)if(n.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=void 0,r.done=!0,r};return i.next=i}}return{next:A}}function A(){return{value:void 0,done:!0}}return p.prototype=d,u(v,"constructor",d),u(d,"constructor",p),p.displayName=u(d,a,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===p||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(v),t},r.awrap=function(t){return{__await:t}},_(w.prototype),u(w.prototype,s,(function(){return this})),r.AsyncIterator=w,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var s=new w(c(t,e,n,i),o);return r.isGeneratorFunction(e)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(v),u(v,a,"Generator"),u(v,o,(function(){return this})),u(v,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=F,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function e(e,n){return s.type="throw",s.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=r,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),h},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),x(e),h}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var i=n.arg;x(e)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:F(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),h}},r}function r(t,r,e,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?r(u):Promise.resolve(u).then(n,i)}function e(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,u,"next",t)}function u(t){r(s,i,o,a,u,"throw",t)}a(void 0)}))}}let n,i=class{static isNull(t){return null===t}static isEmpty(t){return i.isString(t)&&""===t||i.isArray(t)&&t.length<1||i.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(i.isUndefined(t)||i.isNull(t))}static isNullOrEmpty(t){return!i.exists(t)||i.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return i.isBool(t)&&!0===t}static isFalse(t){return i.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||i.isFunction(t)&&/^async/.test(t.toString())||i.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return i.exists(t)&&"object"==typeof t&&!(i.isBool(t)||i.isNumber(t)||i.isDate(t)||i.isArray(t)||i.isString(t)||i.isFunction(t))}static isObjectLiteral(t){return i.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!i.isFalsy(t)}static isFalsy(t){return i.isZero(t)||i.isFalse(t)||i.isNullOrEmpty(t)||isNaN(t)}};function o(t){return i.exists(t)&&i.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function s(t){return i.exists(t)&&i.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function a(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function u(t,r=0){return a(t+5*Math.pow(10,r-1),r)}function c(t,r=0){return 0===t?0:a(t-5*Math.pow(10,r-1),r)}function l(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function h(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function f(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function p(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,build:function(...t){return"".concat(...t)},chunk:function(t,r=0){if(!i.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:function(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)},trim:function(t){return o(s(t))},trimStart:o,trimEnd:s,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){const n=t.toString().split(""),o=new RegExp(e);return i.isFunction(r)?r(t):i.isString(r)&&r.split("").reduce(((e,i)=>n.length>0&&(o.test(i)||n[0]===i&&t.indexOf(n[0])===r.indexOf(i))?e+n.shift():e+i),"")},unmask:function(t,r,e="_"){const n=new RegExp(e);return i.isFunction(r)?r(t):i.isString(r)&&t.split("").reduce(((t,e,i)=>n.test(e)||!n.test(r.charAt(i))&&r.charAt(i)===e?t:t+e),"")}}),Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:a,roundUp:u,roundDown:c,roundTowardZero:function(t,r=0){return t<0?u(t,r):c(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:l,fib2:h,fibArray:function(t){return Array(t).fill(0).map((()=>l(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>h(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}}),Object.freeze({__proto__:null,uid:f,uuid:p,suid:function(){return Symbol(f())},suuid:function(){return Symbol(p())}}),Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i});class d{static isNull(t){return null===t}static isEmpty(t){return d.isString(t)&&""===t||d.isArray(t)&&t.length<1||d.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(d.isUndefined(t)||d.isNull(t))}static isNullOrEmpty(t){return!d.exists(t)||d.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return d.isBool(t)&&!0===t}static isFalse(t){return d.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||d.isFunction(t)&&/^async/.test(t.toString())||d.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return d.exists(t)&&"object"==typeof t&&!(d.isBool(t)||d.isNumber(t)||d.isDate(t)||d.isArray(t)||d.isString(t)||d.isFunction(t))}static isObjectLiteral(t){return d.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!d.isFalsy(t)}static isFalsy(t){return d.isZero(t)||d.isFalse(t)||d.isNullOrEmpty(t)||isNaN(t)}}function y(...t){return"".concat(...t)}function m(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function g(t){return v(_(t))}function v(t){return d.exists(t)&&d.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function _(t){return d.exists(t)&&d.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function w(t,r){try{return t()}catch{return r}}Object.freeze({__proto__:null,build:y,chunk:function(t,r=0){if(!d.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:m,trim:g,trimStart:v,trimEnd:_,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){const n=t.toString().split(""),i=new RegExp(e);return d.isFunction(r)?r(t):d.isString(r)&&r.split("").reduce(((e,o)=>n.length>0&&(i.test(o)||n[0]===o&&t.indexOf(n[0])===r.indexOf(o))?e+n.shift():e+o),"")},unmask:function(t,r,e="_"){const n=new RegExp(e);return d.isFunction(r)?r(t):d.isString(r)&&t.split("").reduce(((t,e,i)=>n.test(e)||!n.test(r.charAt(i))&&r.charAt(i)===e?t:t+e),"")}}),w.async=async(t,r)=>{try{return await t()}catch{return r}};class b{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>N(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return x(this._year)}get nextDay(){return E(this,1,0,0)}get prevDay(){return E(this,-1,0,0)}get nextMonth(){return E(this,0,1,0)}get prevMonth(){return E(this,0,-1,0)}get nextYear(){return E(this,0,0,1)}get prevYear(){return E(this,0,0,-1)}get firstDayOfMonth(){return new b(this._year,this._month,1)}get lastDayOfMonth(){return new b(this._year,this._month,N(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,o=i(t),s=i(e),a=i(r),u=e<0?"prevDay":"nextDay",c=r<0?"prevMonth":"nextMonth";return n(n(n(this,o,t<0?"prevYear":"nextYear"),a,c),s,u)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",o=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return m(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,o),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return d.isString(t)||d.isNumber(t)||d.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof b}static parse(t){if(t instanceof b)return t;let r=d.isString(t)?g(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!d.exists(r)||Number.isNaN(e.valueOf()))throw new Error(m("Cannot parse value= {0}",r));return new b(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return w((()=>b.parse(t)),null)}static assumeNow(t){n=b.parse(t)}static get today(){return n||b.parse(new Date)}}function N(t,r){return 2===t?x(r)?29:28:t<8&&d.isEven(t)||t>7&&d.isOdd(t)?30:31}function x(t){const r=t.toString().split(/\B/);return parseFloat(y(r[r.length-2],r[r.length-1]))%4==0}function E(t,r,e,n){const i=t.month,o=t.year,s=t.date,a=e,u=n;let c=s+r,l=i+a,h=o+u;if(s+r>N(i,o)&&(c=1,l=i+a+1),s+r<1){const r=t.prevMonth;c=N(r.month,r.year),l=i+a-1}return l>12&&(l=1,h=o+u+1),l<1&&(l=12,h=o+u-1),new b(h,l,c)}function F(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function A(t,r=0){return F(t+5*Math.pow(10,r-1),r)}function S(t,r=0){return 0===t?0:F(t-5*Math.pow(10,r-1),r)}function O(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function k(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function L(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function j(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:F,roundUp:A,roundDown:S,roundTowardZero:function(t,r=0){return t<0?A(t,r):S(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:O,fib2:k,fibArray:function(t){return Array(t).fill(0).map((()=>O(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>k(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}});var $=Object.freeze({__proto__:null,uid:L,uuid:j,suid:function(){return Symbol(L())},suuid:function(){return Symbol(j())}});Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i}),$.uid(),b.today.nextYear.toDate();const z=t=>new window.FormData(t),M=t=>{const r={};try{z(t).forEach(((t,e)=>{const n=r[e];d.isArray(n)?r[e].push(t):d.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:o}=t;if("file"===n)r[e]=o[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var D=M,P=z;exports.wireEvents=function(t,r){if(t&&!t.__ku4wireEvents__)try{Object.keys(r).forEach((function(e){var n=r[e],o=t?t.addEventListener:t.removeEventListener;i.isFunction(n)&&o(e,n)})),_ref.__ku4wireEvents__=!0}catch(t){throw new Error("wireEvents Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}},exports.wireForm=function(r,n){if(r&&!r.__ku4wired__)try{var o=r.submit;r.submit=e(t().mark((function e(){var s,a,u;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=D(r),a=P(r),t.next=4,n(s,a,r);case 4:u=t.sent,i.isFalse(u)||o.call(r);case 6:case"end":return t.stop()}}),e)}))),r.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}},exports.wireProps=function(t,r){if(t&&!t.__ku4wireProps__)try{Object.keys(r).forEach((function(e){return t[e]=r[e]})),t.__ku4wireProps__=!0}catch(t){throw new Error("wireProps Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};
1
+ "use strict";function t(){t=function(){return r};var r={},e=Object.prototype,n=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{u({},"")}catch(t){u=function(t,r,e){return t[r]=e}}function h(t,r,e,n){var o=r&&r.prototype instanceof y?r:y,s=Object.create(o.prototype),a=new k(n||[]);return i(s,"_invoke",{value:E(t,e,a)}),s}function l(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var f={};function y(){}function p(){}function d(){}var m={};u(m,s,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(F([])));g&&g!==e&&n.call(g,s)&&(m=g);var w=d.prototype=y.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(r){u(t,r,(function(t){return this._invoke(r,t)}))}))}function b(t,r){function e(i,o,s,a){var c=l(t[i],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?r.resolve(h.__await).then((function(t){e("next",t,s,a)}),(function(t){e("throw",t,s,a)})):r.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return e("throw",t,s,a)}))}a(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new r((function(r,i){e(t,n,r,i)}))}return o=o?o.then(i,i):i()}})}function E(t,r,e){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return L()}for(e.method=i,e.arg=o;;){var s=e.delegate;if(s){var a=x(s,e);if(a){if(a===f)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var c=l(t,r,e);if("normal"===c.type){if(n=e.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(n="completed",e.method="throw",e.arg=c.arg)}}}function x(t,r){var e=r.method,n=t.iterator[e];if(void 0===n)return r.delegate=null,"throw"===e&&t.iterator.return&&(r.method="return",r.arg=void 0,x(t,r),"throw"===r.method)||"return"!==e&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+e+"' method")),f;var i=l(n,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,f;var o=i.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,f):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function N(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function O(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function F(t){if(t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,i=function r(){for(;++e<t.length;)if(n.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=void 0,r.done=!0,r};return i.next=i}}return{next:L}}function L(){return{value:void 0,done:!0}}return p.prototype=d,i(w,"constructor",{value:d,configurable:!0}),i(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,c,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===p||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},_(b.prototype),u(b.prototype,a,(function(){return this})),r.AsyncIterator=b,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var s=new b(h(t,e,n,i),o);return r.isGeneratorFunction(e)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(w),u(w,c,"Generator"),u(w,s,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=F,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function e(e,n){return s.type="throw",s.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=r,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(s)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),f},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),O(e),f}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var i=n.arg;O(e)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:F(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),f}},r}function r(t,r,e,n,i,o,s){try{var a=t[o](s),c=a.value}catch(t){return void e(t)}a.done?r(c):Promise.resolve(c).then(n,i)}function e(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,c,"next",t)}function c(t){r(s,i,o,a,c,"throw",t)}a(void 0)}))}}let n,i=class{static isNull(t){return null===t}static isEmpty(t){return i.isString(t)&&""===t||i.isArray(t)&&t.length<1||i.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(i.isUndefined(t)||i.isNull(t))}static isNullOrEmpty(t){return!i.exists(t)||i.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return i.isBool(t)&&!0===t}static isFalse(t){return i.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||i.isFunction(t)&&/^async/.test(t.toString())||i.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return i.exists(t)&&"object"==typeof t&&!(i.isBool(t)||i.isNumber(t)||i.isDate(t)||i.isArray(t)||i.isString(t)||i.isFunction(t))}static isObjectLiteral(t){return i.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!i.isFalsy(t)}static isFalsy(t){return i.isZero(t)||i.isFalse(t)||i.isNullOrEmpty(t)||isNaN(t)}};class o{static isNull(t){return null===t}static isEmpty(t){return o.isString(t)&&""===t||o.isArray(t)&&t.length<1||o.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(o.isUndefined(t)||o.isNull(t))}static isNullOrEmpty(t){return!o.exists(t)||o.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return o.isBool(t)&&!0===t}static isFalse(t){return o.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||o.isFunction(t)&&/^async/.test(t.toString())||o.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return o.exists(t)&&"object"==typeof t&&!(o.isBool(t)||o.isNumber(t)||o.isDate(t)||o.isArray(t)||o.isString(t)||o.isFunction(t))}static isObjectLiteral(t){return o.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!o.isFalsy(t)}static isFalsy(t){return o.isZero(t)||o.isFalse(t)||o.isNullOrEmpty(t)||isNaN(t)}}function s(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function a(t){return function(t){return o.exists(t)&&o.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}(function(t){return o.exists(t)&&o.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}(t))}function c(t,r){try{return t()}catch{return r}}c.async=async(t,r)=>{try{return await t()}catch{return r}};class u{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>h(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return l(this._year)}get nextDay(){return f(this,1,0,0)}get prevDay(){return f(this,-1,0,0)}get nextMonth(){return f(this,0,1,0)}get prevMonth(){return f(this,0,-1,0)}get nextYear(){return f(this,0,0,1)}get prevYear(){return f(this,0,0,-1)}get firstDayOfMonth(){return new u(this._year,this._month,1)}get lastDayOfMonth(){return new u(this._year,this._month,h(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,o=i(t),s=i(e),a=i(r),c=e<0?"prevDay":"nextDay",u=r<0?"prevMonth":"nextMonth";return n(n(n(this,o,t<0?"prevYear":"nextYear"),a,u),s,c)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",o=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return s(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,o),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return o.isString(t)||o.isNumber(t)||o.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof u}static parse(t){if(t instanceof u)return t;let r=o.isString(t)?a(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!o.exists(r)||Number.isNaN(e.valueOf()))throw new Error(s("Cannot parse value= {0}",r));return new u(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return c((()=>u.parse(t)),null)}static assumeNow(t){n=u.parse(t)}static get today(){return n||u.parse(new Date)}}function h(t,r){return 2===t?l(r)?29:28:t<8&&o.isEven(t)||t>7&&o.isOdd(t)?30:31}function l(t){const r=t.toString().split(/\B/);return parseFloat(function(...t){return"".concat(...t)}(r[r.length-2],r[r.length-1]))%4==0}function f(t,r,e,n){const i=t.month,o=t.year,s=t.date,a=e,c=n;let l=s+r,f=i+a,y=o+c;if(s+r>h(i,o)&&(l=1,f=i+a+1),s+r<1){const r=t.prevMonth;l=h(r.month,r.year),f=i+a-1}return f>12&&(f=1,y=o+c+1),f<1&&(f=12,y=o+c-1),new u(y,f,l)}function y(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function p(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,uid:y,uuid:p,suid:function(){return Symbol(y())},suuid:function(){return Symbol(p())}}).uid(),u.today.nextYear.toDate();const d=t=>new window.FormData(t),m=t=>{const r={};try{d(t).forEach(((t,e)=>{const n=r[e];o.isArray(n)?r[e].push(t):o.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:o}=t;if("file"===n)r[e]=o[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var v=m,g=d;exports.wireEvents=function(t,r){if(t&&!t.__ku4wireEvents__)try{Object.keys(r).forEach((function(e){var n=r[e],o=t?t.addEventListener:t.removeEventListener;i.isFunction(n)&&o(e,n)})),_ref.__ku4wireEvents__=!0}catch(t){throw new Error("wireEvents Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}},exports.wireForm=function(r,n){if(r&&!r.__ku4wired__)try{var o=r.submit;r.submit=e(t().mark((function e(){var s,a,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=v(r),a=g(r),t.next=4,n(s,a,r);case 4:c=t.sent,i.isFalse(c)||o.call(r);case 6:case"end":return t.stop()}}),e)}))),r.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}},exports.wireProps=function(t,r){if(t&&!t.__ku4wireProps__)try{Object.keys(r).forEach((function(e){return t[e]=r[e]})),t.__ku4wireProps__=!0}catch(t){throw new Error("wireProps Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};
package/react/index.mjs CHANGED
@@ -1 +1 @@
1
- let t,r=class{static isNull(t){return null===t}static isEmpty(t){return r.isString(t)&&""===t||r.isArray(t)&&t.length<1||r.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(r.isUndefined(t)||r.isNull(t))}static isNullOrEmpty(t){return!r.exists(t)||r.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return r.isBool(t)&&!0===t}static isFalse(t){return r.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||r.isFunction(t)&&/^async/.test(t.toString())||r.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return r.exists(t)&&"object"==typeof t&&!(r.isBool(t)||r.isNumber(t)||r.isDate(t)||r.isArray(t)||r.isString(t)||r.isFunction(t))}static isObjectLiteral(t){return r.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!r.isFalsy(t)}static isFalsy(t){return r.isZero(t)||r.isFalse(t)||r.isNullOrEmpty(t)||isNaN(t)}};function e(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function n(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function i(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function s(t,r=0){return i(t+5*Math.pow(10,r-1),r)}function a(t,r=0){return 0===t?0:i(t-5*Math.pow(10,r-1),r)}function o(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function u(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function c(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function l(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,build:function(...t){return"".concat(...t)},chunk:function(t,e=0){if(!r.isString(t)||Number.isNaN(e)||e<0)return[];if(e<t.length){let r=0;const n=e||t.length,i=[];for(;r<t.length;)i.push(t.slice(r,r+n)),r+=n;return i}return[t]},format:function(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)},trim:function(t){return e(n(t))},trimStart:e,trimEnd:n,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,e,n="_"){const i=t.toString().split(""),s=new RegExp(n);return r.isFunction(e)?e(t):r.isString(e)&&e.split("").reduce(((r,n)=>i.length>0&&(s.test(n)||i[0]===n&&t.indexOf(i[0])===e.indexOf(n))?r+i.shift():r+n),"")},unmask:function(t,e,n="_"){const i=new RegExp(n);return r.isFunction(e)?e(t):r.isString(e)&&t.split("").reduce(((t,r,n)=>i.test(r)||!i.test(e.charAt(n))&&e.charAt(n)===r?t:t+r),"")}}),Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:i,roundUp:s,roundDown:a,roundTowardZero:function(t,r=0){return t<0?s(t,r):a(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:o,fib2:u,fibArray:function(t){return Array(t).fill(0).map((()=>o(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>u(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}}),Object.freeze({__proto__:null,uid:c,uuid:l,suid:function(){return Symbol(c())},suuid:function(){return Symbol(l())}}),Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i});class h{static isNull(t){return null===t}static isEmpty(t){return h.isString(t)&&""===t||h.isArray(t)&&t.length<1||h.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(h.isUndefined(t)||h.isNull(t))}static isNullOrEmpty(t){return!h.exists(t)||h.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return h.isBool(t)&&!0===t}static isFalse(t){return h.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||h.isFunction(t)&&/^async/.test(t.toString())||h.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return h.exists(t)&&"object"==typeof t&&!(h.isBool(t)||h.isNumber(t)||h.isDate(t)||h.isArray(t)||h.isString(t)||h.isFunction(t))}static isObjectLiteral(t){return h.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!h.isFalsy(t)}static isFalsy(t){return h.isZero(t)||h.isFalse(t)||h.isNullOrEmpty(t)||isNaN(t)}}function f(...t){return"".concat(...t)}function p(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function d(t){return y(m(t))}function y(t){return h.exists(t)&&h.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function m(t){return h.exists(t)&&h.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function _(t,r){try{return t()}catch{return r}}Object.freeze({__proto__:null,build:f,chunk:function(t,r=0){if(!h.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:p,trim:d,trimStart:y,trimEnd:m,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){const n=t.toString().split(""),i=new RegExp(e);return h.isFunction(r)?r(t):h.isString(r)&&r.split("").reduce(((e,s)=>n.length>0&&(i.test(s)||n[0]===s&&t.indexOf(n[0])===r.indexOf(s))?e+n.shift():e+s),"")},unmask:function(t,r,e="_"){const n=new RegExp(e);return h.isFunction(r)?r(t):h.isString(r)&&t.split("").reduce(((t,e,i)=>n.test(e)||!n.test(r.charAt(i))&&r.charAt(i)===e?t:t+e),"")}}),_.async=async(t,r)=>{try{return await t()}catch{return r}};class g{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>b(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return w(this._year)}get nextDay(){return N(this,1,0,0)}get prevDay(){return N(this,-1,0,0)}get nextMonth(){return N(this,0,1,0)}get prevMonth(){return N(this,0,-1,0)}get nextYear(){return N(this,0,0,1)}get prevYear(){return N(this,0,0,-1)}get firstDayOfMonth(){return new g(this._year,this._month,1)}get lastDayOfMonth(){return new g(this._year,this._month,b(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,s=i(t),a=i(e),o=i(r),u=e<0?"prevDay":"nextDay",c=r<0?"prevMonth":"nextMonth";return n(n(n(this,s,t<0?"prevYear":"nextYear"),o,c),a,u)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",s=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return p(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,s),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return h.isString(t)||h.isNumber(t)||h.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof g}static parse(t){if(t instanceof g)return t;let r=h.isString(t)?d(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!h.exists(r)||Number.isNaN(e.valueOf()))throw new Error(p("Cannot parse value= {0}",r));return new g(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return _((()=>g.parse(t)),null)}static assumeNow(r){t=g.parse(r)}static get today(){return t||g.parse(new Date)}}function b(t,r){return 2===t?w(r)?29:28:t<8&&h.isEven(t)||t>7&&h.isOdd(t)?30:31}function w(t){const r=t.toString().split(/\B/);return parseFloat(f(r[r.length-2],r[r.length-1]))%4==0}function N(t,r,e,n){const i=t.month,s=t.year,a=t.date,o=e,u=n;let c=a+r,l=i+o,h=s+u;if(a+r>b(i,s)&&(c=1,l=i+o+1),a+r<1){const r=t.prevMonth;c=b(r.month,r.year),l=i+o-1}return l>12&&(l=1,h=s+u+1),l<1&&(l=12,h=s+u-1),new g(h,l,c)}function A(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function F(t,r=0){return A(t+5*Math.pow(10,r-1),r)}function S(t,r=0){return 0===t?0:A(t-5*Math.pow(10,r-1),r)}function E(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function O(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function v(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function $(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:A,roundUp:F,roundDown:S,roundTowardZero:function(t,r=0){return t<0?F(t,r):S(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:E,fib2:O,fibArray:function(t){return Array(t).fill(0).map((()=>E(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>O(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}});var k=Object.freeze({__proto__:null,uid:v,uuid:$,suid:function(){return Symbol(v())},suuid:function(){return Symbol($())}});Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i}),k.uid(),g.today.nextYear.toDate();const x=t=>new window.FormData(t),z=t=>{const r={};try{x(t).forEach(((t,e)=>{const n=r[e];h.isArray(n)?r[e].push(t):h.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:s}=t;if("file"===n)r[e]=s[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var M=z,D=x;const j=(t,e)=>{if(t&&!t.__ku4wired__)try{const n=t.submit;t.submit=async()=>{const i=M(t),s=D(t),a=await e(i,s,t);r.isFalse(a)||n.call(t)},t.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}},P=(t,e)=>{if(t&&!t.__ku4wireEvents__)try{Object.keys(e).forEach((n=>{const i=e[n],s=t?t.addEventListener:t.removeEventListener;r.isFunction(i)&&s(n,i)})),_ref.__ku4wireEvents__=!0}catch(t){throw new Error("wireEvents Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}},Z=(t,r)=>{if(t&&!t.__ku4wireProps__)try{Object.keys(r).forEach((e=>t[e]=r[e])),t.__ku4wireProps__=!0}catch(t){throw new Error("wireProps Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};export{P as wireEvents,j as wireForm,Z as wireProps};
1
+ let t,e=class{static isNull(t){return null===t}static isEmpty(t){return e.isString(t)&&""===t||e.isArray(t)&&t.length<1||e.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(e.isUndefined(t)||e.isNull(t))}static isNullOrEmpty(t){return!e.exists(t)||e.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return e.isBool(t)&&!0===t}static isFalse(t){return e.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||e.isFunction(t)&&/^async/.test(t.toString())||e.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return e.exists(t)&&"object"==typeof t&&!(e.isBool(t)||e.isNumber(t)||e.isDate(t)||e.isArray(t)||e.isString(t)||e.isFunction(t))}static isObjectLiteral(t){return e.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!e.isFalsy(t)}static isFalsy(t){return e.isZero(t)||e.isFalse(t)||e.isNullOrEmpty(t)||isNaN(t)}};class r{static isNull(t){return null===t}static isEmpty(t){return r.isString(t)&&""===t||r.isArray(t)&&t.length<1||r.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(r.isUndefined(t)||r.isNull(t))}static isNullOrEmpty(t){return!r.exists(t)||r.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return r.isBool(t)&&!0===t}static isFalse(t){return r.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||r.isFunction(t)&&/^async/.test(t.toString())||r.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return r.exists(t)&&"object"==typeof t&&!(r.isBool(t)||r.isNumber(t)||r.isDate(t)||r.isArray(t)||r.isString(t)||r.isFunction(t))}static isObjectLiteral(t){return r.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!r.isFalsy(t)}static isFalsy(t){return r.isZero(t)||r.isFalse(t)||r.isNullOrEmpty(t)||isNaN(t)}}function s(t,...e){return e.reduce(((t,e,r)=>t.replace(new RegExp(`\\{${r}\\}`,"g"),e&&e.toString?e.toString():e)),t)}function i(t){return function(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}(function(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}(t))}function n(t,e){try{return t()}catch{return e}}n.async=async(t,e)=>{try{return await t()}catch{return e}};class a{constructor(t,e,r){if(e<1||e>12)throw new Error("Invalid month at Assert.DayPoint");if(r<1||r>o(e,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,e-1,r):new Date,this._day=this._value.getDay(),this._date=r,this._month=e,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return c(this._year)}get nextDay(){return u(this,1,0,0)}get prevDay(){return u(this,-1,0,0)}get nextMonth(){return u(this,0,1,0)}get prevMonth(){return u(this,0,-1,0)}get nextYear(){return u(this,0,0,1)}get prevYear(){return u(this,0,0,-1)}get firstDayOfMonth(){return new a(this._year,this._month,1)}get lastDayOfMonth(){return new a(this._year,this._month,o(this._month,this._year))}add(t,e,r){function s(t,e,r){let s=t,i=e;for(;i--;)s=s[r];return s}const{abs:i}=Math,n=i(t),a=i(r),o=i(e),c=r<0?"prevDay":"nextDay",u=e<0?"prevMonth":"nextMonth";return s(s(s(this,n,t<0?"prevYear":"nextYear"),o,u),a,c)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const e=this._year,r=t.year,s=this._month,i=t.month;return e>r||e===r&&s>i||e===r&&s===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const e=/y{3,}/i.test(t)?this._year:this.shortYear,r=this._month,i=this._date,n=/m{2}/i.test(t)&&r<10?"0{1}":"{1}",a=/d{2}/i.test(t)&&i<10?"0{2}":"{2}";return s(t.replace(/y+/gi,"{0}").replace(/m+/gi,n).replace(/d+/gi,a),e,r,i)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return r.isString(t)||r.isNumber(t)||r.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof a}static parse(t){if(t instanceof a)return t;let e=r.isString(t)?i(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(e)){const t=e.split("-"),[r]=t;t.push(r),t.shift(),e=t.join("/")}const n=new Date(e);if(!r.exists(e)||Number.isNaN(n.valueOf()))throw new Error(s("Cannot parse value= {0}",e));return new a(n.getFullYear(),n.getMonth()+1,n.getDate())}static tryParse(t){return n((()=>a.parse(t)),null)}static assumeNow(e){t=a.parse(e)}static get today(){return t||a.parse(new Date)}}function o(t,e){return 2===t?c(e)?29:28:t<8&&r.isEven(t)||t>7&&r.isOdd(t)?30:31}function c(t){const e=t.toString().split(/\B/);return parseFloat(function(...t){return"".concat(...t)}(e[e.length-2],e[e.length-1]))%4==0}function u(t,e,r,s){const i=t.month,n=t.year,c=t.date,u=r,h=s;let l=c+e,y=i+u,f=n+h;if(c+e>o(i,n)&&(l=1,y=i+u+1),c+e<1){const e=t.prevMonth;l=o(e.month,e.year),y=i+u-1}return y>12&&(y=1,f=n+h+1),y<1&&(y=12,f=n+h-1),new a(f,y,l)}function h(t){const e=isNaN(parseInt(t))||t<0||t>24?24:t,r=Math.random().toString().substring(2),s=Math.random().toString().substring(2);return r.concat(s).substring(0,e)}function l(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,uid:h,uuid:l,suid:function(){return Symbol(h())},suuid:function(){return Symbol(l())}}).uid(),a.today.nextYear.toDate();const y=t=>new window.FormData(t),f=t=>{const e={};try{y(t).forEach(((t,s)=>{const i=e[s];r.isArray(i)?e[s].push(t):r.exists(i)?e[s]=[e[s],t]:e[s]=t}))}catch(r){[...t.elements].forEach((t=>{const{name:r,type:s,value:i,files:n}=t;if("file"===s)e[r]=n[0];else if("checkbox"===s||"radio"===s)t.checked&&(e[r]=i);else if(t.multiple){const s=[];t.querySelectorAll("option").forEach((t=>t.selected&&s.push(t.value))),e[r]=s.length<2?s[0]:s}else e[r]=i}))}return e};var m=f,d=y;const g=(t,r)=>{if(t&&!t.__ku4wired__)try{const s=t.submit;t.submit=async()=>{const i=m(t),n=d(t),a=await r(i,n,t);e.isFalse(a)||s.call(t)},t.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}},p=(t,r)=>{if(t&&!t.__ku4wireEvents__)try{Object.keys(r).forEach((s=>{const i=r[s],n=t?t.addEventListener:t.removeEventListener;e.isFunction(i)&&n(s,i)})),_ref.__ku4wireEvents__=!0}catch(t){throw new Error("wireEvents Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}},_=(t,e)=>{if(t&&!t.__ku4wireProps__)try{Object.keys(e).forEach((r=>t[r]=e[r])),t.__ku4wireProps__=!0}catch(t){throw new Error("wireProps Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};export{p as wireEvents,g as wireForm,_ as wireProps};
package/vue/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";function t(){t=function(){return r};var r={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{u({},"")}catch(t){u=function(t,r,e){return t[r]=e}}function c(t,r,e,n){var i=r&&r.prototype instanceof f?r:f,o=Object.create(i.prototype),s=new A(n||[]);return o._invoke=function(t,r,e){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return E()}for(e.method=i,e.arg=o;;){var s=e.delegate;if(s){var a=w(s,e);if(a){if(a===h)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var u=l(t,r,e);if("normal"===u.type){if(n=e.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n="completed",e.method="throw",e.arg=u.arg)}}}(t,e,s),o}function l(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=c;var h={};function f(){}function p(){}function d(){}var y={};u(y,o,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(F([])));m&&m!==e&&n.call(m,o)&&(y=m);var v=d.prototype=f.prototype=Object.create(y);function _(t){["next","throw","return"].forEach((function(r){u(t,r,(function(t){return this._invoke(r,t)}))}))}function b(t,r){function e(i,o,s,a){var u=l(t[i],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?r.resolve(h.__await).then((function(t){e("next",t,s,a)}),(function(t){e("throw",t,s,a)})):r.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return e("throw",t,s,a)}))}a(u.arg)}var i;this._invoke=function(t,n){function o(){return new r((function(r,i){e(t,n,r,i)}))}return i=i?i.then(o,o):o()}}function w(t,r){var e=t.iterator[r.method];if(void 0===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,w(t,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(e,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,h;var i=n.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function N(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function x(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function F(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,i=function r(){for(;++e<t.length;)if(n.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=void 0,r.done=!0,r};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return p.prototype=d,u(v,"constructor",d),u(d,"constructor",p),p.displayName=u(d,a,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===p||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(v),t},r.awrap=function(t){return{__await:t}},_(b.prototype),u(b.prototype,s,(function(){return this})),r.AsyncIterator=b,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var s=new b(c(t,e,n,i),o);return r.isGeneratorFunction(e)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(v),u(v,a,"Generator"),u(v,o,(function(){return this})),u(v,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=F,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function e(e,n){return s.type="throw",s.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=r,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),h},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),x(e),h}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var i=n.arg;x(e)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:F(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),h}},r}function r(t,r,e,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?r(u):Promise.resolve(u).then(n,i)}function e(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,u,"next",t)}function u(t){r(s,i,o,a,u,"throw",t)}a(void 0)}))}}let n,i=class{static isNull(t){return null===t}static isEmpty(t){return i.isString(t)&&""===t||i.isArray(t)&&t.length<1||i.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(i.isUndefined(t)||i.isNull(t))}static isNullOrEmpty(t){return!i.exists(t)||i.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return i.isBool(t)&&!0===t}static isFalse(t){return i.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||i.isFunction(t)&&/^async/.test(t.toString())||i.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return i.exists(t)&&"object"==typeof t&&!(i.isBool(t)||i.isNumber(t)||i.isDate(t)||i.isArray(t)||i.isString(t)||i.isFunction(t))}static isObjectLiteral(t){return i.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!i.isFalsy(t)}static isFalsy(t){return i.isZero(t)||i.isFalse(t)||i.isNullOrEmpty(t)||isNaN(t)}};function o(t){return i.exists(t)&&i.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function s(t){return i.exists(t)&&i.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function a(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function u(t,r=0){return a(t+5*Math.pow(10,r-1),r)}function c(t,r=0){return 0===t?0:a(t-5*Math.pow(10,r-1),r)}function l(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function h(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function f(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function p(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,build:function(...t){return"".concat(...t)},chunk:function(t,r=0){if(!i.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:function(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)},trim:function(t){return o(s(t))},trimStart:o,trimEnd:s,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){const n=t.toString().split(""),o=new RegExp(e);return i.isFunction(r)?r(t):i.isString(r)&&r.split("").reduce(((e,i)=>n.length>0&&(o.test(i)||n[0]===i&&t.indexOf(n[0])===r.indexOf(i))?e+n.shift():e+i),"")},unmask:function(t,r,e="_"){const n=new RegExp(e);return i.isFunction(r)?r(t):i.isString(r)&&t.split("").reduce(((t,e,i)=>n.test(e)||!n.test(r.charAt(i))&&r.charAt(i)===e?t:t+e),"")}}),Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:a,roundUp:u,roundDown:c,roundTowardZero:function(t,r=0){return t<0?u(t,r):c(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:l,fib2:h,fibArray:function(t){return Array(t).fill(0).map((()=>l(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>h(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}}),Object.freeze({__proto__:null,uid:f,uuid:p,suid:function(){return Symbol(f())},suuid:function(){return Symbol(p())}}),Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i});class d{static isNull(t){return null===t}static isEmpty(t){return d.isString(t)&&""===t||d.isArray(t)&&t.length<1||d.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(d.isUndefined(t)||d.isNull(t))}static isNullOrEmpty(t){return!d.exists(t)||d.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return d.isBool(t)&&!0===t}static isFalse(t){return d.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||d.isFunction(t)&&/^async/.test(t.toString())||d.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return d.exists(t)&&"object"==typeof t&&!(d.isBool(t)||d.isNumber(t)||d.isDate(t)||d.isArray(t)||d.isString(t)||d.isFunction(t))}static isObjectLiteral(t){return d.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!d.isFalsy(t)}static isFalsy(t){return d.isZero(t)||d.isFalse(t)||d.isNullOrEmpty(t)||isNaN(t)}}function y(...t){return"".concat(...t)}function g(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function m(t){return v(_(t))}function v(t){return d.exists(t)&&d.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function _(t){return d.exists(t)&&d.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function b(t,r){try{return t()}catch{return r}}Object.freeze({__proto__:null,build:y,chunk:function(t,r=0){if(!d.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:g,trim:m,trimStart:v,trimEnd:_,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){const n=t.toString().split(""),i=new RegExp(e);return d.isFunction(r)?r(t):d.isString(r)&&r.split("").reduce(((e,o)=>n.length>0&&(i.test(o)||n[0]===o&&t.indexOf(n[0])===r.indexOf(o))?e+n.shift():e+o),"")},unmask:function(t,r,e="_"){const n=new RegExp(e);return d.isFunction(r)?r(t):d.isString(r)&&t.split("").reduce(((t,e,i)=>n.test(e)||!n.test(r.charAt(i))&&r.charAt(i)===e?t:t+e),"")}}),b.async=async(t,r)=>{try{return await t()}catch{return r}};class w{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>N(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return x(this._year)}get nextDay(){return A(this,1,0,0)}get prevDay(){return A(this,-1,0,0)}get nextMonth(){return A(this,0,1,0)}get prevMonth(){return A(this,0,-1,0)}get nextYear(){return A(this,0,0,1)}get prevYear(){return A(this,0,0,-1)}get firstDayOfMonth(){return new w(this._year,this._month,1)}get lastDayOfMonth(){return new w(this._year,this._month,N(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,o=i(t),s=i(e),a=i(r),u=e<0?"prevDay":"nextDay",c=r<0?"prevMonth":"nextMonth";return n(n(n(this,o,t<0?"prevYear":"nextYear"),a,c),s,u)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",o=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return g(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,o),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return d.isString(t)||d.isNumber(t)||d.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof w}static parse(t){if(t instanceof w)return t;let r=d.isString(t)?m(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!d.exists(r)||Number.isNaN(e.valueOf()))throw new Error(g("Cannot parse value= {0}",r));return new w(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return b((()=>w.parse(t)),null)}static assumeNow(t){n=w.parse(t)}static get today(){return n||w.parse(new Date)}}function N(t,r){return 2===t?x(r)?29:28:t<8&&d.isEven(t)||t>7&&d.isOdd(t)?30:31}function x(t){const r=t.toString().split(/\B/);return parseFloat(y(r[r.length-2],r[r.length-1]))%4==0}function A(t,r,e,n){const i=t.month,o=t.year,s=t.date,a=e,u=n;let c=s+r,l=i+a,h=o+u;if(s+r>N(i,o)&&(c=1,l=i+a+1),s+r<1){const r=t.prevMonth;c=N(r.month,r.year),l=i+a-1}return l>12&&(l=1,h=o+u+1),l<1&&(l=12,h=o+u-1),new w(h,l,c)}function F(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function E(t,r=0){return F(t+5*Math.pow(10,r-1),r)}function S(t,r=0){return 0===t?0:F(t-5*Math.pow(10,r-1),r)}function O(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function $(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function L(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function j(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:F,roundUp:E,roundDown:S,roundTowardZero:function(t,r=0){return t<0?E(t,r):S(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:O,fib2:$,fibArray:function(t){return Array(t).fill(0).map((()=>O(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>$(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}});var z=Object.freeze({__proto__:null,uid:L,uuid:j,suid:function(){return Symbol(L())},suuid:function(){return Symbol(j())}});Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i}),z.uid(),w.today.nextYear.toDate();const M=t=>new window.FormData(t),k=t=>{const r={};try{M(t).forEach(((t,e)=>{const n=r[e];d.isArray(n)?r[e].push(t):d.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:o}=t;if("file"===n)r[e]=o[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var D=k,P=M;exports.wireForm=function(r,n,o){if(r&&r.$refs&&r.$refs[n]&&!r.$refs[n].__ku4wired__)try{var s=r.$refs[n],a=s.submit;s.submit=e(t().mark((function e(){var u,c,l;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=D(n),c=P(n),t.next=4,o.call(r,u,c,s);case 4:l=t.sent,i.isFalse(l)||a.call(n);case 6:case"end":return t.stop()}}),e)}))),s.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};
1
+ "use strict";function t(){t=function(){return e};var e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,s=Object.create(o.prototype),a=new F(n||[]);return i(s,"_invoke",{value:x(t,r,a)}),s}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f={};function y(){}function p(){}function d(){}var g={};u(g,s,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(L([])));m&&m!==r&&n.call(m,s)&&(g=m);var w=d.prototype=y.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(i,o,s,a){var c=l(t[i],t,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){u.value=t,s(u)}),(function(t){return r("throw",t,s,a)}))}a(c.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function x(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return S()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=E(s,r);if(a){if(a===f)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function L(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,i(w,"constructor",{value:d,configurable:!0}),i(d,"constructor",{value:p,configurable:!0}),p.displayName=u(d,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},b(_.prototype),u(_.prototype,a,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new _(h(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},b(w),u(w,c,"Generator"),u(w,s,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function e(t,e,r,n,i,o,s){try{var a=t[o](s),c=a.value}catch(t){return void r(t)}a.done?e(c):Promise.resolve(c).then(n,i)}function r(t){return function(){var r=this,n=arguments;return new Promise((function(i,o){var s=t.apply(r,n);function a(t){e(s,i,o,a,c,"next",t)}function c(t){e(s,i,o,a,c,"throw",t)}a(void 0)}))}}let n,i=class{static isNull(t){return null===t}static isEmpty(t){return i.isString(t)&&""===t||i.isArray(t)&&t.length<1||i.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(i.isUndefined(t)||i.isNull(t))}static isNullOrEmpty(t){return!i.exists(t)||i.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return i.isBool(t)&&!0===t}static isFalse(t){return i.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||i.isFunction(t)&&/^async/.test(t.toString())||i.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return i.exists(t)&&"object"==typeof t&&!(i.isBool(t)||i.isNumber(t)||i.isDate(t)||i.isArray(t)||i.isString(t)||i.isFunction(t))}static isObjectLiteral(t){return i.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!i.isFalsy(t)}static isFalsy(t){return i.isZero(t)||i.isFalse(t)||i.isNullOrEmpty(t)||isNaN(t)}};class o{static isNull(t){return null===t}static isEmpty(t){return o.isString(t)&&""===t||o.isArray(t)&&t.length<1||o.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(o.isUndefined(t)||o.isNull(t))}static isNullOrEmpty(t){return!o.exists(t)||o.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return o.isBool(t)&&!0===t}static isFalse(t){return o.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||o.isFunction(t)&&/^async/.test(t.toString())||o.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return o.exists(t)&&"object"==typeof t&&!(o.isBool(t)||o.isNumber(t)||o.isDate(t)||o.isArray(t)||o.isString(t)||o.isFunction(t))}static isObjectLiteral(t){return o.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!o.isFalsy(t)}static isFalsy(t){return o.isZero(t)||o.isFalse(t)||o.isNullOrEmpty(t)||isNaN(t)}}function s(t,...e){return e.reduce(((t,e,r)=>t.replace(new RegExp(`\\{${r}\\}`,"g"),e&&e.toString?e.toString():e)),t)}function a(t){return function(t){return o.exists(t)&&o.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}(function(t){return o.exists(t)&&o.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}(t))}function c(t,e){try{return t()}catch{return e}}c.async=async(t,e)=>{try{return await t()}catch{return e}};class u{constructor(t,e,r){if(e<1||e>12)throw new Error("Invalid month at Assert.DayPoint");if(r<1||r>h(e,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,e-1,r):new Date,this._day=this._value.getDay(),this._date=r,this._month=e,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return l(this._year)}get nextDay(){return f(this,1,0,0)}get prevDay(){return f(this,-1,0,0)}get nextMonth(){return f(this,0,1,0)}get prevMonth(){return f(this,0,-1,0)}get nextYear(){return f(this,0,0,1)}get prevYear(){return f(this,0,0,-1)}get firstDayOfMonth(){return new u(this._year,this._month,1)}get lastDayOfMonth(){return new u(this._year,this._month,h(this._month,this._year))}add(t,e,r){function n(t,e,r){let n=t,i=e;for(;i--;)n=n[r];return n}const{abs:i}=Math,o=i(t),s=i(r),a=i(e),c=r<0?"prevDay":"nextDay",u=e<0?"prevMonth":"nextMonth";return n(n(n(this,o,t<0?"prevYear":"nextYear"),a,u),s,c)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const e=this._year,r=t.year,n=this._month,i=t.month;return e>r||e===r&&n>i||e===r&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const e=/y{3,}/i.test(t)?this._year:this.shortYear,r=this._month,n=this._date,i=/m{2}/i.test(t)&&r<10?"0{1}":"{1}",o=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return s(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,o),e,r,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return o.isString(t)||o.isNumber(t)||o.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof u}static parse(t){if(t instanceof u)return t;let e=o.isString(t)?a(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(e)){const t=e.split("-"),[r]=t;t.push(r),t.shift(),e=t.join("/")}const r=new Date(e);if(!o.exists(e)||Number.isNaN(r.valueOf()))throw new Error(s("Cannot parse value= {0}",e));return new u(r.getFullYear(),r.getMonth()+1,r.getDate())}static tryParse(t){return c((()=>u.parse(t)),null)}static assumeNow(t){n=u.parse(t)}static get today(){return n||u.parse(new Date)}}function h(t,e){return 2===t?l(e)?29:28:t<8&&o.isEven(t)||t>7&&o.isOdd(t)?30:31}function l(t){const e=t.toString().split(/\B/);return parseFloat(function(...t){return"".concat(...t)}(e[e.length-2],e[e.length-1]))%4==0}function f(t,e,r,n){const i=t.month,o=t.year,s=t.date,a=r,c=n;let l=s+e,f=i+a,y=o+c;if(s+e>h(i,o)&&(l=1,f=i+a+1),s+e<1){const e=t.prevMonth;l=h(e.month,e.year),f=i+a-1}return f>12&&(f=1,y=o+c+1),f<1&&(f=12,y=o+c-1),new u(y,f,l)}function y(t){const e=isNaN(parseInt(t))||t<0||t>24?24:t,r=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return r.concat(n).substring(0,e)}function p(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,uid:y,uuid:p,suid:function(){return Symbol(y())},suuid:function(){return Symbol(p())}}).uid(),u.today.nextYear.toDate();const d=t=>new window.FormData(t),g=t=>{const e={};try{d(t).forEach(((t,r)=>{const n=e[r];o.isArray(n)?e[r].push(t):o.exists(n)?e[r]=[e[r],t]:e[r]=t}))}catch(r){[...t.elements].forEach((t=>{const{name:r,type:n,value:i,files:o}=t;if("file"===n)e[r]=o[0];else if("checkbox"===n||"radio"===n)t.checked&&(e[r]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),e[r]=n.length<2?n[0]:n}else e[r]=i}))}return e};var v=g,m=d;exports.wireForm=function(e,n,o){if(e&&e.$refs&&e.$refs[n]&&!e.$refs[n].__ku4wired__)try{var s=e.$refs[n],a=s.submit;s.submit=r(t().mark((function r(){var c,u,h;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c=v(n),u=m(n),t.next=4,o.call(e,c,u,s);case 4:h=t.sent,i.isFalse(h)||a.call(n);case 6:case"end":return t.stop()}}),r)}))),s.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};
package/vue/index.mjs CHANGED
@@ -1 +1 @@
1
- let t,r=class{static isNull(t){return null===t}static isEmpty(t){return r.isString(t)&&""===t||r.isArray(t)&&t.length<1||r.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(r.isUndefined(t)||r.isNull(t))}static isNullOrEmpty(t){return!r.exists(t)||r.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return r.isBool(t)&&!0===t}static isFalse(t){return r.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||r.isFunction(t)&&/^async/.test(t.toString())||r.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return r.exists(t)&&"object"==typeof t&&!(r.isBool(t)||r.isNumber(t)||r.isDate(t)||r.isArray(t)||r.isString(t)||r.isFunction(t))}static isObjectLiteral(t){return r.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!r.isFalsy(t)}static isFalsy(t){return r.isZero(t)||r.isFalse(t)||r.isNullOrEmpty(t)||isNaN(t)}};function e(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function n(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function i(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function s(t,r=0){return i(t+5*Math.pow(10,r-1),r)}function a(t,r=0){return 0===t?0:i(t-5*Math.pow(10,r-1),r)}function u(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function o(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function c(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function l(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,build:function(...t){return"".concat(...t)},chunk:function(t,e=0){if(!r.isString(t)||Number.isNaN(e)||e<0)return[];if(e<t.length){let r=0;const n=e||t.length,i=[];for(;r<t.length;)i.push(t.slice(r,r+n)),r+=n;return i}return[t]},format:function(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)},trim:function(t){return e(n(t))},trimStart:e,trimEnd:n,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,e,n="_"){const i=t.toString().split(""),s=new RegExp(n);return r.isFunction(e)?e(t):r.isString(e)&&e.split("").reduce(((r,n)=>i.length>0&&(s.test(n)||i[0]===n&&t.indexOf(i[0])===e.indexOf(n))?r+i.shift():r+n),"")},unmask:function(t,e,n="_"){const i=new RegExp(n);return r.isFunction(e)?e(t):r.isString(e)&&t.split("").reduce(((t,r,n)=>i.test(r)||!i.test(e.charAt(n))&&e.charAt(n)===r?t:t+r),"")}}),Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:i,roundUp:s,roundDown:a,roundTowardZero:function(t,r=0){return t<0?s(t,r):a(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:u,fib2:o,fibArray:function(t){return Array(t).fill(0).map((()=>u(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>o(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}}),Object.freeze({__proto__:null,uid:c,uuid:l,suid:function(){return Symbol(c())},suuid:function(){return Symbol(l())}}),Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i});class h{static isNull(t){return null===t}static isEmpty(t){return h.isString(t)&&""===t||h.isArray(t)&&t.length<1||h.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(h.isUndefined(t)||h.isNull(t))}static isNullOrEmpty(t){return!h.exists(t)||h.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return h.isBool(t)&&!0===t}static isFalse(t){return h.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||h.isFunction(t)&&/^async/.test(t.toString())||h.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return h.exists(t)&&"object"==typeof t&&!(h.isBool(t)||h.isNumber(t)||h.isDate(t)||h.isArray(t)||h.isString(t)||h.isFunction(t))}static isObjectLiteral(t){return h.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!h.isFalsy(t)}static isFalsy(t){return h.isZero(t)||h.isFalse(t)||h.isNullOrEmpty(t)||isNaN(t)}}function f(...t){return"".concat(...t)}function p(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function d(t){return y(g(t))}function y(t){return h.exists(t)&&h.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function g(t){return h.exists(t)&&h.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function m(t,r){try{return t()}catch{return r}}Object.freeze({__proto__:null,build:f,chunk:function(t,r=0){if(!h.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:p,trim:d,trimStart:y,trimEnd:g,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){const n=t.toString().split(""),i=new RegExp(e);return h.isFunction(r)?r(t):h.isString(r)&&r.split("").reduce(((e,s)=>n.length>0&&(i.test(s)||n[0]===s&&t.indexOf(n[0])===r.indexOf(s))?e+n.shift():e+s),"")},unmask:function(t,r,e="_"){const n=new RegExp(e);return h.isFunction(r)?r(t):h.isString(r)&&t.split("").reduce(((t,e,i)=>n.test(e)||!n.test(r.charAt(i))&&r.charAt(i)===e?t:t+e),"")}}),m.async=async(t,r)=>{try{return await t()}catch{return r}};class _{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>b(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return N(this._year)}get nextDay(){return A(this,1,0,0)}get prevDay(){return A(this,-1,0,0)}get nextMonth(){return A(this,0,1,0)}get prevMonth(){return A(this,0,-1,0)}get nextYear(){return A(this,0,0,1)}get prevYear(){return A(this,0,0,-1)}get firstDayOfMonth(){return new _(this._year,this._month,1)}get lastDayOfMonth(){return new _(this._year,this._month,b(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,s=i(t),a=i(e),u=i(r),o=e<0?"prevDay":"nextDay",c=r<0?"prevMonth":"nextMonth";return n(n(n(this,s,t<0?"prevYear":"nextYear"),u,c),a,o)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",s=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return p(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,s),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return h.isString(t)||h.isNumber(t)||h.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof _}static parse(t){if(t instanceof _)return t;let r=h.isString(t)?d(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!h.exists(r)||Number.isNaN(e.valueOf()))throw new Error(p("Cannot parse value= {0}",r));return new _(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return m((()=>_.parse(t)),null)}static assumeNow(r){t=_.parse(r)}static get today(){return t||_.parse(new Date)}}function b(t,r){return 2===t?N(r)?29:28:t<8&&h.isEven(t)||t>7&&h.isOdd(t)?30:31}function N(t){const r=t.toString().split(/\B/);return parseFloat(f(r[r.length-2],r[r.length-1]))%4==0}function A(t,r,e,n){const i=t.month,s=t.year,a=t.date,u=e,o=n;let c=a+r,l=i+u,h=s+o;if(a+r>b(i,s)&&(c=1,l=i+u+1),a+r<1){const r=t.prevMonth;c=b(r.month,r.year),l=i+u-1}return l>12&&(l=1,h=s+o+1),l<1&&(l=12,h=s+o-1),new _(h,l,c)}function w(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function F(t,r=0){return w(t+5*Math.pow(10,r-1),r)}function S(t,r=0){return 0===t?0:w(t-5*Math.pow(10,r-1),r)}function $(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function O(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function v(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function x(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:w,roundUp:F,roundDown:S,roundTowardZero:function(t,r=0){return t<0?F(t,r):S(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:$,fib2:O,fibArray:function(t){return Array(t).fill(0).map((()=>$(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>O(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}});var z=Object.freeze({__proto__:null,uid:v,uuid:x,suid:function(){return Symbol(v())},suuid:function(){return Symbol(x())}});Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i}),z.uid(),_.today.nextYear.toDate();const E=t=>new window.FormData(t),M=t=>{const r={};try{E(t).forEach(((t,e)=>{const n=r[e];h.isArray(n)?r[e].push(t):h.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:s}=t;if("file"===n)r[e]=s[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var D=M,j=E;const k=(t,e,n)=>{if(t&&t.$refs&&t.$refs[e]&&!t.$refs[e].__ku4wired__)try{const i=t.$refs[e],{submit:s}=i;i.submit=async()=>{const a=D(e),u=j(e),o=await n.call(t,a,u,i);r.isFalse(o)||s.call(e)},i.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};export{k as wireForm};
1
+ let t,e=class{static isNull(t){return null===t}static isEmpty(t){return e.isString(t)&&""===t||e.isArray(t)&&t.length<1||e.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(e.isUndefined(t)||e.isNull(t))}static isNullOrEmpty(t){return!e.exists(t)||e.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return e.isBool(t)&&!0===t}static isFalse(t){return e.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||e.isFunction(t)&&/^async/.test(t.toString())||e.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return e.exists(t)&&"object"==typeof t&&!(e.isBool(t)||e.isNumber(t)||e.isDate(t)||e.isArray(t)||e.isString(t)||e.isFunction(t))}static isObjectLiteral(t){return e.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!e.isFalsy(t)}static isFalsy(t){return e.isZero(t)||e.isFalse(t)||e.isNullOrEmpty(t)||isNaN(t)}};class r{static isNull(t){return null===t}static isEmpty(t){return r.isString(t)&&""===t||r.isArray(t)&&t.length<1||r.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(r.isUndefined(t)||r.isNull(t))}static isNullOrEmpty(t){return!r.exists(t)||r.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return r.isBool(t)&&!0===t}static isFalse(t){return r.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||r.isFunction(t)&&/^async/.test(t.toString())||r.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return r.exists(t)&&"object"==typeof t&&!(r.isBool(t)||r.isNumber(t)||r.isDate(t)||r.isArray(t)||r.isString(t)||r.isFunction(t))}static isObjectLiteral(t){return r.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!r.isFalsy(t)}static isFalsy(t){return r.isZero(t)||r.isFalse(t)||r.isNullOrEmpty(t)||isNaN(t)}}function s(t,...e){return e.reduce(((t,e,r)=>t.replace(new RegExp(`\\{${r}\\}`,"g"),e&&e.toString?e.toString():e)),t)}function i(t){return function(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}(function(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}(t))}function n(t,e){try{return t()}catch{return e}}n.async=async(t,e)=>{try{return await t()}catch{return e}};class a{constructor(t,e,r){if(e<1||e>12)throw new Error("Invalid month at Assert.DayPoint");if(r<1||r>o(e,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,e-1,r):new Date,this._day=this._value.getDay(),this._date=r,this._month=e,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return u(this._year)}get nextDay(){return c(this,1,0,0)}get prevDay(){return c(this,-1,0,0)}get nextMonth(){return c(this,0,1,0)}get prevMonth(){return c(this,0,-1,0)}get nextYear(){return c(this,0,0,1)}get prevYear(){return c(this,0,0,-1)}get firstDayOfMonth(){return new a(this._year,this._month,1)}get lastDayOfMonth(){return new a(this._year,this._month,o(this._month,this._year))}add(t,e,r){function s(t,e,r){let s=t,i=e;for(;i--;)s=s[r];return s}const{abs:i}=Math,n=i(t),a=i(r),o=i(e),u=r<0?"prevDay":"nextDay",c=e<0?"prevMonth":"nextMonth";return s(s(s(this,n,t<0?"prevYear":"nextYear"),o,c),a,u)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const e=this._year,r=t.year,s=this._month,i=t.month;return e>r||e===r&&s>i||e===r&&s===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const e=/y{3,}/i.test(t)?this._year:this.shortYear,r=this._month,i=this._date,n=/m{2}/i.test(t)&&r<10?"0{1}":"{1}",a=/d{2}/i.test(t)&&i<10?"0{2}":"{2}";return s(t.replace(/y+/gi,"{0}").replace(/m+/gi,n).replace(/d+/gi,a),e,r,i)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return r.isString(t)||r.isNumber(t)||r.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof a}static parse(t){if(t instanceof a)return t;let e=r.isString(t)?i(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(e)){const t=e.split("-"),[r]=t;t.push(r),t.shift(),e=t.join("/")}const n=new Date(e);if(!r.exists(e)||Number.isNaN(n.valueOf()))throw new Error(s("Cannot parse value= {0}",e));return new a(n.getFullYear(),n.getMonth()+1,n.getDate())}static tryParse(t){return n((()=>a.parse(t)),null)}static assumeNow(e){t=a.parse(e)}static get today(){return t||a.parse(new Date)}}function o(t,e){return 2===t?u(e)?29:28:t<8&&r.isEven(t)||t>7&&r.isOdd(t)?30:31}function u(t){const e=t.toString().split(/\B/);return parseFloat(function(...t){return"".concat(...t)}(e[e.length-2],e[e.length-1]))%4==0}function c(t,e,r,s){const i=t.month,n=t.year,u=t.date,c=r,h=s;let l=u+e,y=i+c,f=n+h;if(u+e>o(i,n)&&(l=1,y=i+c+1),u+e<1){const e=t.prevMonth;l=o(e.month,e.year),y=i+c-1}return y>12&&(y=1,f=n+h+1),y<1&&(y=12,f=n+h-1),new a(f,y,l)}function h(t){const e=isNaN(parseInt(t))||t<0||t>24?24:t,r=Math.random().toString().substring(2),s=Math.random().toString().substring(2);return r.concat(s).substring(0,e)}function l(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,uid:h,uuid:l,suid:function(){return Symbol(h())},suuid:function(){return Symbol(l())}}).uid(),a.today.nextYear.toDate();const y=t=>new window.FormData(t),f=t=>{const e={};try{y(t).forEach(((t,s)=>{const i=e[s];r.isArray(i)?e[s].push(t):r.exists(i)?e[s]=[e[s],t]:e[s]=t}))}catch(r){[...t.elements].forEach((t=>{const{name:r,type:s,value:i,files:n}=t;if("file"===s)e[r]=n[0];else if("checkbox"===s||"radio"===s)t.checked&&(e[r]=i);else if(t.multiple){const s=[];t.querySelectorAll("option").forEach((t=>t.selected&&s.push(t.value))),e[r]=s.length<2?s[0]:s}else e[r]=i}))}return e};var d=f,m=y;const g=(t,r,s)=>{if(t&&t.$refs&&t.$refs[r]&&!t.$refs[r].__ku4wired__)try{const i=t.$refs[r],{submit:n}=i;i.submit=async()=>{const a=d(r),o=m(r),u=await s.call(t,a,o,i);e.isFalse(u)||n.call(r)},i.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};export{g as wireForm};
package/vue3/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";function t(){t=function(){return r};var r={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function u(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{u({},"")}catch(t){u=function(t,r,e){return t[r]=e}}function c(t,r,e,n){var i=r&&r.prototype instanceof f?r:f,o=Object.create(i.prototype),s=new A(n||[]);return o._invoke=function(t,r,e){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return E()}for(e.method=i,e.arg=o;;){var s=e.delegate;if(s){var a=w(s,e);if(a){if(a===h)continue;return a}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var u=l(t,r,e);if("normal"===u.type){if(n=e.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n="completed",e.method="throw",e.arg=u.arg)}}}(t,e,s),o}function l(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=c;var h={};function f(){}function p(){}function d(){}var y={};u(y,o,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(F([])));m&&m!==e&&n.call(m,o)&&(y=m);var v=d.prototype=f.prototype=Object.create(y);function _(t){["next","throw","return"].forEach((function(r){u(t,r,(function(t){return this._invoke(r,t)}))}))}function b(t,r){function e(i,o,s,a){var u=l(t[i],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?r.resolve(h.__await).then((function(t){e("next",t,s,a)}),(function(t){e("throw",t,s,a)})):r.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return e("throw",t,s,a)}))}a(u.arg)}var i;this._invoke=function(t,n){function o(){return new r((function(r,i){e(t,n,r,i)}))}return i=i?i.then(o,o):o()}}function w(t,r){var e=t.iterator[r.method];if(void 0===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=void 0,w(t,r),"throw"===r.method))return h;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=l(e,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,h;var i=n.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function N(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function x(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function F(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,i=function r(){for(;++e<t.length;)if(n.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=void 0,r.done=!0,r};return i.next=i}}return{next:E}}function E(){return{value:void 0,done:!0}}return p.prototype=d,u(v,"constructor",d),u(d,"constructor",p),p.displayName=u(d,a,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===p||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,u(t,a,"GeneratorFunction")),t.prototype=Object.create(v),t},r.awrap=function(t){return{__await:t}},_(b.prototype),u(b.prototype,s,(function(){return this})),r.AsyncIterator=b,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var s=new b(c(t,e,n,i),o);return r.isGeneratorFunction(e)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(v),u(v,a,"Generator"),u(v,o,(function(){return this})),u(v,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=[];for(var e in t)r.push(e);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=F,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function e(e,n){return s.type="throw",s.arg=t,r.next=e,n&&(r.method="next",r.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=r&&r<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=r,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(s)},complete:function(t,r){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&r&&(this.next=r),h},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),x(e),h}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var i=n.arg;x(e)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:F(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=void 0),h}},r}function r(t,r,e,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void e(t)}a.done?r(u):Promise.resolve(u).then(n,i)}function e(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var s=t.apply(e,n);function a(t){r(s,i,o,a,u,"next",t)}function u(t){r(s,i,o,a,u,"throw",t)}a(void 0)}))}}let n,i=class{static isNull(t){return null===t}static isEmpty(t){return i.isString(t)&&""===t||i.isArray(t)&&t.length<1||i.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(i.isUndefined(t)||i.isNull(t))}static isNullOrEmpty(t){return!i.exists(t)||i.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return i.isBool(t)&&!0===t}static isFalse(t){return i.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||i.isFunction(t)&&/^async/.test(t.toString())||i.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return i.exists(t)&&"object"==typeof t&&!(i.isBool(t)||i.isNumber(t)||i.isDate(t)||i.isArray(t)||i.isString(t)||i.isFunction(t))}static isObjectLiteral(t){return i.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!i.isFalsy(t)}static isFalsy(t){return i.isZero(t)||i.isFalse(t)||i.isNullOrEmpty(t)||isNaN(t)}};function o(t){return i.exists(t)&&i.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function s(t){return i.exists(t)&&i.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function a(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function u(t,r=0){return a(t+5*Math.pow(10,r-1),r)}function c(t,r=0){return 0===t?0:a(t-5*Math.pow(10,r-1),r)}function l(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function h(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function f(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function p(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,build:function(...t){return"".concat(...t)},chunk:function(t,r=0){if(!i.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:function(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)},trim:function(t){return o(s(t))},trimStart:o,trimEnd:s,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){const n=t.toString().split(""),o=new RegExp(e);return i.isFunction(r)?r(t):i.isString(r)&&r.split("").reduce(((e,i)=>n.length>0&&(o.test(i)||n[0]===i&&t.indexOf(n[0])===r.indexOf(i))?e+n.shift():e+i),"")},unmask:function(t,r,e="_"){const n=new RegExp(e);return i.isFunction(r)?r(t):i.isString(r)&&t.split("").reduce(((t,e,i)=>n.test(e)||!n.test(r.charAt(i))&&r.charAt(i)===e?t:t+e),"")}}),Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:a,roundUp:u,roundDown:c,roundTowardZero:function(t,r=0){return t<0?u(t,r):c(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:l,fib2:h,fibArray:function(t){return Array(t).fill(0).map((()=>l(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>h(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}}),Object.freeze({__proto__:null,uid:f,uuid:p,suid:function(){return Symbol(f())},suuid:function(){return Symbol(p())}}),Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i});class d{static isNull(t){return null===t}static isEmpty(t){return d.isString(t)&&""===t||d.isArray(t)&&t.length<1||d.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(d.isUndefined(t)||d.isNull(t))}static isNullOrEmpty(t){return!d.exists(t)||d.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return d.isBool(t)&&!0===t}static isFalse(t){return d.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||d.isFunction(t)&&/^async/.test(t.toString())||d.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return d.exists(t)&&"object"==typeof t&&!(d.isBool(t)||d.isNumber(t)||d.isDate(t)||d.isArray(t)||d.isString(t)||d.isFunction(t))}static isObjectLiteral(t){return d.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!d.isFalsy(t)}static isFalsy(t){return d.isZero(t)||d.isFalse(t)||d.isNullOrEmpty(t)||isNaN(t)}}function y(...t){return"".concat(...t)}function g(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function m(t){return v(_(t))}function v(t){return d.exists(t)&&d.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function _(t){return d.exists(t)&&d.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function b(t,r){try{return t()}catch{return r}}Object.freeze({__proto__:null,build:y,chunk:function(t,r=0){if(!d.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:g,trim:m,trimStart:v,trimEnd:_,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){const n=t.toString().split(""),i=new RegExp(e);return d.isFunction(r)?r(t):d.isString(r)&&r.split("").reduce(((e,o)=>n.length>0&&(i.test(o)||n[0]===o&&t.indexOf(n[0])===r.indexOf(o))?e+n.shift():e+o),"")},unmask:function(t,r,e="_"){const n=new RegExp(e);return d.isFunction(r)?r(t):d.isString(r)&&t.split("").reduce(((t,e,i)=>n.test(e)||!n.test(r.charAt(i))&&r.charAt(i)===e?t:t+e),"")}}),b.async=async(t,r)=>{try{return await t()}catch{return r}};class w{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>N(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return x(this._year)}get nextDay(){return A(this,1,0,0)}get prevDay(){return A(this,-1,0,0)}get nextMonth(){return A(this,0,1,0)}get prevMonth(){return A(this,0,-1,0)}get nextYear(){return A(this,0,0,1)}get prevYear(){return A(this,0,0,-1)}get firstDayOfMonth(){return new w(this._year,this._month,1)}get lastDayOfMonth(){return new w(this._year,this._month,N(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,o=i(t),s=i(e),a=i(r),u=e<0?"prevDay":"nextDay",c=r<0?"prevMonth":"nextMonth";return n(n(n(this,o,t<0?"prevYear":"nextYear"),a,c),s,u)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",o=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return g(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,o),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return d.isString(t)||d.isNumber(t)||d.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof w}static parse(t){if(t instanceof w)return t;let r=d.isString(t)?m(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!d.exists(r)||Number.isNaN(e.valueOf()))throw new Error(g("Cannot parse value= {0}",r));return new w(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return b((()=>w.parse(t)),null)}static assumeNow(t){n=w.parse(t)}static get today(){return n||w.parse(new Date)}}function N(t,r){return 2===t?x(r)?29:28:t<8&&d.isEven(t)||t>7&&d.isOdd(t)?30:31}function x(t){const r=t.toString().split(/\B/);return parseFloat(y(r[r.length-2],r[r.length-1]))%4==0}function A(t,r,e,n){const i=t.month,o=t.year,s=t.date,a=e,u=n;let c=s+r,l=i+a,h=o+u;if(s+r>N(i,o)&&(c=1,l=i+a+1),s+r<1){const r=t.prevMonth;c=N(r.month,r.year),l=i+a-1}return l>12&&(l=1,h=o+u+1),l<1&&(l=12,h=o+u-1),new w(h,l,c)}function F(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function E(t,r=0){return F(t+5*Math.pow(10,r-1),r)}function S(t,r=0){return 0===t?0:F(t-5*Math.pow(10,r-1),r)}function O(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function L(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function $(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function j(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:F,roundUp:E,roundDown:S,roundTowardZero:function(t,r=0){return t<0?E(t,r):S(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:O,fib2:L,fibArray:function(t){return Array(t).fill(0).map((()=>O(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>L(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}});var z=Object.freeze({__proto__:null,uid:$,uuid:j,suid:function(){return Symbol($())},suuid:function(){return Symbol(j())}});Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i}),z.uid(),w.today.nextYear.toDate();const M=t=>new window.FormData(t),k=t=>{const r={};try{M(t).forEach(((t,e)=>{const n=r[e];d.isArray(n)?r[e].push(t):d.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:o}=t;if("file"===n)r[e]=o[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var D=k,P=M;exports.wireForm=function(r,n){if(r&&r.value&&!r.value.__ku4wired__)try{var o=r.value,s=o.submit;o.submit=e(t().mark((function e(){var a,u,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=D(r.value),u=P(r.value),t.next=4,n(a,u,o);case 4:c=t.sent,i.isFalse(c)||s.call(r.value);case 6:case"end":return t.stop()}}),e)}))),o.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};
1
+ "use strict";function t(){t=function(){return e};var e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,s=Object.create(o.prototype),a=new F(n||[]);return i(s,"_invoke",{value:x(t,r,a)}),s}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f={};function y(){}function p(){}function d(){}var v={};c(v,s,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(L([])));m&&m!==r&&n.call(m,s)&&(v=m);var w=d.prototype=y.prototype=Object.create(v);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(i,o,s,a){var u=l(t[i],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,a)}),(function(t){r("throw",t,s,a)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,a)}))}a(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e((function(e,i){r(t,n,e,i)}))}return o=o?o.then(i,i):i()}})}function x(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return S()}for(r.method=i,r.arg=o;;){var s=r.delegate;if(s){var a=E(s,r);if(a){if(a===f)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function N(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function F(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(N,this),this.reset(!0)}function L(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:S}}function S(){return{value:void 0,done:!0}}return p.prototype=d,i(w,"constructor",{value:d,configurable:!0}),i(d,"constructor",{value:p,configurable:!0}),p.displayName=c(d,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},b(_.prototype),c(_.prototype,a,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var s=new _(h(t,r,n,i),o);return e.isGeneratorFunction(r)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},b(w),c(w,u,"Generator"),c(w,s,(function(){return this})),c(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=L,F.prototype={constructor:F,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(O),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return s.type="throw",s.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),O(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function e(t,e,r,n,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function r(t){return function(){var r=this,n=arguments;return new Promise((function(i,o){var s=t.apply(r,n);function a(t){e(s,i,o,a,u,"next",t)}function u(t){e(s,i,o,a,u,"throw",t)}a(void 0)}))}}let n,i=class{static isNull(t){return null===t}static isEmpty(t){return i.isString(t)&&""===t||i.isArray(t)&&t.length<1||i.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(i.isUndefined(t)||i.isNull(t))}static isNullOrEmpty(t){return!i.exists(t)||i.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return i.isBool(t)&&!0===t}static isFalse(t){return i.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||i.isFunction(t)&&/^async/.test(t.toString())||i.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return i.exists(t)&&"object"==typeof t&&!(i.isBool(t)||i.isNumber(t)||i.isDate(t)||i.isArray(t)||i.isString(t)||i.isFunction(t))}static isObjectLiteral(t){return i.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!i.isFalsy(t)}static isFalsy(t){return i.isZero(t)||i.isFalse(t)||i.isNullOrEmpty(t)||isNaN(t)}};class o{static isNull(t){return null===t}static isEmpty(t){return o.isString(t)&&""===t||o.isArray(t)&&t.length<1||o.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(o.isUndefined(t)||o.isNull(t))}static isNullOrEmpty(t){return!o.exists(t)||o.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return o.isBool(t)&&!0===t}static isFalse(t){return o.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||o.isFunction(t)&&/^async/.test(t.toString())||o.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return o.exists(t)&&"object"==typeof t&&!(o.isBool(t)||o.isNumber(t)||o.isDate(t)||o.isArray(t)||o.isString(t)||o.isFunction(t))}static isObjectLiteral(t){return o.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!o.isFalsy(t)}static isFalsy(t){return o.isZero(t)||o.isFalse(t)||o.isNullOrEmpty(t)||isNaN(t)}}function s(t,...e){return e.reduce(((t,e,r)=>t.replace(new RegExp(`\\{${r}\\}`,"g"),e&&e.toString?e.toString():e)),t)}function a(t){return function(t){return o.exists(t)&&o.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}(function(t){return o.exists(t)&&o.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}(t))}function u(t,e){try{return t()}catch{return e}}u.async=async(t,e)=>{try{return await t()}catch{return e}};class c{constructor(t,e,r){if(e<1||e>12)throw new Error("Invalid month at Assert.DayPoint");if(r<1||r>h(e,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,e-1,r):new Date,this._day=this._value.getDay(),this._date=r,this._month=e,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return l(this._year)}get nextDay(){return f(this,1,0,0)}get prevDay(){return f(this,-1,0,0)}get nextMonth(){return f(this,0,1,0)}get prevMonth(){return f(this,0,-1,0)}get nextYear(){return f(this,0,0,1)}get prevYear(){return f(this,0,0,-1)}get firstDayOfMonth(){return new c(this._year,this._month,1)}get lastDayOfMonth(){return new c(this._year,this._month,h(this._month,this._year))}add(t,e,r){function n(t,e,r){let n=t,i=e;for(;i--;)n=n[r];return n}const{abs:i}=Math,o=i(t),s=i(r),a=i(e),u=r<0?"prevDay":"nextDay",c=e<0?"prevMonth":"nextMonth";return n(n(n(this,o,t<0?"prevYear":"nextYear"),a,c),s,u)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const e=this._year,r=t.year,n=this._month,i=t.month;return e>r||e===r&&n>i||e===r&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const e=/y{3,}/i.test(t)?this._year:this.shortYear,r=this._month,n=this._date,i=/m{2}/i.test(t)&&r<10?"0{1}":"{1}",o=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return s(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,o),e,r,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return o.isString(t)||o.isNumber(t)||o.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof c}static parse(t){if(t instanceof c)return t;let e=o.isString(t)?a(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(e)){const t=e.split("-"),[r]=t;t.push(r),t.shift(),e=t.join("/")}const r=new Date(e);if(!o.exists(e)||Number.isNaN(r.valueOf()))throw new Error(s("Cannot parse value= {0}",e));return new c(r.getFullYear(),r.getMonth()+1,r.getDate())}static tryParse(t){return u((()=>c.parse(t)),null)}static assumeNow(t){n=c.parse(t)}static get today(){return n||c.parse(new Date)}}function h(t,e){return 2===t?l(e)?29:28:t<8&&o.isEven(t)||t>7&&o.isOdd(t)?30:31}function l(t){const e=t.toString().split(/\B/);return parseFloat(function(...t){return"".concat(...t)}(e[e.length-2],e[e.length-1]))%4==0}function f(t,e,r,n){const i=t.month,o=t.year,s=t.date,a=r,u=n;let l=s+e,f=i+a,y=o+u;if(s+e>h(i,o)&&(l=1,f=i+a+1),s+e<1){const e=t.prevMonth;l=h(e.month,e.year),f=i+a-1}return f>12&&(f=1,y=o+u+1),f<1&&(f=12,y=o+u-1),new c(y,f,l)}function y(t){const e=isNaN(parseInt(t))||t<0||t>24?24:t,r=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return r.concat(n).substring(0,e)}function p(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,uid:y,uuid:p,suid:function(){return Symbol(y())},suuid:function(){return Symbol(p())}}).uid(),c.today.nextYear.toDate();const d=t=>new window.FormData(t),v=t=>{const e={};try{d(t).forEach(((t,r)=>{const n=e[r];o.isArray(n)?e[r].push(t):o.exists(n)?e[r]=[e[r],t]:e[r]=t}))}catch(r){[...t.elements].forEach((t=>{const{name:r,type:n,value:i,files:o}=t;if("file"===n)e[r]=o[0];else if("checkbox"===n||"radio"===n)t.checked&&(e[r]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),e[r]=n.length<2?n[0]:n}else e[r]=i}))}return e};var g=v,m=d;exports.wireForm=function(e,n){if(e&&e.value&&!e.value.__ku4wired__)try{var o=e.value,s=o.submit;o.submit=r(t().mark((function r(){var a,u,c;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=g(e.value),u=m(e.value),t.next=4,n(a,u,o);case 4:c=t.sent,i.isFalse(c)||s.call(e.value);case 6:case"end":return t.stop()}}),r)}))),o.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};
package/vue3/index.mjs CHANGED
@@ -1 +1 @@
1
- let t,r=class{static isNull(t){return null===t}static isEmpty(t){return r.isString(t)&&""===t||r.isArray(t)&&t.length<1||r.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(r.isUndefined(t)||r.isNull(t))}static isNullOrEmpty(t){return!r.exists(t)||r.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return r.isBool(t)&&!0===t}static isFalse(t){return r.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||r.isFunction(t)&&/^async/.test(t.toString())||r.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return r.exists(t)&&"object"==typeof t&&!(r.isBool(t)||r.isNumber(t)||r.isDate(t)||r.isArray(t)||r.isString(t)||r.isFunction(t))}static isObjectLiteral(t){return r.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!r.isFalsy(t)}static isFalsy(t){return r.isZero(t)||r.isFalse(t)||r.isNullOrEmpty(t)||isNaN(t)}};function e(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function n(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function i(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function s(t,r=0){return i(t+5*Math.pow(10,r-1),r)}function a(t,r=0){return 0===t?0:i(t-5*Math.pow(10,r-1),r)}function u(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function o(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function c(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function l(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,build:function(...t){return"".concat(...t)},chunk:function(t,e=0){if(!r.isString(t)||Number.isNaN(e)||e<0)return[];if(e<t.length){let r=0;const n=e||t.length,i=[];for(;r<t.length;)i.push(t.slice(r,r+n)),r+=n;return i}return[t]},format:function(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)},trim:function(t){return e(n(t))},trimStart:e,trimEnd:n,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,e,n="_"){const i=t.toString().split(""),s=new RegExp(n);return r.isFunction(e)?e(t):r.isString(e)&&e.split("").reduce(((r,n)=>i.length>0&&(s.test(n)||i[0]===n&&t.indexOf(i[0])===e.indexOf(n))?r+i.shift():r+n),"")},unmask:function(t,e,n="_"){const i=new RegExp(n);return r.isFunction(e)?e(t):r.isString(e)&&t.split("").reduce(((t,r,n)=>i.test(r)||!i.test(e.charAt(n))&&e.charAt(n)===r?t:t+r),"")}}),Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:i,roundUp:s,roundDown:a,roundTowardZero:function(t,r=0){return t<0?s(t,r):a(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:u,fib2:o,fibArray:function(t){return Array(t).fill(0).map((()=>u(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>o(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}}),Object.freeze({__proto__:null,uid:c,uuid:l,suid:function(){return Symbol(c())},suuid:function(){return Symbol(l())}}),Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i});class h{static isNull(t){return null===t}static isEmpty(t){return h.isString(t)&&""===t||h.isArray(t)&&t.length<1||h.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(h.isUndefined(t)||h.isNull(t))}static isNullOrEmpty(t){return!h.exists(t)||h.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return h.isBool(t)&&!0===t}static isFalse(t){return h.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||h.isFunction(t)&&/^async/.test(t.toString())||h.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return h.exists(t)&&"object"==typeof t&&!(h.isBool(t)||h.isNumber(t)||h.isDate(t)||h.isArray(t)||h.isString(t)||h.isFunction(t))}static isObjectLiteral(t){return h.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!h.isFalsy(t)}static isFalsy(t){return h.isZero(t)||h.isFalse(t)||h.isNullOrEmpty(t)||isNaN(t)}}function f(...t){return"".concat(...t)}function p(t,...r){return r.reduce(((t,r,e)=>t.replace(new RegExp(`\\{${e}\\}`,"g"),r&&r.toString?r.toString():r)),t)}function d(t){return y(g(t))}function y(t){return h.exists(t)&&h.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}function g(t){return h.exists(t)&&h.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}function m(t,r){try{return t()}catch{return r}}Object.freeze({__proto__:null,build:f,chunk:function(t,r=0){if(!h.isString(t)||Number.isNaN(r)||r<0)return[];if(r<t.length){let e=0;const n=r||t.length,i=[];for(;e<t.length;)i.push(t.slice(e,e+n)),e+=n;return i}return[t]},format:p,trim:d,trimStart:y,trimEnd:g,capitalize:function(t=""){return(t||"").charAt(0).toUpperCase()+(t||"").slice(1).toLowerCase()},mask:function(t,r,e="_"){const n=t.toString().split(""),i=new RegExp(e);return h.isFunction(r)?r(t):h.isString(r)&&r.split("").reduce(((e,s)=>n.length>0&&(i.test(s)||n[0]===s&&t.indexOf(n[0])===r.indexOf(s))?e+n.shift():e+s),"")},unmask:function(t,r,e="_"){const n=new RegExp(e);return h.isFunction(r)?r(t):h.isString(r)&&t.split("").reduce(((t,e,i)=>n.test(e)||!n.test(r.charAt(i))&&r.charAt(i)===e?t:t+e),"")}}),m.async=async(t,r)=>{try{return await t()}catch{return r}};class _{constructor(t,r,e){if(r<1||r>12)throw new Error("Invalid month at Assert.DayPoint");if(e<1||e>b(r,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,r-1,e):new Date,this._day=this._value.getDay(),this._date=e,this._month=r,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return N(this._year)}get nextDay(){return A(this,1,0,0)}get prevDay(){return A(this,-1,0,0)}get nextMonth(){return A(this,0,1,0)}get prevMonth(){return A(this,0,-1,0)}get nextYear(){return A(this,0,0,1)}get prevYear(){return A(this,0,0,-1)}get firstDayOfMonth(){return new _(this._year,this._month,1)}get lastDayOfMonth(){return new _(this._year,this._month,b(this._month,this._year))}add(t,r,e){function n(t,r,e){let n=t,i=r;for(;i--;)n=n[e];return n}const{abs:i}=Math,s=i(t),a=i(e),u=i(r),o=e<0?"prevDay":"nextDay",c=r<0?"prevMonth":"nextMonth";return n(n(n(this,s,t<0?"prevYear":"nextYear"),u,c),a,o)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const r=this._year,e=t.year,n=this._month,i=t.month;return r>e||r===e&&n>i||r===e&&n===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const r=/y{3,}/i.test(t)?this._year:this.shortYear,e=this._month,n=this._date,i=/m{2}/i.test(t)&&e<10?"0{1}":"{1}",s=/d{2}/i.test(t)&&n<10?"0{2}":"{2}";return p(t.replace(/y+/gi,"{0}").replace(/m+/gi,i).replace(/d+/gi,s),r,e,n)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return h.isString(t)||h.isNumber(t)||h.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof _}static parse(t){if(t instanceof _)return t;let r=h.isString(t)?d(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(r)){const t=r.split("-"),[e]=t;t.push(e),t.shift(),r=t.join("/")}const e=new Date(r);if(!h.exists(r)||Number.isNaN(e.valueOf()))throw new Error(p("Cannot parse value= {0}",r));return new _(e.getFullYear(),e.getMonth()+1,e.getDate())}static tryParse(t){return m((()=>_.parse(t)),null)}static assumeNow(r){t=_.parse(r)}static get today(){return t||_.parse(new Date)}}function b(t,r){return 2===t?N(r)?29:28:t<8&&h.isEven(t)||t>7&&h.isOdd(t)?30:31}function N(t){const r=t.toString().split(/\B/);return parseFloat(f(r[r.length-2],r[r.length-1]))%4==0}function A(t,r,e,n){const i=t.month,s=t.year,a=t.date,u=e,o=n;let c=a+r,l=i+u,h=s+o;if(a+r>b(i,s)&&(c=1,l=i+u+1),a+r<1){const r=t.prevMonth;c=b(r.month,r.year),l=i+u-1}return l>12&&(l=1,h=s+o+1),l<1&&(l=12,h=s+o-1),new _(h,l,c)}function w(t,r=0){const e=Math.pow(10,-r);return Math.round(parseFloat((t*e).toFixed(Math.abs(r))))/e}function F(t,r=0){return w(t+5*Math.pow(10,r-1),r)}function S(t,r=0){return 0===t?0:w(t-5*Math.pow(10,r-1),r)}function v(t){const r=(t,e=0,n=1)=>0<t?r(--t,n,e+n):e;return r(t)}function O(t){let r=0,e=1,n=0;for(;t>1;)n=r,r=e,e+=n,t--;return t<1?r:e}function $(t){const r=isNaN(parseInt(t))||t<0||t>24?24:t,e=Math.random().toString().substring(2),n=Math.random().toString().substring(2);return e.concat(n).substring(0,r)}function x(){return function t(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,random:function(t=0,r=1){return Math.random()*(r-t)+t},round:w,roundUp:F,roundDown:S,roundTowardZero:function(t,r=0){return t<0?F(t,r):S(t,r)},gcd:function t(r,e){return 0===e?Math.abs(r):t(e,r%e)},fib:v,fib2:O,fibArray:function(t){return Array(t).fill(0).map((()=>v(--t))).reverse()},fib2Array:function(t){return Array(t).fill(0).map((()=>O(--t))).reverse()},tryParseInt:function(t,r=0){const e=parseInt(t);return Number.isNaN(e)?r:e},tryParseFloat:function(t,r=0){const e=parseFloat(t);return Number.isNaN(e)?r:e}});var z=Object.freeze({__proto__:null,uid:$,uuid:x,suid:function(){return Symbol($())},suuid:function(){return Symbol(x())}});Object.freeze({__proto__:null,pattern:t=>t.toString().replace(/(^\/)|(\/$)/g,"").replace(/\\/g,"\\"),escape:t=>t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),alpha:/^[A-z]+$/,alphaNumeric:/^[A-z0-9]+$/,base64:/^[A-z0-9=]+$/,dataUrl:/^\s*data:([a-z]+\/[a-z0-9+-]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=._~:@/?%\s-]*\s*$/i,email:/^\w+([.\w-+]+)?@\w+([.\w-]+)?\.[A-Za-z0-9]{2,}$/,empty:/^$/,numeric:/^-?[0-9]+$/,script:/(<script[A-z0-9\n\s\t\r.={([\])}'",;!&|$/_:<>*?+\u0000-\u0037\u00C2\u00A0\u2122-]*?<\/script>)/,uid:/^\d{14,}$/i,url:/^(https?:\/\/)?[^{}\\:]+\.[A-z0-9]{2,12}(\/[^?\s]+)*\/?(\?([^=?_]+=[^=?_]*(&[^=?_]+=[^=?_]*)*(_.*)?)?)?$/,uuid:/^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$/i}),z.uid(),_.today.nextYear.toDate();const E=t=>new window.FormData(t),M=t=>{const r={};try{E(t).forEach(((t,e)=>{const n=r[e];h.isArray(n)?r[e].push(t):h.exists(n)?r[e]=[r[e],t]:r[e]=t}))}catch(e){[...t.elements].forEach((t=>{const{name:e,type:n,value:i,files:s}=t;if("file"===n)r[e]=s[0];else if("checkbox"===n||"radio"===n)t.checked&&(r[e]=i);else if(t.multiple){const n=[];t.querySelectorAll("option").forEach((t=>t.selected&&n.push(t.value))),r[e]=n.length<2?n[0]:n}else r[e]=i}))}return r};var D=M,j=E;const k=(t,e)=>{if(t&&t.value&&!t.value.__ku4wired__)try{const n=t.value,{submit:i}=n;n.submit=async()=>{const s=D(t.value),a=j(t.value),u=await e(s,a,n);r.isFalse(u)||i.call(t.value)},n.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};export{k as wireForm};
1
+ let t,e=class{static isNull(t){return null===t}static isEmpty(t){return e.isString(t)&&""===t||e.isArray(t)&&t.length<1||e.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(e.isUndefined(t)||e.isNull(t))}static isNullOrEmpty(t){return!e.exists(t)||e.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return e.isBool(t)&&!0===t}static isFalse(t){return e.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||e.isFunction(t)&&/^async/.test(t.toString())||e.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return e.exists(t)&&"object"==typeof t&&!(e.isBool(t)||e.isNumber(t)||e.isDate(t)||e.isArray(t)||e.isString(t)||e.isFunction(t))}static isObjectLiteral(t){return e.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!e.isFalsy(t)}static isFalsy(t){return e.isZero(t)||e.isFalse(t)||e.isNullOrEmpty(t)||isNaN(t)}};class r{static isNull(t){return null===t}static isEmpty(t){return r.isString(t)&&""===t||r.isArray(t)&&t.length<1||r.isObjectLiteral(t)&&Object.keys(t).length<1}static isUndefined(t){return void 0===t}static isZero(t){return 0===t}static exists(t){return!(r.isUndefined(t)||r.isNull(t))}static isNullOrEmpty(t){return!r.exists(t)||r.isEmpty(t)}static isArray(t){return Array.isArray(t)}static isBool(t){return"boolean"==typeof t}static isTrue(t){return r.isBool(t)&&!0===t}static isFalse(t){return r.isBool(t)&&!1===t}static isDate(t){return t instanceof Date}static isNumber(t){return("number"==typeof t||t instanceof Number)&&!isNaN(t)}static isEven(t){return this.isNumber(t)&&!this.isZero(t)&&t%2==0}static isOdd(t){return this.isNumber(t)&&!this.isZero(t)&&!this.isEven(t)}static isString(t){return"string"==typeof t||t instanceof String}static isFunction(t){return t instanceof Function}static isAsyncFunction(t){try{return"AsyncFunction"===Object.getPrototypeOf(t).constructor.name||r.isFunction(t)&&/^async/.test(t.toString())||r.isFunction(t().then)}catch(t){return!1}}static isPromise(t){return t instanceof Promise}static isObject(t){return r.exists(t)&&"object"==typeof t&&!(r.isBool(t)||r.isNumber(t)||r.isDate(t)||r.isArray(t)||r.isString(t)||r.isFunction(t))}static isObjectLiteral(t){return r.isObject(t)&&t.constructor==={}.constructor}static isTruthy(t){return!r.isFalsy(t)}static isFalsy(t){return r.isZero(t)||r.isFalse(t)||r.isNullOrEmpty(t)||isNaN(t)}}function s(t,...e){return e.reduce(((t,e,r)=>t.replace(new RegExp(`\\{${r}\\}`,"g"),e&&e.toString?e.toString():e)),t)}function i(t){return function(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/^[\s\n]*/,""):t}(function(t){return r.exists(t)&&r.isFunction(t.replace)?t.replace(/[\s\n]*$/,""):t}(t))}function n(t,e){try{return t()}catch{return e}}n.async=async(t,e)=>{try{return await t()}catch{return e}};class a{constructor(t,e,r){if(e<1||e>12)throw new Error("Invalid month at Assert.DayPoint");if(r<1||r>o(e,t))throw new Error("Invalid date at DayPoint");this._value=arguments.length>=3?new Date(t,e-1,r):new Date,this._day=this._value.getDay(),this._date=r,this._month=e,this._year=t}get value(){return this._value}get day(){return this._day}get date(){return this._date}get month(){return this._month}get year(){return this._year}get shortYear(){const t=this._year.toString();return parseInt(t.substr(t.length-2))}get isWeekday(){const t=this._day;return t>0&&t<6}get isWeekend(){return!this.isWeekday}get isLeapYear(){return u(this._year)}get nextDay(){return c(this,1,0,0)}get prevDay(){return c(this,-1,0,0)}get nextMonth(){return c(this,0,1,0)}get prevMonth(){return c(this,0,-1,0)}get nextYear(){return c(this,0,0,1)}get prevYear(){return c(this,0,0,-1)}get firstDayOfMonth(){return new a(this._year,this._month,1)}get lastDayOfMonth(){return new a(this._year,this._month,o(this._month,this._year))}add(t,e,r){function s(t,e,r){let s=t,i=e;for(;i--;)s=s[r];return s}const{abs:i}=Math,n=i(t),a=i(r),o=i(e),u=r<0?"prevDay":"nextDay",c=e<0?"prevMonth":"nextMonth";return s(s(s(this,n,t<0?"prevYear":"nextYear"),o,c),a,u)}isBefore(t){return!(this.isAfter(t)||this.equals(t))}isAfter(t){const e=this._year,r=t.year,s=this._month,i=t.month;return e>r||e===r&&s>i||e===r&&s===i&&this._date>t.date}equals(t){return this._year===t.year&&this._month===t.month&&this._date===t.date}toString(t="mm/dd/yyyy"){const e=/y{3,}/i.test(t)?this._year:this.shortYear,r=this._month,i=this._date,n=/m{2}/i.test(t)&&r<10?"0{1}":"{1}",a=/d{2}/i.test(t)&&i<10?"0{2}":"{2}";return s(t.replace(/y+/gi,"{0}").replace(/m+/gi,n).replace(/d+/gi,a),e,r,i)}toDate(){return this._value}toJson(){return this._value.toJSON()}static canParse(t){return r.isString(t)||r.isNumber(t)||r.isDate(t)?!isNaN(new Date(t).valueOf()):t instanceof a}static parse(t){if(t instanceof a)return t;let e=r.isString(t)?i(t).replace(/T\d{2}:\d{2}:\d{2}(.\d+)?Z/,""):t;if(/^\d{4}-\d{1,2}-\d{1,2}$/.test(e)){const t=e.split("-"),[r]=t;t.push(r),t.shift(),e=t.join("/")}const n=new Date(e);if(!r.exists(e)||Number.isNaN(n.valueOf()))throw new Error(s("Cannot parse value= {0}",e));return new a(n.getFullYear(),n.getMonth()+1,n.getDate())}static tryParse(t){return n((()=>a.parse(t)),null)}static assumeNow(e){t=a.parse(e)}static get today(){return t||a.parse(new Date)}}function o(t,e){return 2===t?u(e)?29:28:t<8&&r.isEven(t)||t>7&&r.isOdd(t)?30:31}function u(t){const e=t.toString().split(/\B/);return parseFloat(function(...t){return"".concat(...t)}(e[e.length-2],e[e.length-1]))%4==0}function c(t,e,r,s){const i=t.month,n=t.year,u=t.date,c=r,l=s;let h=u+e,y=i+c,f=n+l;if(u+e>o(i,n)&&(h=1,y=i+c+1),u+e<1){const e=t.prevMonth;h=o(e.month,e.year),y=i+c-1}return y>12&&(y=1,f=n+l+1),y<1&&(y=12,f=n+l-1),new a(f,y,h)}function l(t){const e=isNaN(parseInt(t))||t<0||t>24?24:t,r=Math.random().toString().substring(2),s=Math.random().toString().substring(2);return r.concat(s).substring(0,e)}function h(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}Object.freeze({__proto__:null,uid:l,uuid:h,suid:function(){return Symbol(l())},suuid:function(){return Symbol(h())}}).uid(),a.today.nextYear.toDate();const y=t=>new window.FormData(t),f=t=>{const e={};try{y(t).forEach(((t,s)=>{const i=e[s];r.isArray(i)?e[s].push(t):r.exists(i)?e[s]=[e[s],t]:e[s]=t}))}catch(r){[...t.elements].forEach((t=>{const{name:r,type:s,value:i,files:n}=t;if("file"===s)e[r]=n[0];else if("checkbox"===s||"radio"===s)t.checked&&(e[r]=i);else if(t.multiple){const s=[];t.querySelectorAll("option").forEach((t=>t.selected&&s.push(t.value))),e[r]=s.length<2?s[0]:s}else e[r]=i}))}return e};var d=f,m=y;const g=(t,r)=>{if(t&&t.value&&!t.value.__ku4wired__)try{const s=t.value,{submit:i}=s;s.submit=async()=>{const n=d(t.value),a=m(t.value),o=await r(n,a,s);e.isFalse(o)||i.call(t.value)},s.__ku4wired__=!0}catch(t){throw new Error("wireForm Error. See https://kodmunki.com/storybook/?path=/docs/form-ku4-form--basic for more information.")}};export{g as wireForm};
@@ -1 +0,0 @@
1
- import{R}from"./index-adc31e97.js";var uid=function(){return function(){R.uid()}()};export{uid as u};
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,s){function a(t){try{o(n.next(t))}catch(e){s(e)}}function u(t){try{o(n["throw"](t))}catch(e){s(e)}}function o(t){t.done?i(t.value):r(t.value).then(a,u)}o((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(e){return o([t,e])}}function o(a){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(u){a=[6,u];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-8e03322a.system.js","./p-e9482cb1.system.js"],(function(t){"use strict";var e,i,n,r,s,a,u,o,l;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;s=t.g},function(t){a=t.t;u=t.h;o=t.Y;l=t.R}],execute:function(){var h=function(t,e,i,n){return i?i.some((function(t){return t===e}))&&(t||[]).every((function(t){return t.test(e)})):n?n.value===e&&(t||[]).every((function(t){return t.test(e)})):(t||[]).every((function(t){return t.test(e)}))};var c=":host{visibility:hidden !important}:host([invalid]){visibility:visible !important}:host([disabled]){visibility:hidden !important}:host([invalid][disabled]){visibility:hidden !important}:host([invalid][hidden]){visibility:hidden !important}";var d=t("ku4_validation",function(){function t(t){e(this,t);this.didValidate=i(this,"validate",7);this.pattern=".*";this.flags="";this.method="";var n=this.pattern.split(" ");var r=this.flags.split(" ");var s=a.isString(this.method)?this.method.trim():this.method;this.regex=n.map((function(t,e){return new RegExp(t,r[e])}));this.validationMethod=a.isNullOrEmpty(s)?function(){return true}:a.isString(s)?new Function("value, values",/^return/.test(s)?s:"return ".concat(s)):a.isFunction(s)?s:function(){return true};this.handleInput=this.handleInput.bind(this);this.handleChange=this.handleChange.bind(this);this.handleBlur=this.handleBlur.bind(this);this.handleReset=this.handleReset.bind(this)}t.prototype.validate=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.assert()];case 1:return[2,t.sent()]}}))}))};t.prototype.handleInput=function(t){var e=t.target;return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:t=e.type==="file"||a.isFalse(this.isValid);if(!t)return[3,2];return[4,this.assert()];case 1:t=i.sent();i.label=2;case 2:t;return[2]}}))}))};t.prototype.handleChange=function(t){var e=t.target;return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){switch(i.label){case 0:t=e.type==="file"||a.isFalse(this.isValid);if(!t)return[3,2];return[4,this.assert()];case 1:t=i.sent();i.label=2;case 2:t;return[2]}}))}))};t.prototype.handleBlur=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.assert()];case 1:t.sent();return[2]}}))}))};t.prototype.handleReset=function(){this.isValid=true;this.invalid=!this.isValid;this.input&&this.input.setAttribute("aria-invalid",this.invalid)};t.prototype.assert=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i,n,r,s,o,l,c,d,f,v,p;var b=this;return __generator(this,(function(m){switch(m.label){case 0:t=this,e=t.ele,i=t.validOptions,n=t.inputs,r=t.input,s=t.regex,o=t.checked;l=this.isValid;return[4,u.async((function(){return __awaiter(b,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,this.ku4Form.read()];case 1:return[2,t.sent()]}}))}))}),{})];case 1:c=m.sent();if(!!this.disabled)return[3,8];d=function(t){return __awaiter(b,void 0,void 0,(function(){var n,r,u;return __generator(this,(function(l){switch(l.label){case 0:if(t.type==="file"&&a.isNullOrEmpty(t.value)){return[2,true]}if(!a.isBool(o))return[3,1];r=t.checked===o;return[3,4];case 1:u=h(s,t.value,i,e);if(!u)return[3,3];return[4,this.validationMethod(t.value,c)];case 2:u=l.sent();l.label=3;case 3:r=u;l.label=4;case 4:n=r;t.setAttribute("aria-invalid",!n);return[2,n]}}))}))};f=this;if(!n)return[3,3];return[4,Promise.all(n.map((function(t){return d(t)})))];case 2:v=!m.sent().some((function(t){return!t}));return[3,7];case 3:if(!r)return[3,5];return[4,d(r)];case 4:p=m.sent();return[3,6];case 5:p=true;m.label=6;case 6:v=p;m.label=7;case 7:f.isValid=v;return[3,9];case 8:this.isValid=true;m.label=9;case 9:if(a.isFalse(l)&&this.isValid){this.didValidate.emit(this.isValid)}this.invalid=!this.isValid;return[2,this.isValid]}}))}))};t.prototype.componentWillLoad=function(){var t=this;var e=this.for.replace(/\s/g,"").replace(/,/g,",#");this.inputs=/,/.test(this.for)&&Array.from(document.querySelectorAll("#".concat(e)));this.input=!/,/.test(this.for)&&document.getElementById(this.for);this.ele=document.getElementById(this.element)||document.querySelector(this.element);this.validOptions=a.exists(this.values)?this.values.split(","):this.ele&&this.ele.nodeName==="DATALIST"&&[].slice.call(this.ele.querySelectorAll("option")).map((function(t){return t.value}));if(a.isFunction(this.host.closest)){this.ku4Form=this.host.closest("ku4-form");this.form=this.host.closest("form");if(this.form&&this.form.addEventListener){this.form.addEventListener("reset",this.handleReset)}}if(this.inputs){o(0).then((function(){t.inputs.forEach((function(e){e.addEventListener("input",t.handleInput);e.addEventListener("change",t.handleChange);e.addEventListener("blur",t.handleBlur)}))}))}else if(this.input){var i=this.input.getAttribute("aria-describedby");var n=this.host.getAttribute("id")||l.uid();this.host.setAttribute("id",n);if(a.isNullOrEmpty(i)){this.input.setAttribute("aria-describedby",n)}o(0).then((function(){t.input.addEventListener("input",t.handleInput);t.input.addEventListener("change",t.handleChange);t.input.addEventListener("blur",t.handleBlur)}))}else{console.error("ku4-validation must have a valid `for` referencing target field `id`.")}};t.prototype.disconnectedCallback=function(){var t=this;if(this.inputs){this.inputs.forEach((function(e){if(e&&e.removeEventListener){e.removeEventListener("input",t.handleInput);e.removeEventListener("change",t.handleChange);e.removeEventListener("blur",t.handleBlur)}}))}if(this.input&&this.input.removeEventListener){this.input.removeEventListener("input",this.handleInput);this.input.removeEventListener("change",this.handleChange);this.input.removeEventListener("blur",this.handleBlur)}if(this.form&&this.form.removeEventListener){this.form.removeEventListener("reset",this.handleReset)}};t.prototype.render=function(){return n(r,{role:"alert","aria-live":"assertive"},n("slot",null))};Object.defineProperty(t.prototype,"host",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());d.style=c}}}));
@@ -1 +0,0 @@
1
- import{r as s,h as t,H as i}from"./p-f134bec3.js";const a=class{constructor(t){s(this,t),this.classList=""}async slideIn(s){this.active=!0,this.classList=`active ${s}`}async slideOut(s){this.active=!1,this.classList=`inactive ${s}`}async activate(){this.active=!0,this.classList="active"}async deactivate(){this.active=!1,this.classList=""}render(){const{active:s,classList:a}=this;return t(i,{class:`${a}`,"aria-hidden":s?"false":"true","aria-roledescription":"slide"},t("slot",null))}};a.style=":host{overflow-x:hidden}";export{a as ku4_carousel_slide}
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,o,e,i){function n(t){return t instanceof e?t:new e((function(o){o(t)}))}return new(e||(e=Promise))((function(e,r){function s(t){try{h(i.next(t))}catch(o){r(o)}}function a(t){try{h(i["throw"](t))}catch(o){r(o)}}function h(t){t.done?e(t.value):n(t.value).then(s,a)}h((i=i.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(o){return h([t,o])}}function h(s){if(i)throw new TypeError("Generator is already executing.");while(e)try{if(i=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=o.call(t,e)}catch(a){s=[6,a];n=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-8e03322a.system.js","./p-e9482cb1.system.js"],(function(t){"use strict";var o,e,i,n,r,s,a;return{setters:[function(t){o=t.r;e=t.h;i=t.H;n=t.g},function(t){r=t.C;s=t.j;a=t.M}],execute:function(){var h=":host{position:fixed;display:none;opacity:0;z-index:2;background-color:#fff;border:solid 1px #ccc}:host([visible]){display:block;opacity:1;-webkit-transition:opacity 0.4s;transition:opacity 0.4s}:host .arrow{position:absolute;width:var(--ku4-tooltip-arrow-size, 14px);height:var(--ku4-tooltip-arrow-size, 14px);background-color:inherit;-webkit-transform:rotate(45deg);transform:rotate(45deg);border:inherit;-webkit-box-shadow:var(--ku4-tooltip-arrow-box-shadow, none);box-shadow:var(--ku4-tooltip-arrow-box-shadow, none)}:host .content{position:relative}:host([top]) .arrow{top:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));left:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));border-top:none !important;border-left:none !important}:host([left]) .arrow{top:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));left:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));border-left:none !important;border-bottom:none !important}:host([bottom]) .arrow{left:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));bottom:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));border-bottom:none !important;border-right:none !important}:host([right]) .arrow{top:calc(50% - var(--ku4-tooltip-arrow-offset, 7px));right:calc(100% - var(--ku4-tooltip-arrow-offset, 7px));border-top:none !important;border-right:none !important}";var l=t("ku4_tooltip",function(){function t(t){o(this,t);this.isShowing=false;this.show=this.show.bind(this);this.hide=this.hide.bind(this);this._show=this._show.bind(this);this._hide=this._hide.bind(this);this._toggle=this._toggle.bind(this);this.hideTimeout=new r(200).onTimeout(this._hide)}t.prototype.show=function(t){return __awaiter(this,void 0,void 0,(function(){var o=this;return __generator(this,(function(e){this.hideTimeout.clear();if(this.host.contains(t)){return[2]}else{this.isShowing=true;this.host.setAttribute("visible","true");this.calcualatePosition(t);this.scrollListener=s((function(){return o.calcualatePosition(t)}));window.addEventListener("scroll",this.scrollListener,{passive:true})}return[2]}))}))};t.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.hideTimeout.clear().start();return[2]}))}))};t.prototype._show=function(t){this.show(t.target)};t.prototype._hide=function(){window.removeEventListener("scroll",this.scrollListener);this.host.removeAttribute("visible");this.isShowing=false};t.prototype._toggle=function(t){this.isShowing?this._hide():this._show(t)};t.prototype.calcualatePosition=function(t){var o=t.getBoundingClientRect(),e=o.left,i=o.top,n=o.width,r=o.height;var s=this.host.getBoundingClientRect(),h=s.left,l=s.top,c=s.width,u=s.height;var p=new a(e,i,n,r);var f=new a(h,l,c,u);if(this.top){this.host.style.left="".concat(p.origin.x+p.dimensions.x/2-f.dimensions.x/2,"px");this.host.style.top="".concat(p.origin.y-f.dimensions.y-15,"px")}else if(this.left){this.host.style.left="".concat(p.origin.x-f.dimensions.x-15,"px");this.host.style.top="".concat(p.origin.y+p.dimensions.y/2-f.dimensions.y/2,"px")}else if(this.bottom){this.host.style.left="".concat(p.origin.x+p.dimensions.x/2-f.dimensions.x/2,"px");this.host.style.top="".concat(p.origin.y+p.dimensions.y+15,"px")}else if(this.right){this.host.style.left="".concat(p.origin.x+p.dimensions.x+15,"px");this.host.style.top="".concat(p.origin.y+p.dimensions.y/2-f.dimensions.y/2,"px")}else{this.host.style.left="".concat(p.origin.x+p.dimensions.x/2-f.dimensions.x/2,"px");this.host.style.top="".concat(p.origin.y+p.dimensions.y+15,"px")}};t.prototype.componentWillLoad=function(){var t=this;var o=this,e=o.debug,i=o.element,n=o.host,r=o.top,s=o.left,a=o.bottom,h=o.right;if(!(r||s||a||h)){this.host.setAttribute("bottom","")}document.querySelectorAll(i).forEach((function(o){n.addEventListener("mouseover",t._show);o.addEventListener("mouseover",t._show);o.addEventListener("touchstart",t._toggle,{passive:true});if(e){return}n.addEventListener("mouseout",t.hide);o.addEventListener("mouseout",t.hide)}))};t.prototype.disconnectedCallback=function(){var t=this;var o=this,e=o.debug,i=o.element,n=o.hideTimeout,r=o.host;document.querySelectorAll(i).forEach((function(o){r.removeEventListener("mouseover",t._show);o.removeEventListener("mouseover",t._show);o.removeEventListener("touchstart",t._toggle);if(e){return}r.removeEventListener("mouseout",t.hide);o.removeEventListener("mouseout",t.hide)}));n.clear()};t.prototype.render=function(){return e(i,{role:"tooltip"},e("div",{class:"arrow"}),e("div",{class:"content"},e("slot",null)))};Object.defineProperty(t.prototype,"host",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());l.style=h}}}));
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function a(t){try{s(n.next(t))}catch(e){o(e)}}function u(t){try{s(n["throw"](t))}catch(e){o(e)}}function s(t){t.done?i(t.value):r(t.value).then(a,u)}s((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(e){return s([t,e])}}function s(a){if(n)throw new TypeError("Generator is already executing.");while(i)try{if(n=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=e.call(t,i)}catch(u){a=[6,u];r=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-8e03322a.system.js","./p-e9482cb1.system.js","./p-c7ab12de.system.js"],(function(t){"use strict";var e,i,n,r,o,a,u,s;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.g},function(t){o=t.Y;a=t.o;u=t.t},function(t){s=t.i}],execute:function(){var c=t("ku4_form",function(){function t(t){e(this,t);this.didValidate=i(this,"validate",7);this.validate=this.validate.bind(this);this.handleReset=this.handleReset.bind(this)}t.prototype.listFieldNames=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,s.readFieldNames(this.form)]}))}))};t.prototype.validate=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,i;var n=this;return __generator(this,(function(r){switch(r.label){case 0:t=this.fields;e=t.map((function(t){return t.validate()}));i=this;return[4,Promise.all(e).then((function(t){return!t.some((function(t){return t===false}))}))];case 1:i.isValid=r.sent();this.valid=this.isValid;this.invalid=!this.isValid;return[4,o(100).then((function(){var t=[].slice.call(n.form.querySelectorAll("ku4-validation[invalid]"));var e=[].slice.call(document.querySelectorAll('[form="'.concat(n.form.id,'"]')));var i=e.map((function(t){return document.querySelector('ku4-validation[invalid][for="'.concat(t.id,'"]'))}));var r=[].slice.call(document.querySelectorAll('ku4-validation[invalid][form="'.concat(n.form.id,'"]')));return a(t.concat(i).concat(r).filter((function(t){return u.exists(t)})))})).then((function(t){return n.didValidate.emit({invalid:t})}))];case 2:r.sent();return[2,this.isValid]}}))}))};t.prototype.invalidate=function(t){return __awaiter(this,void 0,void 0,(function(){var e;var i=this;return __generator(this,(function(n){if(u.isArray(t)){t.forEach((function(t){var e=i.fields.find((function(e){return e.for===t}));if(e){e.invalid=true}}))}else{e=this.fields.find((function(e){return e.for===t}));if(e){e.invalid=true}}this.isValid=false;this.valid=this.isValid;this.invalid=!this.isValid;return[2,this]}))}))};t.prototype.read=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,s.read(this.form)]}))}))};t.prototype.write=function(t){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){s.write(this.form,t);Object.keys(t).forEach((function(t){try{e.form.querySelector('[name="'.concat(t,'"]')).dispatchEvent(new window.Event("change"))}catch(i){}}));return[2,this]}))}))};t.prototype.focusFirstInvalid=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){o(100).then((function(){var t=document.querySelector("ku4-valiation[invalid]");if(u.exists(t)){t.scrollIntoView({behavior:"smooth",block:"center"})}}));return[2]}))}))};Object.defineProperty(t.prototype,"form",{get:function(){return this.host.querySelector("form")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"fields",{get:function(){var t=[].slice.call(this.form.querySelectorAll("ku4-validation"));var e=[].slice.call(document.querySelectorAll('[form="'.concat(this.form.id,'"]')));var i=e.map((function(t){return document.querySelector('ku4-validation[for="'.concat(t.id,'"]'))}));var n=[].slice.call(document.querySelectorAll('ku4-validation[form="'.concat(this.form.id,'"]')));return a(t.concat(i).concat(n).filter((function(t){return u.exists(t)})))},enumerable:false,configurable:true});t.prototype.handleReset=function(){this.isValid=true;this.valid=this.isValid;this.invalid=!this.isValid};t.prototype.componentWillLoad=function(){var t=this;var e=this.form;if(u.exists(e)){var i=e.onsubmit||function(){};e.onsubmit=function(n){n.preventDefault();t.validate().then((function(t){return t&&i.call(e,n)})).then((function(t){return!u.isFalse(t)&&e.submit()}));return false};e.addEventListener("reset",this.handleReset);this.fields.forEach((function(e){return e.addEventListener("validated",t.validate)}))}};t.prototype.disconnectedCallback=function(){var t=this;var e=this.form;if(u.exists(e)){e.removeEventListener("reset",this.handleReset);this.fields.forEach((function(e){return e.removeEventListener("validated",t.validate)}))}};t.prototype.render=function(){return n("slot",null)};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}())}}}));
@@ -1 +0,0 @@
1
- import{r as t,h as i,H as s,g as n}from"./p-f134bec3.js";import{u as e}from"./p-8091c9a5.js";import"./p-54fb5b7d.js";const a=class{constructor(i){t(this,i),this.selected=!1,this.maxHeight=this.selected?"none":"0px"}handleTransitionEnd(){this.maxHeight=this.selected?"none":"0px"}async select(){this.selected||(this.selected=!0,this.hasTransition?this.maxHeight=`${this.host.scrollHeight}px`:this.handleTransitionEnd())}async deselect(){this.selected&&(this.selected=!1,this.host.style.maxHeight=`${this.host.scrollHeight}px`,this.hasTransition?this.maxHeight="0px":this.handleTransitionEnd())}async connect(t){t.$assignPanel(this),this.tab=t}get hasTransition(){const t=window.getComputedStyle(this.host).getPropertyValue("transition");return!/none/.test(t)}render(){const{selected:t,tab:n,maxHeight:a}=this;return i(s,{role:"tabpanel",id:this.host.id||e(),"aria-hidden":t?"false":"true","aria-labelledby":n&&n.id,tabIndex:t?0:-1,style:{maxHeight:a}},i("slot",null))}get host(){return n(this)}};a.style=":host{-webkit-backface-visibility:hidden;display:block;width:100%;height:auto;max-height:0;-webkit-transition:max-height 0.4s, padding 0.6s;transition:max-height 0.4s, padding 0.6s;overflow:auto}@media only screen and (min-width: 768px){:host{display:none;border-top:1px solid #ccc;border-bottom:1px solid #ccc;max-height:initial !important;-webkit-transition:none;transition:none;-ms-flex-order:2;order:2}:host([selected]){display:block;max-height:initial !important;-webkit-transition:none;transition:none}}";export{a as ku4_tab_panel}
@@ -1 +0,0 @@
1
- import{r as t,h as s}from"./p-f134bec3.js";import{a as i,Y as e,t as h}from"./p-54fb5b7d.js";const n=class{constructor(s){t(this,s),this.charIndexes=[],this.reverseCharIndexes=[],this.previousValue="",this.currentValue="",this.touchStart=!1,this.template="",this.ban="",this.pattern="",this.char="_",this.hidden=!1,this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleInput=this.handleInput.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.init()}init(){this.chars=this.char&&new RegExp(this.char),this.banned=this.ban&&new RegExp(this.ban);const t=this.pattern.replace(/[\s\n]/gm,"");return this.patterns=t.substring(1).split(t[0]).map((t=>{try{return t&&new RegExp(t)||null}catch(s){}})),this.charIndexes=this.template.split("").reduce(((t,s,i)=>(this.chars.test(s)&&t.push(i),t)),[]),this.reverseCharIndexes=[...this.charIndexes].reverse(),this}templateHandler(t,s){const{input:e,previousCharIndex:h,previousValue:n,currentValue:r,value:a,char:o}=this,c=i.unmask(n,s,o).length<i.unmask(r,s,o).length?h+1:h;this.init().value=i.mask(i.unmask(a,s,o),t,o),e.setSelectionRange(c,c)}charHandler(t,s){const{value:e,template:h}=this;this.init().value=i.mask(i.unmask(e,h,s),h,t)}get previousCharIndex(){return this.reverseCharIndexes.find((t=>this.selectionStart>t))||this.charIndexes[0]}get value(){return this.currentValue}set value(t){const{chars:s,hidden:i,input:e}=this,h=t.search(s);this.currentValue=t,e.value=i&&h>-1?t.substring(0,h):t}handleTouchStart(){this.touchStart=!0}handleFocus(){if(window.document.documentMode)return;const{input:t,template:s,char:h,chars:n,touchStart:r}=this,a=i.unmask(t.value,s,h),o=i.unmask(this.value,s,h);this.value=i.mask(a!==o?a:o,s,h),e(0).then((()=>{const s=t.value.search(n),i=s<0?t.value.length:s;this.input.setSelectionRange(s<0&&!r?0:i,i),this.touchStart=!1}))}handleBlur(){const{template:t,char:s}=this;h.isEmpty(i.unmask(this.value,t,s))&&(this.value="")}handleKeyDown(t){if(window.document.documentMode)return;const{banned:s,hidden:e,template:h,char:n}=this;t.key&&1===t.key.length&&s&&s.test(t.key)&&!(t.altKey||t.ctrlKey||t.metaKey)&&t.preventDefault(),this.previousValue=e?i.mask(i.unmask(t.target.value,h,n),h,n):t.target.value,this.selectionStart=t.target.selectionStart,this.selectionEnd=t.target.selectionEnd}handleInput(t){if(window.document.documentMode)return;const{input:s,template:e,char:n,chars:r,previousValue:a,banned:o,selectionStart:c,selectionEnd:l,previousCharIndex:u,patterns:d,charIndexes:p,reverseCharIndexes:f}=this;if(r.test(this.previousValue)||"input"===t.type&&!t.inputType||"insertFromPaste"===t.inputType||"deleteContentBackward"===t.inputType||"deleteContentForward"===t.inputType||"deleteByCut"===t.inputType||c!==l){if("insertFromPaste"===t.inputType)try{return navigator.clipboard.readText().then((t=>{const u=i.unmask(t,e,n).replace(new RegExp(o,"g"),"");if(h.isNullOrEmpty(u))return this.value=a,void s.setSelectionRange(c,c);if(!o||!o.test(u)){let t=a;if(c<l){const s=f.find((t=>t<=c-1)),h=f.find((t=>t<=l-1)),r=p.findIndex((t=>t===s)),o=p.findIndex((t=>t===h)),u=i.unmask(a,e,n),d=u.substring(0,r+1)+u.substring(o+1,a.length);t=i.mask(d,e,n)}const h=p.find((t=>t>=c)),o=p.findIndex((t=>t===h)),d=i.unmask(t,e,n);t=d.substring(0,o)+u+d.substring(o,a.length),this.value=i.mask(t,e,n);const v=p[o+u.length]||this.value.search(r)||this.value.length;s.setSelectionRange(v,v)}})),this.value=a,void s.setSelectionRange(c,c)}catch(t){return this.value=a,void s.setSelectionRange(c,c)}if("deleteContentBackward"!==t.inputType&&"deleteByCut"!==t.inputType){if("deleteContentForward"===t.inputType){const t=p.find((t=>t>=c)),h=p.findIndex((s=>s===t)),r=i.unmask(a,e,n),o=r.substring(0,h)+r.substring(h+1,a.length);return this.value=i.mask(o,e,n),void s.setSelectionRange(c,c)}if(!(t.altKey||t.ctrlKey||t.metaKey))if(t.data)if(r.test(a.charAt(c))||c===e.length){const h=i.unmask(a,e,n);this.value=i.mask(h+t.data,e,n);const o=this.value.search(r),c=o<0?e.length:o;s.setSelectionRange(c,c);const l=p.findIndex((t=>t>=c));this.validate(t.data,d[l<0?p.length-1:l-1])}else{let h=a;if(c<l){const t=f.find((t=>t<=c-1)),s=f.find((t=>t<=l-1)),r=p.findIndex((s=>s===t)),o=p.findIndex((t=>t===s)),u=i.unmask(a,e,n),d=u.substring(0,r+1)+u.substring(o+1,a.length);h=i.mask(d,e,n)}const r=p.find((t=>t>=c)),o=p.findIndex((t=>t===r)),u=i.unmask(h,e,n);h=u.substring(0,o)+t.data+u.substring(o,a.length);const v=p.find((t=>t>r));this.value=i.mask(h,e,n),s.setSelectionRange(v,v);const m=p.findIndex((t=>t>=v));this.validate(t.data,d[m<0?p.length-1:m-1])}else if("input"!==t.type||t.inputType)this.value=a,s.setSelectionRange(c,c);else{const{value:s}=t.target,h=p.find((t=>t>=c)),r=p.findIndex((t=>t===h)),a=i.unmask(s,e,n),l=s.replace(new RegExp(o,"g"),""),u=a.substring(0,r)+l,f=p.find((t=>t>h)),v=p.findIndex((t=>t>=f)),m=v<0?p.length-1:v-1;this.value=i.mask(u,e,n),this.validate(u,d[m])}}else{const t=f.find((t=>t<=c-1)),h=f.find((t=>t<=l-1)),r=p.findIndex((s=>s===t)),o=p.findIndex((t=>t===h)),d=i.unmask(a,e,n);if(r<o){const t=d.substring(0,r+1)+d.substring(o+1,a.length);this.value=i.mask(t,e,n),t&&r>-1?s.setSelectionRange(u+1,u+1):s.setSelectionRange(u,u)}else{const t=d.substring(0,r)+d.substring(o+1,a.length);this.value=i.mask(t,e,n),s.setSelectionRange(u,u)}}}else this.value=a}validate(t,s){const{previousValue:i,input:e,value:n,selectionStart:r}=this;h.exists(s)&&!(s.test(t)||/\(\?[!<=]/.test(s.toString())&&s.test(n))&&(this.value=i,e.setSelectionRange(r,r))}componentWillLoad(){this.input=document.getElementById(this.for),h.exists(this.input)?(this.input.addEventListener("focus",this.handleFocus),this.input.addEventListener("blur",this.handleBlur),this.input.addEventListener("keydown",this.handleKeyDown),this.input.addEventListener("input",this.handleInput),this.input.addEventListener("ku4-mask-input",this.handleInput),this.input.addEventListener("touchstart",this.handleTouchStart,{passive:!0})):console.error("ku4-mask must have a valid `for` referencing target field `id`.")}disconnectedCallback(){this.input&&this.input.removeEventListener&&(this.input.removeEventListener("focus",this.handleFocus),this.input.removeEventListener("blur",this.handleBlur),this.input.removeEventListener("keydown",this.handleKeyDown),this.input.removeEventListener("input",this.handleInput),this.input.removeEventListener("touchstart",this.handleTouchStart,{passive:!0}))}render(){return s("slot",null)}static get watchers(){return{template:["templateHandler"],char:["charHandler"]}}};n.style=":host{display:none}";export{n as ku4_mask}
@@ -1 +0,0 @@
1
- import{r as t,h as s,g as i}from"./p-f134bec3.js";import{t as h,o as e}from"./p-54fb5b7d.js";import{E as n,K as a}from"./p-5d8e9dd5.js";const r=(t,s)=>{t.forEach(s?t=>{t.currentAriaHidden=t.getAttribute("aria-hidden"),t.setAttribute("aria-hidden",s)}:t=>{t.currentAriaHidden?t.setAttribute("aria-hidden",t.currentAriaHidden):t.removeAttribute("aria-hidden")})},o=["A","BUTTON","INPUT","SELECT","TEXTAREA"],c=t=>[].slice.call(t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')),{tab:d}=a,u=a.tab.shift,p=a.tab.alt,l=a.tab.alt.shift,w=class{constructor(s){t(this,s),this.iframes=[],this.active=!1,this.handleKeyDown=this.handleKeyDown.bind(this),this.handleKeyUp=this.handleKeyUp.bind(this),this.handleMouse=this.handleMouse.bind(this)}activeHandler(t){t?this.handleActivate():this.handleDeactivate()}async activate(t){this.lastActiveElement=t||document.querySelector(this.return||null),this.active=!0}async deactivate(){this.active=!1}handleActivate(){this.lastActiveElement=this.lastActiveElement||document.activeElement,this.lastActiveElement&&this.lastActiveElement.blur&&this.lastActiveElement.blur(),this.addEventListeners(this.elements),r(this.outerElements,!0),window.requestAnimationFrame((()=>{const t=document.querySelector(this.initial||null)||this.focusableElements[0]||this.trapElements[0];t.blur(),t.focus(),this.activateTraps()}))}handleDeactivate(){this.removeEventListeners(this.elements),this.deactivateTraps(),r(this.outerElements),this.lastActiveElement&&this.lastActiveElement.focus&&this.lastActiveElement.focus(),this.lastActiveElement=null}handleKeyDown(t){if(u.didFire(t)||l.didFire(t))try{if(this.iframes.length>0&&(this.trapElements[1]===t.target||!h.isNull(t.target.getAttribute("ku4-focus-wrap"))||this.iframes.some((s=>s.contains(t.target)))))return;if(this.trapElements[0]===t.target)return this.trapElements[1].focus(),n.mute(t);const s=this.focusableElements.indexOf(t.target)-1;return this.focusableElements[s<0?this.focusableElements.length-1:s].focus(),n.mute(t)}catch(t){return n.mute(t)}if(d.didFire(t)||p.didFire(t))try{if(this.iframes.length>0&&(this.trapElements[0]===t.target||!h.isNull(t.target.getAttribute("ku4-focus-wrap"))||this.iframes.some((s=>s.contains(t.target)))))return;if(this.trapElements[1]===t.target)return this.trapElements[0].focus(),n.mute(t);const s=this.focusableElements.indexOf(t.target)+1;return this.focusableElements[s>=this.focusableElements.length?0:s].focus(),n.mute(t)}catch(t){return n.mute(t)}}handleKeyUp(t){const s=this.trapElements.indexOf(t.target);return 0===s&&(u.didFire(t)||l.didFire(t))?((this.focusableElements[this.focusableElements.length-1]||this.trapElements[1]).focus(),n.mute(t)):1===s&&(d.didFire(t)||p.didFire(t))?((this.focusableElements[0]||this.trapElements[0]).focus(),n.mute(t)):void 0}handleMouse(t){this.elements.some((s=>s===t.target))||n.mute(t)}addEventListeners(t){t.forEach((t=>t.addEventListener("keydown",this.handleKeyDown,{passive:!0}))),t.forEach((t=>t.addEventListener("keyup",this.handleKeyUp,{passive:!0}))),window.addEventListener("click",this.handleMouse,{passive:!0}),window.addEventListener("mousedown",this.handleMouse,{passive:!0}),window.addEventListener("mouseup",this.handleMouse,{passive:!0}),window.addEventListener("touchstart",this.handleMouse,{passive:!0})}removeEventListeners(t){t.forEach((t=>t.removeEventListener("keydown",this.handleKeyDown))),t.forEach((t=>t.removeEventListener("keyup",this.handleKeyUp))),window.removeEventListener("click",this.handleMouse),window.removeEventListener("mousedown",this.handleMouse),window.removeEventListener("mouseup",this.handleMouse),window.addEventListener("touchstart",this.handleMouse,{passive:!0})}activateTraps(){this.setTraps(0)}deactivateTraps(){this.setTraps(-1)}setTraps(t){[].slice.call(this.host.querySelectorAll("[ku4-focus-trap], [ku4-focus-wrap]")).forEach((s=>s.setAttribute("tabindex",t)))}wrap(t){const s=document.createDocumentFragment();s.appendChild(this.createWrapTag()),s.appendChild(t.cloneNode()),s.appendChild(this.createWrapTag()),t.parentNode.replaceChild(s,t)}createTrapTag(){return this.createTag("ku4-focus-trap")}createWrapTag(){return this.createTag("ku4-focus-wrap")}createTag(t){const s=document.createElement("button");return s.setAttribute(t,""),s.setAttribute("tabindex","0"),s.setAttribute("aria-hidden","true"),s.style.position="static",s.style.display="block",s.style.width="0",s.style.height="0",s.style.margin="0",s.style.padding="0",s.style.border="none",s.style.outline="none",s}initialize(){const t=[].slice.call(this.host.querySelectorAll("*")),s=[].slice.call(document.querySelectorAll(this.include||null)||[]),i=[].slice.call(document.querySelectorAll(this.exclude)||[]);let n=[];var a;(this.excludeShadow||"").split(",").forEach((t=>{if(!h.isNullOrEmpty(t))try{const s=t.trim().replace(/\s/,"|").split("|"),i=document.querySelector(s[0]).shadowRoot.querySelectorAll(s[1]);n=n.concat([].slice.call(i||[]))}catch(s){console.error("Invalid shadow selector",t)}})),this.iframes=[].slice.call(this.host.querySelectorAll("iframe")||[]),this.iframes.forEach((t=>this.wrap(t))),this.elements=e([...(a=this.host,[].slice.call(a.querySelectorAll(':not([tabindex="-1"])'))),...s]),this.focusableElements=this.elements.reduce(((t,s)=>((t=>{const s=t.getAttribute("tabindex");return(o.includes(t.tagName.toUpperCase())||t.getAttribute("href"))&&(!s||isNaN(s)||parseInt(s)>-1)})(s)&&!this.trapElements.includes(s)&&t.push(s),t)),[]),this.outerElements=[...c(document.body),...i,...n].filter((i=>!(i===this.host||t.includes(i)||s.includes(i))))}componentDidLoad(){const t=this.createTrapTag(),s=this.createTrapTag();this.trapElements=[t,s],this.host.insertBefore(t,this.host.firstChild),this.host.appendChild(s),this.initialize(),this.active?this.handleActivate():this.handleDeactivate()}disconnectedCallback(){this.active&&this.handleDeactivate()}render(){return s("slot",null)}get host(){return i(this)}static get watchers(){return{active:["activeHandler"]}}};w.style=":host{position:static}";export{w as ku4_focus_trap}