@compdfkit_pdf_sdk/webviewer 2.9.0 → 2.9.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.
- package/README.md +142 -47
- package/dist/assets/CloseA-CEkvif0J.js +1 -0
- package/dist/assets/CustomModal--dtM3B7m.js +1 -0
- package/dist/assets/CustomModal-CgnZ25pO.css +1 -0
- package/dist/assets/RightPanelPageMode-DTB63PR7.css +1 -0
- package/dist/assets/RightPanelPageMode-tZ9uq8fS.js +1 -0
- package/dist/assets/StampPanel-B65elhuy.css +1 -0
- package/dist/assets/StampPanel-Dtg2zCwL.js +1 -0
- package/dist/assets/browser-ponyfill-hivVjbQ8.js +2 -0
- package/dist/assets/chunk-62oNxeRG.js +1 -0
- package/dist/assets/index-BWvsaYab.js +2508 -0
- package/dist/assets/index-D01qv-cy.css +1 -0
- package/dist/assets/viewer-Bx-vwNpl.js +178 -0
- package/dist/example/Quick Start Guide for ComPDFKit Web Demo.pdf +0 -0
- package/dist/index.html +5 -3
- package/dist/lib/ComPDFKit.js +1 -1
- package/dist/lib/ComPDFKit.wasm +0 -0
- package/dist/lib/PDFWorker.js +1 -1
- package/dist/locales/translation-en.json +10 -1
- package/dist/locales/translation-fr.json +10 -1
- package/dist/locales/translation-ja.json +10 -1
- package/dist/locales/translation-th.json +10 -1
- package/dist/locales/translation-zh-CN.json +10 -1
- package/dist/locales/translation-zh-TW.json +10 -1
- package/package.json +2 -2
- package/webviewer.global.js +1 -1
- package/webviewer.js +1 -1
- package/dist/assets/CustomModal.532fffc2.css +0 -1
- package/dist/assets/CustomModal.912aae28.js +0 -1
- package/dist/assets/RightPanelPageMode.146ec16a.js +0 -1
- package/dist/assets/RightPanelPageMode.16c777c6.css +0 -1
- package/dist/assets/StampPanel.3fa2ea7e.js +0 -1
- package/dist/assets/StampPanel.b042b07b.css +0 -1
- package/dist/assets/browser-ponyfill.5885ccb5.js +0 -2
- package/dist/assets/icon-danger.e75f0c25.svg +0 -4
- package/dist/assets/icon-message-error.c91684dd.svg +0 -7
- package/dist/assets/icon-message-success.c9ccee05.svg +0 -6
- package/dist/assets/index.10f4c475.js +0 -2716
- package/dist/assets/index.ba0177ff.css +0 -1
- package/dist/example/developer_guide_web.pdf +0 -0
- /package/dist/assets/{colorful.c840ddf1.svg → colorful-DLWKobGf.svg} +0 -0
package/README.md
CHANGED
|
@@ -1,78 +1,173 @@
|
|
|
1
|
-
#
|
|
1
|
+
# PDF SDK for Web | View, Annotate, Edit & Render PDFs in the Browser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ComPDF WebViewer is a JavaScript PDF SDK for **Web** apps that need PDF viewing, annotation, editing, forms, signatures, comparison, and security directly in the browser. For teams building broader **document workflow** products, ComPDF also works with ComPDF API for **Convert**, **OCR**, and **Generate** workflows.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
[ComPDFKit for Web](https://www.compdf.com/web) is a powerful JavaScript-based PDF Library that's part of the [ComPDFKit PDF SDK](https://www.compdf.com). It provides a slick out-of-the-box responsive UI that interacts with the core library to view, annotate and manipulate PDFs that can be embedded into any web project.
|
|
5
|
+
## 🚀 Why ComPDF
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
ComPDF is a practical choice for web teams that need more than a low-level PDF renderer but do not want to build a full document UI stack from scratch.
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
- Go to [ComPDFKit's Web Demo](https://www.compdf.com/webviewer/demo) to experience how our WebViewer performs.
|
|
12
|
-
- Integrate ComPDFKit Web SDK into [Salesforce](https://www.compdf.com/pdf-sdk/salesforce), [SharePoint](https://www.compdf.com/pdf-sdk/sharepoint), [Microsoft Teams](https://www.compdf.com/contact-sales), etc.
|
|
9
|
+
Why developers use it:
|
|
13
10
|
|
|
14
|
-
-
|
|
11
|
+
- **Browser rendering:** render PDFs directly in the browser with a ready-to-use UI.
|
|
12
|
+
- **No backend required for standalone mode:** deploy with WebAssembly and keep rendering client-side.
|
|
13
|
+
- **SaaS-friendly integration:** embed document workflows inside portals, dashboards, CRMs, and customer-facing apps.
|
|
14
|
+
- **Framework support:** use it with React, Angular, Vue, Next.js, Nuxt.js, and more.
|
|
15
|
+
- **Commercial flexibility:** standalone and server-backed deployment options for different product needs.
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
## 🎬 Live Demo
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
Try ComPDF in action:
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
- Web Demo: [https://www.compdf.com/demo/webviewer](https://www.compdf.com/demo/webviewer)
|
|
22
|
+
- Sample Project (React): [https://github.com/ComPDF/compdfkit-web-example-react](https://github.com/ComPDFKit/compdfkit-web-example-react)
|
|
23
|
+
- Sample Project (Vanilla JS): [https://github.com/ComPDFKit/compdfkit-web-example-vanilla-javascript](https://github.com/ComPDFKit/compdfkit-web-example-vanilla-javascript)
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
## ⚡ Quick Start
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
> Requirements: Node.js latest stable, npm-compatible package manager, and a valid ComPDF web license.
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
### 1. Install
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm install @compdfkit_pdf_sdk/webviewer
|
|
28
33
|
```
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
### 2. Copy the WebViewer assets
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
```bash
|
|
38
|
+
cp -r ./node_modules/@compdfkit_pdf_sdk/webviewer/dist ./public/webviewer
|
|
39
|
+
```
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
### 3. Initialize the viewer
|
|
35
42
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
```js
|
|
44
|
+
import WebViewer from '@compdfkit_pdf_sdk/webviewer';
|
|
45
|
+
|
|
46
|
+
const viewer = document.getElementById('viewer');
|
|
47
|
+
|
|
48
|
+
WebViewer.init(
|
|
49
|
+
{
|
|
50
|
+
path: '/webviewer',
|
|
51
|
+
pdfUrl: '/webviewer/example/developer_guide_web.pdf',
|
|
52
|
+
license: '<Input your license here>',
|
|
53
|
+
},
|
|
54
|
+
viewer,
|
|
55
|
+
).then((instance) => {
|
|
56
|
+
const docViewer = instance.docViewer;
|
|
57
|
+
|
|
58
|
+
docViewer.addEvent('documentloaded', () => {
|
|
59
|
+
console.log('document loaded');
|
|
60
|
+
});
|
|
61
|
+
});
|
|
39
62
|
```
|
|
40
63
|
|
|
41
|
-
|
|
64
|
+
> Standalone deployment runs in the browser, so no backend is required for rendering PDFs.
|
|
65
|
+
|
|
66
|
+
## 🧩 Key Features
|
|
67
|
+
|
|
68
|
+
- 🌐 **Browser PDF Rendering**
|
|
69
|
+
Render PDFs with smooth navigation, thumbnails, and a ready-made document UI.
|
|
70
|
+
👉 Use case: SaaS dashboards, customer portals, embedded viewers
|
|
71
|
+
|
|
72
|
+
- ✍️ **Annotations, Forms & Signatures**
|
|
73
|
+
Review, mark up, fill, and sign documents inside the browser.
|
|
74
|
+
👉 Use case: contract workflows, onboarding, collaboration
|
|
75
|
+
|
|
76
|
+
- 🛠️ **Editing & Document Operations**
|
|
77
|
+
Support content editing, page workflows, and document manipulation in web apps.
|
|
78
|
+
👉 Use case: online PDF editors, review platforms, content operations tools
|
|
79
|
+
|
|
80
|
+
- 🔐 **Security & Comparison**
|
|
81
|
+
Add secure document handling and compare PDFs in browser-based workflows.
|
|
82
|
+
👉 Use case: legal review, approval systems, quality control
|
|
83
|
+
|
|
84
|
+
- 🧱 **Framework-Friendly Integration**
|
|
85
|
+
Use one PDF layer across React, Angular, Vue, Next.js, and other frontend stacks.
|
|
86
|
+
👉 Use case: multi-team SaaS platforms and reusable frontend infrastructure
|
|
87
|
+
|
|
88
|
+
- 🔄 **Convert / OCR / Generate via ComPDF API**
|
|
89
|
+
Combine WebViewer with backend document processing when your product needs more than in-browser interaction.
|
|
90
|
+
👉 Use case: invoice extraction, document generation, server-side automation
|
|
91
|
+
|
|
92
|
+
## 💡 Use Cases
|
|
93
|
+
|
|
94
|
+
- **Document Management Systems** with browser-based viewing and review
|
|
95
|
+
- **PDF Editors** embedded in SaaS products
|
|
96
|
+
- **Customer Portals** for form filling, signatures, and secure document exchange
|
|
97
|
+
- **Invoice Processing** UIs that preview files in browser before OCR/extraction workflows
|
|
98
|
+
- **No-Backend Viewer Scenarios** where client-side rendering simplifies deployment
|
|
99
|
+
|
|
100
|
+
## 🧪 Code Snippets
|
|
101
|
+
|
|
102
|
+
### Vanilla JavaScript example
|
|
42
103
|
|
|
43
104
|
```js
|
|
44
|
-
import WebViewer from '@compdfkit_pdf_sdk/webviewer'
|
|
105
|
+
import WebViewer from '@compdfkit_pdf_sdk/webviewer';
|
|
45
106
|
|
|
46
107
|
const element = document.getElementById('viewer');
|
|
47
108
|
|
|
48
|
-
WebViewer.init(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
109
|
+
WebViewer.init(
|
|
110
|
+
{
|
|
111
|
+
path: '/webviewer',
|
|
112
|
+
pdfUrl: '/webviewer/example/developer_guide_web.pdf',
|
|
113
|
+
license: '<Input your license here>',
|
|
114
|
+
},
|
|
115
|
+
element,
|
|
116
|
+
).then((instance) => {
|
|
117
|
+
const docViewer = instance.docViewer;
|
|
118
|
+
|
|
119
|
+
docViewer.addEvent('documentloaded', () => {
|
|
120
|
+
console.log('ComPDF WebViewer loaded');
|
|
121
|
+
});
|
|
122
|
+
});
|
|
55
123
|
```
|
|
56
124
|
|
|
57
|
-
|
|
58
|
-
Contact [ComPDFKit's sales team](https://www.compdf.com/contact-sales) to get a free 30-day license to test the project.
|
|
59
|
-
|
|
60
|
-
## Documentation
|
|
61
|
-
[Full documentation for ComPDFKit for Web](https://www.compdf.com/guides/pdf-sdk/web/overview) can be found here.
|
|
62
|
-
|
|
63
|
-
## License
|
|
64
|
-
ComPDFKit for Web supports flexible licensing options, please contact [our sales team](mailto:support@compdf.com) to know more. Each license is only valid for a root domain name and any of its subdomains. However, any documents, sample code, or source code distribution from the released package of ComPDFKit PDF SDK to any third party is prohibited.
|
|
125
|
+
### React example
|
|
65
126
|
|
|
66
|
-
|
|
67
|
-
|
|
127
|
+
```js
|
|
128
|
+
import { useEffect, useRef } from 'react';
|
|
129
|
+
import ComPDFKitViewer from '@compdfkit_pdf_sdk/webviewer';
|
|
130
|
+
|
|
131
|
+
export default function WebViewerContainer() {
|
|
132
|
+
const containerRef = useRef(null);
|
|
133
|
+
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
ComPDFKitViewer.init(
|
|
136
|
+
{
|
|
137
|
+
path: '/',
|
|
138
|
+
pdfUrl: './example/developer_guide_web.pdf',
|
|
139
|
+
license: '<Input your license here>',
|
|
140
|
+
},
|
|
141
|
+
containerRef.current,
|
|
142
|
+
).then((core) => {
|
|
143
|
+
const docViewer = core.docViewer;
|
|
144
|
+
|
|
145
|
+
docViewer.addEvent('documentloaded', async () => {
|
|
146
|
+
console.log('document loaded');
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
}, []);
|
|
150
|
+
|
|
151
|
+
return (
|
|
152
|
+
<div
|
|
153
|
+
ref={containerRef}
|
|
154
|
+
style={{ width: '100%', height: '100vh', overflow: 'hidden' }}
|
|
155
|
+
/>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
```
|
|
68
159
|
|
|
69
|
-
|
|
160
|
+
## 🔗 Documentation & Resources
|
|
70
161
|
|
|
71
|
-
|
|
162
|
+
| Resource | Link |
|
|
163
|
+
| --- | --- |
|
|
164
|
+
| Official Docs | [https://www.compdf.com/guides/pdf-sdk/web/overview](https://www.compdf.com/guides/pdf-sdk/web/overview) |
|
|
165
|
+
| Viewer Guide | [https://www.compdf.com/guides/pdf-sdk/web/viewer](https://www.compdf.com/guides/pdf-sdk/web/viewer) |
|
|
166
|
+
| GitHub Examples | [https://github.com/ComPDFKit/compdfkit-web-example-react](https://github.com/ComPDFKit/compdfkit-web-example-react) |
|
|
167
|
+
| Demo | [https://www.compdf.com/demo/webviewer](https://www.compdf.com/demo/webviewer) |
|
|
72
168
|
|
|
73
|
-
|
|
169
|
+
## ❤️ Engagement
|
|
74
170
|
|
|
75
|
-
|
|
171
|
+
If ComPDF helps your web product ship faster, please ⭐ **Star us on GitHub** to support the project.
|
|
76
172
|
|
|
77
|
-
|
|
78
|
-
We are glad to announce that you can register a ComPDFKit API account for a [free trial](https://api.compdf.com/api/pricing) to process 1000 documents per month for free.
|
|
173
|
+
ComPDF is a strong fit for teams that want browser rendering, customizable UI, and a clean upgrade path from PDF viewing to full document workflows.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{At as e,Bt as t,Dt as n,Et as r,Ft as i,Gt as a,H as o,I as s,It as c,L as l,Lt as u,Mt as d,N as f,Nt as p,O as m,Ot as h,Pt as ee,R as te,Rt as g,S as _,T as v,Tt as y,Vt as b,X as ne,Z as x,at as re,g as S,h as C,it as w,jt as ie,k as ae,kt as oe,m as T,rt as se,v as ce,wt as E,xt as le,zt as D}from"./viewer-Bx-vwNpl.js";var O=void 0,ue=typeof window<`u`&&window.trustedTypes;if(ue)try{O=ue.createPolicy(`vue`,{createHTML:e=>e})}catch{}var de=O?e=>O.createHTML(e):e=>e,fe=`http://www.w3.org/2000/svg`,pe=`http://www.w3.org/1998/Math/MathML`,k=typeof document<`u`?document:null,me=k&&k.createElement(`template`),he={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?k.createElementNS(fe,e):t===`mathml`?k.createElementNS(pe,e):n?k.createElement(e,{is:n}):k.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>k.createTextNode(e),createComment:e=>k.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>k.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{me.innerHTML=de(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=me.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},A=`transition`,j=`animation`,M=Symbol(`_vtc`),ge={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},_e=r({},S,ge),ve=(e=>(e.displayName=`Transition`,e.props=_e,e))((e,{slots:t})=>te(C,ye(e),t)),N=(t,n=[])=>{e(t)?t.forEach(e=>e(...n)):t&&t(...n)},P=t=>t?e(t)?t.some(e=>e.length>1):t.length>1:!1;function ye(e){let t={};for(let n in e)n in ge||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:i,duration:a,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:u=s,appearToClass:d=c,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=be(a),ee=h&&h[0],te=h&&h[1],{onBeforeEnter:g,onEnter:_,onEnterCancelled:v,onLeave:y,onLeaveCancelled:b,onBeforeAppear:ne=g,onAppear:x=_,onAppearCancelled:re=v}=t,S=(e,t,n,r)=>{e._enterCancelled=r,L(e,t?d:c),L(e,t?u:s),n&&n()},C=(e,t)=>{e._isLeaving=!1,L(e,f),L(e,m),L(e,p),t&&t()},w=e=>(t,n)=>{let r=e?x:_,a=()=>S(t,e,n);N(r,[t,a]),xe(()=>{L(t,e?l:o),I(t,e?d:c),P(r)||Ce(t,i,ee,a)})};return r(t,{onBeforeEnter(e){N(g,[e]),I(e,o),I(e,s)},onBeforeAppear(e){N(ne,[e]),I(e,l),I(e,u)},onEnter:w(!1),onAppear:w(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>C(e,t);I(e,f),e._enterCancelled?(I(e,p),V(e)):(V(e),I(e,p)),xe(()=>{e._isLeaving&&(L(e,f),I(e,m),P(y)||Ce(e,i,te,n))}),N(y,[e,n])},onEnterCancelled(e){S(e,!1,void 0,!0),N(v,[e])},onAppearCancelled(e){S(e,!0,void 0,!0),N(re,[e])},onLeaveCancelled(e){C(e),N(b,[e])}})}function be(e){if(e==null)return null;if(p(e))return[F(e.enter),F(e.leave)];{let t=F(e);return[t,t]}}function F(e){return a(e)}function I(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[M]||(e[M]=new Set)).add(t)}function L(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[M];n&&(n.delete(t),n.size||(e[M]=void 0))}function xe(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Se=0;function Ce(e,t,n,r){let i=e._endId=++Se,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=R(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function R(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${A}Delay`),a=r(`${A}Duration`),o=z(i,a),s=r(`${j}Delay`),c=r(`${j}Duration`),l=z(s,c),u=null,d=0,f=0;t===A?o>0&&(u=A,d=o,f=a.length):t===j?l>0&&(u=j,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?A:j:null,f=u?u===A?a.length:c.length:0);let p=u===A&&/\b(?:transform|all)(?:,|$)/.test(r(`${A}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function z(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>B(t)+B(e[n])))}function B(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function V(e){return(e?e.ownerDocument:document).body.offsetHeight}function we(e,t,n){let r=e[M];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var H=Symbol(`_vod`),Te=Symbol(`_vsh`),Ee={name:`show`,beforeMount(e,{value:t},{transition:n}){e[H]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):U(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),U(e,!0),r.enter(e)):r.leave(e,()=>{U(e,!1)}):U(e,t))},beforeUnmount(e,{value:t}){U(e,t)}};function U(e,t){e.style.display=t?e[H]:`none`,e[Te]=!t}var De=Symbol(``),Oe=/(?:^|;)\s*display\s*:/;function ke(e,t,n){let r=e.style,i=u(n),a=!1;if(n&&!i){if(t)if(u(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??W(r,t,``)}else for(let e in t)n[e]??W(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?W(r,i,``):Me(e,i,!u(t)&&t?t[i]:void 0,o)||W(r,i,o)}}else if(i){if(t!==n){let e=r[De];e&&(n+=`;`+e),r.cssText=n,a=Oe.test(n)}}else t&&e.removeAttribute(`style`);H in e&&(e[H]=a?r.display:``,e[Te]&&(r.display=`none`))}var Ae=/\s*!important$/;function W(t,r,i){if(e(i))i.forEach(e=>W(t,r,e));else if(i??=``,r.startsWith(`--`))t.setProperty(r,i);else{let e=je(t,r);Ae.test(i)?t.setProperty(n(e),i.replace(Ae,``),`important`):t[e]=i}}var G=[`Webkit`,`Moz`,`ms`],K={};function je(e,t){let n=K[t];if(n)return n;let r=E(t);if(r!==`filter`&&r in e)return K[t]=r;r=y(r);for(let n=0;n<G.length;n++){let i=G[n]+r;if(i in e)return K[t]=i}return t}function Me(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&u(r)&&n===r}var Ne=`http://www.w3.org/1999/xlink`;function Pe(e,t,n,r,i,a=c(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Ne,t.slice(6,t.length)):e.setAttributeNS(Ne,t,n):n==null||a&&!h(n)?e.removeAttribute(t):e.setAttribute(t,a?``:g(n)?String(n):n)}function Fe(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?de(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=h(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function q(e,t,n,r){e.addEventListener(t,n,r)}function Ie(e,t,n,r){e.removeEventListener(t,n,r)}var Le=Symbol(`_vei`);function Re(e,t,n,r,i=null){let a=e[Le]||(e[Le]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Be(t);r?q(e,n,a[t]=We(r,i),s):o&&(Ie(e,n,o,s),a[t]=void 0)}}var ze=/(?:Once|Passive|Capture)$/;function Be(e){let t;if(ze.test(e)){t={};let n;for(;n=e.match(ze);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===`:`?e.slice(3):n(e.slice(2)),t]}var Ve=0,He=Promise.resolve(),Ue=()=>Ve||=(He.then(()=>Ve=0),Date.now());function We(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;_(Ge(e,n.value),t,5,[e])};return n.value=e,n.attached=Ue(),n}function Ge(t,n){if(e(n)){let e=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{e.call(t),t._stopped=!0},n.map(e=>t=>!t._stopped&&e&&e(t))}else return n}var Ke=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,qe=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?we(e,r,o):t===`style`?ke(e,n,r):ee(t)?d(t)||Re(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):Je(e,t,r,o))?(Fe(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Pe(e,t,r,o,a,t!==`value`)):e._isVueCE&&(Ye(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!u(r)))?Fe(e,E(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Pe(e,t,r,o))};function Je(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Ke(t)&&ie(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Ke(t)&&u(n)?!1:t in e}function Ye(e,t){let n=e._def.props;if(!n)return!1;let r=E(t);return Array.isArray(n)?n.some(e=>E(e)===r):Object.keys(n).some(e=>E(e)===r)}var Xe=new WeakMap,Ze=new WeakMap,J=Symbol(`_moveCb`),Qe=Symbol(`_enterCb`),$e=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:r({},_e,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=s(),r=re(),i,a;return ne(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!it(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(et),i.forEach(tt);let r=i.filter(nt);V(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;I(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[J]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[J]=null,L(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=le(e),s=ye(o),c=o.tag||ce;if(i=[],a)for(let e=0;e<a.length;e++){let t=a[e];t.el&&t.el instanceof Element&&(i.push(t),w(t,se(t,s,r,n)),Xe.set(t,rt(t.el)))}a=t.default?l(t.default()):[];for(let e=0;e<a.length;e++){let t=a[e];t.key!=null&&w(t,se(t,s,r,n))}return f(c,null,a)}}});function et(e){let t=e.el;t[J]&&t[J](),t[Qe]&&t[Qe]()}function tt(e){Ze.set(e,rt(e.el))}function nt(e){let t=Xe.get(e),n=Ze.get(e),r=t.left-n.left,i=t.top-n.top;if(r||i){let t=e.el,n=t.style,a=t.getBoundingClientRect(),o=1,s=1;return t.offsetWidth&&(o=a.width/t.offsetWidth),t.offsetHeight&&(s=a.height/t.offsetHeight),(!Number.isFinite(o)||o===0)&&(o=1),(!Number.isFinite(s)||s===0)&&(s=1),Math.abs(o-1)<.01&&(o=1),Math.abs(s-1)<.01&&(s=1),n.transform=n.webkitTransform=`translate(${r/o}px,${i/s}px)`,n.transitionDuration=`0s`,e}}function rt(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function it(e,t,n){let r=e.cloneNode(),i=e[M];i&&i.forEach(e=>{e.split(/\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=R(r);return a.removeChild(r),o}var Y=t=>{let n=t.props[`onUpdate:modelValue`]||!1;return e(n)?e=>oe(n,e):n};function at(e){e.target.composing=!0}function ot(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var X=Symbol(`_assign`);function st(e,t,n){return t&&(e=e.trim()),n&&(e=b(e)),e}var Z={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[X]=Y(i);let a=r||i.props&&i.props.type===`number`;q(e,t?`change`:`input`,t=>{t.target.composing||e[X](st(e.value,n,a))}),(n||a)&&q(e,`change`,()=>{e.value=st(e.value,n,a)}),t||(q(e,`compositionstart`,at),q(e,`compositionend`,ot),q(e,`change`,ot))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[X]=Y(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?b(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},ct={deep:!0,created(n,r,a){n[X]=Y(a),q(n,`change`,()=>{let r=n._modelValue,a=Q(n),o=n.checked,s=n[X];if(e(r)){let e=t(r,a),n=e!==-1;if(o&&!n)s(r.concat(a));else if(!o&&n){let t=[...r];t.splice(e,1),s(t)}}else if(i(r)){let e=new Set(r);o?e.add(a):e.delete(a),s(e)}else s(pt(n,o))})},mounted:lt,beforeUpdate(e,t,n){e[X]=Y(n),lt(e,t,n)}};function lt(n,{value:r,oldValue:a},o){n._modelValue=r;let s;if(e(r))s=t(r,o.props.value)>-1;else if(i(r))s=r.has(o.props.value);else{if(r===a)return;s=D(r,pt(n,!0))}n.checked!==s&&(n.checked=s)}var ut={created(e,{value:t},n){e.checked=D(t,n.props.value),e[X]=Y(n),q(e,`change`,()=>{e[X](Q(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[X]=Y(r),t!==n&&(e.checked=D(t,r.props.value))}},dt={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let a=i(t);q(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?b(Q(e)):Q(e));e[X](e.multiple?a?new Set(t):t:t[0]),e._assigning=!0,o(()=>{e._assigning=!1})}),e[X]=Y(r)},mounted(e,{value:t}){ft(e,t)},beforeUpdate(e,t,n){e[X]=Y(n)},updated(e,{value:t}){e._assigning||ft(e,t)}};function ft(n,r){let a=n.multiple,o=e(r);if(!(a&&!o&&!i(r))){for(let e=0,i=n.options.length;e<i;e++){let i=n.options[e],s=Q(i);if(a)if(o){let e=typeof s;e===`string`||e===`number`?i.selected=r.some(e=>String(e)===String(s)):i.selected=t(r,s)>-1}else i.selected=r.has(s);else if(D(Q(i),r)){n.selectedIndex!==e&&(n.selectedIndex=e);return}}!a&&n.selectedIndex!==-1&&(n.selectedIndex=-1)}}function Q(e){return`_value`in e?e._value:e.value}function pt(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var mt={created(e,t,n){$(e,t,n,null,`created`)},mounted(e,t,n){$(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){$(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){$(e,t,n,r,`updated`)}};function ht(e,t){switch(e){case`SELECT`:return dt;case`TEXTAREA`:return Z;default:switch(t){case`checkbox`:return ct;case`radio`:return ut;default:return Z}}}function $(e,t,n,r,i){let a=ht(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}var gt=[`ctrl`,`shift`,`alt`,`meta`],_t={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>gt.some(n=>e[`${n}Key`]&&!t.includes(n))},vt=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=_t[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},yt={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},bt=(e,t)=>{let r=e._withKeys||={},i=t.join(`.`);return r[i]||(r[i]=(r=>{if(!(`key`in r))return;let i=n(r.key);if(t.some(e=>e===i||yt[e]===i))return e(r)}))},xt=r({patchProp:qe},he),St;function Ct(){return St||=ae(xt)}var wt=((...e)=>{let t=Ct().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Et(e);if(!r)return;let i=t._component;!ie(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Tt(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function Tt(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Et(e){return u(e)?document.querySelector(e):e}var Dt={},Ot={width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function kt(e,t){return x(),m(`svg`,Ot,[...t[0]||=[v(`path`,{d:`M13 1L1 13`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1),v(`path`,{d:`M1 1L13 13`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]])}var At=T(Dt,[[`render`,kt]]),jt={},Mt={width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function Nt(e,t){return x(),m(`svg`,Mt,[...t[0]||=[v(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M12.6466 13.2531L13.0001 13.6066L13.7072 12.8995L13.3537 12.546L8.7072 7.8995L13.2532 3.35352L13.6067 2.99997L12.8996 2.29286L12.5461 2.64642L8.00009 7.19239L3.45418 2.64648L3.10063 2.29292L2.39352 3.00003L2.74708 3.35358L7.29299 7.8995L2.64657 12.5459L2.29302 12.8995L3.00013 13.6066L3.35368 13.253L8.0001 8.6066L12.6466 13.2531Z`,fill:`currentColor`},null,-1)]])}var Pt=T(jt,[[`render`,Nt]]),Ft={},It={xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`};function Lt(e,t){return x(),m(`svg`,It,[...t[0]||=[v(`path`,{"fill-rule":`evenodd`,"clip-rule":`evenodd`,d:`M14.7331 15.7936C15.026 16.0864 15.5009 16.0864 15.7937 15.7936C16.0866 15.5007 16.0866 15.0258 15.7937 14.7329L11.3743 10.3135L15.7938 5.89408C16.0867 5.60119 16.0867 5.12631 15.7938 4.83342C15.5009 4.54052 15.026 4.54053 14.7331 4.83342L10.3137 9.25284L5.89425 4.8334C5.60136 4.54051 5.12649 4.54051 4.83359 4.8334C4.5407 5.12629 4.5407 5.60117 4.83359 5.89406L9.25303 10.3135L4.83361 14.7329C4.54072 15.0258 4.54072 15.5007 4.83361 15.7936C5.1265 16.0865 5.60138 16.0865 5.89427 15.7936L10.3137 11.3742L14.7331 15.7936Z`,fill:`currentColor`},null,-1)]])}var Rt=T(Ft,[[`render`,Lt]]);export{$e as a,dt as c,bt as d,vt as f,ve as i,Z as l,Pt as n,wt as o,At as r,mt as s,Rt as t,Ee as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,Ct as n,D as r,E as i,H as a,Ht as o,J as s,N as c,O as l,T as u,Ut as d,Wt as f,Y as p,Z as m,lt as h,ot as g,t as _,v,vt as y,w as b}from"./viewer-Bx-vwNpl.js";import{d as x}from"./CloseA-CEkvif0J.js";import{u as S}from"./index-BWvsaYab.js";var C=[`data-element`],w=[`innerHTML`],T={key:0},E=[`onClick`],D=[`onClick`],O=[`innerHTML`],k={key:0},A=[`onClick`],j=[`onClick`],M=[`innerHTML`],N={key:0},P=[`onClick`],F=[`onClick`],I={__name:`CustomModalItem`,props:{modal:{type:Object,required:!0}},setup(i){let I=i,L=_(),R=y(null),{dataElement:z,render:B,header:V,body:H,footer:U,disableBackdropClick:W=!1,disableEscapeKeyDown:G=!1}=I.modal,K=b(()=>L.isElementOpen(z)),q=e=>e?Object.entries(e).map(([e,t])=>Number.isInteger(t)?`${e}:${t}px`:`${e}:${t}`).join(`;`):``,J=()=>{W||X()},Y=e=>{G||(e.preventDefault(),X())},X=()=>{L.closeElement(z)};g(K,async e=>{if(e&&B&&R.value){await a();let e=B();typeof e==`string`?R.value.textContent=e:e instanceof Node&&(R.value.innerHTML=``,R.value.appendChild(e))}},{immediate:!0});let Z=e=>{e.key===`Escape`&&K.value&&!G&&X()};return s(()=>{document.addEventListener(`keydown`,Z)}),p(()=>{document.removeEventListener(`keydown`,Z)}),(i,a)=>{let s=S;return K.value?(m(),l(`div`,{key:0,class:o([`Modal CustomModal`,n(z)]),"data-element":n(z),tabindex:`-1`,onClick:J,onKeydown:x(Y,[`esc`])},[c(s,{show:!0,dialogName:n(z)},t({default:h(()=>[n(H)?(m(),l(`div`,{key:0,class:o([`CustomModal-body`,n(H).className]),style:d(n(H).style)},[n(H).innerHTML?(m(),l(`div`,{key:0,innerHTML:n(H).innerHTML},null,8,O)):(m(),l(v,{key:1},[n(H).title?(m(),l(`p`,k,f(n(H).title),1)):r(``,!0),(m(!0),l(v,null,e(n(H).children,(e,t)=>(m(),l(v,{key:t},[e.button?(m(),l(`button`,{key:0,class:o([`Button`,e.className,`customEl${t}`]),style:d(q(e.style)),onClick:e.onClick},f(e.title),15,A)):(m(),l(`div`,{key:1,class:o([e.className,`customEl${t}`]),style:d(q(e.style)),onClick:e.onClick},f(e.title),15,j))],64))),128))],64))],6)):r(``,!0)]),_:2},[n(V)?{name:`header`,fn:h(()=>[u(`div`,{class:o([`CustomModal-header`,n(V).className]),style:d(n(V).style)},[n(V).innerHTML?(m(),l(`div`,{key:0,innerHTML:n(V).innerHTML},null,8,w)):(m(),l(v,{key:1},[n(V).title?(m(),l(`p`,T,f(n(V).title),1)):r(``,!0),(m(!0),l(v,null,e(n(V).children,(e,t)=>(m(),l(v,{key:t},[e.button?(m(),l(`button`,{key:0,class:o([`Button`,e.className,`customEl${t}`]),style:d(q(e.style)),onClick:e.onClick},f(e.title),15,E)):(m(),l(`div`,{key:1,class:o([e.className,`customEl${t}`]),style:d(q(e.style)),onClick:e.onClick},f(e.title),15,D))],64))),128))],64))],6)]),key:`0`}:void 0,n(U)?{name:`footer`,fn:h(()=>[u(`div`,{class:o([`CustomModal-footer`,n(U).className]),style:d(n(U).style)},[n(U).innerHTML?(m(),l(`div`,{key:0,innerHTML:n(U).innerHTML},null,8,M)):(m(),l(v,{key:1},[n(U).title?(m(),l(`p`,N,f(n(U).title),1)):r(``,!0),(m(!0),l(v,null,e(n(U).children,(e,t)=>(m(),l(v,{key:t},[e.button?(m(),l(`button`,{key:0,class:o([`Button`,e.className,`customEl${t}`]),style:d(q(e.style)),onClick:e.onClick},f(e.title),15,P)):(m(),l(`div`,{key:1,class:o([e.className,`customEl${t}`]),style:d(q(e.style)),onClick:e.onClick},f(e.title),15,F))],64))),128))],64))],6)]),key:`1`}:void 0]),1032,[`dialogName`])],42,C)):r(``,!0)}}},L={__name:`CustomModal`,props:[`dataElement`],setup(t){let n=_(),r=b(()=>n.getCustomModals);r.value.forEach(e=>n.activeElements[e.dataElement]=!1);let a=b(()=>r.value.filter(e=>!n.isElementDisabled(e.dataElement)));return(t,n)=>{let r=I;return m(!0),l(v,null,e(a.value,e=>(m(),i(r,{key:e.dataElement,modal:e},null,8,[`modal`]))),128)}}};export{L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.CustomModal .dialog-container{padding:0}.CustomModal .dialog-container main{margin:0}.CustomModal .CustomModal-header{border-bottom:1px solid #e0e0e0;padding:20px 15px 15px}.CustomModal .CustomModal-body{padding:15px}.CustomModal .CustomModal-footer{border-top:1px solid #e0e0e0;width:100%;padding:15px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.page-mode-panel .sidebar-title{height:40px;color:var(--c-right-side-header-text);background-color:var(--c-side-header-bg);border-bottom:1px solid var(--c-side-header-border);justify-content:center;align-items:center;font-size:14px;font-weight:700;display:flex}.page-mode-panel .mode-container{padding:0 20px 0 16px}.page-mode-panel .mode-item{padding:26px 0 7px}.page-mode-panel .mode-item+.mode-item{border-top:1px solid var(--c-side-header-border)}.page-mode-panel .mode-item h2{margin:0 0 18px;font-size:14px;line-height:16px}.page-mode-panel .mode-tabs{align-items:center;display:flex}.page-mode-panel .mode-tabs .button{color:var(--c-tool-right-page);border-radius:6px;padding:6px 13px}.page-mode-panel .mode-tabs .button.active{color:var(--c-tool-right-page-active)}.page-mode-panel.mobile .sidebar-title{height:36px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ct as e,Ht as t,N as n,O as r,T as i,Wt as a,Z as o,a as s,f as c,lt as l,ot as u,p as d,s as f,t as p,w as m}from"./viewer-Bx-vwNpl.js";import{a as h,c as g,d as _,i as v,n as y,o as b,r as x,s as S,t as C}from"./index-BWvsaYab.js";var w={class:`sidebar-title`},T={class:`mode-container`},E={class:`mode-item`},D={class:`mode-tabs`},O={class:`mode-item`},k={class:`mode-tabs`},A={class:`mode-item`},j={class:`mode-tabs`},M={__name:`RightPanelPageMode`,setup(M){let N=p(),P=g(),F=m(()=>N.isElementOpen(d.PAGE_MODE_PANEL)),I=m(()=>N.getScrollMode),L=m(()=>N.getPageMode),R=m(()=>N.getTheme),z=m(()=>P.getActiveTool);u(F,e=>{e&&z.value===c.CROP_PAGE&&P.setToolState(``)});let B=(e,t)=>{L.value!==0&&e===`Horizontal`&&(f.switchSpreadMode(0),N.setPageMode(0)),N.setScrollMode(e),f.switchScrollMode(t)},V=e=>{I.value===`Horizontal`&&(N.setScrollMode(`Vertical`),f.switchScrollMode(0)),f.switchSpreadMode(e),N.setPageMode(e)},H=e=>{e!==R.value&&N.setTheme(e)};return(c,u)=>{let d=y,f=_,p=b,m=x,g=C,M=h,N=v,P=S;return o(),r(`div`,{class:t([`page-mode-panel`,{mobile:e(s)}])},[i(`div`,w,a(c.$t(`toolbar.viewControls.viewSetting`)),1),i(`div`,T,[i(`div`,E,[i(`h2`,null,a(c.$t(`panels.pageMode.displayMode.title`)),1),i(`div`,D,[n(f,{class:t({active:L.value===0}),onClick:u[0]||=e=>V(0),title:c.$t(`panels.pageMode.displayMode.singlePage`)},{default:l(()=>[n(d)]),_:1},8,[`class`,`title`]),n(f,{class:t({active:L.value===1}),onClick:u[1]||=e=>V(1),title:c.$t(`panels.pageMode.displayMode.twoPages`)},{default:l(()=>[n(p)]),_:1},8,[`class`,`title`]),n(f,{class:t({active:L.value===2}),onClick:u[2]||=e=>V(2),title:c.$t(`panels.pageMode.displayMode.coverMode`)},{default:l(()=>[n(m)]),_:1},8,[`class`,`title`])])]),i(`div`,O,[i(`h2`,null,a(c.$t(`panels.pageMode.splitView.title`)),1),i(`div`,k,[n(f,{class:t({active:I.value===`Vertical`}),onClick:u[3]||=e=>B(`Vertical`,0),title:c.$t(`panels.pageMode.splitView.vertical`)},{default:l(()=>[n(g)]),_:1},8,[`class`,`title`]),n(f,{class:t({active:I.value===`Horizontal`}),onClick:u[4]||=e=>B(`Horizontal`,1),title:c.$t(`panels.pageMode.splitView.horizontal`)},{default:l(()=>[n(M)]),_:1},8,[`class`,`title`])])]),i(`div`,A,[i(`h2`,null,a(c.$t(`panels.pageMode.themes`)),1),i(`div`,j,[n(f,{onClick:u[5]||=e=>H(`light`),class:t({active:R.value===`light`}),title:c.$t(`toolbar.themeSwitcher.light`)},{default:l(()=>[n(N)]),_:1},8,[`class`,`title`]),n(f,{onClick:u[6]||=e=>H(`dark`),class:t({active:R.value===`dark`}),title:c.$t(`toolbar.themeSwitcher.dark`)},{default:l(()=>[n(P)]),_:1},8,[`class`,`title`])])])])],2)}}};export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.stamp-panel{height:100%}.stamp-panel .sidebar-tabs-header{background-color:var(--c-right-side-header-bg);align-items:center;display:flex}.stamp-panel .sidebar-tabs-header .button{border-radius:initial;color:var(--c-right-side-header-text);flex:1;margin:0;padding:12px 0}.stamp-panel .sidebar-tabs-header .button:not(.disabled):hover{background-color:var(--c-right-side-header-bg)}.stamp-panel .sidebar-tabs-header .button:not(.disabled).active{background-color:var(--c-right-side-header-active);color:var(--c-white)}.stamp-panel .sidebar-tabs-header .button span{font-size:12px;line-height:16px}.stamp-panel .sidebar-tabs-header .mobile{display:none}.stamp-panel .sidebar-tabs-header .divider{margin-right:0}.stamp-panel .sidebar-title{height:36px;color:var(--c-right-side-header-text);justify-content:center;align-items:center;font-size:14px;font-weight:700;line-height:17px;display:flex}.stamp-panel .sidebar-content{width:100%;height:calc(100% - 76px)}.stamp-panel .sidebar-content .empty-list{height:100%;color:var(--c-text);justify-content:center;align-items:center;font-size:14px;font-weight:700;display:flex}.stamp-panel .sidebar-content .block{justify-content:center;align-items:center;padding:8px 0;display:flex;position:relative}.stamp-panel .sidebar-content .block:hover{cursor:pointer;background-color:#dde9ff}.stamp-panel .sidebar-content img{max-width:190px;max-height:66px}.stamp-panel .sidebar-content .standard-container,.stamp-panel .sidebar-content .customize-container{height:100%;overflow:auto}.stamp-panel .sidebar-content .dynamic-stamp{text-align:left;border-radius:6px;flex-direction:column;justify-content:center;width:190px;height:36px;padding:0 16px;font-family:Helvetica;font-size:10px;font-weight:400;line-height:16px;display:flex}.stamp-panel .sidebar-content .dynamic-stamp .title{font-size:14px}.stamp-panel .sidebar-content .dynamic-stamp.red{color:#9a1c04;background:var(--c-dynamic-stamp-red-bg);border:1px solid #9a1c04}.stamp-panel .sidebar-content .dynamic-stamp.green{color:#4f7d2a;background:var(--c-dynamic-stamp-green-bg);border:1px solid #a0ba8e}.stamp-panel .sidebar-content .custom-container{flex-direction:column;width:100%;height:100%;display:flex}.stamp-panel .sidebar-content .custom-container.hidden{display:none}.stamp-panel .sidebar-content .custom-container .stamps-container{flex:1;padding:16px 0;overflow:auto}.stamp-panel .sidebar-content .custom-container .block:hover .close-button{display:flex}.stamp-panel .sidebar-content .close-button{margin:0;display:none;position:absolute;right:10px}.stamp-panel .sidebar-content .close-button:not(.disabled):hover{background-color:var(--c-header-button-hover)}.stamp-panel .sidebar-content .create-container{background-color:var(--c-side-bg);justify-content:center;align-items:center;width:100%;display:flex}.stamp-panel .sidebar-content .create-button{text-align:center;background-color:var(--c-right-side-header-active);cursor:pointer;width:200px;color:var(--c-white);border-radius:8px;justify-content:center;align-items:center;margin-bottom:12px;padding:14px 0;font-size:16px;font-weight:700;line-height:20px;display:flex}.stamp-panel .sidebar-content .create-button:hover{background-color:var(--c-right-side-header-active-hover)}.stamp-panel.mobile .standard-container{padding-bottom:80px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,Ct as t,D as n,E as r,Ht as i,J as a,N as o,O as s,T as c,Wt as l,Z as u,a as d,f,lt as p,ot as m,p as h,s as g,t as _,ut as v,v as y,vt as b,w as x}from"./viewer-Bx-vwNpl.js";import{r as ee,u as S}from"./CloseA-CEkvif0J.js";import{c as te,d as ne,l as re,u as ie}from"./index-BWvsaYab.js";var ae=``+new URL(`../images/stamp/Approved.png`,import.meta.url).href,oe=``+new URL(`../images/stamp/NotApproved.png`,import.meta.url).href,se=``+new URL(`../images/stamp/Completed.png`,import.meta.url).href,ce=``+new URL(`../images/stamp/Final.png`,import.meta.url).href,le=``+new URL(`../images/stamp/Draft.png`,import.meta.url).href,ue=``+new URL(`../images/stamp/Confidential.png`,import.meta.url).href,de=``+new URL(`../images/stamp/ForPublicRelease.png`,import.meta.url).href,fe=``+new URL(`../images/stamp/NotForPublicRelease.png`,import.meta.url).href,pe=``+new URL(`../images/stamp/ForComment.png`,import.meta.url).href,me=``+new URL(`../images/stamp/Void.png`,import.meta.url).href,he=``+new URL(`../images/stamp/PreliminaryResults.png`,import.meta.url).href,C=``+new URL(`../images/stamp/InformationOnly.png`,import.meta.url).href,w=``+new URL(`../images/stamp/Witness.png`,import.meta.url).href,T=``+new URL(`../images/stamp/InitialHere.png`,import.meta.url).href,E=``+new URL(`../images/stamp/SignHere.png`,import.meta.url).href,D=``+new URL(`../images/stamp/revised.png`,import.meta.url).href,O=class{updateStampPreview({imgSrc:e,width:t,height:n,stampType:r,contents:i,stampColor:a,time:o}){this.width=t,this.height=n,this.imgSrc=e,this.stampType=r,this.contents=i,this.stampColor=a,this.time=o;let s=this.stampPreviewElement||document.createElement(`div`);s.innerHTML=``,s.className=`stamp-preview`,this.applyStyles(s,{position:`absolute`,border:`1px solid #00A4E4`,"z-index":85,"pointer-events":`none`,left:`-9999px`,top:`-9999px`,width:t+`px`,height:n+`px`}),document.body.appendChild(s);let c=document.createElement(`img`);this.applyStyles(c,{width:`100%`,height:`100%`}),c.src=e,s.appendChild(c);let l=document.querySelector(`.document`);l.addEventListener(`mousemove`,this.handleMouseMove.bind(this,s)),l.addEventListener(`mouseleave`,()=>{s.style.left=`-9999px`,s.style.top=`-9999px`}),this.stampPreviewElement=s}handleMouseMove(e,t){let n=e.getBoundingClientRect();this.applyStyles(e,{left:t.clientX-n.width/2+`px`,top:t.clientY-n.height/2+`px`})}handleMouseLeave(e){this.applyStyles(e,{left:-9999,top:-9999})}hidePreview(){let e=this.stampPreviewElement||document.querySelector(`.stamp-preview`);e&&(e.style.display=`none`,e.remove(),this.stampPreviewElement=null,this.width=null,this.height=null,this.imgSrc=null,this.stampType=null,this.contents=null,this.stampColor=null,this.time=null)}applyStyles(e,t){Object.keys(t).forEach(n=>{e.style[n]=t[n]})}},k={class:`sidebar-title`},A={class:`sidebar-tabs-header`},j={class:`sidebar-content`},M={key:0,class:`standard-container`},N={class:`block`},P={class:`block`},F={class:`block`},I={class:`block`},L={class:`block`},R={class:`block`},ge={class:`block`},_e={class:`block`},ve={class:`block`},ye={class:`block`},be={class:`block`},xe={class:`block`},Se={class:`block`},Ce={class:`block`},we={class:`block`},z={class:`block`},Te={key:1,class:`customize-container`},Ee={class:`dynamic-stamp red`},De={class:`dynamic-stamp green`},Oe={key:2,class:`custom-container`},ke={key:0,class:`empty-list`},Ae=[`src`],je={class:`create-container`},Me={key:3,class:`custom-container`},Ne={key:0,class:`empty-list`},Pe={class:`stamps-container`},Fe=[`src`],Ie={key:0,class:`delete-page-popup`},Le={__name:`StampPanel`,setup(Le){let{switchTool:Re,switchAnnotationEditorMode:ze}=g,B=_(),Be=te(),V=b(!1),H=b(0),U=b(null),W=x(()=>B.getActiveElementTab(h.STAMP_PANEL)),Ve=x(()=>B.isElementOpen(h.STAMP_PANEL)),He=x(()=>Be.getActiveTool),G=x(()=>B.getCustomStamps),K=x(()=>B.getStampPanelTabs),q=x(()=>B.getImportStamps),J=b(``),Y=new O,Ue=()=>{B.openElement(`createCustomStampDialog`)};a(()=>{Z(),setInterval(Z,1e3);let e=document.querySelector(`.document-container`);e&&e.addEventListener(`click`,Ge)}),m(G.value,()=>{G.value.length&&(Array.isArray(U.value)?U.value[0]:U.value)?.scrollTo({top:0,behavior:`smooth`})});let We=e=>{let t=g.getScrollViewElement();if(!t)return;let n=t.scrollLeft||0,r=t.scrollTop||0,{pageX:i,pageY:a}=e;return{x:i+n,y:a+r}},Ge=e=>{let t=We(e),n=g.getSelectedPage(t,t).first;if(n<1)return;let r=g.windowToPage(t,n);if(Y.stampPreviewElement){let{width:e,height:t}=Y,i={stampType:Y.stampType,page:n,rect:{x:r.x-e/2,y:r.y-t/2,width:e,height:t}};Y.stampType===`dynamic`?(i.stampColor=Y.stampColor,i.stampShape=0,i.contents=Y.contents,i.time=J.value):Y.stampType===`image`?i.imageBase64=Y.imgSrc:i.contents=Y.contents,g.handleStamp(i),Y.hidePreview(),window.innerWidth<=640&&(B.toggleActiveHand(!1),Re(0),ze(0),B.closeElement(h.STAMP_PANEL))}};m(()=>He.value,(e,t)=>{e!==f.STAMP&&B.closeElement(h.STAMP_PANEL)}),m(()=>Ve.value,(e,t)=>{e&&X(h.STANDARD)});let X=e=>{B.setActiveElementTab(h.STAMP_PANEL,e)},Z=()=>{J.value=Ke(new Date)},Ke=e=>{let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,`0`);return`${String(e.getDate()).padStart(2,`0`)}/${n}/${t} ${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}:${String(e.getSeconds()).padStart(2,`0`)}`},Q=async(e,t)=>{let n=await g.getDynamicStampPreview({contents:t,time:J.value,stampColor:e,stampShape:0});Y.updateStampPreview({imgSrc:n.imgSrc,width:n.width,height:n.height,stampType:`dynamic`,stampColor:e,contents:t,stampShape:0,time:J.value})},$=(e,t,n)=>{t===`standard`?Y.updateStampPreview({imgSrc:e.target.src,width:e.target.width,height:e.target.height,stampType:`standard`,contents:n}):Y.updateStampPreview({imgSrc:e.target.src,width:e.target.width,height:e.target.height,stampType:`image`,contents:n})},qe=e=>{V.value=!0,H.value=e},Je=()=>{B.removeCustomStamp(H.value),V.value=!1};return(a,f)=>{let m=ne,g=ee,_=re,b=ie;return u(),s(`div`,{class:i([`stamp-panel`,{mobile:t(d)}])},[c(`div`,k,l(a.$t(`toolbar.annotationTools.stamp`)),1),c(`div`,A,[(u(!0),s(y,null,e(K.value,e=>(u(),r(m,{class:i({active:W.value===e.dataElement,mobile:t(d)&&e.dataElement===`CUSTOM`}),isActive:W.value===e.dataElement,"data-element":e.dataElement,onClick:t=>X(e.dataElement)},{default:p(()=>[c(`span`,null,l(e.text?e.text:a.$t(`panels.stamp.`+e.dataElement.toLowerCase())),1)]),_:2},1032,[`class`,`isActive`,`data-element`,`onClick`]))),256))]),c(`div`,j,[(u(!0),s(y,null,e(K.value,r=>(u(),s(y,null,[r.dataElement===t(h).STANDARD?v((u(),s(`div`,M,[c(`div`,N,[c(`img`,{onClick:f[0]||=e=>$(e,`standard`,`Approved`),src:ae,alt:`Approved`})]),c(`div`,P,[c(`img`,{onClick:f[1]||=e=>$(e,`standard`,`Not Approved`),src:oe,alt:`Not Approved`})]),c(`div`,F,[c(`img`,{onClick:f[2]||=e=>$(e,`standard`,`Completed`),src:se,alt:`Completed`})]),c(`div`,I,[c(`img`,{onClick:f[3]||=e=>$(e,`standard`,`Final`),src:ce,alt:`Final`})]),c(`div`,L,[c(`img`,{onClick:f[4]||=e=>$(e,`standard`,`Draft`),src:le,alt:`Draft`})]),c(`div`,R,[c(`img`,{onClick:f[5]||=e=>$(e,`standard`,`Confidential`),src:ue,alt:`Confidential`})]),c(`div`,ge,[c(`img`,{onClick:f[6]||=e=>$(e,`standard`,`For Public Release`),src:de,alt:`For Public Release`})]),c(`div`,_e,[c(`img`,{onClick:f[7]||=e=>$(e,`standard`,`Not For Public Release`),src:fe,alt:`Not For Public Release`})]),c(`div`,ve,[c(`img`,{onClick:f[8]||=e=>$(e,`standard`,`For Comment`),src:pe,alt:`For Comment`})]),c(`div`,ye,[c(`img`,{onClick:f[9]||=e=>$(e,`standard`,`Void`),src:me,alt:`Void`})]),c(`div`,be,[c(`img`,{onClick:f[10]||=e=>$(e,`standard`,`Preliminary Results`),src:he,alt:`Preliminary Results`})]),c(`div`,xe,[c(`img`,{onClick:f[11]||=e=>$(e,`standard`,`Information Only`),src:C,alt:`Information Only`})]),c(`div`,Se,[c(`img`,{onClick:f[12]||=e=>$(e,`standard`,`Witness`),src:w,alt:`Witness`})]),c(`div`,Ce,[c(`img`,{onClick:f[13]||=e=>$(e,`standard`,`Initial Here`),src:T,alt:`Initial Here`})]),c(`div`,we,[c(`img`,{onClick:f[14]||=e=>$(e,`standard`,`Sign Here`),src:E,alt:`Sign Here`})]),c(`div`,z,[c(`img`,{onClick:f[15]||=e=>$(e,`standard`,`revised`),src:D,alt:`revised`})])],512)),[[S,W.value===t(h).STANDARD]]):r.dataElement===t(h).DYNAMIC?v((u(),s(`div`,Te,[c(`div`,{class:`block`,onClick:f[16]||=e=>Q(1,`REVISED`)},[c(`div`,Ee,[f[22]||=c(`p`,{class:`title`},`REVISED`,-1),c(`p`,null,l(J.value),1)])]),c(`div`,{class:`block`,onClick:f[17]||=e=>Q(2,`REVIEWED`)},[c(`div`,De,[f[23]||=c(`p`,{class:`title`},`REVIEWED`,-1),c(`p`,null,l(J.value),1)])])],512)),[[S,W.value===t(h).DYNAMIC]]):r.dataElement===t(h).CUSTOM?v((u(),s(`div`,Oe,[G.value&&G.value.length===0?(u(),s(`div`,ke,l(a.$t(`panels.stamp.createHere`)),1)):n(``,!0),c(`div`,{ref_for:!0,ref_key:`stampsRef`,ref:U,class:`stamps-container`},[(u(!0),s(y,null,e(G.value,(e,t)=>(u(),s(`div`,{class:`block`,key:t},[c(`img`,{onClick:f[18]||=e=>$(e,`custom`,``),src:e},null,8,Ae),o(m,{class:`close-button`,onClick:e=>qe(t)},{default:p(()=>[o(g)]),_:1},8,[`onClick`])]))),128))],512),c(`div`,je,[c(`div`,{class:`create-button`,onClick:f[19]||=e=>Ue()},l(a.$t(`panels.stamp.create`)),1)])],512)),[[S,W.value===t(h).CUSTOM]]):r.type===`custom`?v((u(),s(`div`,Me,[q.value.length===0?(u(),s(`div`,Ne,l(a.$t(`panels.stamp.importStamp`)),1)):n(``,!0),c(`div`,Pe,[(u(!0),s(y,null,e(q.value,(e,t)=>(u(),s(`div`,{class:`block`,key:t},[c(`img`,{onClick:f[20]||=e=>$(e,`custom`,``),src:e},null,8,Fe)]))),128))])],512)),[[S,W.value===r.dataElement]]):n(``,!0)],64))),256))]),V.value?(u(),s(`div`,Ie,[o(b,{show:V.value,dialogName:a.dialogName},{footer:p(()=>[c(`div`,{class:`rect-button white`,onClick:f[21]||=e=>V.value=!1},l(a.$t(`common.actions.cancel`)),1),c(`div`,{class:`rect-button blue`,onClick:Je},l(a.$t(`common.actions.ok`)),1)]),default:p(()=>[o(_),c(`p`,null,l(a.$t(`signatures.deleteConfirm`)),1)]),_:1},8,[`show`,`dialogName`])])):n(``,!0)],2)}}};export{Le as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./chunk-62oNxeRG.js";var t=e(((e,t)=>{var n=typeof globalThis<`u`&&globalThis||typeof self<`u`&&self||typeof global<`u`&&global,r=(function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e})();(function(e){(function(t){var n=e!==void 0&&e||typeof self<`u`&&self||n!==void 0&&n,r={searchParams:`URLSearchParams`in n,iterable:`Symbol`in n&&`iterator`in Symbol,blob:`FileReader`in n&&`Blob`in n&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:`FormData`in n,arrayBuffer:`ArrayBuffer`in n};function i(e){return e&&DataView.prototype.isPrototypeOf(e)}if(r.arrayBuffer)var a=[`[object Int8Array]`,`[object Uint8Array]`,`[object Uint8ClampedArray]`,`[object Int16Array]`,`[object Uint16Array]`,`[object Int32Array]`,`[object Uint32Array]`,`[object Float32Array]`,`[object Float64Array]`],o=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if(typeof e!=`string`&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e===``)throw TypeError(`Invalid character in header field name: "`+e+`"`);return e.toLowerCase()}function c(e){return typeof e!=`string`&&(e=String(e)),e}function l(e){var t={next:function(){var t=e.shift();return{done:t===void 0,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function u(e){this.map={},e instanceof u?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}u.prototype.append=function(e,t){e=s(e),t=c(t);var n=this.map[e];this.map[e]=n?n+`, `+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=c(t)},u.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},u.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),l(e)},u.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),l(e)},u.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),l(e)},r.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);function d(e){if(e.bodyUsed)return Promise.reject(TypeError(`Already read`));e.bodyUsed=!0}function f(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function p(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function m(e){var t=new FileReader,n=f(t);return t.readAsText(e),n}function h(e){for(var t=new Uint8Array(e),n=Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join(``)}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function _(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e==`string`?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&i(e)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText=``,this.headers.get(`content-type`)||(typeof e==`string`?this.headers.set(`content-type`,`text/plain;charset=UTF-8`):this._bodyBlob&&this._bodyBlob.type?this.headers.set(`content-type`,this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set(`content-type`,`application/x-www-form-urlencoded;charset=UTF-8`))},r.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error(`could not read FormData body as blob`);return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(p)}),this.text=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return m(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(h(this._bodyArrayBuffer));if(this._bodyFormData)throw Error(`could not read FormData body as text`);return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}var v=[`DELETE`,`GET`,`HEAD`,`OPTIONS`,`POST`,`PUT`];function y(e){var t=e.toUpperCase();return v.indexOf(t)>-1?t:e}function b(e,t){if(!(this instanceof b))throw TypeError(`Please use the "new" operator, this DOM object constructor cannot be called as a function.`);t||={};var n=t.body;if(e instanceof b){if(e.bodyUsed)throw TypeError(`Already read`);this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&e._bodyInit!=null&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||`same-origin`,(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=y(t.method||this.method||`GET`),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,(this.method===`GET`||this.method===`HEAD`)&&n)throw TypeError(`Body not allowed for GET or HEAD requests`);if(this._initBody(n),(this.method===`GET`||this.method===`HEAD`)&&(t.cache===`no-store`||t.cache===`no-cache`)){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,`$1_=`+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?`&`:`?`)+`_=`+new Date().getTime()}}}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})};function x(e){var t=new FormData;return e.trim().split(`&`).forEach(function(e){if(e){var n=e.split(`=`),r=n.shift().replace(/\+/g,` `),i=n.join(`=`).replace(/\+/g,` `);t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function S(e){var t=new u;return e.replace(/\r?\n[\t ]+/g,` `).split(`\r`).map(function(e){return e.indexOf(`
|
|
2
|
+
`)===0?e.substr(1,e.length):e}).forEach(function(e){var n=e.split(`:`),r=n.shift().trim();if(r){var i=n.join(`:`).trim();t.append(r,i)}}),t}_.call(b.prototype);function C(e,t){if(!(this instanceof C))throw TypeError(`Please use the "new" operator, this DOM object constructor cannot be called as a function.`);t||={},this.type=`default`,this.status=t.status===void 0?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?``:``+t.statusText,this.headers=new u(t.headers),this.url=t.url||``,this._initBody(e)}_.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},C.error=function(){var e=new C(null,{status:0,statusText:``});return e.type=`error`,e};var w=[301,302,303,307,308];C.redirect=function(e,t){if(w.indexOf(t)===-1)throw RangeError(`Invalid status code`);return new C(null,{status:t,headers:{location:e}})},t.DOMException=n.DOMException;try{new t.DOMException}catch{t.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,i){return new Promise(function(a,o){var s=new b(e,i);if(s.signal&&s.signal.aborted)return o(new t.DOMException(`Aborted`,`AbortError`));var l=new XMLHttpRequest;function d(){l.abort()}l.onload=function(){var e={status:l.status,statusText:l.statusText,headers:S(l.getAllResponseHeaders()||``)};e.url=`responseURL`in l?l.responseURL:e.headers.get(`X-Request-URL`);var t=`response`in l?l.response:l.responseText;setTimeout(function(){a(new C(t,e))},0)},l.onerror=function(){setTimeout(function(){o(TypeError(`Network request failed`))},0)},l.ontimeout=function(){setTimeout(function(){o(TypeError(`Network request failed`))},0)},l.onabort=function(){setTimeout(function(){o(new t.DOMException(`Aborted`,`AbortError`))},0)};function f(e){try{return e===``&&n.location.href?n.location.href:e}catch{return e}}l.open(s.method,f(s.url),!0),s.credentials===`include`?l.withCredentials=!0:s.credentials===`omit`&&(l.withCredentials=!1),`responseType`in l&&(r.blob?l.responseType=`blob`:r.arrayBuffer&&s.headers.get(`Content-Type`)&&s.headers.get(`Content-Type`).indexOf(`application/octet-stream`)!==-1&&(l.responseType=`arraybuffer`)),i&&typeof i.headers==`object`&&!(i.headers instanceof u)?Object.getOwnPropertyNames(i.headers).forEach(function(e){l.setRequestHeader(e,c(i.headers[e]))}):s.headers.forEach(function(e,t){l.setRequestHeader(t,e)}),s.signal&&(s.signal.addEventListener(`abort`,d),l.onreadystatechange=function(){l.readyState===4&&s.signal.removeEventListener(`abort`,d)}),l.send(s._bodyInit===void 0?null:s._bodyInit)})}return T.polyfill=!0,n.fetch||(n.fetch=T,n.Headers=u,n.Request=b,n.Response=C),t.Headers=u,t.Request=b,t.Response=C,t.fetch=T,t})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=n.fetch?n:r;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e}));export default t();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});export{l as i,s as n,u as r,o as t};
|