@verdocs/web-sdk 2.3.15 → 2.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/cjs/TemplateFieldStore-7449e5ff.js +24 -0
  2. package/dist/cjs/{TemplateStore-17b9fdfe.js → TemplateStore-0074c71d.js} +2 -0
  3. package/dist/cjs/interact.min-a61b43b3.js +12 -0
  4. package/dist/cjs/ipc-test.cjs.entry.js +2 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/verdocs-build.cjs.entry.js +2 -1
  7. package/dist/cjs/verdocs-button-panel_2.cjs.entry.js +60 -43
  8. package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-field-textbox.cjs.entry.js +11 -2
  10. package/dist/cjs/verdocs-preview_8.cjs.entry.js +2 -1
  11. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +42 -38
  13. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  14. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +1 -1
  15. package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +27 -1
  16. package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +61 -44
  17. package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +40 -36
  18. package/dist/collection/utils/TemplateFieldStore.js +18 -0
  19. package/dist/collection/utils/TemplateStore.js +2 -0
  20. package/dist/components/TemplateStore.js +20 -1
  21. package/dist/components/interact.min.js +2 -2
  22. package/dist/components/verdocs-field-textbox.js +10 -1
  23. package/dist/components/verdocs-preview2.js +1 -1
  24. package/dist/components/verdocs-sign.js +1 -1
  25. package/dist/components/verdocs-template-field-properties2.js +61 -45
  26. package/dist/components/verdocs-template-fields2.js +40 -37
  27. package/dist/docs.json +18 -1
  28. package/dist/esm/TemplateFieldStore-4f1b6332.js +21 -0
  29. package/dist/esm/{TemplateStore-ad77a294.js → TemplateStore-a2ebdaca.js} +2 -0
  30. package/dist/esm/interact.min-6a7b19a1.js +10 -0
  31. package/dist/esm/ipc-test.entry.js +2 -1
  32. package/dist/esm/loader.js +1 -1
  33. package/dist/esm/verdocs-build.entry.js +2 -1
  34. package/dist/esm/verdocs-button-panel_2.entry.js +60 -43
  35. package/dist/esm/verdocs-field-textarea.entry.js +1 -1
  36. package/dist/esm/verdocs-field-textbox.entry.js +11 -2
  37. package/dist/esm/verdocs-preview_8.entry.js +2 -1
  38. package/dist/esm/verdocs-sign.entry.js +1 -1
  39. package/dist/esm/verdocs-template-fields_4.entry.js +42 -38
  40. package/dist/esm/verdocs-web-sdk.js +1 -1
  41. package/dist/esm-es5/TemplateFieldStore-4f1b6332.js +1 -0
  42. package/dist/esm-es5/TemplateStore-a2ebdaca.js +1 -0
  43. package/dist/esm-es5/interact.min-6a7b19a1.js +1 -0
  44. package/dist/esm-es5/ipc-test.entry.js +1 -1
  45. package/dist/esm-es5/loader.js +1 -1
  46. package/dist/esm-es5/verdocs-build.entry.js +1 -1
  47. package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -1
  48. package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
  49. package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
  50. package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
  51. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  52. package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
  53. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  54. package/dist/types/components/fields/verdocs-field-textbox/verdocs-field-textbox.d.ts +7 -0
  55. package/dist/types/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.d.ts +7 -5
  56. package/dist/types/components/templates/verdocs-template-fields/verdocs-template-fields.d.ts +4 -2
  57. package/dist/types/components.d.ts +8 -0
  58. package/dist/types/utils/TemplateFieldStore.d.ts +6 -0
  59. package/dist/types/utils/TemplateStore.d.ts +1 -1
  60. package/dist/verdocs-web-sdk/p-084c23e4.system.js +1 -0
  61. package/dist/verdocs-web-sdk/p-12d00a0f.entry.js +1 -0
  62. package/dist/verdocs-web-sdk/{p-b5eb8024.entry.js → p-319c00bd.entry.js} +1 -1
  63. package/dist/verdocs-web-sdk/p-32c40388.entry.js +1 -0
  64. package/dist/verdocs-web-sdk/p-358aef29.entry.js +1 -0
  65. package/dist/verdocs-web-sdk/p-3cd0d440.system.entry.js +1 -0
  66. package/dist/verdocs-web-sdk/p-429cad70.js +1 -0
  67. package/dist/verdocs-web-sdk/p-4e74bb3c.entry.js +1 -0
  68. package/dist/verdocs-web-sdk/p-588d6cea.system.entry.js +1 -0
  69. package/dist/verdocs-web-sdk/{p-b467d981.system.entry.js → p-5aa77f6d.system.entry.js} +1 -1
  70. package/dist/verdocs-web-sdk/p-5bf12ef8.entry.js +1 -0
  71. package/dist/verdocs-web-sdk/{p-062ca25f.system.entry.js → p-6685ff29.system.entry.js} +1 -1
  72. package/dist/verdocs-web-sdk/p-72978ba3.system.entry.js +1 -0
  73. package/dist/verdocs-web-sdk/{p-0c425f97.system.entry.js → p-736fbb87.system.entry.js} +1 -1
  74. package/dist/verdocs-web-sdk/p-8dc15d33.js +1 -0
  75. package/dist/verdocs-web-sdk/p-915883e6.js +1 -0
  76. package/dist/verdocs-web-sdk/p-a627881e.system.js +1 -0
  77. package/dist/verdocs-web-sdk/p-aae6b4e0.entry.js +1 -0
  78. package/dist/verdocs-web-sdk/{p-5645b8cd.entry.js → p-b91de346.entry.js} +1 -1
  79. package/dist/verdocs-web-sdk/p-bd9ba3b3.system.entry.js +1 -0
  80. package/dist/verdocs-web-sdk/p-e2ff37fb.system.js +1 -0
  81. package/dist/verdocs-web-sdk/p-e3ffc00f.system.entry.js +1 -0
  82. package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
  83. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  84. package/package.json +4 -4
  85. package/dist/cjs/interact.min-7c05ff8a.js +0 -12
  86. package/dist/custom-elements.json +0 -2067
  87. package/dist/esm/interact.min-ef5402f3.js +0 -10
  88. package/dist/esm-es5/TemplateStore-ad77a294.js +0 -1
  89. package/dist/esm-es5/interact.min-ef5402f3.js +0 -1
  90. package/dist/verdocs-web-sdk/p-746fce21.entry.js +0 -1
  91. package/dist/verdocs-web-sdk/p-79168c6a.system.entry.js +0 -1
  92. package/dist/verdocs-web-sdk/p-82b5e475.system.js +0 -1
  93. package/dist/verdocs-web-sdk/p-82d9fa84.system.entry.js +0 -1
  94. package/dist/verdocs-web-sdk/p-85df0da6.entry.js +0 -1
  95. package/dist/verdocs-web-sdk/p-8c0fafde.system.entry.js +0 -1
  96. package/dist/verdocs-web-sdk/p-999fbe79.js +0 -1
  97. package/dist/verdocs-web-sdk/p-9a5c0882.system.entry.js +0 -1
  98. package/dist/verdocs-web-sdk/p-9d2995a9.entry.js +0 -1
  99. package/dist/verdocs-web-sdk/p-b9443a01.entry.js +0 -1
  100. package/dist/verdocs-web-sdk/p-e760f894.entry.js +0 -1
  101. package/dist/verdocs-web-sdk/p-eda5691a.entry.js +0 -1
  102. package/dist/verdocs-web-sdk/p-f3dde708.js +0 -1
  103. package/dist/verdocs-web-sdk/p-fcd0a40a.system.js +0 -1
  104. package/dist/verdocs-web-sdk/p-fe67b620.system.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{c as t,a as n}from"./p-7d5dbd9a.js";var e=t((function(t){t.exports=function(){function n(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,i)}return e}function e(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?n(Object(i),!0).forEach((function(n){s(t,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))}))}return t}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function o(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,d(i.key),i)}}function a(t,n,e){return n&&o(t.prototype,n),e&&o(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,n,e){return(n=d(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function u(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&f(t,n)}function c(t){return(c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function f(t,n){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var e,i=c(t);if(n){var r=c(this).constructor;e=Reflect.construct(i,arguments,r)}else e=i.apply(this,arguments);return function(t,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}(this,e)}}function v(){return(v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,n,e){var i=function(t,n){for(;!Object.prototype.hasOwnProperty.call(t,n)&&null!==(t=c(t)););return t}(t,n);if(i){var r=Object.getOwnPropertyDescriptor(i,n);return r.get?r.get.call(arguments.length<3?t:e):r.value}}).apply(this,arguments)}function d(t){var n=function(t,n){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,n);if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof n?n:n+""}var p=function(t){return!(!t||!t.Window)&&t instanceof t.Window},y=void 0,g=void 0;function m(t){y=t;var n=t.document.createTextNode("");n.ownerDocument!==t.document&&"function"==typeof t.wrap&&t.wrap(n)===n&&(t=t.wrap(t)),g=t}function b(t){return p(t)?t:(t.ownerDocument||t).defaultView||g.window}"undefined"!=typeof window&&window&&m(window);var w=function(t){return!!t&&"object"===i(t)},x=function(t){return"function"==typeof t},k=function(t){return t===g||p(t)},M=function(t){return w(t)&&11===t.nodeType},E=w,T=x,O=function(t){return"number"==typeof t},S=function(t){return"boolean"==typeof t},z=function(t){return"string"==typeof t},I=function(t){if(!t||"object"!==i(t))return!1;var n=b(t)||g;return/object|function/.test("undefined"==typeof Element?"undefined":i(Element))?t instanceof Element||t instanceof n.Element:1===t.nodeType&&"string"==typeof t.nodeName},P=function(t){return w(t)&&!!t.constructor&&/function Object\b/.test(t.constructor.toString())},j=function(t){return w(t)&&void 0!==t.length&&x(t.splice)};function _(t){var n=t.interaction;if("drag"===n.prepared.name){var e=n.prepared.axis;"x"===e?(n.coords.cur.page.y=n.coords.start.page.y,n.coords.cur.client.y=n.coords.start.client.y,n.coords.velocity.client.y=0,n.coords.velocity.page.y=0):"y"===e&&(n.coords.cur.page.x=n.coords.start.page.x,n.coords.cur.client.x=n.coords.start.client.x,n.coords.velocity.client.x=0,n.coords.velocity.page.x=0)}}function D(t){var n=t.iEvent,e=t.interaction;if("drag"===e.prepared.name){var i=e.prepared.axis;if("x"===i||"y"===i){var r="x"===i?"y":"x";n.page[r]=e.coords.start.page[r],n.client[r]=e.coords.start.client[r],n.delta[r]=0}}}var R={id:"actions/drag",install:function(t){var n=t.actions,e=t.defaults;t.Interactable.prototype.draggable=R.draggable,n.map.drag=R,n.methodDict.drag="draggable",e.actions.drag=R.defaults},listeners:{"interactions:before-action-move":_,"interactions:action-resume":_,"interactions:action-move":D,"auto-start:check":function(t){var n=t.interaction,e=t.interactable,i=t.buttons,r=e.options.drag;if(r&&r.enabled&&(!n.pointerIsDown||!/mouse|pointer/.test(n.pointerType)||0!=(i&e.options.drag.mouseButtons)))return t.action={name:"drag",axis:"start"===r.lockAxis?r.startAxis:r.lockAxis},!1}},draggable:function(t){return E(t)?(this.options.drag.enabled=!1!==t.enabled,this.setPerAction("drag",t),this.setOnEvents("drag",t),/^(xy|x|y|start)$/.test(t.lockAxis)&&(this.options.drag.lockAxis=t.lockAxis),/^(xy|x|y)$/.test(t.startAxis)&&(this.options.drag.startAxis=t.startAxis),this):S(t)?(this.options.drag.enabled=t,this):this.options.drag},beforeMove:_,move:D,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(t){return 0===t.search("drag")}},A=R,C={init:function(t){var n=t;C.document=n.document,C.DocumentFragment=n.DocumentFragment||F,C.SVGElement=n.SVGElement||F,C.SVGSVGElement=n.SVGSVGElement||F,C.SVGElementInstance=n.SVGElementInstance||F,C.Element=n.Element||F,C.HTMLElement=n.HTMLElement||C.Element,C.Event=n.Event,C.Touch=n.Touch||F,C.PointerEvent=n.PointerEvent||n.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function F(){}var X=C,Y={init:function(t){var n=X.Element,e=t.navigator||{};Y.supportsTouch="ontouchstart"in t||T(t.DocumentTouch)&&X.document instanceof t.DocumentTouch,Y.supportsPointerEvent=!1!==e.pointerEnabled&&!!X.PointerEvent,Y.isIOS=/iP(hone|od|ad)/.test(e.platform),Y.isIOS7=/iP(hone|od|ad)/.test(e.platform)&&/OS 7[^\d]/.test(e.appVersion),Y.isIe9=/MSIE 9/.test(e.userAgent),Y.isOperaMobile="Opera"===e.appName&&Y.supportsTouch&&/Presto/.test(e.userAgent),Y.prefixedMatchesSelector="matches"in n.prototype?"matches":"webkitMatchesSelector"in n.prototype?"webkitMatchesSelector":"mozMatchesSelector"in n.prototype?"mozMatchesSelector":"oMatchesSelector"in n.prototype?"oMatchesSelector":"msMatchesSelector",Y.pEventTypes=Y.supportsPointerEvent?X.PointerEvent===t.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,Y.wheelEvent=X.document&&"onmousewheel"in X.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},$=Y;function L(t,n){if(t.contains)return t.contains(n);for(;n;){if(n===t)return!0;n=n.parentNode}return!1}function U(t,n){for(;I(t);){if(V(t,n))return t;t=N(t)}return null}function N(t){var n=t.parentNode;if(M(n)){for(;(n=n.host)&&M(n););return n}return n}function V(t,n){return g!==y&&(n=n.replace(/\/deep\//g," ")),t[$.prefixedMatchesSelector](n)}var B=function(t){return t.parentNode||t.host};function q(t,n){for(var e,i=[],r=t;(e=B(r))&&r!==n&&e!==r.ownerDocument;)i.unshift(r),r=e;return i}function G(t,n,e){for(;I(t);){if(V(t,n))return!0;if((t=N(t))===e)return V(t,n)}return!1}function K(t){return t.correspondingUseElement||t}function W(t){var n=t instanceof X.SVGElement?t.getBoundingClientRect():t.getClientRects()[0];return n&&{left:n.left,right:n.right,top:n.top,bottom:n.bottom,width:n.width||n.right-n.left,height:n.height||n.bottom-n.top}}function H(t){var n,e=W(t);if(!$.isIOS7&&e){var i={x:(n=(n=b(t))||g).scrollX||n.document.documentElement.scrollLeft,y:n.scrollY||n.document.documentElement.scrollTop};e.left+=i.x,e.right+=i.x,e.top+=i.y,e.bottom+=i.y}return e}function J(t){for(var n=[];t;)n.push(t),t=N(t);return n}function Q(t){return!!z(t)&&(X.document.querySelector(t),!0)}function Z(t,n){for(var e in n)t[e]=n[e];return t}function tt(t,n,e){return"parent"===t?N(e):"self"===t?n.getRect(e):U(e,t)}function nt(t,n,e,i){var r=t;return z(r)?r=tt(r,n,e):T(r)&&(r=r.apply(void 0,i)),I(r)&&(r=H(r)),r}function et(t){return t&&{x:"x"in t?t.x:t.left,y:"y"in t?t.y:t.top}}function it(t){return!t||"x"in t&&"y"in t||((t=Z({},t)).x=t.left||0,t.y=t.top||0,t.width=t.width||(t.right||0)-t.x,t.height=t.height||(t.bottom||0)-t.y),t}function rt(t,n,e){t.left&&(n.left+=e.x),t.right&&(n.right+=e.x),t.top&&(n.top+=e.y),t.bottom&&(n.bottom+=e.y),n.width=n.right-n.left,n.height=n.bottom-n.top}function ot(t,n,e){var i=e&&t.options[e];return et(nt(i&&i.origin||t.options.origin,t,n,[t&&n]))||{x:0,y:0}}function at(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},i=arguments.length>3?arguments[3]:void 0;if(i=i||{},z(t)&&-1!==t.search(" ")&&(t=st(t)),j(t))return t.forEach((function(t){return at(t,n,e,i)})),i;if(E(t)&&(n=t,t=""),T(n)&&e(t))i[t]=i[t]||[],i[t].push(n);else if(j(n))for(var r=0,o=n;r<o.length;r++)at(t,o[r],e,i);else if(E(n))for(var a in n)at(st(a).map((function(n){return"".concat(t).concat(n)})),n[a],e,i);return i}function st(t){return t.trim().split(/ +/)}var ut=function(t,n){return Math.sqrt(t*t+n*n)},ct=["webkit","moz"];function ft(t,n){t.__set||(t.__set={});var e=function(e){if(ct.some((function(t){return 0===e.indexOf(t)})))return 1;"function"!=typeof t[e]&&"__set"!==e&&Object.defineProperty(t,e,{get:function(){return e in t.__set?t.__set[e]:t.__set[e]=n[e]},set:function(n){t.__set[e]=n},configurable:!0})};for(var i in n)e(i);return t}function lt(t,n){t.page=t.page||{},t.page.x=n.page.x,t.page.y=n.page.y,t.client=t.client||{},t.client.x=n.client.x,t.client.y=n.client.y,t.timeStamp=n.timeStamp}function ht(t){t.page.x=0,t.page.y=0,t.client.x=0,t.client.y=0}function vt(t){return t instanceof X.Event||t instanceof X.Touch}function dt(t,n,e){return(e=e||{}).x=n[(t=t||"page")+"X"],e.y=n[t+"Y"],e}function pt(t,n){return n=n||{x:0,y:0},$.isOperaMobile&&vt(t)?(dt("screen",t,n),n.x+=window.scrollX,n.y+=window.scrollY):dt("page",t,n),n}function yt(t){return O(t.pointerId)?t.pointerId:t.identifier}function gt(t){var n=[];return j(t)?(n[0]=t[0],n[1]=t[1]):"touchend"===t.type?1===t.touches.length?(n[0]=t.touches[0],n[1]=t.changedTouches[0]):0===t.touches.length&&(n[0]=t.changedTouches[0],n[1]=t.changedTouches[1]):(n[0]=t.touches[0],n[1]=t.touches[1]),n}function mt(t){for(var n={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},e=0;e<t.length;e++){var i=t[e];for(var r in n)n[r]+=i[r]}for(var o in n)n[o]/=t.length;return n}function bt(t){if(!t.length)return null;var n=gt(t),e=Math.min(n[0].pageX,n[1].pageX),i=Math.min(n[0].pageY,n[1].pageY),r=Math.max(n[0].pageX,n[1].pageX),o=Math.max(n[0].pageY,n[1].pageY);return{x:e,y:i,left:e,top:i,right:r,bottom:o,width:r-e,height:o-i}}function wt(t,n){var e=n+"X",i=n+"Y",r=gt(t);return ut(r[0][e]-r[1][e],r[0][i]-r[1][i])}function xt(t,n){var e=n+"X",i=n+"Y",r=gt(t);return 180*Math.atan2(r[1][i]-r[0][i],r[1][e]-r[0][e])/Math.PI}function kt(t){return z(t.pointerType)?t.pointerType:O(t.pointerType)?[void 0,void 0,"touch","pen","mouse"][t.pointerType]:/touch/.test(t.type||"")||t instanceof X.Touch?"touch":"mouse"}function Mt(t){var n=T(t.composedPath)?t.composedPath():t.path;return[K(n?n[0]:t.target),K(t.currentTarget)]}var Et=function(){function t(n){r(this,t),s(this,"immediatePropagationStopped",!1),s(this,"propagationStopped",!1),this._interaction=n}return a(t,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),t}();Object.defineProperty(Et.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var Tt=function(t,n){for(var e=0;e<n.length;e++)t.push(n[e]);return t},Ot=function(t){return Tt([],t)},St=function(t,n){for(var e=0;e<t.length;e++)if(n(t[e],e,t))return e;return-1},zt=function(t,n){return t[St(t,n)]},It=function(t){u(e,t);var n=h(e);function e(t,i,o){var a;r(this,e),s(l(a=n.call(this,i._interaction)),"dropzone",void 0),s(l(a),"dragEvent",void 0),s(l(a),"relatedTarget",void 0),s(l(a),"draggable",void 0),s(l(a),"propagationStopped",!1),s(l(a),"immediatePropagationStopped",!1);var u="dragleave"===o?t.prev:t.cur,c=u.element,f=u.dropzone;return a.type=o,a.target=c,a.currentTarget=c,a.dropzone=f,a.dragEvent=i,a.relatedTarget=i.target,a.draggable=i.interactable,a.timeStamp=i.timeStamp,a}return a(e,[{key:"reject",value:function(){var t=this,n=this._interaction.dropState;if("dropactivate"===this.type||this.dropzone&&n.cur.dropzone===this.dropzone&&n.cur.element===this.target)if(n.prev.dropzone=this.dropzone,n.prev.element=this.target,n.rejected=!0,n.events.enter=null,this.stopImmediatePropagation(),"dropactivate"===this.type){var i=St(n.activeDrops,(function(n){return n.dropzone===t.dropzone&&n.element===t.target}));n.activeDrops.splice(i,1);var r=new e(n,this.dragEvent,"dropdeactivate");r.dropzone=this.dropzone,r.target=this.target,this.dropzone.fire(r)}else this.dropzone.fire(new e(n,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),e}(Et);function Pt(t,n){for(var e=0,i=t.slice();e<i.length;e++){var r=i[e],o=r.dropzone,a=r.element;n.dropzone=o,n.target=a,o.fire(n),n.propagationStopped=n.immediatePropagationStopped=!1}}function jt(t,n){for(var e=function(t,n){for(var e=[],i=0,r=t.interactables.list;i<r.length;i++){var o=r[i];if(o.options.drop.enabled){var a=o.options.drop.accept;if(!(I(a)&&a!==n||z(a)&&!V(n,a)||T(a)&&!a({dropzone:o,draggableElement:n})))for(var s=0,u=o.getAllElements();s<u.length;s++){var c=u[s];c!==n&&e.push({dropzone:o,element:c,rect:o.getRect(c)})}}}return e}(t,n),i=0;i<e.length;i++){var r=e[i];r.rect=r.dropzone.getRect(r.element)}return e}function _t(t,n,e){for(var i=t.dropState,r=t.interactable,o=t.element,a=[],s=0,u=i.activeDrops;s<u.length;s++){var c=u[s],f=c.element,l=c.dropzone.dropCheck(n,e,r,o,f,c.rect);a.push(l?f:null)}var h=function(t){for(var n,e,i,r=[],o=0;o<t.length;o++){var a=t[o],s=t[n];if(a&&o!==n)if(s){var u=B(a),c=B(s);if(u!==a.ownerDocument)if(c!==a.ownerDocument)if(u!==c){r=r.length?r:q(s);var f=void 0;if(s instanceof X.HTMLElement&&a instanceof X.SVGElement&&!(a instanceof X.SVGSVGElement)){if(a===c)continue;f=a.ownerSVGElement}else f=a;for(var l=q(f,s.ownerDocument),h=0;l[h]&&l[h]===r[h];)h++;var v=[l[h-1],l[h],r[h]];if(v[0])for(var d=v[0].lastChild;d;){if(d===v[1]){n=o,r=l;break}if(d===v[2])break;d=d.previousSibling}}else i=s,(parseInt(b(e=a).getComputedStyle(e).zIndex,10)||0)>=(parseInt(b(i).getComputedStyle(i).zIndex,10)||0)&&(n=o);else n=o}else n=o}return n}(a);return i.activeDrops[h]||null}function Dt(t,n,e){var i=t.dropState,r={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return"dragstart"===e.type&&(r.activate=new It(i,e,"dropactivate"),r.activate.target=null,r.activate.dropzone=null),"dragend"===e.type&&(r.deactivate=new It(i,e,"dropdeactivate"),r.deactivate.target=null,r.deactivate.dropzone=null),i.rejected||(i.cur.element!==i.prev.element&&(i.prev.dropzone&&(r.leave=new It(i,e,"dragleave"),e.dragLeave=r.leave.target=i.prev.element,e.prevDropzone=r.leave.dropzone=i.prev.dropzone),i.cur.dropzone&&(r.enter=new It(i,e,"dragenter"),e.dragEnter=i.cur.element,e.dropzone=i.cur.dropzone)),"dragend"===e.type&&i.cur.dropzone&&(r.drop=new It(i,e,"drop"),e.dropzone=i.cur.dropzone,e.relatedTarget=i.cur.element),"dragmove"===e.type&&i.cur.dropzone&&(r.move=new It(i,e,"dropmove"),e.dropzone=i.cur.dropzone)),r}function Rt(t,n){var e=t.dropState,i=e.activeDrops,r=e.cur;n.leave&&e.prev.dropzone.fire(n.leave),n.enter&&r.dropzone.fire(n.enter),n.move&&r.dropzone.fire(n.move),n.drop&&r.dropzone.fire(n.drop),n.deactivate&&Pt(i,n.deactivate),e.prev.dropzone=r.dropzone,e.prev.element=r.element}function At(t,n){var e=t.interaction,i=t.iEvent,r=t.event;if("dragmove"===i.type||"dragend"===i.type){var o=e.dropState;n.dynamicDrop&&(o.activeDrops=jt(n,e.element));var a=i,s=_t(e,a,r);o.rejected=o.rejected&&!!s&&s.dropzone===o.cur.dropzone&&s.element===o.cur.element,o.cur.dropzone=s&&s.dropzone,o.cur.element=s&&s.element,o.events=Dt(e,0,a)}}var Ct={id:"actions/drop",install:function(t){var n=t.actions,e=t.interactStatic,i=t.Interactable,r=t.defaults;t.usePlugin(A),i.prototype.dropzone=function(t){return function(t,n){if(E(n)){if(t.options.drop.enabled=!1!==n.enabled,n.listeners){var e=at(n.listeners),i=Object.keys(e).reduce((function(t,n){return t[/^(enter|leave)/.test(n)?"drag".concat(n):/^(activate|deactivate|move)/.test(n)?"drop".concat(n):n]=e[n],t}),{}),r=t.options.drop.listeners;r&&t.off(r),t.on(i),t.options.drop.listeners=i}return T(n.ondrop)&&t.on("drop",n.ondrop),T(n.ondropactivate)&&t.on("dropactivate",n.ondropactivate),T(n.ondropdeactivate)&&t.on("dropdeactivate",n.ondropdeactivate),T(n.ondragenter)&&t.on("dragenter",n.ondragenter),T(n.ondragleave)&&t.on("dragleave",n.ondragleave),T(n.ondropmove)&&t.on("dropmove",n.ondropmove),/^(pointer|center)$/.test(n.overlap)?t.options.drop.overlap=n.overlap:O(n.overlap)&&(t.options.drop.overlap=Math.max(Math.min(1,n.overlap),0)),"accept"in n&&(t.options.drop.accept=n.accept),"checker"in n&&(t.options.drop.checker=n.checker),t}return S(n)?(t.options.drop.enabled=n,t):t.options.drop}(this,t)},i.prototype.dropCheck=function(t,n,e,i,r,o){return function(t,n,e,i,r,o,a){var s=!1;if(!(a=a||t.getRect(o)))return!!t.options.drop.checker&&t.options.drop.checker(n,e,s,t,o,i,r);var u=t.options.drop.overlap;if("pointer"===u){var c=ot(i,r,"drag"),f=pt(n);f.x+=c.x,f.y+=c.y,s=f.x>a.left&&f.x<a.right&&f.y>a.top&&f.y<a.bottom}var l=i.getRect(r);if(l&&"center"===u){var h=l.left+l.width/2,v=l.top+l.height/2;s=h>=a.left&&h<=a.right&&v>=a.top&&v<=a.bottom}return l&&O(u)&&(s=Math.max(0,Math.min(a.right,l.right)-Math.max(a.left,l.left))*Math.max(0,Math.min(a.bottom,l.bottom)-Math.max(a.top,l.top))/(l.width*l.height)>=u),t.options.drop.checker&&(s=t.options.drop.checker(n,e,s,t,o,i,r)),s}(this,t,n,e,i,r,o)},e.dynamicDrop=function(n){return S(n)?(t.dynamicDrop=n,e):t.dynamicDrop},Z(n.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),n.methodDict.drop="dropzone",t.dynamicDrop=!1,r.actions.drop=Ct.defaults},listeners:{"interactions:before-action-start":function(t){var n=t.interaction;"drag"===n.prepared.name&&(n.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(t,n){var e=t.interaction,i=t.iEvent;if("drag"===e.prepared.name){var r=e.dropState;r.activeDrops=[],r.events={},r.activeDrops=jt(n,e.element),r.events=Dt(e,0,i),r.events.activate&&(Pt(r.activeDrops,r.events.activate),n.fire("actions/drop:start",{interaction:e,dragEvent:i}))}},"interactions:action-move":At,"interactions:after-action-move":function(t,n){var e=t.interaction,i=t.iEvent;if("drag"===e.prepared.name){var r=e.dropState;Rt(e,r.events),n.fire("actions/drop:move",{interaction:e,dragEvent:i}),r.events={}}},"interactions:action-end":function(t,n){if("drag"===t.interaction.prepared.name){var e=t.interaction,i=t.iEvent;At(t,n),Rt(e,e.dropState.events),n.fire("actions/drop:end",{interaction:e,dragEvent:i})}},"interactions:stop":function(t){var n=t.interaction;if("drag"===n.prepared.name){var e=n.dropState;e&&(e.activeDrops=null,e.events=null,e.cur.dropzone=null,e.cur.element=null,e.prev.dropzone=null,e.prev.element=null,e.rejected=!1)}}},getActiveDrops:jt,getDrop:_t,getDropEvents:Dt,fireDropEvents:Rt,filterEventType:function(t){return 0===t.search("drag")||0===t.search("drop")},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Ft=Ct;function Xt(t){var n=t.interaction,e=t.iEvent,i=t.phase;if("gesture"===n.prepared.name){var r=n.pointers.map((function(t){return t.pointer})),o="start"===i,a="end"===i,s=n.interactable.options.deltaSource;if(e.touches=[r[0],r[1]],o)e.distance=wt(r,s),e.box=bt(r),e.scale=1,e.ds=0,e.angle=xt(r,s),e.da=0,n.gesture.startDistance=e.distance,n.gesture.startAngle=e.angle;else if(a||n.pointers.length<2){var u=n.prevEvent;e.distance=u.distance,e.box=u.box,e.scale=u.scale,e.ds=0,e.angle=u.angle,e.da=0}else e.distance=wt(r,s),e.box=bt(r),e.scale=e.distance/n.gesture.startDistance,e.angle=xt(r,s),e.ds=e.scale-n.gesture.scale,e.da=e.angle-n.gesture.angle;n.gesture.distance=e.distance,n.gesture.angle=e.angle,O(e.scale)&&e.scale!==1/0&&!isNaN(e.scale)&&(n.gesture.scale=e.scale)}}var Yt={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(t){var n=t.actions,e=t.defaults;t.Interactable.prototype.gesturable=function(t){return E(t)?(this.options.gesture.enabled=!1!==t.enabled,this.setPerAction("gesture",t),this.setOnEvents("gesture",t),this):S(t)?(this.options.gesture.enabled=t,this):this.options.gesture},n.map.gesture=Yt,n.methodDict.gesture="gesturable",e.actions.gesture=Yt.defaults},listeners:{"interactions:action-start":Xt,"interactions:action-move":Xt,"interactions:action-end":Xt,"interactions:new":function(t){t.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(t){if(!(t.interaction.pointers.length<2)){var n=t.interactable.options.gesture;if(n&&n.enabled)return t.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(t){return 0===t.search("gesture")}},$t=Yt;function Lt(t,n,e,i,r,o,a){if(!n)return!1;if(!0===n){var s=O(o.width)?o.width:o.right-o.left,u=O(o.height)?o.height:o.bottom-o.top;if(a=Math.min(a,Math.abs(("left"===t||"right"===t?s:u)/2)),s<0&&("left"===t?t="right":"right"===t&&(t="left")),u<0&&("top"===t?t="bottom":"bottom"===t&&(t="top")),"left"===t)return e.x<(s>=0?o.left:o.right)+a;if("top"===t)return e.y<(u>=0?o.top:o.bottom)+a;if("right"===t)return e.x>(s>=0?o.right:o.left)-a;if("bottom"===t)return e.y>(u>=0?o.bottom:o.top)-a}return!!I(i)&&(I(n)?n===i:G(i,n,r))}function Ut(t){var n=t.interaction;if("resize"===n.prepared.name&&n.resizeAxes){var e=t.iEvent;n.interactable.options.resize.square?("y"===n.resizeAxes?e.delta.x=e.delta.y:e.delta.y=e.delta.x,e.axes="xy"):(e.axes=n.resizeAxes,"x"===n.resizeAxes?e.delta.y=0:"y"===n.resizeAxes&&(e.delta.x=0))}}var Nt,Vt,Bt={id:"actions/resize",before:["actions/drag"],install:function(t){var n=t.actions,e=t.browser,i=t.Interactable,r=t.defaults;Bt.cursors=function(t){return t.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(e),Bt.defaultMargin=e.supportsTouch||e.supportsPointerEvent?20:10,i.prototype.resizable=function(n){return function(t,n,e){return E(n)?(t.options.resize.enabled=!1!==n.enabled,t.setPerAction("resize",n),t.setOnEvents("resize",n),z(n.axis)&&/^x$|^y$|^xy$/.test(n.axis)?t.options.resize.axis=n.axis:null===n.axis&&(t.options.resize.axis=e.defaults.actions.resize.axis),S(n.preserveAspectRatio)?t.options.resize.preserveAspectRatio=n.preserveAspectRatio:S(n.square)&&(t.options.resize.square=n.square),t):S(n)?(t.options.resize.enabled=n,t):t.options.resize}(this,n,t)},n.map.resize=Bt,n.methodDict.resize="resizable",r.actions.resize=Bt.defaults},listeners:{"interactions:new":function(t){t.interaction.resizeAxes="xy"},"interactions:action-start":function(t){!function(t){var n=t.interaction;if("resize"===n.prepared.name&&n.prepared.edges){var e=t.iEvent,i=n.rect;n._rects={start:Z({},i),corrected:Z({},i),previous:Z({},i),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},e.edges=n.prepared.edges,e.rect=n._rects.corrected,e.deltaRect=n._rects.delta}}(t),Ut(t)},"interactions:action-move":function(t){!function(t){var n=t.interaction;if("resize"===n.prepared.name&&n.prepared.edges){var e=t.iEvent,i=n.interactable.options.resize.invert,r="reposition"===i||"negate"===i,o=n.rect,a=n._rects,s=a.start,u=a.corrected,c=a.delta,f=a.previous;if(Z(f,u),r){if(Z(u,o),"reposition"===i){if(u.top>u.bottom){var l=u.top;u.top=u.bottom,u.bottom=l}if(u.left>u.right){var h=u.left;u.left=u.right,u.right=h}}}else u.top=Math.min(o.top,s.bottom),u.bottom=Math.max(o.bottom,s.top),u.left=Math.min(o.left,s.right),u.right=Math.max(o.right,s.left);for(var v in u.width=u.right-u.left,u.height=u.bottom-u.top,u)c[v]=u[v]-f[v];e.edges=n.prepared.edges,e.rect=u,e.deltaRect=c}}(t),Ut(t)},"interactions:action-end":function(t){var n=t.interaction;if("resize"===n.prepared.name&&n.prepared.edges){var e=t.iEvent;e.edges=n.prepared.edges,e.rect=n._rects.corrected,e.deltaRect=n._rects.delta}},"auto-start:check":function(t){var n=t.interaction,e=t.interactable,i=t.element,r=t.rect,o=t.buttons;if(r){var a=Z({},n.coords.cur.page),s=e.options.resize;if(s&&s.enabled&&(!n.pointerIsDown||!/mouse|pointer/.test(n.pointerType)||0!=(o&s.mouseButtons))){if(E(s.edges)){var u={left:!1,right:!1,top:!1,bottom:!1};for(var c in u)u[c]=Lt(c,s.edges[c],a,n._latestPointer.eventTarget,i,r,s.margin||Bt.defaultMargin);u.left=u.left&&!u.right,u.top=u.top&&!u.bottom,(u.left||u.right||u.top||u.bottom)&&(t.action={name:"resize",edges:u})}else{var f="y"!==s.axis&&a.x>r.right-Bt.defaultMargin,l="x"!==s.axis&&a.y>r.bottom-Bt.defaultMargin;(f||l)&&(t.action={name:"resize",axes:(f?"x":"")+(l?"y":"")})}return!t.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(t){var n=t.edges,e=t.axis,i=Bt.cursors,r=null;if(e)r=i[t.name+e];else if(n){for(var o="",a=0,s=["top","bottom","left","right"];a<s.length;a++){var u=s[a];n[u]&&(o+=u)}r=i[o]}return r},filterEventType:function(t){return 0===t.search("resize")},defaultMargin:null},qt=Bt,Gt={id:"actions",install:function(t){t.usePlugin($t),t.usePlugin(qt),t.usePlugin(A),t.usePlugin(Ft)}},Kt=0,Wt=function(t){return Nt(t)},Ht=function(t){return Vt(t)},Jt=function(t){if(Vt=t.cancelAnimationFrame,!(Nt=t.requestAnimationFrame))for(var n=["ms","moz","webkit","o"],e=0;e<n.length;e++){var i=n[e];Nt=t["".concat(i,"RequestAnimationFrame")],Vt=t["".concat(i,"CancelAnimationFrame")]||t["".concat(i,"CancelRequestAnimationFrame")]}Nt=Nt&&Nt.bind(t),Vt=Vt&&Vt.bind(t),Nt||(Nt=function(n){var e=Date.now(),i=Math.max(0,16-(e-Kt)),r=t.setTimeout((function(){n(e+i)}),i);return Kt=e+i,r},Vt=function(t){return clearTimeout(t)})},Qt={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(t){Qt.isScrolling=!0,Ht(Qt.i),t.autoScroll=Qt,Qt.interaction=t,Qt.prevTime=Qt.now(),Qt.i=Wt(Qt.scroll)},stop:function(){Qt.isScrolling=!1,Qt.interaction&&(Qt.interaction.autoScroll=null),Ht(Qt.i)},scroll:function(){var t=Qt.interaction,n=t.interactable,e=t.element,i=n.options[t.prepared.name].autoScroll,r=Zt(i.container,n,e),o=Qt.now(),a=i.speed*((o-Qt.prevTime)/1e3);if(a>=1){var s={x:Qt.x*a,y:Qt.y*a};if(s.x||s.y){var u=tn(r);k(r)?r.scrollBy(s.x,s.y):r&&(r.scrollLeft+=s.x,r.scrollTop+=s.y);var c=tn(r),f={x:c.x-u.x,y:c.y-u.y};(f.x||f.y)&&n.fire({type:"autoscroll",target:e,interactable:n,delta:f,interaction:t,container:r})}Qt.prevTime=o}Qt.isScrolling&&(Ht(Qt.i),Qt.i=Wt(Qt.scroll))},check:function(t,n){var e;return null==(e=t.options[n].autoScroll)?void 0:e.enabled},onInteractionMove:function(t){var n=t.interaction,e=t.pointer;if(n.interacting()&&Qt.check(n.interactable,n.prepared.name))if(n.simulation)Qt.x=Qt.y=0;else{var i,r,o,a,s=n.interactable,u=s.options[n.prepared.name].autoScroll,c=Zt(u.container,s,n.element);if(k(c))a=e.clientX<Qt.margin,i=e.clientY<Qt.margin,r=e.clientX>c.innerWidth-Qt.margin,o=e.clientY>c.innerHeight-Qt.margin;else{var f=W(c);a=e.clientX<f.left+Qt.margin,i=e.clientY<f.top+Qt.margin,r=e.clientX>f.right-Qt.margin,o=e.clientY>f.bottom-Qt.margin}Qt.x=r?1:a?-1:0,Qt.y=o?1:i?-1:0,Qt.isScrolling||(Qt.margin=u.margin,Qt.speed=u.speed,Qt.start(n))}}};function Zt(t,n,e){return(z(t)?tt(t,n,e):t)||b(e)}function tn(t){return k(t)&&(t=window.document.body),{x:t.scrollLeft,y:t.scrollTop}}var nn={id:"auto-scroll",install:function(t){var n=t.defaults,e=t.actions;t.autoScroll=Qt,Qt.now=function(){return t.now()},e.phaselessTypes.autoscroll=!0,n.perAction.autoScroll=Qt.defaults},listeners:{"interactions:new":function(t){t.interaction.autoScroll=null},"interactions:destroy":function(t){t.interaction.autoScroll=null,Qt.stop(),Qt.interaction&&(Qt.interaction=null)},"interactions:stop":Qt.stop,"interactions:action-move":function(t){return Qt.onInteractionMove(t)}}};function en(t,n){var e=!1;return function(){return e||(g.console.warn(n),e=!0),t.apply(this,arguments)}}function rn(t,n){return t.name=n.name,t.axis=n.axis,t.edges=n.edges,t}function on(t){return S(t)?(this.options.styleCursor=t,this):null===t?(delete this.options.styleCursor,this):this.options.styleCursor}function an(t){return T(t)?(this.options.actionChecker=t,this):null===t?(delete this.options.actionChecker,this):this.options.actionChecker}var sn={id:"auto-start/interactableMethods",install:function(t){var n=t.Interactable;n.prototype.getAction=function(n,e,i,r){var o=function(t,n,e,i,r){var o=t.getRect(i),a={action:null,interactable:t,interaction:e,element:i,rect:o,buttons:n.buttons||{0:1,1:4,3:8,4:16}[n.button]};return r.fire("auto-start:check",a),a.action}(this,e,i,r,t);return this.options.actionChecker?this.options.actionChecker(n,e,o,this,r,i):o},n.prototype.ignoreFrom=en((function(t){return this._backCompatOption("ignoreFrom",t)}),"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),n.prototype.allowFrom=en((function(t){return this._backCompatOption("allowFrom",t)}),"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),n.prototype.actionChecker=an,n.prototype.styleCursor=on}};function un(t,n,e,i,r){return n.testIgnoreAllow(n.options[t.name],e,i)&&n.options[t.name].enabled&&hn(n,e,t,r)?t:null}function cn(t,n,e,i,r,o,a){for(var s=0,u=i.length;s<u;s++){var c=i[s],f=r[s],l=c.getAction(n,e,t,f);if(l){var h=un(l,c,f,o,a);if(h)return{action:h,interactable:c,element:f}}}return{action:null,interactable:null,element:null}}function fn(t,n,e,i,r){var o=[],a=[],s=i;function u(t){o.push(t),a.push(s)}for(;I(s);){o=[],a=[],r.interactables.forEachMatch(s,u);var c=cn(t,n,e,o,a,i,r);if(c.action&&!c.interactable.options[c.action.name].manualStart)return c;s=N(s)}return{action:null,interactable:null,element:null}}function ln(t,n,e){var i=n.action,r=n.interactable,o=n.element;i=i||{name:null},t.interactable=r,t.element=o,rn(t.prepared,i),t.rect=r&&i.name?r.getRect(o):null,pn(t,e),e.fire("autoStart:prepared",{interaction:t})}function hn(t,n,e,i){var r=t.options,o=r[e.name].max,a=r[e.name].maxPerElement,s=i.autoStart.maxInteractions,u=0,c=0,f=0;if(!(o&&a&&s))return!1;for(var l=0,h=i.interactions.list;l<h.length;l++){var v=h[l],d=v.prepared.name;if(v.interacting()){if(++u>=s)return!1;if(v.interactable===t){if((c+=d===e.name?1:0)>=o)return!1;if(v.element===n&&(f++,d===e.name&&f>=a))return!1}}}return s>0}function vn(t,n){return O(t)?(n.autoStart.maxInteractions=t,this):n.autoStart.maxInteractions}function dn(t,n,e){var i=e.autoStart.cursorElement;i&&i!==t&&(i.style.cursor=""),t.ownerDocument.documentElement.style.cursor=n,t.style.cursor=n,e.autoStart.cursorElement=n?t:null}function pn(t,n){var e=t.interactable,i=t.element,r=t.prepared;if("mouse"===t.pointerType&&e&&e.options.styleCursor){var o="";if(r.name){var a=e.options[r.name].cursorChecker;o=T(a)?a(r,e,i,t._interacting):n.actions.map[r.name].getCursor(r)}dn(t.element,o||"",n)}else n.autoStart.cursorElement&&dn(n.autoStart.cursorElement,"",n)}var yn={id:"auto-start/base",before:["actions"],install:function(t){var n=t.interactStatic,e=t.defaults;t.usePlugin(sn),e.base.actionChecker=null,e.base.styleCursor=!0,Z(e.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),n.maxInteractions=function(n){return vn(n,t)},t.autoStart={maxInteractions:1/0,withinInteractionLimit:hn,cursorElement:null}},listeners:{"interactions:down":function(t,n){var e=t.interaction,i=t.pointer,r=t.event,o=t.eventTarget;e.interacting()||ln(e,fn(e,i,r,o,n),n)},"interactions:move":function(t,n){!function(t,n){var e=t.interaction,i=t.pointer,r=t.event,o=t.eventTarget;"mouse"!==e.pointerType||e.pointerIsDown||e.interacting()||ln(e,fn(e,i,r,o,n),n)}(t,n),function(t,n){var e=t.interaction;if(e.pointerIsDown&&!e.interacting()&&e.pointerWasMoved&&e.prepared.name){n.fire("autoStart:before-start",t);var i=e.interactable,r=e.prepared.name;r&&i&&(i.options[r].manualStart||!hn(i,e.element,e.prepared,n)?e.stop():(e.start(e.prepared,i,e.element),pn(e,n)))}}(t,n)},"interactions:stop":function(t,n){var e=t.interaction,i=e.interactable;i&&i.options.styleCursor&&dn(e.element,"",n)}},maxInteractions:vn,withinInteractionLimit:hn,validateAction:un},gn={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(t,n){var e=t.interaction,i=t.eventTarget,r=t.dy;if("drag"===e.prepared.name){var o=Math.abs(t.dx),a=Math.abs(r),s=e.interactable.options.drag,u=s.startAxis,c=o>a?"x":o<a?"y":"xy";if(e.prepared.axis="start"===s.lockAxis?c[0]:s.lockAxis,"xy"!==c&&"xy"!==u&&u!==c){e.prepared.name=null;for(var f=i,l=function(t){if(t!==e.interactable){var r=e.interactable.options.drag;if(!r.manualStart&&t.testIgnoreAllow(r,f,i)){var o=t.getAction(e.downPointer,e.downEvent,e,f);if(o&&"drag"===o.name&&function(t,n){if(!n)return!1;var e=n.options.drag.startAxis;return"xy"===t||"xy"===e||e===t}(c,t)&&yn.validateAction(o,t,f,i,n))return t}}};I(f);){var h=n.interactables.forEachMatch(f,l);if(h){e.prepared.name="drag",e.interactable=h,e.element=f;break}f=N(f)}}}}}};function mn(t){var n=t.prepared&&t.prepared.name;if(!n)return null;var e=t.interactable.options;return e[n].hold||e[n].delay}var bn={id:"auto-start/hold",install:function(t){var n=t.defaults;t.usePlugin(yn),n.perAction.hold=0,n.perAction.delay=0},listeners:{"interactions:new":function(t){t.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(t){var n=t.interaction,e=mn(n);e>0&&(n.autoStartHoldTimer=setTimeout((function(){n.start(n.prepared,n.interactable,n.element)}),e))},"interactions:move":function(t){var n=t.interaction;n.autoStartHoldTimer&&n.pointerWasMoved&&!t.duplicate&&(clearTimeout(n.autoStartHoldTimer),n.autoStartHoldTimer=null)},"autoStart:before-start":function(t){var n=t.interaction;mn(n)>0&&(n.prepared.name=null)}},getHoldDuration:mn},wn={id:"auto-start",install:function(t){t.usePlugin(yn),t.usePlugin(bn),t.usePlugin(gn)}},xn=function(t){return/^(always|never|auto)$/.test(t)?(this.options.preventDefault=t,this):S(t)?(this.options.preventDefault=t?"always":"never",this):this.options.preventDefault};function kn(t){var n=t.interaction;n.interactable&&n.interactable.checkAndPreventDefault(t.event)}var Mn={id:"core/interactablePreventDefault",install:function(t){var n=t.Interactable;n.prototype.preventDefault=xn,n.prototype.checkAndPreventDefault=function(n){return function(t,n,e){var i=t.options.preventDefault;if("never"!==i)if("always"!==i){if(n.events.supportsPassive&&/^touch(start|move)$/.test(e.type)){var r=b(e.target).document,o=n.getDocOptions(r);if(!o||!o.events||!1!==o.events.passive)return}/^(mouse|pointer|touch)*(down|start)/i.test(e.type)||I(e.target)&&V(e.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||e.preventDefault()}else e.preventDefault()}(this,t,n)},t.interactions.docEvents.push({type:"dragstart",listener:function(n){for(var e=0,i=t.interactions.list;e<i.length;e++){var r=i[e];if(r.element&&(r.element===n.target||L(r.element,n.target)))return void r.interactable.checkAndPreventDefault(n)}}})},listeners:["down","move","up","cancel"].reduce((function(t,n){return t["interactions:".concat(n)]=kn,t}),{})};function En(t,n){if(n.phaselessTypes[t])return!0;for(var e in n.map)if(0===t.indexOf(e)&&t.substr(e.length)in n.phases)return!0;return!1}function Tn(t){var n={};for(var e in t){var i=t[e];n[e]=P(i)?Tn(i):j(i)?Ot(i):i}return n}var On=function(){function t(n){r(this,t),s(this,"states",[]),s(this,"startOffset",{left:0,right:0,top:0,bottom:0}),s(this,"startDelta",void 0),s(this,"result",void 0),s(this,"endResult",void 0),s(this,"startEdges",void 0),s(this,"edges",void 0),s(this,"interaction",void 0),this.interaction=n,this.result=Sn(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return a(t,[{key:"start",value:function(t,n){var e,i,r=t.phase,o=this.interaction,a=function(t){var n=t.interactable.options[t.prepared.name],e=n.modifiers;return e&&e.length?e:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map((function(t){var e=n[t];return e&&e.enabled&&{options:e,methods:e._methods}})).filter((function(t){return!!t}))}(o);this.prepareStates(a),this.startEdges=Z({},o.edges),this.edges=Z({},this.startEdges),this.startOffset=(i=n,(e=o.rect)?{left:i.x-e.left,top:i.y-e.top,right:e.right-i.x,bottom:e.bottom-i.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var s=this.fillArg({phase:r,pageCoords:n,preEnd:!1});return this.result=Sn(),this.startAll(s),this.result=this.setAll(s)}},{key:"fillArg",value:function(t){var n=this.interaction;return t.interaction=n,t.interactable=n.interactable,t.element=n.element,t.rect||(t.rect=n.rect),t.edges||(t.edges=this.startEdges),t.startOffset=this.startOffset,t}},{key:"startAll",value:function(t){for(var n=0,e=this.states;n<e.length;n++){var i=e[n];i.methods.start&&(t.state=i,i.methods.start(t))}}},{key:"setAll",value:function(t){var n=t.phase,e=t.preEnd,i=t.skipModifiers,r=t.rect,o=t.edges;t.coords=Z({},t.pageCoords),t.rect=Z({},r),t.edges=Z({},o);for(var a=i?this.states.slice(i):this.states,s=Sn(t.coords,t.rect),u=0;u<a.length;u++){var c,f=a[u],l=f.options,h=Z({},t.coords),v=null;null!=(c=f.methods)&&c.set&&this.shouldDo(l,e,n)&&(t.state=f,v=f.methods.set(t),rt(t.edges,t.rect,{x:t.coords.x-h.x,y:t.coords.y-h.y})),s.eventProps.push(v)}Z(this.edges,t.edges),s.delta.x=t.coords.x-t.pageCoords.x,s.delta.y=t.coords.y-t.pageCoords.y,s.rectDelta.left=t.rect.left-r.left,s.rectDelta.right=t.rect.right-r.right,s.rectDelta.top=t.rect.top-r.top,s.rectDelta.bottom=t.rect.bottom-r.bottom;var d=this.result.coords,p=this.result.rect;return d&&p&&(s.changed=s.rect.left!==p.left||s.rect.right!==p.right||s.rect.top!==p.top||s.rect.bottom!==p.bottom||d.x!==s.coords.x||d.y!==s.coords.y),s}},{key:"applyToInteraction",value:function(t){var n=this.interaction,e=n.coords.cur,i=n.coords.start,r=this.result,o=this.startDelta,a=r.delta;"start"===t.phase&&Z(this.startDelta,r.delta);for(var s=0,u=[[i,o],[e,a]];s<u.length;s++){var c=u[s],f=c[0],l=c[1];f.page.x+=l.x,f.page.y+=l.y,f.client.x+=l.x,f.client.y+=l.y}var h=this.result.rectDelta,v=t.rect||n.rect;v.left+=h.left,v.right+=h.right,v.top+=h.top,v.bottom+=h.bottom,v.width=v.right-v.left,v.height=v.bottom-v.top}},{key:"setAndApply",value:function(t){var n=this.interaction,e=t.skipModifiers,i=this.setAll(this.fillArg({preEnd:t.preEnd,phase:t.phase,pageCoords:t.modifiedCoords||n.coords.cur.page}));if(this.result=i,!i.changed&&(!e||e<this.states.length)&&n.interacting())return!1;if(t.modifiedCoords){var r=n.coords.cur.page,o={x:t.modifiedCoords.x-r.x,y:t.modifiedCoords.y-r.y};i.coords.x+=o.x,i.coords.y+=o.y,i.delta.x+=o.x,i.delta.y+=o.y}this.applyToInteraction(t)}},{key:"beforeEnd",value:function(t){var n=t.interaction,e=t.event,i=this.states;if(i&&i.length){for(var r=!1,o=0;o<i.length;o++){var a=i[o];t.state=a;var s=a.options,u=a.methods,c=u.beforeEnd&&u.beforeEnd(t);if(c)return this.endResult=c,!1;r=r||!r&&this.shouldDo(s,!0,t.phase,!0)}r&&n.move({event:e,preEnd:!0})}}},{key:"stop",value:function(t){var n=t.interaction;if(this.states&&this.states.length){var e=Z({states:this.states,interactable:n.interactable,element:n.element,rect:null},t);this.fillArg(e);for(var i=0,r=this.states;i<r.length;i++){var o=r[i];e.state=o,o.methods.stop&&o.methods.stop(e)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(t){this.states=[];for(var n=0;n<t.length;n++){var e=t[n];this.states.push({options:e.options,methods:e.methods,index:n,name:e.name})}return this.states}},{key:"restoreInteractionCoords",value:function(t){var n=t.interaction,e=n.coords,i=n.rect,r=n.modification;if(r.result){for(var o=r.result,a=o.rectDelta,s=0,u=[[e.start,r.startDelta],[e.cur,o.delta]];s<u.length;s++){var c=u[s],f=c[0],l=c[1];f.page.x-=l.x,f.page.y-=l.y,f.client.x-=l.x,f.client.y-=l.y}i.left-=a.left,i.right-=a.right,i.top-=a.top,i.bottom-=a.bottom}}},{key:"shouldDo",value:function(t,n,e,i){return!(!t||!1===t.enabled||i&&!t.endOnly||t.endOnly&&!n||"start"===e&&!t.setStart)}},{key:"copyFrom",value:function(t){this.startOffset=t.startOffset,this.startDelta=t.startDelta,this.startEdges=t.startEdges,this.edges=t.edges,this.states=t.states.map((function(t){return Tn(t)})),this.result=Sn(Z({},t.result.coords),Z({},t.result.rect))}},{key:"destroy",value:function(){for(var t in this)this[t]=null}}]),t}();function Sn(t,n){return{rect:n,coords:t,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function zn(t,n){var e=t.defaults,i={start:t.start,set:t.set,beforeEnd:t.beforeEnd,stop:t.stop},r=function(t){var r=t||{};for(var o in r.enabled=!1!==r.enabled,e)o in r||(r[o]=e[o]);var a={options:r,methods:i,name:n,enable:function(){return r.enabled=!0,a},disable:function(){return r.enabled=!1,a}};return a};return n&&"string"==typeof n&&(r._defaults=e,r._methods=i),r}function In(t){var n=t.interaction.modification.result;n&&(t.iEvent.modifiers=n.eventProps)}var Pn={id:"modifiers/base",before:["actions"],install:function(t){t.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(t){var n=t.interaction;n.modification=new On(n)},"interactions:before-action-start":function(t){var n=t.interaction,e=t.interaction.modification;e.start(t,n.coords.start.page),n.edges=e.edges,e.applyToInteraction(t)},"interactions:before-action-move":function(t){var n=t.interaction,e=n.modification,i=e.setAndApply(t);return n.edges=e.edges,i},"interactions:before-action-end":function(t){var n=t.interaction,e=n.modification,i=e.beforeEnd(t);return n.edges=e.startEdges,i},"interactions:action-start":In,"interactions:action-move":In,"interactions:action-end":In,"interactions:after-action-start":function(t){return t.interaction.modification.restoreInteractionCoords(t)},"interactions:after-action-move":function(t){return t.interaction.modification.restoreInteractionCoords(t)},"interactions:stop":function(t){return t.interaction.modification.stop(t)}}},jn={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},_n=function(t){u(e,t);var n=h(e);function e(t,i,o,a,u,c,f){var h;r(this,e),s(l(h=n.call(this,t)),"relatedTarget",null),s(l(h),"screenX",void 0),s(l(h),"screenY",void 0),s(l(h),"button",void 0),s(l(h),"buttons",void 0),s(l(h),"ctrlKey",void 0),s(l(h),"shiftKey",void 0),s(l(h),"altKey",void 0),s(l(h),"metaKey",void 0),s(l(h),"page",void 0),s(l(h),"client",void 0),s(l(h),"delta",void 0),s(l(h),"rect",void 0),s(l(h),"x0",void 0),s(l(h),"y0",void 0),s(l(h),"t0",void 0),s(l(h),"dt",void 0),s(l(h),"duration",void 0),s(l(h),"clientX0",void 0),s(l(h),"clientY0",void 0),s(l(h),"velocity",void 0),s(l(h),"speed",void 0),s(l(h),"swipe",void 0),s(l(h),"axes",void 0),s(l(h),"preEnd",void 0);var v=t.interactable,d=(v&&v.options||jn).deltaSource,p=ot(v,u=u||t.element,o),y="start"===a,g="end"===a,m=y?l(h):t.prevEvent,b=y?t.coords.start:g?{page:m.page,client:m.client,timeStamp:t.coords.cur.timeStamp}:t.coords.cur;return h.page=Z({},b.page),h.client=Z({},b.client),h.rect=Z({},t.rect),h.timeStamp=b.timeStamp,g||(h.page.x-=p.x,h.page.y-=p.y,h.client.x-=p.x,h.client.y-=p.y),h.ctrlKey=i.ctrlKey,h.altKey=i.altKey,h.shiftKey=i.shiftKey,h.metaKey=i.metaKey,h.button=i.button,h.buttons=i.buttons,h.target=u,h.currentTarget=u,h.preEnd=c,h.type=f||o+(a||""),h.interactable=v,h.t0=y?t.pointers[t.pointers.length-1].downTime:m.t0,h.x0=t.coords.start.page.x-p.x,h.y0=t.coords.start.page.y-p.y,h.clientX0=t.coords.start.client.x-p.x,h.clientY0=t.coords.start.client.y-p.y,h.delta=y||g?{x:0,y:0}:{x:h[d].x-m[d].x,y:h[d].y-m[d].y},h.dt=t.coords.delta.timeStamp,h.duration=h.timeStamp-h.t0,h.velocity=Z({},t.coords.velocity[d]),h.speed=ut(h.velocity.x,h.velocity.y),h.swipe=g||"inertiastart"===a?h.getSwipe():null,h}return a(e,[{key:"getSwipe",value:function(){var t=this._interaction;if(t.prevEvent.speed<600||this.timeStamp-t.prevEvent.timeStamp>150)return null;var n=180*Math.atan2(t.prevEvent.velocityY,t.prevEvent.velocityX)/Math.PI;n<0&&(n+=360);var e=112.5<=n&&n<247.5,i=202.5<=n&&n<337.5;return{up:i,down:!i&&22.5<=n&&n<157.5,left:e,right:!e&&(292.5<=n||n<67.5),angle:n,speed:t.prevEvent.speed,velocity:{x:t.prevEvent.velocityX,y:t.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),e}(Et);Object.defineProperties(_n.prototype,{pageX:{get:function(){return this.page.x},set:function(t){this.page.x=t}},pageY:{get:function(){return this.page.y},set:function(t){this.page.y=t}},clientX:{get:function(){return this.client.x},set:function(t){this.client.x=t}},clientY:{get:function(){return this.client.y},set:function(t){this.client.y=t}},dx:{get:function(){return this.delta.x},set:function(t){this.delta.x=t}},dy:{get:function(){return this.delta.y},set:function(t){this.delta.y=t}},velocityX:{get:function(){return this.velocity.x},set:function(t){this.velocity.x=t}},velocityY:{get:function(){return this.velocity.y},set:function(t){this.velocity.y=t}}});var Dn=a((function t(n,e,i,o,a){r(this,t),s(this,"id",void 0),s(this,"pointer",void 0),s(this,"event",void 0),s(this,"downTime",void 0),s(this,"downTarget",void 0),this.id=n,this.pointer=e,this.event=i,this.downTime=o,this.downTarget=a})),Rn=function(t){return t.interactable="",t.element="",t.prepared="",t.pointerIsDown="",t.pointerWasMoved="",t._proxy="",t}({}),An=function(t){return t.start="",t.move="",t.end="",t.stop="",t.interacting="",t}({}),Cn=0,Fn=function(){function t(n){var e=this,i=n.pointerType,o=n.scopeFire;r(this,t),s(this,"interactable",null),s(this,"element",null),s(this,"rect",null),s(this,"_rects",void 0),s(this,"edges",null),s(this,"_scopeFire",void 0),s(this,"prepared",{name:null,axis:null,edges:null}),s(this,"pointerType",void 0),s(this,"pointers",[]),s(this,"downEvent",null),s(this,"downPointer",{}),s(this,"_latestPointer",{pointer:null,event:null,eventTarget:null}),s(this,"prevEvent",null),s(this,"pointerIsDown",!1),s(this,"pointerWasMoved",!1),s(this,"_interacting",!1),s(this,"_ending",!1),s(this,"_stopped",!0),s(this,"_proxy",void 0),s(this,"simulation",null),s(this,"doMove",en((function(t){this.move(t)}),"The interaction.doMove() method has been renamed to interaction.move()")),s(this,"coords",{start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}}),s(this,"_id",Cn++),this._scopeFire=o,this.pointerType=i;var a=this;this._proxy={};var u=function(t){Object.defineProperty(e._proxy,t,{get:function(){return a[t]}})};for(var c in Rn)u(c);var f=function(t){Object.defineProperty(e._proxy,t,{value:function(){return a[t].apply(a,arguments)}})};for(var l in An)f(l);this._scopeFire("interactions:new",{interaction:this})}return a(t,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,n,e){var i=this.updatePointer(t,n,e,!0);this._scopeFire("interactions:down",{pointer:t,event:n,eventTarget:e,pointerIndex:i,pointerInfo:this.pointers[i],type:"down",interaction:this})}},{key:"start",value:function(t,n,e){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<("gesture"===t.name?2:1)||!n.options[t.name].enabled)&&(rn(this.prepared,t),this.interactable=n,this.element=e,this.rect=n.getRect(e),this.edges=this.prepared.edges?Z({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,n,e){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,n,e,!1);var i,r,o=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(this.pointerWasMoved=ut(i=this.coords.cur.client.x-this.coords.start.client.x,r=this.coords.cur.client.y-this.coords.start.client.y)>this.pointerMoveTolerance);var a,s,u,c=this.getPointerIndex(t),f={pointer:t,pointerIndex:c,pointerInfo:this.pointers[c],event:n,type:"move",eventTarget:e,dx:i,dy:r,duplicate:o,interaction:this};o||(a=this.coords.velocity,s=this.coords.delta,u=Math.max(s.timeStamp/1e3,.001),a.page.x=s.page.x/u,a.page.y=s.page.y/u,a.client.x=s.client.x/u,a.client.y=s.client.y/u,a.timeStamp=u),this._scopeFire("interactions:move",f),o||this.simulation||(this.interacting()&&(f.type=null,this.move(f)),this.pointerWasMoved&&lt(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||ht(this.coords.delta),(t=Z({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,n,e,i){var r=this.getPointerIndex(t);-1===r&&(r=this.updatePointer(t,n,e,!1));var o=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire("interactions:".concat(o),{pointer:t,pointerIndex:r,pointerInfo:this.pointers[r],event:n,eventTarget:e,type:o,curEventTarget:i,interaction:this}),this.simulation||this.end(n),this.removePointer(t,n)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var n;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(n=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,!0===n&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var n=yt(t);return"mouse"===this.pointerType||"pen"===this.pointerType?this.pointers.length-1:St(this.pointers,(function(t){return t.id===n}))}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,n,e,i){var r,o,a,s=yt(t),u=this.getPointerIndex(t),c=this.pointers[u];return i=!1!==i&&(i||/(down|start)$/i.test(n.type)),c?c.pointer=t:(c=new Dn(s,t,n,null,null),u=this.pointers.length,this.pointers.push(c)),function(t,n,e){var i=n.length>1?mt(n):n[0];pt(i,t.page),function(t,n){n=n||{},$.isOperaMobile&&vt(t)?dt("screen",t,n):dt("client",t,n)}(i,t.client),t.timeStamp=e}(this.coords.cur,this.pointers.map((function(t){return t.pointer})),this._now()),(r=this.coords.delta).page.x=(a=this.coords.cur).page.x-(o=this.coords.prev).page.x,r.page.y=a.page.y-o.page.y,r.client.x=a.client.x-o.client.x,r.client.y=a.client.y-o.client.y,r.timeStamp=a.timeStamp-o.timeStamp,i&&(this.pointerIsDown=!0,c.downTime=this.coords.cur.timeStamp,c.downTarget=e,ft(this.downPointer,t),this.interacting()||(lt(this.coords.start,this.coords.cur),lt(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(t,n,e),this._scopeFire("interactions:update-pointer",{pointer:t,event:n,eventTarget:e,down:i,pointerInfo:c,pointerIndex:u,interaction:this}),u}},{key:"removePointer",value:function(t,n){var e=this.getPointerIndex(t);-1!==e&&(this._scopeFire("interactions:remove-pointer",{pointer:t,event:n,eventTarget:null,pointerIndex:e,pointerInfo:this.pointers[e],interaction:this}),this.pointers.splice(e,1),this.pointerIsDown=!1)}},{key:"_updateLatestPointer",value:function(t,n,e){this._latestPointer.pointer=t,this._latestPointer.event=n,this._latestPointer.eventTarget=e}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,n,e,i){return new _n(this,t,this.prepared.name,n,this.element,e,i)}},{key:"_fireEvent",value:function(t){var n;null==(n=this.interactable)||n.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var n=t.event,e=t.phase,i=t.preEnd,r=t.type,o=this.rect;if(o&&"move"===e&&(rt(this.edges,o,this.coords.delta[this.interactable.options.deltaSource]),o.width=o.right-o.left,o.height=o.bottom-o.top),!1===this._scopeFire("interactions:before-action-".concat(e),t))return!1;var a=t.iEvent=this._createPreparedEvent(n,e,i,r);return this._scopeFire("interactions:action-".concat(e),t),"start"===e&&(this.prevEvent=a),this._fireEvent(a),this._scopeFire("interactions:after-action-".concat(e),t),!0}},{key:"_now",value:function(){return Date.now()}}]),t}();function Xn(t){Yn(t.interaction)}function Yn(t){if(!function(t){return!(!t.offset.pending.x&&!t.offset.pending.y)}(t))return!1;var n=t.offset.pending;return Ln(t.coords.cur,n),Ln(t.coords.delta,n),rt(t.edges,t.rect,n),n.x=0,n.y=0,!0}function $n(t){var n=t.x,e=t.y;this.offset.pending.x+=n,this.offset.pending.y+=e,this.offset.total.x+=n,this.offset.total.y+=e}function Ln(t,n){var e=t.page,i=t.client,r=n.x,o=n.y;e.x+=r,e.y+=o,i.x+=r,i.y+=o}An.offsetBy="";var Un={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(t){t.Interaction.prototype.offsetBy=$n},listeners:{"interactions:new":function(t){t.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(t){return function(t){t.pointerIsDown&&(Ln(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}(t.interaction)},"interactions:before-action-start":Xn,"interactions:before-action-move":Xn,"interactions:before-action-end":function(t){var n=t.interaction;if(Yn(n))return n.move({offset:!0}),n.end(),!1},"interactions:stop":function(t){var n=t.interaction;n.offset.total.x=0,n.offset.total.y=0,n.offset.pending.x=0,n.offset.pending.y=0}}},Nn=function(){function t(n){r(this,t),s(this,"active",!1),s(this,"isModified",!1),s(this,"smoothEnd",!1),s(this,"allowResume",!1),s(this,"modification",void 0),s(this,"modifierCount",0),s(this,"modifierArg",void 0),s(this,"startCoords",void 0),s(this,"t0",0),s(this,"v0",0),s(this,"te",0),s(this,"targetOffset",void 0),s(this,"modifiedOffset",void 0),s(this,"currentOffset",void 0),s(this,"lambda_v0",0),s(this,"one_ve_v0",0),s(this,"timeout",void 0),s(this,"interaction",void 0),this.interaction=n}return a(t,[{key:"start",value:function(t){var n=this.interaction,e=Vn(n);if(!e||!e.enabled)return!1;var i=n.coords.velocity.client,r=ut(i.x,i.y),o=this.modification||(this.modification=new On(n));if(o.copyFrom(n.modification),this.t0=n._now(),this.allowResume=e.allowResume,this.v0=r,this.currentOffset={x:0,y:0},this.startCoords=n.coords.cur.page,this.modifierArg=o.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-n.coords.cur.timeStamp<50&&r>e.minSpeed&&r>e.endSpeed)this.startInertia();else{if(o.result=o.setAll(this.modifierArg),!o.result.changed)return!1;this.startSmoothEnd()}return n.modification.result.rect=null,n.offsetBy(this.targetOffset),n._doPhase({interaction:n,event:t,phase:"inertiastart"}),n.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),n.modification.result.rect=null,this.active=!0,n.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,n=this.interaction.coords.velocity.client,e=Vn(this.interaction),i=e.resistance,r=-Math.log(e.endSpeed/this.v0)/i;this.targetOffset={x:(n.x-r)/i,y:(n.y-r)/i},this.te=r,this.lambda_v0=i/this.v0,this.one_ve_v0=1-e.endSpeed/this.v0;var o=this.modification,a=this.modifierArg;a.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},o.result=o.setAll(a),o.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+o.result.delta.x,y:this.targetOffset.y+o.result.delta.y}),this.onNextFrame((function(){return t.inertiaTick()}))}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame((function(){return t.smoothEndTick()}))}},{key:"onNextFrame",value:function(t){var n=this;this.timeout=Wt((function(){n.active&&t()}))}},{key:"inertiaTick",value:function(){var t,n,e,i=this,r=this.interaction,o=Vn(r).resistance,a=(r._now()-this.t0)/1e3;if(a<this.te){var s,u=1-(Math.exp(-o*a)-this.lambda_v0)/this.one_ve_v0;this.isModified?(0,t=this.targetOffset.y,n=this.modifiedOffset.y,s={x:Bn(e=u,0,this.targetOffset.x,this.modifiedOffset.x),y:Bn(e,0,t,n)}):s={x:this.targetOffset.x*u,y:this.targetOffset.y*u};var c={x:s.x-this.currentOffset.x,y:s.y-this.currentOffset.y};this.currentOffset.x+=c.x,this.currentOffset.y+=c.y,r.offsetBy(c),r.move(),this.onNextFrame((function(){return i.inertiaTick()}))}else r.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var t=this,n=this.interaction,e=n._now()-this.t0,i=Vn(n).smoothEndDuration;if(e<i){var r={x:qn(e,0,this.targetOffset.x,i),y:qn(e,0,this.targetOffset.y,i)},o={x:r.x-this.currentOffset.x,y:r.y-this.currentOffset.y};this.currentOffset.x+=o.x,this.currentOffset.y+=o.y,n.offsetBy(o),n.move({skipModifiers:this.modifierCount}),this.onNextFrame((function(){return t.smoothEndTick()}))}else n.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(t){var n=t.pointer,e=t.event,i=t.eventTarget,r=this.interaction;r.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),r.updatePointer(n,e,i,!0),r._doPhase({interaction:r,event:e,phase:"resume"}),lt(r.coords.prev,r.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,Ht(this.timeout)}}]),t}();function Vn(t){var n=t.interactable,e=t.prepared;return n&&n.options&&e.name&&n.options[e.name].inertia}function Bn(t,n,e,i){var r=1-t;return r*r*n+2*r*t*e+t*t*i}function qn(t,n,e,i){return-e*(t/=i)*(t-2)+n}var Gn={id:"inertia",before:["modifiers","actions"],install:function(t){var n=t.defaults;t.usePlugin(Un),t.usePlugin(Pn),t.actions.phases.inertiastart=!0,t.actions.phases.resume=!0,n.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(t){var n=t.interaction;n.inertia=new Nn(n)},"interactions:before-action-end":function(t){var n=t.interaction;return(!n._interacting||n.simulation||!n.inertia.start(t.event))&&null},"interactions:down":function(t){var n=t.interaction,e=n.inertia;if(e.active)for(var i=t.eventTarget;I(i);){if(i===n.element){e.resume(t);break}i=N(i)}},"interactions:stop":function(t){var n=t.interaction.inertia;n.active&&n.stop()},"interactions:before-action-resume":function(t){var n=t.interaction.modification;n.stop(t),n.start(t,t.interaction.coords.cur.page),n.applyToInteraction(t)},"interactions:before-action-inertiastart":function(t){return t.interaction.modification.setAndApply(t)},"interactions:action-resume":In,"interactions:action-inertiastart":In,"interactions:after-action-inertiastart":function(t){return t.interaction.modification.restoreInteractionCoords(t)},"interactions:after-action-resume":function(t){return t.interaction.modification.restoreInteractionCoords(t)}}};function Kn(t,n){for(var e=0;e<n.length;e++){var i=n[e];if(t.immediatePropagationStopped)break;i(t)}}var Wn=function(){function t(n){r(this,t),s(this,"options",void 0),s(this,"types",{}),s(this,"propagationStopped",!1),s(this,"immediatePropagationStopped",!1),s(this,"global",void 0),this.options=Z({},n||{})}return a(t,[{key:"fire",value:function(t){var n,e=this.global;(n=this.types[t.type])&&Kn(t,n),!t.propagationStopped&&e&&(n=e[t.type])&&Kn(t,n)}},{key:"on",value:function(t,n){var e=at(t,n);for(t in e)this.types[t]=Tt(this.types[t]||[],e[t])}},{key:"off",value:function(t,n){var e=at(t,n);for(t in e){var i=this.types[t];if(i&&i.length)for(var r=0,o=e[t];r<o.length;r++){var a=i.indexOf(o[r]);-1!==a&&i.splice(a,1)}}}},{key:"getRect",value:function(){return null}}]),t}(),Hn=function(){function t(n){r(this,t),s(this,"currentTarget",void 0),s(this,"originalEvent",void 0),s(this,"type",void 0),this.originalEvent=n,ft(this,n)}return a(t,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),t}();function Jn(t){return E(t)?{capture:!!t.capture,passive:!!t.passive}:{capture:!!t,passive:!1}}function Qn(t,n){return t===n||("boolean"==typeof t?!!n.capture===t&&0==!!n.passive:!!t.capture==!!n.capture&&!!t.passive==!!n.passive)}var Zn={id:"events",install:function(t){var n,e=[],i={},r=[],o={add:a,remove:s,addDelegate:function(t,n,e,o,s){var f=Jn(s);if(!i[e]){i[e]=[];for(var l=0;l<r.length;l++){var h=r[l];a(h,e,u),a(h,e,c,!0)}}var v=i[e],d=zt(v,(function(e){return e.selector===t&&e.context===n}));d||v.push(d={selector:t,context:n,listeners:[]}),d.listeners.push({func:o,options:f})},removeDelegate:function(t,n,e,r,o){var a,f=Jn(o),l=i[e],h=!1;if(l)for(a=l.length-1;a>=0;a--){var v=l[a];if(v.selector===t&&v.context===n){for(var d=v.listeners,p=d.length-1;p>=0;p--){var y=d[p];if(y.func===r&&Qn(y.options,f)){d.splice(p,1),d.length||(l.splice(a,1),s(n,e,u),s(n,e,c,!0)),h=!0;break}}if(h)break}}},delegateListener:u,delegateUseCapture:c,delegatedEvents:i,documents:r,targets:e,supportsOptions:!1,supportsPassive:!1};function a(t,n,i,r){if(t.addEventListener){var a=Jn(r),s=zt(e,(function(n){return n.eventTarget===t}));s||e.push(s={eventTarget:t,events:{}}),s.events[n]||(s.events[n]=[]),zt(s.events[n],(function(t){return t.func===i&&Qn(t.options,a)}))||(t.addEventListener(n,i,o.supportsOptions?a:a.capture),s.events[n].push({func:i,options:a}))}}function s(t,n,i,r){if(t.addEventListener&&t.removeEventListener){var a=St(e,(function(n){return n.eventTarget===t})),u=e[a];if(u&&u.events)if("all"!==n){var c=!1,f=u.events[n];if(f){if("all"===i){for(var l=f.length-1;l>=0;l--){var h=f[l];s(t,n,h.func,h.options)}return}for(var v=Jn(r),d=0;d<f.length;d++){var p=f[d];if(p.func===i&&Qn(p.options,v)){t.removeEventListener(n,i,o.supportsOptions?v:v.capture),f.splice(d,1),0===f.length&&(delete u.events[n],c=!0);break}}}c&&!Object.keys(u.events).length&&e.splice(a,1)}else for(n in u.events)u.events.hasOwnProperty(n)&&s(t,n,"all")}}function u(t,n){for(var e=Jn(n),r=new Hn(t),o=i[t.type],a=Mt(t)[0],s=a;I(s);){for(var u=0;u<o.length;u++){var c=o[u],f=c.context;if(V(s,c.selector)&&L(f,a)&&L(f,s)){var l=c.listeners;r.currentTarget=s;for(var h=0;h<l.length;h++){var v=l[h];Qn(v.options,e)&&v.func(r)}}}s=N(s)}}function c(t){return u(t,!0)}return null==(n=t.document)||n.createElement("div").addEventListener("test",null,{get capture(){return o.supportsOptions=!0},get passive(){return o.supportsPassive=!0}}),t.events=o,o}},te={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(t){for(var n=0,e=te.methodOrder;n<e.length;n++){var i=te[e[n]](t);if(i)return i}return null},simulationResume:function(t){var n=t.pointerType,e=t.eventTarget,i=t.scope;if(!/down|start/i.test(t.eventType))return null;for(var r=0,o=i.interactions.list;r<o.length;r++){var a=o[r],s=e;if(a.simulation&&a.simulation.allowResume&&a.pointerType===n)for(;s;){if(s===a.element)return a;s=N(s)}}return null},mouseOrPen:function(t){var n,e=t.pointerId,i=t.pointerType,r=t.eventType,o=t.scope;if("mouse"!==i&&"pen"!==i)return null;for(var a=0,s=o.interactions.list;a<s.length;a++){var u=s[a];if(u.pointerType===i){if(u.simulation&&!ne(u,e))continue;if(u.interacting())return u;n||(n=u)}}if(n)return n;for(var c=0,f=o.interactions.list;c<f.length;c++){var l=f[c];if(!(l.pointerType!==i||/down/i.test(r)&&l.simulation))return l}return null},hasPointer:function(t){for(var n=t.pointerId,e=0,i=t.scope.interactions.list;e<i.length;e++){var r=i[e];if(ne(r,n))return r}return null},idle:function(t){for(var n=t.pointerType,e=0,i=t.scope.interactions.list;e<i.length;e++){var r=i[e];if(1===r.pointers.length){var o=r.interactable;if(o&&(!o.options.gesture||!o.options.gesture.enabled))continue}else if(r.pointers.length>=2)continue;if(!r.interacting()&&n===r.pointerType)return r}return null}};function ne(t,n){return t.pointers.some((function(t){return t.id===n}))}var ee=te,ie=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function re(t,n){return function(e){var i=n.interactions.list,r=kt(e),o=Mt(e),a=o[0],s=o[1],u=[];if(/^touch/.test(e.type)){n.prevTouchTime=n.now();for(var c=0,f=e.changedTouches;c<f.length;c++){var l=f[c],h={pointer:l,pointerId:yt(l),pointerType:r,eventType:e.type,eventTarget:a,curEventTarget:s,scope:n},v=oe(h);u.push([h.pointer,h.eventTarget,h.curEventTarget,v])}}else{var d=!1;if(!$.supportsPointerEvent&&/mouse/.test(e.type)){for(var p=0;p<i.length&&!d;p++)d="mouse"!==i[p].pointerType&&i[p].pointerIsDown;d=d||n.now()-n.prevTouchTime<500||0===e.timeStamp}if(!d){var y={pointer:e,pointerId:yt(e),pointerType:r,eventType:e.type,curEventTarget:s,eventTarget:a,scope:n},g=oe(y);u.push([y.pointer,y.eventTarget,y.curEventTarget,g])}}for(var m=0;m<u.length;m++){var b=u[m];b[3][t](b[0],e,b[1],b[2])}}}function oe(t){var n=t.pointerType,e=t.scope,i={interaction:ee.search(t),searchDetails:t};return e.fire("interactions:find",i),i.interaction||e.interactions.new({pointerType:n})}function ae(t,n){var e=t.doc,i=t.scope,r=t.options,o=i.interactions.docEvents,a=i.events,s=a[n];for(var u in i.browser.isIOS&&!r.events&&(r.events={passive:!1}),a.delegatedEvents)s(e,u,a.delegateListener),s(e,u,a.delegateUseCapture,!0);for(var c=r&&r.events,f=0;f<o.length;f++){var l=o[f];s(e,l.type,l.listener,c)}}var se={id:"core/interactions",install:function(t){for(var n={},e=0;e<ie.length;e++){var i=ie[e];n[i]=re(i,t)}var o,s=$.pEventTypes;function c(){for(var n=0,e=t.interactions.list;n<e.length;n++){var i=e[n];if(i.pointerIsDown&&"touch"===i.pointerType&&!i._interacting)for(var r=function(){var n=a[o];t.documents.some((function(t){return L(t.doc,n.downTarget)}))||i.removePointer(n.pointer,n.event)},o=0,a=i.pointers;o<a.length;o++)r()}}(o=X.PointerEvent?[{type:s.down,listener:c},{type:s.down,listener:n.pointerDown},{type:s.move,listener:n.pointerMove},{type:s.up,listener:n.pointerUp},{type:s.cancel,listener:n.pointerUp}]:[{type:"mousedown",listener:n.pointerDown},{type:"mousemove",listener:n.pointerMove},{type:"mouseup",listener:n.pointerUp},{type:"touchstart",listener:c},{type:"touchstart",listener:n.pointerDown},{type:"touchmove",listener:n.pointerMove},{type:"touchend",listener:n.pointerUp},{type:"touchcancel",listener:n.pointerUp}]).push({type:"blur",listener:function(n){for(var e=0,i=t.interactions.list;e<i.length;e++)i[e].documentBlur(n)}}),t.prevTouchTime=0,t.Interaction=function(n){u(i,n);var e=h(i);function i(){return r(this,i),e.apply(this,arguments)}return a(i,[{key:"pointerMoveTolerance",get:function(){return t.interactions.pointerMoveTolerance},set:function(n){t.interactions.pointerMoveTolerance=n}},{key:"_now",value:function(){return t.now()}}]),i}(Fn),t.interactions={list:[],new:function(n){n.scopeFire=function(n,e){return t.fire(n,e)};var e=new t.Interaction(n);return t.interactions.list.push(e),e},listeners:n,docEvents:o,pointerMoveTolerance:1},t.usePlugin(Mn)},listeners:{"scope:add-document":function(t){return ae(t,"add")},"scope:remove-document":function(t){return ae(t,"remove")},"interactable:unset":function(t,n){for(var e=t.interactable,i=n.interactions.list.length-1;i>=0;i--){var r=n.interactions.list[i];r.interactable===e&&(r.stop(),n.fire("interactions:destroy",{interaction:r}),r.destroy(),n.interactions.list.length>2&&n.interactions.list.splice(i,1))}}},onDocSignal:ae,doOnInteractions:re,methodNames:ie},ue=function(t){return t[t.On=0]="On",t[t.Off=1]="Off",t}(ue||{}),ce=function(){function t(n,e,i,o){r(this,t),s(this,"target",void 0),s(this,"options",void 0),s(this,"_actions",void 0),s(this,"events",new Wn),s(this,"_context",void 0),s(this,"_win",void 0),s(this,"_doc",void 0),s(this,"_scopeEvents",void 0),this._actions=e.actions,this.target=n,this._context=e.context||i,this._win=b(Q(n)?this._context:n),this._doc=this._win.document,this._scopeEvents=o,this.set(e)}return a(t,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,n){return T(n.onstart)&&this.on("".concat(t,"start"),n.onstart),T(n.onmove)&&this.on("".concat(t,"move"),n.onmove),T(n.onend)&&this.on("".concat(t,"end"),n.onend),T(n.oninertiastart)&&this.on("".concat(t,"inertiastart"),n.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,n,e){var i,r=this,o=null==(i=this._actions.map[t])?void 0:i.filterEventType,a=function(t){return(null==o||o(t))&&En(t,r._actions)};(j(n)||E(n))&&this._onOff(ue.Off,t,n,void 0,a),(j(e)||E(e))&&this._onOff(ue.On,t,e,void 0,a)}},{key:"setPerAction",value:function(t,n){var e=this._defaults;for(var i in n){var r=i,o=this.options[t],a=n[r];"listeners"===r&&this.updatePerActionListeners(t,o.listeners,a),j(a)?o[r]=Ot(a):P(a)?(o[r]=Z(o[r]||{},Tn(a)),E(e.perAction[r])&&"enabled"in e.perAction[r]&&(o[r].enabled=!1!==a.enabled)):S(a)&&E(e.perAction[r])?o[r].enabled=a:o[r]=a}}},{key:"getRect",value:function(t){return t=t||(I(this.target)?this.target:null),z(this.target)&&(t=t||this._context.querySelector(this.target)),H(t)}},{key:"rectChecker",value:function(t){var n=this;return T(t)?(this.getRect=function(e){var i=Z({},t.apply(n,e));return"width"in i||(i.width=i.right-i.left,i.height=i.bottom-i.top),i},this):null===t?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,n){if(Q(n)||E(n)){for(var e in this.options[t]=n,this._actions.map)this.options[e][t]=n;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return"page"===t||"client"===t?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return z(t)?Array.from(this._context.querySelectorAll(t)):T(t)&&t.getAllElements?t.getAllElements():I(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||L(this._context,t)}},{key:"testIgnoreAllow",value:function(t,n,e){return!this.testIgnore(t.ignoreFrom,n,e)&&this.testAllow(t.allowFrom,n,e)}},{key:"testAllow",value:function(t,n,e){return!t||!!I(e)&&(z(t)?G(e,t,n):!!I(t)&&L(t,e))}},{key:"testIgnore",value:function(t,n,e){return!(!t||!I(e))&&(z(t)?G(e,t,n):!!I(t)&&L(t,e))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,n,e,i,r){E(n)&&!j(n)&&(i=e,e=null);var o=at(n,e,r);for(var a in o){"wheel"===a&&(a=$.wheelEvent);for(var s=0,u=o[a];s<u.length;s++){var c=u[s];En(a,this._actions)?this.events[t===ue.On?"on":"off"](a,c):z(this.target)?this._scopeEvents[t===ue.On?"addDelegate":"removeDelegate"](this.target,this._context,a,c,i):this._scopeEvents[t===ue.On?"add":"remove"](this.target,a,c,i)}}return this}},{key:"on",value:function(t,n,e){return this._onOff(ue.On,t,n,e)}},{key:"off",value:function(t,n,e){return this._onOff(ue.Off,t,n,e)}},{key:"set",value:function(t){var n=this._defaults;for(var e in E(t)||(t={}),this.options=Tn(n.base),this._actions.methodDict){var i=e,r=this._actions.methodDict[i];this.options[i]={},this.setPerAction(i,Z(Z({},n.perAction),n.actions[i])),this[r](t[i])}for(var o in t)"getRect"!==o?T(this[o])&&this[o](t[o]):this.rectChecker(t.getRect);return this}},{key:"unset",value:function(){if(z(this.target))for(var t in this._scopeEvents.delegatedEvents)for(var n=this._scopeEvents.delegatedEvents[t],e=n.length-1;e>=0;e--){var i=n[e],r=i.listeners;i.selector===this.target&&i.context===this._context&&n.splice(e,1);for(var o=r.length-1;o>=0;o--)this._scopeEvents.removeDelegate(this.target,this._context,t,r[o][0],r[o][1])}else this._scopeEvents.remove(this.target,"all")}}]),t}(),fe=function(){function t(n){var e=this;r(this,t),s(this,"list",[]),s(this,"selectorMap",{}),s(this,"scope",void 0),this.scope=n,n.addListeners({"interactable:unset":function(t){var n=t.interactable,i=n.target,r=z(i)?e.selectorMap[i]:i[e.scope.id],o=St(r,(function(t){return t===n}));r.splice(o,1)}})}return a(t,[{key:"new",value:function(t,n){n=Z(n||{},{actions:this.scope.actions});var e=new this.scope.Interactable(t,n,this.scope.document,this.scope.events);return this.scope.addDocument(e._doc),this.list.push(e),z(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(e)):(e.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(e)),this.scope.fire("interactable:new",{target:t,options:n,interactable:e,win:this.scope._win}),e}},{key:"getExisting",value:function(t,n){var e=n&&n.context||this.scope.document,i=z(t),r=i?this.selectorMap[t]:t[this.scope.id];if(r)return zt(r,(function(n){return n._context===e&&(i||n.inContext(t))}))}},{key:"forEachMatch",value:function(t,n){for(var e=0,i=this.list;e<i.length;e++){var r=i[e],o=void 0;if((z(r.target)?I(t)&&V(t,r.target):t===r.target)&&r.inContext(t)&&(o=n(r)),void 0!==o)return o}}}]),t}();function le(t){return t&&t.replace(/\/.*$/,"")}var he=new(function(){function t(){var n=this;r(this,t),s(this,"id","__interact_scope_".concat(Math.floor(100*Math.random()))),s(this,"isInitialized",!1),s(this,"listenerMaps",[]),s(this,"browser",$),s(this,"defaults",Tn(jn)),s(this,"Eventable",Wn),s(this,"actions",{map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}}),s(this,"interactStatic",function(t){var n=function n(e,i){var r=t.interactables.getExisting(e,i);return r||((r=t.interactables.new(e,i)).events.global=n.globalEvents),r};return n.getPointerAverage=mt,n.getTouchBBox=bt,n.getTouchDistance=wt,n.getTouchAngle=xt,n.getElementRect=H,n.getElementClientRect=W,n.matchesSelector=V,n.closest=U,n.globalEvents={},n.version="1.10.25",n.scope=t,n.use=function(t,n){return this.scope.usePlugin(t,n),this},n.isSet=function(t,n){return!!this.scope.interactables.get(t,n&&n.context)},n.on=en((function(t,n,e){if(z(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),j(t)){for(var i=0,r=t;i<r.length;i++)this.on(r[i],n,e);return this}if(E(t)){for(var o in t)this.on(o,t[o],n);return this}return En(t,this.scope.actions)?this.globalEvents[t]?this.globalEvents[t].push(n):this.globalEvents[t]=[n]:this.scope.events.add(this.scope.document,t,n,{options:e}),this}),"The interact.on() method is being deprecated"),n.off=en((function(t,n,e){if(z(t)&&-1!==t.search(" ")&&(t=t.trim().split(/ +/)),j(t)){for(var i=0,r=t;i<r.length;i++)this.off(r[i],n,e);return this}if(E(t)){for(var o in t)this.off(o,t[o],n);return this}var a;return En(t,this.scope.actions)?t in this.globalEvents&&-1!==(a=this.globalEvents[t].indexOf(n))&&this.globalEvents[t].splice(a,1):this.scope.events.remove(this.scope.document,t,n,e),this}),"The interact.off() method is being deprecated"),n.debug=function(){return this.scope},n.supportsTouch=function(){return $.supportsTouch},n.supportsPointerEvent=function(){return $.supportsPointerEvent},n.stop=function(){for(var t=0,n=this.scope.interactions.list;t<n.length;t++)n[t].stop();return this},n.pointerMoveTolerance=function(t){return O(t)?(this.scope.interactions.pointerMoveTolerance=t,this):this.scope.interactions.pointerMoveTolerance},n.addDocument=function(t,n){this.scope.addDocument(t,n)},n.removeDocument=function(t){this.scope.removeDocument(t)},n}(this)),s(this,"InteractEvent",_n),s(this,"Interactable",void 0),s(this,"interactables",new fe(this)),s(this,"_win",void 0),s(this,"document",void 0),s(this,"window",void 0),s(this,"documents",[]),s(this,"_plugins",{list:[],map:{}}),s(this,"onWindowUnload",(function(t){return n.removeDocument(t.target)}));var e=this;this.Interactable=function(t){u(i,t);var n=h(i);function i(){return r(this,i),n.apply(this,arguments)}return a(i,[{key:"_defaults",get:function(){return e.defaults}},{key:"set",value:function(t){return v(c(i.prototype),"set",this).call(this,t),e.fire("interactable:set",{options:t,interactable:this}),this}},{key:"unset",value:function(){v(c(i.prototype),"unset",this).call(this);var t=e.interactables.list.indexOf(this);t<0||(e.interactables.list.splice(t,1),e.fire("interactable:unset",{interactable:this}))}}]),i}(ce)}return a(t,[{key:"addListeners",value:function(t,n){this.listenerMaps.push({id:n,map:t})}},{key:"fire",value:function(t,n){for(var e=0,i=this.listenerMaps;e<i.length;e++){var r=i[e].map[t];if(r&&!1===r(n,this,t))return!1}}},{key:"init",value:function(t){return this.isInitialized?this:function(t,n){return t.isInitialized=!0,k(n)&&m(n),X.init(n),$.init(n),Jt(n),t.window=n,t.document=n.document,t.usePlugin(se),t.usePlugin(Zn),t}(this,t)}},{key:"pluginIsInstalled",value:function(t){var n=t.id;return n?!!this._plugins.map[n]:-1!==this._plugins.list.indexOf(t)}},{key:"usePlugin",value:function(t,n){if(!this.isInitialized)return this;if(this.pluginIsInstalled(t))return this;if(t.id&&(this._plugins.map[t.id]=t),this._plugins.list.push(t),t.install&&t.install(this,n),t.listeners&&t.before){for(var e=0,i=this.listenerMaps.length,r=t.before.reduce((function(t,n){return t[n]=!0,t[le(n)]=!0,t}),{});e<i;e++){var o=this.listenerMaps[e].id;if(o&&(r[o]||r[le(o)]))break}this.listenerMaps.splice(e,0,{id:t.id,map:t.listeners})}else t.listeners&&this.listenerMaps.push({id:t.id,map:t.listeners});return this}},{key:"addDocument",value:function(t,n){if(-1!==this.getDocIndex(t))return!1;var e=b(t);n=n?Z({},n):{},this.documents.push({doc:t,options:n}),this.events.documents.push(t),t!==this.document&&this.events.add(e,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:t,window:e,scope:this,options:n})}},{key:"removeDocument",value:function(t){var n=this.getDocIndex(t),e=b(t),i=this.documents[n].options;this.events.remove(e,"unload",this.onWindowUnload),this.documents.splice(n,1),this.events.documents.splice(n,1),this.fire("scope:remove-document",{doc:t,window:e,scope:this,options:i})}},{key:"getDocIndex",value:function(t){for(var n=0;n<this.documents.length;n++)if(this.documents[n].doc===t)return n;return-1}},{key:"getDocOptions",value:function(t){var n=this.getDocIndex(t);return-1===n?null:this.documents[n].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),t}()),ve=he.interactStatic,de="undefined"!=typeof globalThis?globalThis:window;he.init(de);var pe=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(t){var n=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter((function(n){return n[0]in t||n[1]in t})),e=function(e,i){for(var r=t.limits,o=void 0===r?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:r,a=t.offset,s=void 0===a?{x:0,y:0}:a,u={range:t.range,grid:t,x:null,y:null},c=0;c<n.length;c++){var f=n[c],l=f[0],h=f[1],v=Math.round((e-s.x)/t[l]),d=Math.round((i-s.y)/t[h]);u[l]=Math.max(o.left,Math.min(o.right,v*t[l]+s.x)),u[h]=Math.max(o.top,Math.min(o.bottom,d*t[h]+s.y))}return u};return e.grid=t,e.coordFields=n,e}}),ye={id:"snappers",install:function(t){var n=t.interactStatic;n.snappers=Z(n.snappers||{},pe),n.createSnapGrid=n.snappers.grid}};function ge(t,n,e){var i=t.startCoords,r=t.edgeSign;n?e.y=i.y+(e.x-i.x)*r.y:e.x=i.x+(e.y-i.y)*r.x}function me(t,n,e,i){var r=t.startRect,o=t.startCoords,a=t.ratio,s=t.edgeSign;n?e.y=o.y+(i.width/a-r.height)*s.y:e.x=o.x+(i.height*a-r.width)*s.x}var be=zn({start:function(t){var n=t.state,i=t.rect,r=t.edges,o=n.options,a=o.ratio,s=o.enabled,u=n.options,c=u.equalDelta,f=u.modifiers;"preserve"===a&&(a=i.width/i.height),n.startCoords=Z({},t.pageCoords),n.startRect=Z({},i),n.ratio=a,n.equalDelta=c;var l=n.linkedEdges={top:r.top||r.left&&!r.bottom,left:r.left||r.top&&!r.right,bottom:r.bottom||r.right&&!r.top,right:r.right||r.bottom&&!r.left};if(n.xIsPrimaryAxis=!(!r.left&&!r.right),n.equalDelta){var h=(l.left?1:-1)*(l.top?1:-1);n.edgeSign={x:h,y:h}}else n.edgeSign={x:l.left?-1:1,y:l.top?-1:1};if(!1!==s&&Z(r,l),null!=f&&f.length){var v=new On(t.interaction);v.copyFrom(t.interaction.modification),v.prepareStates(f),n.subModification=v,v.startAll(e({},t))}},set:function(t){var n=t.state,i=t.rect,r=t.coords,o=n.linkedEdges,a=Z({},r),s=n.equalDelta?ge:me;if(Z(t.edges,o),s(n,n.xIsPrimaryAxis,r,i),!n.subModification)return null;var u=Z({},i);rt(o,u,{x:r.x-a.x,y:r.y-a.y});var c=n.subModification.setAll(e(e({},t),{},{rect:u,edges:o,pageCoords:r,prevCoords:r,prevRect:u})),f=c.delta;return c.changed&&(s(n,Math.abs(f.x)>Math.abs(f.y),c.coords,c.rect),Z(r,c.coords)),c.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}},"aspectRatio"),we=function(){};we._defaults={};var xe=we;function ke(t,n,e){return T(t)?nt(t,n.interactable,n.element,[e.x,e.y,n]):nt(t,n.interactable,n.element)}var Me={start:function(t){var n=t.rect,e=t.startOffset,i=t.state,r=t.interaction,o=t.pageCoords,a=i.options,s=a.elementRect,u=Z({left:0,top:0,right:0,bottom:0},a.offset||{});if(n&&s){var c=ke(a.restriction,r,o);if(c){var f=c.right-c.left-n.width,l=c.bottom-c.top-n.height;f<0&&(u.left+=f,u.right+=f),l<0&&(u.top+=l,u.bottom+=l)}u.left+=e.left-n.width*s.left,u.top+=e.top-n.height*s.top,u.right+=e.right-n.width*(1-s.right),u.bottom+=e.bottom-n.height*(1-s.bottom)}i.offset=u},set:function(t){var n=t.coords,e=t.state,i=e.offset,r=ke(e.options.restriction,t.interaction,n);if(r){var o=function(t){return!t||"left"in t&&"top"in t||((t=Z({},t)).left=t.x||0,t.top=t.y||0,t.right=t.right||t.left+t.width,t.bottom=t.bottom||t.top+t.height),t}(r);n.x=Math.max(Math.min(o.right-i.right,n.x),o.left+i.left),n.y=Math.max(Math.min(o.bottom-i.bottom,n.y),o.top+i.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Ee=zn(Me,"restrict"),Te={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Oe={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Se(t,n){for(var e=0,i=["top","left","bottom","right"];e<i.length;e++){var r=i[e];r in t||(t[r]=n[r])}return t}var ze={noInner:Te,noOuter:Oe,start:function(t){var n,e=t.interaction,i=t.startOffset,r=t.state,o=r.options;o&&(n=et(ke(o.offset,e,e.coords.start.page))),r.offset={top:(n=n||{x:0,y:0}).y+i.top,left:n.x+i.left,bottom:n.y-i.bottom,right:n.x-i.right}},set:function(t){var n=t.coords,e=t.edges,i=t.interaction,r=t.state,o=r.offset,a=r.options;if(e){var s=Z({},n),u=ke(a.inner,i,s)||{},c=ke(a.outer,i,s)||{};Se(u,Te),Se(c,Oe),e.top?n.y=Math.min(Math.max(c.top+o.top,s.y),u.top+o.top):e.bottom&&(n.y=Math.max(Math.min(c.bottom+o.bottom,s.y),u.bottom+o.bottom)),e.left?n.x=Math.min(Math.max(c.left+o.left,s.x),u.left+o.left):e.right&&(n.x=Math.max(Math.min(c.right+o.right,s.x),u.right+o.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},Ie=zn(ze,"restrictEdges"),Pe=Z({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(t){}},Me.defaults),je=zn({start:Me.start,set:Me.set,defaults:Pe},"restrictRect"),_e={width:-1/0,height:-1/0},De={width:1/0,height:1/0},Re=zn({start:function(t){return ze.start(t)},set:function(t){var n=t.interaction,e=t.state,i=t.rect,r=t.edges,o=e.options;if(r){var a=it(ke(o.min,n,t.coords))||_e,s=it(ke(o.max,n,t.coords))||De;e.options={endOnly:o.endOnly,inner:Z({},ze.noInner),outer:Z({},ze.noOuter)},r.top?(e.options.inner.top=i.bottom-a.height,e.options.outer.top=i.bottom-s.height):r.bottom&&(e.options.inner.bottom=i.top+a.height,e.options.outer.bottom=i.top+s.height),r.left?(e.options.inner.left=i.right-a.width,e.options.outer.left=i.right-s.width):r.right&&(e.options.inner.right=i.left+a.width,e.options.outer.right=i.left+s.width),ze.set(t),e.options=o}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),Ae={start:function(t){var n,e=t.interaction,i=t.interactable,r=t.element,o=t.rect,a=t.state,s=t.startOffset,u=a.options,c=u.offsetWithOrigin?function(t){var n=t.interaction.element;return et(nt(t.state.options.origin,null,null,[n]))||ot(t.interactable,n,t.interaction.prepared.name)}(t):{x:0,y:0};if("startCoords"===u.offset)n={x:e.coords.start.page.x,y:e.coords.start.page.y};else{var f=nt(u.offset,i,r,[e]);(n=et(f)||{x:0,y:0}).x+=c.x,n.y+=c.y}var l=u.relativePoints;a.offsets=o&&l&&l.length?l.map((function(t,e){return{index:e,relativePoint:t,x:s.left-o.width*t.x+n.x,y:s.top-o.height*t.y+n.y}})):[{index:0,relativePoint:null,x:n.x,y:n.y}]},set:function(t){var n=t.interaction,e=t.coords,i=t.state,r=i.options,o=i.offsets,a=ot(n.interactable,n.element,n.prepared.name),s=Z({},e),u=[];r.offsetWithOrigin||(s.x-=a.x,s.y-=a.y);for(var c=0,f=o;c<f.length;c++)for(var l=f[c],h=s.x-l.x,v=s.y-l.y,d=0,p=r.targets.length;d<p;d++){var y,g=r.targets[d];(y=T(g)?g(h,v,n._proxy,l,d):g)&&u.push({x:(O(y.x)?y.x:h)+l.x,y:(O(y.y)?y.y:v)+l.y,range:O(y.range)?y.range:r.range,source:g,index:d,offset:l})}for(var m={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},b=0;b<u.length;b++){var w=u[b],x=w.range,k=w.x-s.x,M=w.y-s.y,E=ut(k,M),S=E<=x;x===1/0&&m.inRange&&m.range!==1/0&&(S=!1),m.target&&!(S?m.inRange&&x!==1/0?E/x<m.distance/m.range:x===1/0&&m.range!==1/0||E<m.distance:!m.inRange&&E<m.distance)||(m.target=w,m.distance=E,m.range=x,m.inRange=S,m.delta.x=k,m.delta.y=M)}return m.inRange&&(e.x=m.target.x,e.y=m.target.y),i.closest=m,m},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},Ce=zn(Ae,"snap"),Fe={start:function(t){var n=t.state,e=t.edges,i=n.options;if(!e)return null;t.state={options:{targets:null,relativePoints:[{x:e.left?0:1,y:e.top?0:1}],offset:i.offset||"self",origin:{x:0,y:0},range:i.range}},n.targetFields=n.targetFields||[["width","height"],["x","y"]],Ae.start(t),n.offsets=t.state.offsets,t.state=n},set:function(t){var n=t.interaction,e=t.state,i=t.coords,r=e.options,o=e.offsets,a={x:i.x-o[0].x,y:i.y-o[0].y};e.options=Z({},r),e.options.targets=[];for(var s=0,u=r.targets||[];s<u.length;s++){var c=u[s],f=void 0;if(f=T(c)?c(a.x,a.y,n):c){for(var l=0,h=e.targetFields;l<h.length;l++){var v=h[l],d=v[0],p=v[1];if(d in f||p in f){f.x=f[d],f.y=f[p];break}}e.options.targets.push(f)}}var y=Ae.set(t);return e.options=r,y},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},Xe=zn(Fe,"snapSize"),Ye={aspectRatio:be,restrictEdges:Ie,restrict:Ee,restrictRect:je,restrictSize:Re,snapEdges:zn({start:function(t){var n=t.edges;return n?(t.state.targetFields=t.state.targetFields||[[n.left?"left":"right",n.top?"top":"bottom"]],Fe.start(t)):null},set:Fe.set,defaults:Z(Tn(Fe.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:Ce,snapSize:Xe,spring:xe,avoid:xe,transform:xe,rubberband:xe},$e={id:"modifiers",install:function(t){var n=t.interactStatic;for(var e in t.usePlugin(Pn),t.usePlugin(ye),n.modifiers=Ye,Ye){var i=Ye[e],r=i._defaults;r._methods=i._methods,t.defaults.perAction[e]=r}}},Le=function(t){u(e,t);var n=h(e);function e(t,i,o,a,s,u){var c;if(r(this,e),ft(l(c=n.call(this,s)),o),o!==i&&ft(l(c),i),c.timeStamp=u,c.originalEvent=o,c.type=t,c.pointerId=yt(i),c.pointerType=kt(i),c.target=a,c.currentTarget=null,"tap"===t){var f=s.getPointerIndex(i);c.dt=c.timeStamp-s.pointers[f].downTime,c.double=!!s.prevTap&&"doubletap"!==s.prevTap.type&&s.prevTap.target===c.target&&c.timeStamp-s.tapTime<500}else"doubletap"===t&&(c.dt=i.timeStamp-s.tapTime,c.double=!0);return c}return a(e,[{key:"_subtractOrigin",value:function(t){var n=t.x,e=t.y;return this.pageX-=n,this.pageY-=e,this.clientX-=n,this.clientY-=e,this}},{key:"_addOrigin",value:function(t){var n=t.x,e=t.y;return this.pageX+=n,this.pageY+=e,this.clientX+=n,this.clientY+=e,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),e}(Et),Ue={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(t){t.pointerEvents=Ue,t.defaults.actions.pointerEvents=Ue.defaults,Z(t.actions.phaselessTypes,Ue.types)},listeners:{"interactions:new":function(t){var n=t.interaction;n.prevTap=null,n.tapTime=0},"interactions:update-pointer":function(t){var n=t.pointerInfo;!t.down&&n.hold||(n.hold={duration:1/0,timeout:null})},"interactions:move":function(t,n){var e=t.interaction,i=t.pointer,r=t.event,o=t.eventTarget;t.duplicate||e.pointerIsDown&&!e.pointerWasMoved||(e.pointerIsDown&&Be(t),Ne({interaction:e,pointer:i,event:r,eventTarget:o,type:"move"},n))},"interactions:down":function(t,n){!function(t,n){for(var e=t.interaction,i=t.pointer,r=t.event,o=t.eventTarget,a=e.pointers[t.pointerIndex].hold,s=J(o),u={interaction:e,pointer:i,event:r,eventTarget:o,type:"hold",targets:[],path:s,node:null},c=0;c<s.length;c++)u.node=s[c],n.fire("pointerEvents:collect-targets",u);if(u.targets.length){for(var f=1/0,l=0,h=u.targets;l<h.length;l++){var v=h[l].eventable.options.holdDuration;v<f&&(f=v)}a.duration=f,a.timeout=setTimeout((function(){Ne({interaction:e,eventTarget:o,pointer:i,event:r,type:"hold"},n)}),f)}}(t,n),Ne(t,n)},"interactions:up":function(t,n){Be(t),Ne(t,n),function(t,n){var e=t.interaction;e.pointerWasMoved||Ne({interaction:e,eventTarget:t.eventTarget,pointer:t.pointer,event:t.event,type:"tap"},n)}(t,n)},"interactions:cancel":function(t,n){Be(t),Ne(t,n)}},PointerEvent:Le,fire:Ne,collectEventTargets:Ve,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function Ne(t,n){var e=t.interaction,i=t.pointer,r=t.event,o=t.eventTarget,a=t.type,s=t.targets,u=void 0===s?Ve(t,n):s,c=new Le(a,i,r,o,e,n.now());n.fire("pointerEvents:new",{pointerEvent:c});for(var f={interaction:e,pointer:i,event:r,eventTarget:o,targets:u,type:a,pointerEvent:c},l=0;l<u.length;l++){var h=u[l];for(var v in h.props||{})c[v]=h.props[v];var d=ot(h.eventable,h.node);if(c._subtractOrigin(d),c.eventable=h.eventable,c.currentTarget=h.node,h.eventable.fire(c),c._addOrigin(d),c.immediatePropagationStopped||c.propagationStopped&&l+1<u.length&&u[l+1].node!==c.currentTarget)break}if(n.fire("pointerEvents:fired",f),"tap"===a){var p=c.double?Ne({interaction:e,pointer:i,event:r,eventTarget:o,type:"doubletap"},n):c;e.prevTap=p,e.tapTime=p.timeStamp}return c}function Ve(t,n){var e=t.interaction,i=t.pointer,r=t.event,o=t.eventTarget,a=t.type,s=e.getPointerIndex(i),u=e.pointers[s];if("tap"===a&&(e.pointerWasMoved||!u||u.downTarget!==o))return[];for(var c=J(o),f={interaction:e,pointer:i,event:r,eventTarget:o,type:a,path:c,targets:[],node:null},l=0;l<c.length;l++)f.node=c[l],n.fire("pointerEvents:collect-targets",f);return"hold"===a&&(f.targets=f.targets.filter((function(t){var n,i;return t.eventable.options.holdDuration===(null==(n=e.pointers[s])||null==(i=n.hold)?void 0:i.duration)}))),f.targets}function Be(t){var n=t.interaction.pointers[t.pointerIndex].hold;n&&n.timeout&&(clearTimeout(n.timeout),n.timeout=null)}var qe=Object.freeze({__proto__:null,default:Ue});function Ge(t){var n=t.interaction;n.holdIntervalHandle&&(clearInterval(n.holdIntervalHandle),n.holdIntervalHandle=null)}var Ke={id:"pointer-events/holdRepeat",install:function(t){t.usePlugin(Ue);var n=t.pointerEvents;n.defaults.holdRepeatInterval=0,n.types.holdrepeat=t.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce((function(t,n){return t["pointerEvents:".concat(n)]=Ge,t}),{"pointerEvents:new":function(t){var n=t.pointerEvent;"hold"===n.type&&(n.count=(n.count||0)+1)},"pointerEvents:fired":function(t,n){var e=t.interaction,i=t.pointerEvent,r=t.eventTarget,o=t.targets;if("hold"===i.type&&o.length){var a=o[0].eventable.options.holdRepeatInterval;a<=0||(e.holdIntervalHandle=setTimeout((function(){n.pointerEvents.fire({interaction:e,eventTarget:r,type:"hold",pointer:i,event:i},n)}),a))}}})},We={id:"pointer-events/interactableTargets",install:function(t){var n=t.Interactable;n.prototype.pointerEvents=function(t){return Z(this.events.options,t),this};var e=n.prototype._backCompatOption;n.prototype._backCompatOption=function(t,n){var i=e.call(this,t,n);return i===this&&(this.events.options[t]=n),i}},listeners:{"pointerEvents:collect-targets":function(t,n){var e=t.targets,i=t.node,r=t.type,o=t.eventTarget;n.interactables.forEachMatch(i,(function(t){var n=t.events;n.types[r]&&n.types[r].length&&t.testIgnoreAllow(n.options,i,o)&&e.push({node:i,eventable:n,props:{interactable:t}})}))},"interactable:new":function(t){var n=t.interactable;n.events.getRect=function(t){return n.getRect(t)}},"interactable:set":function(t,n){var e=t.interactable,i=t.options;Z(e.events.options,n.pointerEvents.defaults),Z(e.events.options,i.pointerEvents||{})}}},He={id:"pointer-events",install:function(t){t.usePlugin(qe),t.usePlugin(Ke),t.usePlugin(We)}},Je={id:"reflow",install:function(t){var n=t.Interactable;t.actions.phases.reflow=!0,n.prototype.reflow=function(n){return function(t,n,e){for(var i=t.getAllElements(),r=e.window.Promise,o=r?[]:null,a=function(){var a=i[s],u=t.getRect(a);if(!u)return 1;var c,f=zt(e.interactions.list,(function(e){return e.interacting()&&e.interactable===t&&e.element===a&&e.prepared.name===n.name}));if(f)f.move(),o&&(c=f._reflowPromise||new r((function(t){f._reflowResolve=t})));else{var l=it(u),h=function(t){return{coords:t,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:l.x,y:l.y},client:{x:l.x,y:l.y},timeStamp:e.now()});c=function(t,n,e,i,r){var o=t.interactions.new({pointerType:"reflow"}),a={interaction:o,event:r,pointer:r,eventTarget:e,phase:"reflow"};o.interactable=n,o.element=e,o.prevEvent=r,o.updatePointer(r,r,e,!0),ht(o.coords.delta),rn(o.prepared,i),o._doPhase(a);var s=t.window.Promise,u=s?new s((function(t){o._reflowResolve=t})):void 0;return o._reflowPromise=u,o.start(i,n,e),o._interacting?(o.move(a),o.end(r)):(o.stop(),o._reflowResolve()),o.removePointer(r,r),u}(e,t,a,n,h)}o&&o.push(c)},s=0;s<i.length&&!a();s++);return o&&r.all(o).then((function(){return t}))}(this,n,t)}},listeners:{"interactions:stop":function(t,n){var e=t.interaction;"reflow"===e.pointerType&&(e._reflowResolve&&e._reflowResolve(),function(t,n){t.splice(t.indexOf(n),1)}(n.interactions.list,e))}}};if(ve.use(Mn),ve.use(Un),ve.use(He),ve.use(Gn),ve.use($e),ve.use(wn),ve.use(Gt),ve.use(nn),ve.use(Je),ve.default=ve,"object"===i(t)&&t)try{t.exports=ve}catch(n){}return ve.default=ve,ve}()}));export{e as i}
@@ -1 +0,0 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++){t=arguments[i];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))e[o]=t[o]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,i,s){function o(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{a(s.next(e))}catch(e){n(e)}}function l(e){try{a(s["throw"](e))}catch(e){n(e)}}function a(e){e.done?i(e.value):o(e.value).then(r,l)}a((s=s.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,o,n,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return a([e,t])}}function a(r){if(s)throw new TypeError("Generator is already executing.");while(i)try{if(s=1,o&&(n=r[0]&2?o["return"]:r[0]?o["throw"]||((n=o["return"])&&n.call(o),0):o.next)&&!(n=n.call(o,r[1])).done)return n;if(o=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;o=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){i.label=r[1];break}if(r[0]===6&&i.label<n[1]){i.label=n[1];n=r;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(r);break}if(n[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];o=0}finally{s=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var s=0,o=t.length,n;s<o;s++){if(n||!(s in t)){if(!n)n=Array.prototype.slice.call(t,0,s);n[s]=t[s]}}return e.concat(n||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-9bf2d124.system.js","./p-840827b7.system.js","./p-82b5e475.system.js","./p-187b20b7.system.js","./p-8aae8d16.system.js","./p-877c2b06.system.js","./p-05eb4fed.system.js","./p-6e9af353.system.js","./p-455d16dc.system.js","./p-ca13070e.system.js","./p-1ba9f457.system.js","./p-327858f0.system.js","./p-d8cd6b59.system.js","./p-dc9c4361.system.js","./p-3af6b910.system.js"],(function(e){"use strict";var t,i,s,o,n,r,l,a,d,c,p,u,h,m,v,f,g,b,x,y,w,_,k,I,E,S;return{setters:[function(e){t=e.r;i=e.c;s=e.h;o=e.H},function(){},function(e){n=e.V;r=e.b;l=e.u},function(e){a=e.r;d=e.b},function(e){c=e.g;p=e.a},function(e){u=e.S},function(e){h=e.j},function(e){m=e.a;v=e.i},function(e){f=e.g},function(e){g=e.c;b=e.d},function(e){x=e.D;y=e.P;w=e.J;_=e.a;k=e.F;I=e.b;E=e.T},function(e){S=e.V},function(){},function(){},function(){},function(){},function(){}],execute:function(){var C=function(e,t,i){return e.api.post("/templates/".concat(t,"/reminder/"),i).then((function(e){return e.data}))};var D=function(e,t,i,s){return e.api.put("/templates/".concat(t,"/reminder/").concat(i),s).then((function(e){return e.data}))};var L=function(e,t,i){return e.api.delete("/templates/".concat(t,"/reminder/").concat(i)).then((function(e){return e.data}))};var P='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var z=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.store=null;this.endpoint=n.getDefault();this.templateId=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}s=this;return[4,c(this.endpoint,this.templateId,true)];case 1:s.store=n.sent();console.log("[PREVIEW] Loading template ".concat(this.templateId),this.endpoint.session);return[3,3];case 2:o=n.sent();console.log("[PREVIEW] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new u(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handlePageRendered=function(e){var t=this;var i,s;var o=e.detail;var n=(s=(i=this.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.fields.filter((function(e){return e.page_sequence===o.pageNumber}));n.forEach((function(e){return a(e,o,d(p(t.store),e.role_name),{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t,i,n,r;if(!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return s(o,null,s("verdocs-loader",null))}var l=__spreadArray([],(r=(n=this.store)===null||n===void 0?void 0:n.state)===null||r===void 0?void 0:r.pages,true);l.sort((function(e,t){return e.sequence-t.sequence}));return s(o,null,l.map((function(t){return s("verdocs-template-document-page",{templateId:t.template_id,documentId:t.document_id,pageNumber:t.sequence,virtualWidth:612,virtualHeight:792,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))};return e}());z.style=P;var T='verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:none}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid #97979744}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:#00000089}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-direction:row;flex-direction:row}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}';var R='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';var U='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>';var A='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>';var N='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>';var M=e("verdocs_send",function(){function e(e){t(this,e);this.send=i(this,"send",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.searchContacts=i(this,"searchContacts",7);this.levels=[];this.store=null;this.endpoint=n.getDefault();this.templateId=null;this.environment="web";this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={}}e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o,n,r,l,a,d,p,h,m,v;var f=this;return __generator(this,(function(g){switch(g.label){case 0:g.trys.push([0,2,,3]);p=this.endpoint.loadSession();if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SEND] Unable to start builder session, must be authenticated");return[2]}h=this;return[4,c(this.endpoint,this.templateId,true)];case 1:h.store=g.sent();if(!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_sendable)){console.warn("[SEND] Template is not sendable",this.templateId)}if((s=(i=this.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.roles){m={};this.rolesCompleted={};(n=(o=this.store)===null||o===void 0?void 0:o.state)===null||n===void 0?void 0:n.roles.forEach((function(e){var t=e.sequence-1;m[t]||(m[t]=[]);var i="r-".concat(t,"-").concat(m[t].length);m[t].push(__assign(__assign({},e),{id:i}));if(e.full_name&&(e.email||e.phone)){f.rolesCompleted[i]=__assign(__assign({},e),{id:i})}}));this.rolesAtLevel=m;this.levels=Object.keys(m).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}if((r=p===null||p===void 0?void 0:p.session)===null||r===void 0?void 0:r.profile){this.sessionContacts.push({id:p.session.profile.id,name:"".concat(p.session.profile.first_name," ").concat(p.session.profile.last_name),email:p.session.profile.email,phone:p.session.profile.phone})}return[3,3];case 2:v=g.sent();console.log("[SEND] Error with preview session",v);(l=this.sdkError)===null||l===void 0?void 0:l.emit(new u(v.message,(a=v.response)===null||a===void 0?void 0:a.status,(d=v.response)===null||d===void 0?void 0:d.data));return[3,3];case 3:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return s("div",{class:"level-icon",innerHTML:U})}else if(e>=this.levels.length){return s("div",{class:"level-icon",innerHTML:N})}else{return s("div",{class:"level-icon",innerHTML:A})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t=this;var i,s;if(this.sending){console.log("Skipping duplicate send",e);return}console.log("Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;var o={template_id:this.templateId,name:(s=(i=this.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.name,environment:this.environment,roles:Object.values(this.rolesCompleted),prepared_fields:[]};console.log("[SEND] Creating envelope",o);h(this.endpoint,o).then((function(e){var i;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(i=t.send)===null||i===void 0?void 0:i.emit(__assign(__assign({},o),{envelope_id:e.id,envelope:e}))})).catch((function(e){console.log("Send error",e);t.sending=false}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t,i,n,r;var l=(((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.roles)||[]).map((function(e){return e.name}))||[];var a=Object.values(this.rolesCompleted).filter((function(e){return m(e.email)||v(e.phone)}));var c=a.length>=l.length;return s(o,{class:{sendable:(r=(n=this.store)===null||n===void 0?void 0:n.state)===null||r===void 0?void 0:r.is_sendable}},s("div",{class:"recipients"},s("div",{class:"left-line"}),s("div",{class:"level level-start"},this.getLevelIcon(-1),s("div",{class:"complete"},"Send Envelope")),this.levels.map((function(t){return s("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var i,o,n,r,a,c;var p=!t.email;var u="verdocs-send-recipient-".concat(t.name);return p?s("div",{class:"recipient",style:{backgroundColor:f(d(l,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:u},(o=(i=e.rolesCompleted[t.id])===null||i===void 0?void 0:i.full_name)!==null&&o!==void 0?o:t.name,s("div",{class:"icon",innerHTML:R}),e.showPickerForId===t.id&&s("verdocs-portal",{anchor:u,onClickAway:function(){return e.showPickerForId=""}},s("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(n=e.rolesCompleted[t.id])!==null&&n!==void 0?n:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}}))):s("div",{class:"recipient",style:{borderColor:f(d(l,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:u},(a=(r=e.rolesCompleted[t.id])===null||r===void 0?void 0:r.full_name)!==null&&a!==void 0?a:t.full_name,s("div",{class:"icon",innerHTML:R}),e.showPickerForId===t.id&&s("verdocs-portal",{anchor:u,onClickAway:function(){return e.showPickerForId=""}},s("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(c=e.rolesCompleted[t.id])!==null&&c!==void 0?c:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}})))})))})),s("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),s("div",{class:"complete"},"Signing Complete"))),s("div",{class:"buttons"},s("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),s("verdocs-button",{label:"Send",size:"small",disabled:!c||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&s("verdocs-spinner",null)))};return e}());M.style=T;var j='verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';var H=e("verdocs_template_attachments",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.templateUpdated=i(this,"templateUpdated",7);this.sdkError=i(this,"sdkError",7);this.endpoint=n.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.store=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}s=this;return[4,c(this.endpoint,this.templateId,false)];case 1:s.store=n.sent();return[3,3];case 2:o=n.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new u(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,s,o,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:e.stopPropagation();n=e.detail.file;if(!n){return[2]}console.log("[ATTACHMENTS] Uploading...",n);this.uploading=true;this.progressLabel="Uploading...";d.label=1;case 1:d.trys.push([1,4,,5]);return[4,g(this.endpoint,this.templateId,n,this.handleUploadProgress.bind(this))];case 2:r=d.sent();console.log("[ATTACHMENTS] Created attachment",r);l=this;return[4,c(this.endpoint,this.templateId,true)];case 3:l.store=d.sent();console.log("[ATTACHMENTS] Updated template",this.store.state);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:a=d.sent();console.log("[ATTACHMENTS] Error creating template",a);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new u(a.message,(s=a.response)===null||s===void 0?void 0:s.status,(o=a.response)===null||o===void 0?void 0:o.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.store.state})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,b(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,c(this.endpoint,this.templateId,true)];case 2:e.store=t.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){if(((t=this.store.state)===null||t===void 0?void 0:t.template_documents.length)>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return _;case"image/jpeg":return w;case"image/png":return y;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return x}return k};e.prototype.render=function(){var e=this;var t,i,n;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var r=(t=this.store)===null||t===void 0?void 0:t.state;if(!r.isLoaded){return s(o,{class:"loading"},s("verdocs-loader",null))}if(!this.endpoint.session||!r.profile_id){return s(o,{class:"empty"})}return s(o,null,s("h5",null,"Existing Attachments"),s("div",{class:"attachments"},(i=this.store)===null||i===void 0?void 0:i.state.template_documents.map((function(t){return s("div",{class:"attachment"},s("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),s("div",{class:"filename",title:t.name},t.name),s("div",{class:"pages"},s("div",{class:"count"},t.page_numbers),s("div",{class:"pages-icon",innerHTML:I})),s("div",{class:"trash-icon",innerHTML:E,onClick:function(){return e.handleDelete(t)}}))}))),s("h5",null,"Attach a New Document"),this.uploading?s("div",{class:"loader-wrapper"},s("verdocs-loader",null),this.progressLabel&&s("div",{class:"progress-wrapper"},s("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):s("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),s("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((n=this.store)===null||n===void 0?void 0:n.state.template_documents.length)||this.uploading})),this.showDeleteError&&s("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&s("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}());H.style=j;var F='verdocs-template-build-tabs{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}';var B=["attachments","roles","settings","fields","preview"];var O=e("verdocs_template_build_tabs",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.stepChanged=i(this,"stepChanged",7);this.endpoint=n.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onStepChanged=function(){console.log("Step changed",this.step,this.templateId);this.loadTemplate().catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(s){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="preview";return[2]}this.loadTemplate().catch((function(e){return console.log("[BUILD_TABS] Unable to load template",e)}))}catch(s){console.log("[BUILD_TABS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new u(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.loadTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!this.templateId)return[3,2];e=this;return[4,c(this.endpoint,this.templateId,false)];case 1:e.store=t.sent();t.label=2;case 2:return[2]}}))}))};e.prototype.setStep=function(e){var t;console.log("Selected step",e.detail.tab.id);e.stopPropagation();e.preventDefault();this.step=e.detail.tab.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.detail.tab.id)};e.prototype.render=function(){var e=this;var t,i,n,r,l,a,d,c,p;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var u=false;var h=false;var m=false;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step);if(this.templateId&&this.store&&this.store.state){m=((n=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.template_documents)===null||n===void 0?void 0:n.length)>0;h=m&&((a=(l=(r=this.store)===null||r===void 0?void 0:r.state)===null||l===void 0?void 0:l.roles)===null||a===void 0?void 0:a.length)>0;u=h&&((p=(c=(d=this.store)===null||d===void 0?void 0:d.state)===null||c===void 0?void 0:c.fields)===null||p===void 0?void 0:p.length)>0}var v=Math.max(B.indexOf(this.step),0);if(!u&&v>=4){v=3}if(!h&&v>=3){v=1}if(!m&&v>=1){v=0}console.log({selectedStepIndex:v,canPreview:u,canEditFields:h,canEditRoles:m});return s(o,null,s("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:v,tabs:[{id:"attachments",disabled:false,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!m,label:"Roles"},{id:"settings",disabled:!h,label:"Settings"},{id:"fields",disabled:!h,label:"Fields"},{id:"preview",disabled:!u,label:"Preview/Send"}]}))};Object.defineProperty(e,"watchers",{get:function(){return{step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());O.style=F;var W='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';var V=" ";var q='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>';var Y=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.templateCreated=i(this,"templateCreated",7);this.endpoint=n.getDefault();this.file=undefined;this.creating=false;this.progressLabel="Uploading...";this.progressPercent=0}e.prototype.componentWillLoad=function(){this.endpoint.setTimeout(3e4);this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("[CREATE] Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,s,o,n,l,a;var d=this;return __generator(this,(function(c){switch(c.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";c.label=1;case 1:c.trys.push([1,3,,4]);return[4,r(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){d.progressLabel="Processing...";d.progressPercent=100}else{d.progressPercent=e}}))];case 2:l=c.sent();console.log("[CREATE] Created template",l);(t=this.templateCreated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:l,templateId:l.id});(i=this.next)===null||i===void 0?void 0:i.emit(l);this.creating=false;this.progressLabel="";this.progressPercent=0;return[3,4];case 3:a=c.sent();console.log("[CREATE] Error creating template",a);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new u(a.message,(o=a.response)===null||o===void 0?void 0:o.status,(n=a.response)===null||n===void 0?void 0:n.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return s(o,null,s("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},s("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),this.creating?s("div",{class:"loader-wrapper"},s("verdocs-loader",null),this.progressLabel&&s("div",{class:"progress-wrapper"},s("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):s("div",{class:"upload-box",onDrop:function(t){t.preventDefault();t.target.classList.remove("drag-over");e.file=t.dataTransfer.files[0]},onDragOver:function(e){e.preventDefault();e.dataTransfer.dropEffect="copy"},onDragEnter:function(e){return e.target.classList.add("drag-over")},onDragLeave:function(e){return e.target.classList.remove("drag-over")}},s("div",null,s("span",{innerHTML:q})),s("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),s("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?V:"Or, if you prefer..."),s("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),s("div",{class:"buttons"},s("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),s("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}());Y.style=W;var G="";var J=e("verdocs_template_name",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.name="";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,c(this.endpoint,this.templateId,false)];case 1:n.store=l.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.dirty=false;return[3,3];case 2:r=l.sent();console.log("[TEMPLATE NAME] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new u(r.message,(s=r.response)===null||s===void 0?void 0:s.status,(o=r.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,s;e.stopPropagation();this.name=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.name;this.dirty=false;console.log("Closing");(s=this.close)===null||s===void 0?void 0:s.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,s;return __generator(this,(function(o){switch(o.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{name:this.name})];case 1:o.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.name=this.name}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"});(s=this.close)===null||s===void 0?void 0:s.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoading){return s(o,{class:"loading"},s("verdocs-loader",null))}return s(o,null,s("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},s("label",{htmlFor:"verdocs-template-name"},"Template Name"),s("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(t){var i,s;e.name=t.target.value;e.dirty=e.name!==((s=(i=e.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.name)}}),s("div",{class:"buttons"},s("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),s("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());J.style=G;var K='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var Q=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,c(this.endpoint,this.templateId,true)];case 1:n.store=l.sent();this.sendReminders=!!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.reminder_id);this.dirty=false;return[3,3];case 2:r=l.sent();console.log("[TEMPLATE REMINDERS] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new u(r.message,(s=r.response)===null||s===void 0?void 0:s.status,(o=r.response)===null||o===void 0?void 0:o.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,s;e.stopPropagation();this.sendReminders=!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id);this.dirty=false;(s=this.close)===null||s===void 0?void 0:s.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,s,o,n,r,l,a,d,p,h,m,v,f;return __generator(this,(function(g){switch(g.label){case 0:e.stopPropagation();g.label=1;case 1:g.trys.push([1,12,,13]);if(!this.sendReminders)return[3,8];p={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};if(!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id))return[3,4];return[4,C(this.endpoint,this.templateId,p)];case 2:g.sent();h=this;return[4,c(this.endpoint,this.templateId,true)];case 3:h.store=g.sent();return[3,7];case 4:return[4,D(this.endpoint,this.templateId,(s=this.store)===null||s===void 0?void 0:s.state.reminder_id,p)];case 5:g.sent();m=this;return[4,c(this.endpoint,this.templateId,true)];case 6:m.store=g.sent();g.label=7;case 7:return[3,11];case 8:return[4,L(this.endpoint,this.templateId,(o=this.store)===null||o===void 0?void 0:o.state.reminder_id)];case 9:g.sent();v=this;return[4,c(this.endpoint,this.templateId,true)];case 10:v.store=g.sent();g.label=11;case 11:(n=this.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});return[3,13];case 12:f=g.sent();console.log("[TEMPLATE REMINDERS] Unable to update reminders",f);S(f.message);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new u(f.message,(l=f.response)===null||l===void 0?void 0:l.status,(a=f.response)===null||a===void 0?void 0:a.data));return[3,13];case 13:this.dirty=false;(d=this.close)===null||d===void 0?void 0:d.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return s(o,{class:"empty"})}return s(o,null,s("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},s("h5",null,"Reminders"),s("div",{class:"input-row"},s("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),s("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.sendReminders=t.target.checked;e.dirty=true}})),s("div",{class:"input-row"},s("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),s("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){e.firstReminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),s("div",{class:"input-row"},s("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),s("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){e.reminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),s("div",{class:"buttons"},s("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),s("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&s("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}());Q.style=K;var X='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';var Z=e("verdocs_template_visibility",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.dirty=false;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,s,o,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[VISIBILITY] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[VISIBILITY] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,c(this.endpoint,this.templateId,false)];case 1:l.store=d.sent();this.personal=((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_personal)||true;this.public=((s=(i=this.store)===null||i===void 0?void 0:i.state)===null||s===void 0?void 0:s.is_public)||false;this.dirty=false;return[3,3];case 2:a=d.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",a);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new u(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(r=a.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,s,o,n;e.stopPropagation();this.personal=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_personal;this.public=(o=(s=this.store)===null||s===void 0?void 0:s.state)===null||o===void 0?void 0:o.is_public;this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,s;return __generator(this,(function(o){switch(o.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:o.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.is_personal=this.personal;this.store.state.is_public=this.public}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"});(s=this.close)===null||s===void 0?void 0:s.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return s(o,{class:"empty"})}return s(o,null,s("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},s("h5",null,"Visibility"),s("div",{class:"input-row"},s("label",{htmlFor:"verdocs-is-shared"},"Shared"),s("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),s("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),s("div",{class:"input-row"},s("label",{htmlFor:"verdocs-is-public"},"Public"),s("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),s("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),s("div",{class:"buttons"},s("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),s("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());Z.style=X}}}));
@@ -1 +0,0 @@
1
- import{r as t,h as s,H as e}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as l}from"./p-035f6b38.js";import{g as i}from"./p-f3dde708.js";import"./p-7648c449.js";const o=class{constructor(s){t(this,s),this.store=null,this.endpoint=l.getDefault(),this.templateId="e997b94c-9d1b-4c85-8552-dedd24e35550"}async componentWillLoad(){try{this.endpoint.loadSession(),this.store=await i(this.endpoint,this.templateId,!1)}catch(t){console.log("[TEMPLATE VISIBILITY] Error loading template",t)}}render(){return console.log("[IPC] Rendering"),s(e,null,s("div",null,s("pre",null,s("code",null,JSON.stringify(this.store.state,null,2)))),s("verdocs-template-roles",{templateId:this.templateId}),s("verdocs-template-fields",{templateId:this.templateId}))}};o.style="ipc-test{max-width:800px;display:block}";export{o as ipc_test}
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i,H as s,a as o}from"./p-14b44491.js";import{i as r}from"./p-999fbe79.js";import"./p-05788c2b.js";import{V as l}from"./p-035f6b38.js";import{u as n}from"./p-feb442b1.js";import{g as d}from"./p-6de76553.js";import{g as a}from"./p-02a71e03.js";import"./p-7d5dbd9a.js";import"./p-dc2ad047.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";const h=class{constructor(i){t(this,i),this.settingsChanged=e(this,"settingsChanged",7),this.deleted=e(this,"deleted",7),this.endpoint=l.getDefault(),this.templateid="",this.field=null,this.disabled=!1,this.editable=!1,this.moveable=!1,this.done=!1,this.roleindex=0,this.xscale=1,this.yscale=1,this.rerender=0}async focusField(){this.inputEl.focus()}async showSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.showPanel&&t.showPanel()}async hideSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.hidePanel&&t.hidePanel()}componentDidRender(){r.dynamicDrop(!0),this.editable&&r(this.el).resizable({edges:{top:!1,bottom:!1,left:!0,right:!0},listeners:{start:this.handleResizeStart.bind(this),move:this.handleResize.bind(this),end:this.handleResizeEnd.bind(this)}})}handleResizeStart(t){t.preventDefault(),t.stopPropagation()}handleResize(t){let{x:e=0,y:i=0,h:s=0}=t.target.dataset,{width:o,height:r}=t.rect;e=(parseFloat(e)||0)+t.deltaRect.left,i=(parseFloat(i)||0)+t.deltaRect.top,s=(parseFloat(s)||0)+t.deltaRect.height,Object.assign(t.target.style,{width:`${o}px`,height:`${r}px`,transform:`translate(${e}px, ${i+s}px)`}),Object.assign(t.target.dataset,{x:e,y:i,h:s})}handleResizeEnd(t){const e={...a(this.field)},[i,s]=t.target.style.transform.split("(")[1].split(")")[0].split(",").map(parseFloat);e.width=Math.round(parseFloat(t.target.style.width)/this.xscale),e.height=Math.round(parseFloat(t.target.style.height)/this.yscale),e.x=Math.round(e.x+i/this.xscale),e.y=Math.round(e.y-s/this.yscale),n(this.endpoint,this.templateid,this.field.name,{setting:e}).then((i=>{var s;console.log("update result",i),null===(s=this.settingsChanged)||void 0===s||s.emit({fieldName:this.field.name,settings:e,field:i}),Object.assign(t.target.dataset,{x:0,y:0,h:0})})).catch((t=>console.log("Field update failed",t)))}render(){var t,e,o,r;const l=a(this.field);let n=null!==(e=null!==(t=this.disabled)&&void 0!==t?t:l.disabled)&&void 0!==e&&e;const h=this.field.rgba||d(this.roleindex),p=(null==l?void 0:l.result)||"",c=(l.width||150)/5;return this.done?i(s,{class:{done:this.done}},p):i(s,{class:{required:null===(o=this.field)||void 0===o?void 0:o.required,disabled:n,done:this.done},style:{backgroundColor:h}},i("input",{type:"text",name:this.field.name,placeholder:null==l?void 0:l.placeholder,tabIndex:null==l?void 0:l.order,value:p,disabled:n,required:null===(r=this.field)||void 0===r?void 0:r.required,ref:t=>this.inputEl=t,maxlength:c}),this.editable&&i("verdocs-button-panel",{icon:'<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>',id:`verdocs-settings-panel-${this.field.name}`},i("verdocs-template-field-properties",{templateId:this.templateid,fieldName:this.field.name,onClose:()=>this.hideSettingsPanel(),onDelete:()=>{var t;return null===(t=this.deleted)||void 0===t||t.emit({fieldName:this.field.name}),this.hideSettingsPanel()},onSettingsChanged:t=>{var e;return console.log("here"),null===(e=this.settingsChanged)||void 0===e||e.emit(t.detail),this.hideSettingsPanel()},helpText:'Text boxes may be used to capture simple text input. Participant-entered values will be stored for later retrieval via the "name" field.<br /><br />If marked required, the participant must complete the field before proceeding.'})))}get el(){return o(this)}};h.style='verdocs-field-textbox{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;width:150px;height:15px;display:block;font-size:11px;letter-spacing:-0.2px;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border:1px solid rgba(0, 0, 0, 0.2)}verdocs-field-textbox.disabled{opacity:0.5}verdocs-field-textbox input{cursor:inherit;width:100%;height:100%;border:none;outline:none;padding:0 3px;font-size:11px;background:none;font-weight:500;position:absolute;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-box-sizing:border-box;box-sizing:border-box;color:rgba(0, 0, 0, 0.87)}verdocs-field-textbox input.hide{display:none}verdocs-field-textbox.required{border:1px solid #cc0000}verdocs-field-textbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-textbox verdocs-button-panel{top:-3px;left:-2px;opacity:0.5;z-index:1000;cursor:pointer;position:absolute;-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-field-textbox verdocs-button-panel[data-active],verdocs-field-textbox verdocs-button-panel:hover{opacity:1}verdocs-field-textbox verdocs-button-panel .icon svg{fill:#333333}verdocs-field-textbox verdocs-button-panel .icon:hover svg{fill:#000000}verdocs-field-textbox [data-lastpass-icon-root]{display:none !important}';export{h as verdocs_field_textbox}
@@ -1 +0,0 @@
1
- import{r as e,c as t,f as s,h as i,H as l,a as o}from"./p-14b44491.js";import"./p-05788c2b.js";import{V as d}from"./p-035f6b38.js";import{g as n}from"./p-f3dde708.js";import{S as a}from"./p-7a1b2643.js";import"./p-7648c449.js";const r=class{constructor(s){e(this,s),this.sdkError=t(this,"sdkError",7),this.stepChanged=t(this,"stepChanged",7),this.send=t(this,"send",7),this.templateUpdated=t(this,"templateUpdated",7),this.templateCreated=t(this,"templateCreated",7),this.endpoint=d.getDefault(),this.templateId=null,this.step="preview",this.store=null}onTemplateIdChanged(e){console.log("Template ID changed",e),this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(e){console.log("Step changed",e),this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,t,s;try{if(this.endpoint.loadSession(),!this.templateId)return console.log("[BUILD] No template ID, activating upload mode"),void(this.step="attachments");if(!this.endpoint.session)return void console.log("[BUILD] Unable to start builder session, must be authenticated");this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(i){console.log("[BUILD] Error loading template",i),null===(e=this.sdkError)||void 0===e||e.emit(new a(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(s=i.response)||void 0===s?void 0:s.data))}}async loadTemplate(e){e&&(console.log("Loading store",e),this.store=await n(this.endpoint,e,!0),s(this.el))}handleCancel(e){console.log("Cancel",e.detail),this.step="preview"}async handleTemplateCreated(e){var t;await this.loadTemplate(e),this.templateId=e,this.step="roles",null===(t=this.stepChanged)||void 0===t||t.emit("roles")}async handleTemplateUpdated(e){var t;console.log("tup"),null===(t=this.templateUpdated)||void 0===t||t.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles",null===(e=this.stepChanged)||void 0===e||e.emit("roles")}handleRolesNext(){var e;this.step="fields",null===(e=this.stepChanged)||void 0===e||e.emit("fields")}handleStepChanged(e){var t;console.log("osc",e),this.step=e,null===(t=this.stepChanged)||void 0===t||t.emit(e)}render(){return this.endpoint.session?this.store?(console.log("[BUILD] Rendering build view",this.templateId,this.step,["attachments","roles","settings","fields","preview"].indexOf(this.step)),i(l,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var t;return null===(t=this.sdkError)||void 0===t?void 0:t.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),"attachments"===this.step&&i("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"roles"===this.step&&i("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleRolesNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"settings"===this.step&&i("div",{style:{flexDirection:"column",gap:"20px",display:"flex",maxWidth:"400px",margin:"20px"}},i("verdocs-template-name",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),i("verdocs-template-reminders",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),i("verdocs-template-visibility",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:e=>this.handleTemplateUpdated(e)})),"fields"===this.step&&i("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),"preview"===this.step&&i("div",{class:"preview-container"},i("div",{class:"preview-send-wrapper"},i("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var t;return null===(t=this.send)||void 0===t?void 0:t.emit(e.detail)},style:{width:"100%"}})),i("div",{class:"preview-preview-wrapper"},i("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))):(console.log("[BUILD] No template ID, rendering created view"),i(l,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:"attachments",onSdkError:e=>{var t;return null===(t=this.sdkError)||void 0===t?void 0:t.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),i("verdocs-template-create",{endpoint:this.endpoint,onExit:e=>this.handleCancel(e),onNext:()=>this.handleAttachmentsNext(),onTemplateCreated:e=>this.handleTemplateCreated(e.detail.templateId)})))):i(l,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}get el(){return o(this)}static get watchers(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}}};r.style='verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px #0000007f;box-shadow:1px 1px 6px -2px #0000007f}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}';export{r as verdocs_build}
@@ -1 +0,0 @@
1
- import{r as e,c as t,h as i,H as o,F as s,a as l}from"./p-14b44491.js";import{i as r}from"./p-999fbe79.js";import"./p-05788c2b.js";import{V as a,T as n,u as d}from"./p-035f6b38.js";import{u as p,c}from"./p-feb442b1.js";import{i as h}from"./p-5e808a0b.js";import{b as v,r as m,f as u,h as f,i as g}from"./p-02a71e03.js";import{g as x,a as b}from"./p-f3dde708.js";import{S as w}from"./p-7a1b2643.js";import{g as y}from"./p-6de76553.js";import"./p-7d5dbd9a.js";import"./p-dc2ad047.js";import"./p-aa124212.js";import"./p-839f6f0d.js";import"./p-c220af42.js";import"./p-7648c449.js";var k=function(e,t,i,o){return e.api.put("/templates/".concat(t,"/roles/").concat(i),o).then((function(e){return e.data}))};const q='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>',C=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>'},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>'},{id:"sep1",tooltip:"",icon:q},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"checkbox_group",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>'},{id:"radio_button_group",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>'},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>'},{id:"sep2",tooltip:"",icon:q},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>'},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>'}],E=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.pageHeights={},this.store=null,this.cachedPageInfo={},this.endpoint=a.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.showMustSelectRole=!1,this.selectedRoleName="",this.rerender=1}async componentWillLoad(){var e,t,i,o,s,l,r;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[FIELDS] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!0),console.log(`[FIELDS] Loaded template ${this.templateId}`,this.store.state),this.selectedRoleName=(null===(o=null===(i=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||void 0===i?void 0:i[0])||void 0===o?void 0:o.name)||"",console.log("[FIELDS] Starting with role",this.selectedRoleName)}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new w(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(r=e.response)||void 0===r?void 0:r.data))}}componentDidRender(){r.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}componentWillUpdate(){var e,t,i,o,s,l;this.selectedRoleName&&((null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||[]).find((e=>e.name===this.selectedRoleName))||(this.selectedRoleName=(null===(l=null===(s=null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.roles)||void 0===s?void 0:s[0])||void 0===l?void 0:l.name)||"",console.log("[FIELDS] Selected new role",this.selectedRoleName))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,i){console.log("[FIELDS] handleFieldChange",e,t,i),this.rerender++}handleFieldSettingsChange(e,t,i,o,s){var l,r,a,n;console.log("[FIELDS] Field settings changed",t.name,s),Object.assign(t,s),o.field=s,this.selectedRoleName=t.role_name,o.setAttribute("roleindex",v(b(this.store),t.role_name)),o.field=null===(r=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===r?void 0:r.fields.find((e=>e.name===t.name)),this.rerender++,o.setAttribute("rerender",this.rerender),null===(a=this.templateUpdated)||void 0===a||a.emit({endpoint:this.endpoint,template:null===(n=this.store)||void 0===n?void 0:n.state,event:"updated-field"}),console.log("[FIELDS] Re-rendering field",t.name,e.pageNumber),this.reRenderField(t,e.pageNumber),m(t,e,i,{disabled:!0,editable:!0,draggable:!0})}attachFieldAttributes(e,t,i,o){o.addEventListener("input",(e=>this.handleFieldChange(t,e))),o.addEventListener("settingsChanged",(s=>this.handleFieldSettingsChange(e,t,i,o,s.detail.field))),o.addEventListener("deleted",(()=>{var e,i;console.log("[FIELDS] Deleted",this,t),o.remove(),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state,event:"updated-field"})})),o.setAttribute("templateid",this.templateId),o.setAttribute("roleindex",i),o.setAttribute("pageNumber",e.pageNumber),o.setAttribute("xScale",e.xScale),o.setAttribute("yScale",e.yScale),o.setAttribute("name",t.name)}handlePageRendered(e){var t;const i=e.detail;console.log("[FIELDS] Page rendered",i.pageNumber,i),this.cachedPageInfo[i.pageNumber]=i,this.pageHeights[i.pageNumber]=i.naturalHeight,(null===(t=this.store)||void 0===t?void 0:t.state.fields.filter((e=>e.page_sequence===i.pageNumber))).forEach((e=>this.reRenderField(e,i.pageNumber)))}reRenderField(e,t){const i=this.cachedPageInfo[t],o=v(b(this.store),e.role_name),s=m(e,i,o,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.forEach((t=>{this.attachFieldAttributes(i,e,o,t),this.makeDraggable(t)})):(this.attachFieldAttributes(i,e,o,s),this.makeDraggable(s)))}makeDraggable(e){r(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),o=+(e.target.getAttribute("xScale")||1),s=+(e.target.getAttribute("yScale")||1),l=e.dx/o+t,r=e.dy/s+i;e.target.setAttribute("posX",l),e.target.setAttribute("posy",r),u(e.target,"translate",`${l}px, ${r}px`)}async handleMoveEnd(e){var t;const i=e.target.getAttribute("name"),o=+(e.target.getAttribute("option")||"0"),s=null===(t=this.store)||void 0===t?void 0:t.state.fields.find((e=>e.name===i));if(console.log("Dropped field",i,s),!s)return void console.log("[FIELDS] Unable to find field",i);const l=e.target.getAttribute("pageNumber"),{naturalWidth:r=612,naturalHeight:a=792,renderedHeight:n=792}=this.cachedPageInfo[l],d=e.target.getBoundingClientRect(),c=e.target.parentElement.getBoundingClientRect(),h=s.setting.width||f(s.type),m=s.setting.height||g(s.type),u=Math.max(d.left-c.left,0),x=Math.max(n-(c.bottom-d.bottom),0),{x:w,y}=this.viewCoordinatesToPageCoordinates(u,x,l,r-h,a-m);switch(s.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":s.setting.x=w,s.setting.y=y;break;case"checkbox_group":case"radio_button_group":{const e=s.setting.options[o];e&&(e.x=w,e.y=y)}}console.log("[FIELDS] Will update",i,o,s);const k=await p(this.endpoint,this.templateId,i,s),q=this.cachedPageInfo[l],C=v(b(this.store),s.role_name);this.handleFieldSettingsChange(q,s,C,e.target,k),e.target.removeAttribute("posX"),e.target.removeAttribute("posY")}generateFieldName(e,t){var i;let o,s=1;do{o=`${e}P${t}-${s}`,s++}while(null===(i=this.store)||void 0===i?void 0:i.state.fields.some((e=>e.name===o)));return o}viewCoordinatesToPageCoordinates(e,t,i,o,s){const{xScale:l=1,yScale:r=1,renderedHeight:a=792}=this.cachedPageInfo[i],n=Math.floor(Math.min(e/l,o)),d=Math.floor(Math.min(Math.max(a-t,0)/r,s));return console.log("Computed coordinates",{x:n,y:d,viewX:e,viewY:t,xMax:o,yMax:s}),{x:n,y:d}}async handleClickPage(e,t){var i,o,s;if(this.placing){const l=e.offsetX,r=e.offsetY,a=f(this.placing),n=g(this.placing),d=this.cachedPageInfo[t],{naturalWidth:p=612,naturalHeight:h=792}=d,v=this.viewCoordinatesToPageCoordinates(l,r,t,p-a,h-n),m=Math.floor(v.x),u=Math.floor(v.y),x={name:this.generateFieldName(this.placing,t),role_name:this.selectedRoleName,template_id:this.templateId,document_id:d.documentId,type:this.placing,required:!0,page_sequence:t,validator:null,setting:{x:m,y:u},x:m,y:u,tabindex:0,width:a,height:n};switch(x.type){case"attachment":case"payment":x.setting={x:m,y:u};break;case"initial":case"signature":x.setting={x:m,y:u,result:""};break;case"checkbox_group":x.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:`${x.name}-1`,value:"Option 1",checked:!1,x:m,y:u}]};break;case"date":x.setting={x:m,y:u,width:a,height:n,result:""};break;case"dropdown":x.required=!1,x.setting={x:m,y:u,width:a,height:n,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":x.setting={options:[{id:`${x.name}-1`,value:"Option 1",selected:!1,x:m,y:u}]};break;case"textarea":case"textbox":x.setting={x:m,y:u,width:a,height:n,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":x.setting={x:m,y:u,width:a,height:n}}"textarea"===x.type&&(x.setting.leading=16,x.type="textbox");const b=await c(this.endpoint,this.templateId,x);console.log("Saved field",b),this.store.state&&(this.store.state.fields=[...null===(i=this.store)||void 0===i?void 0:i.state.fields,b]),this.placing=null,null===(o=this.templateUpdated)||void 0===o||o.emit({endpoint:this.endpoint,template:null===(s=this.store)||void 0===s?void 0:s.state,event:"added-field"}),this.handlePageRendered({detail:this.cachedPageInfo[t]})}}render(){var e,t,s,l,r,a,n,d;if(console.log("[FIELDS] Rendering",this.selectedRoleName),!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return i(o,null,i("verdocs-loader",null));const p=null===(s=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===s?void 0:s.roles.map((e=>({value:e.name,label:e.name})));return i(o,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-r":this.rerender,onSubmit:()=>{console.log("onSubmit")}},i("div",{id:"verdocs-template-fields-toolbar"},i("div",{class:"add-for"},"Add field:"),i("verdocs-select-input",{value:this.selectedRoleName,options:p,onInput:e=>this.selectedRoleName=e.target.value}),C.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>{e.tooltip&&(this.selectedRoleName?this.placing=e.id:this.showMustSelectRole=!0)}})))),i("div",{class:"pages"},((null===(r=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===r?void 0:r.template_documents)||[]).map((e=>h(1,e.page_numbers).map((t=>i("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:612,virtualHeight:792,onClick:e=>this.handleClickPage(e,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))))),this.showMustSelectRole&&i("verdocs-ok-dialog",{heading:"Unable to add field",message:(null===(d=null===(n=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===n?void 0:n.roles)||void 0===d?void 0:d.length)>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=!1}))}};E.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";const M=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.delete=t(this,"delete",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.roleName="",this.sender=n.EVERYONE,this.dirty=!1,this.saving=!1,this.name="",this.type="signer",this.fullName="",this.email="",this.phone="",this.allowDelegation=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLE_PROPERTIES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!1);const i=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.find((e=>e.name===this.roleName));i&&(this.name=i.name,this.type=i.type,this.fullName=i.full_name,this.email=i.email,this.phone=i.phone,this.allowDelegation=i.delegator,console.log("[ROLES] Editing role",i))}catch(e){console.log("[TEMPLATE ROLE PROPERTIES] Error with preview session",e),null===(i=this.sdkError)||void 0===i||i.emit(new w(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleCancel(e){var t,i,o;e.stopPropagation(),this.name=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.name,this.dirty=!1,null===(o=this.close)||void 0===o||o.emit()}async handleSave(e){e.stopPropagation(),this.saving=!0,k(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,full_name:this.fullName,email:this.email,phone:this.phone,delegator:this.allowDelegation}).then((async e=>{var t;console.log("[ROLE_PROPERTIES] Update result",e),this.saving=!1,this.dirty=!1,this.store=await x(this.endpoint,this.templateId,!0),null===(t=this.close)||void 0===t||t.emit()})).catch((e=>{console.log("Update error",e),this.saving=!1}))}async handleDelete(e){var t,i,o;e.stopPropagation(),window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")&&(t=this.endpoint,i=this.templateId,o=this.roleName,t.api.delete("/templates/".concat(i,"/roles/").concat(o)).then((function(e){return e.data}))).then((e=>{var t;console.log("Role deleted",e),this.store.state.roles=[...this.store.state.roles.filter((e=>e.name!==this.roleName))],null===(t=this.delete)||void 0===t||t.emit({templateId:this.templateId,roleName:this.roleName})})).catch((e=>{console.log("Deletion error",e)}))}render(){const e=-1!==(this.store.state.fields||[]).findIndex((e=>e.role_name===this.roleName));return i(o,null,i("div",{class:"background-overlay",onClick:e=>this.handleCancel(e)},i("div",{class:"dialog"},i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("verdocs-text-input",{id:"verdocs-recipient-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:e,helpText:e?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Template Name...",onInput:e=>{this.name=e.target.value,this.dirty=!0}}),i("div",{class:"row"},i("div",{class:"input-label"},"Type:"),i("verdocs-select-input",{value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value,this.dirty=!0}}),i("verdocs-help-icon",{text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Full Name",value:this.fullName,autocomplete:"off",helpText:"The recipient's full name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Full Name...",onInput:e=>{this.fullName=e.target.value,this.dirty=!0}}),i("verdocs-text-input",{id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value,this.dirty=!0}}),i("verdocs-text-input",{id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value,this.dirty=!0}}),i("div",{class:"row"},i("div",{class:"input-label"},"May Delegate:"),i("div",{class:"checkbox-wrapper"},i("verdocs-checkbox",{checked:this.allowDelegation,onInput:e=>{this.allowDelegation=e.target.checked,this.dirty=!0}})),i("verdocs-help-icon",{text:"If enabled, this recipient may delegate their actions to another individual."})),i("div",{class:"buttons"},i("button",{class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>'}),i("div",{style:{flex:"1"}}),i("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:e=>this.handleCancel(e)}),i("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:e=>this.handleSave(e)}))))))}};M.style='verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';const L={[n.EVERYONE]:"Everyone",[n.EVERYONE_AS_CREATOR]:"Everyone as Me",[n.ORGANIZATION_MEMBER]:"Organization member",[n.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[n.CREATOR]:"Me"},Z='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>',z='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',S='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>',H='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',V='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>',I=class{constructor(i){e(this,i),this.next=t(this,"next",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.sequences=[],this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null}async componentWillLoad(){var e,t,i;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");await this.reloadStore()}catch(o){console.log("[FIELDS] Error with preview session",o),null===(e=this.sdkError)||void 0===e||e.emit(new w(o.message,null===(t=o.response)||void 0===t?void 0:t.status,null===(i=o.response)||void 0===i?void 0:i.data))}}async reloadStore(){this.store=await x(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles()}componentDidRender(){r.dynamicDrop(!0),r(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),o=e.dx+t,s=e.dy+i;e.target.setAttribute("posX",o),e.target.setAttribute("posy",s),e.target.style.transform=`translate(${o+100}px, ${s-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),r(".dropzone").dropzone({overlap:.05,ondrop:function(e){var t,i,o,s,l;e.target.classList.remove("active");const r=e.relatedTarget.dataset.rolename,a=+e.target.dataset.sequence,n=+e.target.dataset.order,d=null===(o=null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.roles)||void 0===o?void 0:o.find((e=>e.name===r));d&&(d.sequence=a,d.order=n,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.roles.map((e=>k(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>{var e,t;console.log("[ROLES] Updated roles"),null===(e=this.templateUpdated)||void 0===e||e.emit({event:"updated-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))})).catch((e=>console.log("[ROLES] Role updates failed",e))))}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(){var e;null===(e=this.exit)||void 0===e||e.emit()}handleSubmit(){var e;null===(e=this.next)||void 0===e||e.emit()}sortTemplateRoles(){var e,t;null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}extractSequenceNumbers(){var e,t;this.sequences=[],null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,t)=>e-t)),this.sequences.forEach(((t,i)=>{var o,s;null===(s=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===s||s.roles.filter((e=>e.sequence===t)).forEach(((t,o)=>{e.includes(t.name)||(t.sequence=i+1,t.order=o+1,e.push(t.name))}))})),this.extractSequenceNumbers()}getNextRoleName(){var e,t,i,o;let s="",l=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.length;do{l++,s=`Recipient ${l}`}while(!s||(null===(o=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===o?void 0:o.roles.some((e=>e.name===s))));return s}callCreateRole(e,t,i){var o,s,l;console.log("[ROLES] Will create role",{name:e,sequence:t,order:i}),(o=this.endpoint,s=this.templateId,l={template_id:this.templateId,name:e,sequence:t,order:i,full_name:"",email:"",phone:"",type:"signer",delegator:!1},o.api.post("/templates/".concat(s,"/roles"),l).then((function(e){return e.data}))).then((async e=>{var t,i;console.log("[ROLES] Created role",e),this.store=await x(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles(),null===(t=this.templateUpdated)||void 0===t||t.emit({event:"created-role",endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){var i;e.stopPropagation();const o=(null===(i=this.store)||void 0===i?void 0:i.state.roles.filter((e=>e.sequence===t)).length)+1,s=this.getNextRoleName();this.callCreateRole(s,t,o)}handleAddStep(e,t){e.stopPropagation();const i=this.getNextRoleName();this.callCreateRole(i,t,1)}render(){var e,t,l,r,a,n;if(console.log("[ROLES] Rendering"),!this.endpoint.session)return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return i(o,{class:"loading"},i("verdocs-loader",null));const d=((null===(l=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===l?void 0:l.roles)||[]).map((e=>e.name));return i(o,null,i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":null===(r=this.store.state)||void 0===r?void 0:r.updateCount},i("h5",null,"Roles and Workflow"),i("div",{class:"participants"},i("div",{class:"left-line"}),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"sender"},i("span",{class:"label"},"Sender:")," ",L[null===(n=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===n?void 0:n.sender]," ",i("div",{class:"settings-button",innerHTML:Z,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),i("div",{class:"row add-sequence","data-sequence":0},i("div",{class:"icon",innerHTML:z}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((e=>{var t,o;return i(s,null,i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"dropzone","data-order":.5,"data-sequence":e}),null===(o=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===o?void 0:o.roles.filter((t=>t.sequence===e)).map((t=>i(s,null,t.email?i("div",{class:"recipient",style:{borderColor:y(v(d,t.name))},"data-rolename":t.name},i("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?V:H}),t.full_name," ",i("div",{class:"settings-button",innerHTML:Z,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):i("div",{class:"recipient",style:{backgroundColor:y(v(d,t.name))},"data-rolename":t.name},i("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?V:H}),t.name," ",i("div",{class:"settings-button",innerHTML:Z,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})),i("div",{class:"dropzone","data-order":t.order+.5,"data-sequence":e})))),i("button",{class:"add-role",innerHTML:z,onClick:t=>this.handleAddRole(t,e)}))),this.sequences.length>0&&i("div",{class:"row add-sequence","data-sequence":e},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:z}),i("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step"))))})),i("div",{class:"row","data-sequence":this.sequences.length+1},i("div",{class:"row-roles"},i("div",{class:"icon",innerHTML:z}),i("button",{class:"add-step",innerHTML:z,onClick:e=>this.handleAddStep(e,this.sequences.length+1)}))),i("div",{class:"row"},i("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),i("div",{class:"row-roles"},i("div",{class:"complete"},"Document Complete")))),d.length<1&&i("div",{class:"empty"},"You must add at least one Role before proceeding.",i("br",null)," Click the ",i("span",{innerHTML:z})," Add button above to get started."),i("div",{class:"buttons"},i("div",{class:"flex-fill"}),i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),i("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:d.length<1}))),this.showingRoleDialog&&i("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null},onDelete:async()=>{var e,t;await x(this.endpoint,this.templateId,!0),this.renumberTemplateRoles(),this.showingRoleDialog=null,null===(e=this.templateUpdated)||void 0===e||e.emit({event:"deleted-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state}),this.reloadStore().catch((e=>console.log("Unknown error",e)))}}),this.showingSenderDialog&&i("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};I.style='verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#46497d;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;gap:10px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';const R=class{constructor(i){e(this,i),this.close=t(this,"close",7),this.sdkError=t(this,"sdkError",7),this.store=null,this.endpoint=a.getDefault(),this.templateId="",this.sender=n.EVERYONE,this.saving=!1}async componentWillLoad(){var e,t,i,o,s;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[SENDER] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[SENDER] Unable to start builder session, must be authenticated");this.store=await x(this.endpoint,this.templateId,!1),this.sender=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.sender}catch(e){console.log("[SENDER] Error with preview session",e),null===(i=this.sdkError)||void 0===i||i.emit(new w(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(s=e.response)||void 0===s?void 0:s.data))}}handleClose(){this.close.emit()}handleDismiss(e){"background-overlay"===e.target.className&&(e.preventDefault(),this.handleClose())}async handleSelectSetting(e){this.saving=!0,d(this.endpoint,this.templateId,{sender:e}).then((t=>{var i;console.log("Update result",t),(null===(i=this.store)||void 0===i?void 0:i.state)&&(this.store.state.sender=e),this.saving=!1,this.sender=e})).catch((e=>{console.log("Error saving",e),this.saving=!1}))}render(){return i(o,null,i("div",{class:"background-overlay",onClick:e=>this.handleDismiss(e)},i("div",{class:"dialog"},i("div",{class:"options"},i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE,checked:this.sender===n.EVERYONE,onInput:()=>this.handleSelectSetting(n.EVERYONE)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web"),i("verdocs-help-icon",{text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.EVERYONE_AS_CREATOR,checked:this.sender===n.EVERYONE_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.EVERYONE_AS_CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone on the Web as me"),i("verdocs-help-icon",{text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER,checked:this.sender===n.ORGANIZATION_MEMBER,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.ORGANIZATION_MEMBER_AS_CREATOR,checked:this.sender===n.ORGANIZATION_MEMBER_AS_CREATOR,onInput:()=>this.handleSelectSetting(n.ORGANIZATION_MEMBER_AS_CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Anyone in my organization as me"),i("verdocs-help-icon",{text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),i("div",{class:"option"},i("verdocs-radio-button",{name:"template-sender",value:n.CREATOR,checked:this.sender===n.CREATOR,onInput:()=>this.handleSelectSetting(n.CREATOR)}),i("div",{class:"description"},i("div",{class:"name"},"Me"),i("verdocs-help-icon",{text:"Only I can use this template."})))),i("div",{class:"buttons"},i("verdocs-button",{label:"Close",onClick:()=>this.handleClose()})))))}};R.style='verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';export{E as verdocs_template_fields,M as verdocs_template_role_properties,I as verdocs_template_roles,R as verdocs_template_sender}
@@ -1 +0,0 @@
1
- import{c as e}from"./p-7648c449.js";import{g as o,T as t}from"./p-035f6b38.js";const r={},s=async(s,a,n=!1)=>{let i=!1;r[a]||(console.debug("[TEMPLATES] No template store found for ID, creating",a),r[a]=(o=>{const r=(new Date).toISOString();return e({isLoading:!0,isLoaded:!1,isError:!1,error:null,updateCount:0,roleNames:[],id:o,name:"",description:"",sender:t.CREATOR,profile_id:"",organization_id:"",counter:0,star_counter:0,is_sendable:!1,is_personal:!0,is_public:!1,created_at:r,updated_at:r,last_used_at:r,token:"",reminder_id:"",reminder:void 0,processed:!1,organization:void 0,roles:[],pages:[],template_document:void 0,template_documents:[]})})(a),i=!0);const d=r[a];if(d.use({reset:()=>console.debug("[TEMPLATES] Store got reset"),dispose:()=>console.debug("[TEMPLATES] Store got disposed")}),i||n){console.debug("[TEMPLATES] Reloading template",{templateId:a,created:i,forceReload:n}),d.state.isLoading=!0,d.state.isLoaded=!1,d.state.isError=!1,d.state.error=void 0;try{const e=await o(s,a);console.debug("[TEMPLATES] Got template",e),Object.assign(d.state,e),d.state.isLoaded=!0,d.state.isError=!1,d.state.error=void 0}catch(e){throw console.error("[TEMPLATES] Error loading template",e),d.state.isLoaded=!1,d.state.isError=!0,d.state.error=e,e}d.state.isLoading=!1,d.state.updateCount++}return d},a=e=>{var o;return((null===(o=null==e?void 0:e.state)||void 0===o?void 0:o.roles)||[]).map((e=>e.name))};export{a,s as g}