@cling-se/widget 0.21.0 → 0.21.1

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 (125) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/dist/{AddClientCallout-CHUJdq58.js → AddClientCallout-BnRzUSYT.js} +4 -4
  3. package/dist/{AnswerModal-DyapzyIy.js → AnswerModal-BleiA3R9.js} +4 -4
  4. package/dist/{AttachmentItem-2Lbs4CKr.js → AttachmentItem-8iXa3AcI.js} +4 -4
  5. package/dist/{BaseUpload-BdfjBI10.js → BaseUpload-BWZrDviX.js} +2 -2
  6. package/dist/{BlockMedia-Cgrrv6PB.js → BlockMedia-BxWtl3ZH.js} +1 -1
  7. package/dist/{CCallout-CbGaTfon.js → CCallout-CcKkqpC0.js} +1 -1
  8. package/dist/{CCurrencyDropdown-s6YyITN1.js → CCurrencyDropdown-D2SDG80L.js} +3 -3
  9. package/dist/{CDropdownItem-D2_kvXa_.js → CDropdownItem-D_qFzFP6.js} +2 -2
  10. package/dist/{CFormField.vue_vue_type_script_setup_true_lang-CXzY3WCV.js → CFormField.vue_vue_type_script_setup_true_lang-Dk4tndCn.js} +2 -2
  11. package/dist/{CPhoneFormat-CgWUX4xc.js → CPhoneFormat-CxLG_rck.js} +1 -1
  12. package/dist/{CPhoneInput-Bb78mU9U.js → CPhoneInput-D96Pf6Ur.js} +5 -5
  13. package/dist/{CPriceInput-1feoLjqZ.js → CPriceInput-Crt8vGKn.js} +2 -2
  14. package/dist/{CSelect-DzVWxFr-.js → CSelect-_m6S4KTh.js} +1 -1
  15. package/dist/{CSkeleton-Che8iURg.js → CSkeleton-BTcWM6h1.js} +1 -1
  16. package/dist/{ClientAutocomplete-BrRpKW_p.js → ClientAutocomplete-DhBSppv1.js} +3 -3
  17. package/dist/{ClientModal-BkRusR-p.js → ClientModal-DIVXs9Gy.js} +8 -8
  18. package/dist/{ColorPicker-Ba0bViV-.js → ColorPicker-Btn2_2hM.js} +1 -1
  19. package/dist/{CompanyModal-RtuWTytD.js → CompanyModal-Bij8yJuG.js} +7 -7
  20. package/dist/{ContentWrapper-C92i2rMN.js → ContentWrapper-UfIuhp2d.js} +6 -6
  21. package/dist/{CoverBlockSettings-BPqtMkhc.js → CoverBlockSettings-CvyOHSL3.js} +7 -7
  22. package/dist/{DocAnswer-BPB_pIO9.js → DocAnswer-2-0pQiDG.js} +2 -2
  23. package/dist/{DocDetails-CmuE-pGU.js → DocDetails-DVCuNQz1.js} +4 -4
  24. package/dist/{DocForm-MZuCjmqg.js → DocForm-C1h16CKJ.js} +24 -24
  25. package/dist/{DocFormSend-t1DotUWg.js → DocFormSend-CSvADG6J.js} +2 -2
  26. package/dist/{DocLinks-raND-RV3.js → DocLinks-CiooyR9I.js} +2 -2
  27. package/dist/{DocModalBase-BTf5RwrM.js → DocModalBase-DNpJtXSe.js} +1 -1
  28. package/dist/{DocPrint-rFQCpls5.js → DocPrint-BN2XolwX.js} +1 -1
  29. package/dist/{DocReceipt-BzEv7iQI.js → DocReceipt-CNsSXWUQ.js} +2 -2
  30. package/dist/{DocSendReminder-B3x4IK4a.js → DocSendReminder-ddqsBfdW.js} +1 -1
  31. package/dist/{DocTextEditor-BnizHe_5.js → DocTextEditor-BSXGQC3B.js} +8 -10
  32. package/dist/{DocTimeline-DnZj_LnM.js → DocTimeline-CZlzJcC0.js} +2 -2
  33. package/dist/{DocumentClient-gm-pzudv.js → DocumentClient-Ca2lshez.js} +5 -5
  34. package/dist/{DocumentLayout-YxxpHY-E.js → DocumentLayout-04MHXjHQ.js} +5 -5
  35. package/dist/{DocumentLogotype-ChGKZ_Qg.js → DocumentLogotype-CwFrc8nX.js} +4 -4
  36. package/dist/{DocumentVoided-HJGhl1_K.js → DocumentVoided-Cg49LHRy.js} +1 -1
  37. package/dist/{EmbedInput-vxzmm0aK.js → EmbedInput-C3dBKtt9.js} +3 -3
  38. package/dist/{EmbedSettings-CzXZc7oD.js → EmbedSettings-mgZ7Q3jr.js} +3 -3
  39. package/dist/{ErrorCallout-C51ElTfp.js → ErrorCallout-DGtE4Gkb.js} +1 -1
  40. package/dist/{FilePreviewModal-BAT5txhb.js → FilePreviewModal-apHiEc5X.js} +2 -2
  41. package/dist/{Flag-BexeJEGw.js → Flag-AqpIw6vt.js} +1 -1
  42. package/dist/{HeaderSettings-DrrnesnI.js → HeaderSettings-DA2xm48B.js} +9 -9
  43. package/dist/{ImageSelectModal-CZK9a8V7.js → ImageSelectModal-15BBn8kr.js} +3 -3
  44. package/dist/{ImageUploadWrapper-DMR97A6K.js → ImageUploadWrapper-DuI1ps_x.js} +2 -2
  45. package/dist/{Index-D4YkmlSS.js → Index-01V-x53w.js} +2 -2
  46. package/dist/{Index-DtSc0ZCn.js → Index-5yl4u_66.js} +2 -2
  47. package/dist/{Index-BEuSlOrT.js → Index-8guWguQl.js} +1 -1
  48. package/dist/{Index-CKG-y86w.js → Index-B4_dn-q7.js} +6 -6
  49. package/dist/{Index-BwDu8CJK.js → Index-B55U9Mak.js} +1 -1
  50. package/dist/{Index-Blrcegjn.js → Index-B9DvuQ1j.js} +9 -9
  51. package/dist/{Index-DPDipy5g.js → Index-BJgNYDdQ.js} +4 -4
  52. package/dist/Index-BdEBHq3w.js +4 -0
  53. package/dist/{Index-BiP_vcaf.js → Index-Bh3r0aT5.js} +3 -3
  54. package/dist/{Index-kyXImimP.js → Index-Bo07P2AB.js} +4 -4
  55. package/dist/{Index-C9yPo8e-.js → Index-BqYwxyLt.js} +3 -3
  56. package/dist/{Index-BVBYxWuz.js → Index-Bv9dMeg8.js} +4 -4
  57. package/dist/{Index-DsFK6Cph.js → Index-BwDKP0KM.js} +3 -3
  58. package/dist/{Index-DH_R4un3.js → Index-C-WVJIwA.js} +11 -11
  59. package/dist/{Index-CpsMRxtq.js → Index-C2s6OzzQ.js} +4 -4
  60. package/dist/{Index-LQVro5oP.js → Index-CDsylrsN.js} +5 -5
  61. package/dist/{Index-BYIKyMnu.js → Index-CHxM_VH6.js} +5 -5
  62. package/dist/{Index-D2ZkVyYi.js → Index-CIOTeZpH.js} +5 -5
  63. package/dist/{Index-Cfw4pakU.js → Index-CKbwZFcU.js} +4 -4
  64. package/dist/{Index-D_C0qEB3.js → Index-CnKrfMHG.js} +4 -4
  65. package/dist/{Index-B1ay-1P2.js → Index-DOXi5MTa.js} +3 -3
  66. package/dist/{Index-CWeJqHrl.js → Index-DTXq59an.js} +1 -1
  67. package/dist/{Index-CAMIux1F.js → Index-DZ1e32W_.js} +15 -15
  68. package/dist/{Index-CLJS5uIx.js → Index-Ddr0gn2U.js} +2 -2
  69. package/dist/{Index-CRrUmXai.js → Index-DeW0Jmof.js} +8 -8
  70. package/dist/{Index-CN7frBBf.js → Index-Djcu4Kor.js} +2 -2
  71. package/dist/{Index-BYFWrKuq.js → Index-Dm9QYki0.js} +8 -8
  72. package/dist/{Index-BiuMBcD2.js → Index-EhPsYaUq.js} +5 -5
  73. package/dist/{Index-DgtEJqd_.js → Index-FTsmmztf.js} +2 -2
  74. package/dist/{Index-CPcPhA1k.js → Index-Ig-zn_-6.js} +5 -5
  75. package/dist/{Index-XArklt7b.js → Index-N6YXGkwz.js} +7 -7
  76. package/dist/{Index-Dnn1-7F6.js → Index-VO4RTwVz.js} +4 -4
  77. package/dist/{Index-qVrrTuqd.js → Index-c3pdbl3Q.js} +6 -6
  78. package/dist/{Index-DLQ_V1c5.js → Index-xWNES6Ii.js} +3 -3
  79. package/dist/{Index.vue_vue_type_script_lang-CkFt4EE-.js → Index.vue_vue_type_script_lang-CBX3qTvB.js} +2 -2
  80. package/dist/{InputToggleRow-CIJ2tdb5.js → InputToggleRow-B5_iMiwC.js} +1 -1
  81. package/dist/{ManualPopover-Cm4X4puK.js → ManualPopover-B-WMPGkt.js} +1 -1
  82. package/dist/{MediaWrapper-_QoV0Yp3.js → MediaWrapper-BthTd3bH.js} +3 -3
  83. package/dist/{NotBindingText-DXOuTuRU.js → NotBindingText-BENDD3u8.js} +2 -2
  84. package/dist/{PackageGroup-CK5XKMRW.js → PackageGroup-BNiMiIP_.js} +5 -5
  85. package/dist/{PdfTerms-4-xS7sSr.js → PdfTerms-DIdrdlK6.js} +2 -2
  86. package/dist/{PdfViewer-Kl_mnvI8.js → PdfViewer-BoOkEaeV.js} +2 -2
  87. package/dist/{PlainHtml.vue_vue_type_script_setup_true_lang-BpWlRPKs.js → PlainHtml.vue_vue_type_script_setup_true_lang-DpyvH8Qz.js} +1 -1
  88. package/dist/{PriceHeader-BntNqVVQ.js → PriceHeader-Df62EuaN.js} +7 -7
  89. package/dist/{SearchApi-BEUkPklX.js → SearchApi-D-7pFFza.js} +1 -1
  90. package/dist/{SendForm-BS73k4AT.js → SendForm-BWlKikjU.js} +8 -8
  91. package/dist/{Setup-CS03IRqK.js → Setup-YAnZLFTz.js} +1 -1
  92. package/dist/{SmartList-DRocSsgI.js → SmartList-RtzzF98H.js} +1 -1
  93. package/dist/{Sortable.vue_vue_type_script_setup_true_lang-Dv_klLzu.js → Sortable.vue_vue_type_script_setup_true_lang-Cm8VPDhR.js} +1 -1
  94. package/dist/{TermsSettings-DUJ9LO60.js → TermsSettings-hl6QsMv_.js} +5 -5
  95. package/dist/{ThemeColorRow-Dd_GSct6.js → ThemeColorRow-DpSprn0X.js} +3 -3
  96. package/dist/{ToggleBinding-CfQWg9lu.js → ToggleBinding-X4ORILV3.js} +4 -4
  97. package/dist/{UploadModal-CbFASSdJ.js → UploadModal-CRY64zTx.js} +2 -2
  98. package/dist/{VideoPlayerInput-DTlqRKfe.js → VideoPlayerInput-CsWPgrQe.js} +4 -4
  99. package/dist/{VideoPlayerSettings-Dzjf2pR-.js → VideoPlayerSettings-zYjGKvcQ.js} +2 -2
  100. package/dist/{VideoSelectModal-l13Jzs11.js → VideoSelectModal-BeTXjxiY.js} +3 -3
  101. package/dist/{focusDrawerMixin-D3TS6r2P.js → focusDrawerMixin-C3BsZbNp.js} +1 -1
  102. package/dist/{formDrawerState-C4a0CyyW.js → formDrawerState-Dyvip7NB.js} +1 -1
  103. package/dist/{fortnoxTheme-BZNI3z8T.js → fortnoxTheme-B4wGHCUs.js} +1 -1
  104. package/dist/{helpers-z8_6IC7O.js → helpers-FWMhYUFJ.js} +1 -1
  105. package/dist/{index-C3pwuPoh.js → index--SRLuiLE.js} +1 -1
  106. package/dist/{index-BNLATTGI.js → index-B49KSeCj.js} +1 -1
  107. package/dist/{index-bVINFrWw.js → index-BaOn5uhR.js} +1 -1
  108. package/dist/{index-BahcePwR.js → index-Be1PivK9.js} +8 -8
  109. package/dist/{index-DKdgpzG1.js → index-C0EirtmH.js} +3 -3
  110. package/dist/{index-GBvEp_9M.js → index-M_AnKoLD.js} +1 -1
  111. package/dist/{index-4cF-Byrh.js → index-ifaR2DKW.js} +6 -6
  112. package/dist/index.es.js +1 -1
  113. package/dist/index.umd.js +4 -4
  114. package/dist/{main-D8veaMd1.js → main-BniMuY9V.js} +14 -15
  115. package/dist/{mapFormMixin-CFpAen9Y.js → mapFormMixin-CY3F2Qqf.js} +2 -2
  116. package/dist/{omit-D0GRsmN6.js → omit-COnagTdQ.js} +1 -1
  117. package/dist/{publicSenderState-eqZv8nqt.js → publicSenderState-DSvlUgfW.js} +1 -1
  118. package/dist/{splitpanes-CMv_BjEq.js → splitpanes-DTafCZco.js} +1 -1
  119. package/dist/{template-DZJeLTWP.js → template-CEB7-0IY.js} +1 -1
  120. package/dist/{tippy.esm-DfMqnQub.js → tippy.esm-DCBLYHgJ.js} +5 -5
  121. package/dist/{useTermsModal-DcYDBUN3.js → useTermsModal-BGS1XL3S.js} +4 -4
  122. package/dist/{utils-CuhF9735.js → utils-BWr51kN8.js} +1 -1
  123. package/dist/{validation-DSHT8mZg.js → validation-CMKdnZm3.js} +2 -2
  124. package/package.json +1 -1
  125. package/dist/Index-flxUW9JI.js +0 -4
package/dist/index.umd.js CHANGED
@@ -91,7 +91,7 @@ Notes are only visible to you & your team.`,updated:{posting:"Saving...",recent:
91
91
  `+s.map(y$).join(`
92
92
  `):" "+y$(s[0]):"as no adapter specified";throw new It("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i},adapters:nk};function rk(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Up(null,e)}function b$(e){return rk(e),e.headers=qi.from(e.headers),e.data=tk.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),v$.getAdapter(e.adapter||Gm.adapter,e)(e).then(function(r){return rk(e),r.data=tk.call(e,e.transformResponse,r),r.headers=qi.from(r.headers),r},function(r){return i$(r)||(rk(e),r&&r.response&&(r.response.data=tk.call(e,e.transformResponse,r.response),r.response.headers=qi.from(r.response.headers))),Promise.reject(r)})}const w$="1.12.2",Fy={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Fy[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const k$={};Fy.transitional=function(t,n,r){function i(o,s){return"[Axios v"+w$+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new It(i(s," has been removed"+(n?" in "+n:"")),It.ERR_DEPRECATED);return n&&!k$[s]&&(k$[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}},Fy.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Qpe(e,t,n){if(typeof e!="object")throw new It("options must be an object",It.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],l=a===void 0||s(a,o,e);if(l!==!0)throw new It("option "+o+" must be "+l,It.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new It("Unknown option "+o,It.ERR_BAD_OPTION)}}const Vy={assertOptions:Qpe,validators:Fy},Ys=Vy.validators;let tu=class{constructor(t){this.defaults=t||{},this.interceptors={request:new e$,response:new e$}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
93
93
  `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=eu(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&Vy.assertOptions(r,{silentJSONParsing:Ys.transitional(Ys.boolean),forcedJSONParsing:Ys.transitional(Ys.boolean),clarifyTimeoutError:Ys.transitional(Ys.boolean)},!1),i!=null&&(me.isFunction(i)?n.paramsSerializer={serialize:i}:Vy.assertOptions(i,{encode:Ys.function,serialize:Ys.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Vy.assertOptions(n,{baseUrl:Ys.spelling("baseURL"),withXsrfToken:Ys.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&me.merge(o.common,o[n.method]);o&&me.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=qi.concat(s,o);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let d,u=0,p;if(!l){const h=[b$.bind(this),void 0];for(h.unshift(...a),h.push(...c),p=h.length,d=Promise.resolve(n);u<p;)d=d.then(h[u++],h[u++]);return d}p=a.length;let f=n;for(;u<p;){const h=a[u++],m=a[u++];try{f=h(f)}catch(g){m.call(this,g);break}}try{d=b$.call(this,f)}catch(h){return Promise.reject(h)}for(u=0,p=c.length;u<p;)d=d.then(c[u++],c[u++]);return d}getUri(t){t=eu(this.defaults,t);const n=l$(t.baseURL,t.url,t.allowAbsoluteUrls);return QI(n,t.params,t.paramsSerializer)}};me.forEach(["delete","get","head","options"],function(t){tu.prototype[t]=function(n,r){return this.request(eu(r||{},{method:t,url:n,data:(r||{}).data}))}}),me.forEach(["post","put","patch"],function(t){function n(r){return function(o,s,a){return this.request(eu(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}tu.prototype[t]=n(),tu.prototype[t+"Form"]=n(!0)});let ehe=class xie{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new Up(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new xie(function(i){t=i}),cancel:t}}};function the(e){return function(n){return e.apply(null,n)}}function nhe(e){return me.isObject(e)&&e.isAxiosError===!0}const ik={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ik).forEach(([e,t])=>{ik[t]=e});function _$(e){const t=new tu(e),n=FI(tu.prototype.request,t);return me.extend(n,tu.prototype,t,{allOwnKeys:!0}),me.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return _$(eu(e,i))},n}const Jt=_$(Gm);Jt.Axios=tu,Jt.CanceledError=Up,Jt.CancelToken=ehe,Jt.isCancel=i$,Jt.VERSION=w$,Jt.toFormData=$y,Jt.AxiosError=It,Jt.Cancel=Jt.CanceledError,Jt.all=function(t){return Promise.all(t)},Jt.spread=the,Jt.isAxiosError=nhe,Jt.mergeConfig=eu,Jt.AxiosHeaders=qi,Jt.formToJSON=e=>n$(me.isHTMLForm(e)?new FormData(e):e),Jt.getAdapter=v$.getAdapter,Jt.HttpStatusCode=ik,Jt.default=Jt;const{Axios:Z3t,AxiosError:X3t,CanceledError:Q3t,isCancel:ekt,CancelToken:tkt,VERSION:nkt,all:rkt,Cancel:ikt,isAxiosError:okt,spread:skt,toFormData:akt,AxiosHeaders:lkt,HttpStatusCode:ckt,formToJSON:dkt,getAdapter:ukt,mergeConfig:pkt}=Jt;var rhe={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},ihe={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function Ym(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ym=function(t){return typeof t}:Ym=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ym(e)}function x$(e){return ohe(e)||she(e)||ahe(e)||lhe()}function ohe(e){if(Array.isArray(e))return e}function she(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function ahe(e,t){if(e){if(typeof e=="string")return C$(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C$(e,t)}}function C$(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function lhe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
94
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var che={normalizePrecision:function(t){var n=t.reduce(function(r,i){return Math.max(r.getPrecision(),i.getPrecision())});return t.map(function(r){return r.getPrecision()!==n?r.convertPrecision(n):r})},minimum:function(t){var n=x$(t),r=n[0],i=n.slice(1),o=r;return i.forEach(function(s){o=o.lessThan(s)?o:s}),o},maximum:function(t){var n=x$(t),r=n[0],i=n.slice(1),o=r;return i.forEach(function(s){o=o.greaterThan(s)?o:s}),o}};function T$(e){return!isNaN(parseInt(e))&&isFinite(e)}function dhe(e){return T$(e)&&e<=100&&e>=0}function uhe(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function S$(e){return e%2===0}function E$(e){return T$(e)&&!Number.isInteger(e)}function phe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}function Jm(e){return Math.abs(e)%1===.5}function hhe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(n,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?n(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",e,!0),fhe(i,t.headers),i.send()})}function fhe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n]);return e}function Zm(e){return typeof e>"u"}function A$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",n={};return Object.entries(e).forEach(function(r){if(Ym(r[1])==="object"){var i=A$(r[1]);Object.entries(i).forEach(function(o){n[r[0]+t+o[0]]=o[1]})}else n[r[0]]=r[1]}),n}function mhe(e){return!!e&&(Ym(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function M$(){var e=function(r,i){var o=function(l){return Math.pow(10,phe(l))},s=Math.max(o(r),o(i));return Math.round(r*s)*Math.round(i*s)/(s*s)},t={HALF_ODD:function(r){var i=Math.round(r);return Jm(r)&&S$(i)?i-1:i},HALF_EVEN:function(r){var i=Math.round(r);return Jm(r)?S$(i)?i:i-1:i},HALF_UP:function(r){return Math.round(r)},HALF_DOWN:function(r){return Jm(r)?Math.floor(r):Math.round(r)},HALF_TOWARDS_ZERO:function(r){return Jm(r)?Math.sign(r)*Math.floor(Math.abs(r)):Math.round(r)},HALF_AWAY_FROM_ZERO:function(r){return Jm(r)?Math.sign(r)*Math.ceil(Math.abs(r)):Math.round(r)},DOWN:function(r){return Math.floor(r)}};return{add:function(r,i){return r+i},subtract:function(r,i){return r-i},multiply:function(r,i){return E$(r)||E$(i)?e(r,i):r*i},divide:function(r,i){return r/i},modulo:function(r,i){return r%i},round:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[i](r)}}}var ghe=M$();function yhe(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(r){return!Zm(r)}):[]},getMinimumFractionDigits:function(){var r=function(o){return o==="."};return Zm(this.getMatches().find(r))?0:this.getMatches()[ghe.add(this.getMatches().findIndex(r),1)].split("").length},getCurrencyDisplay:function(){var r={USD:"code",dollar:"name",$:"symbol"};return r[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Zm(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Zm(this.getMatches().find(function(r){return r===","}))}}}function vhe(e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;for(var s in o)i=i.replace("{{".concat(s,"}}"),o[s]);return i},n=function(i,o){return hhe(t(e.endpoint,{from:i,to:o}),{headers:e.headers})};return{getExchangeRate:function(i,o){return(mhe(e.endpoint)?e.endpoint:n(i,o)).then(function(s){return A$(s)[t(e.propertyPath,{from:i,to:o})]})}}}function Xm(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new n(t)}function bhe(e){Xm(dhe(e),"You must provide a numeric value between 0 and 100.",RangeError)}function whe(e){Xm(uhe(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function ok(e){Xm(Number.isInteger(e),"You must provide an integer.",TypeError)}var On=M$(),khe=function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,i=n.currency,o=n.precision;ok(r),ok(o);var s=e.globalLocale,a=e.globalFormat,l=e.globalRoundingMode,c=e.globalFormatRoundingMode,d=Object.assign({},e.globalExchangeRatesApi),u=function(h){var m=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},h),Object.assign({},{locale:this.locale},h));return Object.assign(e({amount:m.amount,currency:m.currency,precision:m.precision}),{locale:m.locale})},p=function(h){Xm(this.hasSameCurrency(h),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(h){return u.call(this,{locale:h})},getPrecision:function(){return o},convertPrecision:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;ok(h);var g=this.getPrecision(),y=h>g,w=y?On.multiply:On.divide,k=y?[h,g]:[g,h],_=Math.pow(10,On.subtract.apply(On,k));return u.call(this,{amount:On.round(w(this.getAmount(),_),m),precision:h})},add:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return u.call(this,{amount:On.add(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},subtract:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return u.call(this,{amount:On.subtract(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},multiply:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u.call(this,{amount:On.round(On.multiply(this.getAmount(),h),m)})},divide:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u.call(this,{amount:On.round(On.divide(this.getAmount(),h),m)})},percentage:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return bhe(h),this.multiply(On.divide(h,100),m)},allocate:function(h){var m=this;whe(h);for(var g=h.reduce(function(_,M){return On.add(_,M)}),y=this.getAmount(),w=h.map(function(_){var M=Math.floor(On.divide(On.multiply(m.getAmount(),_),g));return y=On.subtract(y,M),u.call(m,{amount:M})}),k=0;y>0;)h[k]>0&&(w[k]=w[k].add(u.call(this,{amount:1})),y=On.subtract(y,1)),k+=1;return w},convert:function(h){var m=this,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=g.endpoint,w=y===void 0?d.endpoint:y,k=g.propertyPath,_=k===void 0?d.propertyPath||"rates.{{to}}":k,M=g.headers,S=M===void 0?d.headers:M,O=g.roundingMode,P=O===void 0?l:O,I=Object.assign({},{endpoint:w,propertyPath:_,headers:S,roundingMode:P});return vhe(I).getExchangeRate(this.getCurrency(),h).then(function(L){return Xm(!Zm(L),'No rate was found for the destination currency "'.concat(h,'".'),TypeError),u.call(m,{amount:On.round(On.multiply(m.getAmount(),parseFloat(L)),I.roundingMode),currency:h})})},equalsTo:function(h){return this.hasSameAmount(h)&&this.hasSameCurrency(h)},lessThan:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return m[0].getAmount()<m[1].getAmount()},lessThanOrEqual:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return m[0].getAmount()<=m[1].getAmount()},greaterThan:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return m[0].getAmount()>m[1].getAmount()},greaterThanOrEqual:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return m[0].getAmount()>=m[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return On.modulo(this.getAmount(),Math.pow(10,o))!==0},hasCents:function(){return On.modulo(this.getAmount(),Math.pow(10,o))!==0},hasSameCurrency:function(h){return this.getCurrency()===h.getCurrency()},hasSameAmount:function(h){var m=e.normalizePrecision([this,h]);return m[0].getAmount()===m[1].getAmount()},toFormat:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,g=yhe(h);return this.toRoundedUnit(g.getMinimumFractionDigits(),m).toLocaleString(this.getLocale(),{currencyDisplay:g.getCurrencyDisplay(),useGrouping:g.getUseGrouping(),minimumFractionDigits:g.getMinimumFractionDigits(),style:g.getStyle(),currency:this.getCurrency()})},toUnit:function(){return On.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,g=Math.pow(10,h);return On.divide(On.round(On.multiply(this.toUnit(),g),m),g)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}},rc=Object.assign(khe,rhe,ihe,che),sk,O$;function _he(){if(O$)return sk;O$=1;function e(){this.__data__=[],this.size=0}return sk=e,sk}var ak,D$;function lk(){if(D$)return ak;D$=1;function e(t,n){return t===n||t!==t&&n!==n}return ak=e,ak}var ck,P$;function By(){if(P$)return ck;P$=1;var e=lk();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return ck=t,ck}var dk,I$;function xhe(){if(I$)return dk;I$=1;var e=By(),t=Array.prototype,n=t.splice;function r(i){var o=this.__data__,s=e(o,i);if(s<0)return!1;var a=o.length-1;return s==a?o.pop():n.call(o,s,1),--this.size,!0}return dk=r,dk}var uk,$$;function Che(){if($$)return uk;$$=1;var e=By();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return uk=t,uk}var pk,R$;function The(){if(R$)return pk;R$=1;var e=By();function t(n){return e(this.__data__,n)>-1}return pk=t,pk}var hk,L$;function She(){if(L$)return hk;L$=1;var e=By();function t(n,r){var i=this.__data__,o=e(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return hk=t,hk}var fk,N$;function zy(){if(N$)return fk;N$=1;var e=_he(),t=xhe(),n=Che(),r=The(),i=She();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,fk=o,fk}var mk,F$;function Ehe(){if(F$)return mk;F$=1;var e=zy();function t(){this.__data__=new e,this.size=0}return mk=t,mk}var gk,V$;function Ahe(){if(V$)return gk;V$=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return gk=e,gk}var yk,B$;function Mhe(){if(B$)return yk;B$=1;function e(t){return this.__data__.get(t)}return yk=e,yk}var vk,z$;function Ohe(){if(z$)return vk;z$=1;function e(t){return this.__data__.has(t)}return vk=e,vk}var bk,U$;function j$(){if(U$)return bk;U$=1;var e=typeof k0=="object"&&k0&&k0.Object===Object&&k0;return bk=e,bk}var wk,H$;function ds(){if(H$)return wk;H$=1;var e=j$(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return wk=n,wk}var kk,q$;function jp(){if(q$)return kk;q$=1;var e=ds(),t=e.Symbol;return kk=t,kk}var _k,W$;function Dhe(){if(W$)return _k;W$=1;var e=jp(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function o(s){var a=n.call(s,i),l=s[i];try{s[i]=void 0;var c=!0}catch{}var d=r.call(s);return c&&(a?s[i]=l:delete s[i]),d}return _k=o,_k}var xk,G$;function Phe(){if(G$)return xk;G$=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return xk=n,xk}var Ck,K$;function Hp(){if(K$)return Ck;K$=1;var e=jp(),t=Dhe(),n=Phe(),r="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?i:r:o&&o in Object(a)?t(a):n(a)}return Ck=s,Ck}var Tk,Y$;function Js(){if(Y$)return Tk;Y$=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Tk=e,Tk}var Sk,J$;function Z$(){if(J$)return Sk;J$=1;var e=Hp(),t=Js(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!t(a))return!1;var l=e(a);return l==r||l==i||l==n||l==o}return Sk=s,Sk}var Ek,X$;function Ihe(){if(X$)return Ek;X$=1;var e=ds(),t=e["__core-js_shared__"];return Ek=t,Ek}var Ak,Q$;function $he(){if(Q$)return Ak;Q$=1;var e=Ihe(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return Ak=n,Ak}var Mk,eR;function tR(){if(eR)return Mk;eR=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Mk=n,Mk}var Ok,nR;function Rhe(){if(nR)return Ok;nR=1;var e=Z$(),t=$he(),n=Js(),r=tR(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,d=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function u(p){if(!n(p)||t(p))return!1;var f=e(p)?d:o;return f.test(r(p))}return Ok=u,Ok}var Dk,rR;function Lhe(){if(rR)return Dk;rR=1;function e(t,n){return t==null?void 0:t[n]}return Dk=e,Dk}var Pk,iR;function nu(){if(iR)return Pk;iR=1;var e=Rhe(),t=Lhe();function n(r,i){var o=t(r,i);return e(o)?o:void 0}return Pk=n,Pk}var Ik,oR;function $k(){if(oR)return Ik;oR=1;var e=nu(),t=ds(),n=e(t,"Map");return Ik=n,Ik}var Rk,sR;function Uy(){if(sR)return Rk;sR=1;var e=nu(),t=e(Object,"create");return Rk=t,Rk}var Lk,aR;function Nhe(){if(aR)return Lk;aR=1;var e=Uy();function t(){this.__data__=e?e(null):{},this.size=0}return Lk=t,Lk}var Nk,lR;function Fhe(){if(lR)return Nk;lR=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Nk=e,Nk}var Fk,cR;function Vhe(){if(cR)return Fk;cR=1;var e=Uy(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var s=this.__data__;if(e){var a=s[o];return a===t?void 0:a}return r.call(s,o)?s[o]:void 0}return Fk=i,Fk}var Vk,dR;function Bhe(){if(dR)return Vk;dR=1;var e=Uy(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var o=this.__data__;return e?o[i]!==void 0:n.call(o,i)}return Vk=r,Vk}var Bk,uR;function zhe(){if(uR)return Bk;uR=1;var e=Uy(),t="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&i===void 0?t:i,this}return Bk=n,Bk}var zk,pR;function Uhe(){if(pR)return zk;pR=1;var e=Nhe(),t=Fhe(),n=Vhe(),r=Bhe(),i=zhe();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,zk=o,zk}var Uk,hR;function jhe(){if(hR)return Uk;hR=1;var e=Uhe(),t=zy(),n=$k();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Uk=r,Uk}var jk,fR;function Hhe(){if(fR)return jk;fR=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return jk=e,jk}var Hk,mR;function jy(){if(mR)return Hk;mR=1;var e=Hhe();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Hk=t,Hk}var qk,gR;function qhe(){if(gR)return qk;gR=1;var e=jy();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return qk=t,qk}var Wk,yR;function Whe(){if(yR)return Wk;yR=1;var e=jy();function t(n){return e(this,n).get(n)}return Wk=t,Wk}var Gk,vR;function Ghe(){if(vR)return Gk;vR=1;var e=jy();function t(n){return e(this,n).has(n)}return Gk=t,Gk}var Kk,bR;function Khe(){if(bR)return Kk;bR=1;var e=jy();function t(n,r){var i=e(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Kk=t,Kk}var Yk,wR;function Jk(){if(wR)return Yk;wR=1;var e=jhe(),t=qhe(),n=Whe(),r=Ghe(),i=Khe();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Yk=o,Yk}var Zk,kR;function Yhe(){if(kR)return Zk;kR=1;var e=zy(),t=$k(),n=Jk(),r=200;function i(o,s){var a=this.__data__;if(a instanceof e){var l=a.__data__;if(!t||l.length<r-1)return l.push([o,s]),this.size=++a.size,this;a=this.__data__=new n(l)}return a.set(o,s),this.size=a.size,this}return Zk=i,Zk}var Xk,_R;function Qk(){if(_R)return Xk;_R=1;var e=zy(),t=Ehe(),n=Ahe(),r=Mhe(),i=Ohe(),o=Yhe();function s(a){var l=this.__data__=new e(a);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=r,s.prototype.has=i,s.prototype.set=o,Xk=s,Xk}var e_,xR;function Jhe(){if(xR)return e_;xR=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i&&n(t[r],r,t)!==!1;);return t}return e_=e,e_}var t_,CR;function TR(){if(CR)return t_;CR=1;var e=nu(),t=function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}}();return t_=t,t_}var n_,SR;function ER(){if(SR)return n_;SR=1;var e=TR();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return n_=t,n_}var r_,AR;function i_(){if(AR)return r_;AR=1;var e=ER(),t=lk(),n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a){var l=o[s];(!(r.call(o,s)&&t(l,a))||a===void 0&&!(s in o))&&e(o,s,a)}return r_=i,r_}var o_,MR;function Qm(){if(MR)return o_;MR=1;var e=i_(),t=ER();function n(r,i,o,s){var a=!o;o||(o={});for(var l=-1,c=i.length;++l<c;){var d=i[l],u=s?s(o[d],r[d],d,o,r):void 0;u===void 0&&(u=r[d]),a?t(o,d,u):e(o,d,u)}return o}return o_=n,o_}var s_,OR;function Zhe(){if(OR)return s_;OR=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return s_=e,s_}var a_,DR;function Ka(){if(DR)return a_;DR=1;function e(t){return t!=null&&typeof t=="object"}return a_=e,a_}var l_,PR;function Xhe(){if(PR)return l_;PR=1;var e=Hp(),t=Ka(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return l_=r,l_}var c_,IR;function d_(){if(IR)return c_;IR=1;var e=Xhe(),t=Ka(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,o=e(function(){return arguments}())?e:function(s){return t(s)&&r.call(s,"callee")&&!i.call(s,"callee")};return c_=o,c_}var u_,$R;function Zs(){if($R)return u_;$R=1;var e=Array.isArray;return u_=e,u_}var e1={exports:{}},p_,RR;function Qhe(){if(RR)return p_;RR=1;function e(){return!1}return p_=e,p_}e1.exports;var LR;function h_(){return LR||(LR=1,function(e,t){var n=ds(),r=Qhe(),i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===i,a=s?n.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;e.exports=c}(e1,e1.exports)),e1.exports}var f_,NR;function m_(){if(NR)return f_;NR=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var o=typeof r;return i=i??e,!!i&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return f_=n,f_}var g_,FR;function y_(){if(FR)return g_;FR=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return g_=t,g_}var v_,VR;function efe(){if(VR)return v_;VR=1;var e=Hp(),t=y_(),n=Ka(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",d="[object Number]",u="[object Object]",p="[object RegExp]",f="[object Set]",h="[object String]",m="[object WeakMap]",g="[object ArrayBuffer]",y="[object DataView]",w="[object Float32Array]",k="[object Float64Array]",_="[object Int8Array]",M="[object Int16Array]",S="[object Int32Array]",O="[object Uint8Array]",P="[object Uint8ClampedArray]",I="[object Uint16Array]",L="[object Uint32Array]",$={};$[w]=$[k]=$[_]=$[M]=$[S]=$[O]=$[P]=$[I]=$[L]=!0,$[r]=$[i]=$[g]=$[o]=$[y]=$[s]=$[a]=$[l]=$[c]=$[d]=$[u]=$[p]=$[f]=$[h]=$[m]=!1;function F(U){return n(U)&&t(U.length)&&!!$[e(U)]}return v_=F,v_}var b_,BR;function Hy(){if(BR)return b_;BR=1;function e(t){return function(n){return t(n)}}return b_=e,b_}var t1={exports:{}};t1.exports;var zR;function w_(){return zR||(zR=1,function(e,t){var n=j$(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();e.exports=a}(t1,t1.exports)),t1.exports}var k_,UR;function jR(){if(UR)return k_;UR=1;var e=efe(),t=Hy(),n=w_(),r=n&&n.isTypedArray,i=r?t(r):e;return k_=i,k_}var __,HR;function qR(){if(HR)return __;HR=1;var e=Zhe(),t=d_(),n=Zs(),r=h_(),i=m_(),o=jR(),s=Object.prototype,a=s.hasOwnProperty;function l(c,d){var u=n(c),p=!u&&t(c),f=!u&&!p&&r(c),h=!u&&!p&&!f&&o(c),m=u||p||f||h,g=m?e(c.length,String):[],y=g.length;for(var w in c)(d||a.call(c,w))&&!(m&&(w=="length"||f&&(w=="offset"||w=="parent")||h&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||i(w,y)))&&g.push(w);return g}return __=l,__}var x_,WR;function C_(){if(WR)return x_;WR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return x_=t,x_}var T_,GR;function KR(){if(GR)return T_;GR=1;function e(t,n){return function(r){return t(n(r))}}return T_=e,T_}var S_,YR;function tfe(){if(YR)return S_;YR=1;var e=KR(),t=e(Object.keys,Object);return S_=t,S_}var E_,JR;function nfe(){if(JR)return E_;JR=1;var e=C_(),t=tfe(),n=Object.prototype,r=n.hasOwnProperty;function i(o){if(!e(o))return t(o);var s=[];for(var a in Object(o))r.call(o,a)&&a!="constructor"&&s.push(a);return s}return E_=i,E_}var A_,ZR;function M_(){if(ZR)return A_;ZR=1;var e=Z$(),t=y_();function n(r){return r!=null&&t(r.length)&&!e(r)}return A_=n,A_}var O_,XR;function qy(){if(XR)return O_;XR=1;var e=qR(),t=nfe(),n=M_();function r(i){return n(i)?e(i):t(i)}return O_=r,O_}var D_,QR;function rfe(){if(QR)return D_;QR=1;var e=Qm(),t=qy();function n(r,i){return r&&e(i,t(i),r)}return D_=n,D_}var P_,eL;function ife(){if(eL)return P_;eL=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return P_=e,P_}var I_,tL;function ofe(){if(tL)return I_;tL=1;var e=Js(),t=C_(),n=ife(),r=Object.prototype,i=r.hasOwnProperty;function o(s){if(!e(s))return n(s);var a=t(s),l=[];for(var c in s)c=="constructor"&&(a||!i.call(s,c))||l.push(c);return l}return I_=o,I_}var $_,nL;function R_(){if(nL)return $_;nL=1;var e=qR(),t=ofe(),n=M_();function r(i){return n(i)?e(i,!0):t(i)}return $_=r,$_}var L_,rL;function sfe(){if(rL)return L_;rL=1;var e=Qm(),t=R_();function n(r,i){return r&&e(i,t(i),r)}return L_=n,L_}var n1={exports:{}};n1.exports;var iL;function afe(){return iL||(iL=1,function(e,t){var n=ds(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;function l(c,d){if(d)return c.slice();var u=c.length,p=a?a(u):new c.constructor(u);return c.copy(p),p}e.exports=l}(n1,n1.exports)),n1.exports}var N_,oL;function lfe(){if(oL)return N_;oL=1;function e(t,n){var r=-1,i=t.length;for(n||(n=Array(i));++r<i;)n[r]=t[r];return n}return N_=e,N_}var F_,sL;function cfe(){if(sL)return F_;sL=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,o=0,s=[];++r<i;){var a=t[r];n(a,r,t)&&(s[o++]=a)}return s}return F_=e,F_}var V_,aL;function lL(){if(aL)return V_;aL=1;function e(){return[]}return V_=e,V_}var B_,cL;function z_(){if(cL)return B_;cL=1;var e=cfe(),t=lL(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(a){return r.call(s,a)}))}:t;return B_=o,B_}var U_,dL;function dfe(){if(dL)return U_;dL=1;var e=Qm(),t=z_();function n(r,i){return e(r,t(r),i)}return U_=n,U_}var j_,uL;function H_(){if(uL)return j_;uL=1;function e(t,n){for(var r=-1,i=n.length,o=t.length;++r<i;)t[o+r]=n[r];return t}return j_=e,j_}var q_,pL;function W_(){if(pL)return q_;pL=1;var e=KR(),t=e(Object.getPrototypeOf,Object);return q_=t,q_}var G_,hL;function fL(){if(hL)return G_;hL=1;var e=H_(),t=W_(),n=z_(),r=lL(),i=Object.getOwnPropertySymbols,o=i?function(s){for(var a=[];s;)e(a,n(s)),s=t(s);return a}:r;return G_=o,G_}var K_,mL;function ufe(){if(mL)return K_;mL=1;var e=Qm(),t=fL();function n(r,i){return e(r,t(r),i)}return K_=n,K_}var Y_,gL;function yL(){if(gL)return Y_;gL=1;var e=H_(),t=Zs();function n(r,i,o){var s=i(r);return t(r)?s:e(s,o(r))}return Y_=n,Y_}var J_,vL;function bL(){if(vL)return J_;vL=1;var e=yL(),t=z_(),n=qy();function r(i){return e(i,n,t)}return J_=r,J_}var Z_,wL;function kL(){if(wL)return Z_;wL=1;var e=yL(),t=fL(),n=R_();function r(i){return e(i,n,t)}return Z_=r,Z_}var X_,_L;function pfe(){if(_L)return X_;_L=1;var e=nu(),t=ds(),n=e(t,"DataView");return X_=n,X_}var Q_,xL;function hfe(){if(xL)return Q_;xL=1;var e=nu(),t=ds(),n=e(t,"Promise");return Q_=n,Q_}var ex,CL;function TL(){if(CL)return ex;CL=1;var e=nu(),t=ds(),n=e(t,"Set");return ex=n,ex}var tx,SL;function ffe(){if(SL)return tx;SL=1;var e=nu(),t=ds(),n=e(t,"WeakMap");return tx=n,tx}var nx,EL;function Wy(){if(EL)return nx;EL=1;var e=pfe(),t=$k(),n=hfe(),r=TL(),i=ffe(),o=Hp(),s=tR(),a="[object Map]",l="[object Object]",c="[object Promise]",d="[object Set]",u="[object WeakMap]",p="[object DataView]",f=s(e),h=s(t),m=s(n),g=s(r),y=s(i),w=o;return(e&&w(new e(new ArrayBuffer(1)))!=p||t&&w(new t)!=a||n&&w(n.resolve())!=c||r&&w(new r)!=d||i&&w(new i)!=u)&&(w=function(k){var _=o(k),M=_==l?k.constructor:void 0,S=M?s(M):"";if(S)switch(S){case f:return p;case h:return a;case m:return c;case g:return d;case y:return u}return _}),nx=w,nx}var rx,AL;function mfe(){if(AL)return rx;AL=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&t.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return rx=n,rx}var ix,ML;function OL(){if(ML)return ix;ML=1;var e=ds(),t=e.Uint8Array;return ix=t,ix}var ox,DL;function sx(){if(DL)return ox;DL=1;var e=OL();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return ox=t,ox}var ax,PL;function gfe(){if(PL)return ax;PL=1;var e=sx();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}return ax=t,ax}var lx,IL;function yfe(){if(IL)return lx;IL=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return lx=t,lx}var cx,$L;function vfe(){if($L)return cx;$L=1;var e=jp(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(i){return n?Object(n.call(i)):{}}return cx=r,cx}var dx,RL;function bfe(){if(RL)return dx;RL=1;var e=sx();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}return dx=t,dx}var ux,LL;function wfe(){if(LL)return ux;LL=1;var e=sx(),t=gfe(),n=yfe(),r=vfe(),i=bfe(),o="[object Boolean]",s="[object Date]",a="[object Map]",l="[object Number]",c="[object RegExp]",d="[object Set]",u="[object String]",p="[object Symbol]",f="[object ArrayBuffer]",h="[object DataView]",m="[object Float32Array]",g="[object Float64Array]",y="[object Int8Array]",w="[object Int16Array]",k="[object Int32Array]",_="[object Uint8Array]",M="[object Uint8ClampedArray]",S="[object Uint16Array]",O="[object Uint32Array]";function P(I,L,$){var F=I.constructor;switch(L){case f:return e(I);case o:case s:return new F(+I);case h:return t(I,$);case m:case g:case y:case w:case k:case _:case M:case S:case O:return i(I,$);case a:return new F;case l:case u:return new F(I);case c:return n(I);case d:return new F;case p:return r(I)}}return ux=P,ux}var px,NL;function kfe(){if(NL)return px;NL=1;var e=Js(),t=Object.create,n=function(){function r(){}return function(i){if(!e(i))return{};if(t)return t(i);r.prototype=i;var o=new r;return r.prototype=void 0,o}}();return px=n,px}var hx,FL;function _fe(){if(FL)return hx;FL=1;var e=kfe(),t=W_(),n=C_();function r(i){return typeof i.constructor=="function"&&!n(i)?e(t(i)):{}}return hx=r,hx}var fx,VL;function xfe(){if(VL)return fx;VL=1;var e=Wy(),t=Ka(),n="[object Map]";function r(i){return t(i)&&e(i)==n}return fx=r,fx}var mx,BL;function Cfe(){if(BL)return mx;BL=1;var e=xfe(),t=Hy(),n=w_(),r=n&&n.isMap,i=r?t(r):e;return mx=i,mx}var gx,zL;function Tfe(){if(zL)return gx;zL=1;var e=Wy(),t=Ka(),n="[object Set]";function r(i){return t(i)&&e(i)==n}return gx=r,gx}var yx,UL;function Sfe(){if(UL)return yx;UL=1;var e=Tfe(),t=Hy(),n=w_(),r=n&&n.isSet,i=r?t(r):e;return yx=i,yx}var vx,jL;function bx(){if(jL)return vx;jL=1;var e=Qk(),t=Jhe(),n=i_(),r=rfe(),i=sfe(),o=afe(),s=lfe(),a=dfe(),l=ufe(),c=bL(),d=kL(),u=Wy(),p=mfe(),f=wfe(),h=_fe(),m=Zs(),g=h_(),y=Cfe(),w=Js(),k=Sfe(),_=qy(),M=R_(),S=1,O=2,P=4,I="[object Arguments]",L="[object Array]",$="[object Boolean]",F="[object Date]",U="[object Error]",q="[object Function]",z="[object GeneratorFunction]",D="[object Map]",N="[object Number]",B="[object Object]",Q="[object RegExp]",te="[object Set]",he="[object String]",Me="[object Symbol]",Ue="[object WeakMap]",Ze="[object ArrayBuffer]",qe="[object DataView]",rt="[object Float32Array]",oe="[object Float64Array]",ge="[object Int8Array]",Ae="[object Int16Array]",ke="[object Int32Array]",Xe="[object Uint8Array]",ht="[object Uint8ClampedArray]",K="[object Uint16Array]",Z="[object Uint32Array]",ie={};ie[I]=ie[L]=ie[Ze]=ie[qe]=ie[$]=ie[F]=ie[rt]=ie[oe]=ie[ge]=ie[Ae]=ie[ke]=ie[D]=ie[N]=ie[B]=ie[Q]=ie[te]=ie[he]=ie[Me]=ie[Xe]=ie[ht]=ie[K]=ie[Z]=!0,ie[U]=ie[q]=ie[Ue]=!1;function xe(ue,Ce,Ne,Re,Ee,_e){var Ge,Ve=Ce&S,Je=Ce&O,st=Ce&P;if(Ne&&(Ge=Ee?Ne(ue,Re,Ee,_e):Ne(ue)),Ge!==void 0)return Ge;if(!w(ue))return ue;var Ot=m(ue);if(Ot){if(Ge=p(ue),!Ve)return s(ue,Ge)}else{var Pt=u(ue),Ut=Pt==q||Pt==z;if(g(ue))return o(ue,Ve);if(Pt==B||Pt==I||Ut&&!Ee){if(Ge=Je||Ut?{}:h(ue),!Ve)return Je?l(ue,i(Ge,ue)):a(ue,r(Ge,ue))}else{if(!ie[Pt])return Ee?ue:{};Ge=f(ue,Pt,Ve)}}_e||(_e=new e);var qt=_e.get(ue);if(qt)return qt;_e.set(ue,Ge),k(ue)?ue.forEach(function(He){Ge.add(xe(He,Ce,Ne,He,ue,_e))}):y(ue)&&ue.forEach(function(He,fe){Ge.set(fe,xe(He,Ce,Ne,fe,ue,_e))});var vn=st?Je?d:c:Je?M:_,Ct=Ot?void 0:vn(ue);return t(Ct||ue,function(He,fe){Ct&&(fe=He,He=ue[fe]),n(Ge,fe,xe(He,Ce,Ne,fe,ue,_e))}),Ge}return vx=xe,vx}var wx,HL;function Efe(){if(HL)return wx;HL=1;var e=bx(),t=1,n=4;function r(i,o){return o=typeof o=="function"?o:void 0,e(i,t|n,o)}return wx=r,wx}var Afe=Efe();const Mfe=hr(Afe);function Ofe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qp={exports:{}};const Dfe=_0(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var qL;function Pfe(){if(qL)return qp.exports;qL=1;var e=typeof process<"u"&&process.pid?process.pid.toString(36):"",t="";if(typeof __webpack_require__!="function"&&typeof Ofe<"u"){var n="",r=Dfe;if(r.networkInterfaces)var i=r.networkInterfaces();if(i){e:for(let a in i){const l=i[a],c=l.length;for(var o=0;o<c;o++)if(l[o]!==void 0&&l[o].mac&&l[o].mac!="00:00:00:00:00:00"){n=l[o].mac;break e}}t=n?parseInt(n.replace(/\:|\D+/gi,"")).toString(36):""}}qp.exports=qp.exports.default=function(a,l){return(a||"")+t+e+s().toString(36)+(l||"")},qp.exports.process=function(a,l){return(a||"")+e+s().toString(36)+(l||"")},qp.exports.time=function(a,l){return(a||"")+s().toString(36)+(l||"")};function s(){var a=Date.now(),l=s.last||a;return s.last=a>l?a:l+1}return qp.exports}var Ife=Pfe();const zt=hr(Ife),Wp={},WL={};function Gy(e){if(WL[e])return;if(Wp[e])return Wp[e];const t=new Promise((n,r)=>{const i=document.createElement("script");e.endsWith(".mjs")&&(i.type="module");const o=window.setTimeout(()=>{Wp[e]=null,r(new Error(`Failed to load ${e} in 20s`))},2e4);i.onload=()=>{o&&window.clearTimeout(o),WL[e]=!0,Wp[e]=null,n()},i.onerror=s=>{o&&window.clearTimeout(o),Wp[e]=null,r(s)},i.src=e,document.body.appendChild(i)});return Wp[e]=t,t}function GL(e){const t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth,i=t.top<=n&&t.top+t.height>=0,o=t.left<=r&&t.left+t.width>=0;return i&&o}const kx=e=>{const t=/(auto|scroll)/,n=(a,l)=>a.parentNode===null?l:n(a.parentNode,l.concat([a])),r=(a,l)=>getComputedStyle(a,null).getPropertyValue(l),i=a=>r(a,"overflow")+r(a,"overflow-y")+r(a,"overflow-x"),o=a=>t.test(i(a));return(a=>{if(!(a instanceof HTMLElement||a instanceof SVGElement))return null;const l=n(a.parentNode,[]);for(let c=0;c<l.length;c+=1)if(o(l[c]))return l[c];return document.scrollingElement||document.documentElement})(e)},$fe=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};function r1(e,t){let n=e;if(typeof n=="string"&&(n=document.querySelector(n)),!kx(n))return;const i={offset:0,behavior:"smooth",body:kx(n),...t},o=$fe(n);HTMLElement.prototype.scrollTo?i.body.scrollTo({behavior:i.behavior,top:o-i.offset}):i.body.scrollTop=o-i.offset}const Ky=e=>{var r;const t=(r=e==null?void 0:e.getRootNode)==null?void 0:r.call(e),n=(t==null?void 0:t.toString())==="[object ShadowRoot]";return{isShadow:n,el:n?t:document}},KL=(e,t)=>(e||"").substr(0,t-1)+((e||"").length>t?"...":""),YL=e=>typeof e!="string"?"":e.replace(/<[^>]+>/g," ");function Rfe(e){return Number(e)===e&&e%1!==0}function kn(e){if(e===void 0)return"undefined";if(e===null)return"null";if(Array.isArray(e))return"array";if(typeof e=="object"&&!(e instanceof Date))return"object";if(Number.isNaN(e))return"nan";if(e===1/0)return"infinity";if(Number.isInteger(e)||Rfe(e))return"number";if(typeof e=="string")return"string";if(typeof e=="boolean")return"boolean";if(typeof e=="function")return"function";if(e instanceof Date&&Pd(e))return"date"}function Lfe(e,t){if(!["array","object"].includes(kn(e)))throw Error("Arg.0 must be an array or object");if(typeof t!="string")throw Error("Arg.1, path must be a string");let n=t.replace(/\[(.*)\]/gi,(i,o)=>`.${o}`).split(".");return n[0]===""&&(n=n.splice(1)),n.reduce((i,o)=>i&&(typeof i[o]!="object",i[o]),e)}const _x=e=>new Promise(t=>setTimeout(t,e)),Nfe=(e={},t={})=>{if(typeof e!="object")throw Error("Query must be an object!");if(typeof t!="object")throw Error("Options must be an object!");const n={prefix:"_",convertFilter:!0,...t};let r="?";function i(o){let s="";function a(l){let c="";return Object.keys(l).forEach(d=>{["or","and"].includes(d)?a(l[d])&&(c+=`${d}(${a(l[d])})`):Object.keys(l[d]).forEach(u=>{let p="";const f=l[d][u]===!0,h=l[d][u]===!1,m=l[d][u]==="contains";d.includes(".")&&(d=`'${d}'`),f?p=`${d}=${u}`:h?p=`${d}!=${u}`:m&&(p=`${d}*=${u}`),p&&(!["(",","].includes(c[c.length-1])&&c.length&&(c=`${c},`),c+=p)})}),c}return s=`_where=and(${a(o)})`,s}return Object.keys(e).forEach((o,s)=>{if(typeof e[o]>"u")return;const a=n.prefix?n.prefix:"";let l=e[o];typeof l=="string"&&(l=encodeURIComponent(l));let c=`${a}${o}=${l}`;o==="filter"&&n.convertFilter&&(c=i(l)),r=`${r}${s?"&":""}${c}`}),r.length>1?r:""};function Gp(e,t=!1){if(typeof e!="object"||Array.isArray(e))throw Error("Arg.0 must be an object");return{...e,_uniqueId:e._uniqueId&&!t?e._uniqueId:zt()}}function Yy(e){if(!(typeof e!="object"||e===null))for(const t of Object.keys(e)){const n=e[t];if(!(!n||typeof n!="object")){if(!Array.isArray(n)){Yy(n);continue}for(let r=0;r<n.length;r++)typeof n[r]!="object"||Array.isArray(n[r])||(n[r]=Gp(n[r]));Yy(n)}}}function xx(e){if(e)for(const t of Object.keys(e)){const n=e[t];if(t==="_uniqueId"){delete e[t];continue}if(!(!n||typeof n!="object")){if(!Array.isArray(n)){xx(n);continue}for(let r=0;r<n.length;r++)typeof n[r]!="object"||Array.isArray(n[r])||xx(n)}}}function Ffe(e,t){function n(r){r&&typeof r=="object"&&t.forEach(i=>{delete r[i]})}return Mfe(e,n)}function Vfe(e){return Math.abs(e)%1===.5}function Bfe(e){return e%2===0}function JL(e){const t=Math.round(e);return Vfe(e)?Bfe(t)?t:t-1:t}function Cx(e){if(!(!e||typeof e!="object"))for(const t of Object.keys(e)){const n=e[t];if(n&&typeof n=="number")e[t]=JL(n);else if(Array.isArray(n))for(let r=0;r<n.length;r++)Cx(e[t][r]);else Cx(e[t])}}function zfe({price:e,discountType:t,discount:n,quantity:r=1}){if(typeof e>"u")throw Error("Missing param price");if(typeof t>"u")throw Error("Missing param discountType");if(typeof n>"u")throw Error("Missing param discount");if(typeof r>"u")throw Error("Missing param quantity");if(!r)return 0;let i=e*r;return t==="fixed"&&n?i-=n:t==="percentage"&&n&&(i*=(100-n/100)/100),JL(i)}function ru(e){if(typeof e!="object"&&!Array.isArray(e))throw Error("Missing valid parameter articles");let t=Array.isArray(e)?e:[e];return t=t.map(n=>{const{price:r,quantity:i,discountType:o,discount:s}=n;return{...n,totalAmount:zfe({price:r,quantity:i,discountType:o,discount:s})}}),Array.isArray(e)?t:t[0]}function Xs(e){if(typeof e!="object"||Array.isArray(e))throw Error("Arg.0 must be an object");let t={ArticleId:null,article_no:null,id:null,vat:null,isDeductable:!1,isRut:!1,greenRot15:!1,greenRot20:!1,greenRot50:!1,name:"",description:"",price:0,currency:"SEK",priceType:"fixed",quantity:1,showPrice:!0,unitType:"unit",position:null,discountType:"fixed",discount:null,totalAmount:0,packageId:null,...e};return t=Gp(t),t=ru(t),t}const Jy=e=>["isDeductable","isRut","greenRot15","greenRot20","greenRot50"].some(t=>!!e[t]),Zy=e=>{const{isDeductable:t,isRut:n,greenRot15:r,greenRot20:i,greenRot50:o}=e||{};return t?"rot":n?"rut":r?"greenRot15":i?"greenRot20":o?"greenRot50":null},ic=(e,{count:t=null,includeCount:n=!1,lng:r=null,instance:i}={})=>{if(typeof e!="string")return"";const o=i||ye,s={...typeof t=="number"&&{count:t},...r&&{lng:r}};if(!e.startsWith("$")){let u=`unitType.${e}`;return i||(u=`_common:${u}`),n?o.tc(u,s):o.t(u,s)}const a=s.count!==void 0&&t!==1,[l,c]=e.replace("$","").split(":"),d=a&&c?c:l;return n?`${t} ${d}`:d};function Tx(e,t,n="sv"){let r=kn(e),i=kn(t),o=e,s=t;if(o===null)return-1;if(s===null)return 1;if(r!==i||!["string","date","number"].includes(r))return 0;if(r!=="date"){if(!Number.isNaN(parseInt(o,10))&&!Number.isNaN(parseInt(s,10))&&/^(?:\d|\.)*$/i.test(o)&&/^(?:\d|\.)*$/i.test(s)&&(o=parseInt(o,10),s=parseInt(s,10),r="number",i="number"),r==="number")return o<s?-1:o>s?1:0;if(!Pd($d(o))||!Pd($d(s)))return n?o.localeCompare(s,n):o.localeCompare(s);o=$d(o),s=$d(s)}return G3(o,s)?1:G3(s,o)?-1:0}function Kp(e,t=[]){return!t||kn(t)==="array"&&!t.length?e:Object.keys(e).filter(r=>t.includes(r)).reduce((r,i)=>({...r,[i]:e[i]}),{})}function i1(e,t=[]){return!t||kn(t)==="array"&&!t.length?e:Object.keys(e).filter(r=>!t.includes(r)).reduce((r,i)=>({...r,[i]:e[i]}),{})}function Ufe(e={}){const{manageCompany:t,manageProjects:n,manageOwnProjects:r,showPrices:i,manageAtas:o,manageOwnAtas:s,manageUsers:a}=e;return t&&n&&r&&i&&o&&s&&a?"admin":r&&i&&o&&s?"creator":"member"}function ZL(e){if(!e)return null;const{code:t,updatedAt:n}=e;let r=null;return t==="mailDropped"?ye.t(`event.${t}`):(t==="viewed"&&(r=`${ye.t(`event.${t}`)} ${ye.formatDistanceToNow(n)}`),r)}function jfe(e){return Math.floor(e)!==e&&e.toString().split(".")[1].length||0}function Hfe(e,{currency:t,locale:n,decimals:r=0,suffix:i=!0,showZero:o=!1,withVat:s=null,hideZeroDecimals:a=!1}={}){if(typeof t>"u"||!t)throw new Error("Missing param currency");let l=e;if(typeof l>"u"&&(l=0),!l&&!o)return"";l=Number(l)||0,l=Math.round(l);let c=rc({amount:l,currency:t});n&&(c=c.setLocale(n)),s&&(c=c.multiply(100+s).divide(100));let d=i?"$0,0":"0,0",u=r;return a&&(u=jfe(c.getAmount()/100)),r&&u&&(d=`${d}.${"0".repeat(u)}`),c.toFormat(d)}function Er(e,t){const{locale:n}=ye;return Hfe(e,{...t,...!t.locale&&{locale:n}})}const Sx={};function Yp(e,t=null){if(typeof e>"u"||!e)throw new Error("Missing param currency");const n=t||ye.locale;if(Sx[`${e}_${t}`])return Sx[`${e}_${t}`];const r=0 .toLocaleString(n,{style:"currency",currency:e,minimumFractionDigits:0,maximumFractionDigits:0}).replace(/\d/g,"").trim();return Sx[`${e}_${t}`]=r,r}function XL(){const e=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))}function qfe(){const e=(navigator==null?void 0:navigator.userAgent)||(navigator==null?void 0:navigator.vendor)||(window==null?void 0:window.opera);return/windows phone/i.test(e)?"Windows Phone":/android/i.test(e)?"Android":/iPad|iPhone|iPod/.test(e)&&!window.MSStream?"iOS":"unknown"}function Xy(e){return{deviceType:XL()?"mobile":"desktop",deviceMode:["app","extension"].includes(e)?e:null}}function Wfe(e,t,n){const r=e.slice();return r.splice(typeof n=="number"?n:e.length,0,t),r}function Gfe(e,t){const n=e.slice();return n.splice(t,1),n}function Kfe(e,t,n){return e.map((r,i)=>i!==n?r:{...r,...t})}const Ex=e=>({add:(t,n)=>Wfe(e,t,n),remove:t=>Gfe(e,t),set:(t,n)=>Kfe(e,t,n)}),Ax=(e,t,n)=>{const r=[...e],i=r[t];return r.splice(t,1),r.splice(n,0,i),r},QL=async(e,{defaultRegion:t}={})=>{if(!e)return null;const{data:n}=await Jt.post(`${De.api.baseUrl}/public/validate/phone`,{phone:e,defaultRegion:t});return n};function co(e){return Array.from(new Set(e))}const eN=(e,t="")=>{const n={};return Object.keys(e).forEach(r=>{const i=e[r],o=t?`${t}.${r}`:r;typeof i=="object"&&!Array.isArray(i)?Object.assign(n,eN(i,o)):n[o]=i}),n},Mx=async e=>{if(!e)throw new Error("Missing param string to copy");if(typeof e!="string")throw new Error("Param string must be a string to copy");if(!navigator.clipboard){console.log("old");const t=document.createElement("textarea");return document.body.appendChild(t),t.value=e,t.select(),document.execCommand("copy",!1),document.body.removeChild(t),!0}try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.error(t),!1}};var Ox,tN;function Yfe(){if(tN)return Ox;tN=1;var e=bx(),t=1,n=4;function r(i){return e(i,t|n)}return Ox=r,Ox}var Jfe=Yfe();const Ya=hr(Jfe),Zfe=e=>{const t=Object.keys(e);let n="";return t.forEach(r=>{const i=typeof e[r]=="object",o=i&&e[r].length>=0;i||(n+=`${r}=${e[r]}&`),i&&o&&e[r].forEach(s=>{n+=`${r}=${s}&`})}),n&&n.slice(0,-1)},nN=e=>{Dx.push(e)},Xfe=e=>{Dx.map(t=>t(e))};function rN(e=""){console.error("User should be logged out!!"),ot.removeItem("token"),ot.removeItem("tokenExpires"),ot.removeItem("refreshToken"),qn.trigger("user:unauthorized",{error:e})}let o1=!1,Dx=[];const Qfe=(e,{renewToken:t})=>{e.interceptors.request.use(n=>{const r=n;if(r.url.includes("/auth")||r.url.startsWith("/public/"))return r;const i=r.headers["X-TOKEN"];if(!i)return r;const o=ot.getItem("tokenExpires");if(i&&o){const s=new Date;s.setSeconds(s.getSeconds()+30);const a=new Date(o);if(s>a)return t(),new Promise(c=>{nN(d=>{r.headers["X-TOKEN"]=d,c(r)})})}return r},n=>Promise.reject(n))},eme=(e,{renewToken:t})=>{e.interceptors.response.use(n=>n,n=>{if(!n||!n.response)return Promise.reject(n);const{config:r,response:i}=n,{status:o,data:s}=i,{errorCode:a}=s,l=r;if(l.url.startsWith("/public/"))return Promise.reject(n);function c(){if(a===8001)return!0;const d=ot.getItem("tokenExpires");if(d){const u=new Date,p=new Date(d);return u>p}return!1}if(o===401&&l.headers["X-TOKEN"]&&c()&&!o1)return t(),new Promise(u=>{nN(p=>{l.headers["X-TOKEN"]=p,u(Jt(l))})});if(o===401&&typeof a>"u"){if(l.url.includes("auth/companyUser")&&!l.headers["X-TOKEN"])return Promise.reject(n);if(l.url.includes("auth/actionlink")&&!l.headers["X-TOKEN"])return Promise.reject(n);rN(n==null?void 0:n.message)}return Promise.reject(n)})},iN=e=>(Yy(e.data),e),tme=e=>{e.interceptors.response.use(iN,t=>{const{response:n,config:r}=t;if(!n)throw new JM(t);if(Object.prototype.hasOwnProperty.call(r,"errorHandle")&&r.errorHandle===!1)return Promise.reject(t);const{status:i}=n;switch(i){case 404:throw new Bi(t);case 401:throw new Dd(t);case 412:throw new YM(t);default:throw new T4(t)}})},nme=e=>{e.interceptors.response.use(t=>{var n,r;if((r=(n=t.config)==null?void 0:n.url)!=null&&r.includes("document")&&t.config.method==="post"){const i=JSON.parse(t.config.data);i.__tempId&&(t.data.__tempId=i.__tempId)}return t},t=>Promise.reject(t))},rme=e=>{e.interceptors.request.use(t=>{if(["post","put"].includes(t.method)&&t.data&&!(t.data instanceof FormData)){const n=Ya(t.data);xx(n),t.data=n}return t},t=>Promise.reject(t))},ime=({baseUrl:e,withCredentials:t,cache:n})=>{const r=Jt.create({baseURL:e,timeout:2e4,adapter:n,withCredentials:t,paramsSerializer:u=>Zfe(u)});r.defaults.headers["X-CLIENT"]="widget",r.defaults.headers["X-CLIENT-VERSION"]="0.21.0";const i=async(u,p,f=null,h={})=>{const m=p.startsWith("/public/"),g=ot.getItem("token");switch(g&&!m&&(r.defaults.headers["X-TOKEN"]=g),u){case"get":return r.get(p,h);case"post":return r.post(p,f,h);case"put":return r.put(p,f,h);case"delete":return r.delete(p,h);case"patch":return r.patch(p,f,h);default:throw new Error(`SendRequest failed as method: '${u}' is not implemented`)}},o=(u,p={})=>i("get",u,null,p),s=(u,p={},f={})=>i("put",u,p,f),a=(u,p,f={})=>i("post",u,p,f),l=(u,p={})=>i("delete",u,null,p),c=(u,p={})=>i("patch",u,null,p),d=async()=>{if(!o1)try{o1=!0;const u=ot.getItem("refreshToken"),p=await a("/auth/companyUser",{refreshToken:u});if(!p.data||!p.data.token)throw new Error("No token was defined in result");const{token:f,tokenExpires:h,refreshToken:m}=p.data;ot.setItem("token",f),ot.setItem("tokenExpires",h),m&&ot.setItem("refreshToken",m),o1=!1,Xfe(f),Dx=[]}catch(u){return console.error(u),rN(u==null?void 0:u.message)}finally{o1=!1}};return Qfe(r,{renewToken:d}),eme(r,{renewToken:d}),iN(r),tme(r),rme(r),nme(r),{instance:r,get:o,put:s,post:a,del:l,patch:c,renewToken:d}},Px=new Map;function ome(e){if(typeof e>"u")throw new Error("Missing valid parameter url");if(typeof e!="string")throw new Error("Parameter url must be a string");const{data:t,cachedAt:n,expiresAt:r}=Px.get(e)||{};return Date.now()>n+6e4*30||r&&Date.now()>r?(Px.delete(e),null):t}const sme=async e=>{const{url:t,params:n={}}=e,r=Object.keys(n).map(s=>`${s}=${n[s]}`).join("&"),i=`${t}${r?`?${r}`:""}`;return ome(i),await Jt({...e,adapter:Jt.defaults.adapter})},{get:pt,post:nn,put:Rr,patch:Qs,del:Wi,instance:ame,renewToken:lme}=ime({withCredentials:!0,baseUrl:De.api.baseUrl,cache:sme});async function oN(e){const t=Nfe(e);return pt(`/project${t}`,{saveCache:!0})}const cme=async(e,t={})=>pt("/project",e,{params:t}),dme=async(e,t={})=>pt(`/project/${e}`,{params:t,saveCache:!0}),ume=async(e,t,n={})=>Rr(`/project/${e}`,t,{params:n,invalidateCache:{type:"project",id:e}}),pme=async e=>Qs(`/project/${e}`),hme=async(e,t={})=>Wi(`/project/${e}`,{params:t,invalidateCache:{type:"project",id:e}}),fme=async()=>pt("/project/createDemo"),mme=()=>pt("/"),gme=async(e,t={})=>nn("/auth/actionlink",{token:e,...t}),yme=async e=>nn("/register",e),vme=async(e,t)=>nn("/companyUser/forgottenPassword/new",{password:e,resetPasswordToken:t}),bme=async e=>nn("/public/consent",e),wme=async e=>pt(`/projectFile/${e}`),kme=async e=>nn("/projectFile",e),_me=async(e,t)=>Rr(`/projectFile/${e}`,t),xme=async e=>Wi(`/projectFile/${e}`),Cme=async e=>Qs(`/projectFile/${e}`),Tme=async(e,t={})=>pt(`/projectNote/${e}`,{params:t}),Sme=async(e,t={})=>nn("/projectNote",e,{params:t}),Eme=async(e,t,n={})=>Rr(`/projectNote/${e}`,t,{params:n}),Ame=async(e={})=>pt("/project/counts",{params:e,saveCache:!0}),Mme=async e=>pt(`/file/${e}`),sN=async e=>nn("/file",e),Ome=async(e,t)=>Rr(`/file/${e}`,t),Dme=async e=>Wi(`/file/${e}`),Pme=async e=>Qs(`/file/${e}`),Ime=async(e={})=>pt("/article",{params:e}),$me=async e=>pt(`/article/${e}`),Rme=async e=>nn("/article",e),Lme=async(e,t)=>Rr(`/article/${e}`,t),Nme=async e=>Wi(`/article/${e}`),Fme=async e=>Qs(`/article/${e}`),Vme=async e=>nn("/search",{type:"article",query:e}),s1={get:async(e,t={})=>pt(e?`/unitType/${e}`:"/unitType",{params:t,saveCache:!0}),post:async(e,t={})=>nn("/unitType",e,{params:t}),put:async(e,t,n={})=>Rr(`/unitType/${e}`,t,{params:n,invalidateCache:{type:"unitType",id:e}}),delete:async(e,t={})=>Wi(`/unitType/${e}`,{params:t,invalidateCache:{type:"unitType",id:e}})},Bme=async(e={})=>pt("/templateMessage",{params:e,saveCache:!0}),zme=async(e,t={})=>pt(`/templateMessage/${e}`,{params:t,saveCache:!0}),Ume=async(e,t={})=>nn("/templateMessage",e,{params:t}),jme=async(e,t,n={})=>Rr(`/templateMessage/${e}`,t,{params:n,invalidateCache:{type:"templateMessage",id:e}}),Hme=async(e,t={})=>Wi(`/templateMessage/${e}`,{params:t,invalidateCache:{type:"templateMessage",id:e}}),qme=async(e,t={})=>Qs(`/templateMessage/${e}`,{params:t}),Wme=async(e={})=>pt("/endCustomer",{params:e}),Gme=async(e,t={})=>pt(`/endCustomer/${e}`,{params:t}),Kme=async(e,t={})=>nn("/endCustomer",e,{params:t}),Yme=async(e,t,n={})=>Rr(`/endCustomer/${e}`,t,{params:n}),Jme=async(e,t={})=>Wi(`/endCustomer/${e}`,{params:t}),Zme=async(e,t={})=>Qs(`/endCustomer/${e}`,{params:t}),Xme=async(e={})=>pt("/companyUser",{params:e,saveCache:!0}),Qme=async(e,t={})=>pt(`/companyUser/${e}`,{params:t,saveCache:!0}),e1e=async(e,t={})=>nn("/companyUser",e,{params:t}),t1e=async(e,t,n={})=>Rr(`/companyUser/${e}`,t,{params:n,invalidateCache:{type:"companyUser",id:e}}),n1e=async(e,t={})=>Wi(`/companyUser/${e}`,{params:t,invalidateCache:{type:"companyUser",id:e}}),r1e=async(e,t={})=>Qs(`/companyUser/${e}`,{params:t}),aN={getPublic:async(e,t={})=>pt(`/public/companyUser/${e}`,{params:t}),getConnectedUsers:async(e={})=>pt("/companyUser/self/connectedUsers",{params:e}),getConnectedUserAuth:async(e,t={})=>pt(`/companyUser/self/connectedUsers/${e}/auth`,{params:t}),setConnectedUserDefault:async(e,t={})=>Rr(`/companyUser/self/connectedUsers/${e}/setDefaultAuth`,{params:t}),verifyEmail:async(e,t={})=>nn("/public/verifyEmail/companyUser",e,{params:t})},i1e=async(e,t=null,n={})=>Rr(`/companyAccount/accountType/${e}`,t,{params:n}),o1e=async(e={})=>pt("/companyAccount/getNumberOfManagers",{params:e}),s1e=async(e={})=>nn("/companyAccount/addUserLicenseInvoice",{},{params:e}),a1e=async(e,t={})=>pt(`/promotionCode/${e}/canUse`,{params:t}),l1e=async(e,t={})=>pt("/promotionCode/inUse",{params:t}),Qy={product:async(e,t={})=>nn("/companyAccount/product",e,{params:t}),cancelAll:async(e={})=>Wi("/companyAccount/subscription",{params:e}),getPrices:async(e={})=>pt("/companyAccount/price",{params:e}),getUpcomingInvoices:async(e={})=>pt("/companyAccount/upcomingInvoice",{params:e}),getPaymentHistory:async(e={})=>pt("/companyAccount/paymentHistory",{params:e}),putPaymentMethod:async(e,t={})=>Rr("/companyAccount/paymentMethod",e,{params:t}),putCustomer:async(e,t={})=>Rr("/companyAccount/customer",e,{params:t}),createCheckoutSession:async(e,t={})=>nn("/companyAccount/create-checkout-session",e,{params:t})},c1e=async(e,t)=>nn(`/project/${e}/projectMember/${t}`,null,{invalidateCache:{type:"project",id:e}}),d1e=async(e,t)=>Wi(`/project/${e}/projectMember/${t}`,{invalidateCache:{type:"project",id:e}}),Gi={get:async(e,t={})=>pt(`/document/${e}`,{params:t,saveCache:!0}),getAll:async(e={})=>pt("/document",{params:e,saveCache:!0}),post:async(e,t={})=>nn("/document",e,{params:t}),send:async(e,t={},n={})=>nn(`/document/${e}/send`,t,{params:n,invalidateCache:{type:"document",id:e}}),clearAnswers:async(e,t={},n={})=>nn(`/document/${e}/clearAnswers`,t,{params:n,invalidateCache:{type:"document",id:e}}),put:async(e,t,n={})=>Rr(`/document/${e}`,t,{params:n,invalidateCache:{type:"document",id:e}}),delete:async(e,t={})=>Wi(`/document/${e}`,{params:t,invalidateCache:{type:"document",id:e}}),patch:async(e,t={})=>Qs(`/document/${e}`,{params:t}),validate:async(e,t={})=>nn("/documentValidate",e,{params:t})},oc={get:async(e,t={})=>pt(e?`/template/${e}`:"/template",{params:t}),post:async(e,t={})=>nn("/template",e,{params:t}),put:async(e,t,n={})=>Rr(`/template/${e}`,t,{params:n}),delete:async(e,t={})=>Wi(`/template/${e}`,{params:t}),patch:async(e,t={})=>Qs(`/template/${e}`,{params:t})},Ix={get:async(e={})=>pt("/templateGallery",{params:e})},u1e={get:async(e,t={})=>pt(`/public/templateStat/${e}`,{params:t})},p1e={get:async(e={})=>pt("/documentStats",{params:e})},Jp={get:async(e,t={})=>pt(`/public/document/${e}`,{params:t}),put:async(e,t,n={})=>Rr(`/public/document/${e}`,t,{headers:n}),answer:async(e,t,n={},r={})=>nn(`/public/document/${e}/answer`,t,{params:n,headers:r}),feedback:async(e,t,n={})=>nn(`/public/document/${e}/feedback`,t,{params:n})},lN={get:async(e,t={})=>pt(`/public/pdfJob/${e}`,{params:t}),addDocument:async(e,t={})=>pt(`/public/document/${e}/pdfJob/start`,{params:t})},cN={getDocuments:async(e={})=>{const t=ot.getItem("clientToken");return Jt.get(`${De.api.baseUrl}/client/document`,{headers:{Authorization:t},params:e})},requestMagicLink:async(e,t={})=>Jt.post(`${De.api.baseUrl}/client/requestMagicLink`,e,{params:t})},ev={get:async(e,t={})=>pt(`/public/company/${e}`,{params:t}),getCertificates:async(e,t={})=>pt(`/public/company/${e}/certificates`,{params:t}),getReferences:async(e,t={})=>pt(`/public/company/${e}/references`,{params:t})},h1e={get:async(e,t={})=>pt(`${De.api.baseUrl}/public/signature/${e}`,{params:t})},$x={post:async(e,t={})=>nn("/voucher",e,{params:t}),canUse:async(e,t={})=>pt(`/voucher/${e}/canUse`,{params:t})},sc={getAuthUrl:async(e,t={})=>pt("/extension/authUrl",{params:{...t,service:e}}),getPublicAuthUrl:async(e,t={})=>pt("/public/extension/authUrl",{params:{...t,service:e}}),install:async(e,t,n={})=>nn("/extension/install",t,{params:{...n,service:e}}),uninstall:async(e,t={})=>Wi("/extension/uninstall",{params:{...t,service:e}}),suggestClients:async(e,t={})=>pt("/extension/suggestClients",{params:{...t,service:e},saveCache:!0,cacheTtl:20}),signupWithCrm:async(e,t,n={})=>nn("/public/extension/register",t,{params:{...n,service:e}}),search:async(e,t={})=>pt("/extension/search",{params:{...t,service:e},saveCache:!0,cacheTtl:10}),getFields:async(e,t={})=>pt("/extension/fields",{params:{...t,service:e},saveCache:!0,cacheTtl:60}),getExternalReferenceDetails:async(e,t={})=>pt("/extension/externalReferenceDetails",{params:{...t,service:e},saveCache:!0,cacheTtl:20}),settings:async(e,t={})=>pt("/extension/settings",{params:{...t,service:e}})},Ur={get:pt,post:nn,put:Rr,del:Wi,patch:Qs,updateAxiosInstance:({baseUrl:e})=>{ame.defaults.baseURL=e},getProjects:oN},ea=Object.create(null);ea.open="0",ea.close="1",ea.ping="2",ea.pong="3",ea.message="4",ea.upgrade="5",ea.noop="6";const tv=Object.create(null);Object.keys(ea).forEach(e=>{tv[ea[e]]=e});const f1e={type:"error",data:"parser error"},m1e=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",g1e=typeof ArrayBuffer=="function",y1e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,dN=({type:e,data:t},n,r)=>m1e&&t instanceof Blob?n?r(t):uN(t,r):g1e&&(t instanceof ArrayBuffer||y1e(t))?n?r(t):uN(new Blob([t]),r):r(ea[e]+(t||"")),uN=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},pN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<pN.length;e++)a1[pN.charCodeAt(e)]=e;const v1e=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)o=a1[e.charCodeAt(r)],s=a1[e.charCodeAt(r+1)],a=a1[e.charCodeAt(r+2)],l=a1[e.charCodeAt(r+3)],d[i++]=o<<2|s>>4,d[i++]=(s&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return c},b1e=typeof ArrayBuffer=="function",hN=(e,t)=>{if(typeof e!="string")return{type:"message",data:fN(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:w1e(e.substring(1),t)}:tv[n]?e.length>1?{type:tv[n],data:e.substring(1)}:{type:tv[n]}:f1e},w1e=(e,t)=>{if(b1e){const n=v1e(e);return fN(n,t)}else return{base64:!0,data:e}},fN=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},mN="",k1e=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{dN(o,!1,a=>{r[s]=a,++i===n&&t(r.join(mN))})})},_1e=(e,t)=>{const n=e.split(mN),r=[];for(let i=0;i<n.length;i++){const o=hN(n[i],t);if(r.push(o),o.type==="error")break}return r},gN=4;function mr(e){if(e)return x1e(e)}function x1e(e){for(var t in mr.prototype)e[t]=mr.prototype[t];return e}mr.prototype.on=mr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},mr.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},mr.prototype.off=mr.prototype.removeListener=mr.prototype.removeAllListeners=mr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this},mr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},mr.prototype.emitReserved=mr.prototype.emit,mr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},mr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const $o=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function yN(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const C1e=$o.setTimeout,T1e=$o.clearTimeout;function nv(e,t){t.useNativeTimers?(e.setTimeoutFn=C1e.bind($o),e.clearTimeoutFn=T1e.bind($o)):(e.setTimeoutFn=$o.setTimeout.bind($o),e.clearTimeoutFn=$o.clearTimeout.bind($o))}const S1e=1.33;function E1e(e){return typeof e=="string"?A1e(e):Math.ceil((e.byteLength||e.size)*S1e)}function A1e(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}class M1e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class vN extends mr{constructor(t){super(),this.writable=!1,nv(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new M1e(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=hN(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}}const bN="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Rx=64,O1e={};let wN=0,rv=0,kN;function _N(e){let t="";do t=bN[e%Rx]+t,e=Math.floor(e/Rx);while(e>0);return t}function xN(){const e=_N(+new Date);return e!==kN?(wN=0,kN=e):e+"."+_N(wN++)}for(;rv<Rx;rv++)O1e[bN[rv]]=rv;function CN(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function D1e(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}let TN=!1;try{TN=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const P1e=TN;function SN(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||P1e))return new XMLHttpRequest}catch{}if(!t)try{return new $o[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function I1e(){}const $1e=function(){return new SN({xdomain:!1}).responseType!=null}();class R1e extends vN{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port,this.xs=t.secure!==r}const n=t&&t.forceBase64;this.supportsBinary=$1e&&!n}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};_1e(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,k1e(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=xN()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=CN(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new ta(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class ta extends mr{constructor(t,n){super(),nv(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=yN(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new SN(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=ta.requestsCount++,ta.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=I1e,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete ta.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(ta.requestsCount=0,ta.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",EN);else if(typeof addEventListener=="function"){const e="onpagehide"in $o?"pagehide":"unload";addEventListener(e,EN,!1)}}function EN(){for(let e in ta.requests)ta.requests.hasOwnProperty(e)&&ta.requests[e].abort()}const AN=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),iv=$o.WebSocket||$o.MozWebSocket,MN=!0,L1e="arraybuffer",ON=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",N1e={websocket:class extends vN{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=ON?{}:yN(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=MN&&!ON?n?new iv(t,n):new iv(t):new iv(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||L1e,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;dN(r,this.supportsBinary,o=>{const s={};try{MN&&this.ws.send(o)}catch{}i&&AN(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=xN()),this.supportsBinary||(t.b64=1);const i=CN(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!iv}},polling:R1e},F1e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,V1e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Lx(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=F1e.exec(e||""),o={},s=14;for(;s--;)o[V1e[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=B1e(o,o.path),o.queryKey=z1e(o,o.query),o}function B1e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function z1e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let DN=class Xf extends mr{constructor(t,n={}){super(),this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Lx(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Lx(n.host).host),nv(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=D1e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=gN,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new N1e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Xf.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Xf.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Xf.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const s=u=>{const p=new Error("probe error: "+u);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function a(){s("transport closed")}function l(){s("socket closed")}function c(u){n&&u.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),n.open()}onOpen(){if(this.readyState="open",Xf.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=E1e(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Xf.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};DN.protocol=gN;function U1e(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Lx(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const j1e=typeof ArrayBuffer=="function",H1e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,PN=Object.prototype.toString,q1e=typeof Blob=="function"||typeof Blob<"u"&&PN.call(Blob)==="[object BlobConstructor]",W1e=typeof File=="function"||typeof File<"u"&&PN.call(File)==="[object FileConstructor]";function Nx(e){return j1e&&(e instanceof ArrayBuffer||H1e(e))||q1e&&e instanceof Blob||W1e&&e instanceof File}function ov(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(ov(e[n]))return!0;return!1}if(Nx(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ov(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ov(e[n]))return!0;return!1}function G1e(e){const t=[],n=e.data,r=e;return r.data=Fx(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Fx(e,t){if(!e)return e;if(Nx(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Fx(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Fx(e[r],t));return n}return e}function K1e(e,t){return e.data=Vx(e.data,t),e.attachments=void 0,e}function Vx(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Vx(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Vx(e[n],t));return e}const Y1e=5;var sn;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(sn||(sn={}));class J1e{constructor(t){this.replacer=t}encode(t){return(t.type===sn.EVENT||t.type===sn.ACK)&&ov(t)?(t.type=t.type===sn.EVENT?sn.BINARY_EVENT:sn.BINARY_ACK,this.encodeAsBinary(t)):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===sn.BINARY_EVENT||t.type===sn.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=G1e(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Bx extends mr{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t),n.type===sn.BINARY_EVENT||n.type===sn.BINARY_ACK?(this.reconstructor=new Z1e(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Nx(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(sn[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===sn.BINARY_EVENT||r.type===sn.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Bx.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case sn.CONNECT:return typeof n=="object";case sn.DISCONNECT:return n===void 0;case sn.CONNECT_ERROR:return typeof n=="string"||typeof n=="object";case sn.EVENT:case sn.BINARY_EVENT:return Array.isArray(n)&&n.length>0;case sn.ACK:case sn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class Z1e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=K1e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const X1e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Bx,Encoder:J1e,get PacketType(){return sn},protocol:Y1e},Symbol.toStringTag,{value:"Module"}));function us(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Q1e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});let IN=class extends mr{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[us(t,"open",this.onopen.bind(this)),us(t,"packet",this.onpacket.bind(this)),us(t,"error",this.onerror.bind(this)),us(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(Q1e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:sn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...s)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...s])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((s,a)=>r?s?o(s):i(a):i(s)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this.ids++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(){if(this._queue.length===0)return;const t=this._queue[0];if(t.pending)return;t.pending=!0,t.tryCount++;const n=this.ids;this.ids=t.id,this.flags=t.flags,this.emit.apply(this,t.args),this.ids=n}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:sn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case sn.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case sn.EVENT:case sn.BINARY_EVENT:this.onevent(t);break;case sn.ACK:case sn.BINARY_ACK:this.onack(t);break;case sn.DISCONNECT:this.ondisconnect();break;case sn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:sn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:sn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}};function Zp(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Zp.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0},Zp.prototype.reset=function(){this.attempts=0},Zp.prototype.setMin=function(e){this.ms=e},Zp.prototype.setMax=function(e){this.max=e},Zp.prototype.setJitter=function(e){this.jitter=e};class zx extends mr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,nv(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Zp({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||X1e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new DN(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=us(n,"open",function(){r.onopen(),t&&t()}),o=us(n,"error",s=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",s),t?t(s):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const s=this._timeout;s===0&&i();const a=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},s);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(us(t,"ping",this.onping.bind(this)),us(t,"data",this.ondata.bind(this)),us(t,"error",this.onerror.bind(this)),us(t,"close",this.onclose.bind(this)),us(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){AN(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new IN(this,t,n),this.nsps[t]=r),this._autoConnect&&r.connect(),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const l1={};function sv(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=U1e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=l1[i]&&o in l1[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new zx(r,t):(l1[i]||(l1[i]=new zx(r,t)),l=l1[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(sv,{Manager:zx,Socket:IN,io:sv,connect:sv});class ege{constructor({rootUrl:t,path:n,logger:r=console,getTokenFn:i}){ln(this,"_socket",null);ln(this,"_isConnected",!1);ln(this,"_autoReconnect",!1);ln(this,"_localAutoReconnect",!1);ln(this,"_listeners",[]);ln(this,"_connectionChangedListener",[]);ln(this,"_retryCount",0);this.rootUrl=t,this.path=n,this.logger=r,this.getTokenFn=i}setUrl({rootUrl:t,path:n}){t&&(this.rootUrl=t),n&&(this.path=n)}set autoReconnect(t){this._autoReconnect=!!t}onConnectionChanged(t){this._connectionChangedListener.push(t)}_onConnectionChanged(t){this._connectionChangedListener.forEach(n=>{try{n(t)}catch(r){console.error(r)}})}setConnected(t){t||(this._retryCount=this._retryCount+1),this.logger.debug(`Socket: isConnected changed to ${t}`);const n=this._isConnected!==t;this._isConnected=t,n&&this._onConnectionChanged(t)}_onConnected(){const t=this.getTokenFn();t&&this._socket.emit("authenticate",{token:t})}on(t,n){return this._listeners.push({type:t,fn:n}),this._socket&&this._socket.on(t,n),()=>this.off(t,n)}off(t,n){this._listeners.forEach((r,i)=>{var o;r.type===t&&r.fn===n&&(this._listeners.splice(i,1),(o=this._socket)==null||o.off(t,n))})}async connect(){await(i=>new Promise(o=>setTimeout(o,i*2*1e3)))(this._retryCount),this._socket&&(this._localAutoReconnect=!1,this.disconnect(),this._localAutoReconnect=!0);const{origin:n,pathname:r}=new URL(this.rootUrl+this.path);this._socket=sv(n,{path:r,transports:["websocket","polling"]}),this._socket.on("connect",this._onConnected.bind(this)),this._socket.on("event",i=>this.logger.debug("Socket: Event:",i)),this._listeners.forEach(({type:i,fn:o})=>{this._socket.on(i,o)}),this._socket.on("disconnect",()=>{this.setConnected(!1),this._localAutoReconnect&&this._autoReconnect&&this.connect()}),this._socket.on("authenticated",()=>{this._retryCount=0,this.setConnected(!0)}),this._socket.on("unauthorized",()=>{this.setConnected(!1)})}disconnect(){this._socket&&(this._socket.close(),this._socket=null)}}const iu=new ege({rootUrl:De.api.baseUrl,path:De.api.socket.path,logger:Ao,getTokenFn:()=>ot.getItem("token")}),tge={brand:fn[De.brand],sign:"unterschreiben",accept:"Akzeptieren",address:"Adresse",and:"und",answerFeedback:{intermediate:{title:"Danke, dass Sie Ihre Gedanken mit uns teilen."},no:{start:{action:"Abschicken",placeholder:"Was sollten wir verbessern?",text:"Gibt es etwas Bestimmtes, das Sie uns mitteilen möchten, das wir verbessern können?",title:"Vielen Dank für Ihren Beitrag."},success:{action:"Erfahren Sie mehr über $t(brand.name)",secondary:"Gehen Sie zurück zum Dokument",text:"Ihr Feedback wurde erfolgreich abgeschickt. Unser Team wird Ihr Feedback mit großer Sorgfalt prüfen.",title:"Vielen Dank."}},start:{no:"Nein",title:"Hat es Ihnen Spaß gemacht, $t(brand.name) zur Anzeige dieses Dokuments zu verwenden?",yes:"Ja"},yes:{action:"Melden Sie sich kostenlos an",secondary:"Erfahren Sie mehr über $t(brand.name)",text:"Erstellen und versenden Sie schöne Dokumente mit $t(brand.name). Entdecken Sie alle Vorteile des Versands webbasierter Dokumente mit elektronischen Signaturen.",title:"Nutzen Sie $t(brand.name) kostenlos."},custom:{title:"Vielen Dank.",text:"Ihr Feedback wurde erfolgreich übermittelt. Unser Team wird Ihr Feedback mit großer Sorgfalt prüfen.",action:"Gehen Sie zurück zum Dokument"}},answerModal:{answerSuccess:"Ihre Antwort wurde erfolgreich gesendet.",bankId:{component:{defaultError:"Etwas ist schief gelaufen. Vergewissern Sie sich, dass Sie Ihre Sozialversicherungsnummer korrekt eingegeben haben und versuchen Sie es erneut.",signingInterrupted:"Die Unterschrift wurde unterbrochen, bitte versuchen Sie es erneut...",startOnThisDevice:"BankID auf diesem Gerät starten",validations:{socialNo:{personalNumber:"Ungültige Sozialversicherungsnummer",required:"Geben Sie Ihre Sozialversicherungsnummer ein"}},viewText:{canceled:{text:"Unterzeichnung abgebrochen. Bitte versuchen Sie es erneut",title:"Unterzeichnung unterbrochen"},error:{text:"Es ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.",title:"Es ist ein Fehler aufgetreten"},form:{text:"Geben Sie Ihre Sozialversicherungsnummer ein, um mit der Unterzeichnung der Vereinbarung zu beginnen.",title:"Unterschreiben Sie das Dokument mit BankID"},new:{spinnerText:"Scannen Sie den QR-Code auf Ihrem Gerät.",text:"Öffnen Sie BankID auf Ihrem Gerät und unterschreiben Sie die Vereinbarung.",title:"Unterschreiben Sie das Dokument"},signing:{spinnerText:"Unterschreiben Sie das Dokument.",text:"Öffnen Sie BankID auf Ihrem Gerät und unterzeichnen Sie die Vereinbarung.",title:"Unterzeichnung läuft"},waiting:{spinnerText:"Ich warte darauf, dass Sie BankID öffnen.",text:"Öffnen Sie BankId auf Ihrem Gerät und unterschreiben Sie die Vereinbarung.",title:"Unterschreiben Sie das Dokument"}}},start:{action:"Unterschreiben mit BankID",text:"Akzeptieren und signieren Sie das Dokument mit BankID.",title:"Unterschreiben mit BankID"},success:{text:"$t(answerModal.successText)",textFallback:"$t(answerModal.successTextFallback)",title:"$t(answerModal.successTitle)"}},decline:{component:{label:"Kommentar (optional)"},start:{action:"Ablehnen",text:"Um dieses Dokument abzulehnen, bestätigen Sie bitte, indem Sie auf die Schaltfläche unten klicken",title:"Dokument ablehnen"},success:{text:"Danke, dass Sie eine Antwort hinterlassen haben.",textFallback:"$t(answerModal.decline.success.text)",title:"Sie haben das Dokument abgelehnt."}},signature:{component:{draw:{canvasLabel:"Signatur zeichnen",tab:"Zeichnen"},subTitle:"Unterschriftsmethode wählen",terms:"Mit meiner Unterschrift erkläre ich mich damit einverstanden, dass die verwendete elektronische Signatur eine Darstellung meiner handschriftlichen Unterschrift ist - und ebenso gültig ist.",text:{canvasLabel:"Vorschau",nameLabel:"Unterzeichnet von",namePlaceholder:"Geben Sie Ihren Namen ein",tab:"Typ"}},start:{action:"Unterschreiben & Akzeptieren",text:"",title:"Dokument akzeptieren"},success:{text:"$t(answerModal.successText)",textFallback:"$t(answerModal.successTextFallback)",title:"$t(answerModal.successTitle)"}},versionError:{accept:{title:"Dokument konnte nicht unterzeichnet werden"},decline:{title:"Dokument konnte nicht abgelehnt werden"},text:"Das Dokument wurde während Ihrer Ansicht geändert. Bitte laden Sie es erneut und überprüfen Sie das neue Dokument, um zu antworten.",btn:"Neu laden"},successText:"Sobald das Dokument von allen beteiligten Parteien unterzeichnet wurde, erhalten Sie eine E-Mail an {{email}} mit einer versiegelten Kopie des Dokuments.",successTextFallback:"Sobald das Dokument von allen beteiligten Parteien unterzeichnet wurde, können Sie zu dieser Webseite zurückkehren, um eine versiegelte und vollständige Kopie des Dokuments herunterzuladen.",successTextFallbackSingle:"Das Dokument ist nun unterzeichnet und vervollständigt.",successTextSingle:"Es wurde eine Bestätigungs-E-Mail an {{email}} mit einer versiegelten Kopie des Dokuments gesendet.",successTitle:"Sie haben das Dokument signiert."},approved:"genehmigt",approx:"ungefähr",cancel:"Abbrechen",chapters:{answerButtons:{approveDescription:"Wir haben {{- sender}} informiert, dass das Dokument genehmigt wurde.",approveTitle:"Das Dokument wurde genehmigt!",denyDescription:"Wir haben {{- sender}} informiert, dass Sie nicht interessiert sind.",denyTitle:"Das Dokument wurde abgelehnt",expiredTitle:"Das Dokument ist abgelaufen",expiredDescription:"Das Verfallsdatum des Dokuments ist abgelaufen. Es ist nicht mehr möglich, das Dokument zu unterschreiben.",editPropDes:"Eigentumsbezeichnung bearbeiten",enterPropDes:"Eigentumsbezeichnung eingeben",inPersonSignatureHint:"Es wurde eingestellt, dass Sie das Dokument in Person unterschreiben müssen. Wenn Sie stattdessen eine digitale Kopie unterschreiben möchten kontaktieren Sie uns bitte.",waitingDescription:"Es wird gewartet bis {{remaining}} Andere eine Antwort gegeben haben.",youHave:"Sie haben "},articleItem:{eligibleForDeduction:"Berechtigt für {{type}}-Rabatt"},articleList:{changeShowVatTooltip:"Umschalten zum anzeigen von {{type}}",title:"Services / Produkte"},attachments:{emptyPlaceholder:"Dieser Anhangsblock ist derzeit leer."},packageGroup:{errorCallout:"Wählen Sie mindestens eine Option",selectableOptions:"Wählbare Optionen"},packageItem:{add:"Option hinzufügen",select:"Option auswählen",selected:"Ausgewählt"},parties:{allRiskAndLiability:"Hat alle Risiko- und Haftpflichtversicherungen",fTax:"Zertifiziert für F-tax"},pricingSummary:{blocks:{approx:"Ungefährer Preis",discount:"Rabatt",deductionSubValue:"Gesamtpreis ohne Rabatt {{price}}",maxPrice:"Maximaler Preis",maxPriceVat:"Maximaler Preis {{vat}}",net:"Netto",price:"Preis",rounding:"Gerundet",subTitleArticles:"Bei Produkten/Dienstleistungen mit fixen Kosten",summary:"Zusammenfassung",total:"Gesamt",typeDeduction:"Nach {{type}}-Rabatt"},placeholder:{description:"Wählen Sie die Option(en) die Ihnen am besten passen, durch Klicken auf ",descriptionBold:"Auswählen",title:"Wählen Sie eine Option"},terms:{houseWork:`Der Gesamtpreis nach Steuerabzug für {{type}}-Arbeiten setzt voraus, dass die geleisteten Arbeiten steuerlich absetzbar sind, dass der Käufer einen ausreichenden Betrag für den Steuerabzug zur Verfügung hat und dass dieser nicht für andere {{type}}-Arbeiten verwendet wurde. Der Käufer ist für die Kontrolle dieser Informationen verantwortlich.
94
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var che={normalizePrecision:function(t){var n=t.reduce(function(r,i){return Math.max(r.getPrecision(),i.getPrecision())});return t.map(function(r){return r.getPrecision()!==n?r.convertPrecision(n):r})},minimum:function(t){var n=x$(t),r=n[0],i=n.slice(1),o=r;return i.forEach(function(s){o=o.lessThan(s)?o:s}),o},maximum:function(t){var n=x$(t),r=n[0],i=n.slice(1),o=r;return i.forEach(function(s){o=o.greaterThan(s)?o:s}),o}};function T$(e){return!isNaN(parseInt(e))&&isFinite(e)}function dhe(e){return T$(e)&&e<=100&&e>=0}function uhe(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function S$(e){return e%2===0}function E$(e){return T$(e)&&!Number.isInteger(e)}function phe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var n=t.split(".")[1];return n?n.length:0}function Jm(e){return Math.abs(e)%1===.5}function hhe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(n,r){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?n(JSON.parse(i.responseText)):r(new Error(i.statusText)))},onerror:function(){r(new Error("Network error"))}});i.open("GET",e,!0),fhe(i,t.headers),i.send()})}function fhe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var n in t)e.setRequestHeader(n,t[n]);return e}function Zm(e){return typeof e>"u"}function A$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",n={};return Object.entries(e).forEach(function(r){if(Ym(r[1])==="object"){var i=A$(r[1]);Object.entries(i).forEach(function(o){n[r[0]+t+o[0]]=o[1]})}else n[r[0]]=r[1]}),n}function mhe(e){return!!e&&(Ym(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function M$(){var e=function(r,i){var o=function(l){return Math.pow(10,phe(l))},s=Math.max(o(r),o(i));return Math.round(r*s)*Math.round(i*s)/(s*s)},t={HALF_ODD:function(r){var i=Math.round(r);return Jm(r)&&S$(i)?i-1:i},HALF_EVEN:function(r){var i=Math.round(r);return Jm(r)?S$(i)?i:i-1:i},HALF_UP:function(r){return Math.round(r)},HALF_DOWN:function(r){return Jm(r)?Math.floor(r):Math.round(r)},HALF_TOWARDS_ZERO:function(r){return Jm(r)?Math.sign(r)*Math.floor(Math.abs(r)):Math.round(r)},HALF_AWAY_FROM_ZERO:function(r){return Jm(r)?Math.sign(r)*Math.ceil(Math.abs(r)):Math.round(r)},DOWN:function(r){return Math.floor(r)}};return{add:function(r,i){return r+i},subtract:function(r,i){return r-i},multiply:function(r,i){return E$(r)||E$(i)?e(r,i):r*i},divide:function(r,i){return r/i},modulo:function(r,i){return r%i},round:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[i](r)}}}var ghe=M$();function yhe(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(r){return!Zm(r)}):[]},getMinimumFractionDigits:function(){var r=function(o){return o==="."};return Zm(this.getMatches().find(r))?0:this.getMatches()[ghe.add(this.getMatches().findIndex(r),1)].split("").length},getCurrencyDisplay:function(){var r={USD:"code",dollar:"name",$:"symbol"};return r[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Zm(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Zm(this.getMatches().find(function(r){return r===","}))}}}function vhe(e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0;for(var s in o)i=i.replace("{{".concat(s,"}}"),o[s]);return i},n=function(i,o){return hhe(t(e.endpoint,{from:i,to:o}),{headers:e.headers})};return{getExchangeRate:function(i,o){return(mhe(e.endpoint)?e.endpoint:n(i,o)).then(function(s){return A$(s)[t(e.propertyPath,{from:i,to:o})]})}}}function Xm(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new n(t)}function bhe(e){Xm(dhe(e),"You must provide a numeric value between 0 and 100.",RangeError)}function whe(e){Xm(uhe(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function ok(e){Xm(Number.isInteger(e),"You must provide an integer.",TypeError)}var On=M$(),khe=function e(t){var n=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),r=n.amount,i=n.currency,o=n.precision;ok(r),ok(o);var s=e.globalLocale,a=e.globalFormat,l=e.globalRoundingMode,c=e.globalFormatRoundingMode,d=Object.assign({},e.globalExchangeRatesApi),u=function(h){var m=Object.assign({},Object.assign({},{amount:r,currency:i,precision:o},h),Object.assign({},{locale:this.locale},h));return Object.assign(e({amount:m.amount,currency:m.currency,precision:m.precision}),{locale:m.locale})},p=function(h){Xm(this.hasSameCurrency(h),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return r},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(h){return u.call(this,{locale:h})},getPrecision:function(){return o},convertPrecision:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;ok(h);var g=this.getPrecision(),y=h>g,w=y?On.multiply:On.divide,k=y?[h,g]:[g,h],_=Math.pow(10,On.subtract.apply(On,k));return u.call(this,{amount:On.round(w(this.getAmount(),_),m),precision:h})},add:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return u.call(this,{amount:On.add(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},subtract:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return u.call(this,{amount:On.subtract(m[0].getAmount(),m[1].getAmount()),precision:m[0].getPrecision()})},multiply:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u.call(this,{amount:On.round(On.multiply(this.getAmount(),h),m)})},divide:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return u.call(this,{amount:On.round(On.divide(this.getAmount(),h),m)})},percentage:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return bhe(h),this.multiply(On.divide(h,100),m)},allocate:function(h){var m=this;whe(h);for(var g=h.reduce(function(_,M){return On.add(_,M)}),y=this.getAmount(),w=h.map(function(_){var M=Math.floor(On.divide(On.multiply(m.getAmount(),_),g));return y=On.subtract(y,M),u.call(m,{amount:M})}),k=0;y>0;)h[k]>0&&(w[k]=w[k].add(u.call(this,{amount:1})),y=On.subtract(y,1)),k+=1;return w},convert:function(h){var m=this,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=g.endpoint,w=y===void 0?d.endpoint:y,k=g.propertyPath,_=k===void 0?d.propertyPath||"rates.{{to}}":k,M=g.headers,S=M===void 0?d.headers:M,O=g.roundingMode,P=O===void 0?l:O,I=Object.assign({},{endpoint:w,propertyPath:_,headers:S,roundingMode:P});return vhe(I).getExchangeRate(this.getCurrency(),h).then(function(L){return Xm(!Zm(L),'No rate was found for the destination currency "'.concat(h,'".'),TypeError),u.call(m,{amount:On.round(On.multiply(m.getAmount(),parseFloat(L)),I.roundingMode),currency:h})})},equalsTo:function(h){return this.hasSameAmount(h)&&this.hasSameCurrency(h)},lessThan:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return m[0].getAmount()<m[1].getAmount()},lessThanOrEqual:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return m[0].getAmount()<=m[1].getAmount()},greaterThan:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return m[0].getAmount()>m[1].getAmount()},greaterThanOrEqual:function(h){p.call(this,h);var m=e.normalizePrecision([this,h]);return m[0].getAmount()>=m[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return On.modulo(this.getAmount(),Math.pow(10,o))!==0},hasCents:function(){return On.modulo(this.getAmount(),Math.pow(10,o))!==0},hasSameCurrency:function(h){return this.getCurrency()===h.getCurrency()},hasSameAmount:function(h){var m=e.normalizePrecision([this,h]);return m[0].getAmount()===m[1].getAmount()},toFormat:function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,g=yhe(h);return this.toRoundedUnit(g.getMinimumFractionDigits(),m).toLocaleString(this.getLocale(),{currencyDisplay:g.getCurrencyDisplay(),useGrouping:g.getUseGrouping(),minimumFractionDigits:g.getMinimumFractionDigits(),style:g.getStyle(),currency:this.getCurrency()})},toUnit:function(){return On.divide(this.getAmount(),Math.pow(10,o))},toRoundedUnit:function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,g=Math.pow(10,h);return On.divide(On.round(On.multiply(this.toUnit(),g),m),g)},toObject:function(){return{amount:r,currency:i,precision:o}},toJSON:function(){return this.toObject()}}},rc=Object.assign(khe,rhe,ihe,che),sk,O$;function _he(){if(O$)return sk;O$=1;function e(){this.__data__=[],this.size=0}return sk=e,sk}var ak,D$;function lk(){if(D$)return ak;D$=1;function e(t,n){return t===n||t!==t&&n!==n}return ak=e,ak}var ck,P$;function By(){if(P$)return ck;P$=1;var e=lk();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return ck=t,ck}var dk,I$;function xhe(){if(I$)return dk;I$=1;var e=By(),t=Array.prototype,n=t.splice;function r(i){var o=this.__data__,s=e(o,i);if(s<0)return!1;var a=o.length-1;return s==a?o.pop():n.call(o,s,1),--this.size,!0}return dk=r,dk}var uk,$$;function Che(){if($$)return uk;$$=1;var e=By();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return uk=t,uk}var pk,R$;function The(){if(R$)return pk;R$=1;var e=By();function t(n){return e(this.__data__,n)>-1}return pk=t,pk}var hk,L$;function She(){if(L$)return hk;L$=1;var e=By();function t(n,r){var i=this.__data__,o=e(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return hk=t,hk}var fk,N$;function zy(){if(N$)return fk;N$=1;var e=_he(),t=xhe(),n=Che(),r=The(),i=She();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,fk=o,fk}var mk,F$;function Ehe(){if(F$)return mk;F$=1;var e=zy();function t(){this.__data__=new e,this.size=0}return mk=t,mk}var gk,V$;function Ahe(){if(V$)return gk;V$=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return gk=e,gk}var yk,B$;function Mhe(){if(B$)return yk;B$=1;function e(t){return this.__data__.get(t)}return yk=e,yk}var vk,z$;function Ohe(){if(z$)return vk;z$=1;function e(t){return this.__data__.has(t)}return vk=e,vk}var bk,U$;function j$(){if(U$)return bk;U$=1;var e=typeof k0=="object"&&k0&&k0.Object===Object&&k0;return bk=e,bk}var wk,H$;function ds(){if(H$)return wk;H$=1;var e=j$(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return wk=n,wk}var kk,q$;function jp(){if(q$)return kk;q$=1;var e=ds(),t=e.Symbol;return kk=t,kk}var _k,W$;function Dhe(){if(W$)return _k;W$=1;var e=jp(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function o(s){var a=n.call(s,i),l=s[i];try{s[i]=void 0;var c=!0}catch{}var d=r.call(s);return c&&(a?s[i]=l:delete s[i]),d}return _k=o,_k}var xk,G$;function Phe(){if(G$)return xk;G$=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return xk=n,xk}var Ck,K$;function Hp(){if(K$)return Ck;K$=1;var e=jp(),t=Dhe(),n=Phe(),r="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function s(a){return a==null?a===void 0?i:r:o&&o in Object(a)?t(a):n(a)}return Ck=s,Ck}var Tk,Y$;function Js(){if(Y$)return Tk;Y$=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Tk=e,Tk}var Sk,J$;function Z$(){if(J$)return Sk;J$=1;var e=Hp(),t=Js(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!t(a))return!1;var l=e(a);return l==r||l==i||l==n||l==o}return Sk=s,Sk}var Ek,X$;function Ihe(){if(X$)return Ek;X$=1;var e=ds(),t=e["__core-js_shared__"];return Ek=t,Ek}var Ak,Q$;function $he(){if(Q$)return Ak;Q$=1;var e=Ihe(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return Ak=n,Ak}var Mk,eR;function tR(){if(eR)return Mk;eR=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Mk=n,Mk}var Ok,nR;function Rhe(){if(nR)return Ok;nR=1;var e=Z$(),t=$he(),n=Js(),r=tR(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,d=RegExp("^"+l.call(c).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function u(p){if(!n(p)||t(p))return!1;var f=e(p)?d:o;return f.test(r(p))}return Ok=u,Ok}var Dk,rR;function Lhe(){if(rR)return Dk;rR=1;function e(t,n){return t==null?void 0:t[n]}return Dk=e,Dk}var Pk,iR;function nu(){if(iR)return Pk;iR=1;var e=Rhe(),t=Lhe();function n(r,i){var o=t(r,i);return e(o)?o:void 0}return Pk=n,Pk}var Ik,oR;function $k(){if(oR)return Ik;oR=1;var e=nu(),t=ds(),n=e(t,"Map");return Ik=n,Ik}var Rk,sR;function Uy(){if(sR)return Rk;sR=1;var e=nu(),t=e(Object,"create");return Rk=t,Rk}var Lk,aR;function Nhe(){if(aR)return Lk;aR=1;var e=Uy();function t(){this.__data__=e?e(null):{},this.size=0}return Lk=t,Lk}var Nk,lR;function Fhe(){if(lR)return Nk;lR=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Nk=e,Nk}var Fk,cR;function Vhe(){if(cR)return Fk;cR=1;var e=Uy(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var s=this.__data__;if(e){var a=s[o];return a===t?void 0:a}return r.call(s,o)?s[o]:void 0}return Fk=i,Fk}var Vk,dR;function Bhe(){if(dR)return Vk;dR=1;var e=Uy(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var o=this.__data__;return e?o[i]!==void 0:n.call(o,i)}return Vk=r,Vk}var Bk,uR;function zhe(){if(uR)return Bk;uR=1;var e=Uy(),t="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&i===void 0?t:i,this}return Bk=n,Bk}var zk,pR;function Uhe(){if(pR)return zk;pR=1;var e=Nhe(),t=Fhe(),n=Vhe(),r=Bhe(),i=zhe();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,zk=o,zk}var Uk,hR;function jhe(){if(hR)return Uk;hR=1;var e=Uhe(),t=zy(),n=$k();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Uk=r,Uk}var jk,fR;function Hhe(){if(fR)return jk;fR=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return jk=e,jk}var Hk,mR;function jy(){if(mR)return Hk;mR=1;var e=Hhe();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Hk=t,Hk}var qk,gR;function qhe(){if(gR)return qk;gR=1;var e=jy();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return qk=t,qk}var Wk,yR;function Whe(){if(yR)return Wk;yR=1;var e=jy();function t(n){return e(this,n).get(n)}return Wk=t,Wk}var Gk,vR;function Ghe(){if(vR)return Gk;vR=1;var e=jy();function t(n){return e(this,n).has(n)}return Gk=t,Gk}var Kk,bR;function Khe(){if(bR)return Kk;bR=1;var e=jy();function t(n,r){var i=e(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Kk=t,Kk}var Yk,wR;function Jk(){if(wR)return Yk;wR=1;var e=jhe(),t=qhe(),n=Whe(),r=Ghe(),i=Khe();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Yk=o,Yk}var Zk,kR;function Yhe(){if(kR)return Zk;kR=1;var e=zy(),t=$k(),n=Jk(),r=200;function i(o,s){var a=this.__data__;if(a instanceof e){var l=a.__data__;if(!t||l.length<r-1)return l.push([o,s]),this.size=++a.size,this;a=this.__data__=new n(l)}return a.set(o,s),this.size=a.size,this}return Zk=i,Zk}var Xk,_R;function Qk(){if(_R)return Xk;_R=1;var e=zy(),t=Ehe(),n=Ahe(),r=Mhe(),i=Ohe(),o=Yhe();function s(a){var l=this.__data__=new e(a);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=r,s.prototype.has=i,s.prototype.set=o,Xk=s,Xk}var e_,xR;function Jhe(){if(xR)return e_;xR=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i&&n(t[r],r,t)!==!1;);return t}return e_=e,e_}var t_,CR;function TR(){if(CR)return t_;CR=1;var e=nu(),t=function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}}();return t_=t,t_}var n_,SR;function ER(){if(SR)return n_;SR=1;var e=TR();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return n_=t,n_}var r_,AR;function i_(){if(AR)return r_;AR=1;var e=ER(),t=lk(),n=Object.prototype,r=n.hasOwnProperty;function i(o,s,a){var l=o[s];(!(r.call(o,s)&&t(l,a))||a===void 0&&!(s in o))&&e(o,s,a)}return r_=i,r_}var o_,MR;function Qm(){if(MR)return o_;MR=1;var e=i_(),t=ER();function n(r,i,o,s){var a=!o;o||(o={});for(var l=-1,c=i.length;++l<c;){var d=i[l],u=s?s(o[d],r[d],d,o,r):void 0;u===void 0&&(u=r[d]),a?t(o,d,u):e(o,d,u)}return o}return o_=n,o_}var s_,OR;function Zhe(){if(OR)return s_;OR=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return s_=e,s_}var a_,DR;function Ka(){if(DR)return a_;DR=1;function e(t){return t!=null&&typeof t=="object"}return a_=e,a_}var l_,PR;function Xhe(){if(PR)return l_;PR=1;var e=Hp(),t=Ka(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return l_=r,l_}var c_,IR;function d_(){if(IR)return c_;IR=1;var e=Xhe(),t=Ka(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,o=e(function(){return arguments}())?e:function(s){return t(s)&&r.call(s,"callee")&&!i.call(s,"callee")};return c_=o,c_}var u_,$R;function Zs(){if($R)return u_;$R=1;var e=Array.isArray;return u_=e,u_}var e1={exports:{}},p_,RR;function Qhe(){if(RR)return p_;RR=1;function e(){return!1}return p_=e,p_}e1.exports;var LR;function h_(){return LR||(LR=1,function(e,t){var n=ds(),r=Qhe(),i=t&&!t.nodeType&&t,o=i&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===i,a=s?n.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;e.exports=c}(e1,e1.exports)),e1.exports}var f_,NR;function m_(){if(NR)return f_;NR=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var o=typeof r;return i=i??e,!!i&&(o=="number"||o!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return f_=n,f_}var g_,FR;function y_(){if(FR)return g_;FR=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return g_=t,g_}var v_,VR;function efe(){if(VR)return v_;VR=1;var e=Hp(),t=y_(),n=Ka(),r="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",d="[object Number]",u="[object Object]",p="[object RegExp]",f="[object Set]",h="[object String]",m="[object WeakMap]",g="[object ArrayBuffer]",y="[object DataView]",w="[object Float32Array]",k="[object Float64Array]",_="[object Int8Array]",M="[object Int16Array]",S="[object Int32Array]",O="[object Uint8Array]",P="[object Uint8ClampedArray]",I="[object Uint16Array]",L="[object Uint32Array]",$={};$[w]=$[k]=$[_]=$[M]=$[S]=$[O]=$[P]=$[I]=$[L]=!0,$[r]=$[i]=$[g]=$[o]=$[y]=$[s]=$[a]=$[l]=$[c]=$[d]=$[u]=$[p]=$[f]=$[h]=$[m]=!1;function F(U){return n(U)&&t(U.length)&&!!$[e(U)]}return v_=F,v_}var b_,BR;function Hy(){if(BR)return b_;BR=1;function e(t){return function(n){return t(n)}}return b_=e,b_}var t1={exports:{}};t1.exports;var zR;function w_(){return zR||(zR=1,function(e,t){var n=j$(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();e.exports=a}(t1,t1.exports)),t1.exports}var k_,UR;function jR(){if(UR)return k_;UR=1;var e=efe(),t=Hy(),n=w_(),r=n&&n.isTypedArray,i=r?t(r):e;return k_=i,k_}var __,HR;function qR(){if(HR)return __;HR=1;var e=Zhe(),t=d_(),n=Zs(),r=h_(),i=m_(),o=jR(),s=Object.prototype,a=s.hasOwnProperty;function l(c,d){var u=n(c),p=!u&&t(c),f=!u&&!p&&r(c),h=!u&&!p&&!f&&o(c),m=u||p||f||h,g=m?e(c.length,String):[],y=g.length;for(var w in c)(d||a.call(c,w))&&!(m&&(w=="length"||f&&(w=="offset"||w=="parent")||h&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||i(w,y)))&&g.push(w);return g}return __=l,__}var x_,WR;function C_(){if(WR)return x_;WR=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return x_=t,x_}var T_,GR;function KR(){if(GR)return T_;GR=1;function e(t,n){return function(r){return t(n(r))}}return T_=e,T_}var S_,YR;function tfe(){if(YR)return S_;YR=1;var e=KR(),t=e(Object.keys,Object);return S_=t,S_}var E_,JR;function nfe(){if(JR)return E_;JR=1;var e=C_(),t=tfe(),n=Object.prototype,r=n.hasOwnProperty;function i(o){if(!e(o))return t(o);var s=[];for(var a in Object(o))r.call(o,a)&&a!="constructor"&&s.push(a);return s}return E_=i,E_}var A_,ZR;function M_(){if(ZR)return A_;ZR=1;var e=Z$(),t=y_();function n(r){return r!=null&&t(r.length)&&!e(r)}return A_=n,A_}var O_,XR;function qy(){if(XR)return O_;XR=1;var e=qR(),t=nfe(),n=M_();function r(i){return n(i)?e(i):t(i)}return O_=r,O_}var D_,QR;function rfe(){if(QR)return D_;QR=1;var e=Qm(),t=qy();function n(r,i){return r&&e(i,t(i),r)}return D_=n,D_}var P_,eL;function ife(){if(eL)return P_;eL=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return P_=e,P_}var I_,tL;function ofe(){if(tL)return I_;tL=1;var e=Js(),t=C_(),n=ife(),r=Object.prototype,i=r.hasOwnProperty;function o(s){if(!e(s))return n(s);var a=t(s),l=[];for(var c in s)c=="constructor"&&(a||!i.call(s,c))||l.push(c);return l}return I_=o,I_}var $_,nL;function R_(){if(nL)return $_;nL=1;var e=qR(),t=ofe(),n=M_();function r(i){return n(i)?e(i,!0):t(i)}return $_=r,$_}var L_,rL;function sfe(){if(rL)return L_;rL=1;var e=Qm(),t=R_();function n(r,i){return r&&e(i,t(i),r)}return L_=n,L_}var n1={exports:{}};n1.exports;var iL;function afe(){return iL||(iL=1,function(e,t){var n=ds(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;function l(c,d){if(d)return c.slice();var u=c.length,p=a?a(u):new c.constructor(u);return c.copy(p),p}e.exports=l}(n1,n1.exports)),n1.exports}var N_,oL;function lfe(){if(oL)return N_;oL=1;function e(t,n){var r=-1,i=t.length;for(n||(n=Array(i));++r<i;)n[r]=t[r];return n}return N_=e,N_}var F_,sL;function cfe(){if(sL)return F_;sL=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,o=0,s=[];++r<i;){var a=t[r];n(a,r,t)&&(s[o++]=a)}return s}return F_=e,F_}var V_,aL;function lL(){if(aL)return V_;aL=1;function e(){return[]}return V_=e,V_}var B_,cL;function z_(){if(cL)return B_;cL=1;var e=cfe(),t=lL(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,o=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(a){return r.call(s,a)}))}:t;return B_=o,B_}var U_,dL;function dfe(){if(dL)return U_;dL=1;var e=Qm(),t=z_();function n(r,i){return e(r,t(r),i)}return U_=n,U_}var j_,uL;function H_(){if(uL)return j_;uL=1;function e(t,n){for(var r=-1,i=n.length,o=t.length;++r<i;)t[o+r]=n[r];return t}return j_=e,j_}var q_,pL;function W_(){if(pL)return q_;pL=1;var e=KR(),t=e(Object.getPrototypeOf,Object);return q_=t,q_}var G_,hL;function fL(){if(hL)return G_;hL=1;var e=H_(),t=W_(),n=z_(),r=lL(),i=Object.getOwnPropertySymbols,o=i?function(s){for(var a=[];s;)e(a,n(s)),s=t(s);return a}:r;return G_=o,G_}var K_,mL;function ufe(){if(mL)return K_;mL=1;var e=Qm(),t=fL();function n(r,i){return e(r,t(r),i)}return K_=n,K_}var Y_,gL;function yL(){if(gL)return Y_;gL=1;var e=H_(),t=Zs();function n(r,i,o){var s=i(r);return t(r)?s:e(s,o(r))}return Y_=n,Y_}var J_,vL;function bL(){if(vL)return J_;vL=1;var e=yL(),t=z_(),n=qy();function r(i){return e(i,n,t)}return J_=r,J_}var Z_,wL;function kL(){if(wL)return Z_;wL=1;var e=yL(),t=fL(),n=R_();function r(i){return e(i,n,t)}return Z_=r,Z_}var X_,_L;function pfe(){if(_L)return X_;_L=1;var e=nu(),t=ds(),n=e(t,"DataView");return X_=n,X_}var Q_,xL;function hfe(){if(xL)return Q_;xL=1;var e=nu(),t=ds(),n=e(t,"Promise");return Q_=n,Q_}var ex,CL;function TL(){if(CL)return ex;CL=1;var e=nu(),t=ds(),n=e(t,"Set");return ex=n,ex}var tx,SL;function ffe(){if(SL)return tx;SL=1;var e=nu(),t=ds(),n=e(t,"WeakMap");return tx=n,tx}var nx,EL;function Wy(){if(EL)return nx;EL=1;var e=pfe(),t=$k(),n=hfe(),r=TL(),i=ffe(),o=Hp(),s=tR(),a="[object Map]",l="[object Object]",c="[object Promise]",d="[object Set]",u="[object WeakMap]",p="[object DataView]",f=s(e),h=s(t),m=s(n),g=s(r),y=s(i),w=o;return(e&&w(new e(new ArrayBuffer(1)))!=p||t&&w(new t)!=a||n&&w(n.resolve())!=c||r&&w(new r)!=d||i&&w(new i)!=u)&&(w=function(k){var _=o(k),M=_==l?k.constructor:void 0,S=M?s(M):"";if(S)switch(S){case f:return p;case h:return a;case m:return c;case g:return d;case y:return u}return _}),nx=w,nx}var rx,AL;function mfe(){if(AL)return rx;AL=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var i=r.length,o=new r.constructor(i);return i&&typeof r[0]=="string"&&t.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return rx=n,rx}var ix,ML;function OL(){if(ML)return ix;ML=1;var e=ds(),t=e.Uint8Array;return ix=t,ix}var ox,DL;function sx(){if(DL)return ox;DL=1;var e=OL();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return ox=t,ox}var ax,PL;function gfe(){if(PL)return ax;PL=1;var e=sx();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}return ax=t,ax}var lx,IL;function yfe(){if(IL)return lx;IL=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return lx=t,lx}var cx,$L;function vfe(){if($L)return cx;$L=1;var e=jp(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(i){return n?Object(n.call(i)):{}}return cx=r,cx}var dx,RL;function bfe(){if(RL)return dx;RL=1;var e=sx();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}return dx=t,dx}var ux,LL;function wfe(){if(LL)return ux;LL=1;var e=sx(),t=gfe(),n=yfe(),r=vfe(),i=bfe(),o="[object Boolean]",s="[object Date]",a="[object Map]",l="[object Number]",c="[object RegExp]",d="[object Set]",u="[object String]",p="[object Symbol]",f="[object ArrayBuffer]",h="[object DataView]",m="[object Float32Array]",g="[object Float64Array]",y="[object Int8Array]",w="[object Int16Array]",k="[object Int32Array]",_="[object Uint8Array]",M="[object Uint8ClampedArray]",S="[object Uint16Array]",O="[object Uint32Array]";function P(I,L,$){var F=I.constructor;switch(L){case f:return e(I);case o:case s:return new F(+I);case h:return t(I,$);case m:case g:case y:case w:case k:case _:case M:case S:case O:return i(I,$);case a:return new F;case l:case u:return new F(I);case c:return n(I);case d:return new F;case p:return r(I)}}return ux=P,ux}var px,NL;function kfe(){if(NL)return px;NL=1;var e=Js(),t=Object.create,n=function(){function r(){}return function(i){if(!e(i))return{};if(t)return t(i);r.prototype=i;var o=new r;return r.prototype=void 0,o}}();return px=n,px}var hx,FL;function _fe(){if(FL)return hx;FL=1;var e=kfe(),t=W_(),n=C_();function r(i){return typeof i.constructor=="function"&&!n(i)?e(t(i)):{}}return hx=r,hx}var fx,VL;function xfe(){if(VL)return fx;VL=1;var e=Wy(),t=Ka(),n="[object Map]";function r(i){return t(i)&&e(i)==n}return fx=r,fx}var mx,BL;function Cfe(){if(BL)return mx;BL=1;var e=xfe(),t=Hy(),n=w_(),r=n&&n.isMap,i=r?t(r):e;return mx=i,mx}var gx,zL;function Tfe(){if(zL)return gx;zL=1;var e=Wy(),t=Ka(),n="[object Set]";function r(i){return t(i)&&e(i)==n}return gx=r,gx}var yx,UL;function Sfe(){if(UL)return yx;UL=1;var e=Tfe(),t=Hy(),n=w_(),r=n&&n.isSet,i=r?t(r):e;return yx=i,yx}var vx,jL;function bx(){if(jL)return vx;jL=1;var e=Qk(),t=Jhe(),n=i_(),r=rfe(),i=sfe(),o=afe(),s=lfe(),a=dfe(),l=ufe(),c=bL(),d=kL(),u=Wy(),p=mfe(),f=wfe(),h=_fe(),m=Zs(),g=h_(),y=Cfe(),w=Js(),k=Sfe(),_=qy(),M=R_(),S=1,O=2,P=4,I="[object Arguments]",L="[object Array]",$="[object Boolean]",F="[object Date]",U="[object Error]",q="[object Function]",z="[object GeneratorFunction]",D="[object Map]",N="[object Number]",B="[object Object]",Q="[object RegExp]",te="[object Set]",he="[object String]",Me="[object Symbol]",Ue="[object WeakMap]",Ze="[object ArrayBuffer]",qe="[object DataView]",rt="[object Float32Array]",oe="[object Float64Array]",ge="[object Int8Array]",Ae="[object Int16Array]",ke="[object Int32Array]",Xe="[object Uint8Array]",ht="[object Uint8ClampedArray]",K="[object Uint16Array]",Z="[object Uint32Array]",ie={};ie[I]=ie[L]=ie[Ze]=ie[qe]=ie[$]=ie[F]=ie[rt]=ie[oe]=ie[ge]=ie[Ae]=ie[ke]=ie[D]=ie[N]=ie[B]=ie[Q]=ie[te]=ie[he]=ie[Me]=ie[Xe]=ie[ht]=ie[K]=ie[Z]=!0,ie[U]=ie[q]=ie[Ue]=!1;function xe(ue,Ce,Ne,Re,Ee,_e){var Ge,Ve=Ce&S,Je=Ce&O,st=Ce&P;if(Ne&&(Ge=Ee?Ne(ue,Re,Ee,_e):Ne(ue)),Ge!==void 0)return Ge;if(!w(ue))return ue;var Ot=m(ue);if(Ot){if(Ge=p(ue),!Ve)return s(ue,Ge)}else{var Pt=u(ue),Ut=Pt==q||Pt==z;if(g(ue))return o(ue,Ve);if(Pt==B||Pt==I||Ut&&!Ee){if(Ge=Je||Ut?{}:h(ue),!Ve)return Je?l(ue,i(Ge,ue)):a(ue,r(Ge,ue))}else{if(!ie[Pt])return Ee?ue:{};Ge=f(ue,Pt,Ve)}}_e||(_e=new e);var qt=_e.get(ue);if(qt)return qt;_e.set(ue,Ge),k(ue)?ue.forEach(function(He){Ge.add(xe(He,Ce,Ne,He,ue,_e))}):y(ue)&&ue.forEach(function(He,fe){Ge.set(fe,xe(He,Ce,Ne,fe,ue,_e))});var vn=st?Je?d:c:Je?M:_,Ct=Ot?void 0:vn(ue);return t(Ct||ue,function(He,fe){Ct&&(fe=He,He=ue[fe]),n(Ge,fe,xe(He,Ce,Ne,fe,ue,_e))}),Ge}return vx=xe,vx}var wx,HL;function Efe(){if(HL)return wx;HL=1;var e=bx(),t=1,n=4;function r(i,o){return o=typeof o=="function"?o:void 0,e(i,t|n,o)}return wx=r,wx}var Afe=Efe();const Mfe=hr(Afe);function Ofe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qp={exports:{}};const Dfe=_0(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var qL;function Pfe(){if(qL)return qp.exports;qL=1;var e=typeof process<"u"&&process.pid?process.pid.toString(36):"",t="";if(typeof __webpack_require__!="function"&&typeof Ofe<"u"){var n="",r=Dfe;if(r.networkInterfaces)var i=r.networkInterfaces();if(i){e:for(let a in i){const l=i[a],c=l.length;for(var o=0;o<c;o++)if(l[o]!==void 0&&l[o].mac&&l[o].mac!="00:00:00:00:00:00"){n=l[o].mac;break e}}t=n?parseInt(n.replace(/\:|\D+/gi,"")).toString(36):""}}qp.exports=qp.exports.default=function(a,l){return(a||"")+t+e+s().toString(36)+(l||"")},qp.exports.process=function(a,l){return(a||"")+e+s().toString(36)+(l||"")},qp.exports.time=function(a,l){return(a||"")+s().toString(36)+(l||"")};function s(){var a=Date.now(),l=s.last||a;return s.last=a>l?a:l+1}return qp.exports}var Ife=Pfe();const zt=hr(Ife),Wp={},WL={};function Gy(e){if(WL[e])return;if(Wp[e])return Wp[e];const t=new Promise((n,r)=>{const i=document.createElement("script");e.endsWith(".mjs")&&(i.type="module");const o=window.setTimeout(()=>{Wp[e]=null,r(new Error(`Failed to load ${e} in 20s`))},2e4);i.onload=()=>{o&&window.clearTimeout(o),WL[e]=!0,Wp[e]=null,n()},i.onerror=s=>{o&&window.clearTimeout(o),Wp[e]=null,r(s)},i.src=e,document.body.appendChild(i)});return Wp[e]=t,t}function GL(e){const t=e.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth,i=t.top<=n&&t.top+t.height>=0,o=t.left<=r&&t.left+t.width>=0;return i&&o}const kx=e=>{const t=/(auto|scroll)/,n=(a,l)=>a.parentNode===null?l:n(a.parentNode,l.concat([a])),r=(a,l)=>getComputedStyle(a,null).getPropertyValue(l),i=a=>r(a,"overflow")+r(a,"overflow-y")+r(a,"overflow-x"),o=a=>t.test(i(a));return(a=>{if(!(a instanceof HTMLElement||a instanceof SVGElement))return null;const l=n(a.parentNode,[]);for(let c=0;c<l.length;c+=1)if(o(l[c]))return l[c];return document.scrollingElement||document.documentElement})(e)},$fe=e=>{let t=0;for(;e;)t+=e.offsetTop,e=e.offsetParent;return t};function r1(e,t){let n=e;if(typeof n=="string"&&(n=document.querySelector(n)),!kx(n))return;const i={offset:0,behavior:"smooth",body:kx(n),...t},o=$fe(n);HTMLElement.prototype.scrollTo?i.body.scrollTo({behavior:i.behavior,top:o-i.offset}):i.body.scrollTop=o-i.offset}const Ky=e=>{var r;const t=(r=e==null?void 0:e.getRootNode)==null?void 0:r.call(e),n=(t==null?void 0:t.toString())==="[object ShadowRoot]";return{isShadow:n,el:n?t:document}},KL=(e,t)=>(e||"").substr(0,t-1)+((e||"").length>t?"...":""),YL=e=>typeof e!="string"?"":e.replace(/<[^>]+>/g," ");function Rfe(e){return Number(e)===e&&e%1!==0}function kn(e){if(e===void 0)return"undefined";if(e===null)return"null";if(Array.isArray(e))return"array";if(typeof e=="object"&&!(e instanceof Date))return"object";if(Number.isNaN(e))return"nan";if(e===1/0)return"infinity";if(Number.isInteger(e)||Rfe(e))return"number";if(typeof e=="string")return"string";if(typeof e=="boolean")return"boolean";if(typeof e=="function")return"function";if(e instanceof Date&&Pd(e))return"date"}function Lfe(e,t){if(!["array","object"].includes(kn(e)))throw Error("Arg.0 must be an array or object");if(typeof t!="string")throw Error("Arg.1, path must be a string");let n=t.replace(/\[(.*)\]/gi,(i,o)=>`.${o}`).split(".");return n[0]===""&&(n=n.splice(1)),n.reduce((i,o)=>i&&(typeof i[o]!="object",i[o]),e)}const _x=e=>new Promise(t=>setTimeout(t,e)),Nfe=(e={},t={})=>{if(typeof e!="object")throw Error("Query must be an object!");if(typeof t!="object")throw Error("Options must be an object!");const n={prefix:"_",convertFilter:!0,...t};let r="?";function i(o){let s="";function a(l){let c="";return Object.keys(l).forEach(d=>{["or","and"].includes(d)?a(l[d])&&(c+=`${d}(${a(l[d])})`):Object.keys(l[d]).forEach(u=>{let p="";const f=l[d][u]===!0,h=l[d][u]===!1,m=l[d][u]==="contains";d.includes(".")&&(d=`'${d}'`),f?p=`${d}=${u}`:h?p=`${d}!=${u}`:m&&(p=`${d}*=${u}`),p&&(!["(",","].includes(c[c.length-1])&&c.length&&(c=`${c},`),c+=p)})}),c}return s=`_where=and(${a(o)})`,s}return Object.keys(e).forEach((o,s)=>{if(typeof e[o]>"u")return;const a=n.prefix?n.prefix:"";let l=e[o];typeof l=="string"&&(l=encodeURIComponent(l));let c=`${a}${o}=${l}`;o==="filter"&&n.convertFilter&&(c=i(l)),r=`${r}${s?"&":""}${c}`}),r.length>1?r:""};function Gp(e,t=!1){if(typeof e!="object"||Array.isArray(e))throw Error("Arg.0 must be an object");return{...e,_uniqueId:e._uniqueId&&!t?e._uniqueId:zt()}}function Yy(e){if(!(typeof e!="object"||e===null))for(const t of Object.keys(e)){const n=e[t];if(!(!n||typeof n!="object")){if(!Array.isArray(n)){Yy(n);continue}for(let r=0;r<n.length;r++)typeof n[r]!="object"||Array.isArray(n[r])||(n[r]=Gp(n[r]));Yy(n)}}}function xx(e){if(e)for(const t of Object.keys(e)){const n=e[t];if(t==="_uniqueId"){delete e[t];continue}if(!(!n||typeof n!="object")){if(!Array.isArray(n)){xx(n);continue}for(let r=0;r<n.length;r++)typeof n[r]!="object"||Array.isArray(n[r])||xx(n)}}}function Ffe(e,t){function n(r){r&&typeof r=="object"&&t.forEach(i=>{delete r[i]})}return Mfe(e,n)}function Vfe(e){return Math.abs(e)%1===.5}function Bfe(e){return e%2===0}function JL(e){const t=Math.round(e);return Vfe(e)?Bfe(t)?t:t-1:t}function Cx(e){if(!(!e||typeof e!="object"))for(const t of Object.keys(e)){const n=e[t];if(n&&typeof n=="number")e[t]=JL(n);else if(Array.isArray(n))for(let r=0;r<n.length;r++)Cx(e[t][r]);else Cx(e[t])}}function zfe({price:e,discountType:t,discount:n,quantity:r=1}){if(typeof e>"u")throw Error("Missing param price");if(typeof t>"u")throw Error("Missing param discountType");if(typeof n>"u")throw Error("Missing param discount");if(typeof r>"u")throw Error("Missing param quantity");if(!r)return 0;let i=e*r;return t==="fixed"&&n?i-=n:t==="percentage"&&n&&(i*=(100-n/100)/100),JL(i)}function ru(e){if(typeof e!="object"&&!Array.isArray(e))throw Error("Missing valid parameter articles");let t=Array.isArray(e)?e:[e];return t=t.map(n=>{const{price:r,quantity:i,discountType:o,discount:s}=n;return{...n,totalAmount:zfe({price:r,quantity:i,discountType:o,discount:s})}}),Array.isArray(e)?t:t[0]}function Xs(e){if(typeof e!="object"||Array.isArray(e))throw Error("Arg.0 must be an object");let t={ArticleId:null,article_no:null,id:null,vat:null,isDeductable:!1,isRut:!1,greenRot15:!1,greenRot20:!1,greenRot50:!1,name:"",description:"",price:0,currency:"SEK",priceType:"fixed",quantity:1,showPrice:!0,unitType:"unit",position:null,discountType:"fixed",discount:null,totalAmount:0,packageId:null,...e};return t=Gp(t),t=ru(t),t}const Jy=e=>["isDeductable","isRut","greenRot15","greenRot20","greenRot50"].some(t=>!!e[t]),Zy=e=>{const{isDeductable:t,isRut:n,greenRot15:r,greenRot20:i,greenRot50:o}=e||{};return t?"rot":n?"rut":r?"greenRot15":i?"greenRot20":o?"greenRot50":null},ic=(e,{count:t=null,includeCount:n=!1,lng:r=null,instance:i}={})=>{if(typeof e!="string")return"";const o=i||ye,s={...typeof t=="number"&&{count:t},...r&&{lng:r}};if(!e.startsWith("$")){let u=`unitType.${e}`;return i||(u=`_common:${u}`),n?o.tc(u,s):o.t(u,s)}const a=s.count!==void 0&&t!==1,[l,c]=e.replace("$","").split(":"),d=a&&c?c:l;return n?`${t} ${d}`:d};function Tx(e,t,n="sv"){let r=kn(e),i=kn(t),o=e,s=t;if(o===null)return-1;if(s===null)return 1;if(r!==i||!["string","date","number"].includes(r))return 0;if(r!=="date"){if(!Number.isNaN(parseInt(o,10))&&!Number.isNaN(parseInt(s,10))&&/^(?:\d|\.)*$/i.test(o)&&/^(?:\d|\.)*$/i.test(s)&&(o=parseInt(o,10),s=parseInt(s,10),r="number",i="number"),r==="number")return o<s?-1:o>s?1:0;if(!Pd($d(o))||!Pd($d(s)))return n?o.localeCompare(s,n):o.localeCompare(s);o=$d(o),s=$d(s)}return G3(o,s)?1:G3(s,o)?-1:0}function Kp(e,t=[]){return!t||kn(t)==="array"&&!t.length?e:Object.keys(e).filter(r=>t.includes(r)).reduce((r,i)=>({...r,[i]:e[i]}),{})}function i1(e,t=[]){return!t||kn(t)==="array"&&!t.length?e:Object.keys(e).filter(r=>!t.includes(r)).reduce((r,i)=>({...r,[i]:e[i]}),{})}function Ufe(e={}){const{manageCompany:t,manageProjects:n,manageOwnProjects:r,showPrices:i,manageAtas:o,manageOwnAtas:s,manageUsers:a}=e;return t&&n&&r&&i&&o&&s&&a?"admin":r&&i&&o&&s?"creator":"member"}function ZL(e){if(!e)return null;const{code:t,updatedAt:n}=e;let r=null;return t==="mailDropped"?ye.t(`event.${t}`):(t==="viewed"&&(r=`${ye.t(`event.${t}`)} ${ye.formatDistanceToNow(n)}`),r)}function jfe(e){return Math.floor(e)!==e&&e.toString().split(".")[1].length||0}function Hfe(e,{currency:t,locale:n,decimals:r=0,suffix:i=!0,showZero:o=!1,withVat:s=null,hideZeroDecimals:a=!1}={}){if(typeof t>"u"||!t)throw new Error("Missing param currency");let l=e;if(typeof l>"u"&&(l=0),!l&&!o)return"";l=Number(l)||0,l=Math.round(l);let c=rc({amount:l,currency:t});n&&(c=c.setLocale(n)),s&&(c=c.multiply(100+s).divide(100));let d=i?"$0,0":"0,0",u=r;return a&&(u=jfe(c.getAmount()/100)),r&&u&&(d=`${d}.${"0".repeat(u)}`),c.toFormat(d)}function Er(e,t){const{locale:n}=ye;return Hfe(e,{...t,...!t.locale&&{locale:n}})}const Sx={};function Yp(e,t=null){if(typeof e>"u"||!e)throw new Error("Missing param currency");const n=t||ye.locale;if(Sx[`${e}_${t}`])return Sx[`${e}_${t}`];const r=0 .toLocaleString(n,{style:"currency",currency:e,minimumFractionDigits:0,maximumFractionDigits:0}).replace(/\d/g,"").trim();return Sx[`${e}_${t}`]=r,r}function XL(){const e=navigator.userAgent||navigator.vendor||window.opera;return!!(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))}function qfe(){const e=(navigator==null?void 0:navigator.userAgent)||(navigator==null?void 0:navigator.vendor)||(window==null?void 0:window.opera);return/windows phone/i.test(e)?"Windows Phone":/android/i.test(e)?"Android":/iPad|iPhone|iPod/.test(e)&&!window.MSStream?"iOS":"unknown"}function Xy(e){return{deviceType:XL()?"mobile":"desktop",deviceMode:["app","extension"].includes(e)?e:null}}function Wfe(e,t,n){const r=e.slice();return r.splice(typeof n=="number"?n:e.length,0,t),r}function Gfe(e,t){const n=e.slice();return n.splice(t,1),n}function Kfe(e,t,n){return e.map((r,i)=>i!==n?r:{...r,...t})}const Ex=e=>({add:(t,n)=>Wfe(e,t,n),remove:t=>Gfe(e,t),set:(t,n)=>Kfe(e,t,n)}),Ax=(e,t,n)=>{const r=[...e],i=r[t];return r.splice(t,1),r.splice(n,0,i),r},QL=async(e,{defaultRegion:t}={})=>{if(!e)return null;const{data:n}=await Jt.post(`${De.api.baseUrl}/public/validate/phone`,{phone:e,defaultRegion:t});return n};function co(e){return Array.from(new Set(e))}const eN=(e,t="")=>{const n={};return Object.keys(e).forEach(r=>{const i=e[r],o=t?`${t}.${r}`:r;typeof i=="object"&&!Array.isArray(i)?Object.assign(n,eN(i,o)):n[o]=i}),n},Mx=async e=>{if(!e)throw new Error("Missing param string to copy");if(typeof e!="string")throw new Error("Param string must be a string to copy");if(!navigator.clipboard){console.log("old");const t=document.createElement("textarea");return document.body.appendChild(t),t.value=e,t.select(),document.execCommand("copy",!1),document.body.removeChild(t),!0}try{return await navigator.clipboard.writeText(e),!0}catch(t){return console.error(t),!1}};var Ox,tN;function Yfe(){if(tN)return Ox;tN=1;var e=bx(),t=1,n=4;function r(i){return e(i,t|n)}return Ox=r,Ox}var Jfe=Yfe();const Ya=hr(Jfe),Zfe=e=>{const t=Object.keys(e);let n="";return t.forEach(r=>{const i=typeof e[r]=="object",o=i&&e[r].length>=0;i||(n+=`${r}=${e[r]}&`),i&&o&&e[r].forEach(s=>{n+=`${r}=${s}&`})}),n&&n.slice(0,-1)},nN=e=>{Dx.push(e)},Xfe=e=>{Dx.map(t=>t(e))};function rN(e=""){console.error("User should be logged out!!"),ot.removeItem("token"),ot.removeItem("tokenExpires"),ot.removeItem("refreshToken"),qn.trigger("user:unauthorized",{error:e})}let o1=!1,Dx=[];const Qfe=(e,{renewToken:t})=>{e.interceptors.request.use(n=>{const r=n;if(r.url.includes("/auth")||r.url.startsWith("/public/"))return r;const i=r.headers["X-TOKEN"];if(!i)return r;const o=ot.getItem("tokenExpires");if(i&&o){const s=new Date;s.setSeconds(s.getSeconds()+30);const a=new Date(o);if(s>a)return t(),new Promise(c=>{nN(d=>{r.headers["X-TOKEN"]=d,c(r)})})}return r},n=>Promise.reject(n))},eme=(e,{renewToken:t})=>{e.interceptors.response.use(n=>n,n=>{if(!n||!n.response)return Promise.reject(n);const{config:r,response:i}=n,{status:o,data:s}=i,{errorCode:a}=s,l=r;if(l.url.startsWith("/public/"))return Promise.reject(n);function c(){if(a===8001)return!0;const d=ot.getItem("tokenExpires");if(d){const u=new Date,p=new Date(d);return u>p}return!1}if(o===401&&l.headers["X-TOKEN"]&&c()&&!o1)return t(),new Promise(u=>{nN(p=>{l.headers["X-TOKEN"]=p,u(Jt(l))})});if(o===401&&typeof a>"u"){if(l.url.includes("auth/companyUser")&&!l.headers["X-TOKEN"])return Promise.reject(n);if(l.url.includes("auth/actionlink")&&!l.headers["X-TOKEN"])return Promise.reject(n);rN(n==null?void 0:n.message)}return Promise.reject(n)})},iN=e=>(Yy(e.data),e),tme=e=>{e.interceptors.response.use(iN,t=>{const{response:n,config:r}=t;if(!n)throw new JM(t);if(Object.prototype.hasOwnProperty.call(r,"errorHandle")&&r.errorHandle===!1)return Promise.reject(t);const{status:i}=n;switch(i){case 404:throw new Bi(t);case 401:throw new Dd(t);case 412:throw new YM(t);default:throw new T4(t)}})},nme=e=>{e.interceptors.response.use(t=>{var n,r;if((r=(n=t.config)==null?void 0:n.url)!=null&&r.includes("document")&&t.config.method==="post"){const i=JSON.parse(t.config.data);i.__tempId&&(t.data.__tempId=i.__tempId)}return t},t=>Promise.reject(t))},rme=e=>{e.interceptors.request.use(t=>{if(["post","put"].includes(t.method)&&t.data&&!(t.data instanceof FormData)){const n=Ya(t.data);xx(n),t.data=n}return t},t=>Promise.reject(t))},ime=({baseUrl:e,withCredentials:t,cache:n})=>{const r=Jt.create({baseURL:e,timeout:2e4,adapter:n,withCredentials:t,paramsSerializer:u=>Zfe(u)});r.defaults.headers["X-CLIENT"]="widget",r.defaults.headers["X-CLIENT-VERSION"]="0.21.1";const i=async(u,p,f=null,h={})=>{const m=p.startsWith("/public/"),g=ot.getItem("token");switch(g&&!m&&(r.defaults.headers["X-TOKEN"]=g),u){case"get":return r.get(p,h);case"post":return r.post(p,f,h);case"put":return r.put(p,f,h);case"delete":return r.delete(p,h);case"patch":return r.patch(p,f,h);default:throw new Error(`SendRequest failed as method: '${u}' is not implemented`)}},o=(u,p={})=>i("get",u,null,p),s=(u,p={},f={})=>i("put",u,p,f),a=(u,p,f={})=>i("post",u,p,f),l=(u,p={})=>i("delete",u,null,p),c=(u,p={})=>i("patch",u,null,p),d=async()=>{if(!o1)try{o1=!0;const u=ot.getItem("refreshToken"),p=await a("/auth/companyUser",{refreshToken:u});if(!p.data||!p.data.token)throw new Error("No token was defined in result");const{token:f,tokenExpires:h,refreshToken:m}=p.data;ot.setItem("token",f),ot.setItem("tokenExpires",h),m&&ot.setItem("refreshToken",m),o1=!1,Xfe(f),Dx=[]}catch(u){return console.error(u),rN(u==null?void 0:u.message)}finally{o1=!1}};return Qfe(r,{renewToken:d}),eme(r,{renewToken:d}),iN(r),tme(r),rme(r),nme(r),{instance:r,get:o,put:s,post:a,del:l,patch:c,renewToken:d}},Px=new Map;function ome(e){if(typeof e>"u")throw new Error("Missing valid parameter url");if(typeof e!="string")throw new Error("Parameter url must be a string");const{data:t,cachedAt:n,expiresAt:r}=Px.get(e)||{};return Date.now()>n+6e4*30||r&&Date.now()>r?(Px.delete(e),null):t}const sme=async e=>{const{url:t,params:n={}}=e,r=Object.keys(n).map(s=>`${s}=${n[s]}`).join("&"),i=`${t}${r?`?${r}`:""}`;return ome(i),await Jt({...e,adapter:Jt.defaults.adapter})},{get:pt,post:nn,put:Rr,patch:Qs,del:Wi,instance:ame,renewToken:lme}=ime({withCredentials:!0,baseUrl:De.api.baseUrl,cache:sme});async function oN(e){const t=Nfe(e);return pt(`/project${t}`,{saveCache:!0})}const cme=async(e,t={})=>pt("/project",e,{params:t}),dme=async(e,t={})=>pt(`/project/${e}`,{params:t,saveCache:!0}),ume=async(e,t,n={})=>Rr(`/project/${e}`,t,{params:n,invalidateCache:{type:"project",id:e}}),pme=async e=>Qs(`/project/${e}`),hme=async(e,t={})=>Wi(`/project/${e}`,{params:t,invalidateCache:{type:"project",id:e}}),fme=async()=>pt("/project/createDemo"),mme=()=>pt("/"),gme=async(e,t={})=>nn("/auth/actionlink",{token:e,...t}),yme=async e=>nn("/register",e),vme=async(e,t)=>nn("/companyUser/forgottenPassword/new",{password:e,resetPasswordToken:t}),bme=async e=>nn("/public/consent",e),wme=async e=>pt(`/projectFile/${e}`),kme=async e=>nn("/projectFile",e),_me=async(e,t)=>Rr(`/projectFile/${e}`,t),xme=async e=>Wi(`/projectFile/${e}`),Cme=async e=>Qs(`/projectFile/${e}`),Tme=async(e,t={})=>pt(`/projectNote/${e}`,{params:t}),Sme=async(e,t={})=>nn("/projectNote",e,{params:t}),Eme=async(e,t,n={})=>Rr(`/projectNote/${e}`,t,{params:n}),Ame=async(e={})=>pt("/project/counts",{params:e,saveCache:!0}),Mme=async e=>pt(`/file/${e}`),sN=async e=>nn("/file",e),Ome=async(e,t)=>Rr(`/file/${e}`,t),Dme=async e=>Wi(`/file/${e}`),Pme=async e=>Qs(`/file/${e}`),Ime=async(e={})=>pt("/article",{params:e}),$me=async e=>pt(`/article/${e}`),Rme=async e=>nn("/article",e),Lme=async(e,t)=>Rr(`/article/${e}`,t),Nme=async e=>Wi(`/article/${e}`),Fme=async e=>Qs(`/article/${e}`),Vme=async e=>nn("/search",{type:"article",query:e}),s1={get:async(e,t={})=>pt(e?`/unitType/${e}`:"/unitType",{params:t,saveCache:!0}),post:async(e,t={})=>nn("/unitType",e,{params:t}),put:async(e,t,n={})=>Rr(`/unitType/${e}`,t,{params:n,invalidateCache:{type:"unitType",id:e}}),delete:async(e,t={})=>Wi(`/unitType/${e}`,{params:t,invalidateCache:{type:"unitType",id:e}})},Bme=async(e={})=>pt("/templateMessage",{params:e,saveCache:!0}),zme=async(e,t={})=>pt(`/templateMessage/${e}`,{params:t,saveCache:!0}),Ume=async(e,t={})=>nn("/templateMessage",e,{params:t}),jme=async(e,t,n={})=>Rr(`/templateMessage/${e}`,t,{params:n,invalidateCache:{type:"templateMessage",id:e}}),Hme=async(e,t={})=>Wi(`/templateMessage/${e}`,{params:t,invalidateCache:{type:"templateMessage",id:e}}),qme=async(e,t={})=>Qs(`/templateMessage/${e}`,{params:t}),Wme=async(e={})=>pt("/endCustomer",{params:e}),Gme=async(e,t={})=>pt(`/endCustomer/${e}`,{params:t}),Kme=async(e,t={})=>nn("/endCustomer",e,{params:t}),Yme=async(e,t,n={})=>Rr(`/endCustomer/${e}`,t,{params:n}),Jme=async(e,t={})=>Wi(`/endCustomer/${e}`,{params:t}),Zme=async(e,t={})=>Qs(`/endCustomer/${e}`,{params:t}),Xme=async(e={})=>pt("/companyUser",{params:e,saveCache:!0}),Qme=async(e,t={})=>pt(`/companyUser/${e}`,{params:t,saveCache:!0}),e1e=async(e,t={})=>nn("/companyUser",e,{params:t}),t1e=async(e,t,n={})=>Rr(`/companyUser/${e}`,t,{params:n,invalidateCache:{type:"companyUser",id:e}}),n1e=async(e,t={})=>Wi(`/companyUser/${e}`,{params:t,invalidateCache:{type:"companyUser",id:e}}),r1e=async(e,t={})=>Qs(`/companyUser/${e}`,{params:t}),aN={getPublic:async(e,t={})=>pt(`/public/companyUser/${e}`,{params:t}),getConnectedUsers:async(e={})=>pt("/companyUser/self/connectedUsers",{params:e}),getConnectedUserAuth:async(e,t={})=>pt(`/companyUser/self/connectedUsers/${e}/auth`,{params:t}),setConnectedUserDefault:async(e,t={})=>Rr(`/companyUser/self/connectedUsers/${e}/setDefaultAuth`,{params:t}),verifyEmail:async(e,t={})=>nn("/public/verifyEmail/companyUser",e,{params:t})},i1e=async(e,t=null,n={})=>Rr(`/companyAccount/accountType/${e}`,t,{params:n}),o1e=async(e={})=>pt("/companyAccount/getNumberOfManagers",{params:e}),s1e=async(e={})=>nn("/companyAccount/addUserLicenseInvoice",{},{params:e}),a1e=async(e,t={})=>pt(`/promotionCode/${e}/canUse`,{params:t}),l1e=async(e,t={})=>pt("/promotionCode/inUse",{params:t}),Qy={product:async(e,t={})=>nn("/companyAccount/product",e,{params:t}),cancelAll:async(e={})=>Wi("/companyAccount/subscription",{params:e}),getPrices:async(e={})=>pt("/companyAccount/price",{params:e}),getUpcomingInvoices:async(e={})=>pt("/companyAccount/upcomingInvoice",{params:e}),getPaymentHistory:async(e={})=>pt("/companyAccount/paymentHistory",{params:e}),putPaymentMethod:async(e,t={})=>Rr("/companyAccount/paymentMethod",e,{params:t}),putCustomer:async(e,t={})=>Rr("/companyAccount/customer",e,{params:t}),createCheckoutSession:async(e,t={})=>nn("/companyAccount/create-checkout-session",e,{params:t})},c1e=async(e,t)=>nn(`/project/${e}/projectMember/${t}`,null,{invalidateCache:{type:"project",id:e}}),d1e=async(e,t)=>Wi(`/project/${e}/projectMember/${t}`,{invalidateCache:{type:"project",id:e}}),Gi={get:async(e,t={})=>pt(`/document/${e}`,{params:t,saveCache:!0}),getAll:async(e={})=>pt("/document",{params:e,saveCache:!0}),post:async(e,t={})=>nn("/document",e,{params:t}),send:async(e,t={},n={})=>nn(`/document/${e}/send`,t,{params:n,invalidateCache:{type:"document",id:e}}),clearAnswers:async(e,t={},n={})=>nn(`/document/${e}/clearAnswers`,t,{params:n,invalidateCache:{type:"document",id:e}}),put:async(e,t,n={})=>Rr(`/document/${e}`,t,{params:n,invalidateCache:{type:"document",id:e}}),delete:async(e,t={})=>Wi(`/document/${e}`,{params:t,invalidateCache:{type:"document",id:e}}),patch:async(e,t={})=>Qs(`/document/${e}`,{params:t}),validate:async(e,t={})=>nn("/documentValidate",e,{params:t})},oc={get:async(e,t={})=>pt(e?`/template/${e}`:"/template",{params:t}),post:async(e,t={})=>nn("/template",e,{params:t}),put:async(e,t,n={})=>Rr(`/template/${e}`,t,{params:n}),delete:async(e,t={})=>Wi(`/template/${e}`,{params:t}),patch:async(e,t={})=>Qs(`/template/${e}`,{params:t})},Ix={get:async(e={})=>pt("/templateGallery",{params:e})},u1e={get:async(e,t={})=>pt(`/public/templateStat/${e}`,{params:t})},p1e={get:async(e={})=>pt("/documentStats",{params:e})},Jp={get:async(e,t={})=>pt(`/public/document/${e}`,{params:t}),put:async(e,t,n={})=>Rr(`/public/document/${e}`,t,{headers:n}),answer:async(e,t,n={},r={})=>nn(`/public/document/${e}/answer`,t,{params:n,headers:r}),feedback:async(e,t,n={})=>nn(`/public/document/${e}/feedback`,t,{params:n})},lN={get:async(e,t={})=>pt(`/public/pdfJob/${e}`,{params:t}),addDocument:async(e,t={})=>pt(`/public/document/${e}/pdfJob/start`,{params:t})},cN={getDocuments:async(e={})=>{const t=ot.getItem("clientToken");return Jt.get(`${De.api.baseUrl}/client/document`,{headers:{Authorization:t},params:e})},requestMagicLink:async(e,t={})=>Jt.post(`${De.api.baseUrl}/client/requestMagicLink`,e,{params:t})},ev={get:async(e,t={})=>pt(`/public/company/${e}`,{params:t}),getCertificates:async(e,t={})=>pt(`/public/company/${e}/certificates`,{params:t}),getReferences:async(e,t={})=>pt(`/public/company/${e}/references`,{params:t})},h1e={get:async(e,t={})=>pt(`${De.api.baseUrl}/public/signature/${e}`,{params:t})},$x={post:async(e,t={})=>nn("/voucher",e,{params:t}),canUse:async(e,t={})=>pt(`/voucher/${e}/canUse`,{params:t})},sc={getAuthUrl:async(e,t={})=>pt("/extension/authUrl",{params:{...t,service:e}}),getPublicAuthUrl:async(e,t={})=>pt("/public/extension/authUrl",{params:{...t,service:e}}),install:async(e,t,n={})=>nn("/extension/install",t,{params:{...n,service:e}}),uninstall:async(e,t={})=>Wi("/extension/uninstall",{params:{...t,service:e}}),suggestClients:async(e,t={})=>pt("/extension/suggestClients",{params:{...t,service:e},saveCache:!0,cacheTtl:20}),signupWithCrm:async(e,t,n={})=>nn("/public/extension/register",t,{params:{...n,service:e}}),search:async(e,t={})=>pt("/extension/search",{params:{...t,service:e},saveCache:!0,cacheTtl:10}),getFields:async(e,t={})=>pt("/extension/fields",{params:{...t,service:e},saveCache:!0,cacheTtl:60}),getExternalReferenceDetails:async(e,t={})=>pt("/extension/externalReferenceDetails",{params:{...t,service:e},saveCache:!0,cacheTtl:20}),settings:async(e,t={})=>pt("/extension/settings",{params:{...t,service:e}})},Ur={get:pt,post:nn,put:Rr,del:Wi,patch:Qs,updateAxiosInstance:({baseUrl:e})=>{ame.defaults.baseURL=e},getProjects:oN},ea=Object.create(null);ea.open="0",ea.close="1",ea.ping="2",ea.pong="3",ea.message="4",ea.upgrade="5",ea.noop="6";const tv=Object.create(null);Object.keys(ea).forEach(e=>{tv[ea[e]]=e});const f1e={type:"error",data:"parser error"},m1e=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",g1e=typeof ArrayBuffer=="function",y1e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,dN=({type:e,data:t},n,r)=>m1e&&t instanceof Blob?n?r(t):uN(t,r):g1e&&(t instanceof ArrayBuffer||y1e(t))?n?r(t):uN(new Blob([t]),r):r(ea[e]+(t||"")),uN=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+r)},n.readAsDataURL(e)},pN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<pN.length;e++)a1[pN.charCodeAt(e)]=e;const v1e=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),d=new Uint8Array(c);for(r=0;r<n;r+=4)o=a1[e.charCodeAt(r)],s=a1[e.charCodeAt(r+1)],a=a1[e.charCodeAt(r+2)],l=a1[e.charCodeAt(r+3)],d[i++]=o<<2|s>>4,d[i++]=(s&15)<<4|a>>2,d[i++]=(a&3)<<6|l&63;return c},b1e=typeof ArrayBuffer=="function",hN=(e,t)=>{if(typeof e!="string")return{type:"message",data:fN(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:w1e(e.substring(1),t)}:tv[n]?e.length>1?{type:tv[n],data:e.substring(1)}:{type:tv[n]}:f1e},w1e=(e,t)=>{if(b1e){const n=v1e(e);return fN(n,t)}else return{base64:!0,data:e}},fN=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},mN="",k1e=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{dN(o,!1,a=>{r[s]=a,++i===n&&t(r.join(mN))})})},_1e=(e,t)=>{const n=e.split(mN),r=[];for(let i=0;i<n.length;i++){const o=hN(n[i],t);if(r.push(o),o.type==="error")break}return r},gN=4;function mr(e){if(e)return x1e(e)}function x1e(e){for(var t in mr.prototype)e[t]=mr.prototype[t];return e}mr.prototype.on=mr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},mr.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},mr.prototype.off=mr.prototype.removeListener=mr.prototype.removeAllListeners=mr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this},mr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},mr.prototype.emitReserved=mr.prototype.emit,mr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},mr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const $o=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function yN(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const C1e=$o.setTimeout,T1e=$o.clearTimeout;function nv(e,t){t.useNativeTimers?(e.setTimeoutFn=C1e.bind($o),e.clearTimeoutFn=T1e.bind($o)):(e.setTimeoutFn=$o.setTimeout.bind($o),e.clearTimeoutFn=$o.clearTimeout.bind($o))}const S1e=1.33;function E1e(e){return typeof e=="string"?A1e(e):Math.ceil((e.byteLength||e.size)*S1e)}function A1e(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}class M1e extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class vN extends mr{constructor(t){super(),this.writable=!1,nv(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new M1e(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=hN(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}}const bN="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Rx=64,O1e={};let wN=0,rv=0,kN;function _N(e){let t="";do t=bN[e%Rx]+t,e=Math.floor(e/Rx);while(e>0);return t}function xN(){const e=_N(+new Date);return e!==kN?(wN=0,kN=e):e+"."+_N(wN++)}for(;rv<Rx;rv++)O1e[bN[rv]]=rv;function CN(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function D1e(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}let TN=!1;try{TN=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const P1e=TN;function SN(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||P1e))return new XMLHttpRequest}catch{}if(!t)try{return new $o[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function I1e(){}const $1e=function(){return new SN({xdomain:!1}).responseType!=null}();class R1e extends vN{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port,this.xs=t.secure!==r}const n=t&&t.forceBase64;this.supportsBinary=$1e&&!n}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};_1e(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,k1e(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=xN()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=CN(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new ta(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class ta extends mr{constructor(t,n){super(),nv(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const t=yN(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const n=this.xhr=new SN(t);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document<"u"&&(this.index=ta.requestsCount++,ta.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=I1e,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete ta.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(ta.requestsCount=0,ta.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",EN);else if(typeof addEventListener=="function"){const e="onpagehide"in $o?"pagehide":"unload";addEventListener(e,EN,!1)}}function EN(){for(let e in ta.requests)ta.requests.hasOwnProperty(e)&&ta.requests[e].abort()}const AN=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),iv=$o.WebSocket||$o.MozWebSocket,MN=!0,L1e="arraybuffer",ON=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",N1e={websocket:class extends vN{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=ON?{}:yN(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=MN&&!ON?n?new iv(t,n):new iv(t):new iv(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||L1e,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;dN(r,this.supportsBinary,o=>{const s={};try{MN&&this.ws.send(o)}catch{}i&&AN(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=xN()),this.supportsBinary||(t.b64=1);const i=CN(t),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!iv}},polling:R1e},F1e=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,V1e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Lx(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=F1e.exec(e||""),o={},s=14;for(;s--;)o[V1e[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=B1e(o,o.path),o.queryKey=z1e(o,o.query),o}function B1e(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function z1e(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let DN=class Xf extends mr{constructor(t,n={}){super(),this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=Lx(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=Lx(n.host).host),nv(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=D1e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=gN,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[t],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new N1e[t](r)}open(){let t;if(this.opts.rememberUpgrade&&Xf.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){let n=this.createTransport(t),r=!1;Xf.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",u=>{if(!r)if(u.type==="pong"&&u.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Xf.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(d(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const p=new Error("probe error");p.transport=n.name,this.emitReserved("upgradeError",p)}}))};function o(){r||(r=!0,d(),n.close(),n=null)}const s=u=>{const p=new Error("probe error: "+u);p.transport=n.name,o(),this.emitReserved("upgradeError",p)};function a(){s("transport closed")}function l(){s("socket closed")}function c(u){n&&u.name!==n.name&&o()}const d=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),n.open()}onOpen(){if(this.readyState="open",Xf.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=E1e(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Xf.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};DN.protocol=gN;function U1e(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=Lx(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const j1e=typeof ArrayBuffer=="function",H1e=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,PN=Object.prototype.toString,q1e=typeof Blob=="function"||typeof Blob<"u"&&PN.call(Blob)==="[object BlobConstructor]",W1e=typeof File=="function"||typeof File<"u"&&PN.call(File)==="[object FileConstructor]";function Nx(e){return j1e&&(e instanceof ArrayBuffer||H1e(e))||q1e&&e instanceof Blob||W1e&&e instanceof File}function ov(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(ov(e[n]))return!0;return!1}if(Nx(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ov(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ov(e[n]))return!0;return!1}function G1e(e){const t=[],n=e.data,r=e;return r.data=Fx(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Fx(e,t){if(!e)return e;if(Nx(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Fx(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Fx(e[r],t));return n}return e}function K1e(e,t){return e.data=Vx(e.data,t),e.attachments=void 0,e}function Vx(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Vx(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Vx(e[n],t));return e}const Y1e=5;var sn;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(sn||(sn={}));class J1e{constructor(t){this.replacer=t}encode(t){return(t.type===sn.EVENT||t.type===sn.ACK)&&ov(t)?(t.type=t.type===sn.EVENT?sn.BINARY_EVENT:sn.BINARY_ACK,this.encodeAsBinary(t)):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===sn.BINARY_EVENT||t.type===sn.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=G1e(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class Bx extends mr{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t),n.type===sn.BINARY_EVENT||n.type===sn.BINARY_ACK?(this.reconstructor=new Z1e(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Nx(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(sn[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===sn.BINARY_EVENT||r.type===sn.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const s=t.substring(o,n);if(s!=Number(s)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=t.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(Bx.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case sn.CONNECT:return typeof n=="object";case sn.DISCONNECT:return n===void 0;case sn.CONNECT_ERROR:return typeof n=="string"||typeof n=="object";case sn.EVENT:case sn.BINARY_EVENT:return Array.isArray(n)&&n.length>0;case sn.ACK:case sn.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class Z1e{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=K1e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const X1e=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Bx,Encoder:J1e,get PacketType(){return sn},protocol:Y1e},Symbol.toStringTag,{value:"Module"}));function us(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Q1e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});let IN=class extends mr{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[us(t,"open",this.onopen.bind(this)),us(t,"packet",this.onpacket.bind(this)),us(t,"error",this.onerror.bind(this)),us(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(Q1e.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:sn.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let s=0;s<this.sendBuffer.length;s++)this.sendBuffer[s].id===t&&this.sendBuffer.splice(s,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...s)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...s])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((s,a)=>r?s?o(s):i(a):i(s)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this.ids++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(i)):(this._queue.shift(),n&&n(null,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(){if(this._queue.length===0)return;const t=this._queue[0];if(t.pending)return;t.pending=!0,t.tryCount++;const n=this.ids;this.ids=t.id,this.flags=t.flags,this.emit.apply(this,t.args),this.ids=n}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:sn.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case sn.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case sn.EVENT:case sn.BINARY_EVENT:this.onevent(t);break;case sn.ACK:case sn.BINARY_ACK:this.onack(t);break;case sn.DISCONNECT:this.ondisconnect();break;case sn.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:sn.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:sn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}};function Zp(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Zp.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0},Zp.prototype.reset=function(){this.attempts=0},Zp.prototype.setMin=function(e){this.ms=e},Zp.prototype.setMax=function(e){this.max=e},Zp.prototype.setJitter=function(e){this.jitter=e};class zx extends mr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,nv(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Zp({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||X1e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new DN(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=us(n,"open",function(){r.onopen(),t&&t()}),o=us(n,"error",s=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",s),t?t(s):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const s=this._timeout;s===0&&i();const a=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},s);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(us(t,"ping",this.onping.bind(this)),us(t,"data",this.ondata.bind(this)),us(t,"error",this.onerror.bind(this)),us(t,"close",this.onclose.bind(this)),us(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){AN(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r||(r=new IN(this,t,n),this.nsps[t]=r),this._autoConnect&&r.connect(),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const l1={};function sv(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=U1e(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=l1[i]&&o in l1[i].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||s;let l;return a?l=new zx(r,t):(l1[i]||(l1[i]=new zx(r,t)),l=l1[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(sv,{Manager:zx,Socket:IN,io:sv,connect:sv});class ege{constructor({rootUrl:t,path:n,logger:r=console,getTokenFn:i}){ln(this,"_socket",null);ln(this,"_isConnected",!1);ln(this,"_autoReconnect",!1);ln(this,"_localAutoReconnect",!1);ln(this,"_listeners",[]);ln(this,"_connectionChangedListener",[]);ln(this,"_retryCount",0);this.rootUrl=t,this.path=n,this.logger=r,this.getTokenFn=i}setUrl({rootUrl:t,path:n}){t&&(this.rootUrl=t),n&&(this.path=n)}set autoReconnect(t){this._autoReconnect=!!t}onConnectionChanged(t){this._connectionChangedListener.push(t)}_onConnectionChanged(t){this._connectionChangedListener.forEach(n=>{try{n(t)}catch(r){console.error(r)}})}setConnected(t){t||(this._retryCount=this._retryCount+1),this.logger.debug(`Socket: isConnected changed to ${t}`);const n=this._isConnected!==t;this._isConnected=t,n&&this._onConnectionChanged(t)}_onConnected(){const t=this.getTokenFn();t&&this._socket.emit("authenticate",{token:t})}on(t,n){return this._listeners.push({type:t,fn:n}),this._socket&&this._socket.on(t,n),()=>this.off(t,n)}off(t,n){this._listeners.forEach((r,i)=>{var o;r.type===t&&r.fn===n&&(this._listeners.splice(i,1),(o=this._socket)==null||o.off(t,n))})}async connect(){await(i=>new Promise(o=>setTimeout(o,i*2*1e3)))(this._retryCount),this._socket&&(this._localAutoReconnect=!1,this.disconnect(),this._localAutoReconnect=!0);const{origin:n,pathname:r}=new URL(this.rootUrl+this.path);this._socket=sv(n,{path:r,transports:["websocket","polling"]}),this._socket.on("connect",this._onConnected.bind(this)),this._socket.on("event",i=>this.logger.debug("Socket: Event:",i)),this._listeners.forEach(({type:i,fn:o})=>{this._socket.on(i,o)}),this._socket.on("disconnect",()=>{this.setConnected(!1),this._localAutoReconnect&&this._autoReconnect&&this.connect()}),this._socket.on("authenticated",()=>{this._retryCount=0,this.setConnected(!0)}),this._socket.on("unauthorized",()=>{this.setConnected(!1)})}disconnect(){this._socket&&(this._socket.close(),this._socket=null)}}const iu=new ege({rootUrl:De.api.baseUrl,path:De.api.socket.path,logger:Ao,getTokenFn:()=>ot.getItem("token")}),tge={brand:fn[De.brand],sign:"unterschreiben",accept:"Akzeptieren",address:"Adresse",and:"und",answerFeedback:{intermediate:{title:"Danke, dass Sie Ihre Gedanken mit uns teilen."},no:{start:{action:"Abschicken",placeholder:"Was sollten wir verbessern?",text:"Gibt es etwas Bestimmtes, das Sie uns mitteilen möchten, das wir verbessern können?",title:"Vielen Dank für Ihren Beitrag."},success:{action:"Erfahren Sie mehr über $t(brand.name)",secondary:"Gehen Sie zurück zum Dokument",text:"Ihr Feedback wurde erfolgreich abgeschickt. Unser Team wird Ihr Feedback mit großer Sorgfalt prüfen.",title:"Vielen Dank."}},start:{no:"Nein",title:"Hat es Ihnen Spaß gemacht, $t(brand.name) zur Anzeige dieses Dokuments zu verwenden?",yes:"Ja"},yes:{action:"Melden Sie sich kostenlos an",secondary:"Erfahren Sie mehr über $t(brand.name)",text:"Erstellen und versenden Sie schöne Dokumente mit $t(brand.name). Entdecken Sie alle Vorteile des Versands webbasierter Dokumente mit elektronischen Signaturen.",title:"Nutzen Sie $t(brand.name) kostenlos."},custom:{title:"Vielen Dank.",text:"Ihr Feedback wurde erfolgreich übermittelt. Unser Team wird Ihr Feedback mit großer Sorgfalt prüfen.",action:"Gehen Sie zurück zum Dokument"}},answerModal:{answerSuccess:"Ihre Antwort wurde erfolgreich gesendet.",bankId:{component:{defaultError:"Etwas ist schief gelaufen. Vergewissern Sie sich, dass Sie Ihre Sozialversicherungsnummer korrekt eingegeben haben und versuchen Sie es erneut.",signingInterrupted:"Die Unterschrift wurde unterbrochen, bitte versuchen Sie es erneut...",startOnThisDevice:"BankID auf diesem Gerät starten",validations:{socialNo:{personalNumber:"Ungültige Sozialversicherungsnummer",required:"Geben Sie Ihre Sozialversicherungsnummer ein"}},viewText:{canceled:{text:"Unterzeichnung abgebrochen. Bitte versuchen Sie es erneut",title:"Unterzeichnung unterbrochen"},error:{text:"Es ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.",title:"Es ist ein Fehler aufgetreten"},form:{text:"Geben Sie Ihre Sozialversicherungsnummer ein, um mit der Unterzeichnung der Vereinbarung zu beginnen.",title:"Unterschreiben Sie das Dokument mit BankID"},new:{spinnerText:"Scannen Sie den QR-Code auf Ihrem Gerät.",text:"Öffnen Sie BankID auf Ihrem Gerät und unterschreiben Sie die Vereinbarung.",title:"Unterschreiben Sie das Dokument"},signing:{spinnerText:"Unterschreiben Sie das Dokument.",text:"Öffnen Sie BankID auf Ihrem Gerät und unterzeichnen Sie die Vereinbarung.",title:"Unterzeichnung läuft"},waiting:{spinnerText:"Ich warte darauf, dass Sie BankID öffnen.",text:"Öffnen Sie BankId auf Ihrem Gerät und unterschreiben Sie die Vereinbarung.",title:"Unterschreiben Sie das Dokument"}}},start:{action:"Unterschreiben mit BankID",text:"Akzeptieren und signieren Sie das Dokument mit BankID.",title:"Unterschreiben mit BankID"},success:{text:"$t(answerModal.successText)",textFallback:"$t(answerModal.successTextFallback)",title:"$t(answerModal.successTitle)"}},decline:{component:{label:"Kommentar (optional)"},start:{action:"Ablehnen",text:"Um dieses Dokument abzulehnen, bestätigen Sie bitte, indem Sie auf die Schaltfläche unten klicken",title:"Dokument ablehnen"},success:{text:"Danke, dass Sie eine Antwort hinterlassen haben.",textFallback:"$t(answerModal.decline.success.text)",title:"Sie haben das Dokument abgelehnt."}},signature:{component:{draw:{canvasLabel:"Signatur zeichnen",tab:"Zeichnen"},subTitle:"Unterschriftsmethode wählen",terms:"Mit meiner Unterschrift erkläre ich mich damit einverstanden, dass die verwendete elektronische Signatur eine Darstellung meiner handschriftlichen Unterschrift ist - und ebenso gültig ist.",text:{canvasLabel:"Vorschau",nameLabel:"Unterzeichnet von",namePlaceholder:"Geben Sie Ihren Namen ein",tab:"Typ"}},start:{action:"Unterschreiben & Akzeptieren",text:"",title:"Dokument akzeptieren"},success:{text:"$t(answerModal.successText)",textFallback:"$t(answerModal.successTextFallback)",title:"$t(answerModal.successTitle)"}},versionError:{accept:{title:"Dokument konnte nicht unterzeichnet werden"},decline:{title:"Dokument konnte nicht abgelehnt werden"},text:"Das Dokument wurde während Ihrer Ansicht geändert. Bitte laden Sie es erneut und überprüfen Sie das neue Dokument, um zu antworten.",btn:"Neu laden"},successText:"Sobald das Dokument von allen beteiligten Parteien unterzeichnet wurde, erhalten Sie eine E-Mail an {{email}} mit einer versiegelten Kopie des Dokuments.",successTextFallback:"Sobald das Dokument von allen beteiligten Parteien unterzeichnet wurde, können Sie zu dieser Webseite zurückkehren, um eine versiegelte und vollständige Kopie des Dokuments herunterzuladen.",successTextFallbackSingle:"Das Dokument ist nun unterzeichnet und vervollständigt.",successTextSingle:"Es wurde eine Bestätigungs-E-Mail an {{email}} mit einer versiegelten Kopie des Dokuments gesendet.",successTitle:"Sie haben das Dokument signiert."},approved:"genehmigt",approx:"ungefähr",cancel:"Abbrechen",chapters:{answerButtons:{approveDescription:"Wir haben {{- sender}} informiert, dass das Dokument genehmigt wurde.",approveTitle:"Das Dokument wurde genehmigt!",denyDescription:"Wir haben {{- sender}} informiert, dass Sie nicht interessiert sind.",denyTitle:"Das Dokument wurde abgelehnt",expiredTitle:"Das Dokument ist abgelaufen",expiredDescription:"Das Verfallsdatum des Dokuments ist abgelaufen. Es ist nicht mehr möglich, das Dokument zu unterschreiben.",editPropDes:"Eigentumsbezeichnung bearbeiten",enterPropDes:"Eigentumsbezeichnung eingeben",inPersonSignatureHint:"Es wurde eingestellt, dass Sie das Dokument in Person unterschreiben müssen. Wenn Sie stattdessen eine digitale Kopie unterschreiben möchten kontaktieren Sie uns bitte.",waitingDescription:"Es wird gewartet bis {{remaining}} Andere eine Antwort gegeben haben.",youHave:"Sie haben "},articleItem:{eligibleForDeduction:"Berechtigt für {{type}}-Rabatt"},articleList:{changeShowVatTooltip:"Umschalten zum anzeigen von {{type}}",title:"Services / Produkte"},attachments:{emptyPlaceholder:"Dieser Anhangsblock ist derzeit leer."},packageGroup:{errorCallout:"Wählen Sie mindestens eine Option",selectableOptions:"Wählbare Optionen"},packageItem:{add:"Option hinzufügen",select:"Option auswählen",selected:"Ausgewählt"},parties:{allRiskAndLiability:"Hat alle Risiko- und Haftpflichtversicherungen",fTax:"Zertifiziert für F-tax"},pricingSummary:{blocks:{approx:"Ungefährer Preis",discount:"Rabatt",deductionSubValue:"Gesamtpreis ohne Rabatt {{price}}",maxPrice:"Maximaler Preis",maxPriceVat:"Maximaler Preis {{vat}}",net:"Netto",price:"Preis",rounding:"Gerundet",subTitleArticles:"Bei Produkten/Dienstleistungen mit fixen Kosten",summary:"Zusammenfassung",total:"Gesamt",typeDeduction:"Nach {{type}}-Rabatt"},placeholder:{description:"Wählen Sie die Option(en) die Ihnen am besten passen, durch Klicken auf ",descriptionBold:"Auswählen",title:"Wählen Sie eine Option"},terms:{houseWork:`Der Gesamtpreis nach Steuerabzug für {{type}}-Arbeiten setzt voraus, dass die geleisteten Arbeiten steuerlich absetzbar sind, dass der Käufer einen ausreichenden Betrag für den Steuerabzug zur Verfügung hat und dass dieser nicht für andere {{type}}-Arbeiten verwendet wurde. Der Käufer ist für die Kontrolle dieser Informationen verantwortlich.
95
95
  `,houseWorkApprox:"Der Preis ist eine Schätzung. Denken Sie daran, dass der Preis um bis zu 15% schwanken kann. Wenn die Dienstleistungen Boden-/Abbrucharbeiten oder ähnliches umfassen. Denken Sie daran, dass der Preis um bis zu 25 % schwanken kann.",reverseVat:"Hinweis: Die umgekehrte Steuerschuldnerschaft für Bauleistungen gilt."}},termsDisclaimer:{description:"Durch genehmigen des Dokuments stimmen Sie den ",termsAndConditions:"Allgemeinen Geschäftsbedingungen zu",title:"AGBs"}},close:"Schließen",company:"Firma",deduction:{after:"Nach Rabatt",afterType:"Nach {{type}}-Rabatt",deduction:"Rabatt",greenRot15:"Grün ROT",greenRot15_percentage:"Grün ROT 15%",greenRot20:"Grün ROT",greenRot20_percentage:"Grün ROT 20%",greenRot50:"Grün ROT",greenRot50_percentage:"Grün ROT 50%",manualType:"Individueller {{type}}-Rabatt",rot:"ROT",rot_percentage:"ROT",rut:"RUT",rut_percentage:"RUT",type:"{{type}}-Rabatt"},denied:"Abgelehnt",deny:"Ablehnen",denyModal:{denyButton:"Dokument ablehnen",helpfulInformation:"Wir informieren {{- senderName}} bei {{- senderCompany}}, dass Sie das Dokument abgelehnt haben.",otherPlaceholder:"Optional. Geben Sie einen Kommentar zur Ablehnung.",subTitle:"Bestätigen Sie dies durch Klicken auf den Ablehnen Button.",successTitle:"Sie haben dieses Dokument abgelehnt",thanksAnswer:"Vielen Dank für Ihre Antwort!",title:"Dokument ablehnen"},detail_other:"Details",document:"Dokument",document_other:"Dokumente",documentDetails:{subTitle:"Informationen über das Dokument."},documentVoided:{title:"Das Dokument ist nicht mehr verfügbar.",description:"Der Absender hat sich entschieden, das Dokument zu stornieren."},documentTemplateView:{emailTemplate:{expires:{content:"$t(documentTemplateView.reminder) $t(documentTemplateView.emailTemplate.first.content)",subject:"$t(documentTemplateView.reminder) $t(documentTemplateView.sharedSubject)",text:`$t(documentTemplateView.emailTemplate.expires.title) $t(documentTemplateView.emailTemplate.expires.subject). $t(documentTemplateView.readMoreAndReply)
96
96
 
97
97
  {{docLink}}`,title:"$t(documentTemplateView.emailTemplate.first.title)"},first:{content:"Sie haben ein Dokument von {{company.name}} erhalten. Klicken Sie auf nachstehenden Link, um mehr zu lesen und Ihre Antwort zu hinterlassen.",subject:"$t(documentTemplateView.sharedSubject)",text:`$t(documentTemplateView.emailTemplate.first.title) $t(documentTemplateView.emailTemplate.first.subject). $t(documentTemplateView.readMoreAndReply)
@@ -252,7 +252,7 @@ $t(documentTemplateView.smsContent) $t(documentTemplateView.readMore)
252
252
  `+s+q.join(`,
253
253
  `+s)+`
254
254
  `+z+"}":"{"+q.join(",")+"}",s=z,F}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+_(this.getUTCMonth()+1)+"-"+_(this.getUTCDate())+"T"+_(this.getUTCHours())+":"+_(this.getUTCMinutes())+":"+_(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=M,Number.prototype.toJSON=M,String.prototype.toJSON=M),typeof o.stringify!="function"&&(l={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},o.stringify=function(P,I,L){var $;if(s="",a="",typeof L=="number")for($=0;$<L;$+=1)a+=" ";else typeof L=="string"&&(a=L);if(c=I,I&&typeof I!="function"&&(typeof I!="object"||typeof I.length!="number"))throw new Error("JSON.stringify");return O("",{"":P})}),typeof o.parse!="function"&&(o.parse=(m={"\\":"\\",'"':'"',"/":"/",t:" ",n:`
255
- `,r:"\r",f:"\f",b:"\b"},g={go:function(){d="ok"},firstokey:function(){f=h,d="colon"},okey:function(){f=h,d="colon"},ovalue:function(){d="ocomma"},firstavalue:function(){d="acomma"},avalue:function(){d="acomma"}},y={go:function(){d="ok"},ovalue:function(){d="ocomma"},firstavalue:function(){d="acomma"},avalue:function(){d="acomma"}},w={"{":{go:function(){u.push({state:"ok"}),p={},d="firstokey"},ovalue:function(){u.push({container:p,state:"ocomma",key:f}),p={},d="firstokey"},firstavalue:function(){u.push({container:p,state:"acomma"}),p={},d="firstokey"},avalue:function(){u.push({container:p,state:"acomma"}),p={},d="firstokey"}},"}":{firstokey:function(){var P=u.pop();h=p,p=P.container,f=P.key,d=P.state},ocomma:function(){var P=u.pop();p[f]=h,h=p,p=P.container,f=P.key,d=P.state}},"[":{go:function(){u.push({state:"ok"}),p=[],d="firstavalue"},ovalue:function(){u.push({container:p,state:"ocomma",key:f}),p=[],d="firstavalue"},firstavalue:function(){u.push({container:p,state:"acomma"}),p=[],d="firstavalue"},avalue:function(){u.push({container:p,state:"acomma"}),p=[],d="firstavalue"}},"]":{firstavalue:function(){var P=u.pop();h=p,p=P.container,f=P.key,d=P.state},acomma:function(){var P=u.pop();p.push(h),h=p,p=P.container,f=P.key,d=P.state}},":":{colon:function(){if(Object.hasOwnProperty.call(p,f))throw new SyntaxError("Duplicate key '"+f+'"');d="ovalue"}},",":{ocomma:function(){p[f]=h,d="okey"},acomma:function(){p.push(h),d="avalue"}},true:{go:function(){h=!0,d="ok"},ovalue:function(){h=!0,d="ocomma"},firstavalue:function(){h=!0,d="acomma"},avalue:function(){h=!0,d="acomma"}},false:{go:function(){h=!1,d="ok"},ovalue:function(){h=!1,d="ocomma"},firstavalue:function(){h=!1,d="acomma"},avalue:function(){h=!1,d="acomma"}},null:{go:function(){h=null,d="ok"},ovalue:function(){h=null,d="ocomma"},firstavalue:function(){h=null,d="acomma"},avalue:function(){h=null,d="acomma"}}},function(P,I){var L,$,F=/^[\u0020\t\n\r]*(?:([,:\[\]{}]|true|false|null)|(-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)|"((?:[^\r\n\t\\\"]|\\(?:["\\\/trnfb]|u[0-9a-fA-F]{4}))*)")/;d="go",u=[];try{for(;L=F.exec(P);)L[1]?w[L[1]][d]():L[2]?(h=+L[2],y[d]()):($=L[3],h=$.replace(/\\(?:u(.{4})|([^u]))/g,function(U,q,z){return q?String.fromCharCode(parseInt(q,16)):m[z]}),g[d]()),P=P.slice(L[0].length)}catch(U){d=U}if(d!=="ok"||/[^\u0020\t\n\r]/.test(P))throw d instanceof SyntaxError?d:new SyntaxError("JSON");return typeof I=="function"?function U(q,z){var D,N,B=q[z];if(B&&typeof B=="object")for(D in h)Object.prototype.hasOwnProperty.call(B,D)&&((N=U(B,D))!==void 0?B[D]=N:delete B[D]);return I.call(q,z,B)}({"":h},""):h}))}}},r={},function i(o){var s=r[o];if(s!==void 0)return s.exports;var a=r[o]={exports:{}};return n[o].call(a.exports,a,a.exports,i),a.exports}(409);var n,r})}(Av)),Av.exports}var mve=fve();const gve=hr(mve),yV=De.rollbar.clientToken,yve=["password","token","authToken","access_token","accessToken"],v6=e=>{const t=typeof e=="string",n=t?JSON.parse(e):e;if(Array.isArray(n))return n.map(r=>typeof r=="object"&&r!==null?v6(r):r);if(typeof n=="object"&&n!==null)for(const r in n)yve.includes(r)&&(n[r]="********");return t?JSON.stringify(n):n},b6=new gve({accessToken:yV,captureUncaught:!0,captureUnhandledRejections:!0,source_map_enabled:!0,enabled:!1,ignoredMessages:["The operation is insecure","Script error.","null is not an object (evaluating 'localStorage.getItem')","Unexpected token '<'","expected expression, got '<'","ChunkLoadError","Loading chunk","ResizeObserver loop limit exceeded","Failed to update a ServiceWorker for scope","Object Not Found Matching Id","newestWorker is null"],payload:{environment:De.rollbar.environment||De.environment,client:{javascript:{code_version:"0.21.0",source_map_enabled:!0,guess_uncaught_frames:!0}}},transform:e=>{var i,o,s,a,l,c;const{body:t,custom:n}=e;(a=(s=(o=(i=t==null?void 0:t.trace)==null?void 0:i.extra)==null?void 0:o.axios)==null?void 0:s.config)!=null&&a.data&&(t.trace.extra.axios.config.data=v6(t.trace.extra.axios.config.data)),(c=(l=n==null?void 0:n.axios)==null?void 0:l.config)!=null&&c.data&&(n.axios.config.data=v6(n.axios.config.data));const{trace:r}=t;if(r&&r.frames)for(let d=0;d<r.frames.length;d++){const{filename:u}=r.frames[d];u&&(r.frames[d].filename=r.frames[d].filename.replace(De.baseUrl,"https://dynamichost"))}}}),vve=!!yV&&!pve().includes("rollbar");window.enableErrorTracker=()=>{vve&&b6.configure({enabled:!0})};const bve=[9001,9002,9003,9004,9005,9006],wve=[401];function kve(e){const{payload:t}=e,n=i=>ye.te(`errors:${i}`)&&ye.t(`errors:${i}`);let r=n(e.code);return t.code&&n(t.code)?r=n(t.code):t.fallbackCode&&n(t.fallbackCode)?r=n(t.fallbackCode):t.string&&(r=t.string),r}class _ve{constructor(){ln(this,"errors",new Map);this.handleError.bind(this)}init({logger:t=console,showMessage:n,onNetworkError:r,clearNetworkError:i}={}){if(this._logger=t,typeof n!="function")throw Error("showMessage must be a function");this._showMessage=n,this._onNetworkError=r,this._clearNetworkError=i}normalizeError(t){return this.getErrorType(t)!=="Error"?t:new T4(t)}_showNotification(t,n){this._showMessage({type:n||"error",message:t||` Tyvärr har ett okänt fel inträffat, vi har loggat felet och kommer snarast att åtgärda det.
255
+ `,r:"\r",f:"\f",b:"\b"},g={go:function(){d="ok"},firstokey:function(){f=h,d="colon"},okey:function(){f=h,d="colon"},ovalue:function(){d="ocomma"},firstavalue:function(){d="acomma"},avalue:function(){d="acomma"}},y={go:function(){d="ok"},ovalue:function(){d="ocomma"},firstavalue:function(){d="acomma"},avalue:function(){d="acomma"}},w={"{":{go:function(){u.push({state:"ok"}),p={},d="firstokey"},ovalue:function(){u.push({container:p,state:"ocomma",key:f}),p={},d="firstokey"},firstavalue:function(){u.push({container:p,state:"acomma"}),p={},d="firstokey"},avalue:function(){u.push({container:p,state:"acomma"}),p={},d="firstokey"}},"}":{firstokey:function(){var P=u.pop();h=p,p=P.container,f=P.key,d=P.state},ocomma:function(){var P=u.pop();p[f]=h,h=p,p=P.container,f=P.key,d=P.state}},"[":{go:function(){u.push({state:"ok"}),p=[],d="firstavalue"},ovalue:function(){u.push({container:p,state:"ocomma",key:f}),p=[],d="firstavalue"},firstavalue:function(){u.push({container:p,state:"acomma"}),p=[],d="firstavalue"},avalue:function(){u.push({container:p,state:"acomma"}),p=[],d="firstavalue"}},"]":{firstavalue:function(){var P=u.pop();h=p,p=P.container,f=P.key,d=P.state},acomma:function(){var P=u.pop();p.push(h),h=p,p=P.container,f=P.key,d=P.state}},":":{colon:function(){if(Object.hasOwnProperty.call(p,f))throw new SyntaxError("Duplicate key '"+f+'"');d="ovalue"}},",":{ocomma:function(){p[f]=h,d="okey"},acomma:function(){p.push(h),d="avalue"}},true:{go:function(){h=!0,d="ok"},ovalue:function(){h=!0,d="ocomma"},firstavalue:function(){h=!0,d="acomma"},avalue:function(){h=!0,d="acomma"}},false:{go:function(){h=!1,d="ok"},ovalue:function(){h=!1,d="ocomma"},firstavalue:function(){h=!1,d="acomma"},avalue:function(){h=!1,d="acomma"}},null:{go:function(){h=null,d="ok"},ovalue:function(){h=null,d="ocomma"},firstavalue:function(){h=null,d="acomma"},avalue:function(){h=null,d="acomma"}}},function(P,I){var L,$,F=/^[\u0020\t\n\r]*(?:([,:\[\]{}]|true|false|null)|(-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)|"((?:[^\r\n\t\\\"]|\\(?:["\\\/trnfb]|u[0-9a-fA-F]{4}))*)")/;d="go",u=[];try{for(;L=F.exec(P);)L[1]?w[L[1]][d]():L[2]?(h=+L[2],y[d]()):($=L[3],h=$.replace(/\\(?:u(.{4})|([^u]))/g,function(U,q,z){return q?String.fromCharCode(parseInt(q,16)):m[z]}),g[d]()),P=P.slice(L[0].length)}catch(U){d=U}if(d!=="ok"||/[^\u0020\t\n\r]/.test(P))throw d instanceof SyntaxError?d:new SyntaxError("JSON");return typeof I=="function"?function U(q,z){var D,N,B=q[z];if(B&&typeof B=="object")for(D in h)Object.prototype.hasOwnProperty.call(B,D)&&((N=U(B,D))!==void 0?B[D]=N:delete B[D]);return I.call(q,z,B)}({"":h},""):h}))}}},r={},function i(o){var s=r[o];if(s!==void 0)return s.exports;var a=r[o]={exports:{}};return n[o].call(a.exports,a,a.exports,i),a.exports}(409);var n,r})}(Av)),Av.exports}var mve=fve();const gve=hr(mve),yV=De.rollbar.clientToken,yve=["password","token","authToken","access_token","accessToken"],v6=e=>{const t=typeof e=="string",n=t?JSON.parse(e):e;if(Array.isArray(n))return n.map(r=>typeof r=="object"&&r!==null?v6(r):r);if(typeof n=="object"&&n!==null)for(const r in n)yve.includes(r)&&(n[r]="********");return t?JSON.stringify(n):n},b6=new gve({accessToken:yV,captureUncaught:!0,captureUnhandledRejections:!0,source_map_enabled:!0,enabled:!1,ignoredMessages:["The operation is insecure","Script error.","null is not an object (evaluating 'localStorage.getItem')","Unexpected token '<'","expected expression, got '<'","ChunkLoadError","Loading chunk","ResizeObserver loop limit exceeded","Failed to update a ServiceWorker for scope","Object Not Found Matching Id","newestWorker is null"],payload:{environment:De.rollbar.environment||De.environment,client:{javascript:{code_version:"0.21.1",source_map_enabled:!0,guess_uncaught_frames:!0}}},transform:e=>{var i,o,s,a,l,c;const{body:t,custom:n}=e;(a=(s=(o=(i=t==null?void 0:t.trace)==null?void 0:i.extra)==null?void 0:o.axios)==null?void 0:s.config)!=null&&a.data&&(t.trace.extra.axios.config.data=v6(t.trace.extra.axios.config.data)),(c=(l=n==null?void 0:n.axios)==null?void 0:l.config)!=null&&c.data&&(n.axios.config.data=v6(n.axios.config.data));const{trace:r}=t;if(r&&r.frames)for(let d=0;d<r.frames.length;d++){const{filename:u}=r.frames[d];u&&(r.frames[d].filename=r.frames[d].filename.replace(De.baseUrl,"https://dynamichost"))}}}),vve=!!yV&&!pve().includes("rollbar");window.enableErrorTracker=()=>{vve&&b6.configure({enabled:!0})};const bve=[9001,9002,9003,9004,9005,9006],wve=[401];function kve(e){const{payload:t}=e,n=i=>ye.te(`errors:${i}`)&&ye.t(`errors:${i}`);let r=n(e.code);return t.code&&n(t.code)?r=n(t.code):t.fallbackCode&&n(t.fallbackCode)?r=n(t.fallbackCode):t.string&&(r=t.string),r}class _ve{constructor(){ln(this,"errors",new Map);this.handleError.bind(this)}init({logger:t=console,showMessage:n,onNetworkError:r,clearNetworkError:i}={}){if(this._logger=t,typeof n!="function")throw Error("showMessage must be a function");this._showMessage=n,this._onNetworkError=r,this._clearNetworkError=i}normalizeError(t){return this.getErrorType(t)!=="Error"?t:new T4(t)}_showNotification(t,n){this._showMessage({type:n||"error",message:t||` Tyvärr har ett okänt fel inträffat, vi har loggat felet och kommer snarast att åtgärda det.
256
256
  `})}logError(t){this._logger?(this._logger.error(t),this._logger.debug(`${t.name}: ${t.message}`,t.payload)):(console.error(t),console.debug(`${t.name}: ${t.message}`,t.payload))}getErrorType(t){return Object.keys(ZM).some(r=>t instanceof ZM[r])?t.name:"Error"}addCustomData(t,n){kn(n)!=="object"||this.getErrorType(t)==="Error"||t.add(n)}saveError(t){const n=this.getErrorType(t);this.errors.has(n)||this.errors.set(n,[]);const r=this.errors.get(n);this.errors.set(n,{...r,[t.message]:{count:((r[t.message]||{}).count||0)+1,lastError:new Date}})}isDuplicate(t,n=1){const r=this.getErrorType(t),{lastError:i}=(this.errors.get(r)||{})[t.message]||{};return!!(i&&Oue(Iue(i,n)))}notifyUser(t){if(this.isDuplicate(t)||t.payload&&!t.payload.showMessage)return;const n=kve(t);n&&this._showNotification(n)}sendRollbarError(t,n=10){if(this.isDuplicate(t,n))return;const{payload:r={},httpStatusCode:i}=t||{},{code:o}=r;o&&bve.includes(o)||!o&&i&&wve.includes(i)||b6.error(t,r)}async resolveNetworkError(t){var n;try{await mme(),(n=this._clearNetworkError)==null||n.call(this)}catch(r){this.getErrorType(r)!=="NetworkError"&&this.handleError(r),setTimeout(()=>{this.resolveNetworkError(t).catch(this.handleError)},5e3)}}}class xve extends _ve{handleError(t,n){var i;const r=this.normalizeError(t);this.addCustomData(r,n),this.notifyUser(r),this.logError(r),this.sendRollbarError(r),!this.isDuplicate(r)&&this.getErrorType(r)==="NetworkError"&&((i=this._onNetworkError)==null||i.call(this,r),this.resolveNetworkError(r).catch(this.handleError)),this.saveError(r)}onVueException(t,n){n.$nextTick(()=>{this.handleError(t)})}}const w6=new xve,Ar=w6.handleError.bind(w6),v0=class v0{init({store:t}){this.store=t}getValidFeatures(){return Object.keys(v0.schema)}_isValidAccountType(t){if(!t||kn(t)!=="array")throw new Error("Invalid param accountTypes");const{accountType:n}=this.store.getters["application/companyAccount"]||{};return t.includes(n)}_isValidFeatureKey(t){if(!t||kn(t)!=="string")throw new Error("Invalid param featureKey");const{CompanyFeatures:n}=this.store.getters["application/company"]||{};return n?n[t]:!1}_isValidCompanySetting(t){if(!t||kn(t)!=="string")throw new Error("Invalid param settingKey");return t.split("||").some(r=>{var o;const i=(o=this.store)==null?void 0:o.getters["settings/getCompanySetting"](r);return typeof i=="boolean"&&i})}_isValidCompanyUserSettingFn({name:t,fn:n}){if(!t||kn(t)!=="string")throw new Error("Invalid param name");if(!n||kn(n)!=="function")throw new Error("Invalid param fn");const r=this.store.getters["settings/getCompanyUserSetting"](t);return!!n(r)}_isValidRegion(t){if(!t||kn(t)!=="string")throw new Error("Invalid param requiredRegion");const{region:n}=this.store.getters["application/company"]||{};return n?t===n:!1}_isValidBrand(t){if(!t||kn(t)!=="string")throw new Error("Invalid param requiredBrand");if(!(De!=null&&De.brand))return!1;const{brand:n}=De.brand;return t===n}_isCreatedBefore(t){if(!t||kn(t)!=="string")throw new Error("Invalid param feature dateString");const{createdAt:n}=this.store.getters["application/company"]||{};return n?Due(n,t):!1}_evaluateFeature(t,{returnType:n="boolean"}={}){const r=v0.schema[t];if(!r||kn(r)!=="object")throw Error(`No rules for feature '${t}' has been defined!`);if(!["boolean","array"].includes(n))throw Error("Invalid param returnType");const i=[];return r.accountTypes&&!this._isValidAccountType(r.accountTypes)&&(i.push("accountTypes"),n==="boolean")||r.featureKey&&!this._isValidFeatureKey(r.featureKey)&&(i.push("featureKey"),n==="boolean")||r.companySetting&&!this._isValidCompanySetting(r.companySetting)&&(i.push("companySetting"),n==="boolean")||r.companyUserSettingFn&&!this._isValidCompanyUserSettingFn(r.companyUserSettingFn)&&(i.push("companyUserSettingFn"),n==="boolean")||r.region&&!this._isValidRegion(r.region)&&(i.push("region"),n==="boolean")||r.brand&&!this._isValidBrand(r.brand)&&(i.push("brand"),n==="boolean")||r.createdBefore&&!this._isCreatedBefore(r.createdBefore)&&(i.push("preDynDoc2"),n==="boolean")?!1:n==="array"?i:!0}checkFeature(t){return this._evaluateFeature(t)}checkFeatureUpgrade(t){const n=this._evaluateFeature(t,{returnType:"array"});return n.length===1&&n.includes("accountTypes")}};ln(v0,"schema",{personalMessage:{},unlimitedCertificates:{},companyAboutUs:{},winProfile:{},templates:{},task:{featureKey:"task"},reverseVat:{featureKey:"reverseVat"},ataSetting:{featureKey:"ataSetting"},propertyDesignation:{companySetting:"showRot||showGreenRot"},openAccConstruction:{featureKey:"openAccConstruction"},docChapterIsBinding:{companySetting:"showIsBinding"},projectSettingHideAllArticles:{companySetting:"allowHideAllArticles"},docAtaDateDelay:{companySetting:"docAtaShowDateDelay"},docAtaNotIncluded:{companySetting:"docAtaShowNotIncluded"},docAtaPayment:{companySetting:"docAtaShowPayment"},sms:{featureKey:"sms"},smsSenderName:{featureKey:"smsSenderName"},regionSE:{region:"SE"},bankId:{region:"SE",companySetting:"enableBankId"},templateGallery:{companyUserSettingFn:{name:"defaultLanguage",fn:t=>t==="sv"}},clientReview:{brand:"cling"},upgradeSignatureBankId:{companySetting:"upgradeSignatureBankId"},preDynDoc2:{createdBefore:"2020-11-05T00:00:00.000Z"},emailDomain:{featureKey:"emailDomain"},subdomain:{featureKey:"subdomain"},stats:{featureKey:"stats"},api:{featureKey:"api"},fortnox:{featureKey:"fortnox"},inviteCreators:{accountTypes:["base","pro"]},docBlock_header:{featureKey:"docBlock_header"},docBlock_parties:{featureKey:"docBlock_parties"},docBlock_packageGroup:{featureKey:"docBlock_packageGroup"},docBlock_titleAndText2:{featureKey:"docBlock_titleAndText2"},docBlock_coverBlock:{featureKey:"docBlock_coverBlock"},docBlock_videoPlayer:{featureKey:"docBlock_videoPlayer"},docBlock_attachments2:{featureKey:"docBlock_attachments2"},docBlock_pdf:{featureKey:"docBlock_pdf"},docBlock_embed:{featureKey:"docBlock_embed"},docBlock_custom:{featureKey:"docBlock_custom"},docBlock_terms:{featureKey:"docBlock_terms"},docBlock_presentation:{featureKey:"docBlock_presentation"},useDocTemplate:{featureKey:"useDocTemplate"},createDocTemplate:{featureKey:"createDocTemplate"}});let k6=v0;const Di=new k6,Cve=Vp(),sa=Wn({messages:[],actions:{}}),Tve=e=>sa.messages.push(Gp(e)),k1=e=>{const t=sa.messages[e];sa.actions[t==null?void 0:t._uniqueId]&&delete sa.actions[t._uniqueId],sa.messages.splice(e,1)},vV=({index:e,type:t})=>{try{const n={cancel:()=>k1(e)},r=sa.messages[e];if(!r||!r._uniqueId)throw Error("message not found, failed to trigger action");const i=sa.actions[r._uniqueId];if(!i)throw Error("message has no actions, failed to trigger action");const o=i[t];if(!o)throw Error(`message has no action of type ${t}`);let s=o;if(typeof o=="string"&&(s=n[o],!s))throw Error(`No predefined action of type ${o}`);if(typeof s!="function")throw Error("Unable to extract function from message action");return s(r)}catch(n){return Ar(n)}},ih=e=>{const{type:t,displayType:n="notification",time:r=5e3,title:i,message:o,closeButton:s,omit:a=""}=e,l={},c={};if((p=>p.split(",").some(f=>{const[h="foo",m="bar"]=f.split(":");return Cve.config.globalProperties[h]===m}))(a))return;e.actions&&Object.keys(e.actions).forEach(p=>{const f=e.actions[p];if(typeof f=="object"&&!Array.isArray(f)){if(!f.fn&&!f.callback)throw Error(`No callback function provided for action ${p}`);l[p]=f.fn||f.callback,delete f.fn,delete f.callback,c[p]=f}else if(typeof f=="string")l[p]=f,c[p]={};else if(typeof f=="function")l[p]=f,c[p]={};else throw Error(`Action, ${p} , must be one of: object|string|function`)}),Tve({actions:c,title:i,message:o,type:t,displayType:n,time:r,closeButton:s});const u=sa.messages.slice(-1)[0];sa.actions[u._uniqueId]=l},No=(e,t)=>ih({type:e,message:t}),bV=sa,Bs=class Bs{init({store:t}){this.store=t}_getObjectById(t,n){const r=(Bs.schema[n]||{}).$module,{data:i}=this.store.state[r]||{};if(!i)throw Error(`No module for ${n} has been defined!`);return i[t]}_getIdPath(t){return(Bs.schema[t]||{}).$id}_getAllowNullOwner(t){return!!(Bs.schema[t]||{}).$allowNullOwner}_getScopeKey(t){return(Bs.schema[t]||{}).$scopeKey}_getUserId(){const{user:t={}}=this.store.state.application;return t.userId}getValidScopes(){return Object.keys(Bs.schema)}getRequiredCompanyUserPermission(t,n){const r=Bs.schema[t];return!r||!r[n]?[]:Array.isArray(r[n])?r[n]:[r[n]]}hasFeature(t){const n=Bs.featureSchema[t];return n?Di.checkFeature(n):!0}checkPermission(t,n,r=void 0){const{getters:i}=this.store,{CompanyUserPermission:o}=i["application/user"]||{};if(!o||!this.hasFeature(t))return!1;let a=this.getRequiredCompanyUserPermission(t,n);if(!a||a.length===0)return console.warn(`Permission ${n} in scope ${t} has not been implemented`),!1;let l=a.some(d=>o[d]===!0);if(l)return!0;if(!r)return!1;const c=this._getScopeKey(t);if(a=a.map(d=>d.includes("Own")?d:d.replace(`${c[0].toUpperCase()}${c.slice(1)}`,`Own${c[0].toUpperCase()}${c.slice(1)}`)),l=a.some(d=>o[d]===!0),l){const d=this._getObjectById(r,t);if(!d)return!1;if(t==="documents")return this.checkPermission("projects",n,d.projectId);const u=Lfe(d,this._getIdPath(t)),p=this._getAllowNullOwner(t);return u===this._getUserId()||p&&u===null}return!1}getScope(t={}){return this.getValidScopes().find(i=>t[i])}};ln(Bs,"schema",{projects:{read:"manageProjects",modify:"manageProjects",create:["manageProjects","manageOwnProjects"],delete:"manageProjects",readPrice:["manageProjects","showPrices"],$scopeKey:"projects",$module:"projects",$id:"CompanyUserId"},users:{modify:"manageUsers",create:"manageUsers",$scopeKey:"users",$module:"companyUsers",$id:"id"},documents:{create:["manageProjects","manageOwnProjects"],read:"manageProjects",modify:"manageProjects",delete:"manageProjects",readPrice:["manageProjects","showPrices"],$scopeKey:"projects",$module:"documents2",$id:"companyUserId"},atas:{create:["manageAtas","manageOwnAtas"],read:"manageAtas",modify:"manageAtas",delete:"manageAtas",readPrice:["manageAtas","showPrices"],$scopeKey:"atas",$module:"documents",$id:"data.CompanyUserId"},company:{create:"manageCompany",read:"manageCompany",modify:"manageCompany",$scopeKey:"company",$module:"companies",$id:"id"},articles:{create:["manageProjects","manageOwnProjects"],modify:["manageProjects","manageOwnProjects"],delete:["manageProjects","manageOwnProjects"],readPrice:["manageOwnAtas","manageAtas","manageProjects","manageOwnProjects","showPrices"],$scopeKey:"projects",$module:"articles",$id:"id"},prices:{read:"showPrices"},templates:{create:"createTemplates",read:"readTemplates",modify:"modifyTemplates",delete:"deleteTemplates"},endCustomers:{read:["readEndCustomers","readOwnEndCustomers"],modify:"modifyEndCustomers",create:"createEndCustomers",delete:"deleteEndCustomers",$scopeKey:"endCustomers",$module:"endCustomers",$id:"CompanyUserId",$allowNullOwner:!0},fortnox:{export:"manageCompany"}}),ln(Bs,"featureSchema",{});let _6=Bs;const _1=new _6;function Sve(e,t,n){const r={}.moduleName||"route";e.registerModule(r,{namespaced:!0,state:x6(t.currentRoute.value),mutations:{ROUTE_CHANGED(l,c){e.state[r]=x6(c.to,c.from)}}});let i=!1,o;const s=e.watch(l=>l[r],l=>{const{fullPath:c}=l;c!==o&&(o!=null&&(i=!0,t.push(l)),o=c)},{flush:"sync"}),a=t.afterEach((l,c)=>{if(i){i=!1;return}o=l.fullPath,e.commit(r+"/ROUTE_CHANGED",{to:l,from:c})});return function(){a(),s(),e.unregisterModule(r)}}function x6(e,t){const n={name:e.name,path:e.path,hash:e.hash,query:e.query,params:e.params,fullPath:e.fullPath,meta:e.meta};return t&&(n.from=x6(t)),Object.freeze(n)}const C6=c1?window:void 0;function du(e){var t;const n=an(e);return(t=n==null?void 0:n.$el)!=null?t:n}function Mv(...e){let t,n,r,i;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,i]=e,t=C6):[t,n,r,i]=e,!t)return Xp;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],s=()=>{o.forEach(d=>d()),o.length=0},a=(d,u,p,f)=>(d.addEventListener(u,p,f),()=>d.removeEventListener(u,p,f)),l=_t(()=>[du(t),an(i)],([d,u])=>{if(s(),!d)return;const p=Hx(u)?{...u}:u;o.push(...n.flatMap(f=>r.map(h=>a(d,f,h,p))))},{immediate:!0,flush:"post"}),c=()=>{l(),s()};return Ja(c),c}let wV=!1;function kV(e,t,n={}){const{window:r=C6,ignore:i=[],capture:o=!0,detectIframe:s=!1}=n;if(!r)return Xp;qx&&!wV&&(wV=!0,Array.from(r.document.body.children).forEach(m=>m.addEventListener("click",Xp)),r.document.documentElement.addEventListener("click",Xp));let a=!0;const l=m=>an(i).some(g=>{if(typeof g=="string")return Array.from(r.document.querySelectorAll(g)).some(y=>y===m.target||m.composedPath().includes(y));{const y=du(g);return y&&(m.target===y||m.composedPath().includes(y))}});function c(m){const g=an(m);return g&&g.$.subTree.shapeFlag===16}function d(m,g){const y=an(m),w=y.$.subTree&&y.$.subTree.children;return w==null||!Array.isArray(w)?!1:w.some(k=>k.el===g.target||g.composedPath().includes(k.el))}const u=m=>{const g=du(e);if(m.target!=null&&!(!(g instanceof Element)&&c(e)&&d(e,m))&&!(!g||g===m.target||m.composedPath().includes(g))){if(m.detail===0&&(a=!l(m)),!a){a=!0;return}t(m)}};let p=!1;const f=[Mv(r,"click",m=>{p||(p=!0,setTimeout(()=>{p=!1},0),u(m))},{passive:!0,capture:o}),Mv(r,"pointerdown",m=>{const g=du(e);a=!l(m)&&!!(g&&!m.composedPath().includes(g))},{passive:!0}),s&&Mv(r,"blur",m=>{setTimeout(()=>{var g;const y=du(e);((g=r.document.activeElement)==null?void 0:g.tagName)==="IFRAME"&&!(y!=null&&y.contains(r.document.activeElement))&&t(m)},0)})].filter(Boolean);return()=>f.forEach(m=>m())}const Eve={[jx.mounted](e,t){const n=!t.modifiers.bubble;if(typeof t.value=="function")e.__onClickOutside_stop=kV(e,t.value,{capture:n});else{const[r,i]=t.value;e.__onClickOutside_stop=kV(e,r,Object.assign({capture:n},i))}},[jx.unmounted](e){e.__onClickOutside_stop()}};function Ave(){const e=Pe(!1),t=wn();return t&&fr(()=>{e.value=!0},t),e}function Mve(e){const t=Ave();return ce(()=>(t.value,!!e()))}function _V(e,t,n={}){const{window:r=C6,...i}=n;let o;const s=Mve(()=>r&&"ResizeObserver"in r),a=()=>{o&&(o.disconnect(),o=void 0)},l=ce(()=>{const u=an(e);return Array.isArray(u)?u.map(p=>du(p)):[du(u)]}),c=_t(l,u=>{if(a(),s.value&&r){o=new ResizeObserver(t);for(const p of u)p&&o.observe(p,i)}},{immediate:!0,flush:"post"}),d=()=>{a(),c()};return Ja(d),{isSupported:s,stop:d}}function T6(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const xV={[jx.mounted](e,t){typeof t.value=="function"?_V(e,t.value):_V(e,...t.value)}};function CV(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const n=e.parentNode;return!n||n.tagName==="BODY"?!1:CV(n)}}function Ove(e){const t=e||window.event,n=t.target;return CV(n)?!1:t.touches.length>1?!0:(t.preventDefault&&t.preventDefault(),!1)}const S6=new WeakMap;function Dve(e,t=!1){const n=Pe(t);let r=null,i="";_t(mge(e),a=>{const l=T6(an(a));if(l){const c=l;if(S6.get(c)||S6.set(c,c.style.overflow),c.style.overflow!=="hidden"&&(i=c.style.overflow),c.style.overflow==="hidden")return n.value=!0;if(n.value)return c.style.overflow="hidden"}},{immediate:!0});const o=()=>{const a=T6(an(e));!a||n.value||(qx&&(r=Mv(a,"touchmove",l=>{Ove(l)},{passive:!1})),a.style.overflow="hidden",n.value=!0)},s=()=>{const a=T6(an(e));!a||!n.value||(qx&&(r==null||r()),a.style.overflow=i,S6.delete(a),n.value=!1)};return Ja(s),ce({get(){return n.value},set(a){a?o():s()}})}function Pve(){let e=!1;const t=Pe(!1);return(n,r)=>{if(t.value=r.value,e)return;e=!0;const i=Dve(n,r.value);_t(t,o=>i.value=o)}}Pve();const TV=Symbol("wormhole");function SV(){const e=Gn(TV);if(!e)throw new Error(`
257
257
  [portal-vue]: Necessary Injection not found. Make sur you installed the plugin properly.`);return e}const EV=typeof window<"u";function Ive(e,t){return e.map((n,r)=>[r,n]).sort(function(n,r){return t(n[1],r[1])||n[0]-r[0]}).map(n=>n[1])}function $ve(e,t){const n=SV();function r(){if(!EV)return;const{to:o,name:s,order:a}=e;t.default?n.open({to:o,from:s,order:a,content:t.default}):i()}function i(o){n.close({to:o??e.to,from:e.name})}fr(()=>{e.disabled||r()}),Wd(()=>{e.disabled?i():r()}),Po(()=>{i()}),_t(()=>e.to,(o,s)=>{e.disabled||(s&&s!==o&&i(s),r())})}const Rve=$e({compatConfig:{MODE:3},name:"portal",props:{disabled:{type:Boolean},name:{type:[String,Symbol],default:()=>Symbol()},order:{type:Number},slotProps:{type:Object,default:()=>({})},to:{type:String,default:()=>String(Math.round(Math.random()*1e7))}},setup(e,{slots:t}){return $ve(e,t),()=>e.disabled&&t.default?t.default(e.slotProps):null}}),Lve=(e,{slots:t})=>{var n;return(n=t.default)==null?void 0:n.call(t)},Nve=$e({compatConfig:{MODE:3},name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slotProps:{type:Object,default:()=>({})}},emits:["change"],setup(e,{emit:t,slots:n}){const r=SV(),i=ce(()=>{const o=r.getContentForTarget(e.name,e.multiple),s=n.wrapper,a=o.map(c=>c.content(e.slotProps)),l=s?a.flatMap(c=>c.length?s(c):[]):a.flat(1);return{vnodes:l,vnodesFn:()=>l}});return _t(i,({vnodes:o})=>{const s=o.length>0,a=r.transports.get(e.name),l=a?[...a.keys()]:[];t("change",{hasContent:s,sources:l})},{flush:"post"}),()=>{var o;return i.value.vnodes.length?[mn("div",{style:"display: none",key:"__portal-vue-hacky-scoped-slot-repair__"}),mn(Lve,i.value.vnodesFn)]:(o=n.default)==null?void 0:o.call(n)}}});function Fve(e=!0){const t=Wn(new Map);function n(s){if(!EV)return;const{to:a,from:l,content:c,order:d=1/0}=s;if(!a||!l||!c)return;t.has(a)||t.set(a,new Map);const u=t.get(a),p={to:a,from:l,content:c,order:d};u.set(l,p)}function r(s){const{to:a,from:l}=s;if(!a||!l)return;const c=t.get(a);!c||(c.delete(l),c.size||t.delete(a))}function i(s,a){const l=t.get(s);if(!l)return[];const c=Array.from((l==null?void 0:l.values())||[]);return a?Ive(c,(d,u)=>d.order-u.order):[c.pop()]}const o={open:n,close:r,transports:t,getContentForTarget:i};return e?Bd(o):o}const Vve=Fve();function Bve(e,t={}){t.portalName!==!1&&e.component(t.portalName||"Portal",Rve),t.portalTargetName!==!1&&e.component(t.portalTargetName||"PortalTarget",Nve);const n=t.wormhole??Vve;e.provide(TV,n)}const zve={name:"Dialog",props:{dialog:{type:Object,default:()=>({type:""})},index:{type:Number,default:null}},data(){return{name:"dialog-modal"}},computed:{hasSubmit(){const{submit:e}=this.dialog.actions||{};return typeof e=="object"&&!Array.isArray(e)},submitText(){const{submit:e={}}=this.dialog.actions||{};return e.text||this.$t("continue")},submitType(){return this.dialog.type||"danger"},hasCancel(){const{cancel:e}=this.dialog.actions||{};return typeof e=="object"&&!Array.isArray(e)},cancelText(){const{cancel:e={}}=this.dialog.actions||{};return e.text||this.$t("cancel")}},mounted(){this.$modal.show(this.name),setTimeout(()=>{this.$refs.action&&this.$refs.action.$el.focus()},100),window.addEventListener("keyup",this.handleEscapeKeyUp)},beforeUnmount(){this.$modal.hide(this.name),window.removeEventListener("keyup",this.handleEscapeKeyUp)},methods:{onMessageAction(e){vV({index:this.index,type:e}),k1(this.index),this.$modal.hide(this.name)},handleEscapeKeyUp(e){e.which===27&&this.onMessageAction("cancel")}}},Uve={class:"mb-6 select-none p-2 text-base font-normal text-gray-700"},jve={key:0,class:"text-md mb-1 font-bold text-gray-900"},Hve={class:"text-sm"},qve={class:"button-row flex justify-end"};function Wve(e,t,n,r,i,o){const s=A("CButton"),a=A("modal");return v(),V(a,{classes:["v--modal",i.name,"bg-white !rounded-xl shadow-2xl py-4 px-4 duration-100 border border-gray-200"],adaptive:!0,width:"90%","max-width":380,scrollable:!1,height:"auto","click-to-close":!1,transition:"modal-pop",class:"transition-fix",name:"dialog-modal",style:{"z-index":"99999999"}},{default:E(()=>[b("div",Uve,[n.dialog.title?(v(),x("div",jve,C(n.dialog.title),1)):R("",!0),b("div",Hve,C(n.dialog.message),1)]),b("div",qve,[o.hasCancel?(v(),V(s,{key:0,type:"none",pattern:"tertiary",tabindex:"-1",size:"small",taller:"",onClick:t[0]||(t[0]=l=>o.onMessageAction("cancel"))},{default:E(()=>[H(C(o.cancelText),1)]),_:1})):R("",!0),o.hasSubmit?(v(),V(s,{key:1,ref:"action",type:o.submitType,tabindex:"0",size:"small",taller:"",style:{"margin-left":"calc(1 * var(--rem))"},onClick:t[1]||(t[1]=l=>o.onMessageAction("submit"))},{default:E(()=>[H(C(o.submitText),1)]),_:1},8,["type"])):R("",!0)])]),_:1},8,["classes"])}const Gve=X(zve,[["render",Wve]]),Kve=["stroke-width"],oh=X($e({__name:"Spinner",props:{size:{default:"40px"},strokeWidth:{default:6},color:{default:""}},setup(e){const t=$p(),n=ce(()=>t.style);return(r,i)=>(v(),x("svg",{style:Oe({width:r.size,height:r.size,lineHeight:r.size,staticStyle:n.value}),class:ne([[r.color],"spinner spinner--circle inline-block"]),viewBox:"0 0 66 66",xmlns:"http://www.w3.org/2000/svg"},[b("circle",{class:"path",fill:"none","stroke-width":r.strokeWidth,"stroke-linecap":"round",cx:"33",cy:"33",r:"30"},null,8,Kve)],6))}}),[["__scopeId","data-v-b4054b3e"]]),Yve={name:"UserMessages",components:{Spinner:oh},props:{notification:{type:Object,default:()=>({message:"",time:null,type:"error",actions:[],closeButton:!0})},index:{type:Number,default:null}},data(){return{timer:null,displayTimer:null,countDownInterval:null}},async mounted(){this.notification&&(this.notification.time&&await this.addTimer(this.notification.time),this.notification.type==="countdown"&&this.startCountDown(Math.round(this.notification.time/1e3)))},beforeUnmount(){this.countDownInterval&&this.stopCountDown()},methods:{close(){k1(this.index)},async addTimer(e){if(typeof this.notification.time=="function"){await this.notification.time()==="close"&&this.close();return}const t=()=>k1(this.index);this.timer=setTimeout(t,e)},clearTimer(){this.timer&&clearTimeout(this.timer)},onMouseOver(){this.clearTimer()},onMouseOut(){this.notification.time,this.addTimer(3e3)},onActionClick(e){vV({index:this.index,type:e}),k1(this.index)},startCountDown(e){this.displayTimer=e,this.countDownInterval=setInterval(()=>{this.displayTimer===0&&this.stopCountDown(),this.displayTimer-=1},1e3)},stopCountDown(){clearInterval(this.countDownInterval)}}},Jve={class:"mr-3 mt-px block font-semibold"},Zve={key:0,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Xve={key:1,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Qve={key:2,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},e2e={key:4,xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},t2e={class:"flex-auto text-sm"},n2e={key:0,class:"countdown-text ml-5 font-medium"},r2e={key:1,class:"w-4"};function i2e(e,t,n,r,i,o){const s=A("Spinner"),a=A("CIcon");return v(),V(Cn,{appear:"","enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"translate-y-full opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-all duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"translate-y-full opacity-0"},{default:E(()=>[b("div",{class:ne([[n.notification.type],"pointer-events-none fixed bottom-4 left-1/2 z-[2147483647] flex w-full -translate-x-1/2 justify-center"])},[b("div",{class:ne([["notification",n.notification.type,n.notification.closeButton||Object.keys(n.notification.actions||{}).length?"pr-2":"pr-5",{"bg-green-600":n.notification.type==="success","bg-red-500":n.notification.type==="error","bg-orange-600":n.notification.type==="warning","bg-primary-500":!["success","error","warning"].includes(n.notification.type)}],"pointer-events-auto z-[100] flex h-11 items-center rounded-lg pl-4 font-medium leading-none text-white"]),style:{"max-width":"calc(100% - calc(2 * var(--rem)))"},onMouseOver:t[3]||(t[3]=(...l)=>o.onMouseOver&&o.onMouseOver(...l)),onMouseLeave:t[4]||(t[4]=(...l)=>o.onMouseOut&&o.onMouseOut(...l))},[b("div",Jve,[n.notification.type==="success"?(v(),x("svg",Zve,t[5]||(t[5]=[b("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"},null,-1)]))):n.notification.type==="error"?(v(),x("svg",Xve,t[6]||(t[6]=[b("polygon",{points:"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"},null,-1),b("line",{x1:"12",y1:"8",x2:"12",y2:"12"},null,-1),b("line",{x1:"12",y1:"16",x2:"12",y2:"16"},null,-1)]))):n.notification.type==="warning"?(v(),x("svg",Qve,t[7]||(t[7]=[b("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"},null,-1),b("line",{x1:"12",y1:"9",x2:"12",y2:"13"},null,-1),b("line",{x1:"12",y1:"17",x2:"12",y2:"17"},null,-1)]))):["spinner","countdown"].includes(n.notification.type)?(v(),V(s,{key:3,size:"18px",color:"white","stroke-width":8})):(v(),x("svg",e2e,t[8]||(t[8]=[b("path",{d:"M22 17H2a3 3 0 0 0 3-3V9a7 7 0 0 1 14 0v5a3 3 0 0 0 3 3zm-8.27 4a2 2 0 0 1-3.46 0"},null,-1)])))]),b("div",t2e,C(n.notification.message),1),n.notification.type==="countdown"?(v(),x("div",n2e,C(e.$t("time.secondsLeft",{time:i.displayTimer})),1)):R("",!0),Object.keys(n.notification.actions||{}).length?(v(),x("div",r2e)):R("",!0),n.notification.actions&&n.notification.actions.submit?(v(),x("div",{key:2,class:"font-sm ml-1 cursor-pointer rounded-md bg-white/20 px-3 py-2 font-semibold leading-none text-white transition-all hover:bg-white/30 active:scale-95",onClick:t[0]||(t[0]=Ie(l=>o.onActionClick("submit"),["prevent"]))},C(n.notification.actions.submit.text),1)):R("",!0),n.notification.actions&&n.notification.actions.undo?(v(),x("div",{key:3,class:"font-sm ml-1 cursor-pointer rounded-md bg-white/20 px-3 py-2 font-semibold leading-none text-white transition-all hover:bg-white/30 active:scale-95",onClick:t[1]||(t[1]=Ie(l=>o.onActionClick("undo"),["prevent"]))},C(n.notification.actions.undo.text||e.$t("undo")),1)):R("",!0),n.notification.closeButton?(v(),x("div",{key:4,class:"ml-1 flex cursor-pointer items-center justify-center rounded-full p-2 text-white transition-all hover:bg-white/30 active:scale-95",onClick:t[2]||(t[2]=Ie((...l)=>o.close&&o.close(...l),["prevent"]))},[T(a,{type:"x",size:"14"})])):R("",!0)],34)],2)]),_:1})}const o2e={name:"UserMessages",components:{Notification:X(Yve,[["render",i2e]]),Dialog:Gve},props:{disableNotification:{type:Boolean,default:!1},disableDialog:{type:Boolean,default:!1}},computed:{notification(){const{messages:e}=bV,t=e.findIndex(n=>n.displayType==="notification");return t!==-1&&{index:t,data:e[t]}},dialog(){const{messages:e}=bV,t=e.findIndex(n=>n.displayType==="dialog");return t!==-1&&{index:t,data:e[t]}}}};function s2e(e,t,n,r,i,o){const s=A("Notification"),a=A("Dialog");return v(),x("div",null,[o.notification&&!n.disableNotification?(v(),V(s,{key:o.notification.data&&o.notification.data._uniqueId,notification:o.notification.data,index:o.notification.index},null,8,["notification","index"])):R("",!0),o.dialog&&!n.disableDialog?(v(),V(a,{key:o.dialog.data&&o.dialog.data._uniqueId,dialog:o.dialog.data,index:o.dialog.index},null,8,["dialog","index"])):R("",!0)])}const a2e=X(o2e,[["render",s2e]]);function AV(e,t,n){const r=document.createDocumentFragment();for(const o of t)Ux(n,o),r.appendChild(o);e.attachShadow({mode:"open"}).appendChild(r)}function l2e(e,t){AV(e,e.childNodes,t)}const c2e=$e({props:{abstract:{type:Boolean,default:!1},static:{type:Boolean,default:!1},tag:{type:String,default:"div"},slotTag:{type:String,default:"div"},slotClass:{type:String,default:""},slotId:{type:String,default:""},styleVars:{type:Object,default:()=>({})}},emits:["error"],setup(e,{emit:t,slots:n}){const r=Pe(e.abstract),i=Pe(e.static),o=xge();return fr(()=>{try{r.value?AV(o.value.parentElement,o.value.childNodes,e.styleVars):l2e(o.value,e.styleVars)}catch(s){console.error(s),t("error",s)}}),()=>{var s,a;return mn(e.tag,{},[i.value?(s=n.default)==null?void 0:s.call(n):mn(e.slotTag,{id:e.slotId,class:e.slotClass},(a=n.default)==null?void 0:a.call(n))])}}});var x1={exports:{}},d2e=x1.exports,MV;function u2e(){return MV||(MV=1,function(e,t){(function(n,r){r(t)})(d2e,function(n){var r="smooth-dnd-container-instance",i="smooth-dnd-draggable-wrapper",o="animated",s="__smooth_dnd_draggable_translation_value",a="__smooth_dnd_draggable_visibility_value",l="smooth-dnd-ghost",c="smooth-dnd-container",d="smooth-dnd-extra-size-for-insertion",u="smooth-dnd-stretcher-element",p="smooth-dnd-stretcher-instance",f="smooth-dnd-disable-touch-action",h="smooth-dnd-no-user-select",m="smooth-dnd-prevent-auto-scroll-class",g="smooth-dnd-drop-preview-default-class",y="smooth-dnd-drop-preview-inner-class",w="smooth-dnd-drop-preview-constant-class",k="smooth-dnd-drop-preview-flex-container-class",_=Object.freeze({containerInstance:r,defaultGroupName:"@@smooth-dnd-default-group@@",wrapperClass:i,defaultGrabHandleClass:"smooth-dnd-default-grap-handle",animationClass:o,translationValue:s,visibilityValue:a,ghostClass:l,containerClass:c,extraSizeForInsertion:d,stretcherElementClass:u,stretcherElementInstance:p,isDraggableDetached:"smoth-dnd-is-draggable-detached",disbaleTouchActions:f,noUserSelectClass:h,preventAutoScrollClass:m,dropPlaceholderDefaultClass:g,dropPlaceholderInnerClass:y,dropPlaceholderWrapperClass:w,dropPlaceholderFlexContainerClass:k}),M={groupName:void 0,behaviour:"move",orientation:"vertical",getChildPayload:void 0,animationDuration:250,autoScrollEnabled:!0,shouldAcceptDrop:void 0,shouldAnimateDrop:void 0};function S(G){return(S=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j})(G)}function O(G,j,W){(j=function(Y){return Y=function(de,pe){if(typeof de!="object"||de===null)return de;var ve=de[Symbol.toPrimitive];if(ve===void 0)return(pe==="string"?String:Number)(de);if(ve=ve.call(de,pe),typeof ve!="object")return ve;throw new TypeError("@@toPrimitive must return a primitive value.")}(Y,"string"),typeof Y=="symbol"?Y:String(Y)}(j))in G?Object.defineProperty(G,j,{value:W,enumerable:!0,configurable:!0,writable:!0}):G[j]=W}function P(G){return function(j){if(Array.isArray(j))return I(j)}(G)||function(j){if(typeof Symbol<"u"&&j[Symbol.iterator]!=null||j["@@iterator"]!=null)return Array.from(j)}(G)||function(j,W){var Y;if(j)return typeof j=="string"?I(j,W):(Y=(Y=Object.prototype.toString.call(j).slice(8,-1))==="Object"&&j.constructor?j.constructor.name:Y)==="Map"||Y==="Set"?Array.from(j):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?I(j,W):void 0}(G)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
258
258
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function I(G,j){(j==null||j>G.length)&&(j=G.length);for(var W=0,Y=new Array(j);W<j;W++)Y[W]=G[W];return Y}function L(G,j){return{left:Math.max(G.left,j.left),top:Math.max(G.top,j.top),right:Math.min(G.right,j.right),bottom:Math.min(G.bottom,j.bottom)}}function $(G){var j=(G=window.getComputedStyle(G)).overflow;return j==="auto"||j==="scroll"||(j=G["overflow-x"],G=(G=G["overflow-y"])==="auto"||G==="scroll",(j=j==="auto"||j==="scroll")&&G)?te.xy:j?te.x:G?te.y:null}function F(Y,j){var W=(Y=window.getComputedStyle(Y)).overflow,Y=Y["overflow-".concat(j)];return W==="auto"||W==="scroll"||Y==="auto"||Y==="scroll"}function U(G,j){for(var Y=G,W=j||Me(G),Y=G.parentElement;Y;)Ze(Y,"x")&&Ue(Y,"x")&&(W=he(W,Y.getBoundingClientRect(),"x")),Ze(Y,"y")&&Ue(Y,"y")&&(W=he(W,Y.getBoundingClientRect(),"y")),Y=Y.parentElement;return W}function q(G,j){for(var W=G;W;){var Y=function(){if(W[r]){var de=W[r];if(j.some(function(pe){return pe===de}))return{v:de}}W=W.parentElement}();if(S(Y)==="object")return Y.v}return null}function z(G,j){for(var W=G;W;){if(W.matches(j))return W;W=W.parentElement}return null}function D(G,j){return-1<G.className.split(" ").map(function(W){return W}).indexOf(j)}function N(G,j){var W;G&&(W=G.className.split(" ").filter(function(Y){return Y})).indexOf(j)===-1&&(W.unshift(j),G.className=W.join(" "))}function B(G,j){var W;G&&(W=G.className.split(" ").filter(function(Y){return Y&&Y!==j}),G.className=W.join(" "))}function Q(){window.getSelection?window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges():window.document.selection&&window.document.selection.empty()}var te=function(G){return G.x="x",G.y="y",G.xy="xy",G}({}),he=function(G,j,W){return W==="x"?{left:Math.max(G.left,j.left),top:G.top,right:Math.min(G.right,j.right),bottom:G.bottom}:{left:G.left,top:Math.max(G.top,j.top),right:G.right,bottom:Math.min(G.bottom,j.bottom)}},Me=function(G){var j=G.getBoundingClientRect(),j={left:j.left,right:j.right,top:j.top,bottom:j.bottom};return Ze(G,"x")&&!Ue(G,"x")&&(j.right=j.right+G.scrollWidth-(j.right-j.left)),Ze(G,"y")&&!Ue(G,"y")&&(j.bottom=j.bottom+G.scrollHeight-(j.bottom-j.top)),j},Ue=function(Y,j){var Y=window.getComputedStyle(Y),W=Y.overflow,Y=Y["overflow-".concat(j)];return W==="auto"||W==="scroll"||W==="hidden"||Y==="auto"||Y==="scroll"||Y==="hidden"},Ze=function(G,j){return j==="x"?G.scrollWidth>G.clientWidth:G.scrollHeight>G.clientHeight},qe=function(G,j){for(var W=[],Y=G;Y;)(F(Y,"x")||F(Y,"y"))&&W.push(Y),Y=Y.parentElement;function de(){W&&(W.forEach(function(pe){return pe.removeEventListener("scroll",j)}),window.removeEventListener("scroll",j))}return{dispose:function(){de(),W=null},start:function(){W&&(W.forEach(function(pe){return pe.addEventListener("scroll",j)}),window.addEventListener("scroll",j))},stop:de}},rt=function(G){return G&&(G=window.getComputedStyle(G),G)?G.cursor:null};function oe(G){return!(G.bottom<=G.top||G.right<=G.left)}var ge=function(G){return G=G.getRootNode?G.getRootNode():null,G&&G.toString&&G.toString()==="[object ShadowRoot]"?G:window.document};function Ae(G){var j=G.element,W=G.draggables;return function(Y,de){var pe,ve=Y.removedIndex,we=Y.addedIndex,ae=Y.droppedElement,le=null;ve!==null&&(le=j.removeChild(j.children[ve]),W.splice(ve,1)),we!==null&&((ve=window.document.createElement("div")).className="".concat(i),ve.appendChild(le&&le.firstElementChild?le.firstElementChild:ae),le=ve,(ae=we)>=(pe=j).children.length?pe.appendChild(le):pe.insertBefore(le,pe.children[ae]),we>=W.length?W.push(ve):W.splice(we,0,ve)),de&&de(Y)}}var ke=Object.freeze({domDropHandler:Ae,reactDropHandler:function(){return{handler:function(){return function(G,j){j&&j(G)}}}}}),Xe={size:"offsetWidth",distanceToParent:"offsetLeft",translate:"transform",begin:"left",end:"right",dragPosition:"x",scrollSize:"scrollWidth",offsetSize:"offsetWidth",scrollValue:"scrollLeft",scale:"scaleX",setSize:"width",setters:{translate:function(G){return"translate3d(".concat(G,"px, 0, 0)")}}},ht={size:"offsetHeight",distanceToParent:"offsetTop",translate:"transform",begin:"top",end:"bottom",dragPosition:"y",scrollSize:"scrollHeight",offsetSize:"offsetHeight",scrollValue:"scrollTop",scale:"scaleY",setSize:"height",setters:{translate:function(G){return"translate3d(0,".concat(G,"px, 0)")}}};function K(G){return{get:function(j,W){return j[G[W]||W]},set:function(j,W,Y){j[G[W]]=G.setters[W]?G.setters[W](Y):Y}}}function Z(G,j){G[d]=0;var W=K(j==="horizontal"?Xe:ht),Y={translation:0};function de(){var ae,le;pe(G),le=(ae=G).getBoundingClientRect(),Y.scaleX=ae.offsetWidth?(le.right-le.left)/ae.offsetWidth:1,Y.scaleY=ae.offsetHeight?(le.bottom-le.top)/ae.offsetHeight:1}function pe(ae){Y.rect=Me(ae),ae=U(ae,Y.rect),oe(ae)&&(Y.lastVisibleRect=Y.visibleRect),Y.visibleRect=ae}function ve(ae){var le=ae;return le.tagName?(le=le.getBoundingClientRect(),j==="vertical"?le.bottom-le.top:le.right-le.left):W.get(ae,"size")*W.get(Y,"scale")}function we(ae){return W.get(ae,"dragPosition")}return window.addEventListener("resize",function(){pe(G)}),setTimeout(function(){de()},10),{getSize:ve,getContainerRectangles:function(){return{rect:Y.rect,visibleRect:Y.visibleRect,lastVisibleRect:Y.lastVisibleRect}},getBeginEndOfDOMRect:function(ae){return{begin:W.get(ae,"begin"),end:W.get(ae,"end")}},getBeginEndOfContainer:function(){return{begin:W.get(Y.rect,"begin")+Y.translation,end:W.get(Y.rect,"end")+Y.translation}},getBeginEndOfContainerVisibleRect:function(){return{begin:W.get(Y.visibleRect,"begin")+Y.translation,end:W.get(Y.visibleRect,"end")+Y.translation}},getBeginEnd:function(ae){le=ae;var le=(W.get(le,"distanceToParent")+(le[s]||0))*W.get(Y,"scale")+(W.get(Y.rect,"begin")+Y.translation)-W.get(G,"scrollValue");return{begin:le,end:le+ve(ae)*W.get(Y,"scale")}},getAxisValue:we,setTranslation:function(ae,le){le?W.set(ae.style,"translate",le):ae.style.removeProperty("transform"),ae[s]=le},getTranslation:function(ae){return ae[s]},setVisibility:function(ae,le){ae[a]!==void 0&&ae[a]===le||(le?ae.style.removeProperty("visibility"):ae.style.visibility="hidden",ae[a]=le)},isVisible:function(ae){return ae[a]===void 0||ae[a]},isInVisibleRect:function(ae,le){var Fe=Y.visibleRect,Qe=Fe.left,Vt=Fe.top,gt=Fe.right,Bt=((Fe=Fe.bottom)-Vt<2&&(Fe=Vt+30),Y.rect);return j==="vertical"?ae>Bt.left&&ae<Bt.right&&Vt<le&&le<Fe:Qe<ae&&ae<gt&&le>Bt.top&&le<Bt.bottom},setSize:function(ae,le){W.set(ae,"setSize",le)},getTopLeftOfElementBegin:function(ae){var le=0;return{top:j==="horizontal"?(le=ae,Y.rect.top):(le=Y.rect.left,ae),left:le}},getScrollSize:function(ae){return W.get(ae,"scrollSize")},getScrollValue:function(ae){return W.get(ae,"scrollValue")},setScrollValue:function(ae,le){return W.set(ae,"scrollValue",le)},invalidate:de,invalidateRects:function(){pe(G)},getPosition:we,setBegin:function(ae,le){W.set(ae,"begin",le)}}}var ie=1500;function xe(Fe,j,ae){var Y,de,pe=ae.left,ve=ae.right,we=ae.top,ae=ae.bottom,le=Fe.x,Fe=Fe.y;return le<pe||ve<le||Fe<we||ae<Fe?null:(j=j==="x"?(Y=pe,de=ve,le):(Y=we,de=ae,Fe),de-j<(ve=400<(pe=de-Y)?100:pe/4)?{direction:"end",speedFactor:(ve-(de-j))/ve}:j-Y<ve?{direction:"begin",speedFactor:(ve-(j-Y))/ve}:null)}function ue(G,j,W){G&&(G!==window?j==="x"?G.scrollLeft+=W:G.scrollTop+=W:j==="x"?G.scrollBy(W,0):G.scrollBy(0,W))}function Ce(G){var j=1<arguments.length&&arguments[1]!==void 0?arguments[1]:"y",W=null,Y=null,de=null,pe=null;return{animate:function(ve,we){de=ve,pe=we,function ae(){W===null&&(W=requestAnimationFrame(function(Qe){var Fe=Qe-(Y=Y===null?Qe:Y),Qe=(Y=Qe,Fe/1e3*pe);ue(G,j,Qe=de==="begin"?0-Qe:Qe),W=null,ae()}))}()},stop:function(){W!==null&&(cancelAnimationFrame(W),W=null),Y=null}}}function Ne(G){for(var j=[],W=G.element;W;){var Y=$(W);if(Y&&!D(W,m)){var de={};switch(Y){case te.xy:de.x={animator:Ce(W,"x")},de.y={animator:Ce(W,"y")};break;case te.x:de.x={animator:Ce(W,"x")};break;case te.y:de.y={animator:Ce(W,"y")}}j.push({axisAnimations:de,getRect:function(pe){return function(){return U(pe,pe.getBoundingClientRect())}}(W),scrollerElement:W})}W=W.parentElement}return j}function Re(G){var j=1<arguments.length&&arguments[1]!==void 0?arguments[1]:ie,W=G.reduce(function(Y,de){return de=Ne(de).filter(function(pe){return!Y.find(function(ve){return ve.scrollerElement===pe.scrollerElement})}),[].concat(P(Y),P(de))},[]);return function(Y){var de,pe,ve=Y.draggableInfo;Y.reset?W.forEach(function(we){we.axisAnimations.x&&we.axisAnimations.x.animator.stop(),we.axisAnimations.y&&we.axisAnimations.y.animator.stop()}):ve&&(pe=ve.mousePosition,W.forEach(function(we){var ae=we.axisAnimations,le=(0,we.getRect)();ae.x&&(ae.x.scrollParams=xe(pe,"x",le),we.cachedRect=le),ae.y&&(ae.y.scrollParams=xe(pe,"y",le),we.cachedRect=le)}),W.forEach(function(Qe){var ae,le,Qe=Qe.axisAnimations,Fe=Qe.x,Qe=Qe.y;Fe&&(Fe.scrollParams?(ae=(le=Fe.scrollParams).direction,le=le.speedFactor,Fe.animator.animate(ae,le*j)):Fe.animator.stop()),Qe&&(Qe.scrollParams?(le=(ae=Qe.scrollParams).direction,Fe=ae.speedFactor,Qe.animator.animate(le,Fe*j)):Qe.animator.stop())}),(Y=W.filter(function(we){return we.cachedRect})).length)&&1<Y.length&&(de=function(we,ae){for(var le=ge(we[0].scrollerElement).elementFromPoint(ae.x,ae.y);le;){var Fe=we.find(function(Qe){return Qe.scrollerElement===le});if(Fe)return Fe;le=le.parentElement}return null}(Y,ve.mousePosition))&&Y.forEach(function(we){we!==de&&(we.axisAnimations.x&&we.axisAnimations.x.animator.stop(),we.axisAnimations.y)&&we.axisAnimations.y.animator.stop()})}}typeof window<"u"&&((Ee=Element)&&Ee.prototype&&!Ee.prototype.matches&&(Ee.prototype.matches=Ee.prototype.matchesSelector||Ee.prototype.mozMatchesSelector||Ee.prototype.msMatchesSelector||Ee.prototype.oMatchesSelector||Ee.prototype.webkitMatchesSelector||function(G){for(var j=(this.document||this.ownerDocument).querySelectorAll(G),W=j.length;0<=--W&&j.item(W)!==this;);return-1<W}),(Ee=Node||Element)&&Ee.prototype&&Ee.prototype.firstElementChild==null&&Object.defineProperty(Ee.prototype,"firstElementChild",{get:function(){for(var G,j=this.childNodes,W=0;G=j[W++];)if(G.nodeType===1)return G;return null}}),Array.prototype.some||(Array.prototype.some=function(G){if(this==null)throw new TypeError("Array.prototype.some called on null or undefined");if(typeof G!="function")throw new TypeError;for(var j=Object(this),W=j.length>>>0,Y=2<=arguments.length?arguments[1]:void 0,de=0;de<W;de++)if(de in j&&G.call(Y,j[de],de,j))return!0;return!1}));var Ee={overflow:"hidden",display:"block"},_e={height:"100%",display:"table-cell","vertical-align":"top"},_e=(O(ar={},".".concat(c),{position:"relative","min-height":"30px","min-width":"30px"}),O(ar,".".concat(c,".horizontal"),{display:"table"}),O(ar,".".concat(c,".horizontal > .").concat(u),{display:"inline-block"}),O(ar,".".concat(c,".horizontal > .").concat(i),_e),O(ar,".".concat(c,".vertical > .").concat(i),Ee),O(ar,".".concat(i),{"box-sizing":"border-box"}),O(ar,".".concat(i,".horizontal"),_e),O(ar,".".concat(i,".vertical"),Ee),O(ar,".".concat(i,".animated"),{transition:"transform ease"}),O(ar,".".concat(l),{"box-sizing":"border-box"}),O(ar,".".concat(l,".animated"),{transition:"all ease-in-out"}),O(ar,".".concat(l," *"),{"pointer-events":"none"}),O(ar,".".concat(f," *"),{"touch-action":"none","-ms-touch-action":"none"}),O(ar,".".concat(h),{"-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"}),O(ar,".".concat(y),{flex:"1"}),O(ar,".".concat(c,".horizontal > .").concat(w),{height:"100%",overflow:"hidden",display:"table-cell","vertical-align":"top"}),O(ar,".".concat(c,".vertical > .").concat(w),{overflow:"hidden",display:"block",width:"100%"}),O(ar,".".concat(k),{width:"100%",height:"100%",display:"flex","justify-content":"stretch","align-items":"stretch"}),O(ar,".".concat(g),{"background-color":"rgba(150, 150, 150, 0.1)",border:"1px solid #ccc"}),ar);function Ge(G){return Object.keys(G).reduce(function(j,W){var Y=G[W];return S(Y)==="object"?"".concat(j).concat(W,"{").concat(Ge(Y),"}"):"".concat(j).concat(W,":").concat(Y,";")},"")}function Ve(G){var j,W;return G&&typeof window<"u"?(j=window.document.head||window.document.getElementsByTagName("head")[0],W=window.document.createElement("style"),G=Ge({"body *":{cursor:"".concat(G," !important")}}),W.type="text/css",W.styleSheet?W.styleSheet.cssText=G:W.appendChild(window.document.createTextNode(G)),j.appendChild(W),W):null}var Je,st,Ot=["mousedown","touchstart"],Pt=["mousemove","touchmove"],Ut=["mouseup","touchend"],qt=null,vn=null,Ct=null,He=null,fe=[],Ke=!1,tt=!1,St=!1,Lt=!1,sr=null,Hn=null,ns=null,Od=null,$a=(Je=null,st=!1,{start:function(){st||(st=!0,function G(){Je=requestAnimationFrame(function(){qt.forEach(function(j){return j.layout.invalidateRects()}),setTimeout(function(){Je!==null&&G()},50)})}())},stop:function(){Je!==null&&(cancelAnimationFrame(Je),Je=null),st=!1}}),b0=typeof window<"u"&&!!(window.navigator.userAgent.match(/Android/i)||window.navigator.userAgent.match(/webOS/i)||window.navigator.userAgent.match(/iPhone/i)||window.navigator.userAgent.match(/iPad/i)||window.navigator.userAgent.match(/iPod/i)||window.navigator.userAgent.match(/BlackBerry/i)||window.navigator.userAgent.match(/Windows Phone/i));function Yf(G){var j;typeof window<"u"&&(j=ge(G),Ot.forEach(function(W){j.addEventListener(W,a3t,{passive:!1})}))}function Nl(){return He&&He.ghostParent?He.ghostParent:vn&&vn.parentElement||window.document.body}function NM(G){function j(){B(Ct.ghost,"animated"),Ct.ghost.style.transitionDuration=null,Nl().removeChild(Ct.ghost),G()}function W(gt,Fe,Qe){var Vt=gt.top,gt=gt.left;N(Ct.ghost,"animated"),Qe&&N(Ct.ghost.firstElementChild,Qe),Ct.topLeft.x=gt,Ct.topLeft.y=Vt,jM(Fe),setTimeout(function(){j()},Fe+20)}function Y(le,Fe){N(Ct.ghost,"animated"),jM(le,.9,!0),setTimeout(function(){Fe()},le+20)}var de,pe,ve,we,ae;He.targetElement?(de=fe.filter(function(le){return le.element===He.targetElement})[0],!(ae=de.getOptions()).shouldAnimateDrop||ae.shouldAnimateDrop(He.container.getOptions(),He.payload)?W(de.getDragResult().shadowBeginEnd.rect,Math.max(150,de.getOptions().animationDuration/2),de.getOptions().dropClass):j()):(ae=fe.filter(function(le){return le===He.container})[0])?(pe=(de=ae.getOptions()).behaviour,we=de.removeOnDropOut,pe!=="move"&&pe!=="contain"||!tt&&we||!ae.getDragResult()?Y(ae.getOptions().animationDuration,j):!oe((pe=ae.layout.getContainerRectangles()).visibleRect)&&oe(pe.lastVisibleRect)?W({top:pe.lastVisibleRect.top,left:pe.lastVisibleRect.left},ae.getOptions().animationDuration,ae.getOptions().dropClass):(pe=(we=ae.getDragResult()).removedIndex,we=we.elementSize,ve=ae.layout,ae.getTranslateCalculator({dragResult:{removedIndex:pe,addedIndex:pe,elementSize:we,pos:void 0,shadowBeginEnd:void 0}}),we=0<pe?ve.getBeginEnd(ae.draggables[pe-1]).end:ve.getBeginEndOfContainer().begin,W(ve.getTopLeftOfElementBegin(we),ae.getOptions().animationDuration,ae.getOptions().dropClass))):Y(M.animationDuration,j)}FM=1,VM=5;var Fl,Vl,Zre,y4,FM,VM,s3t=function(G,j,W){var Y;Fl=b4(G),Vl=typeof j=="number"?j:b0?200:0,Zre=W,Y=ge(G.target),Vl&&(y4=setTimeout(function(){return tie(Y)},Vl)),Pt.forEach(function(de){return Y.addEventListener(de,Xre)},{passive:!1}),Ut.forEach(function(de){return Y.addEventListener(de,Qre)},{passive:!1}),Y.addEventListener("drag",eie,{passive:!1})};function Xre(G){var W=b4(G),j=W.clientX,W=W.clientY;if(Vl)(Math.abs(Fl.clientX-j)>VM||Math.abs(Fl.clientY-W)>VM)&&v4(G.target);else if(Math.abs(Fl.clientX-j)>FM||Math.abs(Fl.clientY-W)>FM)return tie(G.target)}function Qre(G){v4(G.target)}function eie(G){v4(G.target)}function v4(G){clearTimeout(y4),Pt.forEach(function(j){return ge(G).removeEventListener(j,Xre)},{passive:!1}),Ut.forEach(function(j){return ge(G).removeEventListener(j,Qre)},{passive:!1}),ge(G).removeEventListener("drag",eie,{passive:!1})}function tie(G){clearTimeout(y4),v4(G),Zre()}function a3t(G){var j,W,Y,de,pe,ve=b4(G);Ke||ve.button!==void 0&&ve.button!==0||(vn=z(ve.target,"."+i))&&(j=z(vn,"."+c),pe=(W=fe.filter(function(we){return we.element===j})[0]).getOptions().dragHandleSelector,Y=W.getOptions().nonDragAreaSelector,de=!0,pe&&!z(ve.target,pe)&&(de=!1),(de=Y&&z(ve.target,Y)?!1:de)&&(W.layout.invalidate(),N(window.document.body,f),N(window.document.body,h),pe=function we(){B(window.document.body,f),B(window.document.body,h),ge(ve.target).removeEventListener("mouseup",we)},ge(ve.target).addEventListener("mouseup",pe)),de)&&s3t(ve,W.getOptions().dragBeginDelay,function(){var we,ae,le;Q(),lie(ve,rt(G.target)),ae=G.target,we=ge(ae),Pt.forEach(function(Fe){we.addEventListener(Fe,nie,{passive:!1})}),ae=G.target,le=ge(ae),Ut.forEach(function(Fe){le.addEventListener(Fe,BM,{passive:!1})})})}function nie(G){G.preventDefault();var j,W=b4(G);He?((j=He.container.getOptions()).behaviour==="contain"?function(Qe,le){var pe,ve,we,Fe=Qe.clientX,Qe=Qe.clientY,le=1<arguments.length&&le!==void 0?le:"vertical",ae=He.container.layout.getBeginEndOfContainerVisibleRect(),le=le==="vertical"?(pe=Qe,ve="y",we="top",He.size.offsetHeight):(pe=Fe,ve="x",we="left",He.size.offsetWidth),Qe=ae.begin,Fe=ae.end-le,Qe=Math.max(Qe,Math.min(Fe,pe+Ct.positionDelta[we]));Ct.topLeft[ve]=Qe,He.position[ve]=Math.max(ae.begin,Math.min(ae.end,pe+Ct.centerDelta[ve])),He.mousePosition[ve]=Math.max(ae.begin,Math.min(ae.end,pe)),He.position[ve]<ae.begin+le/2&&(He.position[ve]=ae.begin+2),He.position[ve]>ae.end-le/2&&(He.position[ve]=ae.end-2)}(W,j.orientation):ns?ns==="y"?(Ct.topLeft.y=W.clientY+Ct.positionDelta.top,He.position.y=W.clientY+Ct.centerDelta.y,He.mousePosition.y=W.clientY):ns==="x"&&(Ct.topLeft.x=W.clientX+Ct.positionDelta.left,He.position.x=W.clientX+Ct.centerDelta.x,He.mousePosition.x=W.clientX):(Ct.topLeft.x=W.clientX+Ct.positionDelta.left,Ct.topLeft.y=W.clientY+Ct.positionDelta.top,He.position.x=W.clientX+Ct.centerDelta.x,He.position.y=W.clientY+Ct.centerDelta.y,He.mousePosition.x=W.clientX,He.mousePosition.y=W.clientY),jM(),(Lt=!sr(He))&&l3t()):lie(W,rt(G.target))}w0=oie,iie=!(rie=20);var w0,rie,iie,Jf,l3t=function(){for(var G=arguments.length,j=new Array(G),W=0;W<G;W++)j[W]=arguments[W];Jf&&clearTimeout(Jf),iie&&!Jf?w0.call.apply(w0,[null].concat(j)):Jf=setTimeout(function(){Jf=null,w0.call.apply(w0,[null].concat(j))},rie)};function oie(){Lt&&(Lt=!1,sie(He,qt))}function BM(G){var j,W;j=ge(G),Pt.forEach(function(Y){j.removeEventListener(Y,nie,{passive:!1})}),W=ge(G),Ut.forEach(function(Y){W.removeEventListener(Y,BM,{passive:!1})}),Hn({reset:!0}),Od&&((G=Od)&&typeof window<"u"&&(window.document.head||window.document.getElementsByTagName("head")[0]).removeChild(G),Od=null),He&&($a.stop(),oie(),St=!0,NM(function(){aie(Ke=!1);for(var Y=qt||[],de=Y.shift();de!==void 0;)de.handleDrop(He),de=Y.shift();sr=ns=He=Ct=vn=qt=null,St=!1}))}function b4(G){return G.touches?G.touches[0]:G}function sie(G,j){var W=!1;j.forEach(function(Y){Y=Y.handleDrag(G),W=!!Y.containerBoxChanged||!1,Y.containerBoxChanged=!1}),W&&(W=!1,requestAnimationFrame(function(){fe.forEach(function(Y){Y.layout.invalidateRects(),Y.onTranslated()})}))}function zM(G){var j=G,W=null;return function(Y){return!(W!==null||!Ke||St||(W=requestAnimationFrame(function(){Ke&&!St&&(sie(Y,j),Hn({draggableInfo:Y})),W=null}),0))}}function UM(G,j){return G.getOptions().autoScrollEnabled?Re(j,G.getScrollMaxSpeed()):function(W){return null}}function aie(G){fe.forEach(function(j){var W,Y=G?j.getOptions().onDragStart:j.getOptions().onDragEnd;Y&&(W={isSource:j===He.container,payload:He.payload},j.isDragRelevant(He.container,He.payload)?W.willAcceptDrop=!0:W.willAcceptDrop=!1,Y(W))})}function lie(G,j){var W,Y,de,pe,ve,we,ae,le,Fe,Qe,Vt,gt,Bt;vn!==null&&(Ke=!0,(W=fe.filter(function(Rn){return vn.parentElement===Rn.element})[0]).setDraggables(),ns=W.getOptions().lockAxis?W.getOptions().lockAxis.toLowerCase():null,Fe=vn,Qe=fe.filter(function(Rn){return Fe.parentElement===Rn.element})[0],Vt=Qe.draggables.indexOf(Fe),gt=Qe.getOptions().getGhostParent,Bt=Fe.getBoundingClientRect(),He={container:Qe,element:Fe,size:{offsetHeight:Bt.bottom-Bt.top,offsetWidth:Bt.right-Bt.left},elementIndex:Vt,payload:Qe.getOptions().getChildPayload?Qe.getOptions().getChildPayload(Vt):void 0,targetElement:null,position:{x:0,y:0},groupName:Qe.getOptions().groupName,ghostParent:gt?gt():null,invalidateShadow:null,mousePosition:null,relevantContainers:null},Bt=vn,Vt={x:G.clientX,y:G.clientY},Y=He.container,Qe=j,gt=Vt.x,Vt=Vt.y,de=(j=Bt.getBoundingClientRect()).left,pe=j.top,ve=j.right,we=j.bottom,ae=(j=L(Y.layout.getContainerRectangles().visibleRect,j)).left+(j.right-j.left)/2,j=j.top+(j.bottom-j.top)/2,(le=Bt.cloneNode(!0)).style.zIndex="1000",le.style.boxSizing="border-box",le.style.position="fixed",le.style.top="0px",le.style.left="0px",le.style.transform="",le.style.removeProperty("transform"),Y.shouldUseTransformForGhost()?le.style.transform="translate3d(".concat(de,"px, ").concat(pe,"px, 0)"):(le.style.top="".concat(pe,"px"),le.style.left="".concat(de,"px")),le.style.width=ve-de+"px",le.style.height=we-pe+"px",le.style.overflow="visible",le.style.transition=null,le.style.removeProperty("transition"),le.style.pointerEvents="none",le.style.userSelect="none",Y.getOptions().dragClass?setTimeout(function(){N(le.firstElementChild,Y.getOptions().dragClass);var Rn=window.getComputedStyle(le.firstElementChild).cursor;Od=Ve(Rn)}):Od=Ve(Qe),N(le,Y.getOptions().orientation||"vertical"),N(le,l),Ct={ghost:le,centerDelta:{x:ae-gt,y:j-Vt},positionDelta:{left:de-gt,top:pe-Vt},topLeft:{x:de,y:pe}},He.position={x:G.clientX+Ct.centerDelta.x,y:G.clientY+Ct.centerDelta.y},He.mousePosition={x:G.clientX,y:G.clientY},qt=fe.filter(function(Rn){return Rn.isDragRelevant(W,He.payload)}),He.relevantContainers=qt,sr=zM(qt),Hn&&Hn({reset:!0,draggableInfo:void 0}),Hn=UM(W,qt),qt.forEach(function(Rn){return Rn.prepareDrag(Rn,qt)}),aie(!0),sr(He),Nl().appendChild(Ct.ghost),$a.start())}var ar,Zf,w4=Jf=y4=null;function jM(Y,de,we){var Y=0<arguments.length&&Y!==void 0?Y:0,de=1<arguments.length&&de!==void 0?de:1,pe=2<arguments.length&&we!==void 0&&we,we=Ct,ve=we.ghost,we=we.topLeft,ae=we.x,le=we.y,Fe=!He.container||He.container.shouldUseTransformForGhost(),Qe=Fe?"translate3d(".concat(ae,"px,").concat(le,"px, 0)"):null;de!==1&&(Qe=(Qe?"".concat(Qe," scale("):"scale(").concat(de,")")),0<Y?(Ct.ghost.style.transitionDuration=Y+"ms",requestAnimationFrame(function(){Qe&&(ve.style.transform=Qe),Fe||(ve.style.left=ae+"px",ve.style.top=le+"px"),w4=null,pe&&(ve.style.opacity="0")})):w4===null&&(w4=requestAnimationFrame(function(){Qe&&(ve.style.transform=Qe),Fe||(ve.style.left=ae+"px",ve.style.top=le+"px"),w4=null,pe&&(ve.style.opacity="0")}))}function c3t(G){return Yf(G),{register:function(j){j=j,fe.push(j),Ke&&He&&j.isDragRelevant(He.container,He.payload)&&(qt.push(j),j.prepareDrag(j,qt),Hn&&Hn({reset:!0,draggableInfo:void 0}),Hn=UM(j,qt),sr=zM(qt),j.handleDrag(He))},unregister:function(j){var W;j=j,fe.splice(fe.indexOf(j),1),Ke&&He&&(He.container===j&&j.fireRemoveElement(),He.targetElement===j.element&&(He.targetElement=null),-1<(W=qt.indexOf(j)))&&(qt.splice(W,1),Hn&&Hn({reset:!0,draggableInfo:void 0}),Hn=UM(j,qt),sr=zM(qt))},isDragging:function(){return Ke},cancelDrag:function(){var j,W;j=G,!Ke||tt||St||(Lt=!(tt=!0),W=Object.assign({},He,{targetElement:null,position:{x:Number.MAX_SAFE_INTEGER,y:Number.MAX_SAFE_INTEGER},mousePosition:{x:Number.MAX_SAFE_INTEGER,y:Number.MAX_SAFE_INTEGER}}),qt.forEach(function(Y){Y.handleDrag(W)}),He.targetElement=null,He.cancelDrop=!0,BM(j),tt=!1)}}}function cie(G,j,W){W=2<arguments.length&&W!==void 0?W:M.animationDuration,j?(N(G,o),G.style.transitionDuration=W+"ms"):(B(G,o),G.style.removeProperty("transition-duration"))}function die(G){var j=[];return Array.prototype.forEach.call(G.children,function(W){var Y,de,pe;W.nodeType===Node.ELEMENT_NODE?(D(Y=W,i)||(de=W,Y=xi.wrapChild?((pe=window.document.createElement("div")).className="".concat(i),de.parentElement.insertBefore(pe,de),pe.appendChild(de),pe):de),Y[s]=0,j.push(Y)):G.removeChild(W)}),j}function d3t(G){function j(Y,de,pe,ve){var we,ae,le,Fe=4<arguments.length&&arguments[4]!==void 0&&arguments[4];return ve<pe?pe:pe===ve?(le=(we=W.getBeginEnd(Y[pe])).begin,we=we.end,!Fe||de<(we+le)/2?pe:pe+1):(we=Math.floor((ve+pe)/2),ae=(le=W.getBeginEnd(Y[we])).begin,le=le.end,de<ae?j(Y,de,pe,we-1,Fe):le<de?j(Y,de,we+1,ve,Fe):!Fe||de<(le+ae)/2?we:we+1)}var W=G.layout;return function(Y,de){return j(Y,de,0,Y.length-1,2<arguments.length&&arguments[2]!==void 0&&arguments[2])}}function u3t(G){var j,W,Y,de=G.element,pe=G.draggables,ve=G.layout,we=G.getOptions,ae=(j=(G={element:de,draggables:pe,layout:ve,getOptions:we}).element,W=G.draggables,Y=G.layout,function(){W.forEach(function(Fe){cie(Fe,!1),Y.setTranslation(Fe,0),Y.setVisibility(Fe,!0)}),j[p]&&(j[p].parentNode.removeChild(j[p]),j[p]=null)}),le=(xi.dropHandler||Ae)({element:de,draggables:pe,layout:ve,getOptions:we});return function(Fe,gt){var Vt=gt.addedIndex,gt=gt.removedIndex,Bt=2<arguments.length&&arguments[2]!==void 0&&arguments[2];ae(),Fe.cancelDrop||(Fe.targetElement||we().removeOnDropOut||Bt)&&(Bt={removedIndex:gt,addedIndex:Vt!==null?gt!==null&&gt<Vt?Vt-1:Vt:null,payload:Fe.payload},le(Bt,we().onDrop))}}function uie(G){var j=G.element,W=G.getOptions,Y=null;return function(pe){var pe=pe.draggableInfo,ve=Y;return{removedIndex:ve=Y==null&&pe.container.element===j&&W().behaviour!=="copy"?Y=pe.elementIndex:ve}}}function pie(G){var j=G.draggables,W=G.layout;return function(Y){Y=Y.dragResult,Y.removedIndex!==null&&W.setVisibility(j[Y.removedIndex],!1)}}function hie(G){var j=G.element,W=G.layout;return function(de){var de=de.draggableInfo,pe=ge(j).elementFromPoint(de.position.x,de.position.y);return pe&&(pe=q(pe,de.relevantContainers),pe&&pe.element===j)?{pos:W.getPosition(de.position)}:{pos:null}}}function fie(G){var j=G.layout,W=null;return function(Y){var de=Y.draggableInfo;return Y.dragResult.pos===null?W=null:{elementSize:W=W||j.getSize(de.size)}}}function mie(G){var j=G.element;return function(de){var Y=de.draggableInfo,de=de.dragResult;(function(pe,ve,we){ve&&(!(2<arguments.length&&we!==void 0)||we)?pe.targetElement=ve:pe.targetElement===ve&&(pe.targetElement=null)})(Y,j,!!de.pos)}}function p3t(){return function(G){return G.dragResult.pos!==null?{addedIndex:0}:{addedIndex:null}}}function h3t(G){var j=G.layout,W=null;return function(pe){var de,pe=pe.dragResult.addedIndex;return pe!==W?(W=pe,de=(pe=j.getBeginEndOfContainer()).begin,pe.end,{shadowBeginEnd:{rect:j.getTopLeftOfElementBegin(de)}}):null}}function f3t(G){var j=G.layout,W=G.element,Y=G.getOptions,de=null;return function(gt){var ve,we,ae,le,gt=gt.dragResult,Fe=gt.elementSize,Qe=gt.shadowBeginEnd,Vt=gt.addedIndex,gt=gt.dropPlaceholderContainer,Bt=Y();return Bt.dropPlaceholder?(ve=(Bt=typeof Bt.dropPlaceholder=="boolean"?{}:Bt.dropPlaceholder).animationDuration,we=Bt.className,Bt=Bt.showOnTop,Vt!==null?(gt||(ae=document.createElement("div"),(le=document.createElement("div")).className=k,ae.className="".concat(y," ").concat(we||g),(gt=document.createElement("div")).className="".concat(w),gt.style.position="absolute",ve!==void 0&&(gt.style.transition="all ".concat(ve,"ms ease")),gt.appendChild(le),le.appendChild(ae),j.setSize(gt.style,Fe+"px"),gt.style.pointerEvents="none",Bt?W.appendChild(gt):W.insertBefore(gt,W.firstElementChild)),de!==Vt&&Qe.dropArea&&j.setBegin(gt.style,Qe.dropArea.begin-j.getBeginEndOfContainer().begin+"px"),de=Vt,{dropPlaceholderContainer:gt}):(gt&&de!==null&&W.removeChild(gt),de=null,{dropPlaceholderContainer:void 0})):null}}function m3t(G){var j=yie(G);return function(de){var Y=de.draggableInfo,de=de.dragResult;return Y.invalidateShadow?j({draggableInfo:Y,dragResult:de}):null}}function g3t(G){j=G.draggables,W=d3t({layout:G.layout});var j,W,Y=function(ve){var ve=ve.dragResult,pe=ve.shadowBeginEnd,ve=ve.pos;return pe?pe.begin+pe.beginAdjustment<=ve&&pe.end>=ve?null:ve<pe.begin+pe.beginAdjustment?W(j,ve):ve>pe.end?W(j,ve)+1:j.length:(pe=W(j,ve,!0))!==null?pe:j.length};return function(pe){var pe=pe.dragResult,ve=null;return{addedIndex:ve=pe.pos!==null&&(ve=Y({dragResult:pe}))===null?pe.addedIndex:ve}}}function y3t(){var G=null;return function(Y){var Y=Y.dragResult,W=Y.addedIndex,Y=Y.shadowBeginEnd;W!==G&&G!==null&&Y&&(Y.beginAdjustment=0),G=W}}function v3t(G){var j=G.element,W=G.draggables,Y=G.layout,de=G.getOptions,pe=null;return function(le){var le=le.dragResult,we=le.addedIndex,ae=le.removedIndex,le=le.elementSize;if(ae===null){if(we!==null){if(!pe){ae=Y.getBeginEndOfContainer(),ae.end=ae.begin+Y.getSize(j);var we=Y.getScrollSize(j)>Y.getSize(j)?ae.begin+Y.getScrollSize(j)-Y.getScrollValue(j):ae.end,ae=0<W.length?Y.getBeginEnd(W[W.length-1]).end-W[W.length-1][s]:ae.begin;if(we<ae+le)return(pe=window.document.createElement("div")).className=u+" "+de().orientation,ae=0<W.length?le+ae-we:le,Y.setSize(pe.style,"".concat(ae,"px")),j.appendChild(pe),j[p]=pe,{containerBoxChanged:!0}}}else if(pe)return Y.setTranslation(pe,0),we=pe,pe=null,j.removeChild(we),{containerBoxChanged:!(j[p]=null)}}}}function gie(G){var j=G.draggables,W=G.layout,Y=null,de=null;return function(ve){var ve=ve.dragResult,we=ve.addedIndex,ae=ve.removedIndex,le=ve.elementSize;if(we!==Y||ae!==de){for(var Fe,Qe,Vt=0;Vt<j.length;Vt++)Vt!==ae&&(Fe=j[Vt],Qe=0,ae!==null&&ae<Vt&&(Qe-=le),we!==null&&we<=Vt&&(Qe+=le),W.setTranslation(Fe,Qe));return{addedIndex:Y=we,removedIndex:de=ae}}}}function yie(G){var j=G.draggables,W=G.layout,Y=null;return function(Rn){var pe,ve,we,ae,le,Fe=Rn.draggableInfo,Rn=Rn.dragResult,Qe=Rn.addedIndex,Vt=Rn.removedIndex,gt=Rn.elementSize,Bt=Rn.pos,Rn=Rn.shadowBeginEnd;return Bt!==null?Qe===null||!Fe.invalidateShadow&&Qe===Y?null:(Bt=Qe-1,Fe=Number.MIN_SAFE_INTEGER,ve=pe=0,we=ae=null,Bt===Vt&&Bt--,pe=-1<Bt?(le=W.getSize(j[Bt]),we=W.getBeginEnd(j[Bt]),Fe=gt<le?we.end-(le-gt)/2:we.end,we.end):(we={end:W.getBeginEndOfContainer().begin},W.getBeginEndOfContainer().begin),Bt=Number.MAX_SAFE_INTEGER,(le=Qe)===Vt&&le++,ve=le<j.length?(Vt=W.getSize(j[le]),ae=W.getBeginEnd(j[le]),Bt=gt<Vt?ae.begin+(Vt-gt)/2:ae.begin,ae.begin):(ae={begin:W.getContainerRectangles().rect.end},W.getContainerRectangles().rect.end-W.getContainerRectangles().rect.begin),le=we&&ae?W.getTopLeftOfElementBegin(we.end):null,Y=Qe,{shadowBeginEnd:{dropArea:{begin:pe,end:ve},begin:Fe,end:Bt,rect:le,beginAdjustment:Rn?Rn.beginAdjustment:0}}):{shadowBeginEnd:Y=null}}}function b3t(){var G=null;return function(de){var de=de.dragResult,W=de.pos,Y=de.addedIndex,de=de.shadowBeginEnd;W!==null?Y!=null&&G===null&&(W<de.begin&&(W=W-de.begin-5,de.beginAdjustment=W),G=Y):G=null}}function vie(j){var j=j.getOptions,W=!1,Y=j();return function(de){de=!!de.dragResult.pos,de!==W&&((W=de)?Y.onDragEnter&&Y.onDragEnter():Y.onDragLeave&&Y.onDragLeave())}}function bie(j){var j=j.getOptions,W=null,Y=j();return function(le){var pe,we=le.dragResult,ve=we.addedIndex,we=we.removedIndex,le=le.draggableInfo,ae=le.payload,le=le.element;Y.onDropReady&&ve!==null&&W!==ve&&(pe=W=ve,we!==null&&we<ve&&pe--,Y.onDropReady({addedIndex:pe,removedIndex:we,payload:ae,element:le?le.firstElementChild:void 0}))}}function wie(G){return G.getOptions().behaviour==="drop-zone"?kie(G)(uie,pie,hie,fie,mie,p3t,h3t,vie,bie):kie(G)(uie,pie,hie,fie,mie,m3t,g3t,y3t,v3t,gie,yie,f3t,b3t,vie,bie)}function kie(G){return function(){for(var j=arguments.length,W=new Array(j),Y=0;Y<j;Y++)W[Y]=arguments[Y];var de=W.map(function(ve){return ve(G)}),pe=null;return function(ve){return pe=de.reduce(function(we,ae){return Object.assign(we,ae({draggableInfo:ve,dragResult:we}))},pe||{addedIndex:null,removedIndex:null,elementSize:null,pos:null,shadowBeginEnd:null})}}}function w3t(G){return function(j){var W,Y,de,pe,ve,we=Object.assign({},M,j),ae=null,le=null,Fe=(j=_ie,de=die(W=G),Y=j(),N(W,"".concat(c," ").concat(Y.orientation)),{element:W,draggables:de,getOptions:j,layout:Z(W,Y.orientation,Y.animationDuration)}),Qe=wie(Fe),Vt=u3t(Fe),gt=qe(G,function(){Fe.layout.invalidateRects(),Bt()});function Bt(){le!==null&&(le.invalidateShadow=!0,ae=Qe(le),le.invalidateShadow=!1)}function Rn(lr,rs){for(var Ci=die(rs),bp=0;bp<Ci.length;bp++)lr[bp]=Ci[bp];for(var x4=0;x4<lr.length-Ci.length;x4++)lr.pop()}function _ie(){return we}return{element:G,draggables:Fe.draggables,isDragRelevant:(pe=(de=Fe).element,ve=de.getOptions,function(lr,rs){var Ci=ve();return Ci.shouldAcceptDrop?Ci.shouldAcceptDrop(lr.getOptions(),rs):(rs=lr.getOptions(),Ci.behaviour!=="copy"&&z(pe,"."+i)!==lr.element&&(lr.element===pe||!(!rs.groupName||rs.groupName!==Ci.groupName)))}),layout:Fe.layout,dispose:function(lr){var rs;gt.dispose(),rs=lr.element,xi.wrapChild&&Array.prototype.forEach.call(rs.children,function(Ci){Ci.nodeType===Node.ELEMENT_NODE&&D(Ci,i)&&(rs.insertBefore(Ci.firstElementChild,Ci),rs.removeChild(Ci))})},prepareDrag:function(lr,rs){var Ci=lr.element,bp=Fe.draggables;Rn(bp,Ci),lr.layout.invalidateRects(),bp.forEach(function(x4){return cie(x4,!0,we.animationDuration)}),gt.start()},handleDrag:function(lr){return ae=Qe(le=lr)},handleDrop:function(lr){gt.stop(),ae&&ae.dropPlaceholderContainer&&G.removeChild(ae.dropPlaceholderContainer),le=null,Qe=wie(Fe),Vt(lr,ae),ae=null},fireRemoveElement:function(){Vt(le,Object.assign({},ae,{addedIndex:null}),!0),ae=null},getDragResult:function(){return ae},getTranslateCalculator:function(lr){return gie(Fe)(lr)},onTranslated:function(){Bt()},setDraggables:function(){Rn(Fe.draggables,G)},getScrollMaxSpeed:function(){return xi.maxScrollSpeed},shouldUseTransformForGhost:function(){return xi.useTransformForGhost===!0},getOptions:_ie,setOptions:function(lr){we=(!(1<arguments.length&&arguments[1]!==void 0)||arguments[1])===!1?Object.assign({},M,lr):Object.assign({},M,we,lr)}}}}typeof window<"u"&&typeof window<"u"&&(ar=window.document.head||window.document.getElementsByTagName("head")[0],(Zf=window.document.createElement("style")).id="smooth-dnd-style-definitions",_e=Ge(_e),Zf.type="text/css",Zf.styleSheet?Zf.styleSheet.cssText=_e:Zf.appendChild(window.document.createTextNode(_e)),ar.appendChild(Zf));var k4=null,xi=function(G,j){var W=w3t(G)(j);return G[r]=W,(k4=c3t(G)).register(W),{dispose:function(){k4.unregister(W),W.dispose(W)},setOptions:function(Y,de){W.setOptions(Y,de)}}};function _4(G,j,W){Object.defineProperty(G,W,{set:function(Y){j[W]=Y},get:function(){return j[W]}})}xi.wrapChild=!0,xi.cancelDrag=function(){k4.cancelDrag()},xi.isDragging=function(){return k4.isDragging()};function vp(G,j){return console.warn('default export is deprecated. please use named export "smoothDnD"'),xi(G,j)}vp.cancelDrag=function(){xi.cancelDrag()},vp.isDragging=function(){return xi.isDragging()},_4(vp,xi,"useTransformForGhost"),_4(vp,xi,"maxScrollSpeed"),_4(vp,xi,"wrapChild"),_4(vp,xi,"dropHandler"),n.smoothDnD=xi,n.constants=_,n.dropHandlers=ke,n.default=vp,Object.defineProperty(n,"__esModule",{value:!0})})}(x1,x1.exports)),x1.exports}var C1=u2e();function OV(e){return e?typeof e=="string"||typeof e=="object"&&(typeof e.value=="string"||typeof e.value=="function"||typeof e.value=="object"):!0}function DV(e,t){const n=e.$props.tag;if(n){if(typeof n=="string"){const r={value:n};return t&&(r.props={class:t}),r}else if(typeof n=="object"){const r={value:n.value||"div",props:n.props||{}};return t&&(r.props.class?Array.isArray(r.props.class)?r.props.class.push(t):r.props.class=[t,r.props.class]:r.props.class=t),r}}return{value:"div"}}C1.smoothDnD.dropHandler=C1.dropHandlers.reactDropHandler().handler,C1.smoothDnD.wrapChild=!1;const PV={"drag-start":"onDragStart","drag-end":"onDragEnd",drop:"onDrop","drag-enter":"onDragEnter","drag-leave":"onDragLeave","drop-ready":"onDropReady"};var E6=$e({name:"Container",mounted(){const e=Object.assign({},this.$props);for(const t in PV)e[PV[t]]=n=>{this.$emit(t,n)};this.containerElement=this.$refs.container||this.$el,this.container=C1.smoothDnD(this.containerElement,e)},unmounted(){if(this.container)try{this.container.dispose()}catch{}},emits:["drop","drag-start","drag-end","drag-enter","drag-leave","drop-ready"],props:{orientation:{type:String,default:"vertical"},removeOnDropOut:{type:Boolean,default:!1},autoScrollEnabled:{type:Boolean,default:!0},animationDuration:{type:Number,default:250},behaviour:String,groupName:String,dragHandleSelector:String,nonDragAreaSelector:String,lockAxis:String,dragClass:String,dropClass:String,dragBeginDelay:Number,getChildPayload:Function,shouldAnimateDrop:Function,shouldAcceptDrop:Function,getGhostParent:Function,dropPlaceholder:[Object,Boolean],tag:{validator:OV,default:"div"}},render(){const e=DV(this);return mn(e.value,Object.assign({},{ref:"container"},e.props),this.$slots.default())}}),A6=$e({name:"Draggable",props:{tag:{validator:OV,default:"div"}},render:function(){const e=DV(this,C1.constants.wrapperClass);return mn(e.value,Object.assign({},e.props),this.$slots.default())}});const p2e={mainStyles:[`
@@ -295,7 +295,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
295
295
  * (c) 2022 Evan You
296
296
  * @license MIT
297
297
  */var jbe="store";function ph(e,t){Object.keys(e).forEach(function(n){return t(e[n],n)})}function SB(e){return e!==null&&typeof e=="object"}function Hbe(e){return e&&typeof e.then=="function"}function qbe(e,t){return function(){return e(t)}}function EB(e,t,n){return t.indexOf(e)<0&&(n&&n.prepend?t.unshift(e):t.push(e)),function(){var r=t.indexOf(e);r>-1&&t.splice(r,1)}}function AB(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;Pv(e,n,[],e._modules.root,!0),Y6(e,n,t)}function Y6(e,t,n){var r=e._state,i=e._scope;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,s={},a={},l=z0(!0);l.run(function(){ph(o,function(c,d){s[d]=qbe(c,e),a[d]=ce(function(){return s[d]()}),Object.defineProperty(e.getters,d,{get:function(){return a[d].value},enumerable:!0})})}),e._state=Wn({data:t}),e._scope=l,e.strict&&Jbe(e),r&&n&&e._withCommit(function(){r.data=null}),i&&i.stop()}function Pv(e,t,n,r,i){var o=!n.length,s=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=r),!o&&!i){var a=J6(t,n.slice(0,-1)),l=n[n.length-1];e._withCommit(function(){a[l]=r.state})}var c=r.context=Wbe(e,s,n);r.forEachMutation(function(d,u){var p=s+u;Gbe(e,p,d,c)}),r.forEachAction(function(d,u){var p=d.root?u:s+u,f=d.handler||d;Kbe(e,p,f,c)}),r.forEachGetter(function(d,u){var p=s+u;Ybe(e,p,d,c)}),r.forEachChild(function(d,u){Pv(e,t,n.concat(u),d,i)})}function Wbe(e,t,n){var r=t==="",i={dispatch:r?e.dispatch:function(o,s,a){var l=Iv(o,s,a),c=l.payload,d=l.options,u=l.type;return(!d||!d.root)&&(u=t+u),e.dispatch(u,c)},commit:r?e.commit:function(o,s,a){var l=Iv(o,s,a),c=l.payload,d=l.options,u=l.type;(!d||!d.root)&&(u=t+u),e.commit(u,c,d)}};return Object.defineProperties(i,{getters:{get:r?function(){return e.getters}:function(){return MB(e,t)}},state:{get:function(){return J6(e.state,n)}}}),i}function MB(e,t){if(!e._makeLocalGettersCache[t]){var n={},r=t.length;Object.keys(e.getters).forEach(function(i){if(i.slice(0,r)===t){var o=i.slice(r);Object.defineProperty(n,o,{get:function(){return e.getters[i]},enumerable:!0})}}),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}function Gbe(e,t,n,r){var i=e._mutations[t]||(e._mutations[t]=[]);i.push(function(s){n.call(e,r.state,s)})}function Kbe(e,t,n,r){var i=e._actions[t]||(e._actions[t]=[]);i.push(function(s){var a=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},s);return Hbe(a)||(a=Promise.resolve(a)),e._devtoolHook?a.catch(function(l){throw e._devtoolHook.emit("vuex:error",l),l}):a})}function Ybe(e,t,n,r){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(o){return n(r.state,r.getters,o.state,o.getters)})}function Jbe(e){_t(function(){return e._state.data},function(){},{deep:!0,flush:"sync"})}function J6(e,t){return t.reduce(function(n,r){return n[r]},e)}function Iv(e,t,n){return SB(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}var Zbe="vuex bindings",OB="vuex:mutations",Z6="vuex:actions",hh="vuex",Xbe=0;function Qbe(e,t){k2e({id:"org.vuejs.vuex",app:e,label:"Vuex",homepage:"https://next.vuex.vuejs.org/",logo:"https://vuejs.org/images/icons/favicon-96x96.png",packageName:"vuex",componentStateTypes:[Zbe]},function(n){n.addTimelineLayer({id:OB,label:"Vuex Mutations",color:DB}),n.addTimelineLayer({id:Z6,label:"Vuex Actions",color:DB}),n.addInspector({id:hh,label:"Vuex",icon:"storage",treeFilterPlaceholder:"Filter stores..."}),n.on.getInspectorTree(function(r){if(r.app===e&&r.inspectorId===hh)if(r.filter){var i=[];RB(i,t._modules.root,r.filter,""),r.rootNodes=i}else r.rootNodes=[$B(t._modules.root,"")]}),n.on.getInspectorState(function(r){if(r.app===e&&r.inspectorId===hh){var i=r.nodeId;MB(t,i),r.state=nwe(iwe(t._modules,i),i==="root"?t.getters:t._makeLocalGettersCache,i)}}),n.on.editInspectorState(function(r){if(r.app===e&&r.inspectorId===hh){var i=r.nodeId,o=r.path;i!=="root"&&(o=i.split("/").filter(Boolean).concat(o)),t._withCommit(function(){r.set(t._state.data,o,r.state.value)})}}),t.subscribe(function(r,i){var o={};r.payload&&(o.payload=r.payload),o.state=i,n.notifyComponentUpdate(),n.sendInspectorTree(hh),n.sendInspectorState(hh),n.addTimelineEvent({layerId:OB,event:{time:Date.now(),title:r.type,data:o}})}),t.subscribeAction({before:function(r,i){var o={};r.payload&&(o.payload=r.payload),r._id=Xbe++,r._time=Date.now(),o.state=i,n.addTimelineEvent({layerId:Z6,event:{time:r._time,title:r.type,groupId:r._id,subtitle:"start",data:o}})},after:function(r,i){var o={},s=Date.now()-r._time;o.duration={_custom:{type:"duration",display:s+"ms",tooltip:"Action duration",value:s}},r.payload&&(o.payload=r.payload),o.state=i,n.addTimelineEvent({layerId:Z6,event:{time:Date.now(),title:r.type,groupId:r._id,subtitle:"end",data:o}})}})})}var DB=8702998,ewe=6710886,twe=16777215,PB={label:"namespaced",textColor:twe,backgroundColor:ewe};function IB(e){return e&&e!=="root"?e.split("/").slice(-2,-1)[0]:"Root"}function $B(e,t){return{id:t||"root",label:IB(t),tags:e.namespaced?[PB]:[],children:Object.keys(e._children).map(function(n){return $B(e._children[n],t+n+"/")})}}function RB(e,t,n,r){r.includes(n)&&e.push({id:r||"root",label:r.endsWith("/")?r.slice(0,r.length-1):r||"Root",tags:t.namespaced?[PB]:[]}),Object.keys(t._children).forEach(function(i){RB(e,t._children[i],n,r+i+"/")})}function nwe(e,t,n){t=n==="root"?t:t[n];var r=Object.keys(t),i={state:Object.keys(e.state).map(function(s){return{key:s,editable:!0,value:e.state[s]}})};if(r.length){var o=rwe(t);i.getters=Object.keys(o).map(function(s){return{key:s.endsWith("/")?IB(s):s,editable:!1,value:X6(function(){return o[s]})}})}return i}function rwe(e){var t={};return Object.keys(e).forEach(function(n){var r=n.split("/");if(r.length>1){var i=t,o=r.pop();r.forEach(function(s){i[s]||(i[s]={_custom:{value:{},display:s,tooltip:"Module",abstract:!0}}),i=i[s]._custom.value}),i[o]=X6(function(){return e[n]})}else t[n]=X6(function(){return e[n]})}),t}function iwe(e,t){var n=t.split("/").filter(function(r){return r});return n.reduce(function(r,i,o){var s=r[i];if(!s)throw new Error('Missing module "'+i+'" for path "'+t+'".');return o===n.length-1?s:s._children},t==="root"?e:e.root._children)}function X6(e){try{return e()}catch(t){return t}}var bs=function(t,n){this.runtime=n,this._children=Object.create(null),this._rawModule=t;var r=t.state;this.state=(typeof r=="function"?r():r)||{}},LB={namespaced:{configurable:!0}};LB.namespaced.get=function(){return!!this._rawModule.namespaced},bs.prototype.addChild=function(t,n){this._children[t]=n},bs.prototype.removeChild=function(t){delete this._children[t]},bs.prototype.getChild=function(t){return this._children[t]},bs.prototype.hasChild=function(t){return t in this._children},bs.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},bs.prototype.forEachChild=function(t){ph(this._children,t)},bs.prototype.forEachGetter=function(t){this._rawModule.getters&&ph(this._rawModule.getters,t)},bs.prototype.forEachAction=function(t){this._rawModule.actions&&ph(this._rawModule.actions,t)},bs.prototype.forEachMutation=function(t){this._rawModule.mutations&&ph(this._rawModule.mutations,t)},Object.defineProperties(bs.prototype,LB);var pu=function(t){this.register([],t,!1)};pu.prototype.get=function(t){return t.reduce(function(n,r){return n.getChild(r)},this.root)},pu.prototype.getNamespace=function(t){var n=this.root;return t.reduce(function(r,i){return n=n.getChild(i),r+(n.namespaced?i+"/":"")},"")},pu.prototype.update=function(t){NB([],this.root,t)},pu.prototype.register=function(t,n,r){var i=this;r===void 0&&(r=!0);var o=new bs(n,r);if(t.length===0)this.root=o;else{var s=this.get(t.slice(0,-1));s.addChild(t[t.length-1],o)}n.modules&&ph(n.modules,function(a,l){i.register(t.concat(l),a,r)})},pu.prototype.unregister=function(t){var n=this.get(t.slice(0,-1)),r=t[t.length-1],i=n.getChild(r);i&&i.runtime&&n.removeChild(r)},pu.prototype.isRegistered=function(t){var n=this.get(t.slice(0,-1)),r=t[t.length-1];return n?n.hasChild(r):!1};function NB(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return;NB(e.concat(r),t.getChild(r),n.modules[r])}}function owe(e){return new Yi(e)}var Yi=function(t){var n=this;t===void 0&&(t={});var r=t.plugins;r===void 0&&(r=[]);var i=t.strict;i===void 0&&(i=!1);var o=t.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new pu(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=o;var s=this,a=this,l=a.dispatch,c=a.commit;this.dispatch=function(p,f){return l.call(s,p,f)},this.commit=function(p,f,h){return c.call(s,p,f,h)},this.strict=i;var d=this._modules.root.state;Pv(this,d,[],this._modules.root),Y6(this,d),r.forEach(function(u){return u(n)})},Q6={state:{configurable:!0}};Yi.prototype.install=function(t,n){t.provide(n||jbe,this),t.config.globalProperties.$store=this;var r=this._devtools!==void 0?this._devtools:!1;r&&Qbe(t,this)},Q6.state.get=function(){return this._state.data},Q6.state.set=function(e){},Yi.prototype.commit=function(t,n,r){var i=this,o=Iv(t,n,r),s=o.type,a=o.payload,l={type:s,payload:a},c=this._mutations[s];c&&(this._withCommit(function(){c.forEach(function(u){u(a)})}),this._subscribers.slice().forEach(function(d){return d(l,i.state)}))},Yi.prototype.dispatch=function(t,n){var r=this,i=Iv(t,n),o=i.type,s=i.payload,a={type:o,payload:s},l=this._actions[o];if(l){try{this._actionSubscribers.slice().filter(function(d){return d.before}).forEach(function(d){return d.before(a,r.state)})}catch{}var c=l.length>1?Promise.all(l.map(function(d){return d(s)})):l[0](s);return new Promise(function(d,u){c.then(function(p){try{r._actionSubscribers.filter(function(f){return f.after}).forEach(function(f){return f.after(a,r.state)})}catch{}d(p)},function(p){try{r._actionSubscribers.filter(function(f){return f.error}).forEach(function(f){return f.error(a,r.state,p)})}catch{}u(p)})})}},Yi.prototype.subscribe=function(t,n){return EB(t,this._subscribers,n)},Yi.prototype.subscribeAction=function(t,n){var r=typeof t=="function"?{before:t}:t;return EB(r,this._actionSubscribers,n)},Yi.prototype.watch=function(t,n,r){var i=this;return _t(function(){return t(i.state,i.getters)},n,Object.assign({},r))},Yi.prototype.replaceState=function(t){var n=this;this._withCommit(function(){n._state.data=t})},Yi.prototype.registerModule=function(t,n,r){r===void 0&&(r={}),typeof t=="string"&&(t=[t]),this._modules.register(t,n),Pv(this,this.state,t,this._modules.get(t),r.preserveState),Y6(this,this.state)},Yi.prototype.unregisterModule=function(t){var n=this;typeof t=="string"&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var r=J6(n.state,t.slice(0,-1));delete r[t[t.length-1]]}),AB(this)},Yi.prototype.hasModule=function(t){return typeof t=="string"&&(t=[t]),this._modules.isRegistered(t)},Yi.prototype.hotUpdate=function(t){this._modules.update(t),AB(this,!0)},Yi.prototype._withCommit=function(t){var n=this._committing;this._committing=!0,t(),this._committing=n},Object.defineProperties(Yi.prototype,Q6);var hu=tC(function(e,t){var n={};return eC(t).forEach(function(r){var i=r.key,o=r.val;n[i]=function(){var a=this.$store.state,l=this.$store.getters;if(e){var c=nC(this.$store,"mapState",e);if(!c)return;a=c.context.state,l=c.context.getters}return typeof o=="function"?o.call(this,a,l):a[o]},n[i].vuex=!0}),n}),$t=tC(function(e,t){var n={};return eC(t).forEach(function(r){var i=r.key,o=r.val;o=e+o,n[i]=function(){if(!(e&&!nC(this.$store,"mapGetters",e)))return this.$store.getters[o]},n[i].vuex=!0}),n}),gn=tC(function(e,t){var n={};return eC(t).forEach(function(r){var i=r.key,o=r.val;n[i]=function(){for(var a=[],l=arguments.length;l--;)a[l]=arguments[l];var c=this.$store.dispatch;if(e){var d=nC(this.$store,"mapActions",e);if(!d)return;c=d.context.dispatch}return typeof o=="function"?o.apply(this,[c].concat(a)):c.apply(this.$store,[o].concat(a))}}),n});function eC(e){return swe(e)?Array.isArray(e)?e.map(function(t){return{key:t,val:t}}):Object.keys(e).map(function(t){return{key:t,val:e[t]}}):[]}function swe(e){return Array.isArray(e)||SB(e)}function tC(e){return function(t,n){return typeof t!="string"?(n=t,t=""):t.charAt(t.length-1)!=="/"&&(t+="/"),e(t,n)}}function nC(e,t,n){var r=e._modulesNamespaceMap[n];return r}const awe=(e,t)=>({...e,[t]:n=>{var r,i;return((r=n.params)==null?void 0:r[t])||((i=n.meta)==null?void 0:i[t])}}),lwe={components:{StyleComponent:IV,UserMessages:a2e,ViewContainer:Ube,MountingContainer:Sbe},mixins:[((e=[])=>({computed:{...hu("route",e.reduce(awe,{}))}}))(["mode","placement","width","height","maxWidth","maxHeight","scroll","closeButton"])],data(){return{ui:Ht}},computed:{hasOpenUiView(){return this.ui.openViews.filter(e=>["modal","drawer"].includes(e.mode)).length>0}}};function cwe(e,t,n,r,i,o){const s=A("StyleComponent"),a=A("router-view"),l=A("ViewContainer"),c=A("MountingContainer"),d=A("portal-target"),u=A("UserMessages");return v(),x(ee,null,[b("div",{class:ne(["fixed inset-0 h-full w-full overflow-hidden",{"pointer-events-none":!o.hasOpenUiView}])},[T(s),(v(),V(l,{key:e.$route.name,value:o.hasOpenUiView,type:e.mode,placement:e.placement,width:e.width,"max-width":e.maxWidth,height:e.height,scroll:e.scroll,"close-button":e.closeButton,"max-height":e.maxHeight,class:"pointer-events-auto",onInput:t[0]||(t[0]=p=>e.$router.push("/"))},{default:E(()=>[T(a)]),_:1},8,["value","type","placement","width","max-width","height","scroll","close-button","max-height"])),T(c),T(d,{name:"modal",multiple:""})],2),T(u)],64)}const dwe=X(lwe,[["render",cwe]]);function uwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function FB(e,t,n){return t&&uwe(e.prototype,t),e}function fh(){return fh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fh.apply(this,arguments)}function pwe(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function $v(e){return!!(e&&typeof e.hasOwnProperty=="function"&&(e.hasOwnProperty("__ownerID")||e._map&&e._map.hasOwnProperty("__ownerID")))}function hwe(e,t,n){return Object.keys(e).reduce(function(r,i){var o=""+i;return r.has(o)?r.set(o,n(r.get(o),e[o])):r},t)}var fwe=function(t){return function(n){return $v(n)?n.get(t):n[t]}},mwe=function(){function e(n,r,i){if(r===void 0&&(r={}),i===void 0&&(i={}),!n||typeof n!="string")throw new Error("Expected a string key for Entity, but found "+n+".");var o=i,s=o.idAttribute,a=s===void 0?"id":s,l=o.mergeStrategy,c=l===void 0?function(h,m){return fh({},h,m)}:l,d=o.processStrategy,u=d===void 0?function(h){return fh({},h)}:d,p=o.fallbackStrategy,f=p===void 0?function(h,m){}:p;this._key=n,this._getId=typeof a=="function"?a:fwe(a),this._idAttribute=a,this._mergeStrategy=c,this._processStrategy=u,this._fallbackStrategy=f,this.define(r)}var t=e.prototype;return t.define=function(r){this.schema=Object.keys(r).reduce(function(i,o){var s,a=r[o];return fh({},i,(s={},s[o]=a,s))},this.schema||{})},t.getId=function(r,i,o){return this._getId(r,i,o)},t.merge=function(r,i){return this._mergeStrategy(r,i)},t.fallback=function(r,i){return this._fallbackStrategy(r,i)},t.normalize=function(r,i,o,s,a,l){var c=this,d=this.getId(r,i,o),u=this.key;if(u in l||(l[u]={}),d in l[u]||(l[u][d]=[]),l[u][d].some(function(f){return f===r}))return d;l[u][d].push(r);var p=this._processStrategy(r,i,o);return Object.keys(this.schema).forEach(function(f){if(p.hasOwnProperty(f)&&typeof p[f]=="object"){var h=c.schema[f],m=typeof h=="function"?h(r):h;p[f]=s(p[f],p,f,m,a,l)}}),a(this,p,r,i,o),d},t.denormalize=function(r,i){var o=this;return $v(r)?hwe(this.schema,r,i):(Object.keys(this.schema).forEach(function(s){if(r.hasOwnProperty(s)){var a=o.schema[s];r[s]=i(r[s],a)}}),r)},FB(e,[{key:"key",get:function(){return this._key}},{key:"idAttribute",get:function(){return this._idAttribute}}]),e}(),gwe=function(){function e(n,r){r&&(this._schemaAttribute=typeof r=="string"?function(i){return i[r]}:r),this.define(n)}var t=e.prototype;return t.define=function(r){this.schema=r},t.getSchemaAttribute=function(r,i,o){return!this.isSingleSchema&&this._schemaAttribute(r,i,o)},t.inferSchema=function(r,i,o){if(this.isSingleSchema)return this.schema;var s=this.getSchemaAttribute(r,i,o);return this.schema[s]},t.normalizeValue=function(r,i,o,s,a,l){var c=this.inferSchema(r,i,o);if(!c)return r;var d=s(r,i,o,c,a,l);return this.isSingleSchema||d===void 0||d===null?d:{id:d,schema:this.getSchemaAttribute(r,i,o)}},t.denormalizeValue=function(r,i){var o=$v(r)?r.get("schema"):r.schema;if(!this.isSingleSchema&&!o)return r;var s=this.isSingleSchema?void 0:$v(r)?r.get("id"):r.id,a=this.isSingleSchema?this.schema:this.schema[o];return i(s||r,a)},FB(e,[{key:"isSingleSchema",get:function(){return!this._schemaAttribute}}]),e}(),ywe=function(t){var n=Array.isArray(t);if(n&&t.length>1)throw new Error("Expected schema definition to be a single schema, but found "+t.length+".");return t[0]},VB=function(t){return Array.isArray(t)?t:Object.keys(t).map(function(n){return t[n]})},vwe=function(t,n,r,i,o,s,a){t=ywe(t);var l=VB(n);return l.map(function(c,d){return o(c,r,i,t,s,a)})},bwe=function(e){pwe(t,e);function t(){return e.apply(this,arguments)||this}var n=t.prototype;return n.normalize=function(i,o,s,a,l,c){var d=this,u=VB(i);return u.map(function(p,f){return d.normalizeValue(p,o,s,a,l,c)}).filter(function(p){return p!=null})},n.denormalize=function(i,o){var s=this;return i&&i.map?i.map(function(a){return s.denormalizeValue(a,o)}):i},t}(gwe),wwe=function(t,n,r,i,o,s,a){var l=fh({},n);return Object.keys(t).forEach(function(c){var d=t[c],u=typeof d=="function"?d(n):d,p=o(n[c],n,c,u,s,a);p==null?delete l[c]:l[c]=p}),l},kwe=function e(t,n,r,i,o,s){if(typeof t!="object"||!t)return t;if(typeof i=="object"&&(!i.normalize||typeof i.normalize!="function")){var a=Array.isArray(i)?vwe:wwe;return a(i,t,n,r,e,o,s)}return i.normalize(t,n,r,e,o,s)},_we=function(t){return function(n,r,i,o,s){var a=n.key,l=n.getId(i,o,s);a in t||(t[a]={});var c=t[a][l];c?t[a][l]=n.merge(c,r):t[a][l]=r}},xt={Array:bwe,Entity:mwe},BB=function(t,n){if(!t||typeof t!="object")throw new Error('Unexpected input given to normalize. Expected type to be "object", found "'+(t===null?"null":typeof t)+'".');var r={},i=_we(r),o={},s=kwe(t,t,null,n,i,o);return{entities:r,result:s}};const mh="SET_AS_NORMALIZED_DATA",zB=Object.freeze(Object.defineProperty({__proto__:null,SET_AS_NORMALIZED_DATA:mh},Symbol.toStringTag,{value:"Module"})),xwe={LOAD_USER_POSITION:"LOAD_USER_POSITION",LOAD_USER:"LOAD_USER",LOGIN_AUTH_TOKEN:"LOGIN_AUTH_TOKEN",LOGIN_USER:"LOGIN_USER",AUTH_3RD_PARTY_USER:"AUTH_3RD_PARTY_USER",SWITCH_CONNECTED_USER:"SWITCH_CONNECTED_USER",REGISTER_USER:"REGISTER_USER",RESET_USER_PASSWORD:"RESET_USER_PASSWORD",LOGOUT_USER:"LOGOUT_USER"},Cwe={SET_USER_LOCATION:"SET_USER_LOCATION",SET_USER:"SET_USER"},rC={...xwe,SHOW_MESSAGE:"SHOW_MESSAGE",UPDATE_VIEW_SETTINGS:"UPDATE_VIEW_SETTINGS",RESET_VIEW_SETTINGS:"RESET_VIEW_SETTINGS",SHOW_ERROR:"SHOW_ERROR",RESET_ERROR:"RESET_ERROR"},ho={...Cwe,SET_VIEW_SETTINGS:"SET_VIEW_SETTINGS",RESET_VIEW_SETTINGS:"RESET_VIEW_SETTINGS",SET_ERROR:"SET_ERROR",RESET_ERROR:"RESET_ERROR",SET_SOCKET_ENABLED:"SET_SOCKET_ENABLED",SET_SOCKET_CONNECTED:"SET_SOCKET_CONNECTED"},Twe={LOAD_CERTIFICATES:"LOAD_CERTIFICATES",DO_SET_COMPANY_CERTIFICATES:"DO_SET_COMPANY_CERTIFICATES",SUBMIT_CERTIFICATES:"SUBMIT_CERTIFICATES"},Swe={SET_CERTIFICATES:"SET_CERTIFICATES",CLEAR_CERTIFICATES:"CLEAR_CERTIFICATES",SET_CERTIFICATES_FETCHING:"SET_CERTIFICATES_FETCHING",SET_CERTIFICATES_POSTING:"SET_CERTIFICATES_POSTING"},UB={DO_LOAD_CURRENT_COMPANY:"DO_LOAD_CURRENT_COMPANY",DO_UPDATE_CURRENT_COMPANY:"DO_UPDATE_CURRENT_COMPANY",DO_NORMALIZE_COMPANIES:"DO_NORMALIZE_COMPANIES",FORM_EDIT_COMPANY:"FORM_EDIT_COMPANY",FORM_SUBMIT_COMPANY:"FORM_SUBMIT_COMPANY",FORM_NEW_COMPANY_BRANDING:"FORM_NEW_COMPANY_BRANDING",FORM_EDIT_COMPANY_BRANDING:"FORM_EDIT_COMPANY_BRANDING",FORM_SUBMIT_COMPANY_BRANDING:"FORM_SUBMIT_COMPANY_BRANDING",UPDATE_COMPANY_ACCOUNT_TYPE:"UPDATE_COMPANY_ACCOUNT_TYPE"},iC={SET_COMPANIES:"SET_COMPANIES",CLEAR_COMPANIES:"CLEAR_COMPANIES",SET_COMPANIES_FETCHING:"SET_COMPANIES_FETCHING",SET_COMPANIES_POSTING:"SET_COMPANIES_POSTING"},Ewe={LOAD_COMPANY_REFERENCE_ITEMS:"LOAD_COMPANY_REFERENCE_ITEMS",LOAD_COMPANY_REFERENCE_ITEM:"LOAD_COMPANY_REFERENCE_ITEM",SET_COMPANY_REFERENCE_ITEMS:"SET_COMPANY_REFERENCE_ITEMS",CREATE_COMPANY_REFERENCE_ITEM:"CREATE_COMPANY_REFERENCE_ITEM",UPDATE_COMPANY_REFERENCE_ITEM:"UPDATE_COMPANY_REFERENCE_ITEM",DELETE_COMPANY_REFERENCE_ITEM:"DELETE_COMPANY_REFERENCE_ITEM",FORM_NEW_COMPANY_REFERENCE_ITEM:"FORM_NEW_COMPANY_REFERENCE_ITEM",FORM_SUBMIT_COMPANY_REFERENCE_ITEMS:"FORM_SUBMIT_COMPANY_REFERENCE_ITEMS"},Awe={SET_COMPANY_REFERENCE_ITEMS:"SET_COMPANY_REFERENCE_ITEMS",DELETE_COMPANY_REFERENCE_ITEM:"DELETE_COMPANY_REFERENCE_ITEM",CLEAR_COMPANY_REFERENCE_ITEMS:"CLEAR_COMPANY_REFERENCE_ITEMS"},Mwe={LOAD_COMPANY_REFERENCES:"LOAD_COMPANY_REFERENCES",LOAD_COMPANY_REFERENCE:"LOAD_COMPANY_REFERENCE",CREATE_COMPANY_REFERENCE:"CREATE_COMPANY_REFERENCE",UPDATE_COMPANY_REFERENCE:"UPDATE_COMPANY_REFERENCE",DELETE_COMPANY_REFERENCE:"DELETE_COMPANY_REFERENCE",PATCH_COMPANY_REFERENCE:"PATCH_COMPANY_REFERENCE",FORM_NEW_COMPANY_REFERENCE:"FORM_NEW_COMPANY_REFERENCE",FORM_EDIT_COMPANY_REFERENCE:"FORM_EDIT_COMPANY_REFERENCE",FORM_SUBMIT_COMPANY_REFERENCE:"FORM_SUBMIT_COMPANY_REFERENCE"},Owe={SET_COMPANY_REFERENCES:"SET_COMPANY_REFERENCES",DELETE_COMPANY_REFERENCE:"DELETE_COMPANY_REFERENCE",CLEAR_COMPANY_REFERENCES:"CLEAR_COMPANY_REFERENCES",SET_COMPANY_REFERENCE_FETCHING:"SET_COMPANY_REFERENCE_FETCHING",SET_COMPANY_REFERENCE_POSTING:"SET_COMPANY_REFERENCE_POSTING"},jB={DELETE_DOCUMENT2:"DELETE_DOCUMENT2",DO_CREATE_DOCUMENT2:"DO_CREATE_DOCUMENT2",DO_LOAD_DOCUMENT2:"DO_LOAD_DOCUMENT2",DO_LOAD_DOCUMENTS2:"DO_LOAD_DOCUMENTS2",DO_UPDATE_DOCUMENT2:"DO_UPDATE_DOCUMENT2",LOAD_DOCUMENT2:"LOAD_DOCUMENT2",LOAD_DOCUMENTS2:"LOAD_DOCUMENTS2",LOAD_DOCUMENTS2_EXTERNAL:"LOAD_DOCUMENTS2_EXTERNAL",PATCH_DOCUMENT2:"PATCH_DOCUMENT2",UPDATE_DOCUMENT2:"UPDATE_DOCUMENT2",UPDATE_DOCUMENT2_STATUS:"UPDATE_DOCUMENT2_STATUS",DO_SEND_DOCUMENT2:"DO_SEND_DOCUMENT2",SEND_REMINDER_DOCUMENT2:"SEND_REMINDER_DOCUMENT2",REQUEST_PROPERTY_DOCUMENT2:"REQUEST_PROPERTY_DOCUMENT2",CLEAR_DOCUMENT2_ANSWERS:"CLEAR_DOCUMENT2_ANSWERS",ANSWER_OWN_DOCUMENT2:"ANSWER_OWN_DOCUMENT2"},oC={DELETE_MANY_DOCUMENTS2:"DELETE_MANY_DOCUMENTS2",SET_DOCUMENTS2:"SET_DOCUMENTS2",SET_DOCUMENT2_FETCHING:"SET_DOCUMENT2_FETCHING",SET_DOCUMENT2_POSTING:"SET_DOCUMENT2_POSTING"},Dwe={LOAD_DOCUMENT_TERMS:"LOAD_DOCUMENT_TERMS",LOAD_DOCUMENT_TERM:"LOAD_DOCUMENT_TERM",CREATE_DOCUMENT_TERM:"CREATE_DOCUMENT_TERM",UPDATE_DOCUMENT_TERM:"UPDATE_DOCUMENT_TERM",DELETE_DOCUMENT_TERM:"DELETE_DOCUMENT_TERM",PATCH_DOCUMENT_TERM:"PATCH_DOCUMENT_TERM",FORM_NEW_DOCUMENT_TERM:"FORM_NEW_DOCUMENT_TERM",FORM_EDIT_DOCUMENT_TERM:"FORM_EDIT_DOCUMENT_TERM",FORM_SUBMIT_DOCUMENT_TERM:"FORM_SUBMIT_DOCUMENT_TERM"},Pwe={SET_DOCUMENT_TERMS:"SET_DOCUMENT_TERMS",DELETE_DOCUMENT_TERM:"DELETE_DOCUMENT_TERM",CLEAR_DOCUMENT_TERMS:"CLEAR_DOCUMENT_TERMS",SET_DOCUMENT_TERMS_FETCHING:"SET_DOCUMENT_TERMS_FETCHING",SET_DOCUMENT_TERMS_POSTING:"SET_DOCUMENT_TERMS_POSTING"},Rv={LOAD_FILE:"LOAD_FILE",CREATE_FILE:"CREATE_FILE",UPDATE_FILE:"UPDATE_FILE",DELETE_FILE:"DELETE_FILE",PATCH_FILE:"PATCH_FILE",FORM_NEW_FILE:"FORM_NEW_FILE",FORM_EDIT_FILE:"FORM_EDIT_FILE",FORM_SUBMIT_FILE:"FORM_SUBMIT_FILE"},sC={UPDATE_MANY_FILES:"UPDATE_MANY_FILES",DELETE_ONE_FILE:"DELETE_ONE_FILE",CLEAR_FILES:"CLEAR_FILES",SET_FILES_FETCHING:"SET_FILES_FETCHING",SET_FILES_POSTING:"SET_FILES_POSTING"},Iwe={SET_FORM_ARTICLE:"SET_FORM_ARTICLE",REMOVE_FORM_ARTICLE:"REMOVE_FORM_ARTICLE"},HB={LOAD_DOCUMENT2_FORM:"LOAD_DOCUMENT2_FORM",LOAD_DOCUMENT2_PUBLIC_FORM:"LOAD_DOCUMENT2_PUBLIC_FORM",LOAD_DUPLICATE_DOCUMENT2_FORM:"LOAD_DUPLICATE_DOCUMENT2_FORM",SAVE_DYNDOC_FORM:"SAVE_DYNDOC_FORM",CLEAR_DYNDOC_FORM:"CLEAR_DYNDOC_FORM",DO_SAVE_DYNDOC:"DO_SAVE_DYNDOC",HANDLE_DOCUMENT2_EDIT:"HANDLE_DOCUMENT2_EDIT",SAVE_TEMPLATE_FORM:"SAVE_TEMPLATE_FORM",LOAD_EXTERNAL_FORM_FIELDS:"LOAD_EXTERNAL_FORM_FIELDS"},$we={},aa={...Iwe,...HB,LOAD_DOCUMENT_FORM:"LOAD_DOCUMENT_FORM",LOAD_UPGRADE_DOCUMENT_FORM:"LOAD_UPGRADE_DOCUMENT_FORM",LOAD_ATA_DOCUMENT_FORM:"LOAD_ATA_DOCUMENT_FORM",LOAD_DUPLICATE_DOCUMENT_FORM:"LOAD_DUPLICATE_DOCUMENT_FORM",LOAD_DEMO_DOCUMENT_FORM:"LOAD_DEMO_DOCUMENT_FORM",SAVE_DOCUMENT_FORM:"SAVE_DOCUMENT_FORM",SAVE_DOCUMENT_FORM_AND_SEND:"SAVE_DOCUMENT_FORM_AND_SEND",DO_SAVE_DOCUMENT:"DO_SAVE_DOCUMENT",SUBMIT_DOCUMENT_AND_SEND:"SUBMIT_DOCUMENT_AND_SEND",FORM_DOCUMENT_SET_CLIENT:"FORM_DOCUMENT_SET_CLIENT",FORM_DOCUMENT_SUBMIT_CLIENT:"FORM_DOCUMENT_SUBMIT_CLIENT",FORM_RESET_OLD:"FORM_RESET_OLD",FORM_CLEAR_FORM:"FORM_CLEAR_FORM",SET_FORM:"SET_FORM",SET_FORM_VALUE:"SET_FORM_VALUE",REMOVE_FORM_VALUE:"REMOVE_FORM_VALUE",REMOVE_FORM_KEY_VALUE:"REMOVE_FORM_KEY_VALUE"},la={...$we,SET_FORM:"SET_FORM",CLEAR_FORM:"CLEAR_FORM",SET_FORM_VALUE:"SET_FORM_VALUE",REMOVE_FORM_VALUE:"REMOVE_FORM_VALUE",REMOVE_FORM_KEY_VALUE:"REMOVE_FORM_KEY_VALUE"},Rwe={LOAD_NOTIFICATIONS:"LOAD_NOTIFICATIONS",LOAD_UNREAD_NOTIFICATIONS:"LOAD_UNREAD_NOTIFICATIONS",LOAD_NOTIFICATION:"LOAD_NOTIFICATION",SET_READ_FOR_PROJECT:"SET_READ_FOR_PROJECT",SET_NOTIFICATION_READ:"SET_NOTIFICATION_READ",SET_ALL_NOTIFICATION_READ:"SET_ALL_NOTIFICATION_READ",DO_CREATE_NOTIFICATION:"DO_CREATE_NOTIFICATION"},Lwe={SET_NOTIFICATIONS:"SET_NOTIFICATIONS",CLEAR_NOTIFICATIONS:"CLEAR_NOTIFICATIONS",DELETE_MANY_NOTIFICATIONS:"DELETE_MANY_NOTIFICATIONS",SET_NOTIFICATIONS_FETCHED_AT:"SET_NOTIFICATIONS_FETCHED_AT",SET_NOTIFICATIONS_FETCHING:"SET_NOTIFICATIONS_FETCHING",SET_NOTIFICATIONS_POSTING:"SET_NOTIFICATIONS_POSTING"},qB={LOAD_PROJECT_FILE:"LOAD_PROJECT_FILE",CREATE_PROJECT_FILE:"CREATE_PROJECT_FILE",UPDATE_PROJECT_FILE:"UPDATE_PROJECT_FILE",DELETE_PROJECT_FILE:"DELETE_PROJECT_FILE",PATCH_PROJECT_FILE:"PATCH_PROJECT_FILE"},Lv={SET_PROJECT_FILES:"SET_PROJECT_FILES",DELETE_PROJECT_FILE:"DELETE_PROJECT_FILE"},ca={...qB,LOAD_PROJECTS:"LOAD_PROJECTS",LOAD_PROJECT:"LOAD_PROJECT",LOAD_PUBLIC_PROJECT:"LOAD_PUBLIC_PROJECT",CREATE_PROJECT:"CREATE_PROJECT",CREATE_DEMOPROJECT:"CREATE_DEMOPROJECT",UPDATE_PROJECT:"UPDATE_PROJECT",DELETE_PROJECT:"DELETE_PROJECT",PATCH_PROJECT:"PATCH_PROJECT",FORM_EDIT_PROJECT:"FORM_EDIT_PROJECT",DO_SUBMIT_PROJECT:"DO_SUBMIT_PROJECT",SUBMIT_PROJECT:"SUBMIT_PROJECT",DO_LOAD_PROJECT:"DO_LOAD_PROJECT",DO_LOAD_PROJECTS:"DO_LOAD_PROJECTS",DO_LOAD_PROJECTS_COUNT:"DO_LOAD_PROJECTS_COUNT",LOAD_PROJECTS_FOR_CLIENT:"LOAD_PROJECTS_FOR_CLIENT",LOAD_PROJECTS_FOR_USER:"LOAD_PROJECTS_FOR_USER",FORM_SUBMIT_PROJECT:"FORM_SUBMIT_PROJECT",DO_CREATE_PROJECT_NOTE:"DO_CREATE_PROJECT_NOTE",FORM_EDIT_PROJECT_NOTE:"FORM_EDIT_PROJECT_NOTE",FORM_NEW_PROJECT_NOTE:"FORM_NEW_PROJECT_NOTE",FORM_SUBMIT_PROJECT_NOTE:"FORM_SUBMIT_PROJECT_NOTE",LOAD_PROJECT_NOTE:"LOAD_PROJECT_NOTE",DO_UPDATE_PROJECT_NOTE:"DO_UPDATE_PROJECT_NOTE",LOAD_EVENTS_FOR_PROJECT:"LOAD_EVENTS_FOR_PROJECT",DELETE_PROJECT_MEMBER:"SUBMIT_PROJECT_MEMBER",SUBMIT_PROJECT_MEMBER:"DELETE_PROJECT_MEMBER",SET_PROJECT_FILTER:"SET_PROJECT_FILTER",SET_PROJECT_SORT:"SET_PROJECT_SORT",SET_QUICKVIEW_PROJECT:"SET_QUICKVIEW_PROJECT",SET_PROJECT_LEADER:"SET_PROJECT_LEADER",CLEAR_PROJECTS:"CLEAR_PROJECTS"},fo={...Lv,SET_PROJECTS:"SET_PROJECTS",SET_PROJECTS_FETCHING:"SET_PROJECTS_FETCHING",SET_PROJECTS_POSTING:"SET_PROJECTS_POSTING",SET_PROJECTS_CAN_FETCH_MORE:"SET_PROJECTS_CAN_FETCH_MORE",SET_PROJECTS_COUNT:"SET_PROJECTS_COUNT",CLEAR_PROJECT_DATA:"CLEAR_PROJECT_DATA",SET_PROJECT_NOTES:"SET_PROJECT_NOTES",SET_PROJECT_NOTES_FETCHING:"SET_PROJECT_NOTES_FETCHING",SET_PROJECT_NOTES_POSTING:"SET_PROJECT_NOTES_POSTING",SET_EVENTS:"SET_EVENTS",DELETE_MANY_PROJECTS:"DELETE_MANY_PROJECTS",ADD_PROJECT_MEMBER:"ADD_PROJECT_MEMBER",DELETE_PROJECT_MEMBER:"DELETE_PROJECT_MEMBER"},WB={DO_LOAD_PUBLIC_DOCUMENT:"DO_LOAD_PUBLIC_DOCUMENT",DO_LOAD_PUBLIC_DOCUMENTS:"DO_LOAD_PUBLIC_DOCUMENTS",PUT_PUBLIC_DOCUMENT:"PUT_PUBLIC_DOCUMENT",PUT_CURRENT_PUBLIC_DOCUMENT:"PUT_CURRENT_PUBLIC_DOCUMENT",LOAD_PUBLIC_DOCUMENT:"LOAD_PUBLIC_DOCUMENT",LOAD_PUBLIC_DOCUMENTS:"LOAD_PUBLIC_DOCUMENTS",ANSWER_PUBLIC_DOCUMENT:"ANSWER_PUBLIC_DOCUMENT",ANSWER_CURRENT_PUBLIC_DOCUMENT:"ANSWER_CURRENT_PUBLIC_DOCUMENT",DO_SET_CURRENT_DOCUMENT:"DO_SET_CURRENT_DOCUMENT",SET_CURRENT_PUBLIC_DOCUMENT_VALUE:"SET_CURRENT_PUBLIC_DOCUMENT_VALUE",RELOAD_CURRENT_DOCUMENT:"RELOAD_CURRENT_DOCUMENT",LOAD_PUBLIC_COMPANY:"LOAD_PUBLIC_COMPANY",LOAD_CLIENT_DOCUMENTS:"LOAD_CLIENT_DOCUMENTS",REQUEST_MAGIC_LINK:"REQUEST_MAGIC_LINK"},GB={SET_PUBLIC_DOCUMENTS:"SET_PUBLIC_DOCUMENTS",SET_PUBLIC_DOCUMENTS_FETCHING:"SET_PUBLIC_DOCUMENTS_FETCHING",SET_PUBLIC_DOCUMENTS_POSTING:"SET_PUBLIC_DOCUMENTS_POSTING",SET_CURRENT_DOCUMENT:"SET_CURRENT_DOCUMENT",SET_CURRENT_DOCUMENT_VALUE:"SET_CURRENT_DOCUMENT_VALUE",SET_PUBLIC_COMPANIES:"SET_PUBLIC_COMPANIES",SET_VIEWER:"SET_VIEWER"},KB={DO_LOAD_ALL_SETTINGS:"DO_LOAD_ALL_SETTINGS",LOAD_ALL_SETTINGS:"LOAD_ALL_SETTINGS",DO_LOAD_SETTINGS_COMPANY:"DO_LOAD_SETTINGS_COMPANY",DO_LOAD_SETTINGS_COMPANYUSER:"DO_LOAD_SETTINGS_COMPANYUSER",LOAD_SETTINGS_COMPANY:"LOAD_SETTINGS_COMPANY",LOAD_SETTINGS_COMPANYUSER:"LOAD_SETTINGS_COMPANYUSER",UPDATE_SETTINGS:"UPDATE_SETTINGS",DO_UPDATE_SETTINGS:"DO_UPDATE_SETTINGS",FORM_EDIT_COMPANY_SETTINGS:"FORM_EDIT_COMPANY_SETTINGS",FORM_SUBMIT_COMPANY_SETTINGS:"FORM_SUBMIT_COMPANY_SETTINGS",FORM_EDIT_COMPANY_USER_SETTINGS:"FORM_EDIT_COMPANY_USER_SETTINGS",FORM_SUBMIT_COMPANY_USER_SETTINGS:"FORM_SUBMIT_COMPANY_USER_SETTINGS"},YB={SET_SETTINGS:"SET_SETTINGS",CLEAR_SETTINGS:"CLEAR_SETTINGS",SET_SETTINGS_FETCHING:"SET_SETTINGS_FETCHING",SET_SETTINGS_POSTING:"SET_SETTINGS_POSTING"},JB={DO_CREATE_TEMPLATE:"DO_CREATE_TEMPLATE",DO_LOAD_TEMPLATE:"DO_LOAD_TEMPLATE",DO_LOAD_TEMPLATES:"DO_LOAD_TEMPLATES",DO_UPDATE_TEMPLATE:"DO_UPDATE_TEMPLATE",LOAD_TEMPLATE:"LOAD_TEMPLATE",LOAD_TEMPLATES:"LOAD_TEMPLATES",UPDATE_TEMPLATE:"UPDATE_TEMPLATE",REMOVE_TEMPLATE:"REMOVE_TEMPLATE",DELETE_TEMPLATE:"DELETE_TEMPLATE",PATCH_TEMPLATE:"PATCH_TEMPLATE",HIDE_TEMPLATE:"HIDE_TEMPLATE",DUPLICATE_PROTECTED_TEMPLATE:"DUPLICATE_PROTECTED_TEMPLATE"},aC={SET_TEMPLATES:"SET_TEMPLATES",SET_TEMPLATE_FETCHING:"SET_TEMPLATE_FETCHING",SET_TEMPLATE_POSTING:"SET_TEMPLATE_POSTING",DELETE_MANY_TEMPLATES:"DELETE_MANY_TEMPLATES"},ZB={LOAD_UNIT_TYPES:"LOAD_UNIT_TYPES",LOAD_UNIT_TYPE:"LOAD_UNIT_TYPE",CREATE_UNIT_TYPE:"CREATE_UNIT_TYPE",UPDATE_UNIT_TYPE:"UPDATE_UNIT_TYPE",DELETE_UNIT_TYPE:"DELETE_UNIT_TYPE"},Nv={SET_UNIT_TYPES:"SET_UNIT_TYPES",DELETE_UNIT_TYPE:"DELETE_UNIT_TYPE",SET_UNIT_TYPE_FETCHING:"SET_UNIT_TYPE_FETCHING",SET_UNIT_TYPE_POSTING:"SET_UNIT_TYPE_POSTING"},Rt={application:ho,projects:fo,forms:la,files:sC,settings:YB,certificates:Swe,companies:iC,companyReferences:Owe,companyReferenceItems:Awe,documents2:oC,templates:aC,publicDocuments:GB,documentTerms:Pwe,notifications:Lwe,unitTypes:Nv,CLEAR_FORM:"CLEAR_FORM",DELETE_ARTICLE:"DELETE_ARTICLE",DELETE_COMPANY_USER:"DELETE_COMPANY_USER",DELETE_CONTRACT:"DELETE_CONTRACT",DELETE_ENDCUSTOMER:"DELETE_ENDCUSTOMER",DELETE_PROJECT:"DELETE_PROJECT",DELETE_PROJECT_FILE:"DELETE_PROJECT_FILE",DELETE_TEMPLATE_MESSAGE:"DELETE_TEMPLATE_MESSAGE",SET_ARTICLES:"SET_ARTICLES",SET_ATAS:"SET_ATAS",SET_COMPANY_USERS:"SET_COMPANY_USERS",SET_CONTRACTS:"SET_CONTRACTS",SET_ENDCUSTOMERS:"SET_ENDCUSTOMERS",SET_FORM:"SET_FORM",SET_NOTIFICATIONS:"SET_NOTIFICATIONS",SET_OFFERS:"SET_OFFERS",SET_PROJECTS:"SET_PROJECTS",SET_PROJECT_FILES:"SET_PROJECT_FILES",UPDATE_COMPANY:"UPDATE_COMPANY"},gh=new xt.Entity("files"),Nwe=new xt.Array(gh),lC=new xt.Entity("companyUsers"),XB=new xt.Array(lC),QB=new xt.Entity("companies"),Fwe=new xt.Array(QB),Vwe=new xt.Entity("documents",{data:{Files:Nwe}}),Bwe=new xt.Array(Vwe),ez=new xt.Entity("projectFiles",{File:gh}),zwe=new xt.Array(ez),tz=new xt.Entity("projects",{ProjectMembers:XB,ProjectFiles:[{File:gh}],CompanyUser:lC}),Uwe=new xt.Array(tz),nz=new xt.Entity("companyReference",{CompanyReferenceItem:{Image:gh,Thumbnail:gh}}),jwe=new xt.Array(nz),rz=new xt.Entity("documentTerms",{File:gh}),Hwe=new xt.Array(rz),qwe={project:tz,projects:Uwe,companyReference:nz,companyReferences:jwe,projectFile:ez,projectFiles:zwe,documents:Bwe,companyUser:lC,companyUsers:XB,company:QB,companies:Fwe,documentTerm:rz,documentTerms:Hwe},Wwe=(e,t)=>{const n=qwe[t];return n||console.warn(`No schema found for type: '${t}'`),BB(e,n)};function Sc(e,t,n=!1){let r=t.replace(/\[(\d*)\]/gi,(s,a)=>`.${a}`);r=r.split(".");let i=e;const o=r.pop();return r.length>0&&(i=r.reduce((s,a)=>{let l=s[a];return n&&(kn(l)==="undefined"||kn(l)==="null")&&(s[a]={},l=s[a]),l},e)),{root:i,prop:o}}function Fo(e,t){function n(r,i){Object.keys(i).forEach(o=>{const s=r[o]instanceof Object&&!Array.isArray(r[o]),a=i[o]instanceof Object&&!Array.isArray(i[o]);if(s&&a){Fo(r[o],i[o]);return}r[o]=i[o]})}n(e,t)}function Qa(e,{keyId:t="id"}={}){const n=[],r={};return e.forEach(i=>{r[i[t]]=i,n.push(i[t])}),{ids:n,values:r}}const iz={projectFiles:"projects",certificates:"certificates",companies:"companies",companyUsers:"companyUsers",projects:"projects",companyReferences:"companyReferences",companyReferenceItems:"companyReferenceItems",files:"files",documents:"documents",documentTerms:"documentTerms"},oz={projects:Rt.SET_PROJECTS,offers:Rt.SET_OFFERS,companyUsers:Rt.SET_COMPANY_USERS,companies:Rt.companies.SET_COMPANIES,events:Rt.SET_EVENTS,atas:Rt.SET_ATAS,contracts:Rt.SET_CONTRACTS,projectNotes:Rt.SET_PROJECT_NOTES,projectFiles:Rt.SET_PROJECT_FILES,articles:Rt.SET_ARTICLES,certificates:Rt.certificates.SET_CERTIFICATES,companyReferenceItems:Rt.companyReferenceItems.SET_COMPANY_REFERENCE_ITEMS,companyReferences:Rt.companyReferences.SET_COMPANY_REFERENCES,files:Rt.files.UPDATE_MANY_FILES,notifications:Rt.SET_NOTIFICATIONS,templateMessages:Rt.SET_TEMPLATE_MESSAGES,documentTerms:Rt.documentTerms.SET_DOCUMENT_TERMS},Gwe={[mh](e,t){const n={includedModules:void 0,excludedModules:void 0,schema:void 0,data:void 0,moduleOpts:{},...t};if(!n.schema||!n.data)throw Error("Unable to normalize data, missing schema or data");const r=Array.isArray(n.data)?n.data:[n.data];let i;typeof n.schema=="string"?{entities:i}=Wwe(r,n.schema):{entities:i}=BB(r,n.schema);let o=Object.keys(i);o=o.filter(s=>(!n.includedModules||n.includedModules.includes(s))&&(!n.excludedModules||!n.excludedModules.includes(s))),o.forEach(s=>{if(!oz[s]){Ao.warn(`setActions: '${s}', does not exist`);return}if(!iz[s]){Ao.warn(`moduleKeys: '${s}', does not exist`);return}const a={doClearOld:!1,...n.moduleOpts[s]||{}};this.commit(`${iz[s]}/${oz[s]}`,{data:Object.keys(i[s]).map(l=>i[s][l]),...a})})}},sz={LOAD_ARTICLES:"LOAD_ARTICLES",LOAD_ARTICLE:"LOAD_ARTICLE",SET_ARTICLES:"SET_ARTICLES",UPDATE_ARTICLE:"UPDATE_ARTICLE",DO_CREATE_ARTICLE:"DO_CREATE_ARTICLE",DELETE_ARTICLE:"DELETE_ARTICLE",PATCH_ARTICLE:"PATCH_ARTICLE",SEARCH_ARTICLE:"SEARCH_ARTICLE",FORM_NEW_ARTICLE:"FORM_NEW_ARTICLE",FORM_EDIT_ARTICLE:"FORM_EDIT_ARTICLE",FORM_SUBMIT_ARTICLE:"FORM_SUBMIT_ARTICLE"},az={SET_ARTICLES:"SET_ARTICLES",DELETE_ARTICLE:"DELETE_ARTICLE",CLEAR_ARTICLES:"CLEAR_ARTICLES",SET_ARTICLES_FETCHING:"SET_ARTICLES_FETCHING",SET_ARTICLES_POSTING:"SET_ARTICLES_POSTING"},lz={LOAD_COMPANY_USERS:"LOAD_COMPANY_USERS",LOAD_COMPANY_USER:"LOAD_COMPANY_USER",DO_NORMALIZE_COMPANY_USERS:"DO_NORMALIZE_COMPANY_USERS",UPDATE_COMPANY_USER:"UPDATE_COMPANY_USER",CREATE_COMPANY_USER:"CREATE_COMPANY_USER",DELETE_COMPANY_USER:"DELETE_COMPANY_USER",PATCH_COMPANY_USER:"PATCH_COMPANY_USER",FORM_NEW_COMPANY_USER:"FORM_NEW_COMPANY_USER",FORM_EDIT_COMPANY_USER:"FORM_EDIT_COMPANY_USER",FORM_SUBMIT_COMPANY_USER:"FORM_SUBMIT_COMPANY_USER"},cC={SET_COMPANY_USERS:"SET_COMPANY_USERS",DELETE_COMPANY_USER:"DELETE_COMPANY_USER",SET_COMPANY_USERS_FETCHING:"SET_COMPANY_USERS_FETCHING",SET_COMPANY_USERS_POSTING:"SET_COMPANY_USERS_POSTING"},cz={LOAD_ENDCUSTOMERS:"LOAD_ENDCUSTOMERS",LOAD_ENDCUSTOMER:"LOAD_ENDCUSTOMER",UPDATE_ENDCUSTOMER:"UPDATE_ENDCUSTOMER",CREATE_ENDCUSTOMER:"CREATE_ENDCUSTOMER",DELETE_ENDCUSTOMER:"DELETE_ENDCUSTOMER",PATCH_ENDCUSTOMER:"PATCH_ENDCUSTOMER",FORM_NEW_ENDCUSTOMER:"FORM_NEW_ENDCUSTOMER",FORM_EDIT_ENDCUSTOMER:"FORM_EDIT_ENDCUSTOMER",FORM_SUBMIT_ENDCUSTOMER:"FORM_SUBMIT_ENDCUSTOMER"},yh={CLEAR_END_CUSTOMER:"CLEAR_END_CUSTOMER",SET_ENDCUSTOMERS:"SET_ENDCUSTOMERS",DELETE_ENDCUSTOMER:"DELETE_ENDCUSTOMER",SET_ENDCUSTOMER_FETCHING:"SET_ENDCUSTOMER_FETCHING",SET_ENDCUSTOMER_POSTING:"SET_ENDCUSTOMER_POSTING"},dz={LOAD_PRICES:"LOAD_PRICES",RESET_STRIPE_FORM:"RESET_STRIPE_FORM",SET_STRIPE_FORM_VALUE:"SET_STRIPE_FORM_VALUE",SET_FORM_PROMOTION:"SET_FORM_PROMOTION",SUBMIT_PROMOTION_CODE:"SUBMIT_PROMOTION_CODE",SUBMIT_PAYMENT_METHOD:"SUBMIT_PAYMENT_METHOD",SUBMIT_FORM_PLAN:"SUBMIT_FORM_PLAN",CONFIRM_PAYMENT:"CONFIRM_PAYMENT",REMOVE_SUBSCRIPTION_ITEM:"REMOVE_SUBSCRIPTION_ITEM",SUBMIT_FORM_PAYMENT:"SUBMIT_STRIPE_FORM_PAYMENT",SUBMIT_FORM_PRODUCTS:"SUBMIT_STRIPE_FORM_PRODUCTS"},vh={LOAD_TEMPLATE_MESSAGES:"LOAD_TEMPLATE_MESSAGES",LOAD_TEMPLATE_MESSAGE:"LOAD_TEMPLATE_MESSAGE",CREATE_TEMPLATE_MESSAGE:"CREATE_TEMPLATE_MESSAGE",UPDATE_TEMPLATE_MESSAGE:"UPDATE_TEMPLATE_MESSAGE",DELETE_TEMPLATE_MESSAGE:"DELETE_TEMPLATE_MESSAGE",PATCH_TEMPLATE_MESSAGE:"PATCH_TEMPLATE_MESSAGE",FORM_NEW_TEMPLATE_MESSAGE:"FORM_NEW_TEMPLATE_MESSAGE",FORM_EDIT_TEMPLATE_MESSAGE:"FORM_EDIT_TEMPLATE_MESSAGE",FORM_SUBMIT_TEMPLATE_MESSAGE:"FORM_SUBMIT_TEMPLATE_MESSAGE"},dC={SET_TEMPLATE_MESSAGES:"SET_TEMPLATE_MESSAGES",DELETE_TEMPLATE_MESSAGE:"DELETE_TEMPLATE_MESSAGE",CLEAR_TEMPLATE_MESSAGES:"CLEAR_TEMPLATE_MESSAGES",SET_TEMPLATE_MESSAGES_FETCHING:"SET_TEMPLATE_MESSAGES_FETCHING",SET_TEMPLATE_MESSAGES_POSTING:"SET_TEMPLATE_MESSAGES_POSTING"},el={...zB,application:rC,projects:ca,forms:aa,documents2:jB,files:Rv,settings:KB,articles:sz,endCustomers:cz,certificates:Twe,companies:UB,companyUsers:lz,companyReferences:Mwe,companyReferenceItems:Ewe,templateMessages:vh,notifications:Rwe,templates:JB,publicDocuments:WB,documentTerms:Dwe,unitTypes:ZB,stripe:dz,CREATE_ARTICLE:"CREATE_ARTICLE",CREATE_COMPANY_USER:"CREATE_COMPANY_USER",CREATE_ENDCUSTOMER:"CREATE_ENDCUSTOMER",CREATE_PROJECT:"CREATE_PROJECT",DELETE_ARTICLE:"DELETE_ARTICLE",DELETE_COMPANY_USER:"DELETE_COMPANY_USER",DELETE_ENDCUSTOMER:"DELETE_ENDCUSTOMER",DELETE_PROJECT:"DELETE_PROJECT",FORM_CLEAR_FORM:"FORM_CLEAR_FORM",FORM_EDIT_ARTICLE:"FORM_EDIT_ARTICLE",FORM_EDIT_COMPANY:"FORM_EDIT_COMPANY",FORM_EDIT_COMPANY_USER:"FORM_EDIT_COMPANY_USER",FORM_EDIT_COMPANY_BRANDING:"FORM_EDIT_COMPANY_BRANDING",FORM_EDIT_ENDCUSTOMER:"FORM_EDIT_ENDCUSTOMER",FORM_NEW_ARTICLE:"FORM_NEW_ARTICLE",FORM_NEW_COMPANY_USER:"FORM_NEW_COMPANY_USER",FORM_NEW_COMPANY_BRANDING:"FORM_NEW_COMPANY_BRANDING",FORM_NEW_ENDCUSTOMER:"FORM_NEW_ENDCUSTOMER",FORM_NEW_OFFER:"FORM_NEW_OFFER",FORM_SUBMIT_ARTICLE:"FORM_SUBMIT_ARTICLE",FORM_SUBMIT_COMPANY:"FORM_SUBMIT_COMPANY",FORM_SUBMIT_COMPANY_USER:"FORM_SUBMIT_COMPANY_USER",FORM_SUBMIT_COMPANY_BRANDING:"FORM_SUBMIT_COMPANY_BRANDING",FORM_SUBMIT_ENDCUSTOMER:"FORM_SUBMIT_ENDCUSTOMER",FORM_SUBMIT_OFFER:"FORM_SUBMIT_OFFER",LOAD_ARTICLE:"LOAD_ARTICLE",LOAD_ARTICLES:"LOAD_ARTICLES",LOAD_CERTIFICATES:"LOAD_CERTIFICATES",LOAD_COMPANY_USER:"LOAD_COMPANY_USER",LOAD_COMPANY_USERS:"LOAD_COMPANY_USERS",DO_LOAD_CURRENT_COMPANY:"DO_LOAD_CURRENT_COMPANY",LOAD_ENDCUSTOMER:"LOAD_ENDCUSTOMER",LOAD_ENDCUSTOMERS:"LOAD_ENDCUSTOMERS",LOAD_PROJECT:"LOAD_PROJECT",LOAD_PROJECTS:"LOAD_PROJECTS",LOAD_PUBLIC_PROJECT:"LOAD_PUBLIC_PROJECT",PATCH_ARTICLE:"PATCH_ARTICLE",PATCH_COMPANY_USER:"PATCH_COMPANY_USER",SEARCH_ARTICLE:"SEARCH_ARTICLE",SET_ARTICLES:"SET_ARTICLES",SET_FORM:"SET_FORM",SET_PROJECTS:"SET_PROJECTS",SET_READ_FOR_PROJECT:"SET_READ_FOR_PROJECT",SORT:"SORT",UPDATE_ARTICLE:"UPDATE_ARTICLE",UPDATE_COMPANY_USER:"UPDATE_COMPANY_USER",DO_UPDATE_CURRENT_COMPANY:"DO_UPDATE_CURRENT_COMPANY",UPDATE_ENDCUSTOMER:"UPDATE_ENDCUSTOMER",UPDATE_PROJECT:"UPDATE_PROJECT"},Te={};Object.keys(el).forEach(e=>{typeof el[e]=="object"&&Object.keys(el[e]).forEach(t=>{Te[t]&&console.warn(`Duplicate action constant warning!, ${el[e][t]}`),Te[t]=`${e}/${el[e][t]}`})}),Object.keys(zB).forEach(e=>{Te[e]&&console.warn(`Duplicate action constant warning!, ${el[e]}`),Te[e]=el[e]});var uC,uz;function pC(){if(uz)return uC;uz=1;var e=Zs(),t=Dv(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,s){if(e(o))return!1;var a=typeof o;return a=="number"||a=="symbol"||a=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||s!=null&&o in Object(s)}return uC=i,uC}var hC,pz;function Kwe(){if(pz)return hC;pz=1;var e=Jk(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var o=function(){var s=arguments,a=i?i.apply(this,s):s[0],l=o.cache;if(l.has(a))return l.get(a);var c=r.apply(this,s);return o.cache=l.set(a,c)||l,c};return o.cache=new(n.Cache||e),o}return n.Cache=e,hC=n,hC}var fC,hz;function Ywe(){if(hz)return fC;hz=1;var e=Kwe(),t=500;function n(r){var i=e(r,function(s){return o.size===t&&o.clear(),s}),o=i.cache;return i}return fC=n,fC}var mC,fz;function Jwe(){if(fz)return mC;fz=1;var e=Ywe(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(t,function(s,a,l,c){o.push(l?c.replace(n,"$1"):a||s)}),o});return mC=r,mC}var gC,mz;function yC(){if(mz)return gC;mz=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,o=Array(i);++r<i;)o[r]=n(t[r],r,t);return o}return gC=e,gC}var vC,gz;function Zwe(){if(gz)return vC;gz=1;var e=jp(),t=yC(),n=Zs(),r=Dv(),i=e?e.prototype:void 0,o=i?i.toString:void 0;function s(a){if(typeof a=="string")return a;if(n(a))return t(a,s)+"";if(r(a))return o?o.call(a):"";var l=a+"";return l=="0"&&1/a==-1/0?"-0":l}return vC=s,vC}var bC,yz;function Xwe(){if(yz)return bC;yz=1;var e=Zwe();function t(n){return n==null?"":e(n)}return bC=t,bC}var wC,vz;function bh(){if(vz)return wC;vz=1;var e=Zs(),t=pC(),n=Jwe(),r=Xwe();function i(o,s){return e(o)?o:t(o,s)?[o]:n(r(o))}return wC=i,wC}var kC,bz;function wh(){if(bz)return kC;bz=1;var e=Dv();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return kC=t,kC}var _C,wz;function Fv(){if(wz)return _C;wz=1;var e=bh(),t=wh();function n(r,i){i=e(i,r);for(var o=0,s=i.length;r!=null&&o<s;)r=r[t(i[o++])];return o&&o==s?r:void 0}return _C=n,_C}var xC,kz;function _z(){if(kz)return xC;kz=1;var e=Fv();function t(n,r,i){var o=n==null?void 0:e(n,r);return o===void 0?i:o}return xC=t,xC}var Qwe=_z();const re=hr(Qwe),{UPDATE_VIEW_SETTINGS:kh,LOAD_USER_POSITION:e5e,LOAD_USER:_h,LOGIN_USER:Vv,LOGIN_AUTH_TOKEN:xz,AUTH_3RD_PARTY_USER:Cz,SWITCH_CONNECTED_USER:Tz,LOGOUT_USER:Bv,REGISTER_USER:Sz,RESET_USER_PASSWORD:Ez}=rC,{DO_LOAD_CURRENT_COMPANY:t5e,DO_LOAD_ALL_SETTINGS:n5e,DO_NORMALIZE_COMPANY_USERS:r5e,LOAD_UNREAD_NOTIFICATIONS:i5e}=Te,{SET_USER_LOCATION:o5e,SET_USER:Hr}=ho,Az=e=>ye.te(`errors:${e}`)&&ye.t(`errors:${e}`),s5e={async[_h]({commit:e,getters:t,dispatch:n}){var r,i;try{if(!ot.getItem("token")){ot.removeItem("tokenExpire"),ot.removeItem("refreshToken"),e(Hr,{userId:null,companyId:null}),this.$router.push({name:"Login"});return}const{data:o}=await Ur.get("/companyUser/self");let s=[];o.isSlave&&!o.verifiedEmailAt||({data:s}=await aN.getConnectedUsers());const{id:a,CompanyId:l,language:c,locale:d}=o;c&&ye.changeLanguage(c),d&&ye.changeLocale(d),await this.dispatch(r5e,{companyUsers:[{...o,connectedUsers:s}]}),e(Hr,{userId:a,companyId:l}),await this.dispatch(t5e),await this.dispatch(n5e),this.hasModule("notifications")&&!this.getters["notifications/isFetching"]&&this.dispatch(i5e,{throttleTime:5});const{user:u}=t;if(u){let p="";(u.firstname||u.lastname)&&(p=u.fullName),b6.configure({payload:{person:{id:u.id,username:p||null,email:u.email||null}}}),(r=this.$supportChat)==null||r.syncData(),(i=this.$trackEvent)==null||i.call(this,"loadUser",{companyUserId:u.id})}}catch(o){this.handleError(o,{action:_h,actionPayload:null}),n(Bv)}},async[Vv]({commit:e,dispatch:t},{email:n,password:r,doRedirect:i=!0,doLoadUser:o=!0,superUserId:s=null,responseType:a=null,code:l=null,allowCodeSignup:c=!0}){try{e(Hr,{isLoggingIn:!0}),t(kh,{view:"login",settings:{error:null}});let d;if(s)({data:d}=await Ur.post("/auth/employee",{email:n,password:r,CompanyUserId:s}));else if(l){({data:d}=await Ur.post("/oauth2/token",{code:l,client_id:De.clientId,grant_type:"authorization_code",brand:De.brand,allowCodeSignup:c,...Xy(gr.value)}));const m=new Date;m.setSeconds(m.getSeconds()+d.expires_in),d={token:d.access_token,tokenExpires:m.toISOString(),refreshToken:d.refresh_token}}else({data:d}=await Ur.post("/auth/companyUser",{email:n,password:r,response_type:a,...Xy(gr.value)}));if(a==="code"&&d.code)return e(Hr,{isLoggingIn:!1}),d;const{token:u,tokenExpires:p,refreshToken:f}=d;if(ot.setItem("token",u),ot.setItem("tokenExpires",p),ot.setItem("refreshToken",f),o&&await t(_h),!i)return!0;const{redirect:h}=this.state.route.query||{};return h?(this.$router.push(h),!0):(this.$router.push({name:"account"}),!0)}catch(d){let u=ye.t("errors:fallback"),p=!1;if(d&&typeof d.getPayload=="function"){const f=d.getPayload();f&&f.axios&&f.axios.status===401&&(p=!0)}if(p&&(u=ye.t("actions:loginUser.wrongCredentials")),d&&typeof d.getPayload=="function"){const f=d.getPayload();f!=null&&f.code&&ye.te(`errors:${f.code}`)&&(u=ye.t(`errors:${f.code}`))}return t(kh,{view:"login",settings:{error:u}}),e(Hr,{isLoggingIn:!1}),p||this.handleError(d,{action:Vv,actionPayload:null}),!1}finally{e(Hr,{isLoggingIn:!1})}},async[xz]({commit:e,dispatch:t},{authToken:n,to:r,doRedirect:i=!0}){let o={};try{if(!n)throw new Error("Missing param authToken");if(!r&&i)throw new Error("Missing param to");e(Hr,{isLoggingIn:!0}),r&&gr.value!=="pipedrive"&&(o=Object.assign({},r.query),delete o.authtoken);const{data:s}=await gme(n,{...Xy(gr.value)}),{token:a,tokenExpires:l,refreshToken:c}=s;if(ot.setItem("token",a),ot.setItem("tokenExpires",l),ot.setItem("refreshToken",c),await t(_h),!i)return!0;this.$router.push({path:r.path,query:o})}catch(s){r!=null&&r.path&&(o.redirect=r==null?void 0:r.path),await t(Bv,{next:{name:"Login",query:o}}),this.handleError(s,{action:xz,actionPayload:null})}finally{e(Hr,{isLoggingIn:!1})}},async[Cz]({commit:e,dispatch:t},{service:n,code:r}){e(Hr,{isLoggingIn:!0});const i={isAuth:!1,isVerify:!1,company:null,companyUser:null,addedToExistingCompanyId:null,error:null};try{const{data:o}=await sc.signupWithCrm(n,{code:r,doLogin:!0,...Xy(gr.value),brand:De.brand}),{addedToExistingCompanyId:s,authenticate:a}=o,{token:l,tokenExpires:c,refreshToken:d,company:u,companyUser:p}=a;return ot.setItem("token",l),ot.setItem("tokenExpires",c),ot.setItem("refreshToken",d),p&&p.isSlave&&!p.verifiedEmailAt?(i.companyUser=p,i.isVerify=!0,i):(await t(_h),s&&(i.addedToExistingCompanyId=s),i.company=u,i.isAuth=!0,i)}catch(o){return this.handleError(o,{action:Cz,actionPayload:null}),{isAuth:!1,isVerify:!1,company:null,companyUser:null,addedToExistingCompanyId:null,error:o.message}}finally{e(Hr,{isLoggingIn:!1})}},async[Tz]({commit:e,dispatch:t},{companyUserId:n,doRedirect:r=!0}){var i;try{if(typeof n>"u")throw new Error("Missing param companyUserId");e(Hr,{isLoggingIn:!0});const{data:o}=await aN.getConnectedUserAuth(n),{token:s,tokenExpires:a,refreshToken:l}=o;ot.setItem("token",s),ot.setItem("tokenExpires",a),ot.setItem("refreshToken",l),this.commit("reset"),await t(_h),r?this.$router.push({name:"account"}):(i=window.reloadApp)==null||i.call(window,!0)}catch(o){this.handleError(o,{action:Tz,actionPayload:null})}finally{e(Hr,{isLoggingIn:!1})}},async[Sz]({commit:e,dispatch:t},{company:n,companyUser:r,termsVersion:i,voucherCode:o=null,source:s=null,region:a,language:l,currency:c,throwIfSlaveUser:d}){var u;try{const p={isAuth:!1,isVerify:!1,didNavigate:!1};if(t(kh,{view:"register",settings:{error:null}}),e(Hr,{isRegistering:!0}),!n)throw new Error("Missing param company");if(!r)throw new Error("Missing param companyUser");if(!i)throw new Error("Missing param termsVersion");const{data:f}=await yme({Company:n,CompanyUser:r,voucherCode:o,source:s,region:a,language:l,currency:c,throwIfSlaveUser:d}),{CompanyUser:h}=f,m={type:"terms",version:i,identifier:h.email,object:"CompanyUser",objectId:h.id};if(await bme(m),h.isSlave)return p.isVerify=!0,p;const g=await t(Vv,{email:r.email,password:r.password,doRedirect:!1});return p.isAuth=g,g&&((u=this.$trackEvent)==null||u.call(this,"register")),p}catch(p){if(re(p,"payload.code")===4008&&d)throw p;if(p&&p.code){const f=Az(p.code);f&&t(kh,{view:"register",settings:{error:f}})}return this.handleError(p,{action:Sz,actionPayload:null}),{isAuth:!1,isVerify:!1,didNavigate:!1}}finally{e(Hr,{isRegistering:!1})}},async[Ez]({commit:e,dispatch:t},{password:n,token:r,doRedirect:i=!0}){try{if(t(kh,{view:"register",settings:{error:null}}),e(Hr,{isResettingPassword:!0}),!n)throw new Error("Missing param password");if(!r)throw new Error("Missing param token");const{data:o}=await vme(n,r),{email:s}=o;return await t(Vv,{email:s,password:n,doRedirect:i}),!0}catch(o){if(o&&o.code){const s=Az(o.code);s&&t(kh,{view:"register",settings:{error:s}})}return this.handleError(o,{action:Ez,actionPayload:null}),!1}finally{e(Hr,{isResettingPassword:!1})}},[Bv]({commit:e},{next:t={name:"Login"}}={}){try{ot.removeItem("token"),ot.removeItem("tokenExpires"),ot.removeItem("refreshToken"),this.commit("reset")}finally{e(Hr,{isLoggingIn:!1,userId:null,companyId:null})}if(t)try{return this.$router.replace(t)}catch(n){return this.handleError(n,{action:Bv,actionPayload:null}),this.$router.replace({name:"Login"})}return!0},[e5e]({commit:e}){navigator.geolocation.getCurrentPosition(({coords:t})=>{e(o5e,[t.longitude,t.latitude])})}},{SHOW_MESSAGE:a5e,UPDATE_VIEW_SETTINGS:l5e,RESET_VIEW_SETTINGS:c5e,SHOW_ERROR:d5e,RESET_ERROR:u5e}=rC,p5e={...s5e,[a5e](e,t){return ih(t)},[l5e]({commit:e},{view:t,settings:n}){e(ho.SET_VIEW_SETTINGS,{view:t,settings:n})},[c5e]({commit:e}){e(ho.RESET_VIEW_SETTINGS)},[d5e]({commit:e},t){e(ho.SET_ERROR,t)},[u5e]({commit:e}){e(ho.RESET_ERROR)}};function zv(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h5e(e,t){return f5e(e)||m5e(e,t)||g5e(e,t)||y5e()}function f5e(e){if(Array.isArray(e))return e}function m5e(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){i=!0,o=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(i)throw o}}return n}}function g5e(e,t){if(e){if(typeof e=="string")return Mz(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Mz(e,t)}}function Mz(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y5e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
298
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oz(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.reduce(function(t,n){var r=n.split(".").slice(-1)[0];if(t[r])throw new Error("The key `".concat(r,"` is already in use."));return t[r]=n,t},{})}function v5e(e){return Object.keys(e).map(function(t){return[t,e[t]]})}function Uv(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=typeof n[0]=="string"?[].concat(n):[""].concat(n),o=h5e(i,4),s=o[0],a=o[1],l=o[2],c=o[3];return s.length&&s.charAt(s.length-1)!=="/"&&(s+="/"),l="".concat(s).concat(l||"getField"),c="".concat(s).concat(c||"updateField"),e(s,a,l,c)}}function P1(e){return function(t){return t.split(/[.[\]]+/).reduce(function(n,r){return n[r]},e)}}function I1(e,t){var n=t.path,r=t.value;n.split(/[.[\]]+/).reduce(function(i,o,s,a){return a.length===s+1&&(i[o]=r),i[o]},e)}var b5e=Uv(function(e,t,n,r){var i=Array.isArray(t)?Oz(t):t;return Object.keys(i).reduce(function(o,s){var a=i[s],l={get:function(){return this.$store.getters[n](a)},set:function(d){this.$store.commit(r,{path:a,value:d})}};return o[s]=l,o},{})}),w5e=Uv(function(e,t,n,r){var i=Array.isArray(t)?Oz(t):t;return Object.keys(i).reduce(function(o,s){var a=i[s];return o[s]={get:function(){var c=this.$store,d=v5e(c.getters[n](a));return d.map(function(u){return Object.keys(u[1]).reduce(function(p,f){var h="".concat(a,"[").concat(u[0],"].").concat(f);return Object.defineProperty(p,f,{get:function(){return c.getters[n](h)},set:function(g){c.commit(r,{path:h,value:g})}})},{})})}},o},{})}),$1=function(t){var n,r=t.getterType,i=t.mutationType;return n={},zv(n,r,P1),zv(n,i,I1),zv(n,"mapFields",Uv(function(o,s){return b5e(o,s,r,i)})),zv(n,"mapMultiRowFields",Uv(function(o,s){return w5e(o,s,r,i)})),n},jv={exports:{}},CC,Dz;function k5e(){if(Dz)return CC;Dz=1;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function t(r){this.message=r}t.prototype=new Error,t.prototype.name="InvalidCharacterError";function n(r){var i=String(r).replace(/=+$/,"");if(i.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var o=0,s,a,l=0,c="";a=i.charAt(l++);~a&&(s=o%4?s*64+a:a,o++%4)?c+=String.fromCharCode(255&s>>(-2*o&6)):0)a=e.indexOf(a);return c}return CC=typeof window<"u"&&window.atob&&window.atob.bind(window)||n,CC}var TC,Pz;function _5e(){if(Pz)return TC;Pz=1;var e=k5e();function t(n){return decodeURIComponent(e(n).replace(/(.)/g,function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}return TC=function(n){var r=n.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw"Illegal base64url string!"}try{return t(r)}catch{return e(r)}},TC}var Iz;function x5e(){if(Iz)return jv.exports;Iz=1;var e=_5e();function t(n){this.message=n}return t.prototype=new Error,t.prototype.name="InvalidTokenError",jv.exports=function(n,r){if(typeof n!="string")throw new t("Invalid token specified");r=r||{};var i=r.header===!0?0:1;try{return JSON.parse(e(n.split(".")[i]))}catch(o){throw new t("Invalid token specified: "+o.message)}},jv.exports.InvalidTokenError=t,jv.exports}var C5e=x5e();const $z=hr(C5e),T5e={...{userPosition:e=>e.user.position,isLoggingIn:e=>e.user.isLoggingIn,isSuperUser:()=>()=>{const e=ot.getItem("token");if(!e)return!1;const{employee:t}=$z(e);return!!t},isRegistering:e=>e.user.isRegistering,isResettingPassword:e=>e.user.isResettingPassword,isUserLoaded:({user:e})=>e.userId&&e.companyId&&!0||!1,company:({user:e},t,n,r)=>r["companies/companyById"](e.companyId),companyAccount:({user:e},t,n,r)=>(r["companies/companyById"](e.companyId)||{}).CompanyAccount||null,companyAccountType:(e,t)=>(t.companyAccount||{}).accountType||null,accountConfigName:(e,t)=>{var n;return((n=t.companyAccount)==null?void 0:n.accountConfigurationKeyName)||null},companyRegion:(e,t)=>(t.company||{}).region||fn[De.brand].defaultRegion,subscription:(e,t)=>{const{companyAccount:n={}}=t;if(!n)return{};const{freePremiumDays:r=null,accountType:i=null,maxProjectManagers:o=null,freeDocumentsLeft:s=null,paymentMethod:a,billingCycleInterval:l,billingCycleCount:c,showCalloutConvertStripe:d,hasExceededQuota:u,StripeSubscriptions:p,mrr:f,hasFailedPayments:h,allowFailedPaymentToConvertStripe:m,freeBankIdLeft:g,freeSmsLeft:y}=n,w=re(n,"AccountConfiguration.data.defaultNewCompany.freePremiumDays",14),k=[...new Set([...p.map(O=>O.status)])],_=p.some(O=>(O.stripeItems||[]).some(P=>P.stripePriceStripeId.startsWith("plan_"))),M=am.includes(i)&&d&&a==="invoice"&&re(n,"documentQuota.newCount")===1e3&&!re(n,"premiumEndAt");return{type:i,trialDaysLeft:r,maxProjectManagers:o,freeDocumentsLeft:s,paymentMethod:a,billingCycleInterval:l,billingCycleCount:c,showCalloutConvertStripe:am.includes(i)&&d&&a==="invoice",stripeStatuses:k,isPaying:am.includes(i),hasExceededQuota:u,isStripeLegacy:_,isInvoiceLegacy:M,mrr:f,hasFailedPayments:h,allowFailedPaymentToConvertStripe:m,freeBankIdLeft:g,freeSmsLeft:y,initialFreePremiumDays:w}},user:({user:e},t,n,r)=>r["companyUsers/referenceById"](e.userId),feature:()=>Di.checkFeature.bind(Di),can:()=>_1.checkPermission.bind(_1)},getField:P1,modals:e=>e.modals,messages:e=>e.messages,isIncVat:e=>e.priceInputVat==="incVat",viewSettings:e=>t=>e.viewSettings[t],showSearch:e=>e.viewSettings.search.show,error:e=>e.error,socketEnabled:e=>e.socketEnabled,isSocketConnected:e=>e.isSocketConnected},Rz={priceInputVat:"exVat",hideDocArticlePriceInput:!1,user:{position:null,isLoggingIn:!1,isRegistering:!1,isResettingPassword:!1,userId:null,companyId:null},error:null,socketEnabled:!0,isSocketConnected:!1,viewSettings:{app:{isFullPageWindow:!0},nav:{title:null,left:null},projectList:{quickViewProjectId:null},login:{error:null},register:{error:null},search:{show:!1},newDocument:{showOverlayLoader:!1}}},{SET_USER_LOCATION:S5e,SET_USER:E5e}=ho,A5e={...{[S5e](e,t){e.user.position=t},[E5e](e,t){Object.keys(t).forEach(n=>{e.user[n]=t[n]})}},updateField:I1,[ho.SET_VIEW_SETTINGS](e,{view:t,settings:n}){e.viewSettings[t]||(e.viewSettings[t]={}),Object.keys(n).forEach(r=>{e.viewSettings[t][r]=n[r]})},[ho.RESET_VIEW_SETTINGS](e,t){e.viewSettings[t]=JSON.parse(Rz.viewSettings[t])},[ho.SET_ERROR](e,t){e.error=t},[ho.RESET_ERROR](e){e.error=null},[ho.SET_SOCKET_ENABLED](e,t){e.socketEnabled=t},[ho.SET_SOCKET_CONNECTED](e,t){e.isSocketConnected=t}},M5e={namespaced:!0,state:Rz,getters:T5e,actions:p5e,mutations:A5e},fu="articles",{LOAD_ARTICLES:Lz,LOAD_ARTICLE:Hv,SET_ARTICLES:O5e,UPDATE_ARTICLE:SC,DO_CREATE_ARTICLE:Nz,DELETE_ARTICLE:Fz,PATCH_ARTICLE:EC,SEARCH_ARTICLE:Vz,FORM_NEW_ARTICLE:D5e,FORM_EDIT_ARTICLE:P5e,FORM_SUBMIT_ARTICLE:Bz}=sz,{SET_ARTICLES_FETCHING:qv,SET_ARTICLES_POSTING:Ec}=az,I5e={async[Lz]({commit:e},t={}){try{e(qv,!0);const{data:n}=await Ime(t);e(Rt.SET_ARTICLES,{data:n})}catch(n){this.handleError(n,{object:"article",fallbackCode:"article.get",action:`${fu}/${Lz}`})}finally{e(qv,!1)}},async[Hv]({commit:e},{id:t}){try{e(qv,!0);const{data:n}=await $me(t);e(Rt.SET_ARTICLES,{data:n})}catch(n){this.handleError(n,{object:"article",objectId:t,fallbackCode:"article.get",action:`${fu}/${Hv}`,actionPayload:arguments[1]})}finally{e(qv,!1)}},async[SC]({dispatch:e,commit:t},{id:n,body:r}){try{return t(Ec,!0),await Lme(n,r),await e(Hv,{id:n}),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("updatedThing",{thing:ye.t("article")})}),n}catch(i){return this.handleError(i,{object:"article",objectId:n,fallbackCode:"article.put",action:`${fu}/${SC}`,actionPayload:arguments[1]}),null}finally{t(Ec,!1)}},async[Nz]({commit:e},{body:t,showMessage:n=!0}){try{e(Ec,!0);const{data:r}=await Rme(t);return await e(O5e,{data:r}),n&&this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("createdThing",{thing:ye.t("article")})}),r.id}finally{e(Ec,!1)}},async[Fz]({commit:e},{id:t}){try{return e(Ec,!0),await Nme(t),e(Rt.DELETE_ARTICLE,t),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("removedThing",{thing:ye.t("article")}),actions:{undo:()=>{this.dispatch(`articles/${EC}`,{id:t})}}}),t}catch(n){return this.handleError(n,{object:"article",objectId:t,fallbackCode:"article.delete",action:`${fu}/${Fz}`,actionPayload:arguments[1]}),null}finally{e(Ec,!1)}},async[EC]({dispatch:e,commit:t},{id:n}){try{return t(Ec,!0),await Fme(n),await e(Hv,{id:n}),n}catch(r){return this.handleError(r,{object:"article",objectId:n,fallbackCode:"article.patch",action:`${fu}/${EC}`,actionPayload:arguments[1]}),null}finally{t(Ec,!1)}},async[Vz](e,{query:t}){try{if(!t||t.length<=0)return[];const{data:n}=await Vme(t);return n}catch(n){return this.handleError(n,{object:"article",fallbackCode:"article.search",action:`${fu}/${Vz}`,actionPayload:arguments[1]}),[]}},[D5e]({commit:e,rootGetters:t}){const n=t["articles/getNewArticle"]();return e(`forms/${Rt.SET_FORM}`,{key:"article",formData:n},{root:!0})},[P5e]({commit:e,getters:t},{id:n}){const r=t.articleById(n);return e(`forms/${Rt.SET_FORM}`,{key:"article",formData:r},{root:!0})},async[Bz]({rootGetters:e,dispatch:t}){try{const n=e["forms/getFormByKey"]("article");let{id:r}=n;return r?await t(SC,{id:n.id,body:n}):r=await t(Nz,{body:n}),r}catch(n){return this.handleError(n,{object:"article",fallbackCode:"article.submit",action:`${fu}/${Bz}`}),null}}},$5e={getField:P1,articles:e=>e.data,articleIdList:e=>e.ids,articleById:e=>t=>e.data[t],isFetching:e=>e.isFetching,isPosting:e=>e.isPosting,getNewArticle:(e,t,n,r)=>i=>Xs({vat:r["settings/defaultVatRate"],showPrice:!r["settings/hidePriceOnNewlyAddedArticles"],currency:r["settings/defaultCurrency"],...i})},{SET_ARTICLES:R5e,DELETE_ARTICLE:L5e,CLEAR_ARTICLES:N5e,SET_ARTICLES_FETCHING:F5e,SET_ARTICLES_POSTING:V5e}=az,B5e={updateField:I1,[R5e](e,{data:t}){if(typeof t!="object")throw Error("Data must be an article or array of articles!");const n=Array.isArray(t)?t:[t],{ids:r,values:i}=Qa(n);Fo(e.data,i),e.ids=co([...r,...e.ids])},[L5e](e,t=""){delete e.data[t];const n=e.ids.indexOf(t);n!==-1&&e.ids.splice(n,1)},[N5e](e){e.data={},e.ids=[]},[F5e](e,t){e.isFetching=t},[V5e](e,t){e.isPosting=t}},z5e={namespaced:!0,state:{data:{},ids:[],tableDensity:"normal",isFetching:!1,isPosting:!1},getters:$5e,actions:I5e,mutations:B5e},xh=new xt.Entity("files");new xt.Array(xh);const zz=new xt.Entity("projectFiles",{File:xh});new xt.Array(zz);const AC=new xt.Entity("companyUsers");new xt.Array(AC);const MC=new xt.Entity("offers",{Files:[xh]});new xt.Array(MC);const Uz=new xt.Entity("atas",{Files:[xh]});new xt.Array(Uz);const OC=new xt.Entity("projects",{CompanyUser:AC,ProjectMembers:[AC],ProjectFiles:[zz]});Uz.define({Project:OC});const U5e=new xt.Array(OC),j5e=new xt.Entity("articles");new xt.Array(j5e);const jz=new xt.Entity("certificates");new xt.Array(jz);const H5e=new xt.Entity("companies",{CompanyCertificates:[jz]}),q5e=new xt.Array(H5e),Hz=new xt.Entity("companyReferenceItems",{Image:xh,Thumbnail:xh});new xt.Array(Hz);const W5e=new xt.Entity("companyReferences",{CompanyReferenceItems:[Hz]});new xt.Array(W5e);const qz=new xt.Entity("contracts",{Offer:MC});new xt.Array(qz),MC.define({Contract:qz}),new xt.Entity("endCustomers");const G5e=new xt.Entity("notifications",{Project:OC});new xt.Array(G5e);const K5e=new xt.Entity("propertyDesignations");new xt.Array(K5e);const Y5e=new xt.Entity("templateMessages");new xt.Array(Y5e);const R1="companies",{FORM_RESET_OLD:Wz}=Te,{SET_FORM:DC}=Rt.forms,{DO_LOAD_CURRENT_COMPANY:Wv,DO_NORMALIZE_COMPANIES:Gz,DO_UPDATE_CURRENT_COMPANY:Kz,FORM_EDIT_COMPANY:J5e,FORM_SUBMIT_COMPANY:Yz,FORM_NEW_COMPANY_BRANDING:Jz,FORM_EDIT_COMPANY_BRANDING:PC,FORM_SUBMIT_COMPANY_BRANDING:Zz,UPDATE_COMPANY_ACCOUNT_TYPE:Xz}=UB,{SET_COMPANIES_FETCHING:IC,SET_COMPANIES_POSTING:tl}=iC,Z5e={async[Gz](e,{companies:t=[]}){if(!t||!Array.isArray(t)||!t.length)throw new Error("Missing param companies");await this.dispatch(mh,{data:t,schema:q5e})},async[Wv]({commit:e,dispatch:t},{emit:n}={}){var r;try{e(IC,!0);const{data:i}=await Ur.get("/company");return await t(Gz,{companies:[i]}),(r=this.$supportChat)==null||r.syncData(),e(IC,!1),n&&qn.trigger("account:updated"),i}catch(i){throw e(IC,!1),i}},async[Kz]({dispatch:e,commit:t},{body:n}){try{t(tl,!0),await Ur.put("/company",n);const r=await e(Wv);return t(tl,!1),r}catch(r){throw t(tl,!1),r}},async[Xz]({dispatch:e,commit:t},{accountType:n,billingCycleCost:r,billingCycleInterval:i,billingCycleCount:o,premiumSource:s=null,quantity:a}){try{if(t(tl,!0),!n)throw new Error("Missing parameter accountType");if(i&&!o)throw new Error("Param billingCycleCount is required if billingCycleInterval is used");if(!i&&o)throw new Error("Param billingCycleInterval is required if billingCycleCount is used");if((i||o)&&typeof r>"u")throw new Error("Param billingCycleCost is missing");const l={premiumSource:s};return i&&o&&r&&(l.billingCycleInterval=i,l.billingCycleCount=o,l.billingCycleCost=r),typeof a<"u"&&(l.quantity=a),await i1e(n,l),await e(Wv),t(tl,!1),!0}catch(l){return this.handleError(l,{object:"companyAccount",action:`${R1}/${Xz}`}),!1}finally{t(tl,!1)}},async[J5e]({rootGetters:e},{props:t=[]}={}){try{const n=Kp(e["application/company"],t);return this.commit(`forms/${DC}`,{key:"company",formData:n}),!0}catch(n){return this.handleError(n),!1}},async[Yz]({rootGetters:e,dispatch:t}){try{const n=e["forms/getFormByKey"]("company");return await t(Kz,{body:n}),await this.dispatch(Wz,"company"),!0}catch(n){return this.handleError(n,{object:"companies",fallbackCode:"companies.submit",action:`${R1}/${Yz}`}),!1}},async[Jz]({rootGetters:e,dispatch:t}){try{const{CompanyBranding:n}=e["application/company"];if(n&&n.id)return t(PC);const r={about:""};return this.commit(`forms/${DC}`,{key:"companyBranding",formData:r}),!0}catch(n){return this.handleError(n,{object:"companies",action:`${R1}/${Jz}`}),!1}},async[PC]({rootGetters:e}){try{const{CompanyBranding:t}=e["application/company"],n=t;return this.commit(`forms/${DC}`,{key:"companyBranding",formData:n}),!0}catch(t){return this.handleError(t,{object:"companies",action:`${R1}/${PC}`}),!1}},async[Zz]({rootGetters:e,dispatch:t,commit:n}){try{n(tl,!0);const r=e["forms/getFormByKey"]("companyBranding");let{id:i}=r;return i?await Ur.put("/companyBranding",r):{id:i}=await Ur.post("/companyBranding",r),t(Wv),n(tl,!1),await this.dispatch(Wz,"companyBranding"),i}catch(r){return n(tl,!1),this.handleError(r,{object:"companies",fallbackCode:"companies.submit",action:`${R1}/${Zz}`}),!1}}},X5e={companyById:e=>t=>e.data[t],certificateIdListForCurrentCompany:(e,t,n)=>()=>t.certificateIdListForCompany(n.application.user.companyId),certificateIdListForCompany:e=>t=>{const n=e.data[t].CompanyCertificates;return n||[]},isFetching:e=>e.isFetching,isPosting:e=>e.isPosting},{SET_COMPANIES:Q5e,CLEAR_COMPANIES:e4e,SET_COMPANIES_FETCHING:t4e,SET_COMPANIES_POSTING:n4e}=iC,r4e={[Q5e](e,{data:t}){if(typeof t!="object")throw Error("Data must be a company or an array of companies!");const n=Array.isArray(t)?t:[t],{ids:r,values:i}=Qa(n);Fo(e.data,i),e.ids=co([...r,...e.ids])},[e4e](e){e.data={},e.ids=[]},[t4e](e,t){e.isFetching=t},[n4e](e,t){e.isPosting=t}},i4e={namespaced:!0,state:{data:{},ids:[],isFetching:!1,isPosting:!1},getters:X5e,actions:Z5e,mutations:r4e},Ac="companyUsers",{LOAD_COMPANY_USERS:Qz,LOAD_COMPANY_USER:Gv,DO_NORMALIZE_COMPANY_USERS:Kv,UPDATE_COMPANY_USER:$C,CREATE_COMPANY_USER:RC,DELETE_COMPANY_USER:eU,PATCH_COMPANY_USER:LC,FORM_NEW_COMPANY_USER:o4e,FORM_EDIT_COMPANY_USER:s4e,FORM_SUBMIT_COMPANY_USER:tU}=lz,{SET_AS_NORMALIZED_DATA:a4e,FORM_RESET_OLD:l4e,DELETE_FILE:c4e}=Te,{SET_COMPANY_USERS_FETCHING:Yv,SET_COMPANY_USERS_POSTING:Mc}=cC,d4e={async[Kv](e,{companyUsers:t=[]}){if(!t||!Array.isArray(t)||!t.length)throw new Error("Missing param companyUsers");await this.dispatch(a4e,{data:t,schema:"companyUsers"})},async[Qz]({dispatch:e,commit:t}){try{t(Yv,!0);const{data:n}=await Xme();await e(Kv,{companyUsers:n})}catch(n){this.handleError(n,{object:"companyUser",fallbackCode:"companyUser.getAll",action:`${Ac}/${Qz}`})}finally{t(Yv,!1)}},async[Gv]({commit:e,dispatch:t,rootGetters:n},{id:r}){try{e(Yv,!0);const{data:i}=await Qme(r);await t(Kv,{companyUsers:[i]});const{id:o}=n["application/user"]||{};return r===o&&(ye.locale!==i.locale&&ye.changeLocale(i.locale),ye.lang!==i.language&&(ye.changeLanguage(i.language),location&&location.reload())),r}catch(i){return this.handleError(i,{object:"companyUser",objectId:r,fallbackCode:"companyUser.get",action:`${Ac}/${Gv}`,actionPayload:arguments[1]}),null}finally{e(Yv,!1)}},async[RC]({commit:e,dispatch:t,rootGetters:n},{body:r}){try{const{language:i,locale:o}=n["application/user"]||{},s={language:i||"en",locale:o||"en-US",...r};e(Mc,!0);const{data:a}=await e1e(s);return await t(Kv,{companyUsers:[a]}),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("sentThingTo",{thing:ye.t("invitation"),recipient:a.email})}),a.id}catch(i){return this.handleError(i,{object:"companyUser",fallbackCode:"companyUser.post",action:`${Ac}/${RC}`,actionPayload:arguments[1]}),null}finally{e(Mc,!1)}},async[$C]({dispatch:e,commit:t,getters:n},{id:r,body:i}){var o;try{t(Mc,!0);const{AvatarPublicId:s}=i,{AvatarPublicId:a}=n.byId(r);return s&&s!==a&&this.dispatch(c4e,{id:a}),await t1e(r,i),await e(Gv,{id:r}),(o=this.$supportChat)==null||o.syncData(),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("updatedThing",{thing:ye.t("user")})}),r}catch(s){return this.handleError(s,{object:"companyUser",objectId:r,fallbackCode:"companyUser.put",action:`${Ac}/${$C}`,actionPayload:arguments[1]}),null}finally{t(Mc,!1)}},async[eU]({commit:e},{id:t}){try{return e(Mc,!0),await n1e(t),e(cC.DELETE_COMPANY_USER,t),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("removedThing",{thing:ye.t("user")}),actions:{undo:()=>{this.dispatch(`${Ac}/${LC}`,{id:t})}}}),t}catch(n){return this.handleError(n,{object:"companyUser",objectId:t,fallbackCode:"companyUser.delete",action:`${Ac}/${eU}`,actionPayload:arguments[1]}),null}finally{e(Mc,!1)}},async[LC]({dispatch:e,commit:t},{id:n}){try{return t(Mc,!0),await r1e(n),await e(Gv,{id:n}),n}catch(r){return this.handleError(r,{object:"companyUser",objectId:n,fallbackCode:"companyUser.patch",action:`${Ac}/${LC}`,actionPayload:arguments[1]}),null}finally{t(Mc,!1)}},[o4e]({commit:e,rootGetters:t}){let n="en";const r=t["application/user"];r.language&&({language:n}=r);const i={AvatarPublicId:null,CompanyId:null,CompanyUserPermission:{manageCompany:!1,manageUsers:!1,manageProjects:!1,manageOwnProjects:!1,showPrices:!1,manageAtas:!1,manageOwnAtas:!1},cellphone:null,cellphoneRegion:null,email:null,finishedGuide:!1,firstname:null,id:null,language:n,lastActive:null,lastname:null,resetPasswordExpires:null,resetPasswordToken:null};return e(`forms/${Rt.SET_FORM}`,{key:"companyUser",formData:i},{root:!0})},[s4e]({commit:e,getters:t},{id:n,props:r=[]}){const i=Kp(t.byId(n),r);return e(`forms/${Rt.SET_FORM}`,{key:"companyUser",formData:i},{root:!0})},async[tU]({rootGetters:e,dispatch:t}){try{const n=e["forms/getFormByKey"]("companyUser");let{id:r}=n;return r?await t($C,{id:n.id,body:n}):r=await t(RC,{body:n}),await this.dispatch(l4e,"companyUser"),!0}catch(n){return this.handleError(n,{object:"companyUser",action:`${Ac}/${tU}`,actionPayload:arguments[1]}),!1}}},u4e={referenceById:e=>t=>e.data[t],byId:e=>t=>{const n=e.data[t];if(!n)return null;const{firstname:r,lastname:i}=n;return{...n,fullName:`${r||""} ${i||""}`.trim(),role:Ufe(n.CompanyUserPermission),avatarUrl:`${De.api.baseUrl}/file/${n.AvatarPublicId}/download`}},all:(e,t)=>{const n={};return e.ids.forEach(r=>{n[r]=t.byId(r)}),n},isPosting:e=>e.isPosting,isFetching:e=>e.isFetching},{SET_COMPANY_USERS:p4e,DELETE_COMPANY_USER:h4e,CLEAR_COMPANY_USERS:f4e,SET_COMPANY_USERS_FETCHING:m4e,SET_COMPANY_USERS_POSTING:g4e}=cC,y4e={[p4e](e,{data:t=[]}){if(typeof t!="object")throw Error("Data must be a company user or an array of company users!");const n=Array.isArray(t)?t:[t],{ids:r,values:i}=Qa(n);Fo(e.data,i),e.ids=co([...r,...e.ids])},[h4e](e,t){delete e.data[t];const n=e.ids.indexOf(t);n!==-1&&e.ids.splice(n,1)},[f4e](e){e.data={},e.ids=[]},[m4e](e,t){e.isFetching=t},[g4e](e,t){e.isPosting=t}},v4e={namespaced:!0,state:{data:{},ids:[],isFetching:!1,isPosting:!1},getters:u4e,actions:d4e,mutations:y4e};var NC,nU;function rU(){if(nU)return NC;nU=1;var e=i_(),t=bh(),n=m_(),r=Js(),i=wh();function o(s,a,l,c){if(!r(s))return s;a=t(a,s);for(var d=-1,u=a.length,p=u-1,f=s;f!=null&&++d<u;){var h=i(a[d]),m=l;if(h==="__proto__"||h==="constructor"||h==="prototype")return s;if(d!=p){var g=f[h];m=c?c(g,h,f):void 0,m===void 0&&(m=r(g)?g:n(a[d+1])?[]:{})}e(f,h,m),f=f[h]}return s}return NC=o,NC}var FC,iU;function b4e(){if(iU)return FC;iU=1;var e=rU();function t(n,r,i){return n==null?n:e(n,r,i)}return FC=t,FC}var w4e=b4e();const dr=hr(w4e),Ch="documents2",{DELETE_DOCUMENT2:oU,DO_CREATE_DOCUMENT2:k4e,DO_LOAD_DOCUMENT2:mu,DO_LOAD_DOCUMENTS2:sU,DO_UPDATE_DOCUMENT2:Jv,LOAD_DOCUMENT2:aU,LOAD_DOCUMENTS2:VC,LOAD_DOCUMENTS2_EXTERNAL:_4e,PATCH_DOCUMENT2:BC,UPDATE_DOCUMENT2:lU,UPDATE_DOCUMENT2_STATUS:cU,DO_SEND_DOCUMENT2:x4e,SEND_REMINDER_DOCUMENT2:C4e,REQUEST_PROPERTY_DOCUMENT2:T4e,CLEAR_DOCUMENT2_ANSWERS:dU,ANSWER_OWN_DOCUMENT2:S4e}=jB,{DELETE_MANY_DOCUMENTS2:E4e,SET_DOCUMENT2_POSTING:ui,SET_DOCUMENT2_FETCHING:Zv,SET_DOCUMENTS2:uU}=oC,{SHOW_MESSAGE:A4e,DO_LOAD_CURRENT_COMPANY:M4e}=Te,O4e={async[mu]({commit:e},{id:t,emit:n=!1}){try{e(Zv,!0);const{data:r}=await Gi.get(t);return n&&qn.trigger("document:watch",r),e(uU,{data:[r]}),r}catch(r){throw r}finally{e(Zv,!1)}},async[sU]({commit:e},t={}){try{e(Zv,!0);const{data:n}=await Gi.getAll(t),{items:r}=n;e(uU,{data:r})}catch(n){throw n}finally{e(Zv,!1)}},async[VC]({dispatch:e},t={isHidden:!1}){try{await e(sU,t)}catch(n){this.handleError(n,{object:"document2",fallbackCode:"document2.getMany",action:`${Ch}/${VC}`})}},async[_4e]({dispatch:e},{service:t,type:n=null,typeId:r=null}){if(typeof t>"u")throw new Error("Missing param service");await e(VC,{isHidden:!1,"externalReferences.service":t,...n&&{"externalReferences.type":n},...r&&{"externalReferences.typeId":r}})},async[aU]({dispatch:e},{id:t,emit:n}){try{return await e(mu,{id:t,emit:n})}catch(r){this.handleError(r,{object:"document2",fallbackCode:"document2.getOne",action:`${Ch}/${aU}`,actionPayload:arguments[1]})}},async[k4e]({rootGetters:e,commit:t,dispatch:n},{body:r}){try{t(ui,!0);const{data:i}=await Gi.post(r),{id:o}=i;return await n(mu,{id:o}),qn.trigger("document:create",i),qn.trigger("document:save",i),e["application/companyAccountType"]==="free"&&await this.dispatch(M4e),o}catch(i){throw i}finally{t(ui,!1)}},async[x4e]({state:e,commit:t},{id:n}){try{t(ui,!0),await Gi.send(n),qn.trigger("document:send",e.data[n]),["extension","widget"].includes(gr.value)||this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("sentThing",{thing:ye.t("document")})})}catch(r){throw r}finally{t(ui,!1)}},async[C4e]({commit:e},{id:t,body:n={}}){try{const r={views:{sms:{nodes:[{nodeId:1,parentId:null,itemId:"smsText",itemType:"smsText",value:{text:"data.smsTemplate.reminder.text"}}]},email:{nodes:[{nodeId:1,parentId:null,itemId:"emailTemplate",itemType:"emailTemplate",value:{subject:"data.emailTemplate.reminder.subject",title:"data.emailTemplate.reminder.title",content:"data.emailTemplate.reminder.content",text:"data.emailTemplate.reminder.text"}}]}}};e(ui,!0),await Gi.send(t,{...r,...n,sendSource:"reminder"}),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("sentThing",{thing:ye.t("reminder")})})}catch(r){throw r}finally{e(ui,!1)}},async[T4e]({commit:e},{id:t,body:n={}}){try{const r={views:{sms:{nodes:[{nodeId:1,parentId:null,itemId:"smsText",itemType:"smsText",value:{text:"data.smsTemplate.propertyDesignation.text"}}]},email:{nodes:[{nodeId:1,parentId:null,itemId:"emailTemplate",itemType:"emailTemplate",value:{subject:"data.emailTemplate.propertyDesignation.subject",title:"data.emailTemplate.propertyDesignation.title",content:"data.emailTemplate.propertyDesignation.content",text:"data.emailTemplate.propertyDesignation.text",actionUrl:"data.emailTemplate.propertyDesignation.actionUrl"}}]}}},{data:i}=await Gi.get(t),o=a=>ye.t(`propertyDesignationRequest.${a}`,{ns:"actions",interpolation:{prefix:"__",suffix:"__"}});dr(i,"data.smsTemplate.propertyDesignation",{text:o("smsTemplate.text")}),dr(i,"data.emailTemplate.propertyDesignation",{subject:o("emailTemplate.subject"),title:o("emailTemplate.title"),content:o("emailTemplate.content"),text:o("emailTemplate.text"),actionUrl:o("emailTemplate.actionUrl")});const s={...r,document:i,clients:[i.clients[0]]};e(ui,!0),await Gi.send(t,{...s,...n,sendSource:"propertyDesignation"}),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("actions:propertyDesignationRequest.successMessage")})}catch(r){throw r}finally{e(ui,!1)}},async[Jv]({state:e,dispatch:t,commit:n},{id:r,body:i,params:o={},showMessage:s=!0}){try{n(ui,!0),await Gi.put(r,i,o),await t(mu,{id:r});const a=e.data[r];return qn.trigger("document:update",a),qn.trigger("document:save",a),s&&!["extension","widget"].includes(gr.value)&&this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("updatedThing",{thing:ye.t("document")})}),r}catch(a){throw a}finally{n(ui,!1)}},async[lU]({dispatch:e},{id:t,body:n,params:r={}}){try{return await e(Jv,{id:t,body:n,params:r}),t}catch(i){return this.handleError(i,{object:"document2",objectId:t,fallbackCode:"document2.put",action:`${Ch}/${lU}`,actionPayload:arguments[1]}),null}},async[oU]({commit:e},{id:t}){try{return e(ui,!0),await Gi.delete(t),e(E4e,t),qn.trigger("document:remove",t),gr.value!=="widget"&&this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("removedThing",{thing:ye.t("document")}),actions:{undo:()=>{this.dispatch(`documents2/${BC}`,{id:t})}}}),t}catch(n){return this.handleError(n,{object:"document2",objectId:t,fallbackCode:"document2.delete",action:`${Ch}/${oU}`,actionPayload:arguments[1]}),null}finally{e(ui,!1)}},async[BC]({commit:e,dispatch:t},{id:n}){try{return e(ui,!0),await Gi.patch(n),await t(mu,{id:n}),n}catch(r){return this.handleError(r,{object:"document2",objectId:n,fallbackCode:"document2.patch",action:`${Ch}/${BC}`,actionPayload:arguments[1]}),null}finally{e(ui,!1)}},async[cU]({dispatch:e,getters:t},{id:n,status:r}){try{const{hasAnswers:i}=t.byId(n)||{};return i&&!["accepted","denied"].includes(r)?await this.dispatch(A4e,{displayType:"dialog",type:"warning",title:ye.t("actions:updateDocumentDialog.title"),message:ye.t("actions:updateDocumentDialog.message"),actions:{cancel:{text:ye.t("actions:updateDocumentDialog.cancel"),callback:"cancel"},submit:{text:ye.t("actions:updateDocumentDialog.submit"),callback:async()=>{await e(dU,{id:n,doFetch:!1}),await e(Jv,{id:n,body:{status:r}})}}}}):await e(Jv,{id:n,body:{status:r}}),n}catch(i){return this.handleError(i,{object:"document2",objectId:n,fallbackCode:"document2.updateStatus",action:`${Ch}/${cU}`,actionPayload:arguments[1]}),null}},async[dU]({dispatch:e},{id:t,doFetch:n=!0}){await Gi.clearAnswers(t),n&&await e(mu,{id:t})},async[S4e]({commit:e,dispatch:t},{id:n,publicId:r,body:i,checksum:o}){try{e(ui,!0);const s={docChecksum:o},{data:a}=await Jp.answer(r,i,{},s);return await t(mu,{id:n}),a}catch(s){throw s}finally{e(ui,!1)}}};var Xv={exports:{}},D4e=Xv.exports,pU;function P4e(){return pU||(pU=1,function(e,t){(function(n,r){e.exports=r()})(D4e,function(){Array.isArray||(Array.isArray=function(o){return Object.prototype.toString.call(o)==="[object Array]"});function n(o){for(var s=[],a=0,l=o.length;a<l;a++)s.indexOf(o[a])===-1&&s.push(o[a]);return s}var r={},i={"==":function(o,s){return o==s},"===":function(o,s){return o===s},"!=":function(o,s){return o!=s},"!==":function(o,s){return o!==s},">":function(o,s){return o>s},">=":function(o,s){return o>=s},"<":function(o,s,a){return a===void 0?o<s:o<s&&s<a},"<=":function(o,s,a){return a===void 0?o<=s:o<=s&&s<=a},"!!":function(o){return r.truthy(o)},"!":function(o){return!r.truthy(o)},"%":function(o,s){return o%s},log:function(o){return console.log(o),o},in:function(o,s){return!s||typeof s.indexOf>"u"?!1:s.indexOf(o)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(o,s,a){if(a<0){var l=String(o).substr(s);return l.substr(0,l.length+a)}return String(o).substr(s,a)},"+":function(){return Array.prototype.reduce.call(arguments,function(o,s){return parseFloat(o,10)+parseFloat(s,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(o,s){return parseFloat(o,10)*parseFloat(s,10)})},"-":function(o,s){return s===void 0?-o:o-s},"/":function(o,s){return o/s},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(o,s){return o.concat(s)},[])},var:function(o,s){var a=s===void 0?null:s,l=this;if(typeof o>"u"||o===""||o===null)return l;for(var c=String(o).split("."),d=0;d<c.length;d++)if(l==null||(l=l[c[d]],l===void 0))return a;return l},missing:function(){for(var o=[],s=Array.isArray(arguments[0])?arguments[0]:arguments,a=0;a<s.length;a++){var l=s[a],c=r.apply({var:l},this);(c===null||c==="")&&o.push(l)}return o},missing_some:function(o,s){var a=r.apply({missing:s},this);return s.length-a.length>=o?[]:a}};return r.is_logic=function(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.keys(o).length===1},r.truthy=function(o){return Array.isArray(o)&&o.length===0?!1:!!o},r.get_operator=function(o){return Object.keys(o)[0]},r.get_values=function(o){return o[r.get_operator(o)]},r.apply=function(o,s){if(Array.isArray(o))return o.map(function(g){return r.apply(g,s)});if(!r.is_logic(o))return o;var a=r.get_operator(o),l=o[a],c,d,u,p,f;if(Array.isArray(l)||(l=[l]),a==="if"||a=="?:"){for(c=0;c<l.length-1;c+=2)if(r.truthy(r.apply(l[c],s)))return r.apply(l[c+1],s);return l.length===c+1?r.apply(l[c],s):null}else if(a==="and"){for(c=0;c<l.length;c+=1)if(d=r.apply(l[c],s),!r.truthy(d))return d;return d}else if(a==="or"){for(c=0;c<l.length;c+=1)if(d=r.apply(l[c],s),r.truthy(d))return d;return d}else{if(a==="filter")return p=r.apply(l[0],s),u=l[1],Array.isArray(p)?p.filter(function(g){return r.truthy(r.apply(u,g))}):[];if(a==="map")return p=r.apply(l[0],s),u=l[1],Array.isArray(p)?p.map(function(g){return r.apply(u,g)}):[];if(a==="reduce")return p=r.apply(l[0],s),u=l[1],f=typeof l[2]<"u"?l[2]:null,Array.isArray(p)?p.reduce(function(g,y){return r.apply(u,{current:y,accumulator:g})},f):f;if(a==="all"){if(p=r.apply(l[0],s),u=l[1],!Array.isArray(p)||!p.length)return!1;for(c=0;c<p.length;c+=1)if(!r.truthy(r.apply(u,p[c])))return!1;return!0}else if(a==="none"){if(p=r.apply(l[0],s),u=l[1],!Array.isArray(p)||!p.length)return!0;for(c=0;c<p.length;c+=1)if(r.truthy(r.apply(u,p[c])))return!1;return!0}else if(a==="some"){if(p=r.apply(l[0],s),u=l[1],!Array.isArray(p)||!p.length)return!1;for(c=0;c<p.length;c+=1)if(r.truthy(r.apply(u,p[c])))return!0;return!1}}if(l=l.map(function(g){return r.apply(g,s)}),i.hasOwnProperty(a)&&typeof i[a]=="function")return i[a].apply(s,l);if(a.indexOf(".")>0){var h=String(a).split("."),m=i;for(c=0;c<h.length;c++){if(!m.hasOwnProperty(h[c]))throw new Error("Unrecognized operation "+a+" (failed at "+h.slice(0,c+1).join(".")+")");m=m[h[c]]}return m.apply(s,l)}throw new Error("Unrecognized operation "+a)},r.uses_data=function(o){var s=[];if(r.is_logic(o)){var a=r.get_operator(o),l=o[a];Array.isArray(l)||(l=[l]),a==="var"?s.push(l[0]):l.forEach(function(c){s.push.apply(s,r.uses_data(c))})}return n(s)},r.add_operation=function(o,s){i[o]=s},r.rm_operation=function(o){delete i[o]},r.rule_like=function(o,s){if(s===o||s==="@")return!0;if(s==="number")return typeof o=="number";if(s==="string")return typeof o=="string";if(s==="array")return Array.isArray(o)&&!r.is_logic(o);if(r.is_logic(s)){if(r.is_logic(o)){var a=r.get_operator(s),l=r.get_operator(o);if(a==="@"||a===l)return r.rule_like(r.get_values(o,!1),r.get_values(s,!1))}return!1}if(Array.isArray(s))if(Array.isArray(o)){if(s.length!==o.length)return!1;for(var c=0;c<s.length;c+=1)if(!r.rule_like(o[c],s[c]))return!1;return!0}else return!1;return!1},r})}(Xv)),Xv.exports}var I4e=P4e(),zC,hU;function fU(){if(hU)return zC;hU=1;var e=Hp(),t=W_(),n=Ka(),r="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,a=o.hasOwnProperty,l=s.call(Object);function c(d){if(!n(d)||e(d)!=r)return!1;var u=t(d);if(u===null)return!0;var p=a.call(u,"constructor")&&u.constructor;return typeof p=="function"&&p instanceof p&&s.call(p)==l}return zC=c,zC}var $4e=fU();const R4e=hr($4e);function L4e(e,t){const n=[],r=new Map,i=()=>{r.forEach(o=>n.push(o)),r.clear()};return e.forEach(o=>{var s,a,l;if(t.includes(o.code)){const c=o.code+((a=(s=o.data)==null?void 0:s.client)==null?void 0:a.id)||((l=o.data)==null?void 0:l.email),d=r.get(c);d?d.children.push(o):r.set(c,{...o,children:[]})}else i(),n.push(o)}),r.size&&i(),n}const mU=({nodes:e,data:t})=>{const n=[];return e.forEach(r=>{let i=r.isVisible===void 0;i||(i=r.isVisible&&typeof r.isVisible=="object"?I4e.apply(Ffe(r.isVisible,["_uniqueId"]),t):!!r.isVisible),i&&n.push(r),r&&Array.isArray(r.children)&&r.children.length&&(r.children=mU({nodes:r.children,data:t}))}),n},UC=[{cutoffDate:new Date("2026-01-01"),constants:{rot:{max:5e4*100,ratio:.3},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot20:{max:5e4*100,ratio:.2},greenRot50:{max:5e4*100,ratio:.5}}},{cutoffDate:new Date("2025-05-12"),constants:{rot:{max:5e4*100,ratio:.5},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot20:{max:5e4*100,ratio:.2},greenRot50:{max:5e4*100,ratio:.5}}},{cutoffDate:new Date("2025-01-01"),constants:{rot:{max:5e4*100,ratio:.3},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot20:{max:5e4*100,ratio:.2},greenRot50:{max:5e4*100,ratio:.5}}},{cutoffDate:new Date("2024-07-01"),constants:{rot:{max:75e3*100,ratio:.3},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot20:{max:5e4*100,ratio:.2},greenRot50:{max:5e4*100,ratio:.5}}},{cutoffDate:null,constants:{rot:{max:5e4*100,ratio:.3},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot20:{max:5e4*100,ratio:.2},greenRot50:{max:5e4*100,ratio:.5}}}],N4e=e=>{var n;if(e){const r=new Date(e),i=UC.find(({cutoffDate:o})=>!o||r>=o);return i==null?void 0:i.constants}return(n=UC.filter(({cutoffDate:r})=>!r||r<=new Date)[0])==null?void 0:n.constants},F4e=()=>{const e=new Date;return UC.filter(n=>n.cutoffDate&&n.cutoffDate>e).map(n=>({date:n.cutoffDate,label:n.cutoffDate.toISOString().split("T")[0],constants:n.constants}))},jC=(e,t,n,r)=>{const i=N4e(r);if(!i[e])throw new Error("Missing param type");const{max:o,ratio:s}=i[e],a=Math.min(n*o,t*s);return Math.floor(a/100)*100},Qv=({type:e="fixed",currency:t,maxTotal:n=null,articles:r=[],clients:i=[],region:o={},useVat:s,rounding:a})=>{if(typeof s>"u")throw new Error("Missing param useVat");if(typeof s!="boolean")throw new Error("Param useVat must be a boolean");if(typeof a!="object"||a===null)throw new Error("Param rounding must be a object");if(typeof a.enabled>"u")throw new Error("Missing param rounding.enabled");if(typeof a.enabled!="boolean")throw new Error("Param rounding.enabled must be a boolean");if(typeof a.interval>"u")throw new Error("Missing param rounding.interval");if(typeof a.interval!="number")throw new Error("Param rounding.interval must be a number");if(typeof a.show>"u")throw new Error("Missing param rounding.show");if(typeof a.show!="boolean")throw new Error("Param rounding.show must be a boolean");let l=o.houseWorkManualAmount||o.houseWorkAmount||null;l&&(l=Math.floor(l/100)*100);const c={type:e,subTotal:0,taxAmount:0,roundingAmount:0,total:0,currency:t,maxTotal:e==="openAccMaxPrice"?n||0:null,region:{country:"sweden",houseWorkType:null,reverseVat:!!i.find(p=>re(p,"region.reverseVat")),houseWorkManualAmount:o.houseWorkManualAmount||null,houseWorkWork:0,houseWorkAmount:l,deductionDate:o.deductionDate||null},helpers:{discount:0,isIndivid:!i.find(p=>p.type==="company"),noOfClients:i.length||1},useVat:s,rounding:{enabled:a.enabled,interval:a.interval,show:a.show}},d=p=>p/100;if(c.helpers.isIndivid&&!c.region.reverseVat){const p=[...r].sort((f,h)=>new Date(h.updatedAt).getTime()-new Date(f.updatedAt).getTime()).find(Jy);p&&!c.region.houseWorkType&&(c.region.houseWorkType=Zy(p))}for(let p of r){p=ru(p);const{totalAmount:f,currency:h,priceType:m,discount:g,discountType:y}=p;let{vat:w}=p;w===null&&(w=0),s||(w=0),["fixed","approx"].includes(m)&&(c.currency=h,c.subTotal+=f,c.taxAmount+=f*d(w),c.helpers.discount+=y==="percentage"?f/((100-g/100)/100)-f:g,c.region.houseWorkType&&Jy(p)&&(c.region.houseWorkWork+=f*((100+w)/100)))}!c.helpers.isIndivid&&c.region.reverseVat&&(c.taxAmount=0),c.region.houseWorkType&&c.region.houseWorkAmount===null&&(c.region.houseWorkAmount=jC(c.region.houseWorkType,c.region.houseWorkWork,c.helpers.noOfClients,c.region.deductionDate));const u=c.subTotal+c.taxAmount-c.region.houseWorkAmount;return c.roundingAmount=a.enabled&&a.interval?Math.round(u/a.interval)*a.interval-u:0,c.total=u+c.roundingAmount,Cx(c),c},V4e=e=>{if(!e)return null;const{currency:t,clients:n=[],articles:r=[],acceptedAt:i}=e,o=re(e,"data.packageGroups",{}),s=re(e,"data.formSettings.useVat",!0),a={enabled:re(e,"data.formSettings.rounding.enabled",!1),interval:re(e,"data.formSettings.rounding.interval",1),show:re(e,"data.formSettings.rounding.show",!0)},l=[],c=[];let d=null,u=null,p=null;const f=re(e,"data.prices.region.deductionDate");if(Object.keys(o).forEach(y=>{const w=o[y].packages.filter(({isSelected:_})=>_);c.push(...w.map(({packageId:_})=>_));const k=re(w,"[0].data.prices.type","fixed");l.push(...Array.isArray(k)?k:[k]),w.forEach(_=>{const{maxTotal:M=null,region:S}=re(_,"data.prices")||{};k==="openAccMaxPrice"&&!Number.isNaN(Number.parseInt(M,10))&&(d+=M),S&&!Number.isNaN(Number.parseInt(S.houseWorkManualAmount,10))&&(u+=S.houseWorkManualAmount)})}),!l.length){const y=re(e,"data.prices.type","fixed");l.push(...Array.isArray(y)?y:[y])}const h=r.filter(({packageId:y})=>!y||c.includes(y)),m=h.filter(Jy),g={};for(let y of m){if(y=ru(y),!["fixed","approx"].includes(y.priceType))continue;const w=Zy(y),k=s?y.vat:0;g[w]||(g[w]=null),g[w]+=y.totalAmount*((100+k)/100)}for(const[y,w]of Object.entries(g))w&&(p+=jC(y,w,n.length||1,f||i));return{...Qv({currency:t,articles:h,clients:n,region:{houseWorkManualAmount:u,houseWorkAmount:p,deductionDate:f||i},useVat:s,rounding:a}),type:l,maxTotal:d}},B4e=e=>{const t=i=>ye.t(`_common:documentMentions.${i}`),n=!!re(e,"clients.0"),r={clientName:{key:"clients.0.name",meta:{inputDisabled:!n,virtual:!0}},clientEmail:{key:"clients.0.email",meta:{inputDisabled:!n,virtual:!0}},clientPhone:{key:"clients.0.cellphone",meta:{inputDisabled:!n,virtual:!0}},clientCompany:{key:"clients.0.companyName",meta:{inputDisabled:!n,virtual:!0}},clientAddress:{key:"clients.0.addresses.standard.street",meta:{inputDisabled:!n,virtual:!0}},clientZip:{key:"clients.0.addresses.standard.zip",meta:{inputDisabled:!n,virtual:!0}},clientCity:{key:"clients.0.addresses.standard.city",meta:{inputDisabled:!n,virtual:!0}},clientSocialNo:{key:"clients.0.socialNo",meta:{inputDisabled:!0,virtual:!0}},clientOrgNo:{key:"clients.0.orgNo",meta:{inputDisabled:!0,virtual:!0}},senderName:{key:"companyUser.fullName",meta:{inputDisabled:!0,virtual:!0}},senderEmail:{key:"companyUser.email",meta:{inputDisabled:!0,virtual:!0}},senderPhone:{key:"companyUser.cellphone",meta:{inputDisabled:!0,virtual:!0}},senderCompany:{key:"company.name",meta:{inputDisabled:!0,virtual:!0}},senderAddress:{key:"company.street",meta:{inputDisabled:!0,virtual:!0}},senderZip:{key:"company.zip",meta:{inputDisabled:!0,virtual:!0}},senderCity:{key:"company.city",meta:{inputDisabled:!0,virtual:!0}},documentName:{key:"data.name",meta:{inputDisabled:!1,virtual:!0}},sentAt:{key:"sentAt",filter:"formatDate",meta:{inputDisabled:!0,virtual:!0}},expiresAt:{key:"data.expiresAt",filter:"formatDate",meta:{inputDisabled:!0,virtual:!0}}};for(const i of Object.keys(r)){r[i].label=t(i);const o=re(e,r[i].key)||"";r[i].value=r[i].filter==="formatDate"?ye.formatDate(o):o}return r},Th=e=>e?Object.keys(e).reduce((t,n)=>e[n]||e[n]===!1?{...t,[n]:e[n]}:t,{}):{};function gU(e){if(!e||!e.data)return e;const t=fn[De.brand].defaultRegion==="SE",n={useVat:t,vatType:"vat",rounding:{enabled:t,interval:t?100:1,show:t}};e.data.formSettings||(e.data.formSettings={});const r=eN(n);return Object.keys(r).forEach(i=>{function o(s,a,l){R4e(s[a])?Object.keys(s[a]).forEach(c=>{o(s[a],c,l)}):Array.isArray(s[a])?s[a].forEach((c,d)=>{o(s[a],d,l)}):typeof re(s,a)>"u"&&dr(s,a,l)}o(e.data.formSettings,i,r[i])}),e}const yU=e=>{if(!e||typeof e!="string")return e;if(/^https:\/\/[\w.-]+\.s3\.[\w-]+\.amazonaws\.com\/.*/.test(e)){const n=new URLSearchParams({url:e});return`${De.api.baseUrl}/public/fileProxy?${n.toString()}`}return e},z4e=Object.values(fn).map(e=>e.domain),vU=(e,t)=>{if(!e||typeof e!="string"||/^data:/i.test(e))return e;const{h:n,w:r,auto:i}=t||{},o=new URL(yU(e)),{hostname:s}=o;if(!z4e.some(l=>s.includes(l)))return o.toString();const a=new URLSearchParams(o.search);return n&&a.set("h",String(n)),r&&a.set("w",String(r)),i&&a.set("auto",i),o.search=a.toString(),o.toString()},U4e=e=>{if(!e)return null;let t=(e||"").replace(/^SE|[-]/g,"").trim();return t.length===12&&(t=t.substring(2)),`SE${t}01`},L1=()=>{const e=["email"];return Di.checkFeature("sms")&&Di._isValidCompanySetting("deliveryDefaultSms")&&e.push("sms"),{region:{country:"sweden"},permissions:{write:["clients[*].socialNo","clients[0].region.propertyDesignation","data.rejectReasons","data.packageGroups[*].packages[*].isSelected"]},answer:null,deliveryTypes:e,documentRole:"signee",answerMethod:{accept:"signature",deny:"button"},signOrder:0,_uniqueId:zt()}},HC=(e,t)=>{const n={endCustomerId:e.id,type:e.customerType,name:e.customerType==="individual"?e.name:e.reference,socialNo:e.customerType==="individual"?e.org_no:null,companyName:e.customerType==="company"?e.name:null,orgNo:e.customerType==="company"?e.org_no:null,email:e.email,cellphone:e.cellphone,cellphoneRegion:e.cellphoneRegion,addresses:{...e.street||e.zip||e.city?{standard:{street:e.street,zip:`${e.zip||""}`,city:e.city,country:e.country,latitude:e.latitude?`${e.latitude}`:null,longitude:e.longitude?`${e.longitude}`:null}}:{},...e.workStreet||e.workZip||e.workCity?{work:{street:e.workStreet,zip:`${e.workZip||""}`,city:e.workCity,country:e.country,latitude:e.latitude?`${e.latitude}`:null,longitude:e.longitude?`${e.longitude}`:null}}:{}},vatNumber:e.vatNumber,region:{...t&&t.region,reverseVat:e.reverseVat&&e.customerType==="company"},documentRole:re(t,"documentRole","signee"),signOrder:re(t,"signOrder",0)};return{...L1(),...t,...n}},j4e=(e={})=>{const t=e,n=re(t,"addresses.standard",{}),r=re(t,"addresses.work",{});return{id:t.endCustomerId,EndCustomerId:t.endCustomerId,customerType:t.type||"individual",name:t.type==="individual"?t.name:t.companyName,email:t.email,cellphone:t.cellphone,cellphoneRegion:t.cellphoneRegion,org_no:t.type==="individual"?t.socialNo:t.orgNo,street:n.street,zip:n.zip,city:n.city,workStreet:r.street,workZip:r.zip,workCity:r.city,vatNumber:t.vatNumber||U4e(t.orgNo)||"",separateWorkAddress:!!Object.keys(r).length,reverseVat:re(t,"region.reverseVat",!1),longitude:re(t,"addresses[0].longitude",null),latitude:re(t,"addresses[0].latitude",null),reference:t.type==="company"?t.name:null}},H4e=({background:e,backgroundFilter:t,priceSummaryBackground:n,showPriceSummary:r})=>({resourceUrl:e,overlayColor:t,backgroundColor:n,showPriceSummary:r}),q4e=({header:e={},theme:t={}})=>{const{resourceUrl:n="",title:r="",backgroundColor:i="",overlayColor:o="",showPriceSummary:s}={...H4e(t),...e};return{layout:"price",baseStyle:{textColor:"",textAlign:"left"},items:[{type:"content",size:50,media:{type:"color",backgroundColor:i},value:{preText:"",documentName:r?`<h1>${r}</h1>`:"",postText:"",showLogo:!0,logotype:""}},{type:"media",size:50,media:{type:"image",resourceUrl:n,overlay:!0,overlayColor:o}}],...typeof s=="boolean"&&{showPriceSummary:s}}},W4e=(e,t={})=>(!e||!e.data||re(e,"template.views.read.nodes",[]).filter(r=>r.itemType==="header"&&!!r.value.header).map(r=>r.value.header.substring(5)).forEach(r=>{if(e.data[r]&&e.data[r].layout==="legacy"){const i={...t,...Th(e.data.theme)};e.data[r]=q4e({header:{...e.data[r],title:re(e,"data.name","")},theme:i})}}),e),Oc=e=>ye.t(`components:document.chapters.${e}.title`),Ji=e=>ye.t(`components:document.chapters.subChapters.${e}.title`),G4e={docChapter:["section"],docChapterSub:["subSection"],docParties:["party"],workAddressText:["workAddressText"],textContent:["html"],packageGroup:["selectionGroup"],pricingSummary:["pricingSummary"],multiGroupPricing:["multiGroupPricing"],estimatedTimeToCompleteText:["estimatedTimeToCompleteText"],estimatedWorkStartAndEndAtText:["estimatedWorkStartAndEndAtText"],extraWorkTimeImpactText:["extraWorkTimeImpactText"],extraWorkConstructionPricingList:["extraWorkConstructionPricingList"],notBinding:["notBinding"],terms:["termsDisclaimer"],attachments:["attachments"],presentation:["presentation"],coverBlock:["coverBlock"],header:["header"],answer:["answer"]},K4e=()=>({docChapter:{parties:{title:Oc("parties"),classList:"print-avoid-break-inside"},workPackage:{title:Oc("workPackage")},warningInfo:{title:Oc("warningInfo")},estimatedTime:{title:Oc("estimatedTime")},extraWorkTimeImpact:{title:Oc("extraWorkTimeImpact")},extraWorkConstructionPricingList:{title:Oc("extraWorkConstructionPricingList")},paymentTerms:{title:Oc("paymentTerms")},misc:{title:Oc("misc")}},docChapterSub:{workAddress:{title:Ji("workAddress"),hideFromEdit:!0},description:{title:Ji("description")},travelCosts:{title:Ji("travelCosts")},attachments:{title:Ji("attachments")},notIncluded:{title:Ji("notIncluded")},warningInfo:{title:Ji("warningInfo")},estimatedTimeToComplete:{title:Ji("estimatedTimeToComplete")},estimatedWorkStartAndEndAt:{title:Ji("estimatedWorkStartAndEndAt")},extraWorkConstructionPricingList:{title:Ji("extraWorkConstructionPricingList")},extraWorkTravelCosts:{title:Ji("extraWorkTravelCosts")},paymentTerms:{title:Ji("paymentTerms")},miscAgreement:{title:Ji("miscAgreement")},docIsBinding:{title:Ji("docIsBinding")},extraWorkTimeImpact:{title:Ji("extraWorkTimeImpact")}}}),bU={attachments2:"hideDocumentAttachmentBlocks",answer:"hideDocumentAnswerBlocks"},Y4e=["header","coverBlock","videoPlayer","embed","custom","termsDisclaimer"],J4e=e=>{for(const[t,n]of Object.entries(G4e))if(n.includes(e))return t;return e},wU=({data:e,tree:t,bindData:n=!1,customProps:r={},pdfOptions:i={}})=>{const o=Object.create(null),s=K4e();t.forEach(l=>{const c=J4e(l.itemType),d=re(s,`${c}.${l.itemId}`,{}),u=l.value&&typeof l.value=="object";n&&u&&(Object.keys(l.value).forEach(p=>{d[p]=re(e,`${l.value[p]}`)}),l._value=l.value),o[l.nodeId]={...l,componentName:c,props:d,children:[],showEditButton:Y4e.includes(l.itemType)}});const a=[];return t.forEach(l=>{l.parentId&&l.parentId!=="0"?o[l.parentId].children.push(o[l.nodeId]):a.push(o[l.nodeId])}),a.forEach((l,c)=>{l.placement&&l.placement==="last"&&a.push(a.splice(c,1)[0]),bU[l.itemId]&&i[bU[l.itemId]]&&a.splice(c,1)}),a},Sh=(e,{setId:t=!1}={})=>{let n=1;const r=i=>{let o=[];return i.forEach(s=>{t&&(s.nodeId=n,n++),o.push(s),s&&Array.isArray(s.children)&&s.children.length&&(t&&s.children.forEach(a=>{a.parentId=s.nodeId}),o=[...o,...r(s.children)],delete s.children)}),o};return r(e)},N1=()=>({type:"array",default:[{type:"reminder",status:"new",sendDays:2,deliveryTypes:["sms","email"],views:{sms:{nodes:[{nodeId:1,parentId:null,itemId:"smsText",itemType:"smsText",value:{text:"data.smsTemplate.reminder.text"}}]},email:{nodes:[{nodeId:1,parentId:null,itemId:"emailTemplate",itemType:"emailTemplate",value:{subject:"data.emailTemplate.reminder.subject",text:"data.emailTemplate.reminder.text",title:"data.emailTemplate.reminder.title",content:"data.emailTemplate.reminder.content"}}]}},tries:0,sendDaysOptions:{isAfter:!0}},{type:"viewed",status:"new",sendDays:5,deliveryTypes:["sms","email"],views:{sms:{nodes:[{nodeId:1,parentId:null,itemId:"smsText",itemType:"smsText",value:{text:"data.smsTemplate.viewed.text"}}]},email:{nodes:[{nodeId:1,parentId:null,itemId:"emailTemplate",itemType:"emailTemplate",value:{subject:"data.emailTemplate.viewed.subject",text:"data.emailTemplate.viewed.text",title:"data.emailTemplate.viewed.title",content:"data.emailTemplate.viewed.content"}}]}},tries:0,sendDaysOptions:{isAfter:!0}},{type:"expires",status:"new",sendDays:2,deliveryTypes:["sms","email"],views:{sms:{nodes:[{nodeId:1,parentId:null,itemId:"smsText",itemType:"smsText",value:{text:"data.smsTemplate.expires.text"}}]},email:{nodes:[{nodeId:1,parentId:null,itemId:"emailTemplate",itemType:"emailTemplate",value:{subject:"data.emailTemplate.expires.subject",text:"data.emailTemplate.expires.text",title:"data.emailTemplate.expires.title",content:"data.emailTemplate.expires.content"}}]}},tries:0,sendDaysOptions:{isAfter:!1,calculateFrom:"data.expiresAt"}}],items:{$ref:`${De.api.baseUrl}/schemas/reminder/1.json`}}),qC=()=>({type:"object",required:["first"],properties:{first:{type:"object",required:["text"],properties:{text:{type:"string",default:`Hej{{clientFirstName}}!
298
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oz(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.reduce(function(t,n){var r=n.split(".").slice(-1)[0];if(t[r])throw new Error("The key `".concat(r,"` is already in use."));return t[r]=n,t},{})}function v5e(e){return Object.keys(e).map(function(t){return[t,e[t]]})}function Uv(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=typeof n[0]=="string"?[].concat(n):[""].concat(n),o=h5e(i,4),s=o[0],a=o[1],l=o[2],c=o[3];return s.length&&s.charAt(s.length-1)!=="/"&&(s+="/"),l="".concat(s).concat(l||"getField"),c="".concat(s).concat(c||"updateField"),e(s,a,l,c)}}function P1(e){return function(t){return t.split(/[.[\]]+/).reduce(function(n,r){return n[r]},e)}}function I1(e,t){var n=t.path,r=t.value;n.split(/[.[\]]+/).reduce(function(i,o,s,a){return a.length===s+1&&(i[o]=r),i[o]},e)}var b5e=Uv(function(e,t,n,r){var i=Array.isArray(t)?Oz(t):t;return Object.keys(i).reduce(function(o,s){var a=i[s],l={get:function(){return this.$store.getters[n](a)},set:function(d){this.$store.commit(r,{path:a,value:d})}};return o[s]=l,o},{})}),w5e=Uv(function(e,t,n,r){var i=Array.isArray(t)?Oz(t):t;return Object.keys(i).reduce(function(o,s){var a=i[s];return o[s]={get:function(){var c=this.$store,d=v5e(c.getters[n](a));return d.map(function(u){return Object.keys(u[1]).reduce(function(p,f){var h="".concat(a,"[").concat(u[0],"].").concat(f);return Object.defineProperty(p,f,{get:function(){return c.getters[n](h)},set:function(g){c.commit(r,{path:h,value:g})}})},{})})}},o},{})}),$1=function(t){var n,r=t.getterType,i=t.mutationType;return n={},zv(n,r,P1),zv(n,i,I1),zv(n,"mapFields",Uv(function(o,s){return b5e(o,s,r,i)})),zv(n,"mapMultiRowFields",Uv(function(o,s){return w5e(o,s,r,i)})),n},jv={exports:{}},CC,Dz;function k5e(){if(Dz)return CC;Dz=1;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function t(r){this.message=r}t.prototype=new Error,t.prototype.name="InvalidCharacterError";function n(r){var i=String(r).replace(/=+$/,"");if(i.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var o=0,s,a,l=0,c="";a=i.charAt(l++);~a&&(s=o%4?s*64+a:a,o++%4)?c+=String.fromCharCode(255&s>>(-2*o&6)):0)a=e.indexOf(a);return c}return CC=typeof window<"u"&&window.atob&&window.atob.bind(window)||n,CC}var TC,Pz;function _5e(){if(Pz)return TC;Pz=1;var e=k5e();function t(n){return decodeURIComponent(e(n).replace(/(.)/g,function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}return TC=function(n){var r=n.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw"Illegal base64url string!"}try{return t(r)}catch{return e(r)}},TC}var Iz;function x5e(){if(Iz)return jv.exports;Iz=1;var e=_5e();function t(n){this.message=n}return t.prototype=new Error,t.prototype.name="InvalidTokenError",jv.exports=function(n,r){if(typeof n!="string")throw new t("Invalid token specified");r=r||{};var i=r.header===!0?0:1;try{return JSON.parse(e(n.split(".")[i]))}catch(o){throw new t("Invalid token specified: "+o.message)}},jv.exports.InvalidTokenError=t,jv.exports}var C5e=x5e();const $z=hr(C5e),T5e={...{userPosition:e=>e.user.position,isLoggingIn:e=>e.user.isLoggingIn,isSuperUser:()=>()=>{const e=ot.getItem("token");if(!e)return!1;const{employee:t}=$z(e);return!!t},isRegistering:e=>e.user.isRegistering,isResettingPassword:e=>e.user.isResettingPassword,isUserLoaded:({user:e})=>e.userId&&e.companyId&&!0||!1,company:({user:e},t,n,r)=>r["companies/companyById"](e.companyId),companyAccount:({user:e},t,n,r)=>(r["companies/companyById"](e.companyId)||{}).CompanyAccount||null,companyAccountType:(e,t)=>(t.companyAccount||{}).accountType||null,accountConfigName:(e,t)=>{var n;return((n=t.companyAccount)==null?void 0:n.accountConfigurationKeyName)||null},companyRegion:(e,t)=>(t.company||{}).region||fn[De.brand].defaultRegion,subscription:(e,t)=>{const{companyAccount:n={}}=t;if(!n)return{};const{freePremiumDays:r=null,accountType:i=null,maxProjectManagers:o=null,freeDocumentsLeft:s=null,paymentMethod:a,billingCycleInterval:l,billingCycleCount:c,showCalloutConvertStripe:d,hasExceededQuota:u,StripeSubscriptions:p,mrr:f,hasFailedPayments:h,allowFailedPaymentToConvertStripe:m,freeBankIdLeft:g,freeSmsLeft:y}=n,w=re(n,"AccountConfiguration.data.defaultNewCompany.freePremiumDays",14),k=[...new Set([...p.map(O=>O.status)])],_=p.some(O=>(O.stripeItems||[]).some(P=>P.stripePriceStripeId.startsWith("plan_"))),M=am.includes(i)&&d&&a==="invoice"&&re(n,"documentQuota.newCount")===1e3&&!re(n,"premiumEndAt");return{type:i,trialDaysLeft:r,maxProjectManagers:o,freeDocumentsLeft:s,paymentMethod:a,billingCycleInterval:l,billingCycleCount:c,showCalloutConvertStripe:am.includes(i)&&d&&a==="invoice",stripeStatuses:k,isPaying:am.includes(i),hasExceededQuota:u,isStripeLegacy:_,isInvoiceLegacy:M,mrr:f,hasFailedPayments:h,allowFailedPaymentToConvertStripe:m,freeBankIdLeft:g,freeSmsLeft:y,initialFreePremiumDays:w}},user:({user:e},t,n,r)=>r["companyUsers/referenceById"](e.userId),feature:()=>Di.checkFeature.bind(Di),can:()=>_1.checkPermission.bind(_1)},getField:P1,modals:e=>e.modals,messages:e=>e.messages,isIncVat:e=>e.priceInputVat==="incVat",viewSettings:e=>t=>e.viewSettings[t],showSearch:e=>e.viewSettings.search.show,error:e=>e.error,socketEnabled:e=>e.socketEnabled,isSocketConnected:e=>e.isSocketConnected},Rz={priceInputVat:"exVat",hideDocArticlePriceInput:!1,user:{position:null,isLoggingIn:!1,isRegistering:!1,isResettingPassword:!1,userId:null,companyId:null},error:null,socketEnabled:!0,isSocketConnected:!1,viewSettings:{app:{isFullPageWindow:!0},nav:{title:null,left:null},projectList:{quickViewProjectId:null},login:{error:null},register:{error:null},search:{show:!1},newDocument:{showOverlayLoader:!1}}},{SET_USER_LOCATION:S5e,SET_USER:E5e}=ho,A5e={...{[S5e](e,t){e.user.position=t},[E5e](e,t){Object.keys(t).forEach(n=>{e.user[n]=t[n]})}},updateField:I1,[ho.SET_VIEW_SETTINGS](e,{view:t,settings:n}){e.viewSettings[t]||(e.viewSettings[t]={}),Object.keys(n).forEach(r=>{e.viewSettings[t][r]=n[r]})},[ho.RESET_VIEW_SETTINGS](e,t){e.viewSettings[t]=JSON.parse(Rz.viewSettings[t])},[ho.SET_ERROR](e,t){e.error=t},[ho.RESET_ERROR](e){e.error=null},[ho.SET_SOCKET_ENABLED](e,t){e.socketEnabled=t},[ho.SET_SOCKET_CONNECTED](e,t){e.isSocketConnected=t}},M5e={namespaced:!0,state:Rz,getters:T5e,actions:p5e,mutations:A5e},fu="articles",{LOAD_ARTICLES:Lz,LOAD_ARTICLE:Hv,SET_ARTICLES:O5e,UPDATE_ARTICLE:SC,DO_CREATE_ARTICLE:Nz,DELETE_ARTICLE:Fz,PATCH_ARTICLE:EC,SEARCH_ARTICLE:Vz,FORM_NEW_ARTICLE:D5e,FORM_EDIT_ARTICLE:P5e,FORM_SUBMIT_ARTICLE:Bz}=sz,{SET_ARTICLES_FETCHING:qv,SET_ARTICLES_POSTING:Ec}=az,I5e={async[Lz]({commit:e},t={}){try{e(qv,!0);const{data:n}=await Ime(t);e(Rt.SET_ARTICLES,{data:n})}catch(n){this.handleError(n,{object:"article",fallbackCode:"article.get",action:`${fu}/${Lz}`})}finally{e(qv,!1)}},async[Hv]({commit:e},{id:t}){try{e(qv,!0);const{data:n}=await $me(t);e(Rt.SET_ARTICLES,{data:n})}catch(n){this.handleError(n,{object:"article",objectId:t,fallbackCode:"article.get",action:`${fu}/${Hv}`,actionPayload:arguments[1]})}finally{e(qv,!1)}},async[SC]({dispatch:e,commit:t},{id:n,body:r}){try{return t(Ec,!0),await Lme(n,r),await e(Hv,{id:n}),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("updatedThing",{thing:ye.t("article")})}),n}catch(i){return this.handleError(i,{object:"article",objectId:n,fallbackCode:"article.put",action:`${fu}/${SC}`,actionPayload:arguments[1]}),null}finally{t(Ec,!1)}},async[Nz]({commit:e},{body:t,showMessage:n=!0}){try{e(Ec,!0);const{data:r}=await Rme(t);return await e(O5e,{data:r}),n&&this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("createdThing",{thing:ye.t("article")})}),r.id}finally{e(Ec,!1)}},async[Fz]({commit:e},{id:t}){try{return e(Ec,!0),await Nme(t),e(Rt.DELETE_ARTICLE,t),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("removedThing",{thing:ye.t("article")}),actions:{undo:()=>{this.dispatch(`articles/${EC}`,{id:t})}}}),t}catch(n){return this.handleError(n,{object:"article",objectId:t,fallbackCode:"article.delete",action:`${fu}/${Fz}`,actionPayload:arguments[1]}),null}finally{e(Ec,!1)}},async[EC]({dispatch:e,commit:t},{id:n}){try{return t(Ec,!0),await Fme(n),await e(Hv,{id:n}),n}catch(r){return this.handleError(r,{object:"article",objectId:n,fallbackCode:"article.patch",action:`${fu}/${EC}`,actionPayload:arguments[1]}),null}finally{t(Ec,!1)}},async[Vz](e,{query:t}){try{if(!t||t.length<=0)return[];const{data:n}=await Vme(t);return n}catch(n){return this.handleError(n,{object:"article",fallbackCode:"article.search",action:`${fu}/${Vz}`,actionPayload:arguments[1]}),[]}},[D5e]({commit:e,rootGetters:t}){const n=t["articles/getNewArticle"]();return e(`forms/${Rt.SET_FORM}`,{key:"article",formData:n},{root:!0})},[P5e]({commit:e,getters:t},{id:n}){const r=t.articleById(n);return e(`forms/${Rt.SET_FORM}`,{key:"article",formData:r},{root:!0})},async[Bz]({rootGetters:e,dispatch:t}){try{const n=e["forms/getFormByKey"]("article");let{id:r}=n;return r?await t(SC,{id:n.id,body:n}):r=await t(Nz,{body:n}),r}catch(n){return this.handleError(n,{object:"article",fallbackCode:"article.submit",action:`${fu}/${Bz}`}),null}}},$5e={getField:P1,articles:e=>e.data,articleIdList:e=>e.ids,articleById:e=>t=>e.data[t],isFetching:e=>e.isFetching,isPosting:e=>e.isPosting,getNewArticle:(e,t,n,r)=>i=>Xs({vat:r["settings/defaultVatRate"],showPrice:!r["settings/hidePriceOnNewlyAddedArticles"],currency:r["settings/defaultCurrency"],...i})},{SET_ARTICLES:R5e,DELETE_ARTICLE:L5e,CLEAR_ARTICLES:N5e,SET_ARTICLES_FETCHING:F5e,SET_ARTICLES_POSTING:V5e}=az,B5e={updateField:I1,[R5e](e,{data:t}){if(typeof t!="object")throw Error("Data must be an article or array of articles!");const n=Array.isArray(t)?t:[t],{ids:r,values:i}=Qa(n);Fo(e.data,i),e.ids=co([...r,...e.ids])},[L5e](e,t=""){delete e.data[t];const n=e.ids.indexOf(t);n!==-1&&e.ids.splice(n,1)},[N5e](e){e.data={},e.ids=[]},[F5e](e,t){e.isFetching=t},[V5e](e,t){e.isPosting=t}},z5e={namespaced:!0,state:{data:{},ids:[],tableDensity:"normal",isFetching:!1,isPosting:!1},getters:$5e,actions:I5e,mutations:B5e},xh=new xt.Entity("files");new xt.Array(xh);const zz=new xt.Entity("projectFiles",{File:xh});new xt.Array(zz);const AC=new xt.Entity("companyUsers");new xt.Array(AC);const MC=new xt.Entity("offers",{Files:[xh]});new xt.Array(MC);const Uz=new xt.Entity("atas",{Files:[xh]});new xt.Array(Uz);const OC=new xt.Entity("projects",{CompanyUser:AC,ProjectMembers:[AC],ProjectFiles:[zz]});Uz.define({Project:OC});const U5e=new xt.Array(OC),j5e=new xt.Entity("articles");new xt.Array(j5e);const jz=new xt.Entity("certificates");new xt.Array(jz);const H5e=new xt.Entity("companies",{CompanyCertificates:[jz]}),q5e=new xt.Array(H5e),Hz=new xt.Entity("companyReferenceItems",{Image:xh,Thumbnail:xh});new xt.Array(Hz);const W5e=new xt.Entity("companyReferences",{CompanyReferenceItems:[Hz]});new xt.Array(W5e);const qz=new xt.Entity("contracts",{Offer:MC});new xt.Array(qz),MC.define({Contract:qz}),new xt.Entity("endCustomers");const G5e=new xt.Entity("notifications",{Project:OC});new xt.Array(G5e);const K5e=new xt.Entity("propertyDesignations");new xt.Array(K5e);const Y5e=new xt.Entity("templateMessages");new xt.Array(Y5e);const R1="companies",{FORM_RESET_OLD:Wz}=Te,{SET_FORM:DC}=Rt.forms,{DO_LOAD_CURRENT_COMPANY:Wv,DO_NORMALIZE_COMPANIES:Gz,DO_UPDATE_CURRENT_COMPANY:Kz,FORM_EDIT_COMPANY:J5e,FORM_SUBMIT_COMPANY:Yz,FORM_NEW_COMPANY_BRANDING:Jz,FORM_EDIT_COMPANY_BRANDING:PC,FORM_SUBMIT_COMPANY_BRANDING:Zz,UPDATE_COMPANY_ACCOUNT_TYPE:Xz}=UB,{SET_COMPANIES_FETCHING:IC,SET_COMPANIES_POSTING:tl}=iC,Z5e={async[Gz](e,{companies:t=[]}){if(!t||!Array.isArray(t)||!t.length)throw new Error("Missing param companies");await this.dispatch(mh,{data:t,schema:q5e})},async[Wv]({commit:e,dispatch:t},{emit:n}={}){var r;try{e(IC,!0);const{data:i}=await Ur.get("/company");return await t(Gz,{companies:[i]}),(r=this.$supportChat)==null||r.syncData(),e(IC,!1),n&&qn.trigger("account:updated"),i}catch(i){throw e(IC,!1),i}},async[Kz]({dispatch:e,commit:t},{body:n}){try{t(tl,!0),await Ur.put("/company",n);const r=await e(Wv);return t(tl,!1),r}catch(r){throw t(tl,!1),r}},async[Xz]({dispatch:e,commit:t},{accountType:n,billingCycleCost:r,billingCycleInterval:i,billingCycleCount:o,premiumSource:s=null,quantity:a}){try{if(t(tl,!0),!n)throw new Error("Missing parameter accountType");if(i&&!o)throw new Error("Param billingCycleCount is required if billingCycleInterval is used");if(!i&&o)throw new Error("Param billingCycleInterval is required if billingCycleCount is used");if((i||o)&&typeof r>"u")throw new Error("Param billingCycleCost is missing");const l={premiumSource:s};return i&&o&&r&&(l.billingCycleInterval=i,l.billingCycleCount=o,l.billingCycleCost=r),typeof a<"u"&&(l.quantity=a),await i1e(n,l),await e(Wv),t(tl,!1),!0}catch(l){return this.handleError(l,{object:"companyAccount",action:`${R1}/${Xz}`}),!1}finally{t(tl,!1)}},async[J5e]({rootGetters:e},{props:t=[]}={}){try{const n=Kp(e["application/company"],t);return this.commit(`forms/${DC}`,{key:"company",formData:n}),!0}catch(n){return this.handleError(n),!1}},async[Yz]({rootGetters:e,dispatch:t}){try{const n=e["forms/getFormByKey"]("company");return await t(Kz,{body:n}),await this.dispatch(Wz,"company"),!0}catch(n){return this.handleError(n,{object:"companies",fallbackCode:"companies.submit",action:`${R1}/${Yz}`}),!1}},async[Jz]({rootGetters:e,dispatch:t}){try{const{CompanyBranding:n}=e["application/company"];if(n&&n.id)return t(PC);const r={about:""};return this.commit(`forms/${DC}`,{key:"companyBranding",formData:r}),!0}catch(n){return this.handleError(n,{object:"companies",action:`${R1}/${Jz}`}),!1}},async[PC]({rootGetters:e}){try{const{CompanyBranding:t}=e["application/company"],n=t;return this.commit(`forms/${DC}`,{key:"companyBranding",formData:n}),!0}catch(t){return this.handleError(t,{object:"companies",action:`${R1}/${PC}`}),!1}},async[Zz]({rootGetters:e,dispatch:t,commit:n}){try{n(tl,!0);const r=e["forms/getFormByKey"]("companyBranding");let{id:i}=r;return i?await Ur.put("/companyBranding",r):{id:i}=await Ur.post("/companyBranding",r),t(Wv),n(tl,!1),await this.dispatch(Wz,"companyBranding"),i}catch(r){return n(tl,!1),this.handleError(r,{object:"companies",fallbackCode:"companies.submit",action:`${R1}/${Zz}`}),!1}}},X5e={companyById:e=>t=>e.data[t],certificateIdListForCurrentCompany:(e,t,n)=>()=>t.certificateIdListForCompany(n.application.user.companyId),certificateIdListForCompany:e=>t=>{const n=e.data[t].CompanyCertificates;return n||[]},isFetching:e=>e.isFetching,isPosting:e=>e.isPosting},{SET_COMPANIES:Q5e,CLEAR_COMPANIES:e4e,SET_COMPANIES_FETCHING:t4e,SET_COMPANIES_POSTING:n4e}=iC,r4e={[Q5e](e,{data:t}){if(typeof t!="object")throw Error("Data must be a company or an array of companies!");const n=Array.isArray(t)?t:[t],{ids:r,values:i}=Qa(n);Fo(e.data,i),e.ids=co([...r,...e.ids])},[e4e](e){e.data={},e.ids=[]},[t4e](e,t){e.isFetching=t},[n4e](e,t){e.isPosting=t}},i4e={namespaced:!0,state:{data:{},ids:[],isFetching:!1,isPosting:!1},getters:X5e,actions:Z5e,mutations:r4e},Ac="companyUsers",{LOAD_COMPANY_USERS:Qz,LOAD_COMPANY_USER:Gv,DO_NORMALIZE_COMPANY_USERS:Kv,UPDATE_COMPANY_USER:$C,CREATE_COMPANY_USER:RC,DELETE_COMPANY_USER:eU,PATCH_COMPANY_USER:LC,FORM_NEW_COMPANY_USER:o4e,FORM_EDIT_COMPANY_USER:s4e,FORM_SUBMIT_COMPANY_USER:tU}=lz,{SET_AS_NORMALIZED_DATA:a4e,FORM_RESET_OLD:l4e,DELETE_FILE:c4e}=Te,{SET_COMPANY_USERS_FETCHING:Yv,SET_COMPANY_USERS_POSTING:Mc}=cC,d4e={async[Kv](e,{companyUsers:t=[]}){if(!t||!Array.isArray(t)||!t.length)throw new Error("Missing param companyUsers");await this.dispatch(a4e,{data:t,schema:"companyUsers"})},async[Qz]({dispatch:e,commit:t}){try{t(Yv,!0);const{data:n}=await Xme();await e(Kv,{companyUsers:n})}catch(n){this.handleError(n,{object:"companyUser",fallbackCode:"companyUser.getAll",action:`${Ac}/${Qz}`})}finally{t(Yv,!1)}},async[Gv]({commit:e,dispatch:t,rootGetters:n},{id:r}){try{e(Yv,!0);const{data:i}=await Qme(r);await t(Kv,{companyUsers:[i]});const{id:o}=n["application/user"]||{};return r===o&&(ye.locale!==i.locale&&ye.changeLocale(i.locale),ye.lang!==i.language&&(ye.changeLanguage(i.language),location&&location.reload())),r}catch(i){return this.handleError(i,{object:"companyUser",objectId:r,fallbackCode:"companyUser.get",action:`${Ac}/${Gv}`,actionPayload:arguments[1]}),null}finally{e(Yv,!1)}},async[RC]({commit:e,dispatch:t,rootGetters:n},{body:r}){try{const{language:i,locale:o}=n["application/user"]||{},s={language:i||"en",locale:o||"en-US",...r};e(Mc,!0);const{data:a}=await e1e(s);return await t(Kv,{companyUsers:[a]}),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("sentThingTo",{thing:ye.t("invitation"),recipient:a.email})}),a.id}catch(i){return this.handleError(i,{object:"companyUser",fallbackCode:"companyUser.post",action:`${Ac}/${RC}`,actionPayload:arguments[1]}),null}finally{e(Mc,!1)}},async[$C]({dispatch:e,commit:t,getters:n},{id:r,body:i}){var o;try{t(Mc,!0);const{AvatarPublicId:s}=i,{AvatarPublicId:a}=n.byId(r);return s&&s!==a&&this.dispatch(c4e,{id:a}),await t1e(r,i),await e(Gv,{id:r}),(o=this.$supportChat)==null||o.syncData(),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("updatedThing",{thing:ye.t("user")})}),r}catch(s){return this.handleError(s,{object:"companyUser",objectId:r,fallbackCode:"companyUser.put",action:`${Ac}/${$C}`,actionPayload:arguments[1]}),null}finally{t(Mc,!1)}},async[eU]({commit:e},{id:t}){try{return e(Mc,!0),await n1e(t),e(cC.DELETE_COMPANY_USER,t),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("removedThing",{thing:ye.t("user")}),actions:{undo:()=>{this.dispatch(`${Ac}/${LC}`,{id:t})}}}),t}catch(n){return this.handleError(n,{object:"companyUser",objectId:t,fallbackCode:"companyUser.delete",action:`${Ac}/${eU}`,actionPayload:arguments[1]}),null}finally{e(Mc,!1)}},async[LC]({dispatch:e,commit:t},{id:n}){try{return t(Mc,!0),await r1e(n),await e(Gv,{id:n}),n}catch(r){return this.handleError(r,{object:"companyUser",objectId:n,fallbackCode:"companyUser.patch",action:`${Ac}/${LC}`,actionPayload:arguments[1]}),null}finally{t(Mc,!1)}},[o4e]({commit:e,rootGetters:t}){let n="en";const r=t["application/user"];r.language&&({language:n}=r);const i={AvatarPublicId:null,CompanyId:null,CompanyUserPermission:{manageCompany:!1,manageUsers:!1,manageProjects:!1,manageOwnProjects:!1,showPrices:!1,manageAtas:!1,manageOwnAtas:!1},cellphone:null,cellphoneRegion:null,email:null,finishedGuide:!1,firstname:null,id:null,language:n,lastActive:null,lastname:null,resetPasswordExpires:null,resetPasswordToken:null};return e(`forms/${Rt.SET_FORM}`,{key:"companyUser",formData:i},{root:!0})},[s4e]({commit:e,getters:t},{id:n,props:r=[]}){const i=Kp(t.byId(n),r);return e(`forms/${Rt.SET_FORM}`,{key:"companyUser",formData:i},{root:!0})},async[tU]({rootGetters:e,dispatch:t}){try{const n=e["forms/getFormByKey"]("companyUser");let{id:r}=n;return r?await t($C,{id:n.id,body:n}):r=await t(RC,{body:n}),await this.dispatch(l4e,"companyUser"),!0}catch(n){return this.handleError(n,{object:"companyUser",action:`${Ac}/${tU}`,actionPayload:arguments[1]}),!1}}},u4e={referenceById:e=>t=>e.data[t],byId:e=>t=>{const n=e.data[t];if(!n)return null;const{firstname:r,lastname:i}=n;return{...n,fullName:`${r||""} ${i||""}`.trim(),role:Ufe(n.CompanyUserPermission),avatarUrl:`${De.api.baseUrl}/file/${n.AvatarPublicId}/download`}},all:(e,t)=>{const n={};return e.ids.forEach(r=>{n[r]=t.byId(r)}),n},isPosting:e=>e.isPosting,isFetching:e=>e.isFetching},{SET_COMPANY_USERS:p4e,DELETE_COMPANY_USER:h4e,CLEAR_COMPANY_USERS:f4e,SET_COMPANY_USERS_FETCHING:m4e,SET_COMPANY_USERS_POSTING:g4e}=cC,y4e={[p4e](e,{data:t=[]}){if(typeof t!="object")throw Error("Data must be a company user or an array of company users!");const n=Array.isArray(t)?t:[t],{ids:r,values:i}=Qa(n);Fo(e.data,i),e.ids=co([...r,...e.ids])},[h4e](e,t){delete e.data[t];const n=e.ids.indexOf(t);n!==-1&&e.ids.splice(n,1)},[f4e](e){e.data={},e.ids=[]},[m4e](e,t){e.isFetching=t},[g4e](e,t){e.isPosting=t}},v4e={namespaced:!0,state:{data:{},ids:[],isFetching:!1,isPosting:!1},getters:u4e,actions:d4e,mutations:y4e};var NC,nU;function rU(){if(nU)return NC;nU=1;var e=i_(),t=bh(),n=m_(),r=Js(),i=wh();function o(s,a,l,c){if(!r(s))return s;a=t(a,s);for(var d=-1,u=a.length,p=u-1,f=s;f!=null&&++d<u;){var h=i(a[d]),m=l;if(h==="__proto__"||h==="constructor"||h==="prototype")return s;if(d!=p){var g=f[h];m=c?c(g,h,f):void 0,m===void 0&&(m=r(g)?g:n(a[d+1])?[]:{})}e(f,h,m),f=f[h]}return s}return NC=o,NC}var FC,iU;function b4e(){if(iU)return FC;iU=1;var e=rU();function t(n,r,i){return n==null?n:e(n,r,i)}return FC=t,FC}var w4e=b4e();const dr=hr(w4e),Ch="documents2",{DELETE_DOCUMENT2:oU,DO_CREATE_DOCUMENT2:k4e,DO_LOAD_DOCUMENT2:mu,DO_LOAD_DOCUMENTS2:sU,DO_UPDATE_DOCUMENT2:Jv,LOAD_DOCUMENT2:aU,LOAD_DOCUMENTS2:VC,LOAD_DOCUMENTS2_EXTERNAL:_4e,PATCH_DOCUMENT2:BC,UPDATE_DOCUMENT2:lU,UPDATE_DOCUMENT2_STATUS:cU,DO_SEND_DOCUMENT2:x4e,SEND_REMINDER_DOCUMENT2:C4e,REQUEST_PROPERTY_DOCUMENT2:T4e,CLEAR_DOCUMENT2_ANSWERS:dU,ANSWER_OWN_DOCUMENT2:S4e}=jB,{DELETE_MANY_DOCUMENTS2:E4e,SET_DOCUMENT2_POSTING:ui,SET_DOCUMENT2_FETCHING:Zv,SET_DOCUMENTS2:uU}=oC,{SHOW_MESSAGE:A4e,DO_LOAD_CURRENT_COMPANY:M4e}=Te,O4e={async[mu]({commit:e},{id:t,emit:n=!1}){try{e(Zv,!0);const{data:r}=await Gi.get(t);return n&&qn.trigger("document:watch",r),e(uU,{data:[r]}),r}catch(r){throw r}finally{e(Zv,!1)}},async[sU]({commit:e},t={}){try{e(Zv,!0);const{data:n}=await Gi.getAll(t),{items:r}=n;e(uU,{data:r})}catch(n){throw n}finally{e(Zv,!1)}},async[VC]({dispatch:e},t={isHidden:!1}){try{await e(sU,t)}catch(n){this.handleError(n,{object:"document2",fallbackCode:"document2.getMany",action:`${Ch}/${VC}`})}},async[_4e]({dispatch:e},{service:t,type:n=null,typeId:r=null}){if(typeof t>"u")throw new Error("Missing param service");await e(VC,{isHidden:!1,"externalReferences.service":t,...n&&{"externalReferences.type":n},...r&&{"externalReferences.typeId":r}})},async[aU]({dispatch:e},{id:t,emit:n}){try{return await e(mu,{id:t,emit:n})}catch(r){this.handleError(r,{object:"document2",fallbackCode:"document2.getOne",action:`${Ch}/${aU}`,actionPayload:arguments[1]})}},async[k4e]({rootGetters:e,commit:t,dispatch:n},{body:r}){try{t(ui,!0);const{data:i}=await Gi.post(r),{id:o}=i;return await n(mu,{id:o}),qn.trigger("document:create",i),qn.trigger("document:save",i),e["application/companyAccountType"]==="free"&&await this.dispatch(M4e),o}catch(i){throw i}finally{t(ui,!1)}},async[x4e]({state:e,commit:t},{id:n}){try{t(ui,!0),await Gi.send(n),qn.trigger("document:send",e.data[n]),["extension","widget"].includes(gr.value)||this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("sentThing",{thing:ye.t("document")})})}catch(r){throw r}finally{t(ui,!1)}},async[C4e]({commit:e},{id:t,body:n={}}){try{const r={views:{sms:{nodes:[{nodeId:1,parentId:null,itemId:"smsText",itemType:"smsText",value:{text:"data.smsTemplate.reminder.text"}}]},email:{nodes:[{nodeId:1,parentId:null,itemId:"emailTemplate",itemType:"emailTemplate",value:{subject:"data.emailTemplate.reminder.subject",title:"data.emailTemplate.reminder.title",content:"data.emailTemplate.reminder.content",text:"data.emailTemplate.reminder.text"}}]}}};e(ui,!0),await Gi.send(t,{...r,...n,sendSource:"reminder"}),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("sentThing",{thing:ye.t("reminder")})})}catch(r){throw r}finally{e(ui,!1)}},async[T4e]({commit:e},{id:t,body:n={}}){try{const r={views:{sms:{nodes:[{nodeId:1,parentId:null,itemId:"smsText",itemType:"smsText",value:{text:"data.smsTemplate.propertyDesignation.text"}}]},email:{nodes:[{nodeId:1,parentId:null,itemId:"emailTemplate",itemType:"emailTemplate",value:{subject:"data.emailTemplate.propertyDesignation.subject",title:"data.emailTemplate.propertyDesignation.title",content:"data.emailTemplate.propertyDesignation.content",text:"data.emailTemplate.propertyDesignation.text",actionUrl:"data.emailTemplate.propertyDesignation.actionUrl"}}]}}},{data:i}=await Gi.get(t),o=a=>ye.t(`propertyDesignationRequest.${a}`,{ns:"actions",interpolation:{prefix:"__",suffix:"__"}});dr(i,"data.smsTemplate.propertyDesignation",{text:o("smsTemplate.text")}),dr(i,"data.emailTemplate.propertyDesignation",{subject:o("emailTemplate.subject"),title:o("emailTemplate.title"),content:o("emailTemplate.content"),text:o("emailTemplate.text"),actionUrl:o("emailTemplate.actionUrl")});const s={...r,document:i,clients:[i.clients[0]]};e(ui,!0),await Gi.send(t,{...s,...n,sendSource:"propertyDesignation"}),this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("actions:propertyDesignationRequest.successMessage")})}catch(r){throw r}finally{e(ui,!1)}},async[Jv]({state:e,dispatch:t,commit:n},{id:r,body:i,params:o={},showMessage:s=!0}){try{n(ui,!0),await Gi.put(r,i,o),await t(mu,{id:r});const a=e.data[r];return qn.trigger("document:update",a),qn.trigger("document:save",a),s&&!["extension","widget"].includes(gr.value)&&this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("updatedThing",{thing:ye.t("document")})}),r}catch(a){throw a}finally{n(ui,!1)}},async[lU]({dispatch:e},{id:t,body:n,params:r={}}){try{return await e(Jv,{id:t,body:n,params:r}),t}catch(i){return this.handleError(i,{object:"document2",objectId:t,fallbackCode:"document2.put",action:`${Ch}/${lU}`,actionPayload:arguments[1]}),null}},async[oU]({commit:e},{id:t}){try{return e(ui,!0),await Gi.delete(t),e(E4e,t),qn.trigger("document:remove",t),gr.value!=="widget"&&this.dispatch("application/SHOW_MESSAGE",{type:"success",message:ye.t("removedThing",{thing:ye.t("document")}),actions:{undo:()=>{this.dispatch(`documents2/${BC}`,{id:t})}}}),t}catch(n){return this.handleError(n,{object:"document2",objectId:t,fallbackCode:"document2.delete",action:`${Ch}/${oU}`,actionPayload:arguments[1]}),null}finally{e(ui,!1)}},async[BC]({commit:e,dispatch:t},{id:n}){try{return e(ui,!0),await Gi.patch(n),await t(mu,{id:n}),n}catch(r){return this.handleError(r,{object:"document2",objectId:n,fallbackCode:"document2.patch",action:`${Ch}/${BC}`,actionPayload:arguments[1]}),null}finally{e(ui,!1)}},async[cU]({dispatch:e,getters:t},{id:n,status:r}){try{const{hasAnswers:i}=t.byId(n)||{};return i&&!["accepted","denied"].includes(r)?await this.dispatch(A4e,{displayType:"dialog",type:"warning",title:ye.t("actions:updateDocumentDialog.title"),message:ye.t("actions:updateDocumentDialog.message"),actions:{cancel:{text:ye.t("actions:updateDocumentDialog.cancel"),callback:"cancel"},submit:{text:ye.t("actions:updateDocumentDialog.submit"),callback:async()=>{await e(dU,{id:n,doFetch:!1}),await e(Jv,{id:n,body:{status:r}})}}}}):await e(Jv,{id:n,body:{status:r}}),n}catch(i){return this.handleError(i,{object:"document2",objectId:n,fallbackCode:"document2.updateStatus",action:`${Ch}/${cU}`,actionPayload:arguments[1]}),null}},async[dU]({dispatch:e},{id:t,doFetch:n=!0}){await Gi.clearAnswers(t),n&&await e(mu,{id:t})},async[S4e]({commit:e,dispatch:t},{id:n,publicId:r,body:i,checksum:o}){try{e(ui,!0);const s={docChecksum:o},{data:a}=await Jp.answer(r,i,{},s);return await t(mu,{id:n}),a}catch(s){throw s}finally{e(ui,!1)}}};var Xv={exports:{}},D4e=Xv.exports,pU;function P4e(){return pU||(pU=1,function(e,t){(function(n,r){e.exports=r()})(D4e,function(){Array.isArray||(Array.isArray=function(o){return Object.prototype.toString.call(o)==="[object Array]"});function n(o){for(var s=[],a=0,l=o.length;a<l;a++)s.indexOf(o[a])===-1&&s.push(o[a]);return s}var r={},i={"==":function(o,s){return o==s},"===":function(o,s){return o===s},"!=":function(o,s){return o!=s},"!==":function(o,s){return o!==s},">":function(o,s){return o>s},">=":function(o,s){return o>=s},"<":function(o,s,a){return a===void 0?o<s:o<s&&s<a},"<=":function(o,s,a){return a===void 0?o<=s:o<=s&&s<=a},"!!":function(o){return r.truthy(o)},"!":function(o){return!r.truthy(o)},"%":function(o,s){return o%s},log:function(o){return console.log(o),o},in:function(o,s){return!s||typeof s.indexOf>"u"?!1:s.indexOf(o)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(o,s,a){if(a<0){var l=String(o).substr(s);return l.substr(0,l.length+a)}return String(o).substr(s,a)},"+":function(){return Array.prototype.reduce.call(arguments,function(o,s){return parseFloat(o,10)+parseFloat(s,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(o,s){return parseFloat(o,10)*parseFloat(s,10)})},"-":function(o,s){return s===void 0?-o:o-s},"/":function(o,s){return o/s},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(o,s){return o.concat(s)},[])},var:function(o,s){var a=s===void 0?null:s,l=this;if(typeof o>"u"||o===""||o===null)return l;for(var c=String(o).split("."),d=0;d<c.length;d++)if(l==null||(l=l[c[d]],l===void 0))return a;return l},missing:function(){for(var o=[],s=Array.isArray(arguments[0])?arguments[0]:arguments,a=0;a<s.length;a++){var l=s[a],c=r.apply({var:l},this);(c===null||c==="")&&o.push(l)}return o},missing_some:function(o,s){var a=r.apply({missing:s},this);return s.length-a.length>=o?[]:a}};return r.is_logic=function(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.keys(o).length===1},r.truthy=function(o){return Array.isArray(o)&&o.length===0?!1:!!o},r.get_operator=function(o){return Object.keys(o)[0]},r.get_values=function(o){return o[r.get_operator(o)]},r.apply=function(o,s){if(Array.isArray(o))return o.map(function(g){return r.apply(g,s)});if(!r.is_logic(o))return o;var a=r.get_operator(o),l=o[a],c,d,u,p,f;if(Array.isArray(l)||(l=[l]),a==="if"||a=="?:"){for(c=0;c<l.length-1;c+=2)if(r.truthy(r.apply(l[c],s)))return r.apply(l[c+1],s);return l.length===c+1?r.apply(l[c],s):null}else if(a==="and"){for(c=0;c<l.length;c+=1)if(d=r.apply(l[c],s),!r.truthy(d))return d;return d}else if(a==="or"){for(c=0;c<l.length;c+=1)if(d=r.apply(l[c],s),r.truthy(d))return d;return d}else{if(a==="filter")return p=r.apply(l[0],s),u=l[1],Array.isArray(p)?p.filter(function(g){return r.truthy(r.apply(u,g))}):[];if(a==="map")return p=r.apply(l[0],s),u=l[1],Array.isArray(p)?p.map(function(g){return r.apply(u,g)}):[];if(a==="reduce")return p=r.apply(l[0],s),u=l[1],f=typeof l[2]<"u"?l[2]:null,Array.isArray(p)?p.reduce(function(g,y){return r.apply(u,{current:y,accumulator:g})},f):f;if(a==="all"){if(p=r.apply(l[0],s),u=l[1],!Array.isArray(p)||!p.length)return!1;for(c=0;c<p.length;c+=1)if(!r.truthy(r.apply(u,p[c])))return!1;return!0}else if(a==="none"){if(p=r.apply(l[0],s),u=l[1],!Array.isArray(p)||!p.length)return!0;for(c=0;c<p.length;c+=1)if(r.truthy(r.apply(u,p[c])))return!1;return!0}else if(a==="some"){if(p=r.apply(l[0],s),u=l[1],!Array.isArray(p)||!p.length)return!1;for(c=0;c<p.length;c+=1)if(r.truthy(r.apply(u,p[c])))return!0;return!1}}if(l=l.map(function(g){return r.apply(g,s)}),i.hasOwnProperty(a)&&typeof i[a]=="function")return i[a].apply(s,l);if(a.indexOf(".")>0){var h=String(a).split("."),m=i;for(c=0;c<h.length;c++){if(!m.hasOwnProperty(h[c]))throw new Error("Unrecognized operation "+a+" (failed at "+h.slice(0,c+1).join(".")+")");m=m[h[c]]}return m.apply(s,l)}throw new Error("Unrecognized operation "+a)},r.uses_data=function(o){var s=[];if(r.is_logic(o)){var a=r.get_operator(o),l=o[a];Array.isArray(l)||(l=[l]),a==="var"?s.push(l[0]):l.forEach(function(c){s.push.apply(s,r.uses_data(c))})}return n(s)},r.add_operation=function(o,s){i[o]=s},r.rm_operation=function(o){delete i[o]},r.rule_like=function(o,s){if(s===o||s==="@")return!0;if(s==="number")return typeof o=="number";if(s==="string")return typeof o=="string";if(s==="array")return Array.isArray(o)&&!r.is_logic(o);if(r.is_logic(s)){if(r.is_logic(o)){var a=r.get_operator(s),l=r.get_operator(o);if(a==="@"||a===l)return r.rule_like(r.get_values(o,!1),r.get_values(s,!1))}return!1}if(Array.isArray(s))if(Array.isArray(o)){if(s.length!==o.length)return!1;for(var c=0;c<s.length;c+=1)if(!r.rule_like(o[c],s[c]))return!1;return!0}else return!1;return!1},r})}(Xv)),Xv.exports}var I4e=P4e(),zC,hU;function fU(){if(hU)return zC;hU=1;var e=Hp(),t=W_(),n=Ka(),r="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,a=o.hasOwnProperty,l=s.call(Object);function c(d){if(!n(d)||e(d)!=r)return!1;var u=t(d);if(u===null)return!0;var p=a.call(u,"constructor")&&u.constructor;return typeof p=="function"&&p instanceof p&&s.call(p)==l}return zC=c,zC}var $4e=fU();const R4e=hr($4e);function L4e(e,t){const n=[],r=new Map,i=()=>{r.forEach(o=>n.push(o)),r.clear()};return e.forEach(o=>{var s,a,l;if(t.includes(o.code)){const c=o.code+((a=(s=o.data)==null?void 0:s.client)==null?void 0:a.id)||((l=o.data)==null?void 0:l.email),d=r.get(c);d?d.children.push(o):r.set(c,{...o,children:[]})}else i(),n.push(o)}),r.size&&i(),n}const mU=({nodes:e,data:t})=>{const n=[];return e.forEach(r=>{let i=r.isVisible===void 0;i||(i=r.isVisible&&typeof r.isVisible=="object"?I4e.apply(Ffe(r.isVisible,["_uniqueId"]),t):!!r.isVisible),i&&n.push(r),r&&Array.isArray(r.children)&&r.children.length&&(r.children=mU({nodes:r.children,data:t}))}),n},UC=[{cutoffDate:new Date("2026-01-01"),constants:{rot:{max:5e4*100,ratio:.3},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot20:{max:5e4*100,ratio:.2},greenRot50:{max:5e4*100,ratio:.5}}},{cutoffDate:new Date("2025-05-12"),constants:{rot:{max:5e4*100,ratio:.5},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot20:{max:5e4*100,ratio:.2},greenRot50:{max:5e4*100,ratio:.5}}},{cutoffDate:new Date("2025-01-01"),constants:{rot:{max:5e4*100,ratio:.3},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot20:{max:5e4*100,ratio:.2},greenRot50:{max:5e4*100,ratio:.5}}},{cutoffDate:new Date("2024-07-01"),constants:{rot:{max:75e3*100,ratio:.3},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot20:{max:5e4*100,ratio:.2},greenRot50:{max:5e4*100,ratio:.5}}},{cutoffDate:null,constants:{rot:{max:5e4*100,ratio:.3},rut:{max:75e3*100,ratio:.5},greenRot15:{max:5e4*100,ratio:.15},greenRot20:{max:5e4*100,ratio:.2},greenRot50:{max:5e4*100,ratio:.5}}}],N4e=e=>{var n;if(e){const r=new Date(e),i=UC.find(({cutoffDate:o})=>!o||r>=o);return i==null?void 0:i.constants}return(n=UC.filter(({cutoffDate:r})=>!r||r<=new Date)[0])==null?void 0:n.constants},F4e=()=>{const e=new Date;return UC.filter(n=>n.cutoffDate&&n.cutoffDate>e).map(n=>({date:n.cutoffDate,label:n.cutoffDate.toISOString().split("T")[0],constants:n.constants}))},jC=(e,t,n,r)=>{const i=N4e(r);if(!i[e])throw new Error("Missing param type");const{max:o,ratio:s}=i[e],a=Math.min(n*o,t*s);return Math.floor(a/100)*100},Qv=({type:e="fixed",currency:t,maxTotal:n=null,articles:r=[],clients:i=[],region:o={},useVat:s,rounding:a})=>{if(typeof s>"u")throw new Error("Missing param useVat");if(typeof s!="boolean")throw new Error("Param useVat must be a boolean");if(typeof a!="object"||a===null)throw new Error("Param rounding must be a object");if(typeof a.enabled>"u")throw new Error("Missing param rounding.enabled");if(typeof a.enabled!="boolean")throw new Error("Param rounding.enabled must be a boolean");if(typeof a.interval>"u")throw new Error("Missing param rounding.interval");if(typeof a.interval!="number")throw new Error("Param rounding.interval must be a number");if(typeof a.show>"u")throw new Error("Missing param rounding.show");if(typeof a.show!="boolean")throw new Error("Param rounding.show must be a boolean");let l=o.houseWorkManualAmount||o.houseWorkAmount||null;l&&(l=Math.floor(l/100)*100);const c={type:e,subTotal:0,taxAmount:0,roundingAmount:0,total:0,currency:t,maxTotal:e==="openAccMaxPrice"?n||0:null,region:{country:"sweden",houseWorkType:null,reverseVat:!!i.find(p=>re(p,"region.reverseVat")),houseWorkManualAmount:o.houseWorkManualAmount||null,houseWorkWork:0,houseWorkAmount:l,deductionDate:o.deductionDate||null},helpers:{discount:0,isIndivid:!i.find(p=>p.type==="company"),noOfClients:i.length||1},useVat:s,rounding:{enabled:a.enabled,interval:a.interval,show:a.show}},d=p=>p/100;if(c.helpers.isIndivid&&!c.region.reverseVat){const p=[...r].sort((f,h)=>new Date(h.updatedAt).getTime()-new Date(f.updatedAt).getTime()).find(Jy);p&&!c.region.houseWorkType&&(c.region.houseWorkType=Zy(p))}for(let p of r){p=ru(p);const{totalAmount:f,currency:h,priceType:m,discount:g,discountType:y}=p;let{vat:w}=p;w===null&&(w=0),s||(w=0),["fixed","approx"].includes(m)&&(c.currency=h,c.subTotal+=f,c.taxAmount+=f*d(w),c.helpers.discount+=y==="percentage"?f/((100-g/100)/100)-f:g,c.region.houseWorkType&&Jy(p)&&(c.region.houseWorkWork+=f*((100+w)/100)))}!c.helpers.isIndivid&&c.region.reverseVat&&(c.taxAmount=0),c.region.houseWorkType&&c.region.houseWorkAmount===null&&(c.region.houseWorkAmount=jC(c.region.houseWorkType,c.region.houseWorkWork,c.helpers.noOfClients,c.region.deductionDate));const u=c.subTotal+c.taxAmount-c.region.houseWorkAmount;return c.roundingAmount=a.enabled&&a.interval?Math.round(u/a.interval)*a.interval-u:0,c.total=u+c.roundingAmount,Cx(c),c},V4e=e=>{if(!e)return null;const{currency:t,clients:n=[],articles:r=[],acceptedAt:i}=e,o=re(e,"data.packageGroups",{}),s=re(e,"data.formSettings.useVat",!0),a={enabled:re(e,"data.formSettings.rounding.enabled",!1),interval:re(e,"data.formSettings.rounding.interval",1),show:re(e,"data.formSettings.rounding.show",!0)},l=[],c=[];let d=null,u=null,p=null;const f=re(e,"data.prices.region.deductionDate");if(Object.keys(o).forEach(y=>{const w=o[y].packages.filter(({isSelected:_})=>_);c.push(...w.map(({packageId:_})=>_));const k=re(w,"[0].data.prices.type","fixed");l.push(...Array.isArray(k)?k:[k]),w.forEach(_=>{const{maxTotal:M=null,region:S}=re(_,"data.prices")||{};k==="openAccMaxPrice"&&!Number.isNaN(Number.parseInt(M,10))&&(d+=M),S&&!Number.isNaN(Number.parseInt(S.houseWorkManualAmount,10))&&(u+=S.houseWorkManualAmount)})}),!l.length){const y=re(e,"data.prices.type","fixed");l.push(...Array.isArray(y)?y:[y])}const h=r.filter(({packageId:y})=>!y||c.includes(y)),m=h.filter(Jy),g={};for(let y of m){if(y=ru(y),!["fixed","approx"].includes(y.priceType))continue;const w=Zy(y),k=s?y.vat:0;g[w]||(g[w]=null),g[w]+=y.totalAmount*((100+k)/100)}for(const[y,w]of Object.entries(g))w&&(p+=jC(y,w,n.length||1,f||i));return{...Qv({currency:t,articles:h,clients:n,region:{houseWorkManualAmount:u,houseWorkAmount:p,deductionDate:f||i},useVat:s,rounding:a}),type:l,maxTotal:d}},B4e=e=>{const t=i=>ye.t(`_common:documentMentions.${i}`),n=!!re(e,"clients.0"),r={clientName:{key:"clients.0.name",meta:{inputDisabled:!n,virtual:!0}},clientEmail:{key:"clients.0.email",meta:{inputDisabled:!n,virtual:!0}},clientPhone:{key:"clients.0.cellphone",meta:{inputDisabled:!n,virtual:!0}},clientCompany:{key:"clients.0.companyName",meta:{inputDisabled:!n,virtual:!0}},clientAddress:{key:"clients.0.addresses.standard.street",meta:{inputDisabled:!n,virtual:!0}},clientZip:{key:"clients.0.addresses.standard.zip",meta:{inputDisabled:!n,virtual:!0}},clientCity:{key:"clients.0.addresses.standard.city",meta:{inputDisabled:!n,virtual:!0}},clientSocialNo:{key:"clients.0.socialNo",meta:{inputDisabled:!0,virtual:!0}},clientOrgNo:{key:"clients.0.orgNo",meta:{inputDisabled:!0,virtual:!0}},senderName:{key:"companyUser.fullName",meta:{inputDisabled:!0,virtual:!0}},senderEmail:{key:"companyUser.email",meta:{inputDisabled:!0,virtual:!0}},senderPhone:{key:"companyUser.cellphone",meta:{inputDisabled:!0,virtual:!0}},senderCompany:{key:"company.name",meta:{inputDisabled:!0,virtual:!0}},senderAddress:{key:"company.street",meta:{inputDisabled:!0,virtual:!0}},senderZip:{key:"company.zip",meta:{inputDisabled:!0,virtual:!0}},senderCity:{key:"company.city",meta:{inputDisabled:!0,virtual:!0}},documentName:{key:"data.name",meta:{inputDisabled:!1,virtual:!0}},sentAt:{key:"sentAt",filter:"formatDate",meta:{inputDisabled:!0,virtual:!0}},expiresAt:{key:"data.expiresAt",filter:"formatDate",meta:{inputDisabled:!0,virtual:!0}}};for(const i of Object.keys(r)){r[i].label=t(i);const o=re(e,r[i].key)||"";r[i].value=r[i].filter==="formatDate"?ye.formatDate(o):o}return r},Th=e=>e?Object.keys(e).reduce((t,n)=>e[n]||e[n]===!1?{...t,[n]:e[n]}:t,{}):{};function gU(e){if(!e||!e.data)return e;const t=fn[De.brand].defaultRegion==="SE",n={useVat:t,vatType:"vat",rounding:{enabled:t,interval:t?100:1,show:t}};e.data.formSettings||(e.data.formSettings={});const r=eN(n);return Object.keys(r).forEach(i=>{function o(s,a,l){R4e(s[a])?Object.keys(s[a]).forEach(c=>{o(s[a],c,l)}):Array.isArray(s[a])?s[a].forEach((c,d)=>{o(s[a],d,l)}):typeof re(s,a)>"u"&&dr(s,a,l)}o(e.data.formSettings,i,r[i])}),e}const yU=e=>{if(!e||typeof e!="string")return e;if(/^https:\/\/[\w.-]+\.s3\.[\w-]+\.amazonaws\.com\/.*/.test(e)){const n=new URLSearchParams({url:e});return`${De.api.baseUrl}/public/fileProxy?${n.toString()}`}return e},z4e=Object.values(fn).map(e=>e.domain),vU=(e,t)=>{const{h:n,w:r,auto:i}=t||{},o=new URL(yU(e)),{hostname:s}=o;if(!z4e.some(l=>s.includes(l)))return o.toString();const a=new URLSearchParams(o.search);return n&&a.set("h",String(n)),r&&a.set("w",String(r)),i&&a.set("auto",i),o.search=a.toString(),o.toString()},U4e=e=>{if(!e)return null;let t=(e||"").replace(/^SE|[-]/g,"").trim();return t.length===12&&(t=t.substring(2)),`SE${t}01`},L1=()=>{const e=["email"];return Di.checkFeature("sms")&&Di._isValidCompanySetting("deliveryDefaultSms")&&e.push("sms"),{region:{country:"sweden"},permissions:{write:["clients[*].socialNo","clients[0].region.propertyDesignation","data.rejectReasons","data.packageGroups[*].packages[*].isSelected"]},answer:null,deliveryTypes:e,documentRole:"signee",answerMethod:{accept:"signature",deny:"button"},signOrder:0,_uniqueId:zt()}},HC=(e,t)=>{const n={endCustomerId:e.id,type:e.customerType,name:e.customerType==="individual"?e.name:e.reference,socialNo:e.customerType==="individual"?e.org_no:null,companyName:e.customerType==="company"?e.name:null,orgNo:e.customerType==="company"?e.org_no:null,email:e.email,cellphone:e.cellphone,cellphoneRegion:e.cellphoneRegion,addresses:{...e.street||e.zip||e.city?{standard:{street:e.street,zip:`${e.zip||""}`,city:e.city,country:e.country,latitude:e.latitude?`${e.latitude}`:null,longitude:e.longitude?`${e.longitude}`:null}}:{},...e.workStreet||e.workZip||e.workCity?{work:{street:e.workStreet,zip:`${e.workZip||""}`,city:e.workCity,country:e.country,latitude:e.latitude?`${e.latitude}`:null,longitude:e.longitude?`${e.longitude}`:null}}:{}},vatNumber:e.vatNumber,region:{...t&&t.region,reverseVat:e.reverseVat&&e.customerType==="company"},documentRole:re(t,"documentRole","signee"),signOrder:re(t,"signOrder",0)};return{...L1(),...t,...n}},j4e=(e={})=>{const t=e,n=re(t,"addresses.standard",{}),r=re(t,"addresses.work",{});return{id:t.endCustomerId,EndCustomerId:t.endCustomerId,customerType:t.type||"individual",name:t.type==="individual"?t.name:t.companyName,email:t.email,cellphone:t.cellphone,cellphoneRegion:t.cellphoneRegion,org_no:t.type==="individual"?t.socialNo:t.orgNo,street:n.street,zip:n.zip,city:n.city,workStreet:r.street,workZip:r.zip,workCity:r.city,vatNumber:t.vatNumber||U4e(t.orgNo)||"",separateWorkAddress:!!Object.keys(r).length,reverseVat:re(t,"region.reverseVat",!1),longitude:re(t,"addresses[0].longitude",null),latitude:re(t,"addresses[0].latitude",null),reference:t.type==="company"?t.name:null}},H4e=({background:e,backgroundFilter:t,priceSummaryBackground:n,showPriceSummary:r})=>({resourceUrl:e,overlayColor:t,backgroundColor:n,showPriceSummary:r}),q4e=({header:e={},theme:t={}})=>{const{resourceUrl:n="",title:r="",backgroundColor:i="",overlayColor:o="",showPriceSummary:s}={...H4e(t),...e};return{layout:"price",baseStyle:{textColor:"",textAlign:"left"},items:[{type:"content",size:50,media:{type:"color",backgroundColor:i},value:{preText:"",documentName:r?`<h1>${r}</h1>`:"",postText:"",showLogo:!0,logotype:""}},{type:"media",size:50,media:{type:"image",resourceUrl:n,overlay:!0,overlayColor:o}}],...typeof s=="boolean"&&{showPriceSummary:s}}},W4e=(e,t={})=>(!e||!e.data||re(e,"template.views.read.nodes",[]).filter(r=>r.itemType==="header"&&!!r.value.header).map(r=>r.value.header.substring(5)).forEach(r=>{if(e.data[r]&&e.data[r].layout==="legacy"){const i={...t,...Th(e.data.theme)};e.data[r]=q4e({header:{...e.data[r],title:re(e,"data.name","")},theme:i})}}),e),Oc=e=>ye.t(`components:document.chapters.${e}.title`),Ji=e=>ye.t(`components:document.chapters.subChapters.${e}.title`),G4e={docChapter:["section"],docChapterSub:["subSection"],docParties:["party"],workAddressText:["workAddressText"],textContent:["html"],packageGroup:["selectionGroup"],pricingSummary:["pricingSummary"],multiGroupPricing:["multiGroupPricing"],estimatedTimeToCompleteText:["estimatedTimeToCompleteText"],estimatedWorkStartAndEndAtText:["estimatedWorkStartAndEndAtText"],extraWorkTimeImpactText:["extraWorkTimeImpactText"],extraWorkConstructionPricingList:["extraWorkConstructionPricingList"],notBinding:["notBinding"],terms:["termsDisclaimer"],attachments:["attachments"],presentation:["presentation"],coverBlock:["coverBlock"],header:["header"],answer:["answer"]},K4e=()=>({docChapter:{parties:{title:Oc("parties"),classList:"print-avoid-break-inside"},workPackage:{title:Oc("workPackage")},warningInfo:{title:Oc("warningInfo")},estimatedTime:{title:Oc("estimatedTime")},extraWorkTimeImpact:{title:Oc("extraWorkTimeImpact")},extraWorkConstructionPricingList:{title:Oc("extraWorkConstructionPricingList")},paymentTerms:{title:Oc("paymentTerms")},misc:{title:Oc("misc")}},docChapterSub:{workAddress:{title:Ji("workAddress"),hideFromEdit:!0},description:{title:Ji("description")},travelCosts:{title:Ji("travelCosts")},attachments:{title:Ji("attachments")},notIncluded:{title:Ji("notIncluded")},warningInfo:{title:Ji("warningInfo")},estimatedTimeToComplete:{title:Ji("estimatedTimeToComplete")},estimatedWorkStartAndEndAt:{title:Ji("estimatedWorkStartAndEndAt")},extraWorkConstructionPricingList:{title:Ji("extraWorkConstructionPricingList")},extraWorkTravelCosts:{title:Ji("extraWorkTravelCosts")},paymentTerms:{title:Ji("paymentTerms")},miscAgreement:{title:Ji("miscAgreement")},docIsBinding:{title:Ji("docIsBinding")},extraWorkTimeImpact:{title:Ji("extraWorkTimeImpact")}}}),bU={attachments2:"hideDocumentAttachmentBlocks",answer:"hideDocumentAnswerBlocks"},Y4e=["header","coverBlock","videoPlayer","embed","custom","termsDisclaimer"],J4e=e=>{for(const[t,n]of Object.entries(G4e))if(n.includes(e))return t;return e},wU=({data:e,tree:t,bindData:n=!1,customProps:r={},pdfOptions:i={}})=>{const o=Object.create(null),s=K4e();t.forEach(l=>{const c=J4e(l.itemType),d=re(s,`${c}.${l.itemId}`,{}),u=l.value&&typeof l.value=="object";n&&u&&(Object.keys(l.value).forEach(p=>{d[p]=re(e,`${l.value[p]}`)}),l._value=l.value),o[l.nodeId]={...l,componentName:c,props:d,children:[],showEditButton:Y4e.includes(l.itemType)}});const a=[];return t.forEach(l=>{l.parentId&&l.parentId!=="0"?o[l.parentId].children.push(o[l.nodeId]):a.push(o[l.nodeId])}),a.forEach((l,c)=>{l.placement&&l.placement==="last"&&a.push(a.splice(c,1)[0]),bU[l.itemId]&&i[bU[l.itemId]]&&a.splice(c,1)}),a},Sh=(e,{setId:t=!1}={})=>{let n=1;const r=i=>{let o=[];return i.forEach(s=>{t&&(s.nodeId=n,n++),o.push(s),s&&Array.isArray(s.children)&&s.children.length&&(t&&s.children.forEach(a=>{a.parentId=s.nodeId}),o=[...o,...r(s.children)],delete s.children)}),o};return r(e)},N1=()=>({type:"array",default:[{type:"reminder",status:"new",sendDays:2,deliveryTypes:["sms","email"],views:{sms:{nodes:[{nodeId:1,parentId:null,itemId:"smsText",itemType:"smsText",value:{text:"data.smsTemplate.reminder.text"}}]},email:{nodes:[{nodeId:1,parentId:null,itemId:"emailTemplate",itemType:"emailTemplate",value:{subject:"data.emailTemplate.reminder.subject",text:"data.emailTemplate.reminder.text",title:"data.emailTemplate.reminder.title",content:"data.emailTemplate.reminder.content"}}]}},tries:0,sendDaysOptions:{isAfter:!0}},{type:"viewed",status:"new",sendDays:5,deliveryTypes:["sms","email"],views:{sms:{nodes:[{nodeId:1,parentId:null,itemId:"smsText",itemType:"smsText",value:{text:"data.smsTemplate.viewed.text"}}]},email:{nodes:[{nodeId:1,parentId:null,itemId:"emailTemplate",itemType:"emailTemplate",value:{subject:"data.emailTemplate.viewed.subject",text:"data.emailTemplate.viewed.text",title:"data.emailTemplate.viewed.title",content:"data.emailTemplate.viewed.content"}}]}},tries:0,sendDaysOptions:{isAfter:!0}},{type:"expires",status:"new",sendDays:2,deliveryTypes:["sms","email"],views:{sms:{nodes:[{nodeId:1,parentId:null,itemId:"smsText",itemType:"smsText",value:{text:"data.smsTemplate.expires.text"}}]},email:{nodes:[{nodeId:1,parentId:null,itemId:"emailTemplate",itemType:"emailTemplate",value:{subject:"data.emailTemplate.expires.subject",text:"data.emailTemplate.expires.text",title:"data.emailTemplate.expires.title",content:"data.emailTemplate.expires.content"}}]}},tries:0,sendDaysOptions:{isAfter:!1,calculateFrom:"data.expiresAt"}}],items:{$ref:`${De.api.baseUrl}/schemas/reminder/1.json`}}),qC=()=>({type:"object",required:["first"],properties:{first:{type:"object",required:["text"],properties:{text:{type:"string",default:`Hej{{clientFirstName}}!
299
299
  {{company.name}} har skickat ett dokument till dig som du kan lämna svar på. Läs mer och lämna svar på:
300
300
 
301
301
  {{docLink}}`}}},reminder:{type:"object",required:["text"],properties:{text:{type:"string",default:`Påminnelse!
@@ -1751,7 +1751,7 @@ img.ProseMirror-separator {
1751
1751
 
1752
1752
  `);return!o||!s?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0?!1:r.nodeAt(a)?e.commands.command(({tr:c})=>(c.setSelection(mt.near(r.resolve(a))),!0)):e.commands.exitCode()}}},addInputRules(){return[K9({find:Not,type:this.type,getAttributes:e=>({language:e[1]})}),K9({find:Fot,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new In({key:new Zn("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,`
1753
1753
  `));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(dt.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),Bot=ei.create({name:"doc",topNode:!0,content:"block+"});function zot(e={}){return new In({view(t){return new Uot(t,e)}})}class Uot{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return t.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r;if(n){let a=t.nodeBefore,l=t.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let d=c.getBoundingClientRect(),u=a?d.bottom:d.top;a&&l&&(u=(u+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:d.left,right:d.right,top:u-this.width/2,bottom:u+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=mX(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)}}const jot=_r.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[zot(this.options)]}});class nr extends mt{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return nr.valid(r)?new nr(r):mt.near(r)}content(){return We.empty}eq(t){return t instanceof nr&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new nr(t.resolve(n.pos))}getBookmark(){return new hA(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!Hot(t)||!qot(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&nr.valid(t))return t;let i=t.pos,o=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){o=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;i+=n;let l=t.doc.resolve(i);if(nr.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!at.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=t.doc.resolve(i);if(nr.valid(a))return a}return null}}}nr.prototype.visible=!1,nr.findFrom=nr.findGapCursorFrom,mt.jsonID("gapcursor",nr);class hA{constructor(t){this.pos=t}map(t){return new hA(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return nr.valid(n)?new nr(n):mt.near(n)}}function Hot(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function qot(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Wot(){return new In({props:{decorations:Jot,createSelectionBetween(e,t,n){return t.pos==n.pos&&nr.valid(n)?new nr(n):null},handleClick:Kot,handleKeyDown:Got,handleDOMEvents:{beforeinput:Yot}}})}const Got=M9({ArrowLeft:u5("horiz",-1),ArrowRight:u5("horiz",1),ArrowUp:u5("vert",-1),ArrowDown:u5("vert",1)});function u5(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,o){let s=r.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof dt){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(t>0?a.after():a.before())}let c=nr.findGapCursorFrom(a,t,l);return c?(i&&i(r.tr.setSelection(new nr(c))),!0):!1}}function Kot(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!nr.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&at.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new nr(r))),!0)}function Yot(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof nr))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=Se.empty;for(let s=r.length-1;s>=0;s--)i=Se.from(r[s].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new We(i,0,0));return o.setSelection(dt.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function Jot(e){if(!(e.selection instanceof nr))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Un.create(e.doc,[Xr.widget(e.selection.head,t,{key:"gapcursor"})])}const Zot=_r.create({name:"gapCursor",addProseMirrorPlugins(){return[Wot()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Nt(nt(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),Xot=ei.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",_n(this.options.HTMLAttributes,e)]},renderText(){return`
1754
- `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&s){const u=l.filter(p=>a.includes(p.type.name));c.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Qot=ei.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,_n(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>K9({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var p5=200,ti=function(){};ti.prototype.append=function(t){return t.length?(t=ti.from(t),!this.length&&t||t.length<p5&&this.leafAppend(t)||this.length<p5&&t.leafPrepend(this)||this.appendInner(t)):this},ti.prototype.prepend=function(t){return t.length?ti.from(t).append(this):this},ti.prototype.appendInner=function(t){return new est(this,t)},ti.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?ti.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},ti.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},ti.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)},ti.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(t(o,s))},n,r),i},ti.from=function(t){return t instanceof ti?t:t&&t.length?new zee(t):ti.empty};var zee=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=p5)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=p5)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(ti);ti.empty=new zee([]);var est=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(ti),Uee=ti;const tst=500;class Ls{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,a,l,c=[],d=[];return this.items.forEach((u,p)=>{if(!u.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,d.push(u);return}if(i){d.push(new Ma(u.map));let f=u.step.map(i.slice(o)),h;f&&s.maybeStep(f).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new Ma(h,void 0,void 0,c.length+d.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(u.step);if(u.selection)return a=i?u.selection.map(i.slice(o)):u.selection,l=new Ls(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<t.steps.length;d++){let u=t.steps[d].invert(t.docs[d]),p=new Ma(t.mapping.maps[d],u,n),f;(f=l&&l.merge(p))&&(p=f,d?o.pop():a=a.slice(0,a.length-1)),o.push(p),n&&(s++,n=void 0),i||(l=p)}let c=s-r.depth;return c>rst&&(a=nst(a,c),s-=c),new Ls(a.append(o),s)}remapping(t,n){let r=new yf;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new Ls(this.items.append(t.map(n=>new Ma(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},i);let l=n;this.items.forEach(p=>{let f=o.getMirror(--l);if(f==null)return;s=Math.min(s,f);let h=o.maps[f];if(p.step){let m=t.steps[f].invert(t.docs[f]),g=p.selection&&p.selection.map(o.slice(l+1,f));g&&a++,r.push(new Ma(h,m,g))}else r.push(new Ma(h))},i);let c=[];for(let p=n;p<s;p++)c.push(new Ma(o.maps[p]));let d=this.items.slice(0,i).append(c).append(r),u=new Ls(d,a);return u.emptyItemCount()>tst&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=t)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=s.selection&&s.selection.map(n.slice(r));d&&o++;let u=new Ma(c.invert(),l,d),p,f=i.length-1;(p=i.length&&i[f].merge(u))?i[f]=p:i.push(u)}}else s.map&&r--},this.items.length,0),new Ls(Uee.from(i.reverse()),o)}}Ls.empty=new Ls(Uee.empty,0);function nst(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class Ma{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Ma(n.getMap().invert(),n,this.selection)}}}class wd{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const rst=20;function ist(e,t,n,r){let i=n.getMeta(sp),o;if(i)return i.historyState;n.getMeta(ast)&&(e=new wd(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(sp))return s.getMeta(sp).redo?new wd(e.done.addTransform(n,void 0,r,h5(t)),e.undone,jee(n.mapping.maps),e.prevTime,e.prevComposition):new wd(e.done,e.undone.addTransform(n,void 0,r,h5(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!ost(n,e.prevRanges)),c=s?fA(e.prevRanges,n.mapping):jee(n.mapping.maps);return new wd(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,h5(t)),Ls.empty,c,n.time,a??e.prevComposition)}else return(o=n.getMeta("rebased"))?new wd(e.done.rebased(n,o),e.undone.rebased(n,o),fA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new wd(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),fA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function ost(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function jee(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,s)=>t.push(o,s));return t}function fA(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function sst(e,t,n){let r=h5(t),i=sp.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),l=new wd(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(sp,{redo:n,historyState:l})}let mA=!1,Hee=null;function h5(e){let t=e.plugins;if(Hee!=t){mA=!1,Hee=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){mA=!0;break}}return mA}const sp=new Zn("history"),ast=new Zn("closeHistory");function lst(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new In({key:sp,state:{init(){return new wd(Ls.empty,Ls.empty,null,0,-1)},apply(t,n,r){return ist(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?Wee:r=="historyRedo"?Gee:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}function qee(e,t){return(n,r)=>{let i=sp.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=sst(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const Wee=qee(!1,!0),Gee=qee(!0,!0),cst=_r.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Wee(e,t),redo:()=>({state:e,dispatch:t})=>Gee(e,t)}},addProseMirrorPlugins(){return[lst(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),dst=ei.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",_n(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:n}=t,{$from:r,$to:i}=n,o=e();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):bee(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:c}=s.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(dt.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(at.create(s.doc,c.pos)):s.setSelection(dt.create(s.doc,c.pos));else{const u=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();u&&(s.insert(d,u),s.setSelection(dt.create(s.doc,d+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[kee({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),ust=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,pst=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,hst=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,fst=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,mst=Jo.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",_n(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ip({find:ust,type:this.type}),ip({find:hst,type:this.type})]},addPasteRules(){return[gd({find:pst,type:this.type}),gd({find:fst,type:this.type})]}}),gst=ei.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",_n(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),yst="listItem",Kee="textStyle",Yee=/^(\d+)\.\s$/,vst=ei.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",_n(this.options.HTMLAttributes,n),0]:["ol",_n(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(yst,this.editor.getAttributes(Kee)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Wg({find:Yee,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Wg({find:Yee,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Kee)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),bst=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,wst=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,kst=Jo.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",_n(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ip({find:bst,type:this.type})]},addPasteRules(){return[gd({find:wst,type:this.type})]}}),_st=ei.create({name:"text",group:"inline"}),xst=_r.create({name:"starterKit",addExtensions(){var e,t,n,r,i,o,s,a,l,c,d,u,p,f,h,m,g,y;const w=[];return this.options.bold!==!1&&w.push(Dot.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.blockquote!==!1&&w.push(Sot.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bulletList!==!1&&w.push(Iot.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&w.push(Lot.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&w.push(Vot.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&w.push(Bot.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&w.push(jot.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&w.push(Zot.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&w.push(Xot.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&w.push(Qot.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&w.push(cst.configure((d=this.options)===null||d===void 0?void 0:d.history)),this.options.horizontalRule!==!1&&w.push(dst.configure((u=this.options)===null||u===void 0?void 0:u.horizontalRule)),this.options.italic!==!1&&w.push(mst.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&w.push(gst.configure((f=this.options)===null||f===void 0?void 0:f.listItem)),this.options.orderedList!==!1&&w.push(vst.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&w.push(Fee.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&w.push(kst.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&w.push(_st.configure((y=this.options)===null||y===void 0?void 0:y.text)),w}});class Cst{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:d})=>{const{doc:u,selection:p}=l,{empty:f}=p,h=!u.textBetween(c,d).length&&B9(l.selection),m=this.element.contains(document.activeElement);return!(!(a.hasFocus()||m)||f||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),d=!(l!=null&&l.doc.eq(a.state.doc));!c&&!d||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,d,l)},this.updateDelay))},this.updateHandler=(a,l,c,d)=>{var u,p,f;const{state:h,composing:m}=a,{selection:g}=h;if(m||!l&&!c)return;this.createTooltip();const{ranges:w}=g,k=Math.min(...w.map(S=>S.$from.pos)),_=Math.max(...w.map(S=>S.$to.pos));if(!((u=this.shouldShow)===null||u===void 0?void 0:u.call(this,{editor:this.editor,element:this.element,view:a,state:h,oldState:d,from:k,to:_}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((f=this.tippyOptions)===null||f===void 0?void 0:f.getReferenceClientRect)||(()=>{if(bee(h.selection)){let S=a.nodeDOM(k);if(S){const O=S.dataset.nodeViewWrapper?S:S.querySelector("[data-node-view-wrapper]");if(O&&(S=O.firstChild),S)return S.getBoundingClientRect()}}return wit(a,k,_)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=Jc(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}const o=!(n!=null&&n.selection.eq(t.state.selection)),s=!(n!=null&&n.doc.eq(t.state.doc));this.updateHandler(t,o,s,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Jee=e=>new In({key:typeof e.pluginKey=="string"?new Zn(e.pluginKey):e.pluginKey,view:t=>new Cst({view:t,...e})});_r.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Jee({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const Tst=$e({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:t}){const n=Pe(null);return fr(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:a}=e;i.registerPlugin(Jee({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:a}))}),Po(()=>{const{pluginKey:r,editor:i}=e;i.unregisterPlugin(r)}),()=>{var r;return mn("div",{ref:n},(r=t.default)===null||r===void 0?void 0:r.call(t))}}});function Zee(e){return Sp((t,n)=>({get(){return t(),e},set(r){e=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class Sst extends Bit{constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=Zee(this.view.state),this.reactiveExtensionStorage=Zee(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),Wl(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,n){const r=super.registerPlugin(t,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(t){const n=super.unregisterPlugin(t);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const Est=$e({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=Pe(),n=wn();return lo(()=>{const r=e.editor;r&&r.options.element&&t.value&&cr(()=>{if(!t.value||!r.options.element.firstChild)return;const i=J(t.value);t.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:i}),r.createNodeViews()})}),Po(()=>{const r=e.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:t}},render(){return mn("div",{ref:e=>{this.rootEl=e}})}}),Ast=$e({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,t;return mn(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}});class Xee{constructor(t,{props:n={},editor:r}){this.editor=r,this.component=Wl(t),this.el=document.createElement("div"),this.props=Wn(n),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var t,n,r,i;return!((n=(t=this.renderedComponent.vNode)===null||t===void 0?void 0:t.component)===null||n===void 0)&&n.exposed?this.renderedComponent.vNode.component.exposed:(i=(r=this.renderedComponent.vNode)===null||r===void 0?void 0:r.component)===null||i===void 0?void 0:i.proxy}renderComponent(){let t=mn(this.component,this.props);return this.editor.appContext&&(t.appContext=this.editor.appContext),typeof document<"u"&&this.el&&jm(t,this.el),{vNode:t,destroy:()=>{this.el&&jm(null,this.el),this.el=null,t=null},el:this.el?this.el.firstElementChild:null}}updateProps(t={}){Object.entries(t).forEach(([n,r])=>{this.props[n]=r}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const Mst={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}};class Ost extends Uit{mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=Pe(this.getDecorationClasses());const r=$e({extends:{...this.component},props:Object.keys(t),template:this.component.template,setup:i=>{var o,s;return zi("onDragStart",n),zi("decorationClasses",this.decorationClasses),(s=(o=this.component).setup)===null||s===void 0?void 0:s.call(o,i,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new Xee(r,{editor:this.editor,props:t})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:t,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(t<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(t,n,r){const i=o=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(o)};if(typeof this.options.update=="function"){const o=this.node,s=this.decorations,a=this.innerDecorations;return this.node=t,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:o,oldDecorations:s,newNode:t,newDecorations:n,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>i({node:t,decorations:n,innerDecorations:r})})}return t.type!==this.node.type?!1:(t===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=t,this.decorations=n,this.innerDecorations=r,i({node:t,decorations:n,innerDecorations:r})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(t=>t.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function Dst(e,t){return n=>{if(!n.editor.contentComponent)return{};const r=typeof e=="function"&&"__vccOpts"in e?e.__vccOpts:e;return new Ost(r,n,t)}}const gA={__name:"ManualPopover",props:{distance:{type:Number,default:6}},setup(e){const t=Pe(!1),n=ss("popover"),r=ce(()=>{var d,u;return(u=(d=n.value)==null?void 0:d.$el)==null?void 0:u.firstElementChild});fr(()=>{var d;(d=r.value)==null||d.addEventListener("click",i)});const i=d=>{d.preventDefault(),t.value=!t.value,t.value?a():l()},o=()=>{t.value=!1,l()},s=d=>{var p,f,h,m;const u=(m=(h=(f=(p=n.value)==null?void 0:p.$refs)==null?void 0:f.popper)==null?void 0:h.popperNode)==null?void 0:m.call(h);u!=null&&u.contains(d.target)||(t.value=!1,l())},a=()=>{setTimeout(()=>{var d;(d=c())==null||d.addEventListener("click",s)},0)},l=()=>{c().removeEventListener("click",s)},c=()=>{var p,f,h;const d=(h=(p=n.value)==null?void 0:(f=p.$el).getRootNode)==null?void 0:h.call(f);return(d==null?void 0:d.toString())==="[object ShadowRoot]"?d:document};return Po(()=>{var d;l(),(d=r.value)==null||d.removeEventListener("click",i)}),(d,u)=>{const p=A("VDropdown");return v(),V(p,{shown:t.value,ref_key:"popover",ref:n,distance:e.distance,triggers:[],"auto-hide":!1},{popper:E(()=>[se(d.$slots,"popper",{hide:o})]),default:E(()=>[se(d.$slots,"default")]),_:3},8,["shown","distance"])}}},Pst={name:"TextEditorColorMenu",components:{ColorPicker:X7,ManualPopover:gA},emits:["update:show-picker"],props:{editor:{type:Object,required:!0},showPicker:{type:Boolean,required:!0}},data(){return{internalColor:"hsl(205, 90%, 45%)",isTouchDevice:xG}},computed:{currentColor(){return this.editor.getAttributes("textStyle").color}},methods:{openPicker(){this.$emit("update:show-picker",!0)},closePicker(){this.$emit("update:show-picker",!1)},setColor(e){const t=typeof e=="object"?bZ(e.hsl):e;this.internalColor=t;const n=t?"setColor":"unsetColor";this.editor.chain().focus()[n](t).run()}}},Ist=["data-texteditor-tooltip"],$st=["fill"],Rst={key:0},Lst=["onClick"];function Nst(e,t,n,r,i,o){const s=A("ColorPicker"),a=A("CIcon"),l=A("ManualPopover");return v(),V(l,{placement:n.showPicker?"right":i.isTouchDevice?"bottom":"top","popper-class":"color-menu-popover texteditor-tooltip-dropdown-inner is-color-menu",distance:-4,"dispose-timeout":0,onApplyHide:o.closePicker},{popper:E(()=>[b("div",{class:"flex bg-white text-[15px] text-white/70",onClick:t[4]||(t[4]=Ie(()=>{},["stop"]))},[n.showPicker?(v(),x("div",Rst,[T(s,{ref:"colorPicker","model-value":i.internalColor,class:"!p-0 !shadow-none","onUpdate:modelValue":t[0]||(t[0]=c=>o.setColor(c))},null,8,["model-value"])])):(v(),x(ee,{key:1},[(v(),x(ee,null,be(["auto","#0a5cff","#3022f1","#915cee","#f65a5a","#ff7b22","#fcc136","#4caf50","#5d5d5b","#111111"],(c,d)=>b("div",Be({key:d,class:[{"is-active":o.currentColor===c||!o.currentColor&&c==="auto"},"color-option-button"],style:{backgroundColor:c==="auto"?"hsl(0, 0%, 85%)":c},onMousedown:t[1]||(t[1]=Ie(()=>{},["prevent"])),onClick:Ie(u=>o.setColor(c==="auto"?"":c),["prevent","stop"]),ref_for:!0},{...c==="auto"?{"data-texteditor-tooltip":`Auto ${e.$t("_common:color")}`}:{}}),[c==="auto"?(v(),V(a,{key:0,type:"star",size:"14",fill:"hsl(0, 0%, 30%)",stroke:"hsl(0, 0%, 30%)"})):R("",!0)],16,Lst)),64)),b("div",{class:"color-option-button",onMousedown:t[2]||(t[2]=Ie(()=>{},["prevent"])),onClick:t[3]||(t[3]=Ie((...c)=>o.openPicker&&o.openPicker(...c),["prevent","stop"]))},t[6]||(t[6]=[b("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100"},[b("defs",null,[b("filter",{id:"blur","color-interpolation-filters":"linear",x:"-50%",y:"-50%",width:"200%",height:"200%"},[b("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"9"})]),b("mask",{id:"circle"},[b("circle",{cx:"50",cy:"50",r:"50",fill:"white"})])]),b("g",{mask:"url(#circle)",filter:"url(#blur)"},[b("rect",{x:"-10",width:"110",height:"110",fill:"blue"}),b("rect",{x:"50",width:"60",height:"110",fill:"yellow"}),b("polygon",{points:"50,50, 60,110, 40,110",fill:"#0f8"}),b("polygon",{points:"0,0, 100,0, 100,20, 50,50, 0,20",fill:"red"}),b("polygon",{points:"0,10, 50,50, 0,30",fill:"#f0f"}),b("polygon",{points:"100,10, 100,30, 50,50",fill:"#f80"})])],-1)]),32)],64))])]),default:E(()=>[b("button",{"data-texteditor-tooltip":e.$t("_common:color").capitalize(),class:"menu-button"},[(v(),x("svg",{fill:n.editor.getAttributes("textStyle").color,viewBox:"0 0 24 24",width:"20",height:"20",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},t[5]||(t[5]=[b("path",{d:"M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z"},null,-1)]),8,$st))],8,Ist)]),_:1},8,["placement","onApplyHide"])}const Fst=X(Pst,[["render",Nst],["__scopeId","data-v-63ce2d51"]]),Vst={name:"TextEditorFontStyleMenu",components:{ManualPopover:gA},i18nOptions:{namespaces:"TextEditorFontStyleMenu",messages:{en:{fontStyle:"Font style",title:"Title",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",blockquote:"Quote",paragraph:"Text"},sv:{fontStyle:"Typsnitt",title:"Titel",h1:"Rubrik 1",h2:"Rubrik 2",h3:"Rubrik 3",blockquote:"Citat",paragraph:"Text"}}},props:{editor:{type:Object,required:!0}}},Bst=["data-texteditor-tooltip"],zst=["onClick"],Ust=["onClick"];function jst(e,t,n,r,i,o){const s=A("ManualPopover");return v(),V(s,{"popper-class":"texteditor-tooltip-dropdown-inner",placement:"bottom-start"},{popper:E(({hide:a})=>[b("div",{class:"texteditor-tooltip-dropdown flex w-full flex-col text-left",onClick:a},[b("div",{class:ne([{"is-active":n.editor.isActive("paragraph",{typography:"title"})},"texteditor-tooltip-dropdown-item"]),onClick:t[0]||(t[0]=l=>n.editor.chain().focus().setParagraph({typography:"title"}).run())},C(e.$t("title")),3),(v(),x(ee,null,be([1,2,3],l=>b("div",{key:`h${l}`,class:ne([{"is-active":n.editor.isActive("heading",{level:l})},"texteditor-tooltip-dropdown-item"]),onClick:c=>n.editor.chain().focus().setHeading({level:l}).run()},C(e.$t(`h${l}`)),11,Ust)),64)),b("div",{class:ne([{"is-active":n.editor.isActive("paragraph",{typography:null})},"texteditor-tooltip-dropdown-item"]),onClick:t[1]||(t[1]=l=>n.editor.chain().focus().setParagraph({typography:null}).run())},C(e.$t("paragraph")),3),n.editor.commands.toggleBlockquote?(v(),x("div",{key:0,class:ne([{"is-active":n.editor.isActive("blockquote")},"texteditor-tooltip-dropdown-item"]),onClick:t[2]||(t[2]=l=>n.editor.chain().focus().toggleBlockquote().run())},C(e.$t("blockquote")),3)):R("",!0)],8,zst)]),default:E(()=>[b("button",{"data-texteditor-tooltip":e.$t("fontStyle"),class:"menu-button"},t[3]||(t[3]=[b("svg",{width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"1 4 46 44"},[b("path",{d:"M 35.005859 7 A 2.0002 2.0002 0 0 0 33.132812 8.28125 L 23.132812 34.28125 A 2.000748 2.000748 0 0 0 26.867188 35.71875 L 29.066406 30 L 40.933594 30 L 43.132812 35.71875 A 2.000748 2.000748 0 1 0 46.867188 34.28125 L 36.867188 8.28125 A 2.0002 2.0002 0 0 0 35.005859 7 z M 10.980469 13 A 2.0002 2.0002 0 0 0 9.1425781 14.257812 L 3.2519531 28.982422 A 2.0002 2.0002 0 0 0 3.0253906 29.550781 L 1.1425781 34.257812 A 2.0002148 2.0002148 0 1 0 4.8574219 35.742188 L 6.3535156 32 L 15.646484 32 L 17.142578 35.742188 A 2.0002149 2.0002149 0 1 0 20.857422 34.257812 L 18.982422 29.572266 A 2.0002 2.0002 0 0 0 18.980469 29.566406 A 2.0002 2.0002 0 0 0 18.744141 28.976562 L 12.857422 14.257812 A 2.0002 2.0002 0 0 0 10.980469 13 z M 35 14.574219 L 39.394531 26 L 30.605469 26 L 35 14.574219 z M 11 20.386719 L 14.044922 28 L 7.9550781 28 L 11 20.386719 z"})],-1)]),8,Bst)]),_:1})}const Hst={name:"TextEditorBubbleMenu",i18nOptions:{namespaces:"TextEditorBubbleMenu",messages:{en:{bold:"Bold",italic:"Italic",highlight:"Highlight",underline:"Underline"},sv:{bold:"Fetstil",italic:"Kursiv",highlight:"Markera",underline:"Understryk"}}},components:{BubbleMenu:Tst,FontStyleMenu:X(Vst,[["render",jst]]),ColorMenu:Fst},props:{editor:{type:Object,required:!0},extensions:{type:Object,default:()=>({})},isFocused:{type:Boolean,default:!1}},data(){return{linkUrl:null,linkMenuIsActive:!1,showColorPicker:!1,isTouchDevice:xG}},methods:{textAlignActive(e){return this.editor.isActive({textAlign:e})},setTextAlign(e){this.textAlignActive(e)?this.editor.chain().focus().unsetTextAlign().run():this.editor.chain().focus().setTextAlign(e).run()},showLinkMenu(){this.linkUrl=this.editor.getAttributes("link").href,this.linkMenuIsActive=!0,this.$nextTick(()=>this.$refs.linkInput.focus())},hideLinkMenu(){this.linkUrl=null,this.linkMenuIsActive=!1},setLink(e){let t="unsetLink",n=e;e&&(t="setLink",n.toLowerCase().startsWith("http")||(n=`//${n}`)),this.editor.chain().focus().extendMarkRange("link")[t]({href:n}).run(),this.hideLinkMenu()}}},qst={key:1,class:"menu-content"},Wst=["data-texteditor-tooltip"],Gst=["data-texteditor-tooltip"],Kst=["data-texteditor-tooltip"],Yst=["data-texteditor-tooltip"],Jst=["data-texteditor-tooltip"],Zst=["data-texteditor-tooltip"],Xst=["data-texteditor-tooltip"],Qst=["data-texteditor-tooltip"];function eat(e,t,n,r,i,o){const s=A("CIcon"),a=A("FontStyleMenu"),l=A("ColorMenu"),c=A("BubbleMenu",!0),d=jt("click-outside");return v(),V(c,{"should-show":({from:u,to:p})=>(n.isFocused||i.linkMenuIsActive)&&u!==p&&!n.editor.isActive("image")&&!n.editor.isActive("horizontalRule"),editor:n.editor,"tippy-options":{maxWidth:"none"}},{default:E(()=>[b("div",{class:ne([[{"is-bottom":i.isTouchDevice}],"menu"])},[i.linkMenuIsActive?Le((v(),x("form",{key:0,class:"menu-form",onSubmit:t[3]||(t[3]=Ie(u=>o.setLink(i.linkUrl),["prevent"]))},[Le(b("input",{ref:"linkInput","onUpdate:modelValue":t[0]||(t[0]=u=>i.linkUrl=u),class:"menu-input",type:"text",placeholder:"https://",onKeydown:t[1]||(t[1]=tn((...u)=>o.hideLinkMenu&&o.hideLinkMenu(...u),["esc"]))},null,544),[[Xd,i.linkUrl]]),b("div",{class:"menu-button",onMousedown:t[2]||(t[2]=Ie(u=>o.setLink(null),["prevent"]))},[T(s,{type:"x",size:"16"})],32)],32)),[[d,()=>i.linkMenuIsActive=!1]]):(v(),x("div",qst,[T(a,{editor:n.editor},null,8,["editor"]),n.editor.commands.toggleBold?(v(),x("button",{key:0,"data-texteditor-tooltip":e.$t("bold"),class:ne([{"is-active":n.editor.isActive("bold")},"menu-button"]),onMousedown:t[4]||(t[4]=Ie(()=>{},["prevent"])),onClick:t[5]||(t[5]=Ie(u=>n.editor.chain().focus().toggleBold().run(),["prevent"]))},t[21]||(t[21]=[b("svg",{width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"-8 -5 62 62"},[b("path",{d:"M 14 5 A 4.0004 4.0004 0 0 0 10 9 L 10 39 A 4.0004 4.0004 0 0 0 14 43 L 29 43 C 35.580064 43 41 37.580064 41 31 C 41 27.155249 39.030751 23.864926 36.179688 21.662109 C 37.230561 19.978585 38 18.110372 38 16 C 38 9.972248 33.027752 5 27 5 L 14 5 z M 18 13 L 27 13 C 28.704248 13 30 14.295752 30 16 C 30 17.704248 28.704248 19 27 19 L 18 19 L 18 13 z M 18 27 L 27 27 L 29 27 C 31.255936 27 33 28.744064 33 31 C 33 33.255936 31.255936 35 29 35 L 18 35 L 18 27 z"})],-1)]),42,Wst)):R("",!0),n.editor.commands.toggleItalic?(v(),x("button",{key:1,"data-texteditor-tooltip":e.$t("italic"),class:ne([{"is-active":n.editor.isActive("italic")},"menu-button"]),onMousedown:t[6]||(t[6]=Ie(()=>{},["prevent"])),onClick:t[7]||(t[7]=Ie(u=>n.editor.chain().focus().toggleItalic().run(),["prevent"]))},[T(s,{type:"editorItalic",size:"20"})],42,Gst)):R("",!0),b("button",{"data-texteditor-tooltip":e.$t("underline"),class:ne([{"is-active":n.editor.isActive("underline")},"menu-button"]),onMousedown:t[8]||(t[8]=Ie(()=>{},["prevent"])),onClick:t[9]||(t[9]=Ie(u=>n.editor.chain().focus().toggleUnderline().run(),["prevent"]))},t[22]||(t[22]=[b("svg",{width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"-6 -6 58 58"},[b("path",{d:"M 10.970703 4.9726562 A 2.0002 2.0002 0 0 0 9 7 L 9 22.5 C 9 30.484726 15.515274 37 23.5 37 C 31.484726 37 38 30.484726 38 22.5 L 38 7 A 2.0002 2.0002 0 1 0 34 7 L 34 22.5 C 34 28.323274 29.323274 33 23.5 33 C 17.676726 33 13 28.323274 13 22.5 L 13 7 A 2.0002 2.0002 0 0 0 10.970703 4.9726562 z M 11 40 A 2.0002 2.0002 0 1 0 11 44 L 37 44 A 2.0002 2.0002 0 1 0 37 40 L 11 40 z"})],-1)]),42,Kst),b("button",{"data-texteditor-tooltip":e.$t("_common:link").capitalize(),class:ne([{"is-active":n.editor.isActive("link")},"menu-button"]),onMousedown:t[10]||(t[10]=Ie(()=>{},["prevent"])),onClick:t[11]||(t[11]=Ie((...u)=>o.showLinkMenu&&o.showLinkMenu(...u),["prevent"]))},t[23]||(t[23]=[b("svg",{width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -4 54 54"},[b("path",{d:"M 37 4.0039062 C 34.69525 4.0037812 32.389766 4.8822188 30.634766 6.6367188 L 25.634766 11.636719 C 23.142766 14.128719 22.430516 17.727281 23.478516 20.863281 L 27.070312 17.271484 C 27.220312 16.244484 27.673891 15.253844 28.462891 14.464844 L 33.462891 9.4648438 C 34.437891 8.4908438 35.72 8.0019531 37 8.0019531 C 38.28 8.0019531 39.561156 8.4898437 40.535156 9.4648438 C 42.484156 11.414844 42.484156 14.586156 40.535156 16.535156 L 35.535156 21.535156 C 34.746156 22.324156 33.756516 22.776734 32.728516 22.927734 L 29.134766 26.521484 C 30.062766 26.831484 31.029047 26.996094 31.998047 26.996094 C 34.303047 26.996094 36.608281 26.118281 38.363281 24.363281 L 43.363281 19.363281 C 46.873281 15.854281 46.872281 10.145719 43.363281 6.6367188 C 41.608281 4.8827187 39.30475 4.0040313 37 4.0039062 z M 30.960938 16.980469 A 2.0002 2.0002 0 0 0 29.585938 17.585938 L 17.585938 29.585938 A 2.0002 2.0002 0 1 0 20.414062 32.414062 L 32.414062 20.414062 A 2.0002 2.0002 0 0 0 30.960938 16.980469 z M 18.449219 23.023438 C 15.997141 22.898656 13.506469 23.765766 11.636719 25.634766 L 6.6367188 30.634766 C 3.1277188 34.143766 3.1277187 39.854281 6.6367188 43.363281 C 8.3917188 45.117281 10.696 45.994141 13 45.994141 C 15.304 45.994141 17.608281 45.116328 19.363281 43.361328 L 24.363281 38.361328 C 26.855281 35.869328 27.569484 32.270766 26.521484 29.134766 L 22.927734 32.728516 C 22.777734 33.755516 22.324156 34.746156 21.535156 35.535156 L 16.535156 40.535156 C 14.586156 42.485156 11.413844 42.485156 9.4648438 40.535156 C 7.5158438 38.585156 7.5158438 35.413844 9.4648438 33.464844 L 14.464844 28.464844 C 15.253844 27.675844 16.244484 27.221312 17.271484 27.070312 L 20.863281 23.478516 C 20.079281 23.216516 19.266578 23.065031 18.449219 23.023438 z"})],-1)]),42,Yst),t[28]||(t[28]=b("div",{class:"menu-divider"},null,-1)),n.editor.commands.toggleHighlight?(v(),x("button",{key:2,class:ne([{"is-active":n.editor.isActive("highlight")},"menu-button"]),"data-texteditor-tooltip":e.$t("highlight"),onMousedown:t[12]||(t[12]=Ie(()=>{},["prevent"])),onClick:t[13]||(t[13]=Ie(u=>n.editor.chain().focus().toggleHighlight().run(),["prevent"]))},t[24]||(t[24]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",viewBox:"0 0 48 48"},[b("path",{d:"M 7.4765625 4.9785156 A 1.50015 1.50015 0 0 0 6 6.5 L 6 15.5 C 6 17.790682 7.7748091 19.635632 10 19.898438 L 10 24.5 C 10 26.967501 12.032499 29 14.5 29 L 15 29 L 15 43.5 C 15 44.013 15.261359 44.489625 15.693359 44.765625 C 15.938359 44.920625 16.219 45 16.5 45 C 16.716 45 16.933766 44.953375 17.134766 44.859375 L 30.402344 38.667969 C 31.980344 37.932969 33 36.330844 33 34.589844 L 33 29 L 33.5 29 C 35.967501 29 38 26.967501 38 24.5 L 38 19.898438 C 40.225191 19.635632 42 17.790682 42 15.5 L 42 6.5 A 1.50015 1.50015 0 1 0 39 6.5 L 39 15.5 C 39 16.346499 38.346499 17 37.5 17 L 36.746094 17 A 1.50015 1.50015 0 0 0 36.259766 17 L 11.746094 17 A 1.50015 1.50015 0 0 0 11.259766 17 L 10.5 17 C 9.6535009 17 9 16.346499 9 15.5 L 9 6.5 A 1.50015 1.50015 0 0 0 7.4765625 4.9785156 z M 13 20 L 35 20 L 35 24.5 C 35 25.346499 34.346499 26 33.5 26 L 14.5 26 C 13.653501 26 13 25.346499 13 24.5 L 13 20 z"})],-1)]),42,Jst)):R("",!0),n.editor.commands.setColor?(v(),V(l,{key:3,"show-picker":i.showColorPicker,"onUpdate:showPicker":t[14]||(t[14]=u=>i.showColorPicker=u),editor:n.editor},null,8,["show-picker","editor"])):R("",!0),t[29]||(t[29]=b("div",{class:"menu-divider"},null,-1)),n.editor.commands.setTextAlign?(v(),x(ee,{key:4},[b("button",{class:ne([{"is-active":o.textAlignActive("left")},"menu-button"]),"data-texteditor-tooltip":e.$t("_common:align",{thing:e.$t("_common:left")}),onMousedown:t[15]||(t[15]=Ie(()=>{},["prevent"])),onClick:t[16]||(t[16]=Ie(u=>o.setTextAlign("left"),["prevent"]))},t[25]||(t[25]=[b("svg",{width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",fill:"currentColor"},[b("path",{d:"M 6 9 A 2.0002 2.0002 0 1 0 6 13 L 34 13 A 2.0002 2.0002 0 1 0 34 9 L 6 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 7 35 A 2.0002 2.0002 0 1 0 7 39 L 27 39 A 2.0002 2.0002 0 1 0 27 35 L 7 35 z"})],-1)]),42,Zst),b("button",{class:ne([{"is-active":o.textAlignActive("center")},"menu-button"]),"data-texteditor-tooltip":e.$t("_common:center",{thing:e.$t("_common:text")}).capitalize(),onMousedown:t[17]||(t[17]=Ie(()=>{},["prevent"])),onClick:t[18]||(t[18]=Ie(u=>o.setTextAlign("center"),["prevent"]))},t[26]||(t[26]=[b("svg",{width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},[b("path",{d:"M 10 9 A 2.0002 2.0002 0 1 0 10 13 L 38 13 A 2.0002 2.0002 0 1 0 38 9 L 10 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 14 35 A 2.0002 2.0002 0 1 0 14 39 L 34 39 A 2.0002 2.0002 0 1 0 34 35 L 14 35 z"})],-1)]),42,Xst),b("button",{class:ne([{"is-active":o.textAlignActive("right")},"menu-button"]),"data-texteditor-tooltip":e.$t("_common:align",{thing:e.$t("_common:right")}),onMousedown:t[19]||(t[19]=Ie(()=>{},["prevent"])),onClick:t[20]||(t[20]=Ie(u=>o.setTextAlign("right"),["prevent"]))},t[27]||(t[27]=[b("svg",{width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",fill:"currentColor"},[b("path",{d:"M 14 9 A 2.0002 2.0002 0 1 0 14 13 L 42 13 A 2.0002 2.0002 0 1 0 42 9 L 14 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 22 35 A 2.0002 2.0002 0 1 0 22 39 L 42 39 A 2.0002 2.0002 0 1 0 42 35 L 22 35 z"})],-1)]),42,Qst)],64)):R("",!0)]))],2)]),_:1},8,["should-show","editor"])}const tat=X(Hst,[["render",eat],["__scopeId","data-v-e14ee888"]]),nat={components:{FormInputRow:Q1,TextTemplates:vt(()=>Promise.resolve().then(()=>Bmt))},emits:["upload-image"],mixins:[yr],props:{editor:{type:Object,required:!0},isFocused:{type:Boolean,default:!1},extensions:{type:Object,default:()=>({})}},i18nOptions:{namespaces:"tableMenu",messages:{en:{addColumnBefore:"Insert column to the left",addColumnAfter:"Insert column to the right",deleteColumn:"Delete column",addRowBefore:"Insert row above",addRowAfter:"Insert row below",deleteRow:"Delete row",toggleHeaderCell:"Toggle background cell",mergeOrSplit:"Merge or split cells",appearance:"Table style",deleteTable:"Delete table"},sv:{addColumnBefore:"Infoga kolumn till vänster",addColumnAfter:"Infoga kolumn till höger",deleteColumn:"Ta bort kolumn",addRowBefore:"Infoga rad ovanför",addRowAfter:"Infoga rad under",deleteRow:"Ta bort rad",toggleHeaderCell:"Växla bakgrund",mergeOrSplit:"Slå samman eller dela upp cell",appearance:"Utseende",deleteTable:"Ta bort tabell"}}},data(){return{popupOpen:!1,tableActions:[{onClick:()=>this.editor.chain().focus().addColumnBefore().run(),icon:"tableInsertColumnBefore",tooltip:this.$t("addColumnBefore")},{onClick:()=>this.editor.chain().focus().addColumnAfter().run(),icon:"tableInsertColumnAfter",tooltip:this.$t("addColumnAfter")},{onClick:()=>this.editor.chain().focus().deleteColumn().run(),icon:"tableDeleteColumn",tooltip:this.$t("deleteColumn")},{type:"divider"},{onClick:()=>this.editor.chain().focus().addRowBefore().run(),icon:"tableInsertRowBefore",tooltip:this.$t("addRowBefore")},{onClick:()=>this.editor.chain().focus().addRowAfter().run(),icon:"tableInsertRowAfter",tooltip:this.$t("addRowAfter")},{onClick:()=>this.editor.chain().focus().deleteRow().run(),icon:"tableDeleteRow",tooltip:this.$t("deleteRow")},{type:"divider"},{onClick:()=>this.editor.chain().focus().toggleHeaderCell().run(),icon:"tableHeaderCell",tooltip:this.$t("toggleHeaderCell")},{onClick:()=>this.editor.chain().focus().mergeOrSplit().run(),icon:"tableEditCell",tooltip:this.$t("mergeOrSplit")},{onClick:()=>{this.popupOpen=!0},icon:"drop",tooltip:this.$t("appearance"),popup:()=>{const{borderColor:e,borderWidth:t,cellPadding:n,headerBackground:r}=this.editor.getAttributes("table");return this.generateStyleInputs({borderColor:e,borderWidth:t,cellPadding:n,headerBackground:r,set:(i,o)=>this.editor.commands.updateAttributes("table",{[i]:o})})}},{type:"divider"},{onClick:()=>this.editor.chain().focus().deleteTable().run(),icon:"tableDelete",tooltip:this.$t("deleteTable")}],defaultActions:[{hide:this.mq==="sm"||!this.editor.commands.toggleHeading,onClick:()=>this.editor.commands.toggleHeading({level:1}),active:()=>this.editor.isActive("heading",{level:1}),icon:"editorH1",tooltip:this.$t("_common:designLabels.h1"),hideForMobile:!0},{hide:this.mq==="sm"||!this.editor.commands.toggleHeading,onClick:()=>this.editor.commands.toggleHeading({level:2}),active:()=>this.editor.isActive("heading",{level:2}),icon:"editorH2",tooltip:this.$t("_common:designLabels.h2"),hideForMobile:!0},{hide:this.mq==="sm"||!this.editor.commands.toggleHeading,onClick:()=>this.editor.commands.toggleHeading({level:3}),active:()=>this.editor.isActive("heading",{level:3}),icon:"editorH3",tooltip:this.$t("_common:designLabels.h3"),hideForMobile:!0},{hide:this.mq==="sm"||!this.editor.commands.toggleBlockquote,onClick:()=>this.editor.commands.toggleBlockquote(),active:()=>this.editor.isActive("blockquote"),icon:"editorQuote",tooltip:this.$t("_common:designLabels.blockquote"),hideForMobile:!0},{type:"divider",hideForMobile:!0},{hide:!this.editor.commands.toggleOrderedList,onClick:()=>this.editor.commands.toggleOrderedList(),active:()=>this.editor.isActive("orderedList"),icon:"editorNumberedList",tooltip:this.$t("_common:designLabels.numberedList")},{hide:!this.editor.commands.toggleBulletList,onClick:()=>this.editor.commands.toggleBulletList(),active:()=>this.editor.isActive("bulletList"),icon:"editorBulletList",tooltip:this.$t("_common:designLabels.bulletList")},{type:"divider"},{hide:!this.editor.commands.setImage,onClick:()=>{this.popupOpen=!0,this.$refs.inputImgUpload.click()},icon:"editorImage",tooltip:this.$t("_common:insert",{thing:this.$t("_common:image")})},{hide:!this.editor.commands.insertTable,onClick:()=>this.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),icon:"table",tooltip:this.$t("_common:table").capitalize()},{hide:!this.editor.commands.setHorizontalRule,onClick:()=>this.editor.chain().focus().setHorizontalRule().run(),icon:"editorLine",tooltip:this.$t("_common:designLabels.line")},{hide:!this.extensions.mentions&&!this.extensions.snippets,type:"divider"},{hide:!this.extensions.mentions,onClick:()=>this.editor.chain().focus().insertContent("@").run(),icon:"editorMention",tooltip:this.$t("_common:insert",{thing:this.$t("_common:reference")})}]}},computed:{shouldShow(){return this.isFocused||this.popupOpen},menuActions(){return this.editor.isActive("table")?this.tableActions:this.defaultActions.filter(t=>t.hideForMobile?this.mq!=="sm":!0)}},methods:{generateStyleInputs({borderColor:e,borderWidth:t,cellPadding:n,headerBackground:r,set:i}){const o=/([\d+.]*)(.*)/,s=c=>(c||"").match(o),a=s(t)[1],l=s(n)[1];return[{label:this.$t("_common:designLabels.borderWidth"),inputs:[{component:"input",props:{value:a,type:"number",minValue:0},onInput:c=>i("borderWidth",`${c}px`)},{component:"step",props:{value:a},onIncrease:()=>i("borderWidth",`${parseFloat(a||0)+1}px`),onDecrease:()=>i("borderWidth",`${parseFloat(a||0)-1}px`)}]},{label:this.$t("_common:designLabels.color"),inputs:[{component:"color",props:{value:e||""},onInput:c=>i("borderColor",c)}]},{label:this.$t("_common:designLabels.padding"),inputs:[{component:"input",props:{value:l,type:"number",minValue:0},onInput:c=>i("cellPadding",`${c}px`)},{component:"step",props:{value:l},onIncrease:()=>i("cellPadding",`${parseFloat(l||0)+1}px`),onDecrease:()=>i("cellPadding",`${parseFloat(l||0)-1}px`)}]},{label:this.$t("_common:designLabels.background"),inputs:[{component:"color",props:{value:r||"",showReset:!0,position:"is-top-right"},onInput:c=>i("headerBackground",c)}]}]},setTextToEditor(e){this.editor.chain().focus().insertContent(e).run()}}},rat=["data-texteditor-tooltip","onMousedown","onClick"],iat={key:0,style:{position:"absolute",left:"50%",bottom:"calc(100% + 1em)","background-color":"white",padding:"10px 10px calc(2 * var(--rem)) 10px",transform:"translate(-50%, 0%)",color:"hsl(0, 0%, 35%)",width:"250px","box-shadow":"0 8px 14px rgba(0, 0, 0, 0.2)",border:"1px solid hsl(0, 0%, 88%)","border-radius":"8px",cursor:"default"}},oat=["data-texteditor-tooltip"];function sat(e,t,n,r,i,o){const s=A("CIcon"),a=A("FormInputRow"),l=A("TextTemplates"),c=A("portal"),d=jt("click-outside");return v(),V(c,{to:"modal"},{default:E(()=>[T(Cn,{name:"slide-vertical",mode:"out-in"},{default:E(()=>[o.shouldShow?(v(),x("div",{key:o.menuActions[0].tooltip,class:"menu"},[(v(!0),x(ee,null,be(o.menuActions,(u,p)=>(v(),x(ee,{key:p},[u.type==="divider"&&!u.hide?(v(),x("div",{key:"divider-"+p,class:"menu-divider"})):u.hide?R("",!0):Le((v(),x("div",{key:p,"data-texteditor-tooltip":u.tooltip,class:ne([{"is-active":u.active&&u.active()},"menu-button"]),onMousedown:f=>{u.popup?u.onClick():f.preventDefault()},onClick:u.onClick},[T(s,{type:u.icon||"info",size:"22"},null,8,["type"]),u.popup&&i.popupOpen?(v(),x("div",iat,[(v(!0),x(ee,null,be(u.popup(),(f,h)=>(v(),V(a,{key:h,label:f.label,inputs:f.inputs},null,8,["label","inputs"]))),128))])):R("",!0)],42,rat)),[[d,()=>{u.popup&&(i.popupOpen=!1)}]])],64))),128)),n.extensions.snippets&&!n.editor.isActive("table")?(v(),V(l,{key:0,placement:"top",onMousedown:t[0]||(t[0]=Ie(()=>{},["prevent"])),onOpen:t[1]||(t[1]=u=>i.popupOpen=!0),onSelect:o.setTextToEditor,onClose:t[2]||(t[2]=u=>i.popupOpen=!1)},{default:E(()=>[b("div",{"data-texteditor-tooltip":e.$t("_common:insert",{thing:e.$t("_common:snippet")}),class:"menu-button"},[T(s,{type:"editorSnippets",size:"22"})],8,oat)]),_:1},8,["onSelect"])):R("",!0),b("input",{ref:"inputImgUpload",type:"file",style:{display:"none"},onChange:t[3]||(t[3]=u=>{e.$emit("upload-image",{file:u}),i.popupOpen=!1})},null,544)])):R("",!0)]),_:1})]),_:1})}const aat=X(nat,[["render",sat],["__scopeId","data-v-0cd0d0af"]]);function lat(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=e,a=jit(n),l=new RegExp(`\\s${a}$`),c=o?"^":"",d=r?new RegExp(`${c}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${c}(?:^)?${a}[^\\s${a}]*`,"gm"),u=((t=s.nodeBefore)===null||t===void 0?void 0:t.isText)&&s.nodeBefore.text;if(!u)return null;const p=s.pos-u.length,f=Array.from(u.matchAll(d)).pop();if(!f||f.input===void 0||f.index===void 0)return null;const h=f.input.slice(Math.max(0,f.index-1),f.index),m=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(h);if(i!==null&&!m)return null;const g=p+f.index;let y=g+f[0].length;return r&&l.test(u.slice(y-1,y+1))&&(f[0]+=" ",y+=1),g<s.pos&&y>=s.pos?{range:{from:g,to:y},query:f[0].slice(n.length),text:f[0]}:null}const cat=new Zn("suggestion");function Qee({pluginKey:e=cat,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=()=>null,items:c=()=>[],render:d=()=>({}),allow:u=()=>!0,findSuggestionMatch:p=lat}){let f;const h=d==null?void 0:d(),m=new In({key:e,view(){return{update:async(g,y)=>{var w,k,_,M,S,O,P;const I=(w=this.key)===null||w===void 0?void 0:w.getState(y),L=(k=this.key)===null||k===void 0?void 0:k.getState(g.state),$=I.active&&L.active&&I.range.from!==L.range.from,F=!I.active&&L.active,U=I.active&&!L.active,q=!F&&!U&&I.query!==L.query,z=F||$&&q,D=q||$,N=U||$&&q;if(!z&&!D&&!N)return;const B=N&&!z?I:L,Q=g.dom.querySelector(`[data-decoration-id="${B.decorationId}"]`);f={editor:t,range:B.range,query:B.query,text:B.text,items:[],command:te=>l({editor:t,range:B.range,props:te}),decorationNode:Q,clientRect:Q?()=>{var te;const{decorationId:he}=(te=this.key)===null||te===void 0?void 0:te.getState(t.state),Me=g.dom.querySelector(`[data-decoration-id="${he}"]`);return(Me==null?void 0:Me.getBoundingClientRect())||null}:null},z&&((_=h==null?void 0:h.onBeforeStart)===null||_===void 0||_.call(h,f)),D&&((M=h==null?void 0:h.onBeforeUpdate)===null||M===void 0||M.call(h,f)),(D||z)&&(f.items=await c({editor:t,query:B.query})),N&&((S=h==null?void 0:h.onExit)===null||S===void 0||S.call(h,f)),D&&((O=h==null?void 0:h.onUpdate)===null||O===void 0||O.call(h,f)),z&&((P=h==null?void 0:h.onStart)===null||P===void 0||P.call(h,f))},destroy:()=>{var g;f&&((g=h==null?void 0:h.onExit)===null||g===void 0||g.call(h,f))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(g,y,w,k){const{isEditable:_}=t,{composing:M}=t.view,{selection:S}=g,{empty:O,from:P}=S,I={...y};if(I.composing=M,_&&(O||t.view.composing)){(P<y.range.from||P>y.range.to)&&!M&&!y.composing&&(I.active=!1);const L=p({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:S.$from}),$=`id_${Math.floor(Math.random()*4294967295)}`;L&&u({editor:t,state:k,range:L.range,isActive:y.active})?(I.active=!0,I.decorationId=y.decorationId?y.decorationId:$,I.range=L.range,I.query=L.query,I.text=L.text):I.active=!1}else I.active=!1;return I.active||(I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null),I}},props:{handleKeyDown(g,y){var w;const{active:k,range:_}=m.getState(g.state);return k&&((w=h==null?void 0:h.onKeyDown)===null||w===void 0?void 0:w.call(h,{view:g,event:y,range:_}))||!1},decorations(g){const{active:y,range:w,decorationId:k}=m.getState(g);return y?Un.create(g.doc,[Xr.inline(w.from,w.to,{nodeName:s,class:a,"data-decoration-id":k})]):null}}});return m}const dat=new Zn("mention"),uat=ei.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:e,node:t}){var n;return`${e.suggestion.char}${(n=t.attrs.label)!==null&&n!==void 0?n:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t}){var n;return["span",_n(this.HTMLAttributes,e.HTMLAttributes),`${e.suggestion.char}${(n=t.attrs.label)!==null&&n!==void 0?n:t.attrs.id}`]},suggestion:{char:"@",pluginKey:dat,command:({editor:e,range:t,props:n})=>{var r,i,o;const s=e.view.state.selection.$to.nodeAfter;((r=s==null?void 0:s.text)===null||r===void 0?void 0:r.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(o=(i=e.view.dom.ownerDocument.defaultView)===null||i===void 0?void 0:i.getSelection())===null||o===void 0||o.collapseToEnd()},allow:({state:e,range:t})=>{const n=e.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",_n({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})];const n={...this.options};n.HTMLAttributes=_n({"data-type":this.name},this.options.HTMLAttributes,t);const r=this.options.renderHTML({options:n,node:e});return typeof r=="string"?["span",_n({"data-type":this.name},this.options.HTMLAttributes,t),r]:r},renderText({node:e}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:e})):this.options.renderText({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1;const{selection:r}=t,{empty:i,anchor:o}=r;return i?(t.doc.nodesBetween(o-1,o,(s,a)=>{if(s.type.name===this.name)return n=!0,e.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",a,a+s.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[Qee({editor:this.editor,...this.options.suggestion})]}}),pat={name:"TextEditorMentionList",i18nOptions:{namespaces:"TextEditorMentionList",messages:{en:{referenceTooltipTitle:"Reference info from..."},sv:{referenceTooltipTitle:"Referera till info från..."}}},props:{items:{type:Array,required:!0},command:{type:Function,required:!0}},setup(){return{mentions:Pe([])}},data(){return{navigatedIndex:0}},watch:{items(){this.navigatedIndex=0}},methods:{onKeyDown({event:e}){return e.key==="ArrowUp"?(this.upHandler(),!0):e.key==="ArrowDown"?(this.downHandler(),!0):e.key==="Enter"?(this.enterHandler(),!0):!1},upHandler(){this.navigatedIndex=(this.navigatedIndex+this.items.length-1)%this.items.length,this.scrollToHighlightedMention()},downHandler(){this.navigatedIndex=(this.navigatedIndex+1)%this.items.length,this.scrollToHighlightedMention()},scrollToHighlightedMention(){!this.mentions||!this.mentions[this.navigatedIndex]||this.mentions[this.navigatedIndex].scrollIntoView({block:"nearest"})},enterHandler(){const e=this.items[this.navigatedIndex];e&&this.selectItem(e)},selectItem(e){this.command(e)}}},hat={class:"flex max-h-[300px] w-64 flex-col overflow-hidden rounded-lg border border-solid border-slate-200 bg-white text-base text-[#262626] shadow-lg"},fat={class:"px-4 py-3 text-sm font-semibold"},mat={class:"overflow-auto"},gat=["onClick"],yat={key:1,class:"px-4 py-2 opacity-50"};function vat(e,t,n,r,i,o){return v(),x("div",hat,[n.items.length?(v(),x(ee,{key:0},[b("div",fat,C(e.$t("referenceTooltipTitle")),1),b("div",mat,[(v(!0),x(ee,null,be(n.items,(s,a)=>(v(),x("div",{ref_for:!0,ref:"mentions",key:s.id+a,class:ne([{"bg-[hsl(var(--primary-color-500)/0.2)]":i.navigatedIndex===a,"mb-3":a==n.items.length-1},"cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap px-4 py-1 hover:bg-[hsl(var(--primary-color-500)/0.1)]"]),onMousedown:t[0]||(t[0]=Ie(()=>{},["prevent"])),onClick:l=>o.selectItem(s)},C(s.label),43,gat))),128))])],64)):(v(),x("div",yat,C(e.$t("_common:noResults")),1))])}const bat=X(pat,[["render",vat]]),ete="mention",tte=(e,t)=>(t||[]).filter(({label:n=""})=>n.toLowerCase().includes(e.toLowerCase()));function wat(e=null){let t=[];const n=typeof e=="function"?e:()=>[];return{render:()=>{let r,i,o;return{onStart:s=>{t=n(),s.items=tte(s.query,t);const{el:a,isShadow:l}=Ky(this.$el),c=l?a:a.body,d=l?a:document;r=new Xee(bat,{props:s,editor:s.editor}),i=Jc("body",{getReferenceClientRect:s.clientRect,appendTo:c,content:r.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",plugins:[TVe],onHidden:()=>{r.destroy(),o&&d.removeEventListener("touchstart",o)}}),o=u=>{i[0].popper.contains(u.target)||i[0].hide()},d.addEventListener("touchstart",o)},onUpdate(s){s.items=tte(s.query,t),r.updateProps(s),i[0].setProps({getReferenceClientRect:s.clientRect})},onKeyDown(s){return s.event.key==="Escape"?(i[0].hide(),!0):r.ref.onKeyDown(s)},onExit(){if(i[0].destroy(),r.destroy(),o){const{el:s,isShadow:a}=Ky(this.$el);(a?s:document).removeEventListener("touchstart",o)}}}}}}function kat(e=null){return uat.extend({addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-mention-id"),renderHTML:t=>({"data-mention-id":t.id})},label:{default:null,parseHTML:t=>t.innerText.split(this.options.suggestion.char).join("")},tooltip:{default:null,parseHTML:t=>t.getAttribute("data-tooltip"),renderHTML:t=>({"data-tooltip":t.tooltip})},filter:{default:null,parseHTML:t=>t.getAttribute("data-filter"),renderHTML:t=>({"data-filter":t.filter})}}},parseHTML(){return[{tag:"span[data-mention-id]"}]},renderHTML({HTMLAttributes:t}){return["span",{class:[ete,...t["data-tooltip"]?[]:["empty"]].join(" "),...t,"data-tooltip":t["data-tooltip"]||ye.t("_common:missing",{thing:ye.t("_common:value")})},`${t.label}`]},addProseMirrorPlugins(){const t=typeof e=="function"?e:()=>[];let n=t();return[Qee({editor:this.editor,...this.options.suggestion}),new In({key:new Zn("mention-paste-handler"),props:{handlePaste(r,i){if(r.props.editable&&!r.props.editable(r.state))return!1;const o=i.clipboardData||i.originalEvent.clipboardData;if(!o)return!1;const s=o.getData("text/plain");if(typeof s!="string"||!s.startsWith("{{")||!s.endsWith("}}"))return!1;const a=s.substring(2,s.length-2);n=t();const l=n.find(f=>f.id===a);if(!l)return!1;const{state:c,dispatch:d}=r,u=c.schema.nodes.mention.create(l),p=c.tr.replaceSelectionWith(u);return d(p),!0}}})]}}).configure({HTMLAttributes:{class:ete},suggestion:wat.call(this,e)})}const _at=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,xat=ei.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",_n(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[kee({find:_at,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),Cat={name:"TextEditorImageView",components:{NodeViewWrapper:Ast},props:Mst,data(){return{hasError:!1,displayOptions:[{value:"left",icon:'<rect x="1" y="5" width="11" height="15" rx="0" ry="2"></rect><line x1="16" y1="7" x2="22" y2="7"></line><line x1="16" y1="12" x2="22" y2="12"></line><line x1="16" y1="17" x2="22" y2="17"></line>',tooltip:this.$t("_common:align",{thing:this.$t("_common:left")})},{value:"block",icon:'<rect x="2" y="7" width="19" height="11" rx="0" ry="2"></rect><line x1="2" y1="3" y2="3" x2="21"></line><line x1="2" y1="22" x2="21" y2="22"></line>',tooltip:this.$t("_common:center",{thing:this.$t("_common:image")}).capitalize()},{value:"right",icon:'<rect x="11" y="5" width="11" height="15" rx="0" ry="2"></rect><line x1="0" y1="7" y2="7" x2="6"></line><line x1="0" y1="12" x2="6" y2="12"></line><line x1="0" y1="17" x2="6" y2="17"></line>',tooltip:this.$t("_common:align",{thing:this.$t("_common:right")})}]}},computed:{isSelected(){return this.selected&&this.editor.isEditable},src(){var t,n;const e=re(this,"node.attrs.src","");return((n=(t=this.extension)==null?void 0:t.options)==null?void 0:n.resolveImgSrc(e))||e},display(){return re(this,"node.attrs.display","block")},style(){return re(this,"node.attrs.style","")}},methods:{selectImage(){this.editor.isEditable?this.editor.chain().focus().setNodeSelection(this.getPos()).run():this.openPreview()},remove(){this.deleteNode(this.getPos())},changeDisplay(e){this.updateAttributes({display:e}),this.selectImage()},async openPreview(){var n;const e=vt(()=>Promise.resolve().then(()=>KQe)),{title:t}=((n=this.node)==null?void 0:n.attrs)||{};this.$modal.show(e,{index:0,list:[{url:this.src,name:t}]},{adaptive:!0,height:"100%",width:"100%",classes:"",transition:""})},onError(){this.hasError=!0}}},Tat=["src"],Sat={key:1,class:"image-menu top-2 rounded-md bg-gray-800"},Eat=["innerHTML"];function Aat(e,t,n,r,i,o){const s=A("CButton"),a=A("CIcon"),l=A("NodeViewWrapper");return v(),V(l,{class:ne([[{"texteditor-image-view-inline":o.display&&o.display!=="block","outline-primary-300 outline outline-2":o.isSelected},`texteditor-image-view-${o.display}`],"texteditor-image-view"]),as:"span",draggable:"true","data-drag-handle":""},{default:E(()=>[i.hasError?R("",!0):(v(),x("img",{key:0,src:o.src,class:ne({selected:o.isSelected}),style:Oe(o.style),onClick:t[0]||(t[0]=(...c)=>o.selectImage&&o.selectImage(...c)),onError:t[1]||(t[1]=(...c)=>o.onError&&o.onError(...c))},null,46,Tat)),o.isSelected?(v(),x("div",Sat,[(v(!0),x(ee,null,be(i.displayOptions,(c,d)=>(v(),V(s,{key:d,class:ne({"!text-primary-300":o.display===c.value}),"data-texteditor-tooltip":c.tooltip,type:"none",size:"small",onClick:u=>o.changeDisplay(c.value)},{default:E(()=>[(v(),x("svg",{viewBox:"0 0 24 24",width:"21",height:"21",stroke:"currentColor","stroke-width":"2",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",innerHTML:c.icon},null,8,Eat))]),_:2},1032,["class","data-texteditor-tooltip","onClick"]))),128)),t[2]||(t[2]=b("div",{class:"bg-gray-500",style:{width:"1px",height:"1.5em",margin:"0 2px"}},null,-1)),T(s,{"data-texteditor-tooltip":e.$t("_common:remove"),type:"none",size:"small",onClick:o.remove},{default:E(()=>[T(a,{size:18,type:"trash"})]),_:1},8,["data-texteditor-tooltip","onClick"])])):R("",!0)]),_:1},8,["class"])}const Mat=X(Cat,[["render",Aat],["__scopeId","data-v-7f9e7fe8"]]),Oat=(e,t=!1)=>xat.extend({addOptions(){return{inline:!0,allowBase64:!0,HTMLAttributes:{},resolveImgSrc:n=>vU(n,t?{auto:"compress"}:{})}},addAttributes(){return{...this.parent?this.parent():null,src:{default:null,parseHTML:n=>n.getAttribute("src"),renderHTML:n=>{var r;return{src:((r=this.options)==null?void 0:r.resolveImgSrc(n.src))||n.src}}},display:{default:"block",parseHTML:n=>n.getAttribute("data-display"),renderHTML:n=>({"data-display":n.display})},style:{default:"",parseHTML:n=>n.getAttribute("style"),renderHTML:n=>({style:n.style})},hash:{default:null,parseHTML:n=>n.getAttribute("data-hash"),renderHTML:n=>({"data-hash":n.hash})},algorithm:{default:null,parseHTML:n=>n.getAttribute("data-alg"),renderHTML:n=>({"data-alg":n.algorithm})}}},addNodeView(){return Dst(Mat)},addProseMirrorPlugins(){return[new In({key:new Zn("image-handler"),props:{handlePaste(n,r){const{items:i}=r.clipboardData||r.originalEvent.clipboardData;for(const o of i)if(o.type.indexOf("image")===0){r.preventDefault();const{schema:s}=n.state,a=o.getAsFile();if(e)e(a).then(({url:l,hash:c,algorithm:d})=>{const u=s.nodes.image.create({src:l,hash:c,algorithm:d}),p=n.state.tr.replaceSelectionWith(u);n.dispatch(p)});else{const l=new FileReader;l.onload=c=>{const d=s.nodes.image.create({src:c.target.result}),u=n.state.tr.replaceSelectionWith(d);n.dispatch(u)},l.readAsDataURL(a)}}return!1},handleDOMEvents:{drop(n,r){if(!(r.dataTransfer&&r.dataTransfer.files&&r.dataTransfer.files.length))return;const o=Array.from(r.dataTransfer.files).filter(l=>/image/i.test(l.type));if(o.length===0)return;r.preventDefault();const{schema:s}=n.state,a=n.posAtCoords({left:r.clientX,top:r.clientY});o.forEach(async l=>{const c=new FileReader;if(e){const{url:d,hash:u,algorithm:p}=await e(l),f=s.nodes.image.create({src:d,hash:u,algorithm:p}),h=n.state.tr.insert(a.pos,f);n.dispatch(h)}else c.onload=d=>{const u=s.nodes.image.create({src:d.target.result}),p=n.state.tr.insert(a.pos,u);n.dispatch(p)},c.readAsDataURL(l)})}}}})]}});var yA,vA;if(typeof WeakMap<"u"){let e=new WeakMap;yA=t=>e.get(t),vA=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;yA=r=>{for(let i=0;i<e.length;i+=2)if(e[i]==r)return e[i+1]},vA=(r,i)=>(n==10&&(n=0),e[n++]=r,e[n++]=i)}var rr=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,i=t/this.width|0;let o=r+1,s=i+1;for(let a=1;o<this.width&&this.map[t+a]==n;a++)o++;for(let a=1;s<this.height&&this.map[t+this.width*a]==n;a++)s++;return{left:r,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:i,top:o,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(e,t){const{left:n,right:r,top:i,bottom:o}=this.findCell(e),{left:s,right:a,top:l,bottom:c}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(i,l),right:Math.max(r,a),bottom:Math.max(o,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){const o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,!(i==e.left&&i&&this.map[o-1]==s||r==e.top&&r&&this.map[o-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==e){let s=t+e*this.width;const a=(e+1)*this.width;for(;s<a&&this.map[s]<i;)s++;return s==a?o-1:this.map[s]}i=o}}static get(e){return yA(e)||vA(e,Dat(e))}};function Dat(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Pat(e),n=e.childCount,r=[];let i=0,o=null;const s=[];for(let c=0,d=t*n;c<d;c++)r[c]=0;for(let c=0,d=0;c<n;c++){const u=e.child(c);d++;for(let h=0;;h++){for(;i<r.length&&r[i]!=0;)i++;if(h==u.childCount)break;const m=u.child(h),{colspan:g,rowspan:y,colwidth:w}=m.attrs;for(let k=0;k<y;k++){if(k+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:d,n:y-k});break}const _=i+k*t;for(let M=0;M<g;M++){r[_+M]==0?r[_+M]=d:(o||(o=[])).push({type:"collision",row:c,pos:d,n:g-M});const S=w&&w[M];if(S){const O=(_+M)%t*2,P=s[O];P==null||P!=S&&s[O+1]==1?(s[O]=S,s[O+1]=1):P==S&&s[O+1]++}}}i+=g,d+=m.nodeSize}const p=(c+1)*t;let f=0;for(;i<p;)r[i++]==0&&f++;f&&(o||(o=[])).push({type:"missing",row:c,n:f}),d++}const a=new rr(t,n,r,o);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&Iat(a,s,e),a}function Pat(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const i=e.child(r);let o=0;if(n)for(let s=0;s<r;s++){const a=e.child(s);for(let l=0;l<a.childCount;l++){const c=a.child(l);s+c.attrs.rowspan>r&&(o+=c.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const a=i.child(s);o+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}t==-1?t=o:t!=o&&(t=Math.max(t,o))}return t}function Iat(e,t,n){e.problems||(e.problems=[]);const r={};for(let i=0;i<e.map.length;i++){const o=e.map[i];if(r[o])continue;r[o]=!0;const s=n.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let a=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const d=(i+c)%e.width,u=t[d*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((a||(a=$at(l)))[c]=u)}a&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}function $at(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function bi(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var kd=new Zn("selectingCells");function $f(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Rat(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function Ns(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function f5(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=$f(t.$head)||Lat(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function Lat(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function bA(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function Nat(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function wA(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function nte(e,t,n){const r=e.node(-1),i=rr.get(r),o=e.start(-1),s=i.nextCell(e.pos-o,t,n);return s==null?null:e.node(0).resolve(o+s)}function ap(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function rte(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(t,0,0)}return r}function Fat(e,t,n){const r=bi(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var An=class Bl extends mt{constructor(t,n=t){const r=t.node(-1),i=rr.get(r),o=t.start(-1),s=i.rectBetween(t.pos-o,n.pos-o),a=t.node(0),l=i.cellsInRect(s).filter(d=>d!=n.pos-o);l.unshift(n.pos-o);const c=l.map(d=>{const u=r.nodeAt(d);if(!u)throw RangeError(`No cell with offset ${d} found`);const p=o+d+1;return new wX(a.resolve(p),a.resolve(p+u.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(bA(r)&&bA(i)&&wA(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Bl.rowSelection(r,i):o&&this.isColSelection()?Bl.colSelection(r,i):new Bl(r,i)}return dt.between(r,i)}content(){const t=this.$anchorCell.node(-1),n=rr.get(t),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let d=l*n.width+i.left,u=i.left;u<i.right;u++,d++){const p=n.map[d];if(o[p])continue;o[p]=!0;const f=n.findCell(p);let h=t.nodeAt(p);if(!h)throw RangeError(`No cell with offset ${p} found`);const m=i.left-f.left,g=f.right-i.right;if(m>0||g>0){let y=h.attrs;if(m>0&&(y=ap(y,0,m)),g>0&&(y=ap(y,y.colspan-g,g)),f.left<i.left){if(h=h.type.createAndFill(y),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else h=h.type.create(y,h.content)}if(f.top<i.top||f.bottom>i.bottom){const y={...h.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?h=h.type.createAndFill(y):h=h.type.create(y,h.content)}c.push(h)}s.push(t.child(l).copy(Se.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?t:s;return new We(Se.from(a),1,1)}replace(t,n=We.empty){const r=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:a,$to:l}=i[s],c=t.mapping.slice(r);t.replace(c.map(a.pos),c.map(l.pos),s?We.empty:n)}const o=mt.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);o&&t.setSelection(o)}replaceWith(t,n){this.replace(t,new We(Se.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),r=rr.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)t(n.nodeAt(o[s]),i+o[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const r=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),i=rr.get(r),o=t.start(-1),s=i.findCell(t.pos-o),a=i.findCell(n.pos-o),l=t.node(0);return s.top<=a.top?(s.top>0&&(t=l.resolve(o+i.map[s.left])),a.bottom<i.height&&(n=l.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(o+i.map[a.left])),s.bottom<i.height&&(t=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new Bl(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=rr.get(t),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(t){return t instanceof Bl&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),i=rr.get(r),o=t.start(-1),s=i.findCell(t.pos-o),a=i.findCell(n.pos-o),l=t.node(0);return s.left<=a.left?(s.left>0&&(t=l.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(n=l.resolve(o+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(t=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new Bl(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new Bl(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new Bl(t.resolve(n),t.resolve(r))}getBookmark(){return new Vat(this.$anchorCell.pos,this.$headCell.pos)}};An.prototype.visible=!1,mt.jsonID("cell",An);var Vat=class Tie{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Tie(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),r=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&wA(n,r)?new An(n,r):mt.near(r,1)}};function Bat(e){if(!(e.selection instanceof An))return null;const t=[];return e.selection.forEachCell((n,r)=>{t.push(Xr.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Un.create(e.doc,t)}function zat({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let o=t.depth;o>=0&&!(t.before(o+1)>t.start(o));o--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Uat({$from:e,$to:t}){let n,r;for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&t.parentOffset===0}function jat(e,t,n){const r=(t||e).selection,i=(t||e).doc;let o,s;if(r instanceof at&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=An.create(i,r.from);else if(s=="row"){const a=i.resolve(r.from+1);o=An.rowSelection(a,a)}else if(!n){const a=rr.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];o=An.create(i,l+1,c)}}else r instanceof dt&&zat(r)?o=dt.create(i,r.from):r instanceof dt&&Uat(r)&&(o=dt.create(i,r.$from.start(),r.$from.end()));return o&&(t||(t=e.tr)).setSelection(o),t}var Hat=new Zn("fix-tables");function ite(e,t,n,r){const i=e.childCount,o=t.childCount;e:for(let s=0,a=0;s<o;s++){const l=t.child(s);for(let c=a,d=Math.min(i,s+3);c<d;c++)if(e.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<i&&e.child(a).sameMarkup(l)?ite(e.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function ote(e,t){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=qat(e,i,o,n))};return t?t.doc!=e.doc&&ite(t.doc,e.doc,0,r):e.doc.descendants(r),n}function qat(e,t,n,r){const i=rr.get(t);if(!i.problems)return r;r||(r=e.tr);const o=[];for(let l=0;l<i.height;l++)o.push(0);for(let l=0;l<i.problems.length;l++){const c=i.problems[l];if(c.type=="collision"){const d=t.nodeAt(c.pos);if(!d)continue;const u=d.attrs;for(let p=0;p<u.rowspan;p++)o[c.row+p]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,ap(u,u.colspan-c.n,c.n))}else if(c.type=="missing")o[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const d=t.nodeAt(c.pos);if(!d)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const d=t.nodeAt(c.pos);if(!d)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...d.attrs,colwidth:c.colwidth})}}let s,a;for(let l=0;l<o.length;l++)o[l]&&(s==null&&(s=l),a=l);for(let l=0,c=n+1;l<i.height;l++){const d=t.child(l),u=c+d.nodeSize,p=o[l];if(p>0){let f="cell";d.firstChild&&(f=d.firstChild.type.spec.tableRole);const h=[];for(let g=0;g<p;g++){const y=bi(e.schema)[f].createAndFill();y&&h.push(y)}const m=(l==0||s==l-1)&&a==l?c+1:u-1;r.insert(r.mapping.map(m),h)}c=u}return r.setMeta(Hat,{fixTables:!0})}function Oa(e){const t=e.selection,n=f5(e),r=n.node(-1),i=n.start(-1),o=rr.get(r);return{...t instanceof An?o.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function ste(e,{map:t,tableStart:n,table:r},i){let o=i>0?-1:0;Fat(t,r,i+o)&&(o=i==0||i==t.width?null:0);for(let s=0;s<t.height;s++){const a=s*t.width+i;if(i>0&&i<t.width&&t.map[a-1]==t.map[a]){const l=t.map[a],c=r.nodeAt(l);e.setNodeMarkup(e.mapping.map(n+l),null,rte(c.attrs,i-t.colCount(l))),s+=c.attrs.rowspan-1}else{const l=o==null?bi(r.type.schema).cell:r.nodeAt(t.map[a+o]).type,c=t.positionAt(s,i,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function Wat(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e);t(ste(e.tr,n,n.left))}return!0}function Gat(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e);t(ste(e.tr,n,n.right))}return!0}function Kat(e,{map:t,table:n,tableStart:r},i){const o=e.mapping.maps.length;for(let s=0;s<t.height;){const a=s*t.width+i,l=t.map[a],c=n.nodeAt(l),d=c.attrs;if(i>0&&t.map[a-1]==l||i<t.width-1&&t.map[a+1]==l)e.setNodeMarkup(e.mapping.slice(o).map(r+l),null,ap(d,i-t.colCount(l)));else{const u=e.mapping.slice(o).map(r+l);e.delete(u,u+c.nodeSize)}s+=d.rowspan}}function Yat(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;Kat(r,n,i),i!=n.left;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=rr.get(o)}t(r)}return!0}function Jat(e,t,n){var r;const i=bi(t.type.schema).header_cell;for(let o=0;o<e.width;o++)if(((r=t.nodeAt(e.map[o+n*e.width]))==null?void 0:r.type)!=i)return!1;return!0}function ate(e,{map:t,tableStart:n,table:r},i){var o;let s=n;for(let c=0;c<i;c++)s+=r.child(c).nodeSize;const a=[];let l=i>0?-1:0;Jat(t,r,i+l)&&(l=i==0||i==t.height?null:0);for(let c=0,d=t.width*i;c<t.width;c++,d++)if(i>0&&i<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],p=r.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...p,rowspan:p.rowspan+1}),c+=p.colspan-1}else{const u=l==null?bi(r.type.schema).cell:(o=r.nodeAt(t.map[d+l*t.width]))==null?void 0:o.type,p=u==null?void 0:u.createAndFill();p&&a.push(p)}return e.insert(s,bi(r.type.schema).row.create(null,a)),e}function Zat(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e);t(ate(e.tr,n,n.top))}return!0}function Xat(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e);t(ate(e.tr,n,n.bottom))}return!0}function Qat(e,{map:t,table:n,tableStart:r},i){let o=0;for(let c=0;c<i;c++)o+=n.child(c).nodeSize;const s=o+n.child(i).nodeSize,a=e.mapping.maps.length;e.delete(o+r,s+r);const l=new Set;for(let c=0,d=i*t.width;c<t.width;c++,d++){const u=t.map[d];if(!l.has(u)){if(l.add(u),i>0&&u==t.map[d-t.width]){const p=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(a).map(u+r),null,{...p,rowspan:p.rowspan-1}),c+=p.colspan-1}else if(i<t.height&&u==t.map[d+t.width]){const p=n.nodeAt(u),f=p.attrs,h=p.type.create({...f,rowspan:p.attrs.rowspan-1},p.content),m=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(a).map(r+m),h),c+=f.colspan-1}}}}function elt(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;Qat(r,n,i),i!=n.top;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=rr.get(n.table)}t(r)}return!0}function lte(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function tlt({width:e,height:t,map:n},r){let i=r.top*e+r.left,o=i,s=(r.bottom-1)*e+r.left,a=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[o]==n[o-1]||r.right<e&&n[a]==n[a+1])return!0;o+=e,a+=e}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[s]==n[s+e])return!0;i++,s++}return!1}function cte(e,t){const n=e.selection;if(!(n instanceof An)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Oa(e),{map:i}=r;if(tlt(i,r))return!1;if(t){const o=e.tr,s={};let a=Se.empty,l,c;for(let d=r.top;d<r.bottom;d++)for(let u=r.left;u<r.right;u++){const p=i.map[d*i.width+u],f=r.table.nodeAt(p);if(!(s[p]||!f))if(s[p]=!0,l==null)l=p,c=f;else{lte(f)||(a=a.append(f.content));const h=o.mapping.map(p+r.tableStart);o.delete(h,h+f.nodeSize)}}if(l==null||c==null)return!0;if(o.setNodeMarkup(l+r.tableStart,null,{...rte(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const d=l+1+c.content.size,u=lte(c)?l+1:d;o.replaceWith(u+r.tableStart,d+r.tableStart,a)}o.setSelection(new An(o.doc.resolve(l+r.tableStart))),t(o)}return!0}function dte(e,t){const n=bi(e.schema);return nlt(({node:r})=>n[r.type.spec.tableRole])(e,t)}function nlt(e){return(t,n)=>{var r;const i=t.selection;let o,s;if(i instanceof An){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=Rat(i.$from),!o)return!1;s=(r=$f(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let a=o.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const d=Oa(t),u=t.tr;for(let f=0;f<d.right-d.left;f++)l.push(c?{...a,colwidth:c&&c[f]?[c[f]]:null}:a);let p;for(let f=d.top;f<d.bottom;f++){let h=d.map.positionAt(f,d.left,d.table);f==d.top&&(h+=o.nodeSize);for(let m=d.left,g=0;m<d.right;m++,g++)m==d.left&&f==d.top||u.insert(p=u.mapping.map(h+d.tableStart,1),e({node:o,row:f,col:m}).createAndFill(l[g]))}u.setNodeMarkup(s,e({node:o,row:d.top,col:d.left}),l[0]),i instanceof An&&u.setSelection(new An(u.doc.resolve(i.$anchorCell.pos),p?u.doc.resolve(p):void 0)),n(u)}return!0}}function rlt(e,t){return function(n,r){if(!Ns(n))return!1;const i=f5(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){const o=n.tr;n.selection instanceof An?n.selection.forEachCell((s,a)=>{s.attrs[e]!==t&&o.setNodeMarkup(a,null,{...s.attrs,[e]:t})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(o)}return!0}}function ilt(e){return function(t,n){if(!Ns(t))return!1;if(n){const r=bi(t.schema),i=Oa(t),o=t.tr,s=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[l],r.cell,a[l].attrs);if(o.steps.length==0)for(let l=0;l<s.length;l++)o.setNodeMarkup(i.tableStart+s[l],r.header_cell,a[l].attrs);n(o)}return!0}}function ute(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<r.length;i++){const o=t.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function Qg(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?ilt(e):function(n,r){if(!Ns(n))return!1;if(r){const i=bi(n.schema),o=Oa(n),s=n.tr,a=ute("row",o,i),l=ute("column",o,i),d=(e==="column"?a:e==="row"?l:!1)?1:0,u=e=="column"?{left:0,top:d,right:1,bottom:o.map.height}:e=="row"?{left:d,top:0,right:o.map.width,bottom:1}:o,p=e=="column"?l?i.cell:i.header_cell:e=="row"?a?i.cell:i.header_cell:i.cell;o.map.cellsInRect(u).forEach(f=>{const h=f+o.tableStart,m=s.doc.nodeAt(h);m&&s.setNodeMarkup(h,p,m.attrs)}),r(s)}return!0}}Qg("row",{useDeprecatedLogic:!0}),Qg("column",{useDeprecatedLogic:!0});var olt=Qg("cell",{useDeprecatedLogic:!0});function slt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let r=e.index(-1)-1,i=e.before();r>=0;r--){const o=e.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let r=e.indexAfter(-1),i=e.after();r<n.childCount;r++){const o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function pte(e){return function(t,n){if(!Ns(t))return!1;const r=slt(f5(t),e);if(r==null)return!1;if(n){const i=t.doc.resolve(r);n(t.tr.setSelection(dt.between(i,Nat(i))).scrollIntoView())}return!0}}function alt(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function m5(e,t){const n=e.selection;if(!(n instanceof An))return!1;if(t){const r=e.tr,i=bi(e.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new We(i,0,0))}),r.docChanged&&t(r)}return!0}function llt(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole=="table");)n--,r--,t=t.child(0).content;const i=t.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l<t.childCount;l++){let c=t.child(l).content;const d=l?0:Math.max(0,n-1),u=l<t.childCount-1?0:Math.max(0,r-1);(d||u)&&(c=kA(bi(s).row,new We(c,d,u)).content),a.push(c)}else if(o=="cell"||o=="header_cell")a.push(n||r?kA(bi(s).row,new We(t,n,r)).content:t);else return null;return clt(s,a)}function clt(e,t){const n=[];for(let i=0;i<t.length;i++){const o=t[i];for(let s=o.childCount-1;s>=0;s--){const{rowspan:a,colspan:l}=o.child(s).attrs;for(let c=i;c<i+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(Se.empty),n[i]<r){const o=bi(e).cell.createAndFill(),s=[];for(let a=n[i];a<r;a++)s.push(o);t[i]=t[i].append(Se.from(s))}return{height:t.length,width:r,rows:t}}function kA(e,t){const n=e.createAndFill();return new QE(n).replace(0,n.content.size,t).doc}function dlt({width:e,height:t,rows:n},r,i){if(e!=r){const o=[],s=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let d=o[a]||0,u=0;d<r;u++){let p=l.child(u%l.childCount);d+p.attrs.colspan>r&&(p=p.type.createChecked(ap(p.attrs,p.attrs.colspan,d+p.attrs.colspan-r),p.content)),c.push(p),d+=p.attrs.colspan;for(let f=1;f<p.attrs.rowspan;f++)o[a+f]=(o[a+f]||0)+p.attrs.colspan}s.push(Se.from(c))}n=s,e=r}if(t!=i){const o=[];for(let s=0,a=0;s<i;s++,a++){const l=[],c=n[a%t];for(let d=0;d<c.childCount;d++){let u=c.child(d);s+u.attrs.rowspan>i&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,i-u.attrs.rowspan)},u.content)),l.push(u)}o.push(Se.from(l))}n=o,t=i}return{width:e,height:t,rows:n}}function ult(e,t,n,r,i,o,s){const a=e.doc.type.schema,l=bi(a);let c,d;if(i>t.width)for(let u=0,p=0;u<t.height;u++){const f=n.child(u);p+=f.nodeSize;const h=[];let m;f.lastChild==null||f.lastChild.type==l.cell?m=c||(c=l.cell.createAndFill()):m=d||(d=l.header_cell.createAndFill());for(let g=t.width;g<i;g++)h.push(m);e.insert(e.mapping.slice(s).map(p-1+r),h)}if(o>t.height){const u=[];for(let h=0,m=(t.height-1)*t.width;h<Math.max(t.width,i);h++){const g=h>=t.width?!1:n.nodeAt(t.map[m+h]).type==l.header_cell;u.push(g?d||(d=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const p=l.row.create(null,Se.from(u)),f=[];for(let h=t.height;h<o;h++)f.push(p);e.insert(e.mapping.slice(s).map(r+n.nodeSize-2),f)}return!!(c||d)}function hte(e,t,n,r,i,o,s,a){if(s==0||s==t.height)return!1;let l=!1;for(let c=i;c<o;c++){const d=s*t.width+c,u=t.map[d];if(t.map[d-t.width]==u){l=!0;const p=n.nodeAt(u),{top:f,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(a).map(u+r),null,{...p.attrs,rowspan:s-f}),e.insert(e.mapping.slice(a).map(t.positionAt(s,h,n)),p.type.createAndFill({...p.attrs,rowspan:f+p.attrs.rowspan-s})),c+=p.attrs.colspan-1}}return l}function fte(e,t,n,r,i,o,s,a){if(s==0||s==t.width)return!1;let l=!1;for(let c=i;c<o;c++){const d=c*t.width+s,u=t.map[d];if(t.map[d-1]==u){l=!0;const p=n.nodeAt(u),f=t.colCount(u),h=e.mapping.slice(a).map(u+r);e.setNodeMarkup(h,null,ap(p.attrs,s-f,p.attrs.colspan-(s-f))),e.insert(h+p.nodeSize,p.type.createAndFill(ap(p.attrs,0,s-f))),c+=p.attrs.rowspan-1}}return l}function mte(e,t,n,r,i){let o=n?e.doc.nodeAt(n-1):e.doc;if(!o)throw new Error("No table found");let s=rr.get(o);const{top:a,left:l}=r,c=l+i.width,d=a+i.height,u=e.tr;let p=0;function f(){if(o=n?u.doc.nodeAt(n-1):u.doc,!o)throw new Error("No table found");s=rr.get(o),p=u.mapping.maps.length}ult(u,s,o,n,c,d,p)&&f(),hte(u,s,o,n,l,c,a,p)&&f(),hte(u,s,o,n,l,c,d,p)&&f(),fte(u,s,o,n,a,d,l,p)&&f(),fte(u,s,o,n,a,d,c,p)&&f();for(let h=a;h<d;h++){const m=s.positionAt(h,l,o),g=s.positionAt(h,c,o);u.replace(u.mapping.slice(p).map(m+n),u.mapping.slice(p).map(g+n),new We(i.rows[h-a],0,0))}f(),u.setSelection(new An(u.doc.resolve(n+s.positionAt(a,l,o)),u.doc.resolve(n+s.positionAt(d-1,c-1,o)))),t(u)}var plt=M9({ArrowLeft:y5("horiz",-1),ArrowRight:y5("horiz",1),ArrowUp:y5("vert",-1),ArrowDown:y5("vert",1),"Shift-ArrowLeft":v5("horiz",-1),"Shift-ArrowRight":v5("horiz",1),"Shift-ArrowUp":v5("vert",-1),"Shift-ArrowDown":v5("vert",1),Backspace:m5,"Mod-Backspace":m5,Delete:m5,"Mod-Delete":m5});function g5(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function y5(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof An)return g5(n,r,mt.near(o.$headCell,t));if(e!="horiz"&&!o.empty)return!1;const s=gte(i,e,t);if(s==null)return!1;if(e=="horiz")return g5(n,r,mt.near(n.doc.resolve(o.head+t),t));{const a=n.doc.resolve(s),l=nte(a,e,t);let c;return l?c=mt.near(l,1):t<0?c=mt.near(n.doc.resolve(a.before(-1)),-1):c=mt.near(n.doc.resolve(a.after(-1)),1),g5(n,r,c)}}}function v5(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof An)s=o;else{const l=gte(i,e,t);if(l==null)return!1;s=new An(n.doc.resolve(l))}const a=nte(s.$headCell,e,t);return a?g5(n,r,new An(s.$anchorCell,a)):!1}}function hlt(e,t){const n=e.state.doc,r=$f(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new An(r))),!0):!1}function flt(e,t,n){if(!Ns(e.state))return!1;let r=llt(n);const i=e.state.selection;if(i instanceof An){r||(r={width:1,height:1,rows:[Se.from(kA(bi(e.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=rr.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=dlt(r,a.right-a.left,a.bottom-a.top),mte(e.state,e.dispatch,s,a,r),!0}else if(r){const o=f5(e.state),s=o.start(-1);return mte(e.state,e.dispatch,s,rr.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function mlt(e,t){var n;if(t.ctrlKey||t.metaKey)return;const r=yte(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof An)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&(i=$f(e.state.selection.$anchor))!=null&&((n=_A(e,t))==null?void 0:n.pos)!=i.pos)o(i,t),t.preventDefault();else if(!r)return;function o(l,c){let d=_A(e,c);const u=kd.getState(e.state)==null;if(!d||!wA(l,d))if(u)d=l;else return;const p=new An(l,d);if(u||!e.state.selection.eq(p)){const f=e.state.tr.setSelection(p);u&&f.setMeta(kd,l.pos),e.dispatch(f)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",a),kd.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(kd,-1))}function a(l){const c=l,d=kd.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(yte(e,c.target)!=r&&(u=_A(e,t),!u))return s();u&&o(u,c)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",a)}function gte(e,t,n){if(!(e.state.selection instanceof dt))return null;const{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const a=r.before(i),l=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?a:null}}return null}function yte(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function _A(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?$f(e.state.doc.resolve(n.pos)):null}var glt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),xA(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,xA(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function xA(e,t,n,r,i,o){var s;let a=0,l=!0,c=t.firstChild;const d=e.firstChild;if(d){for(let u=0,p=0;u<d.childCount;u++){const{colspan:f,colwidth:h}=d.child(u).attrs;for(let m=0;m<f;m++,p++){const g=i==p?o:h&&h[m],y=g?g+"px":"";if(a+=g||r,g||(l=!1),c)c.style.width!=y&&(c.style.width=y),c=c.nextSibling;else{const w=document.createElement("col");w.style.width=y,t.appendChild(w)}}}for(;c;){const u=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=u}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var To=new Zn("tableColumnResizing");function ylt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=glt,lastColumnResizable:i=!0}={}){const o=new In({key:To,state:{init(s,a){var l,c;const d=(c=(l=o.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,u=bi(a.schema).table.name;return r&&d&&(d[u]=(p,f)=>new r(p,n,f)),new vlt(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=To.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{blt(s,a,e,i)},mouseleave:s=>{wlt(s)},mousedown:(s,a)=>{klt(s,a,t,n)}},decorations:s=>{const a=To.getState(s);if(a&&a.activeHandle>-1)return Slt(s,a.activeHandle)},nodeViews:{}}});return o}var vlt=class C4{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,r=t.getMeta(To);if(r&&r.setHandle!=null)return new C4(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new C4(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return bA(t.doc.resolve(i))||(i=-1),new C4(i,n.dragging)}return n}};function blt(e,t,n,r){const i=To.getState(e.state);if(i&&!i.dragging){const o=xlt(t.target);let s=-1;if(o){const{left:a,right:l}=o.getBoundingClientRect();t.clientX-a<=n?s=vte(e,t,"left",n):l-t.clientX<=n&&(s=vte(e,t,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){const a=e.state.doc.resolve(s),l=a.node(-1),c=rr.get(l),d=a.start(-1);if(c.colCount(a.pos-d)+a.nodeAfter.attrs.colspan-1==c.width-1)return}wte(e,s)}}}function wlt(e){const t=To.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&wte(e,-1)}function klt(e,t,n,r){var i;const o=(i=e.dom.ownerDocument.defaultView)!=null?i:window,s=To.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=e.state.doc.nodeAt(s.activeHandle),l=_lt(e,s.activeHandle,a.attrs);e.dispatch(e.state.tr.setMeta(To,{setDragging:{startX:t.clientX,startWidth:l}}));function c(u){o.removeEventListener("mouseup",c),o.removeEventListener("mousemove",d);const p=To.getState(e.state);p!=null&&p.dragging&&(Clt(e,p.activeHandle,bte(p.dragging,u,n)),e.dispatch(e.state.tr.setMeta(To,{setDragging:null})))}function d(u){if(!u.which)return c(u);const p=To.getState(e.state);if(p&&p.dragging){const f=bte(p.dragging,u,n);kte(e,p.activeHandle,f,r)}}return kte(e,s.activeHandle,l,r),o.addEventListener("mouseup",c),o.addEventListener("mousemove",d),t.preventDefault(),!0}function _lt(e,t,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=e.domAtPos(t);let a=o.node.childNodes[o.offset].offsetWidth,l=n;if(r)for(let c=0;c<n;c++)r[c]&&(a-=r[c],l--);return a/l}function xlt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function vte(e,t,n,r){const i=n=="right"?-r:r,o=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!o)return-1;const{pos:s}=o,a=$f(e.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;const l=rr.get(a.node(-1)),c=a.start(-1),d=l.map.indexOf(a.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function bte(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function wte(e,t){e.dispatch(e.state.tr.setMeta(To,{setHandle:t}))}function Clt(e,t,n){const r=e.state.doc.resolve(t),i=r.node(-1),o=rr.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let c=0;c<o.height;c++){const d=c*o.width+a;if(c&&o.map[d]==o.map[d-o.width])continue;const u=o.map[d],p=i.nodeAt(u).attrs,f=p.colspan==1?0:a-o.colCount(u);if(p.colwidth&&p.colwidth[f]==n)continue;const h=p.colwidth?p.colwidth.slice():Tlt(p.colspan);h[f]=n,l.setNodeMarkup(s+u,null,{...p,colwidth:h})}l.docChanged&&e.dispatch(l)}function kte(e,t,n,r){const i=e.state.doc.resolve(t),o=i.node(-1),s=i.start(-1),a=rr.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;let l=e.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&xA(o,l.firstChild,l,r,a,n)}function Tlt(e){return Array(e).fill(0)}function Slt(e,t){var n;const r=[],i=e.doc.resolve(t),o=i.node(-1);if(!o)return Un.empty;const s=rr.get(o),a=i.start(-1),l=s.colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const d=l+c*s.width;if((l==s.width-1||s.map[d]!=s.map[d+1])&&(c==0||s.map[d]!=s.map[d-s.width])){const u=s.map[d],p=a+u+o.nodeAt(u).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",(n=To.getState(e))!=null&&n.dragging&&r.push(Xr.node(a+u,a+u+o.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),r.push(Xr.widget(p,f))}}return Un.create(e.doc,r)}function Elt({allowTableNodeSelection:e=!1}={}){return new In({key:kd,state:{init(){return null},apply(t,n){const r=t.getMeta(kd);if(r!=null)return r==-1?null:r;if(n==null||!t.docChanged)return n;const{deleted:i,pos:o}=t.mapping.mapResult(n);return i?null:o}},props:{decorations:Bat,handleDOMEvents:{mousedown:mlt},createSelectionBetween(t){return kd.getState(t.state)!=null?t.state.selection:null},handleTripleClick:hlt,handleKeyDown:plt,handlePaste:flt},appendTransaction(t,n,r){return jat(r,ote(r,n),e)}})}function CA(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function _te(e,t,n,r,i,o){var s;let a=0,l=!0,c=t.firstChild;const d=e.firstChild;if(d!==null)for(let u=0,p=0;u<d.childCount;u+=1){const{colspan:f,colwidth:h}=d.child(u).attrs;for(let m=0;m<f;m+=1,p+=1){const g=i===p?o:h&&h[m],y=g?`${g}px`:"";if(a+=g||r,g||(l=!1),c){if(c.style.width!==y){const[w,k]=CA(r,g);c.style.setProperty(w,k)}c=c.nextSibling}else{const w=document.createElement("col"),[k,_]=CA(r,g);w.style.setProperty(k,_),t.appendChild(w)}}}for(;c;){const u=c.nextSibling;(s=c.parentNode)===null||s===void 0||s.removeChild(c),c=u}l?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}let Alt=class{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),_te(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,_te(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}};function Mlt(e,t,n,r){let i=0,o=!0;const s=[],a=e.firstChild;if(!a)return{};for(let u=0,p=0;u<a.childCount;u+=1){const{colspan:f,colwidth:h}=a.child(u).attrs;for(let m=0;m<f;m+=1,p+=1){const g=n===p?r:h&&h[m];i+=g||t,g||(o=!1);const[y,w]=CA(t,g);s.push(["col",{style:`${y}: ${w}`}])}}const l=o?`${i}px`:"",c=o?"":`${i}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function xte(e,t){return e.createAndFill()}function Olt(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function Dlt(e,t,n,r,i){const o=Olt(e),s=[],a=[];for(let c=0;c<n;c+=1){const d=xte(o.cell);if(d&&a.push(d),r){const u=xte(o.header_cell);u&&s.push(u)}}const l=[];for(let c=0;c<t;c+=1)l.push(o.row.createChecked(null,r&&c===0?s:a));return o.table.createChecked(null,l)}function Plt(e){return e instanceof An}const b5=({editor:e})=>{const{selection:t}=e.state;if(!Plt(t))return!1;let n=0;const r=gee(t.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},Ilt=ei.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Alt,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=Mlt(e,this.options.cellMinWidth);return["table",_n(this.options.HTMLAttributes,t,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{const s=Dlt(o.schema,e,t,n);if(i){const a=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(dt.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Wat(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Gat(e,t),deleteColumn:()=>({state:e,dispatch:t})=>Yat(e,t),addRowBefore:()=>({state:e,dispatch:t})=>Zat(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Xat(e,t),deleteRow:()=>({state:e,dispatch:t})=>elt(e,t),deleteTable:()=>({state:e,dispatch:t})=>alt(e,t),mergeCells:()=>({state:e,dispatch:t})=>cte(e,t),splitCell:()=>({state:e,dispatch:t})=>dte(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Qg("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Qg("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>olt(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>cte(e,t)?!0:dte(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>rlt(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>pte(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>pte(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&ote(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const r=An.create(t.doc,e.anchorCell,e.headCell);t.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:b5,"Mod-Backspace":b5,Delete:b5,"Mod-Delete":b5}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[ylt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Elt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Nt(nt(e,"tableRole",t))}}});function TA(e,t,n,r,i,o){let s=0,a=!0,l=t.firstChild;const c=e.firstChild;for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:p,colwidth:f}=c.child(d).attrs;for(let h=0;h<p;h+=1,u+=1){const m=i===u?o:f&&f[h],g=m?`${m}px`:"";s+=m||r,m||(a=!1),l?(l.style.width!==g&&(l.style.width=g),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=g}}for(;l;){const d=l.nextSibling;l.parentNode.removeChild(l),l=d}a?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`),n.style.setProperty("--borderWidth",e.attrs.borderWidth),n.style.setProperty("--borderColor",e.attrs.borderColor),n.style.setProperty("--cellPadding",e.attrs.cellPadding),n.style.setProperty("--headerBackground",e.attrs.headerBackground)}class w5{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",Object.keys(this.node.attrs).forEach(r=>{this.dom.dataset[r]=this.node.attrs[r]}),this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),TA(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,TA(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}}const SA=Ilt.extend({addAttributes(){return{...this.parent?this.parent():null,borderColor:{default:"#dedee3",parseHTML:e=>e.getAttribute("data-border-color"),renderHTML:e=>({"data-border-color":e.borderColor})},borderWidth:{default:"1px",parseHTML:e=>e.getAttribute("data-border-width"),renderHTML:e=>({"data-border-width":e.borderWidth})},cellPadding:{default:"5px",parseHTML:e=>e.getAttribute("data-cell-padding"),renderHTML:e=>({"data-cell-padding":e.cellPadding})},headerBackground:{default:"#eeeef1",parseHTML:e=>e.getAttribute("data-header-background"),renderHTML:e=>({"data-header-background":e.headerBackground})}}}}),Cte=SA.extend({addNodeView(){return({node:e})=>{const t=document.createElement("div");t.className="tableWrapper";const n=t.appendChild(document.createElement("table")),r=n.appendChild(document.createElement("colgroup"));TA(e,r,n);const i=n.appendChild(document.createElement("tbody"));return{dom:t,contentDOM:i}}},addProseMirrorPlugins(){return[]}}),$lt=SA.configure({resizable:!0,View:w5}),Rlt=Cte.configure({resizable:!0,View:w5});SA.configure({resizable:!0,View:w5}),Cte.configure({resizable:!0,View:w5});function Tte({types:e,node:t}){return Array.isArray(e)&&e.includes(t.type)||t.type===e}const Llt=_r.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:["paragraph","heading"]}},addProseMirrorPlugins(){const e=new Zn(this.name),t=Object.entries(this.editor.schema.nodes).map(([,n])=>n).filter(n=>this.options.notAfter.includes(n.name));return[new In({key:e,appendTransaction:(n,r,i)=>{const{doc:o,tr:s,schema:a}=i,l=e.getState(i),c=o.content.size,d=a.nodes[this.options.node];if(l)return s.insert(c,d.create())},state:{init:(n,r)=>{var o;const i=r.tr.doc.lastChild;return((o=this.editor)==null?void 0:o.isEditable)&&!Tte({node:i,types:t})},apply:(n,r)=>{if(!n.docChanged)return r;const i=n.doc.lastChild;return!Tte({node:i,types:t})}}})]}}),Ste=async e=>{const t=new FormData;t.append("file",e,e.name);const{data:n}=await nn("/file",t,{timeout:6e4}),{url:r,hash:i,algorithm:o}=n;return{url:r,hash:i,algorithm:o}},Nlt=Fee.extend({addAttributes(){return{...this.parent?this.parent():null,typography:{default:null,parseHTML:e=>e.getAttribute("data-typography"),renderHTML:e=>({"data-typography":e.typography})}}},addCommands(){return{setParagraph:(e={})=>({commands:t})=>t.setNode("paragraph",e)}}}),Flt={name:"TextEditor",i18nOptions:{namespaces:"TextEditor",messages:{en:{placeholder:"Type something"},sv:{placeholder:"Skriv något"}}},components:{EditorContent:Est,BubbleMenu:tat,EditorFixedMenu:aat},inject:{compressImages:{default:!1}},props:{modelValue:{type:String,default:""},triggerUpdate:{type:Boolean,default:!1},placeholder:{type:String,default:""},editable:{type:Boolean,default:!0},disabled:{type:Boolean,default:void 0},extensions:{type:[Object,String],default:()=>({})},mentions:{type:Function,default:null},snippets:{type:Boolean,default:!1},classList:{type:String,default:""},size:{type:String,default:null},unstyled:{type:Boolean,default:!1},textareaStyle:{type:Boolean,default:!1},filled:{type:Boolean,default:!1},static:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur"],data(){return{editor:null,isFocused:!1,isHover:!1,uidClass:`uid-${this.$.uid}`}},computed:{enabledExtensions(){const e={bulletList:!0,heading:[1,2,3],bold:!0,link:!0,underline:!0,textAlign:!0,color:!0,table:!0,image:!1,highlight:!1,blockquote:!1,...this.extensions,...typeof this.mentions=="function"&&{mentions:this.mentions},snippets:this.snippets};return this.extensions==="all"&&(e.image=!0,e.highlight=!0,e.blockquote=!0),e}},watch:{modelValue(e){!this.editor||this.editor.getHTML()===e||this.editor.commands.setContent(e,!1)},editable(e){this.setEditable(e)}},created(){window.initalizedEditorTooltips||(this.createGeneralTooltip(),window.initalizedEditorTooltips=!0)},mounted(){this.init(),this.$nextTick(()=>this.createTooltips())},beforeUnmount(){this.editor&&this.editor.destroy(),this.destroyDynamicTooltips()},methods:{init(){const{bulletList:e,blockquote:t,heading:n,image:r,mentions:i,bold:o,highlight:s,italic:a,link:l,underline:c,color:d,textAlign:u,table:p}=this.enabledExtensions,f=[bot.configure({emptyEditorClass:"is-empty",placeholder:this.placeholder||this.$t("placeholder"),showOnlyWhenEditable:!0}),xst.configure({blockquote:t,bulletList:e,...n&&{heading:{levels:n}},bold:o,italic:a,strike:!0,code:!0,codeBlock:!0,paragraph:!1}),Nlt,Llt];l&&f.push(vot),d&&f.push(Hit,qit),s&&f.push(Kit),c&&f.push(Cot),u&&f.push(xot.configure({types:["paragraph","heading","list_item","todo_item","title"],defaultAlignment:""})),p&&f.push(this.editable?$lt:Rlt,_ot,wot,kot),r&&f.push(Oat(Ste,this.compressImages)),i&&f.push(kat.call(this,i)),this.editor=new Sst({injectCSS:!1,editable:this.editable,content:this.modelValue||"",extensions:f,onFocus:({event:h})=>{this.isFocused=!0,this.$emit("focus",h)},onBlur:({editor:h,event:m})=>{this.isFocused=!1,this.$emit("update:modelValue",h.isEmpty?"":h.getHTML()),this.$emit("blur",m)},...this.triggerUpdate&&{onUpdate:({editor:h})=>{this.$emit("update:modelValue",h.isEmpty?"":h.getHTML())}}})},setContent(e){this.editor.commands.setContent((this.modelValue||"")+e,!0)},setEditable(e){if(typeof e!="boolean")throw Error("Invalid param editable");this.editor&&this.editor.setOptions({editable:e})},focus(){return this.setFocus()},setFocus(){this.editor&&this.editor.isEditable&&this.editor.commands.focus("end")},async onUploadImage({file:e}){const t=e.target.files[0],{url:n,hash:r,algorithm:i}=await Ste(t);this.editor&&this.editor.chain().focus().setImage({src:n,hash:r,algorithm:i}).run()},createTooltips(){var i;const{el:e,isShadow:t}=Ky((i=this.$root)==null?void 0:i.$el),n=t?e:e.body,r=t?this.$el:`.${this.uidClass}`;this.dynamicTooltips=jS(r,{target:"span[data-tooltip]",appendTo:n,content(o){return`
1754
+ `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&s){const u=l.filter(p=>a.includes(p.type.name));c.ensureMarks(u)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Qot=ei.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,_n(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>K9({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var p5=200,ti=function(){};ti.prototype.append=function(t){return t.length?(t=ti.from(t),!this.length&&t||t.length<p5&&this.leafAppend(t)||this.length<p5&&t.leafPrepend(this)||this.appendInner(t)):this},ti.prototype.prepend=function(t){return t.length?ti.from(t).append(this):this},ti.prototype.appendInner=function(t){return new est(this,t)},ti.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?ti.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))},ti.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},ti.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)},ti.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(t(o,s))},n,r),i},ti.from=function(t){return t instanceof ti?t:t&&t.length?new zee(t):ti.empty};var zee=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=p5)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=p5)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(ti);ti.empty=new zee([]);var est=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(ti),Uee=ti;const tst=500;class Ls{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,a,l,c=[],d=[];return this.items.forEach((u,p)=>{if(!u.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,d.push(u);return}if(i){d.push(new Ma(u.map));let f=u.step.map(i.slice(o)),h;f&&s.maybeStep(f).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new Ma(h,void 0,void 0,c.length+d.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(u.step);if(u.selection)return a=i?u.selection.map(i.slice(o)):u.selection,l=new Ls(this.items.slice(0,r).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let d=0;d<t.steps.length;d++){let u=t.steps[d].invert(t.docs[d]),p=new Ma(t.mapping.maps[d],u,n),f;(f=l&&l.merge(p))&&(p=f,d?o.pop():a=a.slice(0,a.length-1)),o.push(p),n&&(s++,n=void 0),i||(l=p)}let c=s-r.depth;return c>rst&&(a=nst(a,c),s-=c),new Ls(a.append(o),s)}remapping(t,n){let r=new yf;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new Ls(this.items.append(t.map(n=>new Ma(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(p=>{p.selection&&a--},i);let l=n;this.items.forEach(p=>{let f=o.getMirror(--l);if(f==null)return;s=Math.min(s,f);let h=o.maps[f];if(p.step){let m=t.steps[f].invert(t.docs[f]),g=p.selection&&p.selection.map(o.slice(l+1,f));g&&a++,r.push(new Ma(h,m,g))}else r.push(new Ma(h))},i);let c=[];for(let p=n;p<s;p++)c.push(new Ma(o.maps[p]));let d=this.items.slice(0,i).append(c).append(r),u=new Ls(d,a);return u.emptyItemCount()>tst&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=t)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let d=s.selection&&s.selection.map(n.slice(r));d&&o++;let u=new Ma(c.invert(),l,d),p,f=i.length-1;(p=i.length&&i[f].merge(u))?i[f]=p:i.push(u)}}else s.map&&r--},this.items.length,0),new Ls(Uee.from(i.reverse()),o)}}Ls.empty=new Ls(Uee.empty,0);function nst(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class Ma{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Ma(n.getMap().invert(),n,this.selection)}}}class wd{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const rst=20;function ist(e,t,n,r){let i=n.getMeta(sp),o;if(i)return i.historyState;n.getMeta(ast)&&(e=new wd(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(sp))return s.getMeta(sp).redo?new wd(e.done.addTransform(n,void 0,r,h5(t)),e.undone,jee(n.mapping.maps),e.prevTime,e.prevComposition):new wd(e.done,e.undone.addTransform(n,void 0,r,h5(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!ost(n,e.prevRanges)),c=s?fA(e.prevRanges,n.mapping):jee(n.mapping.maps);return new wd(e.done.addTransform(n,l?t.selection.getBookmark():void 0,r,h5(t)),Ls.empty,c,n.time,a??e.prevComposition)}else return(o=n.getMeta("rebased"))?new wd(e.done.rebased(n,o),e.undone.rebased(n,o),fA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new wd(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),fA(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function ost(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function jee(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,s)=>t.push(o,s));return t}function fA(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function sst(e,t,n){let r=h5(t),i=sp.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),l=new wd(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(sp,{redo:n,historyState:l})}let mA=!1,Hee=null;function h5(e){let t=e.plugins;if(Hee!=t){mA=!1,Hee=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){mA=!0;break}}return mA}const sp=new Zn("history"),ast=new Zn("closeHistory");function lst(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new In({key:sp,state:{init(){return new wd(Ls.empty,Ls.empty,null,0,-1)},apply(t,n,r){return ist(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?Wee:r=="historyRedo"?Gee:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}function qee(e,t){return(n,r)=>{let i=sp.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=sst(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const Wee=qee(!1,!0),Gee=qee(!0,!0),cst=_r.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Wee(e,t),redo:()=>({state:e,dispatch:t})=>Gee(e,t)}},addProseMirrorPlugins(){return[lst(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),dst=ei.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",_n(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:n}=t,{$from:r,$to:i}=n,o=e();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):bee(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:c}=s.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(dt.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(at.create(s.doc,c.pos)):s.setSelection(dt.create(s.doc,c.pos));else{const u=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();u&&(s.insert(d,u),s.setSelection(dt.create(s.doc,d+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[kee({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),ust=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,pst=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,hst=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,fst=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,mst=Jo.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",_n(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ip({find:ust,type:this.type}),ip({find:hst,type:this.type})]},addPasteRules(){return[gd({find:pst,type:this.type}),gd({find:fst,type:this.type})]}}),gst=ei.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",_n(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),yst="listItem",Kee="textStyle",Yee=/^(\d+)\.\s$/,vst=ei.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",_n(this.options.HTMLAttributes,n),0]:["ol",_n(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(yst,this.editor.getAttributes(Kee)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Wg({find:Yee,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Wg({find:Yee,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(Kee)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),bst=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,wst=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,kst=Jo.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",_n(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ip({find:bst,type:this.type})]},addPasteRules(){return[gd({find:wst,type:this.type})]}}),_st=ei.create({name:"text",group:"inline"}),xst=_r.create({name:"starterKit",addExtensions(){var e,t,n,r,i,o,s,a,l,c,d,u,p,f,h,m,g,y;const w=[];return this.options.bold!==!1&&w.push(Dot.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.blockquote!==!1&&w.push(Sot.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bulletList!==!1&&w.push(Iot.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&w.push(Lot.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&w.push(Vot.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&w.push(Bot.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&w.push(jot.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&w.push(Zot.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&w.push(Xot.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&w.push(Qot.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&w.push(cst.configure((d=this.options)===null||d===void 0?void 0:d.history)),this.options.horizontalRule!==!1&&w.push(dst.configure((u=this.options)===null||u===void 0?void 0:u.horizontalRule)),this.options.italic!==!1&&w.push(mst.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&w.push(gst.configure((f=this.options)===null||f===void 0?void 0:f.listItem)),this.options.orderedList!==!1&&w.push(vst.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&w.push(Fee.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&w.push(kst.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&w.push(_st.configure((y=this.options)===null||y===void 0?void 0:y.text)),w}});class Cst{constructor({editor:t,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:d})=>{const{doc:u,selection:p}=l,{empty:f}=p,h=!u.textBetween(c,d).length&&B9(l.selection),m=this.element.contains(document.activeElement);return!(!(a.hasFocus()||m)||f||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),d=!(l!=null&&l.doc.eq(a.state.doc));!c&&!d||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,d,l)},this.updateDelay))},this.updateHandler=(a,l,c,d)=>{var u,p,f;const{state:h,composing:m}=a,{selection:g}=h;if(m||!l&&!c)return;this.createTooltip();const{ranges:w}=g,k=Math.min(...w.map(S=>S.$from.pos)),_=Math.max(...w.map(S=>S.$to.pos));if(!((u=this.shouldShow)===null||u===void 0?void 0:u.call(this,{editor:this.editor,element:this.element,view:a,state:h,oldState:d,from:k,to:_}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((f=this.tippyOptions)===null||f===void 0?void 0:f.getReferenceClientRect)||(()=>{if(bee(h.selection)){let S=a.nodeDOM(k);if(S){const O=S.dataset.nodeViewWrapper?S:S.querySelector("[data-node-view-wrapper]");if(O&&(S=O.firstChild),S)return S.getBoundingClientRect()}}return wit(a,k,_)})}),this.show()},this.editor=t,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:t}=this.editor.options,n=!!t.parentElement;this.tippy||!n||(this.tippy=Jc(t,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(t,n){const{state:r}=t,i=r.selection.from!==r.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(t,n);return}const o=!(n!=null&&n.selection.eq(t.state.selection)),s=!(n!=null&&n.doc.eq(t.state.doc));this.updateHandler(t,o,s,n)}show(){var t;(t=this.tippy)===null||t===void 0||t.show()}hide(){var t;(t=this.tippy)===null||t===void 0||t.hide()}destroy(){var t,n;!((t=this.tippy)===null||t===void 0)&&t.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Jee=e=>new In({key:typeof e.pluginKey=="string"?new Zn(e.pluginKey):e.pluginKey,view:t=>new Cst({view:t,...e})});_r.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Jee({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});const Tst=$e({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(e,{slots:t}){const n=Pe(null);return fr(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:a}=e;i.registerPlugin(Jee({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:a}))}),Po(()=>{const{pluginKey:r,editor:i}=e;i.unregisterPlugin(r)}),()=>{var r;return mn("div",{ref:n},(r=t.default)===null||r===void 0?void 0:r.call(t))}}});function Zee(e){return Sp((t,n)=>({get(){return t(),e},set(r){e=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class Sst extends Bit{constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=Zee(this.view.state),this.reactiveExtensionStorage=Zee(this.extensionStorage),this.on("beforeTransaction",({nextState:n})=>{this.reactiveState.value=n,this.reactiveExtensionStorage.value=this.extensionStorage}),Wl(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,n){const r=super.registerPlugin(t,n);return this.reactiveState&&(this.reactiveState.value=r),r}unregisterPlugin(t){const n=super.unregisterPlugin(t);return this.reactiveState&&n&&(this.reactiveState.value=n),n}}const Est=$e({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(e){const t=Pe(),n=wn();return lo(()=>{const r=e.editor;r&&r.options.element&&t.value&&cr(()=>{if(!t.value||!r.options.element.firstChild)return;const i=J(t.value);t.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,n&&(r.appContext={...n.appContext,provides:n.provides}),r.setOptions({element:i}),r.createNodeViews()})}),Po(()=>{const r=e.editor;r&&(r.contentComponent=null,r.appContext=null)}),{rootEl:t}},render(){return mn("div",{ref:e=>{this.rootEl=e}})}}),Ast=$e({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var e,t;return mn(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}});class Xee{constructor(t,{props:n={},editor:r}){this.editor=r,this.component=Wl(t),this.el=document.createElement("div"),this.props=Wn(n),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var t,n,r,i;return!((n=(t=this.renderedComponent.vNode)===null||t===void 0?void 0:t.component)===null||n===void 0)&&n.exposed?this.renderedComponent.vNode.component.exposed:(i=(r=this.renderedComponent.vNode)===null||r===void 0?void 0:r.component)===null||i===void 0?void 0:i.proxy}renderComponent(){let t=mn(this.component,this.props);return this.editor.appContext&&(t.appContext=this.editor.appContext),typeof document<"u"&&this.el&&jm(t,this.el),{vNode:t,destroy:()=>{this.el&&jm(null,this.el),this.el=null,t=null},el:this.el?this.el.firstElementChild:null}}updateProps(t={}){Object.entries(t).forEach(([n,r])=>{this.props[n]=r}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const Mst={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0}};class Ost extends Uit{mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode()},n=this.onDragStart.bind(this);this.decorationClasses=Pe(this.getDecorationClasses());const r=$e({extends:{...this.component},props:Object.keys(t),template:this.component.template,setup:i=>{var o,s;return zi("onDragStart",n),zi("decorationClasses",this.decorationClasses),(s=(o=this.component).setup)===null||s===void 0?void 0:s.call(o,i,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new Xee(r,{editor:this.editor,props:t})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:t,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(t<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(t,n,r){const i=o=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(o)};if(typeof this.options.update=="function"){const o=this.node,s=this.decorations,a=this.innerDecorations;return this.node=t,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:o,oldDecorations:s,newNode:t,newDecorations:n,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>i({node:t,decorations:n,innerDecorations:r})})}return t.type!==this.node.type?!1:(t===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=t,this.decorations=n,this.innerDecorations=r,i({node:t,decorations:n,innerDecorations:r})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(t=>t.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function Dst(e,t){return n=>{if(!n.editor.contentComponent)return{};const r=typeof e=="function"&&"__vccOpts"in e?e.__vccOpts:e;return new Ost(r,n,t)}}const gA={__name:"ManualPopover",props:{distance:{type:Number,default:6}},setup(e){const t=Pe(!1),n=ss("popover"),r=ce(()=>{var d,u;return(u=(d=n.value)==null?void 0:d.$el)==null?void 0:u.firstElementChild});fr(()=>{var d;(d=r.value)==null||d.addEventListener("click",i)});const i=d=>{d.preventDefault(),t.value=!t.value,t.value?a():l()},o=()=>{t.value=!1,l()},s=d=>{var p,f,h,m;const u=(m=(h=(f=(p=n.value)==null?void 0:p.$refs)==null?void 0:f.popper)==null?void 0:h.popperNode)==null?void 0:m.call(h);u!=null&&u.contains(d.target)||(t.value=!1,l())},a=()=>{setTimeout(()=>{var d;(d=c())==null||d.addEventListener("click",s)},0)},l=()=>{c().removeEventListener("click",s)},c=()=>{var p,f,h;const d=(h=(p=n.value)==null?void 0:(f=p.$el).getRootNode)==null?void 0:h.call(f);return(d==null?void 0:d.toString())==="[object ShadowRoot]"?d:document};return Po(()=>{var d;l(),(d=r.value)==null||d.removeEventListener("click",i)}),(d,u)=>{const p=A("VDropdown");return v(),V(p,{shown:t.value,ref_key:"popover",ref:n,distance:e.distance,triggers:[],"auto-hide":!1},{popper:E(()=>[se(d.$slots,"popper",{hide:o})]),default:E(()=>[se(d.$slots,"default")]),_:3},8,["shown","distance"])}}},Pst={name:"TextEditorColorMenu",components:{ColorPicker:X7,ManualPopover:gA},emits:["update:show-picker"],props:{editor:{type:Object,required:!0},showPicker:{type:Boolean,required:!0}},data(){return{internalColor:"hsl(205, 90%, 45%)",isTouchDevice:xG}},computed:{currentColor(){return this.editor.getAttributes("textStyle").color}},methods:{openPicker(){this.$emit("update:show-picker",!0)},closePicker(){this.$emit("update:show-picker",!1)},setColor(e){const t=typeof e=="object"?bZ(e.hsl):e;this.internalColor=t;const n=t?"setColor":"unsetColor";this.editor.chain().focus()[n](t).run()}}},Ist=["data-texteditor-tooltip"],$st=["fill"],Rst={key:0},Lst=["onClick"];function Nst(e,t,n,r,i,o){const s=A("ColorPicker"),a=A("CIcon"),l=A("ManualPopover");return v(),V(l,{placement:n.showPicker?"right":i.isTouchDevice?"bottom":"top","popper-class":"color-menu-popover texteditor-tooltip-dropdown-inner is-color-menu",distance:-4,"dispose-timeout":0,onApplyHide:o.closePicker},{popper:E(()=>[b("div",{class:"flex bg-white text-[15px] text-white/70",onClick:t[4]||(t[4]=Ie(()=>{},["stop"]))},[n.showPicker?(v(),x("div",Rst,[T(s,{ref:"colorPicker","model-value":i.internalColor,class:"!p-0 !shadow-none","onUpdate:modelValue":t[0]||(t[0]=c=>o.setColor(c))},null,8,["model-value"])])):(v(),x(ee,{key:1},[(v(),x(ee,null,be(["auto","#0a5cff","#3022f1","#915cee","#f65a5a","#ff7b22","#fcc136","#4caf50","#5d5d5b","#111111"],(c,d)=>b("div",Be({key:d,class:[{"is-active":o.currentColor===c||!o.currentColor&&c==="auto"},"color-option-button"],style:{backgroundColor:c==="auto"?"hsl(0, 0%, 85%)":c},onMousedown:t[1]||(t[1]=Ie(()=>{},["prevent"])),onClick:Ie(u=>o.setColor(c==="auto"?"":c),["prevent","stop"]),ref_for:!0},{...c==="auto"?{"data-texteditor-tooltip":`Auto ${e.$t("_common:color")}`}:{}}),[c==="auto"?(v(),V(a,{key:0,type:"star",size:"14",fill:"hsl(0, 0%, 30%)",stroke:"hsl(0, 0%, 30%)"})):R("",!0)],16,Lst)),64)),b("div",{class:"color-option-button",onMousedown:t[2]||(t[2]=Ie(()=>{},["prevent"])),onClick:t[3]||(t[3]=Ie((...c)=>o.openPicker&&o.openPicker(...c),["prevent","stop"]))},t[6]||(t[6]=[b("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100"},[b("defs",null,[b("filter",{id:"blur","color-interpolation-filters":"linear",x:"-50%",y:"-50%",width:"200%",height:"200%"},[b("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"9"})]),b("mask",{id:"circle"},[b("circle",{cx:"50",cy:"50",r:"50",fill:"white"})])]),b("g",{mask:"url(#circle)",filter:"url(#blur)"},[b("rect",{x:"-10",width:"110",height:"110",fill:"blue"}),b("rect",{x:"50",width:"60",height:"110",fill:"yellow"}),b("polygon",{points:"50,50, 60,110, 40,110",fill:"#0f8"}),b("polygon",{points:"0,0, 100,0, 100,20, 50,50, 0,20",fill:"red"}),b("polygon",{points:"0,10, 50,50, 0,30",fill:"#f0f"}),b("polygon",{points:"100,10, 100,30, 50,50",fill:"#f80"})])],-1)]),32)],64))])]),default:E(()=>[b("button",{"data-texteditor-tooltip":e.$t("_common:color").capitalize(),class:"menu-button"},[(v(),x("svg",{fill:n.editor.getAttributes("textStyle").color,viewBox:"0 0 24 24",width:"20",height:"20",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},t[5]||(t[5]=[b("path",{d:"M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z"},null,-1)]),8,$st))],8,Ist)]),_:1},8,["placement","onApplyHide"])}const Fst=X(Pst,[["render",Nst],["__scopeId","data-v-63ce2d51"]]),Vst={name:"TextEditorFontStyleMenu",components:{ManualPopover:gA},i18nOptions:{namespaces:"TextEditorFontStyleMenu",messages:{en:{fontStyle:"Font style",title:"Title",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",blockquote:"Quote",paragraph:"Text"},sv:{fontStyle:"Typsnitt",title:"Titel",h1:"Rubrik 1",h2:"Rubrik 2",h3:"Rubrik 3",blockquote:"Citat",paragraph:"Text"}}},props:{editor:{type:Object,required:!0}}},Bst=["data-texteditor-tooltip"],zst=["onClick"],Ust=["onClick"];function jst(e,t,n,r,i,o){const s=A("ManualPopover");return v(),V(s,{"popper-class":"texteditor-tooltip-dropdown-inner",placement:"bottom-start"},{popper:E(({hide:a})=>[b("div",{class:"texteditor-tooltip-dropdown flex w-full flex-col text-left",onClick:a},[b("div",{class:ne([{"is-active":n.editor.isActive("paragraph",{typography:"title"})},"texteditor-tooltip-dropdown-item"]),onClick:t[0]||(t[0]=l=>n.editor.chain().focus().setParagraph({typography:"title"}).run())},C(e.$t("title")),3),(v(),x(ee,null,be([1,2,3],l=>b("div",{key:`h${l}`,class:ne([{"is-active":n.editor.isActive("heading",{level:l})},"texteditor-tooltip-dropdown-item"]),onClick:c=>n.editor.chain().focus().setHeading({level:l}).run()},C(e.$t(`h${l}`)),11,Ust)),64)),b("div",{class:ne([{"is-active":n.editor.isActive("paragraph",{typography:null})},"texteditor-tooltip-dropdown-item"]),onClick:t[1]||(t[1]=l=>n.editor.chain().focus().setParagraph({typography:null}).run())},C(e.$t("paragraph")),3),n.editor.commands.toggleBlockquote?(v(),x("div",{key:0,class:ne([{"is-active":n.editor.isActive("blockquote")},"texteditor-tooltip-dropdown-item"]),onClick:t[2]||(t[2]=l=>n.editor.chain().focus().toggleBlockquote().run())},C(e.$t("blockquote")),3)):R("",!0)],8,zst)]),default:E(()=>[b("button",{"data-texteditor-tooltip":e.$t("fontStyle"),class:"menu-button"},t[3]||(t[3]=[b("svg",{width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"1 4 46 44"},[b("path",{d:"M 35.005859 7 A 2.0002 2.0002 0 0 0 33.132812 8.28125 L 23.132812 34.28125 A 2.000748 2.000748 0 0 0 26.867188 35.71875 L 29.066406 30 L 40.933594 30 L 43.132812 35.71875 A 2.000748 2.000748 0 1 0 46.867188 34.28125 L 36.867188 8.28125 A 2.0002 2.0002 0 0 0 35.005859 7 z M 10.980469 13 A 2.0002 2.0002 0 0 0 9.1425781 14.257812 L 3.2519531 28.982422 A 2.0002 2.0002 0 0 0 3.0253906 29.550781 L 1.1425781 34.257812 A 2.0002148 2.0002148 0 1 0 4.8574219 35.742188 L 6.3535156 32 L 15.646484 32 L 17.142578 35.742188 A 2.0002149 2.0002149 0 1 0 20.857422 34.257812 L 18.982422 29.572266 A 2.0002 2.0002 0 0 0 18.980469 29.566406 A 2.0002 2.0002 0 0 0 18.744141 28.976562 L 12.857422 14.257812 A 2.0002 2.0002 0 0 0 10.980469 13 z M 35 14.574219 L 39.394531 26 L 30.605469 26 L 35 14.574219 z M 11 20.386719 L 14.044922 28 L 7.9550781 28 L 11 20.386719 z"})],-1)]),8,Bst)]),_:1})}const Hst={name:"TextEditorBubbleMenu",i18nOptions:{namespaces:"TextEditorBubbleMenu",messages:{en:{bold:"Bold",italic:"Italic",highlight:"Highlight",underline:"Underline"},sv:{bold:"Fetstil",italic:"Kursiv",highlight:"Markera",underline:"Understryk"}}},components:{BubbleMenu:Tst,FontStyleMenu:X(Vst,[["render",jst]]),ColorMenu:Fst},props:{editor:{type:Object,required:!0},extensions:{type:Object,default:()=>({})},isFocused:{type:Boolean,default:!1}},data(){return{linkUrl:null,linkMenuIsActive:!1,showColorPicker:!1,isTouchDevice:xG}},methods:{textAlignActive(e){return this.editor.isActive({textAlign:e})},setTextAlign(e){this.textAlignActive(e)?this.editor.chain().focus().unsetTextAlign().run():this.editor.chain().focus().setTextAlign(e).run()},showLinkMenu(){this.linkUrl=this.editor.getAttributes("link").href,this.linkMenuIsActive=!0,this.$nextTick(()=>this.$refs.linkInput.focus())},hideLinkMenu(){this.linkUrl=null,this.linkMenuIsActive=!1},setLink(e){let t="unsetLink",n=e;e&&(t="setLink",n.toLowerCase().startsWith("http")||(n=`//${n}`)),this.editor.chain().focus().extendMarkRange("link")[t]({href:n}).run(),this.hideLinkMenu()}}},qst={key:1,class:"menu-content"},Wst=["data-texteditor-tooltip"],Gst=["data-texteditor-tooltip"],Kst=["data-texteditor-tooltip"],Yst=["data-texteditor-tooltip"],Jst=["data-texteditor-tooltip"],Zst=["data-texteditor-tooltip"],Xst=["data-texteditor-tooltip"],Qst=["data-texteditor-tooltip"];function eat(e,t,n,r,i,o){const s=A("CIcon"),a=A("FontStyleMenu"),l=A("ColorMenu"),c=A("BubbleMenu",!0),d=jt("click-outside");return v(),V(c,{"should-show":({from:u,to:p})=>(n.isFocused||i.linkMenuIsActive)&&u!==p&&!n.editor.isActive("image")&&!n.editor.isActive("horizontalRule"),editor:n.editor,"tippy-options":{maxWidth:"none"}},{default:E(()=>[b("div",{class:ne([[{"is-bottom":i.isTouchDevice}],"menu"])},[i.linkMenuIsActive?Le((v(),x("form",{key:0,class:"menu-form",onSubmit:t[3]||(t[3]=Ie(u=>o.setLink(i.linkUrl),["prevent"]))},[Le(b("input",{ref:"linkInput","onUpdate:modelValue":t[0]||(t[0]=u=>i.linkUrl=u),class:"menu-input",type:"text",placeholder:"https://",onKeydown:t[1]||(t[1]=tn((...u)=>o.hideLinkMenu&&o.hideLinkMenu(...u),["esc"]))},null,544),[[Xd,i.linkUrl]]),b("div",{class:"menu-button",onMousedown:t[2]||(t[2]=Ie(u=>o.setLink(null),["prevent"]))},[T(s,{type:"x",size:"16"})],32)],32)),[[d,()=>i.linkMenuIsActive=!1]]):(v(),x("div",qst,[T(a,{editor:n.editor},null,8,["editor"]),n.editor.commands.toggleBold?(v(),x("button",{key:0,"data-texteditor-tooltip":e.$t("bold"),class:ne([{"is-active":n.editor.isActive("bold")},"menu-button"]),onMousedown:t[4]||(t[4]=Ie(()=>{},["prevent"])),onClick:t[5]||(t[5]=Ie(u=>n.editor.chain().focus().toggleBold().run(),["prevent"]))},t[21]||(t[21]=[b("svg",{width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"-8 -5 62 62"},[b("path",{d:"M 14 5 A 4.0004 4.0004 0 0 0 10 9 L 10 39 A 4.0004 4.0004 0 0 0 14 43 L 29 43 C 35.580064 43 41 37.580064 41 31 C 41 27.155249 39.030751 23.864926 36.179688 21.662109 C 37.230561 19.978585 38 18.110372 38 16 C 38 9.972248 33.027752 5 27 5 L 14 5 z M 18 13 L 27 13 C 28.704248 13 30 14.295752 30 16 C 30 17.704248 28.704248 19 27 19 L 18 19 L 18 13 z M 18 27 L 27 27 L 29 27 C 31.255936 27 33 28.744064 33 31 C 33 33.255936 31.255936 35 29 35 L 18 35 L 18 27 z"})],-1)]),42,Wst)):R("",!0),n.editor.commands.toggleItalic?(v(),x("button",{key:1,"data-texteditor-tooltip":e.$t("italic"),class:ne([{"is-active":n.editor.isActive("italic")},"menu-button"]),onMousedown:t[6]||(t[6]=Ie(()=>{},["prevent"])),onClick:t[7]||(t[7]=Ie(u=>n.editor.chain().focus().toggleItalic().run(),["prevent"]))},[T(s,{type:"editorItalic",size:"20"})],42,Gst)):R("",!0),b("button",{"data-texteditor-tooltip":e.$t("underline"),class:ne([{"is-active":n.editor.isActive("underline")},"menu-button"]),onMousedown:t[8]||(t[8]=Ie(()=>{},["prevent"])),onClick:t[9]||(t[9]=Ie(u=>n.editor.chain().focus().toggleUnderline().run(),["prevent"]))},t[22]||(t[22]=[b("svg",{width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"-6 -6 58 58"},[b("path",{d:"M 10.970703 4.9726562 A 2.0002 2.0002 0 0 0 9 7 L 9 22.5 C 9 30.484726 15.515274 37 23.5 37 C 31.484726 37 38 30.484726 38 22.5 L 38 7 A 2.0002 2.0002 0 1 0 34 7 L 34 22.5 C 34 28.323274 29.323274 33 23.5 33 C 17.676726 33 13 28.323274 13 22.5 L 13 7 A 2.0002 2.0002 0 0 0 10.970703 4.9726562 z M 11 40 A 2.0002 2.0002 0 1 0 11 44 L 37 44 A 2.0002 2.0002 0 1 0 37 40 L 11 40 z"})],-1)]),42,Kst),b("button",{"data-texteditor-tooltip":e.$t("_common:link").capitalize(),class:ne([{"is-active":n.editor.isActive("link")},"menu-button"]),onMousedown:t[10]||(t[10]=Ie(()=>{},["prevent"])),onClick:t[11]||(t[11]=Ie((...u)=>o.showLinkMenu&&o.showLinkMenu(...u),["prevent"]))},t[23]||(t[23]=[b("svg",{width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -4 54 54"},[b("path",{d:"M 37 4.0039062 C 34.69525 4.0037812 32.389766 4.8822188 30.634766 6.6367188 L 25.634766 11.636719 C 23.142766 14.128719 22.430516 17.727281 23.478516 20.863281 L 27.070312 17.271484 C 27.220312 16.244484 27.673891 15.253844 28.462891 14.464844 L 33.462891 9.4648438 C 34.437891 8.4908438 35.72 8.0019531 37 8.0019531 C 38.28 8.0019531 39.561156 8.4898437 40.535156 9.4648438 C 42.484156 11.414844 42.484156 14.586156 40.535156 16.535156 L 35.535156 21.535156 C 34.746156 22.324156 33.756516 22.776734 32.728516 22.927734 L 29.134766 26.521484 C 30.062766 26.831484 31.029047 26.996094 31.998047 26.996094 C 34.303047 26.996094 36.608281 26.118281 38.363281 24.363281 L 43.363281 19.363281 C 46.873281 15.854281 46.872281 10.145719 43.363281 6.6367188 C 41.608281 4.8827187 39.30475 4.0040313 37 4.0039062 z M 30.960938 16.980469 A 2.0002 2.0002 0 0 0 29.585938 17.585938 L 17.585938 29.585938 A 2.0002 2.0002 0 1 0 20.414062 32.414062 L 32.414062 20.414062 A 2.0002 2.0002 0 0 0 30.960938 16.980469 z M 18.449219 23.023438 C 15.997141 22.898656 13.506469 23.765766 11.636719 25.634766 L 6.6367188 30.634766 C 3.1277188 34.143766 3.1277187 39.854281 6.6367188 43.363281 C 8.3917188 45.117281 10.696 45.994141 13 45.994141 C 15.304 45.994141 17.608281 45.116328 19.363281 43.361328 L 24.363281 38.361328 C 26.855281 35.869328 27.569484 32.270766 26.521484 29.134766 L 22.927734 32.728516 C 22.777734 33.755516 22.324156 34.746156 21.535156 35.535156 L 16.535156 40.535156 C 14.586156 42.485156 11.413844 42.485156 9.4648438 40.535156 C 7.5158438 38.585156 7.5158438 35.413844 9.4648438 33.464844 L 14.464844 28.464844 C 15.253844 27.675844 16.244484 27.221312 17.271484 27.070312 L 20.863281 23.478516 C 20.079281 23.216516 19.266578 23.065031 18.449219 23.023438 z"})],-1)]),42,Yst),t[28]||(t[28]=b("div",{class:"menu-divider"},null,-1)),n.editor.commands.toggleHighlight?(v(),x("button",{key:2,class:ne([{"is-active":n.editor.isActive("highlight")},"menu-button"]),"data-texteditor-tooltip":e.$t("highlight"),onMousedown:t[12]||(t[12]=Ie(()=>{},["prevent"])),onClick:t[13]||(t[13]=Ie(u=>n.editor.chain().focus().toggleHighlight().run(),["prevent"]))},t[24]||(t[24]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",viewBox:"0 0 48 48"},[b("path",{d:"M 7.4765625 4.9785156 A 1.50015 1.50015 0 0 0 6 6.5 L 6 15.5 C 6 17.790682 7.7748091 19.635632 10 19.898438 L 10 24.5 C 10 26.967501 12.032499 29 14.5 29 L 15 29 L 15 43.5 C 15 44.013 15.261359 44.489625 15.693359 44.765625 C 15.938359 44.920625 16.219 45 16.5 45 C 16.716 45 16.933766 44.953375 17.134766 44.859375 L 30.402344 38.667969 C 31.980344 37.932969 33 36.330844 33 34.589844 L 33 29 L 33.5 29 C 35.967501 29 38 26.967501 38 24.5 L 38 19.898438 C 40.225191 19.635632 42 17.790682 42 15.5 L 42 6.5 A 1.50015 1.50015 0 1 0 39 6.5 L 39 15.5 C 39 16.346499 38.346499 17 37.5 17 L 36.746094 17 A 1.50015 1.50015 0 0 0 36.259766 17 L 11.746094 17 A 1.50015 1.50015 0 0 0 11.259766 17 L 10.5 17 C 9.6535009 17 9 16.346499 9 15.5 L 9 6.5 A 1.50015 1.50015 0 0 0 7.4765625 4.9785156 z M 13 20 L 35 20 L 35 24.5 C 35 25.346499 34.346499 26 33.5 26 L 14.5 26 C 13.653501 26 13 25.346499 13 24.5 L 13 20 z"})],-1)]),42,Jst)):R("",!0),n.editor.commands.setColor?(v(),V(l,{key:3,"show-picker":i.showColorPicker,"onUpdate:showPicker":t[14]||(t[14]=u=>i.showColorPicker=u),editor:n.editor},null,8,["show-picker","editor"])):R("",!0),t[29]||(t[29]=b("div",{class:"menu-divider"},null,-1)),n.editor.commands.setTextAlign?(v(),x(ee,{key:4},[b("button",{class:ne([{"is-active":o.textAlignActive("left")},"menu-button"]),"data-texteditor-tooltip":e.$t("_common:align",{thing:e.$t("_common:left")}),onMousedown:t[15]||(t[15]=Ie(()=>{},["prevent"])),onClick:t[16]||(t[16]=Ie(u=>o.setTextAlign("left"),["prevent"]))},t[25]||(t[25]=[b("svg",{width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",fill:"currentColor"},[b("path",{d:"M 6 9 A 2.0002 2.0002 0 1 0 6 13 L 34 13 A 2.0002 2.0002 0 1 0 34 9 L 6 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 7 35 A 2.0002 2.0002 0 1 0 7 39 L 27 39 A 2.0002 2.0002 0 1 0 27 35 L 7 35 z"})],-1)]),42,Zst),b("button",{class:ne([{"is-active":o.textAlignActive("center")},"menu-button"]),"data-texteditor-tooltip":e.$t("_common:center",{thing:e.$t("_common:text")}).capitalize(),onMousedown:t[17]||(t[17]=Ie(()=>{},["prevent"])),onClick:t[18]||(t[18]=Ie(u=>o.setTextAlign("center"),["prevent"]))},t[26]||(t[26]=[b("svg",{width:"20",height:"20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},[b("path",{d:"M 10 9 A 2.0002 2.0002 0 1 0 10 13 L 38 13 A 2.0002 2.0002 0 1 0 38 9 L 10 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 14 35 A 2.0002 2.0002 0 1 0 14 39 L 34 39 A 2.0002 2.0002 0 1 0 34 35 L 14 35 z"})],-1)]),42,Xst),b("button",{class:ne([{"is-active":o.textAlignActive("right")},"menu-button"]),"data-texteditor-tooltip":e.$t("_common:align",{thing:e.$t("_common:right")}),onMousedown:t[19]||(t[19]=Ie(()=>{},["prevent"])),onClick:t[20]||(t[20]=Ie(u=>o.setTextAlign("right"),["prevent"]))},t[27]||(t[27]=[b("svg",{width:"20",height:"20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",fill:"currentColor"},[b("path",{d:"M 14 9 A 2.0002 2.0002 0 1 0 14 13 L 42 13 A 2.0002 2.0002 0 1 0 42 9 L 14 9 z M 6 22 A 2.0002 2.0002 0 1 0 6 26 L 42 26 A 2.0002 2.0002 0 1 0 42 22 L 6 22 z M 22 35 A 2.0002 2.0002 0 1 0 22 39 L 42 39 A 2.0002 2.0002 0 1 0 42 35 L 22 35 z"})],-1)]),42,Qst)],64)):R("",!0)]))],2)]),_:1},8,["should-show","editor"])}const tat=X(Hst,[["render",eat],["__scopeId","data-v-e14ee888"]]),nat={components:{FormInputRow:Q1,TextTemplates:vt(()=>Promise.resolve().then(()=>Bmt))},emits:["upload-image"],mixins:[yr],props:{editor:{type:Object,required:!0},isFocused:{type:Boolean,default:!1},extensions:{type:Object,default:()=>({})}},i18nOptions:{namespaces:"tableMenu",messages:{en:{addColumnBefore:"Insert column to the left",addColumnAfter:"Insert column to the right",deleteColumn:"Delete column",addRowBefore:"Insert row above",addRowAfter:"Insert row below",deleteRow:"Delete row",toggleHeaderCell:"Toggle background cell",mergeOrSplit:"Merge or split cells",appearance:"Table style",deleteTable:"Delete table"},sv:{addColumnBefore:"Infoga kolumn till vänster",addColumnAfter:"Infoga kolumn till höger",deleteColumn:"Ta bort kolumn",addRowBefore:"Infoga rad ovanför",addRowAfter:"Infoga rad under",deleteRow:"Ta bort rad",toggleHeaderCell:"Växla bakgrund",mergeOrSplit:"Slå samman eller dela upp cell",appearance:"Utseende",deleteTable:"Ta bort tabell"}}},data(){return{popupOpen:!1,tableActions:[{onClick:()=>this.editor.chain().focus().addColumnBefore().run(),icon:"tableInsertColumnBefore",tooltip:this.$t("addColumnBefore")},{onClick:()=>this.editor.chain().focus().addColumnAfter().run(),icon:"tableInsertColumnAfter",tooltip:this.$t("addColumnAfter")},{onClick:()=>this.editor.chain().focus().deleteColumn().run(),icon:"tableDeleteColumn",tooltip:this.$t("deleteColumn")},{type:"divider"},{onClick:()=>this.editor.chain().focus().addRowBefore().run(),icon:"tableInsertRowBefore",tooltip:this.$t("addRowBefore")},{onClick:()=>this.editor.chain().focus().addRowAfter().run(),icon:"tableInsertRowAfter",tooltip:this.$t("addRowAfter")},{onClick:()=>this.editor.chain().focus().deleteRow().run(),icon:"tableDeleteRow",tooltip:this.$t("deleteRow")},{type:"divider"},{onClick:()=>this.editor.chain().focus().toggleHeaderCell().run(),icon:"tableHeaderCell",tooltip:this.$t("toggleHeaderCell")},{onClick:()=>this.editor.chain().focus().mergeOrSplit().run(),icon:"tableEditCell",tooltip:this.$t("mergeOrSplit")},{onClick:()=>{this.popupOpen=!0},icon:"drop",tooltip:this.$t("appearance"),popup:()=>{const{borderColor:e,borderWidth:t,cellPadding:n,headerBackground:r}=this.editor.getAttributes("table");return this.generateStyleInputs({borderColor:e,borderWidth:t,cellPadding:n,headerBackground:r,set:(i,o)=>this.editor.commands.updateAttributes("table",{[i]:o})})}},{type:"divider"},{onClick:()=>this.editor.chain().focus().deleteTable().run(),icon:"tableDelete",tooltip:this.$t("deleteTable")}],defaultActions:[{hide:this.mq==="sm"||!this.editor.commands.toggleHeading,onClick:()=>this.editor.commands.toggleHeading({level:1}),active:()=>this.editor.isActive("heading",{level:1}),icon:"editorH1",tooltip:this.$t("_common:designLabels.h1"),hideForMobile:!0},{hide:this.mq==="sm"||!this.editor.commands.toggleHeading,onClick:()=>this.editor.commands.toggleHeading({level:2}),active:()=>this.editor.isActive("heading",{level:2}),icon:"editorH2",tooltip:this.$t("_common:designLabels.h2"),hideForMobile:!0},{hide:this.mq==="sm"||!this.editor.commands.toggleHeading,onClick:()=>this.editor.commands.toggleHeading({level:3}),active:()=>this.editor.isActive("heading",{level:3}),icon:"editorH3",tooltip:this.$t("_common:designLabels.h3"),hideForMobile:!0},{hide:this.mq==="sm"||!this.editor.commands.toggleBlockquote,onClick:()=>this.editor.commands.toggleBlockquote(),active:()=>this.editor.isActive("blockquote"),icon:"editorQuote",tooltip:this.$t("_common:designLabels.blockquote"),hideForMobile:!0},{type:"divider",hideForMobile:!0},{hide:!this.editor.commands.toggleOrderedList,onClick:()=>this.editor.commands.toggleOrderedList(),active:()=>this.editor.isActive("orderedList"),icon:"editorNumberedList",tooltip:this.$t("_common:designLabels.numberedList")},{hide:!this.editor.commands.toggleBulletList,onClick:()=>this.editor.commands.toggleBulletList(),active:()=>this.editor.isActive("bulletList"),icon:"editorBulletList",tooltip:this.$t("_common:designLabels.bulletList")},{type:"divider"},{hide:!this.editor.commands.setImage,onClick:()=>{this.popupOpen=!0,this.$refs.inputImgUpload.click()},icon:"editorImage",tooltip:this.$t("_common:insert",{thing:this.$t("_common:image")})},{hide:!this.editor.commands.insertTable,onClick:()=>this.editor.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),icon:"table",tooltip:this.$t("_common:table").capitalize()},{hide:!this.editor.commands.setHorizontalRule,onClick:()=>this.editor.chain().focus().setHorizontalRule().run(),icon:"editorLine",tooltip:this.$t("_common:designLabels.line")},{hide:!this.extensions.mentions&&!this.extensions.snippets,type:"divider"},{hide:!this.extensions.mentions,onClick:()=>this.editor.chain().focus().insertContent("@").run(),icon:"editorMention",tooltip:this.$t("_common:insert",{thing:this.$t("_common:reference")})}]}},computed:{shouldShow(){return this.isFocused||this.popupOpen},menuActions(){return this.editor.isActive("table")?this.tableActions:this.defaultActions.filter(t=>t.hideForMobile?this.mq!=="sm":!0)}},methods:{generateStyleInputs({borderColor:e,borderWidth:t,cellPadding:n,headerBackground:r,set:i}){const o=/([\d+.]*)(.*)/,s=c=>(c||"").match(o),a=s(t)[1],l=s(n)[1];return[{label:this.$t("_common:designLabels.borderWidth"),inputs:[{component:"input",props:{value:a,type:"number",minValue:0},onInput:c=>i("borderWidth",`${c}px`)},{component:"step",props:{value:a},onIncrease:()=>i("borderWidth",`${parseFloat(a||0)+1}px`),onDecrease:()=>i("borderWidth",`${parseFloat(a||0)-1}px`)}]},{label:this.$t("_common:designLabels.color"),inputs:[{component:"color",props:{value:e||""},onInput:c=>i("borderColor",c)}]},{label:this.$t("_common:designLabels.padding"),inputs:[{component:"input",props:{value:l,type:"number",minValue:0},onInput:c=>i("cellPadding",`${c}px`)},{component:"step",props:{value:l},onIncrease:()=>i("cellPadding",`${parseFloat(l||0)+1}px`),onDecrease:()=>i("cellPadding",`${parseFloat(l||0)-1}px`)}]},{label:this.$t("_common:designLabels.background"),inputs:[{component:"color",props:{value:r||"",showReset:!0,position:"is-top-right"},onInput:c=>i("headerBackground",c)}]}]},setTextToEditor(e){this.editor.chain().focus().insertContent(e).run()}}},rat=["data-texteditor-tooltip","onMousedown","onClick"],iat={key:0,style:{position:"absolute",left:"50%",bottom:"calc(100% + 1em)","background-color":"white",padding:"10px 10px calc(2 * var(--rem)) 10px",transform:"translate(-50%, 0%)",color:"hsl(0, 0%, 35%)",width:"250px","box-shadow":"0 8px 14px rgba(0, 0, 0, 0.2)",border:"1px solid hsl(0, 0%, 88%)","border-radius":"8px",cursor:"default"}},oat=["data-texteditor-tooltip"];function sat(e,t,n,r,i,o){const s=A("CIcon"),a=A("FormInputRow"),l=A("TextTemplates"),c=A("portal"),d=jt("click-outside");return v(),V(c,{to:"modal"},{default:E(()=>[T(Cn,{name:"slide-vertical",mode:"out-in"},{default:E(()=>[o.shouldShow?(v(),x("div",{key:o.menuActions[0].tooltip,class:"menu"},[(v(!0),x(ee,null,be(o.menuActions,(u,p)=>(v(),x(ee,{key:p},[u.type==="divider"&&!u.hide?(v(),x("div",{key:"divider-"+p,class:"menu-divider"})):u.hide?R("",!0):Le((v(),x("div",{key:p,"data-texteditor-tooltip":u.tooltip,class:ne([{"is-active":u.active&&u.active()},"menu-button"]),onMousedown:f=>{u.popup?u.onClick():f.preventDefault()},onClick:u.onClick},[T(s,{type:u.icon||"info",size:"22"},null,8,["type"]),u.popup&&i.popupOpen?(v(),x("div",iat,[(v(!0),x(ee,null,be(u.popup(),(f,h)=>(v(),V(a,{key:h,label:f.label,inputs:f.inputs},null,8,["label","inputs"]))),128))])):R("",!0)],42,rat)),[[d,()=>{u.popup&&(i.popupOpen=!1)}]])],64))),128)),n.extensions.snippets&&!n.editor.isActive("table")?(v(),V(l,{key:0,placement:"top",onMousedown:t[0]||(t[0]=Ie(()=>{},["prevent"])),onOpen:t[1]||(t[1]=u=>i.popupOpen=!0),onSelect:o.setTextToEditor,onClose:t[2]||(t[2]=u=>i.popupOpen=!1)},{default:E(()=>[b("div",{"data-texteditor-tooltip":e.$t("_common:insert",{thing:e.$t("_common:snippet")}),class:"menu-button"},[T(s,{type:"editorSnippets",size:"22"})],8,oat)]),_:1},8,["onSelect"])):R("",!0),b("input",{ref:"inputImgUpload",type:"file",style:{display:"none"},onChange:t[3]||(t[3]=u=>{e.$emit("upload-image",{file:u}),i.popupOpen=!1})},null,544)])):R("",!0)]),_:1})]),_:1})}const aat=X(nat,[["render",sat],["__scopeId","data-v-0cd0d0af"]]);function lat(e){var t;const{char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:s}=e,a=jit(n),l=new RegExp(`\\s${a}$`),c=o?"^":"",d=r?new RegExp(`${c}${a}.*?(?=\\s${a}|$)`,"gm"):new RegExp(`${c}(?:^)?${a}[^\\s${a}]*`,"gm"),u=((t=s.nodeBefore)===null||t===void 0?void 0:t.isText)&&s.nodeBefore.text;if(!u)return null;const p=s.pos-u.length,f=Array.from(u.matchAll(d)).pop();if(!f||f.input===void 0||f.index===void 0)return null;const h=f.input.slice(Math.max(0,f.index-1),f.index),m=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(h);if(i!==null&&!m)return null;const g=p+f.index;let y=g+f[0].length;return r&&l.test(u.slice(y-1,y+1))&&(f[0]+=" ",y+=1),g<s.pos&&y>=s.pos?{range:{from:g,to:y},query:f[0].slice(n.length),text:f[0]}:null}const cat=new Zn("suggestion");function Qee({pluginKey:e=cat,editor:t,char:n="@",allowSpaces:r=!1,allowedPrefixes:i=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:a="suggestion",command:l=()=>null,items:c=()=>[],render:d=()=>({}),allow:u=()=>!0,findSuggestionMatch:p=lat}){let f;const h=d==null?void 0:d(),m=new In({key:e,view(){return{update:async(g,y)=>{var w,k,_,M,S,O,P;const I=(w=this.key)===null||w===void 0?void 0:w.getState(y),L=(k=this.key)===null||k===void 0?void 0:k.getState(g.state),$=I.active&&L.active&&I.range.from!==L.range.from,F=!I.active&&L.active,U=I.active&&!L.active,q=!F&&!U&&I.query!==L.query,z=F||$&&q,D=q||$,N=U||$&&q;if(!z&&!D&&!N)return;const B=N&&!z?I:L,Q=g.dom.querySelector(`[data-decoration-id="${B.decorationId}"]`);f={editor:t,range:B.range,query:B.query,text:B.text,items:[],command:te=>l({editor:t,range:B.range,props:te}),decorationNode:Q,clientRect:Q?()=>{var te;const{decorationId:he}=(te=this.key)===null||te===void 0?void 0:te.getState(t.state),Me=g.dom.querySelector(`[data-decoration-id="${he}"]`);return(Me==null?void 0:Me.getBoundingClientRect())||null}:null},z&&((_=h==null?void 0:h.onBeforeStart)===null||_===void 0||_.call(h,f)),D&&((M=h==null?void 0:h.onBeforeUpdate)===null||M===void 0||M.call(h,f)),(D||z)&&(f.items=await c({editor:t,query:B.query})),N&&((S=h==null?void 0:h.onExit)===null||S===void 0||S.call(h,f)),D&&((O=h==null?void 0:h.onUpdate)===null||O===void 0||O.call(h,f)),z&&((P=h==null?void 0:h.onStart)===null||P===void 0||P.call(h,f))},destroy:()=>{var g;f&&((g=h==null?void 0:h.onExit)===null||g===void 0||g.call(h,f))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(g,y,w,k){const{isEditable:_}=t,{composing:M}=t.view,{selection:S}=g,{empty:O,from:P}=S,I={...y};if(I.composing=M,_&&(O||t.view.composing)){(P<y.range.from||P>y.range.to)&&!M&&!y.composing&&(I.active=!1);const L=p({char:n,allowSpaces:r,allowedPrefixes:i,startOfLine:o,$position:S.$from}),$=`id_${Math.floor(Math.random()*4294967295)}`;L&&u({editor:t,state:k,range:L.range,isActive:y.active})?(I.active=!0,I.decorationId=y.decorationId?y.decorationId:$,I.range=L.range,I.query=L.query,I.text=L.text):I.active=!1}else I.active=!1;return I.active||(I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null),I}},props:{handleKeyDown(g,y){var w;const{active:k,range:_}=m.getState(g.state);return k&&((w=h==null?void 0:h.onKeyDown)===null||w===void 0?void 0:w.call(h,{view:g,event:y,range:_}))||!1},decorations(g){const{active:y,range:w,decorationId:k}=m.getState(g);return y?Un.create(g.doc,[Xr.inline(w.from,w.to,{nodeName:s,class:a,"data-decoration-id":k})]):null}}});return m}const dat=new Zn("mention"),uat=ei.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:e,node:t}){var n;return`${e.suggestion.char}${(n=t.attrs.label)!==null&&n!==void 0?n:t.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:e,node:t}){var n;return["span",_n(this.HTMLAttributes,e.HTMLAttributes),`${e.suggestion.char}${(n=t.attrs.label)!==null&&n!==void 0?n:t.attrs.id}`]},suggestion:{char:"@",pluginKey:dat,command:({editor:e,range:t,props:n})=>{var r,i,o;const s=e.view.state.selection.$to.nodeAfter;((r=s==null?void 0:s.text)===null||r===void 0?void 0:r.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(o=(i=e.view.dom.ownerDocument.defaultView)===null||i===void 0?void 0:i.getSelection())===null||o===void 0||o.collapseToEnd()},allow:({state:e,range:t})=>{const n=e.doc.resolve(t.from),r=e.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:e,HTMLAttributes:t}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",_n({"data-type":this.name},this.options.HTMLAttributes,t),this.options.renderLabel({options:this.options,node:e})];const n={...this.options};n.HTMLAttributes=_n({"data-type":this.name},this.options.HTMLAttributes,t);const r=this.options.renderHTML({options:n,node:e});return typeof r=="string"?["span",_n({"data-type":this.name},this.options.HTMLAttributes,t),r]:r},renderText({node:e}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:e})):this.options.renderText({options:this.options,node:e})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1;const{selection:r}=t,{empty:i,anchor:o}=r;return i?(t.doc.nodesBetween(o-1,o,(s,a)=>{if(s.type.name===this.name)return n=!0,e.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",a,a+s.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[Qee({editor:this.editor,...this.options.suggestion})]}}),pat={name:"TextEditorMentionList",i18nOptions:{namespaces:"TextEditorMentionList",messages:{en:{referenceTooltipTitle:"Reference info from..."},sv:{referenceTooltipTitle:"Referera till info från..."}}},props:{items:{type:Array,required:!0},command:{type:Function,required:!0}},setup(){return{mentions:Pe([])}},data(){return{navigatedIndex:0}},watch:{items(){this.navigatedIndex=0}},methods:{onKeyDown({event:e}){return e.key==="ArrowUp"?(this.upHandler(),!0):e.key==="ArrowDown"?(this.downHandler(),!0):e.key==="Enter"?(this.enterHandler(),!0):!1},upHandler(){this.navigatedIndex=(this.navigatedIndex+this.items.length-1)%this.items.length,this.scrollToHighlightedMention()},downHandler(){this.navigatedIndex=(this.navigatedIndex+1)%this.items.length,this.scrollToHighlightedMention()},scrollToHighlightedMention(){!this.mentions||!this.mentions[this.navigatedIndex]||this.mentions[this.navigatedIndex].scrollIntoView({block:"nearest"})},enterHandler(){const e=this.items[this.navigatedIndex];e&&this.selectItem(e)},selectItem(e){this.command(e)}}},hat={class:"flex max-h-[300px] w-64 flex-col overflow-hidden rounded-lg border border-solid border-slate-200 bg-white text-base text-[#262626] shadow-lg"},fat={class:"px-4 py-3 text-sm font-semibold"},mat={class:"overflow-auto"},gat=["onClick"],yat={key:1,class:"px-4 py-2 opacity-50"};function vat(e,t,n,r,i,o){return v(),x("div",hat,[n.items.length?(v(),x(ee,{key:0},[b("div",fat,C(e.$t("referenceTooltipTitle")),1),b("div",mat,[(v(!0),x(ee,null,be(n.items,(s,a)=>(v(),x("div",{ref_for:!0,ref:"mentions",key:s.id+a,class:ne([{"bg-[hsl(var(--primary-color-500)/0.2)]":i.navigatedIndex===a,"mb-3":a==n.items.length-1},"cursor-pointer overflow-hidden text-ellipsis whitespace-nowrap px-4 py-1 hover:bg-[hsl(var(--primary-color-500)/0.1)]"]),onMousedown:t[0]||(t[0]=Ie(()=>{},["prevent"])),onClick:l=>o.selectItem(s)},C(s.label),43,gat))),128))])],64)):(v(),x("div",yat,C(e.$t("_common:noResults")),1))])}const bat=X(pat,[["render",vat]]),ete="mention",tte=(e,t)=>(t||[]).filter(({label:n=""})=>n.toLowerCase().includes(e.toLowerCase()));function wat(e=null){let t=[];const n=typeof e=="function"?e:()=>[];return{render:()=>{let r,i,o;return{onStart:s=>{t=n(),s.items=tte(s.query,t);const{el:a,isShadow:l}=Ky(this.$el),c=l?a:a.body,d=l?a:document;r=new Xee(bat,{props:s,editor:s.editor}),i=Jc("body",{getReferenceClientRect:s.clientRect,appendTo:c,content:r.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",plugins:[TVe],onHidden:()=>{r.destroy(),o&&d.removeEventListener("touchstart",o)}}),o=u=>{i[0].popper.contains(u.target)||i[0].hide()},d.addEventListener("touchstart",o)},onUpdate(s){s.items=tte(s.query,t),r.updateProps(s),i[0].setProps({getReferenceClientRect:s.clientRect})},onKeyDown(s){return s.event.key==="Escape"?(i[0].hide(),!0):r.ref.onKeyDown(s)},onExit(){if(i[0].destroy(),r.destroy(),o){const{el:s,isShadow:a}=Ky(this.$el);(a?s:document).removeEventListener("touchstart",o)}}}}}}function kat(e=null){return uat.extend({addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-mention-id"),renderHTML:t=>({"data-mention-id":t.id})},label:{default:null,parseHTML:t=>t.innerText.split(this.options.suggestion.char).join("")},tooltip:{default:null,parseHTML:t=>t.getAttribute("data-tooltip"),renderHTML:t=>({"data-tooltip":t.tooltip})},filter:{default:null,parseHTML:t=>t.getAttribute("data-filter"),renderHTML:t=>({"data-filter":t.filter})}}},parseHTML(){return[{tag:"span[data-mention-id]"}]},renderHTML({HTMLAttributes:t}){return["span",{class:[ete,...t["data-tooltip"]?[]:["empty"]].join(" "),...t,"data-tooltip":t["data-tooltip"]||ye.t("_common:missing",{thing:ye.t("_common:value")})},`${t.label}`]},addProseMirrorPlugins(){const t=typeof e=="function"?e:()=>[];let n=t();return[Qee({editor:this.editor,...this.options.suggestion}),new In({key:new Zn("mention-paste-handler"),props:{handlePaste(r,i){if(r.props.editable&&!r.props.editable(r.state))return!1;const o=i.clipboardData||i.originalEvent.clipboardData;if(!o)return!1;const s=o.getData("text/plain");if(typeof s!="string"||!s.startsWith("{{")||!s.endsWith("}}"))return!1;const a=s.substring(2,s.length-2);n=t();const l=n.find(f=>f.id===a);if(!l)return!1;const{state:c,dispatch:d}=r,u=c.schema.nodes.mention.create(l),p=c.tr.replaceSelectionWith(u);return d(p),!0}}})]}}).configure({HTMLAttributes:{class:ete},suggestion:wat.call(this,e)})}const _at=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,xat=ei.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",_n(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[kee({find:_at,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),Cat={name:"TextEditorImageView",components:{NodeViewWrapper:Ast},props:Mst,data(){return{hasError:!1,displayOptions:[{value:"left",icon:'<rect x="1" y="5" width="11" height="15" rx="0" ry="2"></rect><line x1="16" y1="7" x2="22" y2="7"></line><line x1="16" y1="12" x2="22" y2="12"></line><line x1="16" y1="17" x2="22" y2="17"></line>',tooltip:this.$t("_common:align",{thing:this.$t("_common:left")})},{value:"block",icon:'<rect x="2" y="7" width="19" height="11" rx="0" ry="2"></rect><line x1="2" y1="3" y2="3" x2="21"></line><line x1="2" y1="22" x2="21" y2="22"></line>',tooltip:this.$t("_common:center",{thing:this.$t("_common:image")}).capitalize()},{value:"right",icon:'<rect x="11" y="5" width="11" height="15" rx="0" ry="2"></rect><line x1="0" y1="7" y2="7" x2="6"></line><line x1="0" y1="12" x2="6" y2="12"></line><line x1="0" y1="17" x2="6" y2="17"></line>',tooltip:this.$t("_common:align",{thing:this.$t("_common:right")})}]}},computed:{isSelected(){return this.selected&&this.editor.isEditable},src(){var t,n;const e=re(this,"node.attrs.src","");return((n=(t=this.extension)==null?void 0:t.options)==null?void 0:n.resolveImgSrc(e))||e},display(){return re(this,"node.attrs.display","block")},style(){return re(this,"node.attrs.style","")}},methods:{selectImage(){this.editor.isEditable?this.editor.chain().focus().setNodeSelection(this.getPos()).run():this.openPreview()},remove(){this.deleteNode(this.getPos())},changeDisplay(e){this.updateAttributes({display:e}),this.selectImage()},async openPreview(){var n;const e=vt(()=>Promise.resolve().then(()=>KQe)),{title:t}=((n=this.node)==null?void 0:n.attrs)||{};this.$modal.show(e,{index:0,list:[{url:this.src,name:t}]},{adaptive:!0,height:"100%",width:"100%",classes:"",transition:""})},onError(){this.hasError=!0}}},Tat=["src"],Sat={key:1,class:"image-menu top-2 rounded-md bg-gray-800"},Eat=["innerHTML"];function Aat(e,t,n,r,i,o){const s=A("CButton"),a=A("CIcon"),l=A("NodeViewWrapper");return v(),V(l,{class:ne([[{"texteditor-image-view-inline":o.display&&o.display!=="block","outline-primary-300 outline outline-2":o.isSelected},`texteditor-image-view-${o.display}`],"texteditor-image-view"]),as:"span",draggable:"true","data-drag-handle":""},{default:E(()=>[i.hasError?R("",!0):(v(),x("img",{key:0,src:o.src,class:ne({selected:o.isSelected}),style:Oe(o.style),onClick:t[0]||(t[0]=(...c)=>o.selectImage&&o.selectImage(...c)),onError:t[1]||(t[1]=(...c)=>o.onError&&o.onError(...c))},null,46,Tat)),o.isSelected?(v(),x("div",Sat,[(v(!0),x(ee,null,be(i.displayOptions,(c,d)=>(v(),V(s,{key:d,class:ne({"!text-primary-300":o.display===c.value}),"data-texteditor-tooltip":c.tooltip,type:"none",size:"small",onClick:u=>o.changeDisplay(c.value)},{default:E(()=>[(v(),x("svg",{viewBox:"0 0 24 24",width:"21",height:"21",stroke:"currentColor","stroke-width":"2",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",innerHTML:c.icon},null,8,Eat))]),_:2},1032,["class","data-texteditor-tooltip","onClick"]))),128)),t[2]||(t[2]=b("div",{class:"bg-gray-500",style:{width:"1px",height:"1.5em",margin:"0 2px"}},null,-1)),T(s,{"data-texteditor-tooltip":e.$t("_common:remove"),type:"none",size:"small",onClick:o.remove},{default:E(()=>[T(a,{size:18,type:"trash"})]),_:1},8,["data-texteditor-tooltip","onClick"])])):R("",!0)]),_:1},8,["class"])}const Mat=X(Cat,[["render",Aat],["__scopeId","data-v-7f9e7fe8"]]),Oat=(e,t=!1)=>xat.extend({addOptions(){return{inline:!0,HTMLAttributes:{},resolveImgSrc:n=>vU(n,t?{auto:"compress"}:{})}},addAttributes(){return{...this.parent?this.parent():null,src:{default:null,parseHTML:n=>n.getAttribute("src"),renderHTML:n=>{var r;return{src:((r=this.options)==null?void 0:r.resolveImgSrc(n.src))||n.src}}},display:{default:"block",parseHTML:n=>n.getAttribute("data-display"),renderHTML:n=>({"data-display":n.display})},style:{default:"",parseHTML:n=>n.getAttribute("style"),renderHTML:n=>({style:n.style})},hash:{default:null,parseHTML:n=>n.getAttribute("data-hash"),renderHTML:n=>({"data-hash":n.hash})},algorithm:{default:null,parseHTML:n=>n.getAttribute("data-alg"),renderHTML:n=>({"data-alg":n.algorithm})}}},addNodeView(){return Dst(Mat)},addProseMirrorPlugins(){return[new In({key:new Zn("image-handler"),props:{handlePaste(n,r){const{items:i}=r.clipboardData||r.originalEvent.clipboardData;for(const o of i)if(o.type.indexOf("image")===0){r.preventDefault();const{schema:s}=n.state,a=o.getAsFile();if(e)e(a).then(({url:l,hash:c,algorithm:d})=>{const u=s.nodes.image.create({src:l,hash:c,algorithm:d}),p=n.state.tr.replaceSelectionWith(u);n.dispatch(p)});else{const l=new FileReader;l.onload=c=>{const d=s.nodes.image.create({src:c.target.result}),u=n.state.tr.replaceSelectionWith(d);n.dispatch(u)},l.readAsDataURL(a)}}return!1},handleDOMEvents:{drop(n,r){if(!(r.dataTransfer&&r.dataTransfer.files&&r.dataTransfer.files.length))return;const o=Array.from(r.dataTransfer.files).filter(l=>/image/i.test(l.type));if(o.length===0)return;r.preventDefault();const{schema:s}=n.state,a=n.posAtCoords({left:r.clientX,top:r.clientY});o.forEach(async l=>{const c=new FileReader;if(e){const{url:d,hash:u,algorithm:p}=await e(l),f=s.nodes.image.create({src:d,hash:u,algorithm:p}),h=n.state.tr.insert(a.pos,f);n.dispatch(h)}else c.onload=d=>{const u=s.nodes.image.create({src:d.target.result}),p=n.state.tr.insert(a.pos,u);n.dispatch(p)},c.readAsDataURL(l)})}}}})]}});var yA,vA;if(typeof WeakMap<"u"){let e=new WeakMap;yA=t=>e.get(t),vA=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;yA=r=>{for(let i=0;i<e.length;i+=2)if(e[i]==r)return e[i+1]},vA=(r,i)=>(n==10&&(n=0),e[n++]=r,e[n++]=i)}var rr=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){const n=this.map[t];if(n!=e)continue;const r=t%this.width,i=t/this.width|0;let o=r+1,s=i+1;for(let a=1;o<this.width&&this.map[t+a]==n;a++)o++;for(let a=1;s<this.height&&this.map[t+this.width*a]==n;a++)s++;return{left:r,top:i,right:o,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){const{left:r,right:i,top:o,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?r==0:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?o==0:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(e,t){const{left:n,right:r,top:i,bottom:o}=this.findCell(e),{left:s,right:a,top:l,bottom:c}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(i,l),right:Math.max(r,a),bottom:Math.max(o,c)}}cellsInRect(e){const t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){const o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,!(i==e.left&&i&&this.map[o-1]==s||r==e.top&&r&&this.map[o-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){const o=i+n.child(r).nodeSize;if(r==e){let s=t+e*this.width;const a=(e+1)*this.width;for(;s<a&&this.map[s]<i;)s++;return s==a?o-1:this.map[s]}i=o}}static get(e){return yA(e)||vA(e,Dat(e))}};function Dat(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);const t=Pat(e),n=e.childCount,r=[];let i=0,o=null;const s=[];for(let c=0,d=t*n;c<d;c++)r[c]=0;for(let c=0,d=0;c<n;c++){const u=e.child(c);d++;for(let h=0;;h++){for(;i<r.length&&r[i]!=0;)i++;if(h==u.childCount)break;const m=u.child(h),{colspan:g,rowspan:y,colwidth:w}=m.attrs;for(let k=0;k<y;k++){if(k+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:d,n:y-k});break}const _=i+k*t;for(let M=0;M<g;M++){r[_+M]==0?r[_+M]=d:(o||(o=[])).push({type:"collision",row:c,pos:d,n:g-M});const S=w&&w[M];if(S){const O=(_+M)%t*2,P=s[O];P==null||P!=S&&s[O+1]==1?(s[O]=S,s[O+1]=1):P==S&&s[O+1]++}}}i+=g,d+=m.nodeSize}const p=(c+1)*t;let f=0;for(;i<p;)r[i++]==0&&f++;f&&(o||(o=[])).push({type:"missing",row:c,n:f}),d++}const a=new rr(t,n,r,o);let l=!1;for(let c=0;!l&&c<s.length;c+=2)s[c]!=null&&s[c+1]<n&&(l=!0);return l&&Iat(a,s,e),a}function Pat(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){const i=e.child(r);let o=0;if(n)for(let s=0;s<r;s++){const a=e.child(s);for(let l=0;l<a.childCount;l++){const c=a.child(l);s+c.attrs.rowspan>r&&(o+=c.attrs.colspan)}}for(let s=0;s<i.childCount;s++){const a=i.child(s);o+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}t==-1?t=o:t!=o&&(t=Math.max(t,o))}return t}function Iat(e,t,n){e.problems||(e.problems=[]);const r={};for(let i=0;i<e.map.length;i++){const o=e.map[i];if(r[o])continue;r[o]=!0;const s=n.nodeAt(o);if(!s)throw new RangeError(`No cell with offset ${o} found`);let a=null;const l=s.attrs;for(let c=0;c<l.colspan;c++){const d=(i+c)%e.width,u=t[d*2];u!=null&&(!l.colwidth||l.colwidth[c]!=u)&&((a||(a=$at(l)))[c]=u)}a&&e.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}function $at(e){if(e.colwidth)return e.colwidth.slice();const t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function bi(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(const n in e.nodes){const r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var kd=new Zn("selectingCells");function $f(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function Rat(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function Ns(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function f5(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=$f(t.$head)||Lat(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function Lat(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function bA(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function Nat(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function wA(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function nte(e,t,n){const r=e.node(-1),i=rr.get(r),o=e.start(-1),s=i.nextCell(e.pos-o,t,n);return s==null?null:e.node(0).resolve(o+s)}function ap(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function rte(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;i<n;i++)r.colwidth.splice(t,0,0)}return r}function Fat(e,t,n){const r=bi(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var An=class Bl extends mt{constructor(t,n=t){const r=t.node(-1),i=rr.get(r),o=t.start(-1),s=i.rectBetween(t.pos-o,n.pos-o),a=t.node(0),l=i.cellsInRect(s).filter(d=>d!=n.pos-o);l.unshift(n.pos-o);const c=l.map(d=>{const u=r.nodeAt(d);if(!u)throw RangeError(`No cell with offset ${d} found`);const p=o+d+1;return new wX(a.resolve(p),a.resolve(p+u.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(bA(r)&&bA(i)&&wA(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Bl.rowSelection(r,i):o&&this.isColSelection()?Bl.colSelection(r,i):new Bl(r,i)}return dt.between(r,i)}content(){const t=this.$anchorCell.node(-1),n=rr.get(t),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let l=i.top;l<i.bottom;l++){const c=[];for(let d=l*n.width+i.left,u=i.left;u<i.right;u++,d++){const p=n.map[d];if(o[p])continue;o[p]=!0;const f=n.findCell(p);let h=t.nodeAt(p);if(!h)throw RangeError(`No cell with offset ${p} found`);const m=i.left-f.left,g=f.right-i.right;if(m>0||g>0){let y=h.attrs;if(m>0&&(y=ap(y,0,m)),g>0&&(y=ap(y,y.colspan-g,g)),f.left<i.left){if(h=h.type.createAndFill(y),!h)throw RangeError(`Could not create cell with attrs ${JSON.stringify(y)}`)}else h=h.type.create(y,h.content)}if(f.top<i.top||f.bottom>i.bottom){const y={...h.attrs,rowspan:Math.min(f.bottom,i.bottom)-Math.max(f.top,i.top)};f.top<i.top?h=h.type.createAndFill(y):h=h.type.create(y,h.content)}c.push(h)}s.push(t.child(l).copy(Se.from(c)))}const a=this.isColSelection()&&this.isRowSelection()?t:s;return new We(Se.from(a),1,1)}replace(t,n=We.empty){const r=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){const{$from:a,$to:l}=i[s],c=t.mapping.slice(r);t.replace(c.map(a.pos),c.map(l.pos),s?We.empty:n)}const o=mt.findFrom(t.doc.resolve(t.mapping.slice(r).map(this.to)),-1);o&&t.setSelection(o)}replaceWith(t,n){this.replace(t,new We(Se.from(n),0,0))}forEachCell(t){const n=this.$anchorCell.node(-1),r=rr.get(n),i=this.$anchorCell.start(-1),o=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i));for(let s=0;s<o.length;s++)t(n.nodeAt(o[s]),i+o[s])}isColSelection(){const t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;const r=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),i=rr.get(r),o=t.start(-1),s=i.findCell(t.pos-o),a=i.findCell(n.pos-o),l=t.node(0);return s.top<=a.top?(s.top>0&&(t=l.resolve(o+i.map[s.left])),a.bottom<i.height&&(n=l.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(o+i.map[a.left])),s.bottom<i.height&&(t=l.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))),new Bl(t,n)}isRowSelection(){const t=this.$anchorCell.node(-1),n=rr.get(t),r=this.$anchorCell.start(-1),i=n.colCount(this.$anchorCell.pos-r),o=n.colCount(this.$headCell.pos-r);if(Math.min(i,o)>0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,a=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(t){return t instanceof Bl&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),i=rr.get(r),o=t.start(-1),s=i.findCell(t.pos-o),a=i.findCell(n.pos-o),l=t.node(0);return s.left<=a.left?(s.left>0&&(t=l.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(n=l.resolve(o+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(t=l.resolve(o+i.map[i.width*(s.top+1)-1]))),new Bl(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new Bl(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new Bl(t.resolve(n),t.resolve(r))}getBookmark(){return new Vat(this.$anchorCell.pos,this.$headCell.pos)}};An.prototype.visible=!1,mt.jsonID("cell",An);var Vat=class Tie{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Tie(t.map(this.anchor),t.map(this.head))}resolve(t){const n=t.resolve(this.anchor),r=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&wA(n,r)?new An(n,r):mt.near(r,1)}};function Bat(e){if(!(e.selection instanceof An))return null;const t=[];return e.selection.forEachCell((n,r)=>{t.push(Xr.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Un.create(e.doc,t)}function zat({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let o=t.depth;o>=0&&!(t.before(o+1)>t.start(o));o--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Uat({$from:e,$to:t}){let n,r;for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&t.parentOffset===0}function jat(e,t,n){const r=(t||e).selection,i=(t||e).doc;let o,s;if(r instanceof at&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=An.create(i,r.from);else if(s=="row"){const a=i.resolve(r.from+1);o=An.rowSelection(a,a)}else if(!n){const a=rr.get(r.node),l=r.from+1,c=l+a.map[a.width*a.height-1];o=An.create(i,l+1,c)}}else r instanceof dt&&zat(r)?o=dt.create(i,r.from):r instanceof dt&&Uat(r)&&(o=dt.create(i,r.$from.start(),r.$from.end()));return o&&(t||(t=e.tr)).setSelection(o),t}var Hat=new Zn("fix-tables");function ite(e,t,n,r){const i=e.childCount,o=t.childCount;e:for(let s=0,a=0;s<o;s++){const l=t.child(s);for(let c=a,d=Math.min(i,s+3);c<d;c++)if(e.child(c)==l){a=c+1,n+=l.nodeSize;continue e}r(l,n),a<i&&e.child(a).sameMarkup(l)?ite(e.child(a),l,n+1,r):l.nodesBetween(0,l.content.size,r,n+1),n+=l.nodeSize}}function ote(e,t){let n;const r=(i,o)=>{i.type.spec.tableRole=="table"&&(n=qat(e,i,o,n))};return t?t.doc!=e.doc&&ite(t.doc,e.doc,0,r):e.doc.descendants(r),n}function qat(e,t,n,r){const i=rr.get(t);if(!i.problems)return r;r||(r=e.tr);const o=[];for(let l=0;l<i.height;l++)o.push(0);for(let l=0;l<i.problems.length;l++){const c=i.problems[l];if(c.type=="collision"){const d=t.nodeAt(c.pos);if(!d)continue;const u=d.attrs;for(let p=0;p<u.rowspan;p++)o[c.row+p]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,ap(u,u.colspan-c.n,c.n))}else if(c.type=="missing")o[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const d=t.nodeAt(c.pos);if(!d)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const d=t.nodeAt(c.pos);if(!d)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...d.attrs,colwidth:c.colwidth})}}let s,a;for(let l=0;l<o.length;l++)o[l]&&(s==null&&(s=l),a=l);for(let l=0,c=n+1;l<i.height;l++){const d=t.child(l),u=c+d.nodeSize,p=o[l];if(p>0){let f="cell";d.firstChild&&(f=d.firstChild.type.spec.tableRole);const h=[];for(let g=0;g<p;g++){const y=bi(e.schema)[f].createAndFill();y&&h.push(y)}const m=(l==0||s==l-1)&&a==l?c+1:u-1;r.insert(r.mapping.map(m),h)}c=u}return r.setMeta(Hat,{fixTables:!0})}function Oa(e){const t=e.selection,n=f5(e),r=n.node(-1),i=n.start(-1),o=rr.get(r);return{...t instanceof An?o.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):o.findCell(n.pos-i),tableStart:i,map:o,table:r}}function ste(e,{map:t,tableStart:n,table:r},i){let o=i>0?-1:0;Fat(t,r,i+o)&&(o=i==0||i==t.width?null:0);for(let s=0;s<t.height;s++){const a=s*t.width+i;if(i>0&&i<t.width&&t.map[a-1]==t.map[a]){const l=t.map[a],c=r.nodeAt(l);e.setNodeMarkup(e.mapping.map(n+l),null,rte(c.attrs,i-t.colCount(l))),s+=c.attrs.rowspan-1}else{const l=o==null?bi(r.type.schema).cell:r.nodeAt(t.map[a+o]).type,c=t.positionAt(s,i,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function Wat(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e);t(ste(e.tr,n,n.left))}return!0}function Gat(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e);t(ste(e.tr,n,n.right))}return!0}function Kat(e,{map:t,table:n,tableStart:r},i){const o=e.mapping.maps.length;for(let s=0;s<t.height;){const a=s*t.width+i,l=t.map[a],c=n.nodeAt(l),d=c.attrs;if(i>0&&t.map[a-1]==l||i<t.width-1&&t.map[a+1]==l)e.setNodeMarkup(e.mapping.slice(o).map(r+l),null,ap(d,i-t.colCount(l)));else{const u=e.mapping.slice(o).map(r+l);e.delete(u,u+c.nodeSize)}s+=d.rowspan}}function Yat(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let i=n.right-1;Kat(r,n,i),i!=n.left;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=rr.get(o)}t(r)}return!0}function Jat(e,t,n){var r;const i=bi(t.type.schema).header_cell;for(let o=0;o<e.width;o++)if(((r=t.nodeAt(e.map[o+n*e.width]))==null?void 0:r.type)!=i)return!1;return!0}function ate(e,{map:t,tableStart:n,table:r},i){var o;let s=n;for(let c=0;c<i;c++)s+=r.child(c).nodeSize;const a=[];let l=i>0?-1:0;Jat(t,r,i+l)&&(l=i==0||i==t.height?null:0);for(let c=0,d=t.width*i;c<t.width;c++,d++)if(i>0&&i<t.height&&t.map[d]==t.map[d-t.width]){const u=t.map[d],p=r.nodeAt(u).attrs;e.setNodeMarkup(n+u,null,{...p,rowspan:p.rowspan+1}),c+=p.colspan-1}else{const u=l==null?bi(r.type.schema).cell:(o=r.nodeAt(t.map[d+l*t.width]))==null?void 0:o.type,p=u==null?void 0:u.createAndFill();p&&a.push(p)}return e.insert(s,bi(r.type.schema).row.create(null,a)),e}function Zat(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e);t(ate(e.tr,n,n.top))}return!0}function Xat(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e);t(ate(e.tr,n,n.bottom))}return!0}function Qat(e,{map:t,table:n,tableStart:r},i){let o=0;for(let c=0;c<i;c++)o+=n.child(c).nodeSize;const s=o+n.child(i).nodeSize,a=e.mapping.maps.length;e.delete(o+r,s+r);const l=new Set;for(let c=0,d=i*t.width;c<t.width;c++,d++){const u=t.map[d];if(!l.has(u)){if(l.add(u),i>0&&u==t.map[d-t.width]){const p=n.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(a).map(u+r),null,{...p,rowspan:p.rowspan-1}),c+=p.colspan-1}else if(i<t.height&&u==t.map[d+t.width]){const p=n.nodeAt(u),f=p.attrs,h=p.type.create({...f,rowspan:p.attrs.rowspan-1},p.content),m=t.positionAt(i+1,c,n);e.insert(e.mapping.slice(a).map(r+m),h),c+=f.colspan-1}}}}function elt(e,t){if(!Ns(e))return!1;if(t){const n=Oa(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let i=n.bottom-1;Qat(r,n,i),i!=n.top;i--){const o=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!o)throw RangeError("No table found");n.table=o,n.map=rr.get(n.table)}t(r)}return!0}function lte(e){const t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function tlt({width:e,height:t,map:n},r){let i=r.top*e+r.left,o=i,s=(r.bottom-1)*e+r.left,a=i+(r.right-r.left-1);for(let l=r.top;l<r.bottom;l++){if(r.left>0&&n[o]==n[o-1]||r.right<e&&n[a]==n[a+1])return!0;o+=e,a+=e}for(let l=r.left;l<r.right;l++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[s]==n[s+e])return!0;i++,s++}return!1}function cte(e,t){const n=e.selection;if(!(n instanceof An)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Oa(e),{map:i}=r;if(tlt(i,r))return!1;if(t){const o=e.tr,s={};let a=Se.empty,l,c;for(let d=r.top;d<r.bottom;d++)for(let u=r.left;u<r.right;u++){const p=i.map[d*i.width+u],f=r.table.nodeAt(p);if(!(s[p]||!f))if(s[p]=!0,l==null)l=p,c=f;else{lte(f)||(a=a.append(f.content));const h=o.mapping.map(p+r.tableStart);o.delete(h,h+f.nodeSize)}}if(l==null||c==null)return!0;if(o.setNodeMarkup(l+r.tableStart,null,{...rte(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),a.size){const d=l+1+c.content.size,u=lte(c)?l+1:d;o.replaceWith(u+r.tableStart,d+r.tableStart,a)}o.setSelection(new An(o.doc.resolve(l+r.tableStart))),t(o)}return!0}function dte(e,t){const n=bi(e.schema);return nlt(({node:r})=>n[r.type.spec.tableRole])(e,t)}function nlt(e){return(t,n)=>{var r;const i=t.selection;let o,s;if(i instanceof An){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=Rat(i.$from),!o)return!1;s=(r=$f(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let a=o.attrs;const l=[],c=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});const d=Oa(t),u=t.tr;for(let f=0;f<d.right-d.left;f++)l.push(c?{...a,colwidth:c&&c[f]?[c[f]]:null}:a);let p;for(let f=d.top;f<d.bottom;f++){let h=d.map.positionAt(f,d.left,d.table);f==d.top&&(h+=o.nodeSize);for(let m=d.left,g=0;m<d.right;m++,g++)m==d.left&&f==d.top||u.insert(p=u.mapping.map(h+d.tableStart,1),e({node:o,row:f,col:m}).createAndFill(l[g]))}u.setNodeMarkup(s,e({node:o,row:d.top,col:d.left}),l[0]),i instanceof An&&u.setSelection(new An(u.doc.resolve(i.$anchorCell.pos),p?u.doc.resolve(p):void 0)),n(u)}return!0}}function rlt(e,t){return function(n,r){if(!Ns(n))return!1;const i=f5(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){const o=n.tr;n.selection instanceof An?n.selection.forEachCell((s,a)=>{s.attrs[e]!==t&&o.setNodeMarkup(a,null,{...s.attrs,[e]:t})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(o)}return!0}}function ilt(e){return function(t,n){if(!Ns(t))return!1;if(n){const r=bi(t.schema),i=Oa(t),o=t.tr,s=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),a=s.map(l=>i.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[l],r.cell,a[l].attrs);if(o.steps.length==0)for(let l=0;l<s.length;l++)o.setNodeMarkup(i.tableStart+s[l],r.header_cell,a[l].attrs);n(o)}return!0}}function ute(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let i=0;i<r.length;i++){const o=t.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function Qg(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?ilt(e):function(n,r){if(!Ns(n))return!1;if(r){const i=bi(n.schema),o=Oa(n),s=n.tr,a=ute("row",o,i),l=ute("column",o,i),d=(e==="column"?a:e==="row"?l:!1)?1:0,u=e=="column"?{left:0,top:d,right:1,bottom:o.map.height}:e=="row"?{left:d,top:0,right:o.map.width,bottom:1}:o,p=e=="column"?l?i.cell:i.header_cell:e=="row"?a?i.cell:i.header_cell:i.cell;o.map.cellsInRect(u).forEach(f=>{const h=f+o.tableStart,m=s.doc.nodeAt(h);m&&s.setNodeMarkup(h,p,m.attrs)}),r(s)}return!0}}Qg("row",{useDeprecatedLogic:!0}),Qg("column",{useDeprecatedLogic:!0});var olt=Qg("cell",{useDeprecatedLogic:!0});function slt(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let r=e.index(-1)-1,i=e.before();r>=0;r--){const o=e.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;const n=e.node(-1);for(let r=e.indexAfter(-1),i=e.after();r<n.childCount;r++){const o=n.child(r);if(o.childCount)return i+1;i+=o.nodeSize}}return null}function pte(e){return function(t,n){if(!Ns(t))return!1;const r=slt(f5(t),e);if(r==null)return!1;if(n){const i=t.doc.resolve(r);n(t.tr.setSelection(dt.between(i,Nat(i))).scrollIntoView())}return!0}}function alt(e,t){const n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function m5(e,t){const n=e.selection;if(!(n instanceof An))return!1;if(t){const r=e.tr,i=bi(e.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new We(i,0,0))}),r.docChanged&&t(r)}return!0}function llt(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole=="table");)n--,r--,t=t.child(0).content;const i=t.child(0),o=i.type.spec.tableRole,s=i.type.schema,a=[];if(o=="row")for(let l=0;l<t.childCount;l++){let c=t.child(l).content;const d=l?0:Math.max(0,n-1),u=l<t.childCount-1?0:Math.max(0,r-1);(d||u)&&(c=kA(bi(s).row,new We(c,d,u)).content),a.push(c)}else if(o=="cell"||o=="header_cell")a.push(n||r?kA(bi(s).row,new We(t,n,r)).content:t);else return null;return clt(s,a)}function clt(e,t){const n=[];for(let i=0;i<t.length;i++){const o=t[i];for(let s=o.childCount-1;s>=0;s--){const{rowspan:a,colspan:l}=o.child(s).attrs;for(let c=i;c<i+a;c++)n[c]=(n[c]||0)+l}}let r=0;for(let i=0;i<n.length;i++)r=Math.max(r,n[i]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(Se.empty),n[i]<r){const o=bi(e).cell.createAndFill(),s=[];for(let a=n[i];a<r;a++)s.push(o);t[i]=t[i].append(Se.from(s))}return{height:t.length,width:r,rows:t}}function kA(e,t){const n=e.createAndFill();return new QE(n).replace(0,n.content.size,t).doc}function dlt({width:e,height:t,rows:n},r,i){if(e!=r){const o=[],s=[];for(let a=0;a<n.length;a++){const l=n[a],c=[];for(let d=o[a]||0,u=0;d<r;u++){let p=l.child(u%l.childCount);d+p.attrs.colspan>r&&(p=p.type.createChecked(ap(p.attrs,p.attrs.colspan,d+p.attrs.colspan-r),p.content)),c.push(p),d+=p.attrs.colspan;for(let f=1;f<p.attrs.rowspan;f++)o[a+f]=(o[a+f]||0)+p.attrs.colspan}s.push(Se.from(c))}n=s,e=r}if(t!=i){const o=[];for(let s=0,a=0;s<i;s++,a++){const l=[],c=n[a%t];for(let d=0;d<c.childCount;d++){let u=c.child(d);s+u.attrs.rowspan>i&&(u=u.type.create({...u.attrs,rowspan:Math.max(1,i-u.attrs.rowspan)},u.content)),l.push(u)}o.push(Se.from(l))}n=o,t=i}return{width:e,height:t,rows:n}}function ult(e,t,n,r,i,o,s){const a=e.doc.type.schema,l=bi(a);let c,d;if(i>t.width)for(let u=0,p=0;u<t.height;u++){const f=n.child(u);p+=f.nodeSize;const h=[];let m;f.lastChild==null||f.lastChild.type==l.cell?m=c||(c=l.cell.createAndFill()):m=d||(d=l.header_cell.createAndFill());for(let g=t.width;g<i;g++)h.push(m);e.insert(e.mapping.slice(s).map(p-1+r),h)}if(o>t.height){const u=[];for(let h=0,m=(t.height-1)*t.width;h<Math.max(t.width,i);h++){const g=h>=t.width?!1:n.nodeAt(t.map[m+h]).type==l.header_cell;u.push(g?d||(d=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}const p=l.row.create(null,Se.from(u)),f=[];for(let h=t.height;h<o;h++)f.push(p);e.insert(e.mapping.slice(s).map(r+n.nodeSize-2),f)}return!!(c||d)}function hte(e,t,n,r,i,o,s,a){if(s==0||s==t.height)return!1;let l=!1;for(let c=i;c<o;c++){const d=s*t.width+c,u=t.map[d];if(t.map[d-t.width]==u){l=!0;const p=n.nodeAt(u),{top:f,left:h}=t.findCell(u);e.setNodeMarkup(e.mapping.slice(a).map(u+r),null,{...p.attrs,rowspan:s-f}),e.insert(e.mapping.slice(a).map(t.positionAt(s,h,n)),p.type.createAndFill({...p.attrs,rowspan:f+p.attrs.rowspan-s})),c+=p.attrs.colspan-1}}return l}function fte(e,t,n,r,i,o,s,a){if(s==0||s==t.width)return!1;let l=!1;for(let c=i;c<o;c++){const d=c*t.width+s,u=t.map[d];if(t.map[d-1]==u){l=!0;const p=n.nodeAt(u),f=t.colCount(u),h=e.mapping.slice(a).map(u+r);e.setNodeMarkup(h,null,ap(p.attrs,s-f,p.attrs.colspan-(s-f))),e.insert(h+p.nodeSize,p.type.createAndFill(ap(p.attrs,0,s-f))),c+=p.attrs.rowspan-1}}return l}function mte(e,t,n,r,i){let o=n?e.doc.nodeAt(n-1):e.doc;if(!o)throw new Error("No table found");let s=rr.get(o);const{top:a,left:l}=r,c=l+i.width,d=a+i.height,u=e.tr;let p=0;function f(){if(o=n?u.doc.nodeAt(n-1):u.doc,!o)throw new Error("No table found");s=rr.get(o),p=u.mapping.maps.length}ult(u,s,o,n,c,d,p)&&f(),hte(u,s,o,n,l,c,a,p)&&f(),hte(u,s,o,n,l,c,d,p)&&f(),fte(u,s,o,n,a,d,l,p)&&f(),fte(u,s,o,n,a,d,c,p)&&f();for(let h=a;h<d;h++){const m=s.positionAt(h,l,o),g=s.positionAt(h,c,o);u.replace(u.mapping.slice(p).map(m+n),u.mapping.slice(p).map(g+n),new We(i.rows[h-a],0,0))}f(),u.setSelection(new An(u.doc.resolve(n+s.positionAt(a,l,o)),u.doc.resolve(n+s.positionAt(d-1,c-1,o)))),t(u)}var plt=M9({ArrowLeft:y5("horiz",-1),ArrowRight:y5("horiz",1),ArrowUp:y5("vert",-1),ArrowDown:y5("vert",1),"Shift-ArrowLeft":v5("horiz",-1),"Shift-ArrowRight":v5("horiz",1),"Shift-ArrowUp":v5("vert",-1),"Shift-ArrowDown":v5("vert",1),Backspace:m5,"Mod-Backspace":m5,Delete:m5,"Mod-Delete":m5});function g5(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function y5(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;if(o instanceof An)return g5(n,r,mt.near(o.$headCell,t));if(e!="horiz"&&!o.empty)return!1;const s=gte(i,e,t);if(s==null)return!1;if(e=="horiz")return g5(n,r,mt.near(n.doc.resolve(o.head+t),t));{const a=n.doc.resolve(s),l=nte(a,e,t);let c;return l?c=mt.near(l,1):t<0?c=mt.near(n.doc.resolve(a.before(-1)),-1):c=mt.near(n.doc.resolve(a.after(-1)),1),g5(n,r,c)}}}function v5(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof An)s=o;else{const l=gte(i,e,t);if(l==null)return!1;s=new An(n.doc.resolve(l))}const a=nte(s.$headCell,e,t);return a?g5(n,r,new An(s.$anchorCell,a)):!1}}function hlt(e,t){const n=e.state.doc,r=$f(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new An(r))),!0):!1}function flt(e,t,n){if(!Ns(e.state))return!1;let r=llt(n);const i=e.state.selection;if(i instanceof An){r||(r={width:1,height:1,rows:[Se.from(kA(bi(e.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),a=rr.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=dlt(r,a.right-a.left,a.bottom-a.top),mte(e.state,e.dispatch,s,a,r),!0}else if(r){const o=f5(e.state),s=o.start(-1);return mte(e.state,e.dispatch,s,rr.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function mlt(e,t){var n;if(t.ctrlKey||t.metaKey)return;const r=yte(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof An)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&(i=$f(e.state.selection.$anchor))!=null&&((n=_A(e,t))==null?void 0:n.pos)!=i.pos)o(i,t),t.preventDefault();else if(!r)return;function o(l,c){let d=_A(e,c);const u=kd.getState(e.state)==null;if(!d||!wA(l,d))if(u)d=l;else return;const p=new An(l,d);if(u||!e.state.selection.eq(p)){const f=e.state.tr.setSelection(p);u&&f.setMeta(kd,l.pos),e.dispatch(f)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",a),kd.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(kd,-1))}function a(l){const c=l,d=kd.getState(e.state);let u;if(d!=null)u=e.state.doc.resolve(d);else if(yte(e,c.target)!=r&&(u=_A(e,t),!u))return s();u&&o(u,c)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",a)}function gte(e,t,n){if(!(e.state.selection instanceof dt))return null;const{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const a=r.before(i),l=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(l)?a:null}}return null}function yte(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function _A(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?$f(e.state.doc.resolve(n.pos)):null}var glt=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),xA(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,xA(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function xA(e,t,n,r,i,o){var s;let a=0,l=!0,c=t.firstChild;const d=e.firstChild;if(d){for(let u=0,p=0;u<d.childCount;u++){const{colspan:f,colwidth:h}=d.child(u).attrs;for(let m=0;m<f;m++,p++){const g=i==p?o:h&&h[m],y=g?g+"px":"";if(a+=g||r,g||(l=!1),c)c.style.width!=y&&(c.style.width=y),c=c.nextSibling;else{const w=document.createElement("col");w.style.width=y,t.appendChild(w)}}}for(;c;){const u=c.nextSibling;(s=c.parentNode)==null||s.removeChild(c),c=u}l?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}}var To=new Zn("tableColumnResizing");function ylt({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=glt,lastColumnResizable:i=!0}={}){const o=new In({key:To,state:{init(s,a){var l,c;const d=(c=(l=o.spec)==null?void 0:l.props)==null?void 0:c.nodeViews,u=bi(a.schema).table.name;return r&&d&&(d[u]=(p,f)=>new r(p,n,f)),new vlt(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{const a=To.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{blt(s,a,e,i)},mouseleave:s=>{wlt(s)},mousedown:(s,a)=>{klt(s,a,t,n)}},decorations:s=>{const a=To.getState(s);if(a&&a.activeHandle>-1)return Slt(s,a.activeHandle)},nodeViews:{}}});return o}var vlt=class C4{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,r=t.getMeta(To);if(r&&r.setHandle!=null)return new C4(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new C4(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return bA(t.doc.resolve(i))||(i=-1),new C4(i,n.dragging)}return n}};function blt(e,t,n,r){const i=To.getState(e.state);if(i&&!i.dragging){const o=xlt(t.target);let s=-1;if(o){const{left:a,right:l}=o.getBoundingClientRect();t.clientX-a<=n?s=vte(e,t,"left",n):l-t.clientX<=n&&(s=vte(e,t,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){const a=e.state.doc.resolve(s),l=a.node(-1),c=rr.get(l),d=a.start(-1);if(c.colCount(a.pos-d)+a.nodeAfter.attrs.colspan-1==c.width-1)return}wte(e,s)}}}function wlt(e){const t=To.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&wte(e,-1)}function klt(e,t,n,r){var i;const o=(i=e.dom.ownerDocument.defaultView)!=null?i:window,s=To.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const a=e.state.doc.nodeAt(s.activeHandle),l=_lt(e,s.activeHandle,a.attrs);e.dispatch(e.state.tr.setMeta(To,{setDragging:{startX:t.clientX,startWidth:l}}));function c(u){o.removeEventListener("mouseup",c),o.removeEventListener("mousemove",d);const p=To.getState(e.state);p!=null&&p.dragging&&(Clt(e,p.activeHandle,bte(p.dragging,u,n)),e.dispatch(e.state.tr.setMeta(To,{setDragging:null})))}function d(u){if(!u.which)return c(u);const p=To.getState(e.state);if(p&&p.dragging){const f=bte(p.dragging,u,n);kte(e,p.activeHandle,f,r)}}return kte(e,s.activeHandle,l,r),o.addEventListener("mouseup",c),o.addEventListener("mousemove",d),t.preventDefault(),!0}function _lt(e,t,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=e.domAtPos(t);let a=o.node.childNodes[o.offset].offsetWidth,l=n;if(r)for(let c=0;c<n;c++)r[c]&&(a-=r[c],l--);return a/l}function xlt(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function vte(e,t,n,r){const i=n=="right"?-r:r,o=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!o)return-1;const{pos:s}=o,a=$f(e.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;const l=rr.get(a.node(-1)),c=a.start(-1),d=l.map.indexOf(a.pos-c);return d%l.width==0?-1:c+l.map[d-1]}function bte(e,t,n){const r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function wte(e,t){e.dispatch(e.state.tr.setMeta(To,{setHandle:t}))}function Clt(e,t,n){const r=e.state.doc.resolve(t),i=r.node(-1),o=rr.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let c=0;c<o.height;c++){const d=c*o.width+a;if(c&&o.map[d]==o.map[d-o.width])continue;const u=o.map[d],p=i.nodeAt(u).attrs,f=p.colspan==1?0:a-o.colCount(u);if(p.colwidth&&p.colwidth[f]==n)continue;const h=p.colwidth?p.colwidth.slice():Tlt(p.colspan);h[f]=n,l.setNodeMarkup(s+u,null,{...p,colwidth:h})}l.docChanged&&e.dispatch(l)}function kte(e,t,n,r){const i=e.state.doc.resolve(t),o=i.node(-1),s=i.start(-1),a=rr.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1;let l=e.domAtPos(i.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&xA(o,l.firstChild,l,r,a,n)}function Tlt(e){return Array(e).fill(0)}function Slt(e,t){var n;const r=[],i=e.doc.resolve(t),o=i.node(-1);if(!o)return Un.empty;const s=rr.get(o),a=i.start(-1),l=s.colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1;for(let c=0;c<s.height;c++){const d=l+c*s.width;if((l==s.width-1||s.map[d]!=s.map[d+1])&&(c==0||s.map[d]!=s.map[d-s.width])){const u=s.map[d],p=a+u+o.nodeAt(u).nodeSize-1,f=document.createElement("div");f.className="column-resize-handle",(n=To.getState(e))!=null&&n.dragging&&r.push(Xr.node(a+u,a+u+o.nodeAt(u).nodeSize,{class:"column-resize-dragging"})),r.push(Xr.widget(p,f))}}return Un.create(e.doc,r)}function Elt({allowTableNodeSelection:e=!1}={}){return new In({key:kd,state:{init(){return null},apply(t,n){const r=t.getMeta(kd);if(r!=null)return r==-1?null:r;if(n==null||!t.docChanged)return n;const{deleted:i,pos:o}=t.mapping.mapResult(n);return i?null:o}},props:{decorations:Bat,handleDOMEvents:{mousedown:mlt},createSelectionBetween(t){return kd.getState(t.state)!=null?t.state.selection:null},handleTripleClick:hlt,handleKeyDown:plt,handlePaste:flt},appendTransaction(t,n,r){return jat(r,ote(r,n),e)}})}function CA(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function _te(e,t,n,r,i,o){var s;let a=0,l=!0,c=t.firstChild;const d=e.firstChild;if(d!==null)for(let u=0,p=0;u<d.childCount;u+=1){const{colspan:f,colwidth:h}=d.child(u).attrs;for(let m=0;m<f;m+=1,p+=1){const g=i===p?o:h&&h[m],y=g?`${g}px`:"";if(a+=g||r,g||(l=!1),c){if(c.style.width!==y){const[w,k]=CA(r,g);c.style.setProperty(w,k)}c=c.nextSibling}else{const w=document.createElement("col"),[k,_]=CA(r,g);w.style.setProperty(k,_),t.appendChild(w)}}}for(;c;){const u=c.nextSibling;(s=c.parentNode)===null||s===void 0||s.removeChild(c),c=u}l?(n.style.width=`${a}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${a}px`)}let Alt=class{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),_te(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,_te(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}};function Mlt(e,t,n,r){let i=0,o=!0;const s=[],a=e.firstChild;if(!a)return{};for(let u=0,p=0;u<a.childCount;u+=1){const{colspan:f,colwidth:h}=a.child(u).attrs;for(let m=0;m<f;m+=1,p+=1){const g=n===p?r:h&&h[m];i+=g||t,g||(o=!1);const[y,w]=CA(t,g);s.push(["col",{style:`${y}: ${w}`}])}}const l=o?`${i}px`:"",c=o?"":`${i}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:c}}function xte(e,t){return e.createAndFill()}function Olt(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function Dlt(e,t,n,r,i){const o=Olt(e),s=[],a=[];for(let c=0;c<n;c+=1){const d=xte(o.cell);if(d&&a.push(d),r){const u=xte(o.header_cell);u&&s.push(u)}}const l=[];for(let c=0;c<t;c+=1)l.push(o.row.createChecked(null,r&&c===0?s:a));return o.table.createChecked(null,l)}function Plt(e){return e instanceof An}const b5=({editor:e})=>{const{selection:t}=e.state;if(!Plt(t))return!1;let n=0;const r=gee(t.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},Ilt=ei.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:Alt,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=Mlt(e,this.options.cellMinWidth);return["table",_n(this.options.HTMLAttributes,t,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{const s=Dlt(o.schema,e,t,n);if(i){const a=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(dt.near(r.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Wat(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Gat(e,t),deleteColumn:()=>({state:e,dispatch:t})=>Yat(e,t),addRowBefore:()=>({state:e,dispatch:t})=>Zat(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Xat(e,t),deleteRow:()=>({state:e,dispatch:t})=>elt(e,t),deleteTable:()=>({state:e,dispatch:t})=>alt(e,t),mergeCells:()=>({state:e,dispatch:t})=>cte(e,t),splitCell:()=>({state:e,dispatch:t})=>dte(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Qg("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Qg("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>olt(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>cte(e,t)?!0:dte(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>rlt(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>pte(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>pte(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&ote(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const r=An.create(t.doc,e.anchorCell,e.headCell);t.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:b5,"Mod-Backspace":b5,Delete:b5,"Mod-Delete":b5}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[ylt({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Elt({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Nt(nt(e,"tableRole",t))}}});function TA(e,t,n,r,i,o){let s=0,a=!0,l=t.firstChild;const c=e.firstChild;for(let d=0,u=0;d<c.childCount;d+=1){const{colspan:p,colwidth:f}=c.child(d).attrs;for(let h=0;h<p;h+=1,u+=1){const m=i===u?o:f&&f[h],g=m?`${m}px`:"";s+=m||r,m||(a=!1),l?(l.style.width!==g&&(l.style.width=g),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=g}}for(;l;){const d=l.nextSibling;l.parentNode.removeChild(l),l=d}a?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`),n.style.setProperty("--borderWidth",e.attrs.borderWidth),n.style.setProperty("--borderColor",e.attrs.borderColor),n.style.setProperty("--cellPadding",e.attrs.cellPadding),n.style.setProperty("--headerBackground",e.attrs.headerBackground)}class w5{constructor(t,n){this.node=t,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",Object.keys(this.node.attrs).forEach(r=>{this.dom.dataset[r]=this.node.attrs[r]}),this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),TA(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!==this.node.type?!1:(this.node=t,TA(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return t.type==="attributes"&&(t.target===this.table||this.colgroup.contains(t.target))}}const SA=Ilt.extend({addAttributes(){return{...this.parent?this.parent():null,borderColor:{default:"#dedee3",parseHTML:e=>e.getAttribute("data-border-color"),renderHTML:e=>({"data-border-color":e.borderColor})},borderWidth:{default:"1px",parseHTML:e=>e.getAttribute("data-border-width"),renderHTML:e=>({"data-border-width":e.borderWidth})},cellPadding:{default:"5px",parseHTML:e=>e.getAttribute("data-cell-padding"),renderHTML:e=>({"data-cell-padding":e.cellPadding})},headerBackground:{default:"#eeeef1",parseHTML:e=>e.getAttribute("data-header-background"),renderHTML:e=>({"data-header-background":e.headerBackground})}}}}),Cte=SA.extend({addNodeView(){return({node:e})=>{const t=document.createElement("div");t.className="tableWrapper";const n=t.appendChild(document.createElement("table")),r=n.appendChild(document.createElement("colgroup"));TA(e,r,n);const i=n.appendChild(document.createElement("tbody"));return{dom:t,contentDOM:i}}},addProseMirrorPlugins(){return[]}}),$lt=SA.configure({resizable:!0,View:w5}),Rlt=Cte.configure({resizable:!0,View:w5});SA.configure({resizable:!0,View:w5}),Cte.configure({resizable:!0,View:w5});function Tte({types:e,node:t}){return Array.isArray(e)&&e.includes(t.type)||t.type===e}const Llt=_r.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:["paragraph","heading"]}},addProseMirrorPlugins(){const e=new Zn(this.name),t=Object.entries(this.editor.schema.nodes).map(([,n])=>n).filter(n=>this.options.notAfter.includes(n.name));return[new In({key:e,appendTransaction:(n,r,i)=>{const{doc:o,tr:s,schema:a}=i,l=e.getState(i),c=o.content.size,d=a.nodes[this.options.node];if(l)return s.insert(c,d.create())},state:{init:(n,r)=>{var o;const i=r.tr.doc.lastChild;return((o=this.editor)==null?void 0:o.isEditable)&&!Tte({node:i,types:t})},apply:(n,r)=>{if(!n.docChanged)return r;const i=n.doc.lastChild;return!Tte({node:i,types:t})}}})]}}),Ste=async e=>{const t=new FormData;t.append("file",e,e.name);const{data:n}=await nn("/file",t,{timeout:6e4}),{url:r,hash:i,algorithm:o}=n;return{url:r,hash:i,algorithm:o}},Nlt=Fee.extend({addAttributes(){return{...this.parent?this.parent():null,typography:{default:null,parseHTML:e=>e.getAttribute("data-typography"),renderHTML:e=>({"data-typography":e.typography})}}},addCommands(){return{setParagraph:(e={})=>({commands:t})=>t.setNode("paragraph",e)}}}),Flt={name:"TextEditor",i18nOptions:{namespaces:"TextEditor",messages:{en:{placeholder:"Type something"},sv:{placeholder:"Skriv något"}}},components:{EditorContent:Est,BubbleMenu:tat,EditorFixedMenu:aat},inject:{compressImages:{default:!1}},props:{modelValue:{type:String,default:""},triggerUpdate:{type:Boolean,default:!1},placeholder:{type:String,default:""},editable:{type:Boolean,default:!0},disabled:{type:Boolean,default:void 0},extensions:{type:[Object,String],default:()=>({})},mentions:{type:Function,default:null},snippets:{type:Boolean,default:!1},classList:{type:String,default:""},size:{type:String,default:null},unstyled:{type:Boolean,default:!1},textareaStyle:{type:Boolean,default:!1},filled:{type:Boolean,default:!1},static:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur"],data(){return{editor:null,isFocused:!1,isHover:!1,uidClass:`uid-${this.$.uid}`}},computed:{enabledExtensions(){const e={bulletList:!0,heading:[1,2,3],bold:!0,link:!0,underline:!0,textAlign:!0,color:!0,table:!0,image:!1,highlight:!1,blockquote:!1,...this.extensions,...typeof this.mentions=="function"&&{mentions:this.mentions},snippets:this.snippets};return this.extensions==="all"&&(e.image=!0,e.highlight=!0,e.blockquote=!0),e}},watch:{modelValue(e){!this.editor||this.editor.getHTML()===e||this.editor.commands.setContent(e,!1)},editable(e){this.setEditable(e)}},created(){window.initalizedEditorTooltips||(this.createGeneralTooltip(),window.initalizedEditorTooltips=!0)},mounted(){this.init(),this.$nextTick(()=>this.createTooltips())},beforeUnmount(){this.editor&&this.editor.destroy(),this.destroyDynamicTooltips()},methods:{init(){const{bulletList:e,blockquote:t,heading:n,image:r,mentions:i,bold:o,highlight:s,italic:a,link:l,underline:c,color:d,textAlign:u,table:p}=this.enabledExtensions,f=[bot.configure({emptyEditorClass:"is-empty",placeholder:this.placeholder||this.$t("placeholder"),showOnlyWhenEditable:!0}),xst.configure({blockquote:t,bulletList:e,...n&&{heading:{levels:n}},bold:o,italic:a,strike:!0,code:!0,codeBlock:!0,paragraph:!1}),Nlt,Llt];l&&f.push(vot),d&&f.push(Hit,qit),s&&f.push(Kit),c&&f.push(Cot),u&&f.push(xot.configure({types:["paragraph","heading","list_item","todo_item","title"],defaultAlignment:""})),p&&f.push(this.editable?$lt:Rlt,_ot,wot,kot),r&&f.push(Oat(Ste,this.compressImages)),i&&f.push(kat.call(this,i)),this.editor=new Sst({injectCSS:!1,editable:this.editable,content:this.modelValue||"",extensions:f,onFocus:({event:h})=>{this.isFocused=!0,this.$emit("focus",h)},onBlur:({editor:h,event:m})=>{this.isFocused=!1,this.$emit("update:modelValue",h.isEmpty?"":h.getHTML()),this.$emit("blur",m)},...this.triggerUpdate&&{onUpdate:({editor:h})=>{this.$emit("update:modelValue",h.isEmpty?"":h.getHTML())}}})},setContent(e){this.editor.commands.setContent((this.modelValue||"")+e,!0)},setEditable(e){if(typeof e!="boolean")throw Error("Invalid param editable");this.editor&&this.editor.setOptions({editable:e})},focus(){return this.setFocus()},setFocus(){this.editor&&this.editor.isEditable&&this.editor.commands.focus("end")},async onUploadImage({file:e}){const t=e.target.files[0],{url:n,hash:r,algorithm:i}=await Ste(t);this.editor&&this.editor.chain().focus().setImage({src:n,hash:r,algorithm:i}).run()},createTooltips(){var i;const{el:e,isShadow:t}=Ky((i=this.$root)==null?void 0:i.$el),n=t?e:e.body,r=t?this.$el:`.${this.uidClass}`;this.dynamicTooltips=jS(r,{target:"span[data-tooltip]",appendTo:n,content(o){return`
1755
1755
  <div class="tooltip">
1756
1756
  <div class="tooltip-inner">
1757
1757
  ${o.getAttribute("data-tooltip")}