Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@iiif/parser

Package Overview
Dependencies
Maintainers
7
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iiif/parser - npm Package Compare versions

Comparing version
2.1.5
to
2.1.6
+1
-1
dist/image-3.cjs

@@ -1,1 +0,1 @@

"use strict";var y=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var _e=(i,e)=>{for(var t in e)y(i,t,{get:e[t],enumerable:!0})},ye=(i,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of de(e))!Ie.call(i,r)&&r!==t&&y(i,r,{get:()=>e[r],enumerable:!(o=ge(e,r))||o.enumerable});return i};var Fe=i=>ye(y({},"__esModule",{value:!0}),i);var Be={};_e(Be,{IIIF_1_IMAGE_LEVEL_0:()=>G,IIIF_1_IMAGE_LEVEL_0_PROFILE:()=>$,IIIF_1_IMAGE_LEVEL_1:()=>C,IIIF_1_IMAGE_LEVEL_1_PROFILE:()=>T,IIIF_1_IMAGE_LEVEL_2:()=>H,IIIF_1_IMAGE_LEVEL_2_PROFILE:()=>Q,IIIF_2_IMAGE_LEVEL_0:()=>V,IIIF_2_IMAGE_LEVEL_0_NO_JSON:()=>q,IIIF_2_IMAGE_LEVEL_0_PROFILE:()=>D,IIIF_2_IMAGE_LEVEL_1:()=>U,IIIF_2_IMAGE_LEVEL_1_NO_JSON:()=>ee,IIIF_2_IMAGE_LEVEL_1_PROFILE:()=>k,IIIF_2_IMAGE_LEVEL_2:()=>J,IIIF_2_IMAGE_LEVEL_2_NO_JSON:()=>ie,IIIF_2_IMAGE_LEVEL_2_PROFILE:()=>Z,IIIF_3_IMAGE_LEVEL_0:()=>K,IIIF_3_IMAGE_LEVEL_1:()=>X,IIIF_3_IMAGE_LEVEL_2:()=>Y,STANFORD_IIIF_1_IMAGE_COMPLIANCE_0:()=>P,STANFORD_IIIF_1_IMAGE_COMPLIANCE_1:()=>B,STANFORD_IIIF_1_IMAGE_COMPLIANCE_2:()=>b,STANFORD_IIIF_1_IMAGE_CONFORMANCE_0:()=>N,STANFORD_IIIF_1_IMAGE_CONFORMANCE_1:()=>W,STANFORD_IIIF_1_IMAGE_CONFORMANCE_2:()=>j,STANFORD_IIIF_IMAGE_COMPLIANCE_0:()=>v,STANFORD_IIIF_IMAGE_COMPLIANCE_1:()=>O,STANFORD_IIIF_IMAGE_COMPLIANCE_2:()=>L,STANFORD_IIIF_IMAGE_CONFORMANCE_0:()=>R,STANFORD_IIIF_IMAGE_CONFORMANCE_1:()=>w,STANFORD_IIIF_IMAGE_CONFORMANCE_2:()=>M,canonicalServiceUrl:()=>ue,combineProfiles:()=>p,createImageServiceRequest:()=>Re,extraFeatures:()=>I,extractFixedSizeScales:()=>we,fixedSizesFromScales:()=>Me,getId:()=>se,getType:()=>Pe,imageServiceProfiles:()=>d,imageServiceRequestInfo:()=>Le,imageServiceRequestToString:()=>le,imageServiceSupportsFormat:()=>ve,imageServiceSupportsRequest:()=>Oe,isImageService:()=>l,isLevel0:()=>ze,level0:()=>re,level0Support:()=>Ee,level1:()=>oe,level1Support:()=>m,level2:()=>ae,level2Support:()=>g,levelToProfile:()=>ne,onlyLevel0:()=>te,parseImageServerFromId:()=>Se,parseImageServiceRequest:()=>A,parseImageServiceUrl:()=>z,parseRegionParameter:()=>F,parseRotationParameter:()=>E,parseSizeParameter:()=>S,regionParameterToString:()=>fe,rotationParameterToString:()=>pe,sizeParameterToString:()=>me,supports:()=>u,supportsCustomSizes:()=>Ae});module.exports=Fe(Be);function Se(i){let e=i.replace(/(https?:\/\/)?(www.)?/i,"");return e.indexOf("/")!==-1?e.split("/")[0]:e}function F(i){try{if(i==="full")return{full:!0};if(i==="square")return{square:!0};let e=i.startsWith("pct:"),o=i.substr(e?4:0).split(",").map(r=>parseFloat(r));return{x:o[0],y:o[1],w:o[2],h:o[3],percent:e}}catch{throw new Error("Expected 'full', 'square' or 'x,y,w,h'. Found "+i)}}function S(i){let e={upscaled:!1,max:!1,confined:!1};if(i[0]==="^"&&(e.upscaled=!0,i=i.slice(1)),i==="max"||i==="full")return e.max=!0,e.serialiseAsFull=i==="full",e;if(i[0]==="!"&&(e.confined=!0,i=i.slice(1)),i[0]==="p")return e.percentScale=parseFloat(i.slice(4)),e;let t=i.split(",").map(o=>o.trim());return t.length&&(t[0]!==""&&(e.width=parseInt(t[0],10)),t[1]!==""&&(e.height=parseInt(t[1],10))),e}function E(i){let e={angle:0};if(i[0]==="!"&&(e.mirror=!0,i=i.substr(1)),e.angle=parseFloat(i)%360,Number.isNaN(e.angle))throw new Error(`Invalid rotation ${i}`);return e}function z(i,e=""){let t=i.match(/^(([a-zA-Z]+):\/\/([^/]+))?((.*)+)/);if(!t)throw new Error(`Invalid or unknown input ${i}`);let o=t[2],r=t[3],a=t[4];if(a[0]==="/"&&(a=a.substring(1)),e.length>0){if(e[0]==="/"&&(e=e.substring(1)),e!==a.substring(0,e.length))throw new Error(`Path does not start with prefix (path: ${a}, prefix: ${e})`);a=a.substring(e.length)}return{scheme:o,server:r,path:a,prefix:e}}function A(i,e=""){let{path:t,scheme:o,server:r,prefix:a}=z(i,e),n=t.split("/").reverse(),[s,x,f,c,..._]=n,h=_.reverse().filter(Boolean).join("/");if(n.length===1||s==="")return{type:"base",scheme:o,server:r,prefix:a,identifier:h};if(s==="info.json"){let[,...he]=n;return{type:"info",scheme:o,server:r,prefix:a,identifier:he.reverse().filter(Boolean).join("/")}}if(typeof o>"u"||typeof r>"u"||typeof t>"u"||typeof c>"u"||typeof f>"u"||typeof x>"u"||typeof s>"u")throw new Error("Invalid image service URL");let[xe="",ce=""]=s.split(".");return{type:"image",scheme:o,server:r,prefix:a,identifier:h,originalPath:t,region:F(c),size:S(f),rotation:E(x),quality:xe,format:ce}}var v="http://library.stanford.edu/iiif/image-api/compliance.html#level0",O="http://library.stanford.edu/iiif/image-api/compliance.html#level1",L="http://library.stanford.edu/iiif/image-api/compliance.html#level2",R="http://library.stanford.edu/iiif/image-api/conformance.html#level0",w="http://library.stanford.edu/iiif/image-api/conformance.html#level1",M="http://library.stanford.edu/iiif/image-api/conformance.html#level2",P="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",B="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",b="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",N="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",W="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",j="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",G="http://iiif.io/api/image/1/level0.json",$="http://iiif.io/api/image/1/profiles/level0.json",C="http://iiif.io/api/image/1/level1.json",T="http://iiif.io/api/image/1/profiles/level1.json",H="http://iiif.io/api/image/1/level2.json",Q="http://iiif.io/api/image/1/profiles/level2.json",V="http://iiif.io/api/image/2/level0.json",D="http://iiif.io/api/image/2/profiles/level0.json",U="http://iiif.io/api/image/2/level1.json",k="http://iiif.io/api/image/2/profiles/level1.json",J="http://iiif.io/api/image/2/level2.json",Z="http://iiif.io/api/image/2/profiles/level2.json",K="level0",X="level1",Y="level2",q="http://iiif.io/api/image/2/level0",ee="http://iiif.io/api/image/2/level1",ie="http://iiif.io/api/image/2/level2",g=[ie,L,M,b,j,H,Q,J,Z,Y],m=[...g,ee,O,w,B,W,C,T,U,k,X],d=[q,ee,ie,v,O,L,R,w,M,P,B,b,N,W,j,G,$,C,T,H,Q,V,D,U,k,J,Z,K,X,Y],Ee=d,te=[q,v,R,P,N,G,$,V,D,K],re={extraFormats:["jpg"],extraQualities:["default"],extraFeatures:["sizeByWhListed"]},oe={extraFormats:["jpg"],extraQualities:["default"],extraFeatures:["baseUriRedirect","cors","jsonldMediaType","regionByPx","regionSquare","sizeByWhListed","sizeByH","sizeByW","sizeByWh"]},ae={extraFormats:["jpg","png"],extraQualities:["default"],extraFeatures:["baseUriRedirect","cors","jsonldMediaType","regionByPct","regionByPx","regionSquare","rotationBy90s","sizeByWhListed","sizeByConfinedWh","sizeByH","sizeByPct","sizeByW","sizeByWh"]},I=["baseUriRedirect","canonicalLinkHeader","cors","jsonldMediaType","mirroring","profileLinkHeader","regionByPct","regionByPx","regionSquare","rotationArbitrary","rotationBy90s","sizeByConfinedWh","sizeByH","sizeByPct","sizeByW","sizeByWh","sizeUpscaling","sizeByWhListed","sizeByDistortedWh","sizeByForcedWh"];function ne(i){return g.indexOf(i)!==-1?ae:m.indexOf(i)!==-1?oe:re}function p(i){let e=i?Array.isArray(i.profile)?i.profile:[i.profile]:[],t={extraQualities:[],extraFormats:[],extraFeatures:[]};for(let o of e)if(typeof o=="string"&&(o=ne(o)),!!o){if(o.formats)for(let r of o.formats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(o.qualities)for(let r of o.qualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);if(o.supports)for(let r of o.supports)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);if(o.maxHeight&&(t.maxHeight=o.maxHeight),o.maxWidth&&(t.maxWidth=o.maxWidth),o.maxArea&&(t.maxArea=o.maxArea),o.extraFormats)for(let r of o.extraFormats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(o.extraQualities)for(let r of o.extraQualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);if(o.extraFeatures)for(let r of o.extraFeatures)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);o.maxHeight&&(t.maxHeight=o.maxHeight),o.maxWidth&&(t.maxWidth=o.maxWidth),o.maxArea&&(t.maxArea=o.maxArea)}if(i.extraFormats)for(let o of i.extraFormats)t.extraFormats.indexOf(o)===-1&&t.extraFormats.push(o);if(i.extraFeatures)for(let o of i.extraFeatures)t.extraFeatures.indexOf(o)===-1&&t.extraFeatures.push(o);if(i.extraQualities)for(let o of i.extraQualities)t.extraQualities.indexOf(o)===-1&&t.extraQualities.push(o);return t}function ze(i){let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"&&te.indexOf(t)!==-1)return!0;return!1}function se(i){if(i["@id"])return i["@id"];if(i.id)return i.id}function l(i){if(!i||!i.profile||!se(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"&&d.indexOf(t)!==-1)return!0;return!1}function u(i,e){if(!l(i))return[!1,"Not a valid image service"];e.extraFeatures=e.extraFeatures?e.extraFeatures:[];let t=p(i);if(e.exactSize){let o=!1;if(i.sizes)for(let r of i.sizes)r.width&&r.width===e.exactSize.width&&(I.indexOf("sizeByW")!==-1||r.height&&r.height===e.exactSize.height)&&(o=!0),r.height&&r.height===e.exactSize.height&&(I.indexOf("sizeByH")!==-1||r.width&&r.width===e.exactSize.width)&&(o=!0);o||(e.maxWidth=Math.max(e.maxWidth||0,e.exactSize.width||0)||void 0,e.maxHeight=Math.max(e.maxHeight||0,e.exactSize.height||0)||void 0,e.maxArea=Math.max(e.maxArea||0,(e.exactSize.width&&e.exactSize.height?e.exactSize.width*e.exactSize.height:e.maxArea)||0)||void 0,!e.exactSize.height&&e.exactSize.width?e.extraFeatures.indexOf("sizeByW")===-1&&e.extraFeatures.push("sizeByW"):!e.exactSize.width&&e.exactSize.height&&e.extraFeatures.indexOf("sizeByH")===-1&&e.extraFeatures.push("sizeByH"))}if(e.maxArea&&t.maxArea&&e.maxArea>t.maxArea)return[!1,`Max area is ${t.maxArea}`];if(e.maxWidth&&t.maxWidth&&e.maxWidth>t.maxWidth)return[!1,`Max width is ${t.maxWidth}`];if(e.maxHeight&&t.maxHeight&&e.maxHeight>t.maxHeight)return[!1,`Max height is ${t.maxHeight}`];if(e.extraFeatures){let o=[];for(let r of e.extraFeatures)t.extraFeatures.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing features: ${o.join(", ")}`]}if(e.extraFormats){let o=[];for(let r of e.extraFormats)t.extraFormats.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing formats: ${o.join(", ")}`]}if(e.extraQualities){let o=[];for(let r of e.extraQualities)t.extraQualities.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing qualities: ${o.join(", ")}`]}return[!0]}function Ae(i){if(!l(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"){if(m.indexOf(t)!==-1)return!0}else{let o=[...t.supports||[],...t.extraFeatures||[]];if(o.indexOf("regionByPx")!==-1&&(o.indexOf("sizeByW")!==-1||o.indexOf("sizeByWh")!==-1))return!0}return!1}function ve(i,e){return u(i,{extraFormats:[e]})}function Oe(i,e){if(e.type!=="image")return[!0];let t=[];e.rotation.mirror&&t.push("mirroring"),e.region.percent&&t.push("regionByPct"),e.region.square?t.push("regionSquare"):e.region.full||t.push("regionByPx"),e.rotation.angle&&(e.rotation.angle%90?t.push("rotationArbitrary"):t.push("rotationBy90s")),e.size.confined&&t.push("sizeByConfinedWh"),!e.size.width&&e.size.height&&t.push("sizeByH"),e.size.percentScale&&t.push("sizeByPct"),(i.sizes||[]).find(n=>n.width===e.size.width&&!e.size.height||n.height===e.size.height&&!e.size.width||n.height===e.size.height&&n.width===e.size.width)?t.push("sizeByWhListed"):(e.size.width&&!e.size.height&&t.push("sizeByW"),e.size.width&&e.size.height&&t.push("sizeByWh")),e.size.upscaled&&t.push("sizeUpscaling");let[r,a]=u(i,{extraFeatures:t,extraQualities:[e.quality],extraFormats:[e.format],exactSize:e.size});return r?[!0]:[!1,a]}function fe({x:i=0,y:e=0,w:t,h:o,full:r,square:a,percent:n}){if(r)return"full";if(a)return"square";if(typeof t>"u"||typeof o>"u")throw new Error("RegionParameter: invalid region");let s=`${i},${e},${t},${o}`;return n?`pct:${s}`:s}function me({max:i,percentScale:e,upscaled:t,confined:o,width:r,height:a,serialiseAsFull:n}){let s=[];return t&&s.push("^"),i?(s.push(n?"full":"max"),s.join("")):(o&&s.push("!"),e&&s.push(`pct:${e}`),r&&s.push(`${r}`),s.push(","),a&&s.push(`${a}`),s.join(""))}function pe(i){return`${i.mirror?"!":""}${(i.angle||0)%360}`}function le(i,e){let t=i.prefix.startsWith("/")?i.prefix.substr(1):i.prefix,o=`${i.scheme}://${i.server}/${t?`${t}/`:""}${i.identifier}`;if(i.type==="base")return o;if(i.type==="info")return`${o}/info.json`;let{size:r}=i,{region:a,rotation:n,format:s,quality:x}=i;if(e){let f=e["@context"]?Array.isArray(e["@context"])?e["@context"]:[e["@context"]]:[],c=f.indexOf("http://iiif.io/api/image/2/context.json")!==-1,_=f.indexOf("http://iiif.io/api/image/3/context.json")!==-1;if((r.width===e.width&&!r.height||r.height===e.height&&!r.width||r.width===e.width&&r.height===e.height)&&(r={...r,max:!0}),c&&(r.max&&!r.serialiseAsFull&&(r={...r,serialiseAsFull:!0}),!r.max&&r.width&&r.height&&(r={...r,height:void 0})),_&&(r.max&&r.serialiseAsFull&&(r={...r,serialiseAsFull:!1}),r.width&&!r.height&&e.width&&e.height)){let h=e.height/e.width;r={...r,height:Math.ceil(r.width*h)}}}return[o,fe(a),me(r),pe(n),`${x}.${s}`].filter(Boolean).join("/")}function Le(i,e){return le({...i,type:"info"},e)}function ue(i){return i.endsWith("info.json")?i:i.endsWith("/")?`${i}info.json`:`${i}/info.json`}function Re(i){let e=A(ue(i.id));if(e.type!=="info")throw new Error("Invalid service URL");let t=p(i);return{identifier:e.identifier,originalPath:"",server:e.server,prefix:e.prefix,scheme:e.scheme,type:"image",quality:t.extraQualities.indexOf("default")===-1?t.extraQualities[0]:"default",region:{full:!0},size:{max:!0,upscaled:!1,confined:!1},format:"jpg",rotation:{angle:0}}}function we(i,e,t){let o=t.length,r=[];for(let a=0;a<o;a++){let n=t[a];if(!n)continue;let s=n.width;r.push(i/s)}return r}function Me(i,e,t){let o=t.length,r=[];for(let a=0;a<o;a++){let n=t[a];n&&r.push({width:Math.floor(i/n),height:Math.floor(e/n)})}return r}function Pe(i){if(i["@type"])return i["@type"];if(i.type)return i.type}
"use strict";var F=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var _e=(i,e)=>{for(var t in e)F(i,t,{get:e[t],enumerable:!0})},Se=(i,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ie(e))!ye.call(i,r)&&r!==t&&F(i,r,{get:()=>e[r],enumerable:!(o=de(e,r))||o.enumerable});return i};var Fe=i=>Se(F({},"__esModule",{value:!0}),i);var je={};_e(je,{IIIF_1_IMAGE_LEVEL_0:()=>C,IIIF_1_IMAGE_LEVEL_0_PROFILE:()=>T,IIIF_1_IMAGE_LEVEL_1:()=>H,IIIF_1_IMAGE_LEVEL_1_PROFILE:()=>Q,IIIF_1_IMAGE_LEVEL_2:()=>V,IIIF_1_IMAGE_LEVEL_2_PROFILE:()=>D,IIIF_2_IMAGE_LEVEL_0:()=>U,IIIF_2_IMAGE_LEVEL_0_NO_JSON:()=>ie,IIIF_2_IMAGE_LEVEL_0_PROFILE:()=>k,IIIF_2_IMAGE_LEVEL_1:()=>J,IIIF_2_IMAGE_LEVEL_1_NO_JSON:()=>te,IIIF_2_IMAGE_LEVEL_1_PROFILE:()=>Z,IIIF_2_IMAGE_LEVEL_2:()=>K,IIIF_2_IMAGE_LEVEL_2_NO_JSON:()=>re,IIIF_2_IMAGE_LEVEL_2_PROFILE:()=>X,IIIF_3_IMAGE_LEVEL_0:()=>Y,IIIF_3_IMAGE_LEVEL_1:()=>q,IIIF_3_IMAGE_LEVEL_2:()=>ee,STANFORD_IIIF_1_IMAGE_COMPLIANCE_0:()=>b,STANFORD_IIIF_1_IMAGE_COMPLIANCE_1:()=>N,STANFORD_IIIF_1_IMAGE_COMPLIANCE_2:()=>W,STANFORD_IIIF_1_IMAGE_CONFORMANCE_0:()=>j,STANFORD_IIIF_1_IMAGE_CONFORMANCE_1:()=>$,STANFORD_IIIF_1_IMAGE_CONFORMANCE_2:()=>G,STANFORD_IIIF_IMAGE_COMPLIANCE_0:()=>L,STANFORD_IIIF_IMAGE_COMPLIANCE_1:()=>R,STANFORD_IIIF_IMAGE_COMPLIANCE_2:()=>w,STANFORD_IIIF_IMAGE_CONFORMANCE_0:()=>P,STANFORD_IIIF_IMAGE_CONFORMANCE_1:()=>M,STANFORD_IIIF_IMAGE_CONFORMANCE_2:()=>B,canonicalServiceUrl:()=>xe,combineProfiles:()=>c,createImageServiceRequest:()=>we,extraFeatures:()=>_,extractFixedSizeScales:()=>Pe,fixedSizesFromScales:()=>Me,getId:()=>fe,getImageServiceLevel:()=>Be,getImageServices:()=>be,getType:()=>Ne,identifyImageServer:()=>We,imageServiceProfiles:()=>y,imageServiceRequestInfo:()=>Re,imageServiceRequestToString:()=>ue,imageServiceSupportsFormat:()=>Oe,imageServiceSupportsRequest:()=>Le,isImageService:()=>m,isImageServiceLevel:()=>h,isLevel0:()=>ze,level0:()=>oe,level0Support:()=>Ee,level1:()=>ae,level1Support:()=>p,level2:()=>ne,level2Support:()=>l,levelToProfile:()=>se,onlyLevel0:()=>x,parseImageServerFromId:()=>ve,parseImageServiceRequest:()=>O,parseImageServiceUrl:()=>A,parseRegionParameter:()=>v,parseRotationParameter:()=>z,parseSizeParameter:()=>E,regionParameterToString:()=>me,rotationParameterToString:()=>le,sizeParameterToString:()=>pe,supports:()=>g,supportsCustomSizes:()=>Ae});module.exports=Fe(je);function ve(i){let e=i.replace(/(https?:\/\/)?(www.)?/i,"");return e.indexOf("/")!==-1?e.split("/")[0]:e}function v(i){try{if(i==="full")return{full:!0};if(i==="square")return{square:!0};let e=i.startsWith("pct:"),o=i.substr(e?4:0).split(",").map(r=>parseFloat(r));return{x:o[0],y:o[1],w:o[2],h:o[3],percent:e}}catch{throw new Error("Expected 'full', 'square' or 'x,y,w,h'. Found "+i)}}function E(i){let e={upscaled:!1,max:!1,confined:!1};if(i[0]==="^"&&(e.upscaled=!0,i=i.slice(1)),i==="max"||i==="full")return e.max=!0,e.serialiseAsFull=i==="full",e;if(i[0]==="!"&&(e.confined=!0,i=i.slice(1)),i[0]==="p")return e.percentScale=parseFloat(i.slice(4)),e;let t=i.split(",").map(o=>o.trim());return t.length&&(t[0]!==""&&(e.width=parseInt(t[0],10)),t[1]!==""&&(e.height=parseInt(t[1],10))),e}function z(i){let e={angle:0};if(i[0]==="!"&&(e.mirror=!0,i=i.substr(1)),e.angle=parseFloat(i)%360,Number.isNaN(e.angle))throw new Error(`Invalid rotation ${i}`);return e}function A(i,e=""){let t=i.match(/^(([a-zA-Z]+):\/\/([^/]+))?((.*)+)/);if(!t)throw new Error(`Invalid or unknown input ${i}`);let o=t[2],r=t[3],a=t[4];if(a[0]==="/"&&(a=a.substring(1)),e.length>0){if(e[0]==="/"&&(e=e.substring(1)),e!==a.substring(0,e.length))throw new Error(`Path does not start with prefix (path: ${a}, prefix: ${e})`);a=a.substring(e.length)}return{scheme:o,server:r,path:a,prefix:e}}function O(i,e=""){let{path:t,scheme:o,server:r,prefix:a}=A(i,e),n=t.split("/").reverse(),[f,s,u,d,...S]=n,I=S.reverse().filter(Boolean).join("/");if(n.length===1||f==="")return{type:"base",scheme:o,server:r,prefix:a,identifier:I};if(f==="info.json"){let[,...he]=n;return{type:"info",scheme:o,server:r,prefix:a,identifier:he.reverse().filter(Boolean).join("/")}}if(typeof o>"u"||typeof r>"u"||typeof t>"u"||typeof d>"u"||typeof u>"u"||typeof s>"u"||typeof f>"u")throw new Error("Invalid image service URL");let[ce="",ge=""]=f.split(".");return{type:"image",scheme:o,server:r,prefix:a,identifier:I,originalPath:t,region:v(d),size:E(u),rotation:z(s),quality:ce,format:ge}}var L="http://library.stanford.edu/iiif/image-api/compliance.html#level0",R="http://library.stanford.edu/iiif/image-api/compliance.html#level1",w="http://library.stanford.edu/iiif/image-api/compliance.html#level2",P="http://library.stanford.edu/iiif/image-api/conformance.html#level0",M="http://library.stanford.edu/iiif/image-api/conformance.html#level1",B="http://library.stanford.edu/iiif/image-api/conformance.html#level2",b="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",N="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",W="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",j="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",$="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",G="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",C="http://iiif.io/api/image/1/level0.json",T="http://iiif.io/api/image/1/profiles/level0.json",H="http://iiif.io/api/image/1/level1.json",Q="http://iiif.io/api/image/1/profiles/level1.json",V="http://iiif.io/api/image/1/level2.json",D="http://iiif.io/api/image/1/profiles/level2.json",U="http://iiif.io/api/image/2/level0.json",k="http://iiif.io/api/image/2/profiles/level0.json",J="http://iiif.io/api/image/2/level1.json",Z="http://iiif.io/api/image/2/profiles/level1.json",K="http://iiif.io/api/image/2/level2.json",X="http://iiif.io/api/image/2/profiles/level2.json",Y="level0",q="level1",ee="level2",ie="http://iiif.io/api/image/2/level0",te="http://iiif.io/api/image/2/level1",re="http://iiif.io/api/image/2/level2",l=[re,w,B,W,G,V,D,K,X,ee],p=[...l,te,R,M,N,$,H,Q,J,Z,q],y=[ie,te,re,L,R,w,P,M,B,b,N,W,j,$,G,C,T,H,Q,V,D,U,k,J,Z,K,X,Y,q,ee],Ee=y,x=[ie,L,P,b,j,C,T,U,k,Y],oe={extraFormats:["jpg"],extraQualities:["default"],extraFeatures:["sizeByWhListed"]},ae={extraFormats:["jpg"],extraQualities:["default"],extraFeatures:["baseUriRedirect","cors","jsonldMediaType","regionByPx","regionSquare","sizeByWhListed","sizeByH","sizeByW","sizeByWh"]},ne={extraFormats:["jpg","png"],extraQualities:["default"],extraFeatures:["baseUriRedirect","cors","jsonldMediaType","regionByPct","regionByPx","regionSquare","rotationBy90s","sizeByWhListed","sizeByConfinedWh","sizeByH","sizeByPct","sizeByW","sizeByWh"]},_=["baseUriRedirect","canonicalLinkHeader","cors","jsonldMediaType","mirroring","profileLinkHeader","regionByPct","regionByPx","regionSquare","rotationArbitrary","rotationBy90s","sizeByConfinedWh","sizeByH","sizeByPct","sizeByW","sizeByWh","sizeUpscaling","sizeByWhListed","sizeByDistortedWh","sizeByForcedWh"];function se(i){return l.indexOf(i)!==-1?ne:p.indexOf(i)!==-1?ae:oe}function c(i){let e=i?Array.isArray(i.profile)?i.profile:[i.profile]:[],t={extraQualities:[],extraFormats:[],extraFeatures:[]};for(let o of e)if(typeof o=="string"&&(o=se(o)),!!o){if(o.formats)for(let r of o.formats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(o.qualities)for(let r of o.qualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);if(o.supports)for(let r of o.supports)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);if(o.maxHeight&&(t.maxHeight=o.maxHeight),o.maxWidth&&(t.maxWidth=o.maxWidth),o.maxArea&&(t.maxArea=o.maxArea),o.extraFormats)for(let r of o.extraFormats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(o.extraQualities)for(let r of o.extraQualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);if(o.extraFeatures)for(let r of o.extraFeatures)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);o.maxHeight&&(t.maxHeight=o.maxHeight),o.maxWidth&&(t.maxWidth=o.maxWidth),o.maxArea&&(t.maxArea=o.maxArea)}if(i.extraFormats)for(let o of i.extraFormats)t.extraFormats.indexOf(o)===-1&&t.extraFormats.push(o);if(i.extraFeatures)for(let o of i.extraFeatures)t.extraFeatures.indexOf(o)===-1&&t.extraFeatures.push(o);if(i.extraQualities)for(let o of i.extraQualities)t.extraQualities.indexOf(o)===-1&&t.extraQualities.push(o);return t}function ze(i){let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"&&x.indexOf(t)!==-1)return!0;return!1}function fe(i){if(i["@id"])return i["@id"];if(i.id)return i.id}function m(i){if(!i||!i.profile||!fe(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"&&y.indexOf(t)!==-1)return!0;return!1}function g(i,e){if(!m(i))return[!1,"Not a valid image service"];e.extraFeatures=e.extraFeatures?e.extraFeatures:[];let t=c(i);if(e.exactSize){let o=!1;if(i.sizes)for(let r of i.sizes)r.width&&r.width===e.exactSize.width&&(_.indexOf("sizeByW")!==-1||r.height&&r.height===e.exactSize.height)&&(o=!0),r.height&&r.height===e.exactSize.height&&(_.indexOf("sizeByH")!==-1||r.width&&r.width===e.exactSize.width)&&(o=!0);o||(e.maxWidth=Math.max(e.maxWidth||0,e.exactSize.width||0)||void 0,e.maxHeight=Math.max(e.maxHeight||0,e.exactSize.height||0)||void 0,e.maxArea=Math.max(e.maxArea||0,(e.exactSize.width&&e.exactSize.height?e.exactSize.width*e.exactSize.height:e.maxArea)||0)||void 0,!e.exactSize.height&&e.exactSize.width?e.extraFeatures.indexOf("sizeByW")===-1&&e.extraFeatures.push("sizeByW"):!e.exactSize.width&&e.exactSize.height&&e.extraFeatures.indexOf("sizeByH")===-1&&e.extraFeatures.push("sizeByH"))}if(e.maxArea&&t.maxArea&&e.maxArea>t.maxArea)return[!1,`Max area is ${t.maxArea}`];if(e.maxWidth&&t.maxWidth&&e.maxWidth>t.maxWidth)return[!1,`Max width is ${t.maxWidth}`];if(e.maxHeight&&t.maxHeight&&e.maxHeight>t.maxHeight)return[!1,`Max height is ${t.maxHeight}`];if(e.extraFeatures){let o=[];for(let r of e.extraFeatures)t.extraFeatures.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing features: ${o.join(", ")}`]}if(e.extraFormats){let o=[];for(let r of e.extraFormats)t.extraFormats.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing formats: ${o.join(", ")}`]}if(e.extraQualities){let o=[];for(let r of e.extraQualities)t.extraQualities.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing qualities: ${o.join(", ")}`]}return[!0]}function Ae(i){if(!m(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"){if(p.indexOf(t)!==-1)return!0}else{let o=[...t.supports||[],...t.extraFeatures||[]];if(o.indexOf("regionByPx")!==-1&&(o.indexOf("sizeByW")!==-1||o.indexOf("sizeByWh")!==-1))return!0}return!1}function Oe(i,e){return g(i,{extraFormats:[e]})}function Le(i,e){if(e.type!=="image")return[!0];let t=[];e.rotation.mirror&&t.push("mirroring"),e.region.percent&&t.push("regionByPct"),e.region.square?t.push("regionSquare"):e.region.full||t.push("regionByPx"),e.rotation.angle&&(e.rotation.angle%90?t.push("rotationArbitrary"):t.push("rotationBy90s")),e.size.confined&&t.push("sizeByConfinedWh"),!e.size.width&&e.size.height&&t.push("sizeByH"),e.size.percentScale&&t.push("sizeByPct"),(i.sizes||[]).find(n=>n.width===e.size.width&&!e.size.height||n.height===e.size.height&&!e.size.width||n.height===e.size.height&&n.width===e.size.width)?t.push("sizeByWhListed"):(e.size.width&&!e.size.height&&t.push("sizeByW"),e.size.width&&e.size.height&&t.push("sizeByWh")),e.size.upscaled&&t.push("sizeUpscaling");let[r,a]=g(i,{extraFeatures:t,extraQualities:[e.quality],extraFormats:[e.format],exactSize:e.size});return r?[!0]:[!1,a]}function me({x:i=0,y:e=0,w:t,h:o,full:r,square:a,percent:n}){if(r)return"full";if(a)return"square";if(typeof t>"u"||typeof o>"u")throw new Error("RegionParameter: invalid region");let f=`${i},${e},${t},${o}`;return n?`pct:${f}`:f}function pe({max:i,percentScale:e,upscaled:t,confined:o,width:r,height:a,serialiseAsFull:n,version:f}){let s=[];return t&&s.push("^"),i?(s.push(n?"full":"max"),s.join("")):(o&&s.push("!"),e&&s.push(`pct:${e}`),r&&s.push(`${r}`),s.push(","),a&&f===3&&s.push(`${a}`),s.join(""))}function le(i){return`${i.mirror?"!":""}${(i.angle||0)%360}`}function ue(i,e){let t=i.prefix.startsWith("/")?i.prefix.substring(1):i.prefix,o=`${i.scheme}://${i.server}/${t?`${t}/`:""}${i.identifier}`;if(i.type==="base")return o;if(i.type==="info")return`${o}/info.json`;let{size:r}=i,{region:a,rotation:n,format:f,quality:s}=i;if(e){let u=e["@context"]?Array.isArray(e["@context"])?e["@context"]:[e["@context"]]:[],d=u.indexOf("http://iiif.io/api/image/2/context.json")!==-1,S=u.indexOf("http://iiif.io/api/image/3/context.json")!==-1;if((r.width===e.width&&!r.height||r.height===e.height&&!r.width||r.width===e.width&&r.height===e.height)&&(r={...r,max:!0}),d&&(r.max&&!r.serialiseAsFull&&(r={...r,serialiseAsFull:!0}),!r.max&&r.width&&r.height&&(r={...r,height:void 0}),r={...r,version:2}),S){if(r.max&&r.serialiseAsFull&&(r={...r,serialiseAsFull:!1}),r.width&&!r.height&&e.width&&e.height){let I=e.height/e.width;r={...r,height:Math.ceil(r.width*I)}}r={...r,version:3}}}return[o,me(a),pe(r),le(n),`${s}.${f}`].filter(Boolean).join("/")}function Re(i,e){return ue({...i,type:"info"},e)}function xe(i){return i.endsWith("info.json")?i:i.endsWith("/")?`${i}info.json`:`${i}/info.json`}function we(i){let e=O(xe(i.id));if(e.type!=="info")throw new Error("Invalid service URL");let t=c(i);return{identifier:e.identifier,originalPath:"",server:e.server,prefix:e.prefix,scheme:e.scheme,type:"image",quality:t.extraQualities.indexOf("default")===-1?t.extraQualities[0]:"default",region:{full:!0},size:{max:!0,upscaled:!1,confined:!1},format:"jpg",rotation:{angle:0}}}function Pe(i,e,t){let o=t.length,r=[];for(let a=0;a<o;a++){let n=t[a];if(!n)continue;let f=n.width;r.push(i/f)}return r}function Me(i,e,t){let o=t.length,r=[];for(let a=0;a<o;a++){let n=t[a];n&&r.push({width:Math.floor(i/n),height:Math.floor(e/n)})}return r}function h(i,e){if(e&&e.profile){let t=e.profile;if(t){let o=Array.isArray(t)?t:[t];if(o.includes(`level${i}`)||o.includes(`http://iiif.io/api/image/2/level${i}.json`)||o.includes(`http://iiif.io/api/image/1/level${i}.json`)||o.includes(`http://iiif.io/api/image/1/profiles/level${i}.json`))return!0;if(i===2){for(let r of o)if(l.includes(r))return!0}if(i===1){for(let r of o)if(p.includes(r))return!0}if(i===0){for(let r of o)if(x.includes(r))return!0}}}return!1}function Be(i){return m(i)?h(0,i)?0:h(1,i)?1:h(2,i)?2:null:null}function be(i){let e=i.service?Array.isArray(i.service)?i.service:[i.service]:[],t=e.length,o=[];for(let r=0;r<t;r++)m(e[r])&&o.push(e[r]);return o}function Ne(i){if(i["@type"])return i["@type"];if(i.type)return i.type}function We(i){let e=i.replace(/(https?:\/\/)?(www.)?/i,"");return e.indexOf("/")!==-1?e.split("/")[0]:e}

@@ -1,2 +0,2 @@

import { ImageService, ImageSize } from '@iiif/presentation-3';
import { ImageService, ImageSize, Service } from '@iiif/presentation-3';

@@ -18,2 +18,3 @@ /**

percentScale?: number;
version?: 2 | 3;
};

@@ -173,3 +174,3 @@ /**

declare function sizeParameterToString({ max, percentScale, upscaled, confined, width, height, serialiseAsFull, }: SizeParameter): string;
declare function sizeParameterToString({ max, percentScale, upscaled, confined, width, height, serialiseAsFull, version, }: SizeParameter): string;

@@ -212,6 +213,28 @@ /**

declare function getImageServiceLevel(service: ImageService): null | number;
/**
* Given a resource, will return only the image services on that resource.
*
* @param resource
*/
declare function getImageServices(resource: {
service: Array<Service>;
}): ImageService[];
declare function getType(resource: any): any;
/**
* Get image server from ID.
*
* Normalises image service URLs to extract identity of the image server.
*
* @param url
*/
declare function identifyImageServer(url: string): string;
declare function isImageService(service: any): service is ImageService;
export { type ExtraFeature, IIIF_1_IMAGE_LEVEL_0, IIIF_1_IMAGE_LEVEL_0_PROFILE, IIIF_1_IMAGE_LEVEL_1, IIIF_1_IMAGE_LEVEL_1_PROFILE, IIIF_1_IMAGE_LEVEL_2, IIIF_1_IMAGE_LEVEL_2_PROFILE, IIIF_2_IMAGE_LEVEL_0, IIIF_2_IMAGE_LEVEL_0_NO_JSON, IIIF_2_IMAGE_LEVEL_0_PROFILE, IIIF_2_IMAGE_LEVEL_1, IIIF_2_IMAGE_LEVEL_1_NO_JSON, IIIF_2_IMAGE_LEVEL_1_PROFILE, IIIF_2_IMAGE_LEVEL_2, IIIF_2_IMAGE_LEVEL_2_NO_JSON, IIIF_2_IMAGE_LEVEL_2_PROFILE, IIIF_3_IMAGE_LEVEL_0, IIIF_3_IMAGE_LEVEL_1, IIIF_3_IMAGE_LEVEL_2, type ImageServiceImageRequest, type Profile, type RegionParameter, type RotationParameter, STANFORD_IIIF_1_IMAGE_COMPLIANCE_0, STANFORD_IIIF_1_IMAGE_COMPLIANCE_1, STANFORD_IIIF_1_IMAGE_COMPLIANCE_2, STANFORD_IIIF_1_IMAGE_CONFORMANCE_0, STANFORD_IIIF_1_IMAGE_CONFORMANCE_1, STANFORD_IIIF_1_IMAGE_CONFORMANCE_2, STANFORD_IIIF_IMAGE_COMPLIANCE_0, STANFORD_IIIF_IMAGE_COMPLIANCE_1, STANFORD_IIIF_IMAGE_COMPLIANCE_2, STANFORD_IIIF_IMAGE_CONFORMANCE_0, STANFORD_IIIF_IMAGE_CONFORMANCE_1, STANFORD_IIIF_IMAGE_CONFORMANCE_2, type SizeParameter, canonicalServiceUrl, combineProfiles, createImageServiceRequest, extraFeatures, extractFixedSizeScales, fixedSizesFromScales, getId, getType, imageServiceProfiles, imageServiceRequestInfo, imageServiceRequestToString, imageServiceSupportsFormat, imageServiceSupportsRequest, isImageService, isLevel0, level0, level0Support, level1, level1Support, level2, level2Support, levelToProfile, onlyLevel0, parseImageServerFromId, parseImageServiceRequest, parseImageServiceUrl, parseRegionParameter, parseRotationParameter, parseSizeParameter, regionParameterToString, rotationParameterToString, sizeParameterToString, supports, supportsCustomSizes };
declare function isImageServiceLevel(level: 0 | 1 | 2, imageService?: ImageService): boolean;
export { type ExtraFeature, IIIF_1_IMAGE_LEVEL_0, IIIF_1_IMAGE_LEVEL_0_PROFILE, IIIF_1_IMAGE_LEVEL_1, IIIF_1_IMAGE_LEVEL_1_PROFILE, IIIF_1_IMAGE_LEVEL_2, IIIF_1_IMAGE_LEVEL_2_PROFILE, IIIF_2_IMAGE_LEVEL_0, IIIF_2_IMAGE_LEVEL_0_NO_JSON, IIIF_2_IMAGE_LEVEL_0_PROFILE, IIIF_2_IMAGE_LEVEL_1, IIIF_2_IMAGE_LEVEL_1_NO_JSON, IIIF_2_IMAGE_LEVEL_1_PROFILE, IIIF_2_IMAGE_LEVEL_2, IIIF_2_IMAGE_LEVEL_2_NO_JSON, IIIF_2_IMAGE_LEVEL_2_PROFILE, IIIF_3_IMAGE_LEVEL_0, IIIF_3_IMAGE_LEVEL_1, IIIF_3_IMAGE_LEVEL_2, type ImageServiceImageRequest, type Profile, type RegionParameter, type RotationParameter, STANFORD_IIIF_1_IMAGE_COMPLIANCE_0, STANFORD_IIIF_1_IMAGE_COMPLIANCE_1, STANFORD_IIIF_1_IMAGE_COMPLIANCE_2, STANFORD_IIIF_1_IMAGE_CONFORMANCE_0, STANFORD_IIIF_1_IMAGE_CONFORMANCE_1, STANFORD_IIIF_1_IMAGE_CONFORMANCE_2, STANFORD_IIIF_IMAGE_COMPLIANCE_0, STANFORD_IIIF_IMAGE_COMPLIANCE_1, STANFORD_IIIF_IMAGE_COMPLIANCE_2, STANFORD_IIIF_IMAGE_CONFORMANCE_0, STANFORD_IIIF_IMAGE_CONFORMANCE_1, STANFORD_IIIF_IMAGE_CONFORMANCE_2, type SizeParameter, canonicalServiceUrl, combineProfiles, createImageServiceRequest, extraFeatures, extractFixedSizeScales, fixedSizesFromScales, getId, getImageServiceLevel, getImageServices, getType, identifyImageServer, imageServiceProfiles, imageServiceRequestInfo, imageServiceRequestToString, imageServiceSupportsFormat, imageServiceSupportsRequest, isImageService, isImageServiceLevel, isLevel0, level0, level0Support, level1, level1Support, level2, level2Support, levelToProfile, onlyLevel0, parseImageServerFromId, parseImageServiceRequest, parseImageServiceUrl, parseRegionParameter, parseRotationParameter, parseSizeParameter, regionParameterToString, rotationParameterToString, sizeParameterToString, supports, supportsCustomSizes };

@@ -1,2 +0,2 @@

import { ImageService, ImageSize } from '@iiif/presentation-3';
import { ImageService, ImageSize, Service } from '@iiif/presentation-3';

@@ -18,2 +18,3 @@ /**

percentScale?: number;
version?: 2 | 3;
};

@@ -173,3 +174,3 @@ /**

declare function sizeParameterToString({ max, percentScale, upscaled, confined, width, height, serialiseAsFull, }: SizeParameter): string;
declare function sizeParameterToString({ max, percentScale, upscaled, confined, width, height, serialiseAsFull, version, }: SizeParameter): string;

@@ -212,6 +213,28 @@ /**

declare function getImageServiceLevel(service: ImageService): null | number;
/**
* Given a resource, will return only the image services on that resource.
*
* @param resource
*/
declare function getImageServices(resource: {
service: Array<Service>;
}): ImageService[];
declare function getType(resource: any): any;
/**
* Get image server from ID.
*
* Normalises image service URLs to extract identity of the image server.
*
* @param url
*/
declare function identifyImageServer(url: string): string;
declare function isImageService(service: any): service is ImageService;
export { type ExtraFeature, IIIF_1_IMAGE_LEVEL_0, IIIF_1_IMAGE_LEVEL_0_PROFILE, IIIF_1_IMAGE_LEVEL_1, IIIF_1_IMAGE_LEVEL_1_PROFILE, IIIF_1_IMAGE_LEVEL_2, IIIF_1_IMAGE_LEVEL_2_PROFILE, IIIF_2_IMAGE_LEVEL_0, IIIF_2_IMAGE_LEVEL_0_NO_JSON, IIIF_2_IMAGE_LEVEL_0_PROFILE, IIIF_2_IMAGE_LEVEL_1, IIIF_2_IMAGE_LEVEL_1_NO_JSON, IIIF_2_IMAGE_LEVEL_1_PROFILE, IIIF_2_IMAGE_LEVEL_2, IIIF_2_IMAGE_LEVEL_2_NO_JSON, IIIF_2_IMAGE_LEVEL_2_PROFILE, IIIF_3_IMAGE_LEVEL_0, IIIF_3_IMAGE_LEVEL_1, IIIF_3_IMAGE_LEVEL_2, type ImageServiceImageRequest, type Profile, type RegionParameter, type RotationParameter, STANFORD_IIIF_1_IMAGE_COMPLIANCE_0, STANFORD_IIIF_1_IMAGE_COMPLIANCE_1, STANFORD_IIIF_1_IMAGE_COMPLIANCE_2, STANFORD_IIIF_1_IMAGE_CONFORMANCE_0, STANFORD_IIIF_1_IMAGE_CONFORMANCE_1, STANFORD_IIIF_1_IMAGE_CONFORMANCE_2, STANFORD_IIIF_IMAGE_COMPLIANCE_0, STANFORD_IIIF_IMAGE_COMPLIANCE_1, STANFORD_IIIF_IMAGE_COMPLIANCE_2, STANFORD_IIIF_IMAGE_CONFORMANCE_0, STANFORD_IIIF_IMAGE_CONFORMANCE_1, STANFORD_IIIF_IMAGE_CONFORMANCE_2, type SizeParameter, canonicalServiceUrl, combineProfiles, createImageServiceRequest, extraFeatures, extractFixedSizeScales, fixedSizesFromScales, getId, getType, imageServiceProfiles, imageServiceRequestInfo, imageServiceRequestToString, imageServiceSupportsFormat, imageServiceSupportsRequest, isImageService, isLevel0, level0, level0Support, level1, level1Support, level2, level2Support, levelToProfile, onlyLevel0, parseImageServerFromId, parseImageServiceRequest, parseImageServiceUrl, parseRegionParameter, parseRotationParameter, parseSizeParameter, regionParameterToString, rotationParameterToString, sizeParameterToString, supports, supportsCustomSizes };
declare function isImageServiceLevel(level: 0 | 1 | 2, imageService?: ImageService): boolean;
export { type ExtraFeature, IIIF_1_IMAGE_LEVEL_0, IIIF_1_IMAGE_LEVEL_0_PROFILE, IIIF_1_IMAGE_LEVEL_1, IIIF_1_IMAGE_LEVEL_1_PROFILE, IIIF_1_IMAGE_LEVEL_2, IIIF_1_IMAGE_LEVEL_2_PROFILE, IIIF_2_IMAGE_LEVEL_0, IIIF_2_IMAGE_LEVEL_0_NO_JSON, IIIF_2_IMAGE_LEVEL_0_PROFILE, IIIF_2_IMAGE_LEVEL_1, IIIF_2_IMAGE_LEVEL_1_NO_JSON, IIIF_2_IMAGE_LEVEL_1_PROFILE, IIIF_2_IMAGE_LEVEL_2, IIIF_2_IMAGE_LEVEL_2_NO_JSON, IIIF_2_IMAGE_LEVEL_2_PROFILE, IIIF_3_IMAGE_LEVEL_0, IIIF_3_IMAGE_LEVEL_1, IIIF_3_IMAGE_LEVEL_2, type ImageServiceImageRequest, type Profile, type RegionParameter, type RotationParameter, STANFORD_IIIF_1_IMAGE_COMPLIANCE_0, STANFORD_IIIF_1_IMAGE_COMPLIANCE_1, STANFORD_IIIF_1_IMAGE_COMPLIANCE_2, STANFORD_IIIF_1_IMAGE_CONFORMANCE_0, STANFORD_IIIF_1_IMAGE_CONFORMANCE_1, STANFORD_IIIF_1_IMAGE_CONFORMANCE_2, STANFORD_IIIF_IMAGE_COMPLIANCE_0, STANFORD_IIIF_IMAGE_COMPLIANCE_1, STANFORD_IIIF_IMAGE_COMPLIANCE_2, STANFORD_IIIF_IMAGE_CONFORMANCE_0, STANFORD_IIIF_IMAGE_CONFORMANCE_1, STANFORD_IIIF_IMAGE_CONFORMANCE_2, type SizeParameter, canonicalServiceUrl, combineProfiles, createImageServiceRequest, extraFeatures, extractFixedSizeScales, fixedSizesFromScales, getId, getImageServiceLevel, getImageServices, getType, identifyImageServer, imageServiceProfiles, imageServiceRequestInfo, imageServiceRequestToString, imageServiceSupportsFormat, imageServiceSupportsRequest, isImageService, isImageServiceLevel, isLevel0, level0, level0Support, level1, level1Support, level2, level2Support, levelToProfile, onlyLevel0, parseImageServerFromId, parseImageServiceRequest, parseImageServiceUrl, parseRegionParameter, parseRotationParameter, parseSizeParameter, regionParameterToString, rotationParameterToString, sizeParameterToString, supports, supportsCustomSizes };

@@ -1,1 +0,1 @@

"use strict";var IIIFParser=(()=>{var y=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var Ie=Object.prototype.hasOwnProperty;var _e=(i,e)=>{for(var t in e)y(i,t,{get:e[t],enumerable:!0})},ye=(i,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of de(e))!Ie.call(i,r)&&r!==t&&y(i,r,{get:()=>e[r],enumerable:!(o=ge(e,r))||o.enumerable});return i};var Fe=i=>ye(y({},"__esModule",{value:!0}),i);var Be={};_e(Be,{IIIF_1_IMAGE_LEVEL_0:()=>G,IIIF_1_IMAGE_LEVEL_0_PROFILE:()=>$,IIIF_1_IMAGE_LEVEL_1:()=>C,IIIF_1_IMAGE_LEVEL_1_PROFILE:()=>T,IIIF_1_IMAGE_LEVEL_2:()=>H,IIIF_1_IMAGE_LEVEL_2_PROFILE:()=>Q,IIIF_2_IMAGE_LEVEL_0:()=>V,IIIF_2_IMAGE_LEVEL_0_NO_JSON:()=>q,IIIF_2_IMAGE_LEVEL_0_PROFILE:()=>D,IIIF_2_IMAGE_LEVEL_1:()=>U,IIIF_2_IMAGE_LEVEL_1_NO_JSON:()=>ee,IIIF_2_IMAGE_LEVEL_1_PROFILE:()=>k,IIIF_2_IMAGE_LEVEL_2:()=>J,IIIF_2_IMAGE_LEVEL_2_NO_JSON:()=>ie,IIIF_2_IMAGE_LEVEL_2_PROFILE:()=>Z,IIIF_3_IMAGE_LEVEL_0:()=>K,IIIF_3_IMAGE_LEVEL_1:()=>X,IIIF_3_IMAGE_LEVEL_2:()=>Y,STANFORD_IIIF_1_IMAGE_COMPLIANCE_0:()=>P,STANFORD_IIIF_1_IMAGE_COMPLIANCE_1:()=>B,STANFORD_IIIF_1_IMAGE_COMPLIANCE_2:()=>b,STANFORD_IIIF_1_IMAGE_CONFORMANCE_0:()=>N,STANFORD_IIIF_1_IMAGE_CONFORMANCE_1:()=>W,STANFORD_IIIF_1_IMAGE_CONFORMANCE_2:()=>j,STANFORD_IIIF_IMAGE_COMPLIANCE_0:()=>v,STANFORD_IIIF_IMAGE_COMPLIANCE_1:()=>O,STANFORD_IIIF_IMAGE_COMPLIANCE_2:()=>L,STANFORD_IIIF_IMAGE_CONFORMANCE_0:()=>R,STANFORD_IIIF_IMAGE_CONFORMANCE_1:()=>w,STANFORD_IIIF_IMAGE_CONFORMANCE_2:()=>M,canonicalServiceUrl:()=>ue,combineProfiles:()=>p,createImageServiceRequest:()=>Re,extraFeatures:()=>I,extractFixedSizeScales:()=>we,fixedSizesFromScales:()=>Me,getId:()=>se,getType:()=>Pe,imageServiceProfiles:()=>d,imageServiceRequestInfo:()=>Le,imageServiceRequestToString:()=>le,imageServiceSupportsFormat:()=>ve,imageServiceSupportsRequest:()=>Oe,isImageService:()=>l,isLevel0:()=>ze,level0:()=>re,level0Support:()=>Ee,level1:()=>oe,level1Support:()=>m,level2:()=>ae,level2Support:()=>g,levelToProfile:()=>ne,onlyLevel0:()=>te,parseImageServerFromId:()=>Se,parseImageServiceRequest:()=>A,parseImageServiceUrl:()=>z,parseRegionParameter:()=>F,parseRotationParameter:()=>E,parseSizeParameter:()=>S,regionParameterToString:()=>fe,rotationParameterToString:()=>pe,sizeParameterToString:()=>me,supports:()=>u,supportsCustomSizes:()=>Ae});function Se(i){let e=i.replace(/(https?:\/\/)?(www.)?/i,"");return e.indexOf("/")!==-1?e.split("/")[0]:e}function F(i){try{if(i==="full")return{full:!0};if(i==="square")return{square:!0};let e=i.startsWith("pct:"),o=i.substr(e?4:0).split(",").map(r=>parseFloat(r));return{x:o[0],y:o[1],w:o[2],h:o[3],percent:e}}catch{throw new Error("Expected 'full', 'square' or 'x,y,w,h'. Found "+i)}}function S(i){let e={upscaled:!1,max:!1,confined:!1};if(i[0]==="^"&&(e.upscaled=!0,i=i.slice(1)),i==="max"||i==="full")return e.max=!0,e.serialiseAsFull=i==="full",e;if(i[0]==="!"&&(e.confined=!0,i=i.slice(1)),i[0]==="p")return e.percentScale=parseFloat(i.slice(4)),e;let t=i.split(",").map(o=>o.trim());return t.length&&(t[0]!==""&&(e.width=parseInt(t[0],10)),t[1]!==""&&(e.height=parseInt(t[1],10))),e}function E(i){let e={angle:0};if(i[0]==="!"&&(e.mirror=!0,i=i.substr(1)),e.angle=parseFloat(i)%360,Number.isNaN(e.angle))throw new Error(`Invalid rotation ${i}`);return e}function z(i,e=""){let t=i.match(/^(([a-zA-Z]+):\/\/([^/]+))?((.*)+)/);if(!t)throw new Error(`Invalid or unknown input ${i}`);let o=t[2],r=t[3],a=t[4];if(a[0]==="/"&&(a=a.substring(1)),e.length>0){if(e[0]==="/"&&(e=e.substring(1)),e!==a.substring(0,e.length))throw new Error(`Path does not start with prefix (path: ${a}, prefix: ${e})`);a=a.substring(e.length)}return{scheme:o,server:r,path:a,prefix:e}}function A(i,e=""){let{path:t,scheme:o,server:r,prefix:a}=z(i,e),n=t.split("/").reverse(),[s,x,f,c,..._]=n,h=_.reverse().filter(Boolean).join("/");if(n.length===1||s==="")return{type:"base",scheme:o,server:r,prefix:a,identifier:h};if(s==="info.json"){let[,...he]=n;return{type:"info",scheme:o,server:r,prefix:a,identifier:he.reverse().filter(Boolean).join("/")}}if(typeof o>"u"||typeof r>"u"||typeof t>"u"||typeof c>"u"||typeof f>"u"||typeof x>"u"||typeof s>"u")throw new Error("Invalid image service URL");let[xe="",ce=""]=s.split(".");return{type:"image",scheme:o,server:r,prefix:a,identifier:h,originalPath:t,region:F(c),size:S(f),rotation:E(x),quality:xe,format:ce}}var v="http://library.stanford.edu/iiif/image-api/compliance.html#level0",O="http://library.stanford.edu/iiif/image-api/compliance.html#level1",L="http://library.stanford.edu/iiif/image-api/compliance.html#level2",R="http://library.stanford.edu/iiif/image-api/conformance.html#level0",w="http://library.stanford.edu/iiif/image-api/conformance.html#level1",M="http://library.stanford.edu/iiif/image-api/conformance.html#level2",P="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",B="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",b="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",N="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",W="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",j="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",G="http://iiif.io/api/image/1/level0.json",$="http://iiif.io/api/image/1/profiles/level0.json",C="http://iiif.io/api/image/1/level1.json",T="http://iiif.io/api/image/1/profiles/level1.json",H="http://iiif.io/api/image/1/level2.json",Q="http://iiif.io/api/image/1/profiles/level2.json",V="http://iiif.io/api/image/2/level0.json",D="http://iiif.io/api/image/2/profiles/level0.json",U="http://iiif.io/api/image/2/level1.json",k="http://iiif.io/api/image/2/profiles/level1.json",J="http://iiif.io/api/image/2/level2.json",Z="http://iiif.io/api/image/2/profiles/level2.json",K="level0",X="level1",Y="level2",q="http://iiif.io/api/image/2/level0",ee="http://iiif.io/api/image/2/level1",ie="http://iiif.io/api/image/2/level2",g=[ie,L,M,b,j,H,Q,J,Z,Y],m=[...g,ee,O,w,B,W,C,T,U,k,X],d=[q,ee,ie,v,O,L,R,w,M,P,B,b,N,W,j,G,$,C,T,H,Q,V,D,U,k,J,Z,K,X,Y],Ee=d,te=[q,v,R,P,N,G,$,V,D,K],re={extraFormats:["jpg"],extraQualities:["default"],extraFeatures:["sizeByWhListed"]},oe={extraFormats:["jpg"],extraQualities:["default"],extraFeatures:["baseUriRedirect","cors","jsonldMediaType","regionByPx","regionSquare","sizeByWhListed","sizeByH","sizeByW","sizeByWh"]},ae={extraFormats:["jpg","png"],extraQualities:["default"],extraFeatures:["baseUriRedirect","cors","jsonldMediaType","regionByPct","regionByPx","regionSquare","rotationBy90s","sizeByWhListed","sizeByConfinedWh","sizeByH","sizeByPct","sizeByW","sizeByWh"]},I=["baseUriRedirect","canonicalLinkHeader","cors","jsonldMediaType","mirroring","profileLinkHeader","regionByPct","regionByPx","regionSquare","rotationArbitrary","rotationBy90s","sizeByConfinedWh","sizeByH","sizeByPct","sizeByW","sizeByWh","sizeUpscaling","sizeByWhListed","sizeByDistortedWh","sizeByForcedWh"];function ne(i){return g.indexOf(i)!==-1?ae:m.indexOf(i)!==-1?oe:re}function p(i){let e=i?Array.isArray(i.profile)?i.profile:[i.profile]:[],t={extraQualities:[],extraFormats:[],extraFeatures:[]};for(let o of e)if(typeof o=="string"&&(o=ne(o)),!!o){if(o.formats)for(let r of o.formats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(o.qualities)for(let r of o.qualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);if(o.supports)for(let r of o.supports)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);if(o.maxHeight&&(t.maxHeight=o.maxHeight),o.maxWidth&&(t.maxWidth=o.maxWidth),o.maxArea&&(t.maxArea=o.maxArea),o.extraFormats)for(let r of o.extraFormats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(o.extraQualities)for(let r of o.extraQualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);if(o.extraFeatures)for(let r of o.extraFeatures)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);o.maxHeight&&(t.maxHeight=o.maxHeight),o.maxWidth&&(t.maxWidth=o.maxWidth),o.maxArea&&(t.maxArea=o.maxArea)}if(i.extraFormats)for(let o of i.extraFormats)t.extraFormats.indexOf(o)===-1&&t.extraFormats.push(o);if(i.extraFeatures)for(let o of i.extraFeatures)t.extraFeatures.indexOf(o)===-1&&t.extraFeatures.push(o);if(i.extraQualities)for(let o of i.extraQualities)t.extraQualities.indexOf(o)===-1&&t.extraQualities.push(o);return t}function ze(i){let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"&&te.indexOf(t)!==-1)return!0;return!1}function se(i){if(i["@id"])return i["@id"];if(i.id)return i.id}function l(i){if(!i||!i.profile||!se(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"&&d.indexOf(t)!==-1)return!0;return!1}function u(i,e){if(!l(i))return[!1,"Not a valid image service"];e.extraFeatures=e.extraFeatures?e.extraFeatures:[];let t=p(i);if(e.exactSize){let o=!1;if(i.sizes)for(let r of i.sizes)r.width&&r.width===e.exactSize.width&&(I.indexOf("sizeByW")!==-1||r.height&&r.height===e.exactSize.height)&&(o=!0),r.height&&r.height===e.exactSize.height&&(I.indexOf("sizeByH")!==-1||r.width&&r.width===e.exactSize.width)&&(o=!0);o||(e.maxWidth=Math.max(e.maxWidth||0,e.exactSize.width||0)||void 0,e.maxHeight=Math.max(e.maxHeight||0,e.exactSize.height||0)||void 0,e.maxArea=Math.max(e.maxArea||0,(e.exactSize.width&&e.exactSize.height?e.exactSize.width*e.exactSize.height:e.maxArea)||0)||void 0,!e.exactSize.height&&e.exactSize.width?e.extraFeatures.indexOf("sizeByW")===-1&&e.extraFeatures.push("sizeByW"):!e.exactSize.width&&e.exactSize.height&&e.extraFeatures.indexOf("sizeByH")===-1&&e.extraFeatures.push("sizeByH"))}if(e.maxArea&&t.maxArea&&e.maxArea>t.maxArea)return[!1,`Max area is ${t.maxArea}`];if(e.maxWidth&&t.maxWidth&&e.maxWidth>t.maxWidth)return[!1,`Max width is ${t.maxWidth}`];if(e.maxHeight&&t.maxHeight&&e.maxHeight>t.maxHeight)return[!1,`Max height is ${t.maxHeight}`];if(e.extraFeatures){let o=[];for(let r of e.extraFeatures)t.extraFeatures.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing features: ${o.join(", ")}`]}if(e.extraFormats){let o=[];for(let r of e.extraFormats)t.extraFormats.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing formats: ${o.join(", ")}`]}if(e.extraQualities){let o=[];for(let r of e.extraQualities)t.extraQualities.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing qualities: ${o.join(", ")}`]}return[!0]}function Ae(i){if(!l(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"){if(m.indexOf(t)!==-1)return!0}else{let o=[...t.supports||[],...t.extraFeatures||[]];if(o.indexOf("regionByPx")!==-1&&(o.indexOf("sizeByW")!==-1||o.indexOf("sizeByWh")!==-1))return!0}return!1}function ve(i,e){return u(i,{extraFormats:[e]})}function Oe(i,e){if(e.type!=="image")return[!0];let t=[];e.rotation.mirror&&t.push("mirroring"),e.region.percent&&t.push("regionByPct"),e.region.square?t.push("regionSquare"):e.region.full||t.push("regionByPx"),e.rotation.angle&&(e.rotation.angle%90?t.push("rotationArbitrary"):t.push("rotationBy90s")),e.size.confined&&t.push("sizeByConfinedWh"),!e.size.width&&e.size.height&&t.push("sizeByH"),e.size.percentScale&&t.push("sizeByPct"),(i.sizes||[]).find(n=>n.width===e.size.width&&!e.size.height||n.height===e.size.height&&!e.size.width||n.height===e.size.height&&n.width===e.size.width)?t.push("sizeByWhListed"):(e.size.width&&!e.size.height&&t.push("sizeByW"),e.size.width&&e.size.height&&t.push("sizeByWh")),e.size.upscaled&&t.push("sizeUpscaling");let[r,a]=u(i,{extraFeatures:t,extraQualities:[e.quality],extraFormats:[e.format],exactSize:e.size});return r?[!0]:[!1,a]}function fe({x:i=0,y:e=0,w:t,h:o,full:r,square:a,percent:n}){if(r)return"full";if(a)return"square";if(typeof t>"u"||typeof o>"u")throw new Error("RegionParameter: invalid region");let s=`${i},${e},${t},${o}`;return n?`pct:${s}`:s}function me({max:i,percentScale:e,upscaled:t,confined:o,width:r,height:a,serialiseAsFull:n}){let s=[];return t&&s.push("^"),i?(s.push(n?"full":"max"),s.join("")):(o&&s.push("!"),e&&s.push(`pct:${e}`),r&&s.push(`${r}`),s.push(","),a&&s.push(`${a}`),s.join(""))}function pe(i){return`${i.mirror?"!":""}${(i.angle||0)%360}`}function le(i,e){let t=i.prefix.startsWith("/")?i.prefix.substr(1):i.prefix,o=`${i.scheme}://${i.server}/${t?`${t}/`:""}${i.identifier}`;if(i.type==="base")return o;if(i.type==="info")return`${o}/info.json`;let{size:r}=i,{region:a,rotation:n,format:s,quality:x}=i;if(e){let f=e["@context"]?Array.isArray(e["@context"])?e["@context"]:[e["@context"]]:[],c=f.indexOf("http://iiif.io/api/image/2/context.json")!==-1,_=f.indexOf("http://iiif.io/api/image/3/context.json")!==-1;if((r.width===e.width&&!r.height||r.height===e.height&&!r.width||r.width===e.width&&r.height===e.height)&&(r={...r,max:!0}),c&&(r.max&&!r.serialiseAsFull&&(r={...r,serialiseAsFull:!0}),!r.max&&r.width&&r.height&&(r={...r,height:void 0})),_&&(r.max&&r.serialiseAsFull&&(r={...r,serialiseAsFull:!1}),r.width&&!r.height&&e.width&&e.height)){let h=e.height/e.width;r={...r,height:Math.ceil(r.width*h)}}}return[o,fe(a),me(r),pe(n),`${x}.${s}`].filter(Boolean).join("/")}function Le(i,e){return le({...i,type:"info"},e)}function ue(i){return i.endsWith("info.json")?i:i.endsWith("/")?`${i}info.json`:`${i}/info.json`}function Re(i){let e=A(ue(i.id));if(e.type!=="info")throw new Error("Invalid service URL");let t=p(i);return{identifier:e.identifier,originalPath:"",server:e.server,prefix:e.prefix,scheme:e.scheme,type:"image",quality:t.extraQualities.indexOf("default")===-1?t.extraQualities[0]:"default",region:{full:!0},size:{max:!0,upscaled:!1,confined:!1},format:"jpg",rotation:{angle:0}}}function we(i,e,t){let o=t.length,r=[];for(let a=0;a<o;a++){let n=t[a];if(!n)continue;let s=n.width;r.push(i/s)}return r}function Me(i,e,t){let o=t.length,r=[];for(let a=0;a<o;a++){let n=t[a];n&&r.push({width:Math.floor(i/n),height:Math.floor(e/n)})}return r}function Pe(i){if(i["@type"])return i["@type"];if(i.type)return i.type}return Fe(Be);})();
"use strict";var IIIFParser=(()=>{var F=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var ye=Object.prototype.hasOwnProperty;var _e=(i,e)=>{for(var t in e)F(i,t,{get:e[t],enumerable:!0})},Se=(i,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ie(e))!ye.call(i,r)&&r!==t&&F(i,r,{get:()=>e[r],enumerable:!(o=de(e,r))||o.enumerable});return i};var Fe=i=>Se(F({},"__esModule",{value:!0}),i);var je={};_e(je,{IIIF_1_IMAGE_LEVEL_0:()=>C,IIIF_1_IMAGE_LEVEL_0_PROFILE:()=>T,IIIF_1_IMAGE_LEVEL_1:()=>H,IIIF_1_IMAGE_LEVEL_1_PROFILE:()=>Q,IIIF_1_IMAGE_LEVEL_2:()=>V,IIIF_1_IMAGE_LEVEL_2_PROFILE:()=>D,IIIF_2_IMAGE_LEVEL_0:()=>U,IIIF_2_IMAGE_LEVEL_0_NO_JSON:()=>ie,IIIF_2_IMAGE_LEVEL_0_PROFILE:()=>k,IIIF_2_IMAGE_LEVEL_1:()=>J,IIIF_2_IMAGE_LEVEL_1_NO_JSON:()=>te,IIIF_2_IMAGE_LEVEL_1_PROFILE:()=>Z,IIIF_2_IMAGE_LEVEL_2:()=>K,IIIF_2_IMAGE_LEVEL_2_NO_JSON:()=>re,IIIF_2_IMAGE_LEVEL_2_PROFILE:()=>X,IIIF_3_IMAGE_LEVEL_0:()=>Y,IIIF_3_IMAGE_LEVEL_1:()=>q,IIIF_3_IMAGE_LEVEL_2:()=>ee,STANFORD_IIIF_1_IMAGE_COMPLIANCE_0:()=>b,STANFORD_IIIF_1_IMAGE_COMPLIANCE_1:()=>N,STANFORD_IIIF_1_IMAGE_COMPLIANCE_2:()=>W,STANFORD_IIIF_1_IMAGE_CONFORMANCE_0:()=>j,STANFORD_IIIF_1_IMAGE_CONFORMANCE_1:()=>$,STANFORD_IIIF_1_IMAGE_CONFORMANCE_2:()=>G,STANFORD_IIIF_IMAGE_COMPLIANCE_0:()=>L,STANFORD_IIIF_IMAGE_COMPLIANCE_1:()=>R,STANFORD_IIIF_IMAGE_COMPLIANCE_2:()=>w,STANFORD_IIIF_IMAGE_CONFORMANCE_0:()=>P,STANFORD_IIIF_IMAGE_CONFORMANCE_1:()=>M,STANFORD_IIIF_IMAGE_CONFORMANCE_2:()=>B,canonicalServiceUrl:()=>xe,combineProfiles:()=>c,createImageServiceRequest:()=>we,extraFeatures:()=>_,extractFixedSizeScales:()=>Pe,fixedSizesFromScales:()=>Me,getId:()=>fe,getImageServiceLevel:()=>Be,getImageServices:()=>be,getType:()=>Ne,identifyImageServer:()=>We,imageServiceProfiles:()=>y,imageServiceRequestInfo:()=>Re,imageServiceRequestToString:()=>ue,imageServiceSupportsFormat:()=>Oe,imageServiceSupportsRequest:()=>Le,isImageService:()=>m,isImageServiceLevel:()=>h,isLevel0:()=>ze,level0:()=>oe,level0Support:()=>Ee,level1:()=>ae,level1Support:()=>p,level2:()=>ne,level2Support:()=>l,levelToProfile:()=>se,onlyLevel0:()=>x,parseImageServerFromId:()=>ve,parseImageServiceRequest:()=>O,parseImageServiceUrl:()=>A,parseRegionParameter:()=>v,parseRotationParameter:()=>z,parseSizeParameter:()=>E,regionParameterToString:()=>me,rotationParameterToString:()=>le,sizeParameterToString:()=>pe,supports:()=>g,supportsCustomSizes:()=>Ae});function ve(i){let e=i.replace(/(https?:\/\/)?(www.)?/i,"");return e.indexOf("/")!==-1?e.split("/")[0]:e}function v(i){try{if(i==="full")return{full:!0};if(i==="square")return{square:!0};let e=i.startsWith("pct:"),o=i.substr(e?4:0).split(",").map(r=>parseFloat(r));return{x:o[0],y:o[1],w:o[2],h:o[3],percent:e}}catch{throw new Error("Expected 'full', 'square' or 'x,y,w,h'. Found "+i)}}function E(i){let e={upscaled:!1,max:!1,confined:!1};if(i[0]==="^"&&(e.upscaled=!0,i=i.slice(1)),i==="max"||i==="full")return e.max=!0,e.serialiseAsFull=i==="full",e;if(i[0]==="!"&&(e.confined=!0,i=i.slice(1)),i[0]==="p")return e.percentScale=parseFloat(i.slice(4)),e;let t=i.split(",").map(o=>o.trim());return t.length&&(t[0]!==""&&(e.width=parseInt(t[0],10)),t[1]!==""&&(e.height=parseInt(t[1],10))),e}function z(i){let e={angle:0};if(i[0]==="!"&&(e.mirror=!0,i=i.substr(1)),e.angle=parseFloat(i)%360,Number.isNaN(e.angle))throw new Error(`Invalid rotation ${i}`);return e}function A(i,e=""){let t=i.match(/^(([a-zA-Z]+):\/\/([^/]+))?((.*)+)/);if(!t)throw new Error(`Invalid or unknown input ${i}`);let o=t[2],r=t[3],a=t[4];if(a[0]==="/"&&(a=a.substring(1)),e.length>0){if(e[0]==="/"&&(e=e.substring(1)),e!==a.substring(0,e.length))throw new Error(`Path does not start with prefix (path: ${a}, prefix: ${e})`);a=a.substring(e.length)}return{scheme:o,server:r,path:a,prefix:e}}function O(i,e=""){let{path:t,scheme:o,server:r,prefix:a}=A(i,e),n=t.split("/").reverse(),[f,s,u,d,...S]=n,I=S.reverse().filter(Boolean).join("/");if(n.length===1||f==="")return{type:"base",scheme:o,server:r,prefix:a,identifier:I};if(f==="info.json"){let[,...he]=n;return{type:"info",scheme:o,server:r,prefix:a,identifier:he.reverse().filter(Boolean).join("/")}}if(typeof o>"u"||typeof r>"u"||typeof t>"u"||typeof d>"u"||typeof u>"u"||typeof s>"u"||typeof f>"u")throw new Error("Invalid image service URL");let[ce="",ge=""]=f.split(".");return{type:"image",scheme:o,server:r,prefix:a,identifier:I,originalPath:t,region:v(d),size:E(u),rotation:z(s),quality:ce,format:ge}}var L="http://library.stanford.edu/iiif/image-api/compliance.html#level0",R="http://library.stanford.edu/iiif/image-api/compliance.html#level1",w="http://library.stanford.edu/iiif/image-api/compliance.html#level2",P="http://library.stanford.edu/iiif/image-api/conformance.html#level0",M="http://library.stanford.edu/iiif/image-api/conformance.html#level1",B="http://library.stanford.edu/iiif/image-api/conformance.html#level2",b="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",N="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",W="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",j="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",$="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",G="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",C="http://iiif.io/api/image/1/level0.json",T="http://iiif.io/api/image/1/profiles/level0.json",H="http://iiif.io/api/image/1/level1.json",Q="http://iiif.io/api/image/1/profiles/level1.json",V="http://iiif.io/api/image/1/level2.json",D="http://iiif.io/api/image/1/profiles/level2.json",U="http://iiif.io/api/image/2/level0.json",k="http://iiif.io/api/image/2/profiles/level0.json",J="http://iiif.io/api/image/2/level1.json",Z="http://iiif.io/api/image/2/profiles/level1.json",K="http://iiif.io/api/image/2/level2.json",X="http://iiif.io/api/image/2/profiles/level2.json",Y="level0",q="level1",ee="level2",ie="http://iiif.io/api/image/2/level0",te="http://iiif.io/api/image/2/level1",re="http://iiif.io/api/image/2/level2",l=[re,w,B,W,G,V,D,K,X,ee],p=[...l,te,R,M,N,$,H,Q,J,Z,q],y=[ie,te,re,L,R,w,P,M,B,b,N,W,j,$,G,C,T,H,Q,V,D,U,k,J,Z,K,X,Y,q,ee],Ee=y,x=[ie,L,P,b,j,C,T,U,k,Y],oe={extraFormats:["jpg"],extraQualities:["default"],extraFeatures:["sizeByWhListed"]},ae={extraFormats:["jpg"],extraQualities:["default"],extraFeatures:["baseUriRedirect","cors","jsonldMediaType","regionByPx","regionSquare","sizeByWhListed","sizeByH","sizeByW","sizeByWh"]},ne={extraFormats:["jpg","png"],extraQualities:["default"],extraFeatures:["baseUriRedirect","cors","jsonldMediaType","regionByPct","regionByPx","regionSquare","rotationBy90s","sizeByWhListed","sizeByConfinedWh","sizeByH","sizeByPct","sizeByW","sizeByWh"]},_=["baseUriRedirect","canonicalLinkHeader","cors","jsonldMediaType","mirroring","profileLinkHeader","regionByPct","regionByPx","regionSquare","rotationArbitrary","rotationBy90s","sizeByConfinedWh","sizeByH","sizeByPct","sizeByW","sizeByWh","sizeUpscaling","sizeByWhListed","sizeByDistortedWh","sizeByForcedWh"];function se(i){return l.indexOf(i)!==-1?ne:p.indexOf(i)!==-1?ae:oe}function c(i){let e=i?Array.isArray(i.profile)?i.profile:[i.profile]:[],t={extraQualities:[],extraFormats:[],extraFeatures:[]};for(let o of e)if(typeof o=="string"&&(o=se(o)),!!o){if(o.formats)for(let r of o.formats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(o.qualities)for(let r of o.qualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);if(o.supports)for(let r of o.supports)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);if(o.maxHeight&&(t.maxHeight=o.maxHeight),o.maxWidth&&(t.maxWidth=o.maxWidth),o.maxArea&&(t.maxArea=o.maxArea),o.extraFormats)for(let r of o.extraFormats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(o.extraQualities)for(let r of o.extraQualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);if(o.extraFeatures)for(let r of o.extraFeatures)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);o.maxHeight&&(t.maxHeight=o.maxHeight),o.maxWidth&&(t.maxWidth=o.maxWidth),o.maxArea&&(t.maxArea=o.maxArea)}if(i.extraFormats)for(let o of i.extraFormats)t.extraFormats.indexOf(o)===-1&&t.extraFormats.push(o);if(i.extraFeatures)for(let o of i.extraFeatures)t.extraFeatures.indexOf(o)===-1&&t.extraFeatures.push(o);if(i.extraQualities)for(let o of i.extraQualities)t.extraQualities.indexOf(o)===-1&&t.extraQualities.push(o);return t}function ze(i){let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"&&x.indexOf(t)!==-1)return!0;return!1}function fe(i){if(i["@id"])return i["@id"];if(i.id)return i.id}function m(i){if(!i||!i.profile||!fe(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"&&y.indexOf(t)!==-1)return!0;return!1}function g(i,e){if(!m(i))return[!1,"Not a valid image service"];e.extraFeatures=e.extraFeatures?e.extraFeatures:[];let t=c(i);if(e.exactSize){let o=!1;if(i.sizes)for(let r of i.sizes)r.width&&r.width===e.exactSize.width&&(_.indexOf("sizeByW")!==-1||r.height&&r.height===e.exactSize.height)&&(o=!0),r.height&&r.height===e.exactSize.height&&(_.indexOf("sizeByH")!==-1||r.width&&r.width===e.exactSize.width)&&(o=!0);o||(e.maxWidth=Math.max(e.maxWidth||0,e.exactSize.width||0)||void 0,e.maxHeight=Math.max(e.maxHeight||0,e.exactSize.height||0)||void 0,e.maxArea=Math.max(e.maxArea||0,(e.exactSize.width&&e.exactSize.height?e.exactSize.width*e.exactSize.height:e.maxArea)||0)||void 0,!e.exactSize.height&&e.exactSize.width?e.extraFeatures.indexOf("sizeByW")===-1&&e.extraFeatures.push("sizeByW"):!e.exactSize.width&&e.exactSize.height&&e.extraFeatures.indexOf("sizeByH")===-1&&e.extraFeatures.push("sizeByH"))}if(e.maxArea&&t.maxArea&&e.maxArea>t.maxArea)return[!1,`Max area is ${t.maxArea}`];if(e.maxWidth&&t.maxWidth&&e.maxWidth>t.maxWidth)return[!1,`Max width is ${t.maxWidth}`];if(e.maxHeight&&t.maxHeight&&e.maxHeight>t.maxHeight)return[!1,`Max height is ${t.maxHeight}`];if(e.extraFeatures){let o=[];for(let r of e.extraFeatures)t.extraFeatures.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing features: ${o.join(", ")}`]}if(e.extraFormats){let o=[];for(let r of e.extraFormats)t.extraFormats.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing formats: ${o.join(", ")}`]}if(e.extraQualities){let o=[];for(let r of e.extraQualities)t.extraQualities.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing qualities: ${o.join(", ")}`]}return[!0]}function Ae(i){if(!m(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"){if(p.indexOf(t)!==-1)return!0}else{let o=[...t.supports||[],...t.extraFeatures||[]];if(o.indexOf("regionByPx")!==-1&&(o.indexOf("sizeByW")!==-1||o.indexOf("sizeByWh")!==-1))return!0}return!1}function Oe(i,e){return g(i,{extraFormats:[e]})}function Le(i,e){if(e.type!=="image")return[!0];let t=[];e.rotation.mirror&&t.push("mirroring"),e.region.percent&&t.push("regionByPct"),e.region.square?t.push("regionSquare"):e.region.full||t.push("regionByPx"),e.rotation.angle&&(e.rotation.angle%90?t.push("rotationArbitrary"):t.push("rotationBy90s")),e.size.confined&&t.push("sizeByConfinedWh"),!e.size.width&&e.size.height&&t.push("sizeByH"),e.size.percentScale&&t.push("sizeByPct"),(i.sizes||[]).find(n=>n.width===e.size.width&&!e.size.height||n.height===e.size.height&&!e.size.width||n.height===e.size.height&&n.width===e.size.width)?t.push("sizeByWhListed"):(e.size.width&&!e.size.height&&t.push("sizeByW"),e.size.width&&e.size.height&&t.push("sizeByWh")),e.size.upscaled&&t.push("sizeUpscaling");let[r,a]=g(i,{extraFeatures:t,extraQualities:[e.quality],extraFormats:[e.format],exactSize:e.size});return r?[!0]:[!1,a]}function me({x:i=0,y:e=0,w:t,h:o,full:r,square:a,percent:n}){if(r)return"full";if(a)return"square";if(typeof t>"u"||typeof o>"u")throw new Error("RegionParameter: invalid region");let f=`${i},${e},${t},${o}`;return n?`pct:${f}`:f}function pe({max:i,percentScale:e,upscaled:t,confined:o,width:r,height:a,serialiseAsFull:n,version:f}){let s=[];return t&&s.push("^"),i?(s.push(n?"full":"max"),s.join("")):(o&&s.push("!"),e&&s.push(`pct:${e}`),r&&s.push(`${r}`),s.push(","),a&&f===3&&s.push(`${a}`),s.join(""))}function le(i){return`${i.mirror?"!":""}${(i.angle||0)%360}`}function ue(i,e){let t=i.prefix.startsWith("/")?i.prefix.substring(1):i.prefix,o=`${i.scheme}://${i.server}/${t?`${t}/`:""}${i.identifier}`;if(i.type==="base")return o;if(i.type==="info")return`${o}/info.json`;let{size:r}=i,{region:a,rotation:n,format:f,quality:s}=i;if(e){let u=e["@context"]?Array.isArray(e["@context"])?e["@context"]:[e["@context"]]:[],d=u.indexOf("http://iiif.io/api/image/2/context.json")!==-1,S=u.indexOf("http://iiif.io/api/image/3/context.json")!==-1;if((r.width===e.width&&!r.height||r.height===e.height&&!r.width||r.width===e.width&&r.height===e.height)&&(r={...r,max:!0}),d&&(r.max&&!r.serialiseAsFull&&(r={...r,serialiseAsFull:!0}),!r.max&&r.width&&r.height&&(r={...r,height:void 0}),r={...r,version:2}),S){if(r.max&&r.serialiseAsFull&&(r={...r,serialiseAsFull:!1}),r.width&&!r.height&&e.width&&e.height){let I=e.height/e.width;r={...r,height:Math.ceil(r.width*I)}}r={...r,version:3}}}return[o,me(a),pe(r),le(n),`${s}.${f}`].filter(Boolean).join("/")}function Re(i,e){return ue({...i,type:"info"},e)}function xe(i){return i.endsWith("info.json")?i:i.endsWith("/")?`${i}info.json`:`${i}/info.json`}function we(i){let e=O(xe(i.id));if(e.type!=="info")throw new Error("Invalid service URL");let t=c(i);return{identifier:e.identifier,originalPath:"",server:e.server,prefix:e.prefix,scheme:e.scheme,type:"image",quality:t.extraQualities.indexOf("default")===-1?t.extraQualities[0]:"default",region:{full:!0},size:{max:!0,upscaled:!1,confined:!1},format:"jpg",rotation:{angle:0}}}function Pe(i,e,t){let o=t.length,r=[];for(let a=0;a<o;a++){let n=t[a];if(!n)continue;let f=n.width;r.push(i/f)}return r}function Me(i,e,t){let o=t.length,r=[];for(let a=0;a<o;a++){let n=t[a];n&&r.push({width:Math.floor(i/n),height:Math.floor(e/n)})}return r}function h(i,e){if(e&&e.profile){let t=e.profile;if(t){let o=Array.isArray(t)?t:[t];if(o.includes(`level${i}`)||o.includes(`http://iiif.io/api/image/2/level${i}.json`)||o.includes(`http://iiif.io/api/image/1/level${i}.json`)||o.includes(`http://iiif.io/api/image/1/profiles/level${i}.json`))return!0;if(i===2){for(let r of o)if(l.includes(r))return!0}if(i===1){for(let r of o)if(p.includes(r))return!0}if(i===0){for(let r of o)if(x.includes(r))return!0}}}return!1}function Be(i){return m(i)?h(0,i)?0:h(1,i)?1:h(2,i)?2:null:null}function be(i){let e=i.service?Array.isArray(i.service)?i.service:[i.service]:[],t=e.length,o=[];for(let r=0;r<t;r++)m(e[r])&&o.push(e[r]);return o}function Ne(i){if(i["@type"])return i["@type"];if(i.type)return i.type}function We(i){let e=i.replace(/(https?:\/\/)?(www.)?/i,"");return e.indexOf("/")!==-1?e.split("/")[0]:e}return Fe(je);})();

@@ -1,1 +0,1 @@

import{A as pe,B as xe,C as le,D as ge,E as S,F as x,G as y,H as he,I as z,J as I,K as w,L as F,M as d,a as L,b as U,c as N,d as C,e as k,f as Z,g as D,h as G,i as J,j as K,k as V,l as X,m as Y,n as _,o as q,p as ee,q as te,r as ie,s as re,t as oe,u as ae,v as ne,w as fe,x as se,y as me,z as ue}from"./chunk-J657UVVW.js";import"./chunk-D22QKJZO.js";function ce(t){let e=t.replace(/(https?:\/\/)?(www.)?/i,"");return e.indexOf("/")!==-1?e.split("/")[0]:e}function v(t){try{if(t==="full")return{full:!0};if(t==="square")return{square:!0};let e=t.startsWith("pct:"),r=t.substr(e?4:0).split(",").map(o=>parseFloat(o));return{x:r[0],y:r[1],w:r[2],h:r[3],percent:e}}catch{throw new Error("Expected 'full', 'square' or 'x,y,w,h'. Found "+t)}}function R(t){let e={upscaled:!1,max:!1,confined:!1};if(t[0]==="^"&&(e.upscaled=!0,t=t.slice(1)),t==="max"||t==="full")return e.max=!0,e.serialiseAsFull=t==="full",e;if(t[0]==="!"&&(e.confined=!0,t=t.slice(1)),t[0]==="p")return e.percentScale=parseFloat(t.slice(4)),e;let i=t.split(",").map(r=>r.trim());return i.length&&(i[0]!==""&&(e.width=parseInt(i[0],10)),i[1]!==""&&(e.height=parseInt(i[1],10))),e}function P(t){let e={angle:0};if(t[0]==="!"&&(e.mirror=!0,t=t.substr(1)),e.angle=parseFloat(t)%360,Number.isNaN(e.angle))throw new Error(`Invalid rotation ${t}`);return e}function A(t,e=""){let i=t.match(/^(([a-zA-Z]+):\/\/([^/]+))?((.*)+)/);if(!i)throw new Error(`Invalid or unknown input ${t}`);let r=i[2],o=i[3],a=i[4];if(a[0]==="/"&&(a=a.substring(1)),e.length>0){if(e[0]==="/"&&(e=e.substring(1)),e!==a.substring(0,e.length))throw new Error(`Path does not start with prefix (path: ${a}, prefix: ${e})`);a=a.substring(e.length)}return{scheme:r,server:o,path:a,prefix:e}}function $(t,e=""){let{path:i,scheme:r,server:o,prefix:a}=A(t,e),n=i.split("/").reverse(),[f,m,s,u,...c]=n,p=c.reverse().filter(Boolean).join("/");if(n.length===1||f==="")return{type:"base",scheme:r,server:o,prefix:a,identifier:p};if(f==="info.json"){let[,...E]=n;return{type:"info",scheme:r,server:o,prefix:a,identifier:E.reverse().filter(Boolean).join("/")}}if(typeof r>"u"||typeof o>"u"||typeof i>"u"||typeof u>"u"||typeof s>"u"||typeof m>"u"||typeof f>"u")throw new Error("Invalid image service URL");let[M="",T=""]=f.split(".");return{type:"image",scheme:r,server:o,prefix:a,identifier:p,originalPath:i,region:v(u),size:R(s),rotation:P(m),quality:M,format:T}}function O(t){return S.indexOf(t)!==-1?F:x.indexOf(t)!==-1?w:I}function l(t){let e=t?Array.isArray(t.profile)?t.profile:[t.profile]:[],i={extraQualities:[],extraFormats:[],extraFeatures:[]};for(let r of e)if(typeof r=="string"&&(r=O(r)),!!r){if(r.formats)for(let o of r.formats)i.extraFormats.indexOf(o)===-1&&i.extraFormats.push(o);if(r.qualities)for(let o of r.qualities)i.extraQualities.indexOf(o)===-1&&i.extraQualities.push(o);if(r.supports)for(let o of r.supports)i.extraFeatures.indexOf(o)===-1&&i.extraFeatures.push(o);if(r.maxHeight&&(i.maxHeight=r.maxHeight),r.maxWidth&&(i.maxWidth=r.maxWidth),r.maxArea&&(i.maxArea=r.maxArea),r.extraFormats)for(let o of r.extraFormats)i.extraFormats.indexOf(o)===-1&&i.extraFormats.push(o);if(r.extraQualities)for(let o of r.extraQualities)i.extraQualities.indexOf(o)===-1&&i.extraQualities.push(o);if(r.extraFeatures)for(let o of r.extraFeatures)i.extraFeatures.indexOf(o)===-1&&i.extraFeatures.push(o);r.maxHeight&&(i.maxHeight=r.maxHeight),r.maxWidth&&(i.maxWidth=r.maxWidth),r.maxArea&&(i.maxArea=r.maxArea)}if(t.extraFormats)for(let r of t.extraFormats)i.extraFormats.indexOf(r)===-1&&i.extraFormats.push(r);if(t.extraFeatures)for(let r of t.extraFeatures)i.extraFeatures.indexOf(r)===-1&&i.extraFeatures.push(r);if(t.extraQualities)for(let r of t.extraQualities)i.extraQualities.indexOf(r)===-1&&i.extraQualities.push(r);return i}function Qe(t){let e=Array.isArray(t.profile)?t.profile:[t.profile];for(let i of e)if(typeof i=="string"&&z.indexOf(i)!==-1)return!0;return!1}function b(t){if(t["@id"])return t["@id"];if(t.id)return t.id}function g(t){if(!t||!t.profile||!b(t))return!1;let e=Array.isArray(t.profile)?t.profile:[t.profile];for(let i of e)if(typeof i=="string"&&y.indexOf(i)!==-1)return!0;return!1}function h(t,e){if(!g(t))return[!1,"Not a valid image service"];e.extraFeatures=e.extraFeatures?e.extraFeatures:[];let i=l(t);if(e.exactSize){let r=!1;if(t.sizes)for(let o of t.sizes)o.width&&o.width===e.exactSize.width&&(d.indexOf("sizeByW")!==-1||o.height&&o.height===e.exactSize.height)&&(r=!0),o.height&&o.height===e.exactSize.height&&(d.indexOf("sizeByH")!==-1||o.width&&o.width===e.exactSize.width)&&(r=!0);r||(e.maxWidth=Math.max(e.maxWidth||0,e.exactSize.width||0)||void 0,e.maxHeight=Math.max(e.maxHeight||0,e.exactSize.height||0)||void 0,e.maxArea=Math.max(e.maxArea||0,(e.exactSize.width&&e.exactSize.height?e.exactSize.width*e.exactSize.height:e.maxArea)||0)||void 0,!e.exactSize.height&&e.exactSize.width?e.extraFeatures.indexOf("sizeByW")===-1&&e.extraFeatures.push("sizeByW"):!e.exactSize.width&&e.exactSize.height&&e.extraFeatures.indexOf("sizeByH")===-1&&e.extraFeatures.push("sizeByH"))}if(e.maxArea&&i.maxArea&&e.maxArea>i.maxArea)return[!1,`Max area is ${i.maxArea}`];if(e.maxWidth&&i.maxWidth&&e.maxWidth>i.maxWidth)return[!1,`Max width is ${i.maxWidth}`];if(e.maxHeight&&i.maxHeight&&e.maxHeight>i.maxHeight)return[!1,`Max height is ${i.maxHeight}`];if(e.extraFeatures){let r=[];for(let o of e.extraFeatures)i.extraFeatures.indexOf(o)===-1&&r.push(o);if(r.length)return[!1,`Missing features: ${r.join(", ")}`]}if(e.extraFormats){let r=[];for(let o of e.extraFormats)i.extraFormats.indexOf(o)===-1&&r.push(o);if(r.length)return[!1,`Missing formats: ${r.join(", ")}`]}if(e.extraQualities){let r=[];for(let o of e.extraQualities)i.extraQualities.indexOf(o)===-1&&r.push(o);if(r.length)return[!1,`Missing qualities: ${r.join(", ")}`]}return[!0]}function Je(t){if(!g(t))return!1;let e=Array.isArray(t.profile)?t.profile:[t.profile];for(let i of e)if(typeof i=="string"){if(x.indexOf(i)!==-1)return!0}else{let r=[...i.supports||[],...i.extraFeatures||[]];if(r.indexOf("regionByPx")!==-1&&(r.indexOf("sizeByW")!==-1||r.indexOf("sizeByWh")!==-1))return!0}return!1}function Xe(t,e){return h(t,{extraFormats:[e]})}function qe(t,e){if(e.type!=="image")return[!0];let i=[];e.rotation.mirror&&i.push("mirroring"),e.region.percent&&i.push("regionByPct"),e.region.square?i.push("regionSquare"):e.region.full||i.push("regionByPx"),e.rotation.angle&&(e.rotation.angle%90?i.push("rotationArbitrary"):i.push("rotationBy90s")),e.size.confined&&i.push("sizeByConfinedWh"),!e.size.width&&e.size.height&&i.push("sizeByH"),e.size.percentScale&&i.push("sizeByPct"),(t.sizes||[]).find(n=>n.width===e.size.width&&!e.size.height||n.height===e.size.height&&!e.size.width||n.height===e.size.height&&n.width===e.size.width)?i.push("sizeByWhListed"):(e.size.width&&!e.size.height&&i.push("sizeByW"),e.size.width&&e.size.height&&i.push("sizeByWh")),e.size.upscaled&&i.push("sizeUpscaling");let[o,a]=h(t,{extraFeatures:i,extraQualities:[e.quality],extraFormats:[e.format],exactSize:e.size});return o?[!0]:[!1,a]}function W({x:t=0,y:e=0,w:i,h:r,full:o,square:a,percent:n}){if(o)return"full";if(a)return"square";if(typeof i>"u"||typeof r>"u")throw new Error("RegionParameter: invalid region");let f=`${t},${e},${i},${r}`;return n?`pct:${f}`:f}function B({max:t,percentScale:e,upscaled:i,confined:r,width:o,height:a,serialiseAsFull:n}){let f=[];return i&&f.push("^"),t?(f.push(n?"full":"max"),f.join("")):(r&&f.push("!"),e&&f.push(`pct:${e}`),o&&f.push(`${o}`),f.push(","),a&&f.push(`${a}`),f.join(""))}function Q(t){return`${t.mirror?"!":""}${(t.angle||0)%360}`}function H(t,e){let i=t.prefix.startsWith("/")?t.prefix.substr(1):t.prefix,r=`${t.scheme}://${t.server}/${i?`${i}/`:""}${t.identifier}`;if(t.type==="base")return r;if(t.type==="info")return`${r}/info.json`;let{size:o}=t,{region:a,rotation:n,format:f,quality:m}=t;if(e){let s=e["@context"]?Array.isArray(e["@context"])?e["@context"]:[e["@context"]]:[],u=s.indexOf("http://iiif.io/api/image/2/context.json")!==-1,c=s.indexOf("http://iiif.io/api/image/3/context.json")!==-1;if((o.width===e.width&&!o.height||o.height===e.height&&!o.width||o.width===e.width&&o.height===e.height)&&(o={...o,max:!0}),u&&(o.max&&!o.serialiseAsFull&&(o={...o,serialiseAsFull:!0}),!o.max&&o.width&&o.height&&(o={...o,height:void 0})),c&&(o.max&&o.serialiseAsFull&&(o={...o,serialiseAsFull:!1}),o.width&&!o.height&&e.width&&e.height)){let p=e.height/e.width;o={...o,height:Math.ceil(o.width*p)}}}return[r,W(a),B(o),Q(n),`${m}.${f}`].filter(Boolean).join("/")}function mt(t,e){return H({...t,type:"info"},e)}function j(t){return t.endsWith("info.json")?t:t.endsWith("/")?`${t}info.json`:`${t}/info.json`}function ht(t){let e=$(j(t.id));if(e.type!=="info")throw new Error("Invalid service URL");let i=l(t);return{identifier:e.identifier,originalPath:"",server:e.server,prefix:e.prefix,scheme:e.scheme,type:"image",quality:i.extraQualities.indexOf("default")===-1?i.extraQualities[0]:"default",region:{full:!0},size:{max:!0,upscaled:!1,confined:!1},format:"jpg",rotation:{angle:0}}}function dt(t,e,i){let r=i.length,o=[];for(let a=0;a<r;a++){let n=i[a];if(!n)continue;let f=n.width;o.push(t/f)}return o}function yt(t,e,i){let r=i.length,o=[];for(let a=0;a<r;a++){let n=i[a];n&&o.push({width:Math.floor(t/n),height:Math.floor(e/n)})}return o}function It(t){if(t["@type"])return t["@type"];if(t.type)return t.type}export{Y as IIIF_1_IMAGE_LEVEL_0,_ as IIIF_1_IMAGE_LEVEL_0_PROFILE,q as IIIF_1_IMAGE_LEVEL_1,ee as IIIF_1_IMAGE_LEVEL_1_PROFILE,te as IIIF_1_IMAGE_LEVEL_2,ie as IIIF_1_IMAGE_LEVEL_2_PROFILE,re as IIIF_2_IMAGE_LEVEL_0,xe as IIIF_2_IMAGE_LEVEL_0_NO_JSON,oe as IIIF_2_IMAGE_LEVEL_0_PROFILE,ae as IIIF_2_IMAGE_LEVEL_1,le as IIIF_2_IMAGE_LEVEL_1_NO_JSON,ne as IIIF_2_IMAGE_LEVEL_1_PROFILE,fe as IIIF_2_IMAGE_LEVEL_2,ge as IIIF_2_IMAGE_LEVEL_2_NO_JSON,se as IIIF_2_IMAGE_LEVEL_2_PROFILE,me as IIIF_3_IMAGE_LEVEL_0,ue as IIIF_3_IMAGE_LEVEL_1,pe as IIIF_3_IMAGE_LEVEL_2,D as STANFORD_IIIF_1_IMAGE_COMPLIANCE_0,G as STANFORD_IIIF_1_IMAGE_COMPLIANCE_1,J as STANFORD_IIIF_1_IMAGE_COMPLIANCE_2,K as STANFORD_IIIF_1_IMAGE_CONFORMANCE_0,V as STANFORD_IIIF_1_IMAGE_CONFORMANCE_1,X as STANFORD_IIIF_1_IMAGE_CONFORMANCE_2,L as STANFORD_IIIF_IMAGE_COMPLIANCE_0,U as STANFORD_IIIF_IMAGE_COMPLIANCE_1,N as STANFORD_IIIF_IMAGE_COMPLIANCE_2,C as STANFORD_IIIF_IMAGE_CONFORMANCE_0,k as STANFORD_IIIF_IMAGE_CONFORMANCE_1,Z as STANFORD_IIIF_IMAGE_CONFORMANCE_2,j as canonicalServiceUrl,l as combineProfiles,ht as createImageServiceRequest,d as extraFeatures,dt as extractFixedSizeScales,yt as fixedSizesFromScales,b as getId,It as getType,y as imageServiceProfiles,mt as imageServiceRequestInfo,H as imageServiceRequestToString,Xe as imageServiceSupportsFormat,qe as imageServiceSupportsRequest,g as isImageService,Qe as isLevel0,I as level0,he as level0Support,w as level1,x as level1Support,F as level2,S as level2Support,O as levelToProfile,z as onlyLevel0,ce as parseImageServerFromId,$ as parseImageServiceRequest,A as parseImageServiceUrl,v as parseRegionParameter,P as parseRotationParameter,R as parseSizeParameter,W as regionParameterToString,Q as rotationParameterToString,B as sizeParameterToString,h as supports,Je as supportsCustomSizes};
import{A as le,B as xe,C as ge,D as ce,E as g,F as u,G as I,H as he,I as c,J as v,K as w,L as F,M as z,a as U,b as N,c as C,d as k,e as Z,f as D,g as G,h as J,i as K,j as V,k as X,l as Y,m as _,n as q,o as ee,p as ie,q as te,r as re,s as oe,t as ae,u as ne,v as fe,w as se,x as me,y as ue,z as pe}from"./chunk-J657UVVW.js";import"./chunk-D22QKJZO.js";function de(i){let e=i.replace(/(https?:\/\/)?(www.)?/i,"");return e.indexOf("/")!==-1?e.split("/")[0]:e}function A(i){try{if(i==="full")return{full:!0};if(i==="square")return{square:!0};let e=i.startsWith("pct:"),o=i.substr(e?4:0).split(",").map(r=>parseFloat(r));return{x:o[0],y:o[1],w:o[2],h:o[3],percent:e}}catch{throw new Error("Expected 'full', 'square' or 'x,y,w,h'. Found "+i)}}function P(i){let e={upscaled:!1,max:!1,confined:!1};if(i[0]==="^"&&(e.upscaled=!0,i=i.slice(1)),i==="max"||i==="full")return e.max=!0,e.serialiseAsFull=i==="full",e;if(i[0]==="!"&&(e.confined=!0,i=i.slice(1)),i[0]==="p")return e.percentScale=parseFloat(i.slice(4)),e;let t=i.split(",").map(o=>o.trim());return t.length&&(t[0]!==""&&(e.width=parseInt(t[0],10)),t[1]!==""&&(e.height=parseInt(t[1],10))),e}function $(i){let e={angle:0};if(i[0]==="!"&&(e.mirror=!0,i=i.substr(1)),e.angle=parseFloat(i)%360,Number.isNaN(e.angle))throw new Error(`Invalid rotation ${i}`);return e}function R(i,e=""){let t=i.match(/^(([a-zA-Z]+):\/\/([^/]+))?((.*)+)/);if(!t)throw new Error(`Invalid or unknown input ${i}`);let o=t[2],r=t[3],a=t[4];if(a[0]==="/"&&(a=a.substring(1)),e.length>0){if(e[0]==="/"&&(e=e.substring(1)),e!==a.substring(0,e.length))throw new Error(`Path does not start with prefix (path: ${a}, prefix: ${e})`);a=a.substring(e.length)}return{scheme:o,server:r,path:a,prefix:e}}function O(i,e=""){let{path:t,scheme:o,server:r,prefix:a}=R(i,e),n=t.split("/").reverse(),[s,f,p,l,...y]=n,x=y.reverse().filter(Boolean).join("/");if(n.length===1||s==="")return{type:"base",scheme:o,server:r,prefix:a,identifier:x};if(s==="info.json"){let[,...E]=n;return{type:"info",scheme:o,server:r,prefix:a,identifier:E.reverse().filter(Boolean).join("/")}}if(typeof o>"u"||typeof r>"u"||typeof t>"u"||typeof l>"u"||typeof p>"u"||typeof f>"u"||typeof s>"u")throw new Error("Invalid image service URL");let[M="",T=""]=s.split(".");return{type:"image",scheme:o,server:r,prefix:a,identifier:x,originalPath:t,region:A(l),size:P(p),rotation:$(f),quality:M,format:T}}function b(i){return g.indexOf(i)!==-1?F:u.indexOf(i)!==-1?w:v}function h(i){let e=i?Array.isArray(i.profile)?i.profile:[i.profile]:[],t={extraQualities:[],extraFormats:[],extraFeatures:[]};for(let o of e)if(typeof o=="string"&&(o=b(o)),!!o){if(o.formats)for(let r of o.formats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(o.qualities)for(let r of o.qualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);if(o.supports)for(let r of o.supports)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);if(o.maxHeight&&(t.maxHeight=o.maxHeight),o.maxWidth&&(t.maxWidth=o.maxWidth),o.maxArea&&(t.maxArea=o.maxArea),o.extraFormats)for(let r of o.extraFormats)t.extraFormats.indexOf(r)===-1&&t.extraFormats.push(r);if(o.extraQualities)for(let r of o.extraQualities)t.extraQualities.indexOf(r)===-1&&t.extraQualities.push(r);if(o.extraFeatures)for(let r of o.extraFeatures)t.extraFeatures.indexOf(r)===-1&&t.extraFeatures.push(r);o.maxHeight&&(t.maxHeight=o.maxHeight),o.maxWidth&&(t.maxWidth=o.maxWidth),o.maxArea&&(t.maxArea=o.maxArea)}if(i.extraFormats)for(let o of i.extraFormats)t.extraFormats.indexOf(o)===-1&&t.extraFormats.push(o);if(i.extraFeatures)for(let o of i.extraFeatures)t.extraFeatures.indexOf(o)===-1&&t.extraFeatures.push(o);if(i.extraQualities)for(let o of i.extraQualities)t.extraQualities.indexOf(o)===-1&&t.extraQualities.push(o);return t}function Qe(i){let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"&&c.indexOf(t)!==-1)return!0;return!1}function W(i){if(i["@id"])return i["@id"];if(i.id)return i.id}function m(i){if(!i||!i.profile||!W(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"&&I.indexOf(t)!==-1)return!0;return!1}function d(i,e){if(!m(i))return[!1,"Not a valid image service"];e.extraFeatures=e.extraFeatures?e.extraFeatures:[];let t=h(i);if(e.exactSize){let o=!1;if(i.sizes)for(let r of i.sizes)r.width&&r.width===e.exactSize.width&&(z.indexOf("sizeByW")!==-1||r.height&&r.height===e.exactSize.height)&&(o=!0),r.height&&r.height===e.exactSize.height&&(z.indexOf("sizeByH")!==-1||r.width&&r.width===e.exactSize.width)&&(o=!0);o||(e.maxWidth=Math.max(e.maxWidth||0,e.exactSize.width||0)||void 0,e.maxHeight=Math.max(e.maxHeight||0,e.exactSize.height||0)||void 0,e.maxArea=Math.max(e.maxArea||0,(e.exactSize.width&&e.exactSize.height?e.exactSize.width*e.exactSize.height:e.maxArea)||0)||void 0,!e.exactSize.height&&e.exactSize.width?e.extraFeatures.indexOf("sizeByW")===-1&&e.extraFeatures.push("sizeByW"):!e.exactSize.width&&e.exactSize.height&&e.extraFeatures.indexOf("sizeByH")===-1&&e.extraFeatures.push("sizeByH"))}if(e.maxArea&&t.maxArea&&e.maxArea>t.maxArea)return[!1,`Max area is ${t.maxArea}`];if(e.maxWidth&&t.maxWidth&&e.maxWidth>t.maxWidth)return[!1,`Max width is ${t.maxWidth}`];if(e.maxHeight&&t.maxHeight&&e.maxHeight>t.maxHeight)return[!1,`Max height is ${t.maxHeight}`];if(e.extraFeatures){let o=[];for(let r of e.extraFeatures)t.extraFeatures.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing features: ${o.join(", ")}`]}if(e.extraFormats){let o=[];for(let r of e.extraFormats)t.extraFormats.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing formats: ${o.join(", ")}`]}if(e.extraQualities){let o=[];for(let r of e.extraQualities)t.extraQualities.indexOf(r)===-1&&o.push(r);if(o.length)return[!1,`Missing qualities: ${o.join(", ")}`]}return[!0]}function Ke(i){if(!m(i))return!1;let e=Array.isArray(i.profile)?i.profile:[i.profile];for(let t of e)if(typeof t=="string"){if(u.indexOf(t)!==-1)return!0}else{let o=[...t.supports||[],...t.extraFeatures||[]];if(o.indexOf("regionByPx")!==-1&&(o.indexOf("sizeByW")!==-1||o.indexOf("sizeByWh")!==-1))return!0}return!1}function Ye(i,e){return d(i,{extraFormats:[e]})}function ei(i,e){if(e.type!=="image")return[!0];let t=[];e.rotation.mirror&&t.push("mirroring"),e.region.percent&&t.push("regionByPct"),e.region.square?t.push("regionSquare"):e.region.full||t.push("regionByPx"),e.rotation.angle&&(e.rotation.angle%90?t.push("rotationArbitrary"):t.push("rotationBy90s")),e.size.confined&&t.push("sizeByConfinedWh"),!e.size.width&&e.size.height&&t.push("sizeByH"),e.size.percentScale&&t.push("sizeByPct"),(i.sizes||[]).find(n=>n.width===e.size.width&&!e.size.height||n.height===e.size.height&&!e.size.width||n.height===e.size.height&&n.width===e.size.width)?t.push("sizeByWhListed"):(e.size.width&&!e.size.height&&t.push("sizeByW"),e.size.width&&e.size.height&&t.push("sizeByWh")),e.size.upscaled&&t.push("sizeUpscaling");let[r,a]=d(i,{extraFeatures:t,extraQualities:[e.quality],extraFormats:[e.format],exactSize:e.size});return r?[!0]:[!1,a]}function B({x:i=0,y:e=0,w:t,h:o,full:r,square:a,percent:n}){if(r)return"full";if(a)return"square";if(typeof t>"u"||typeof o>"u")throw new Error("RegionParameter: invalid region");let s=`${i},${e},${t},${o}`;return n?`pct:${s}`:s}function j({max:i,percentScale:e,upscaled:t,confined:o,width:r,height:a,serialiseAsFull:n,version:s}){let f=[];return t&&f.push("^"),i?(f.push(n?"full":"max"),f.join("")):(o&&f.push("!"),e&&f.push(`pct:${e}`),r&&f.push(`${r}`),f.push(","),a&&s===3&&f.push(`${a}`),f.join(""))}function Q(i){return`${i.mirror?"!":""}${(i.angle||0)%360}`}function H(i,e){let t=i.prefix.startsWith("/")?i.prefix.substring(1):i.prefix,o=`${i.scheme}://${i.server}/${t?`${t}/`:""}${i.identifier}`;if(i.type==="base")return o;if(i.type==="info")return`${o}/info.json`;let{size:r}=i,{region:a,rotation:n,format:s,quality:f}=i;if(e){let p=e["@context"]?Array.isArray(e["@context"])?e["@context"]:[e["@context"]]:[],l=p.indexOf("http://iiif.io/api/image/2/context.json")!==-1,y=p.indexOf("http://iiif.io/api/image/3/context.json")!==-1;if((r.width===e.width&&!r.height||r.height===e.height&&!r.width||r.width===e.width&&r.height===e.height)&&(r={...r,max:!0}),l&&(r.max&&!r.serialiseAsFull&&(r={...r,serialiseAsFull:!0}),!r.max&&r.width&&r.height&&(r={...r,height:void 0}),r={...r,version:2}),y){if(r.max&&r.serialiseAsFull&&(r={...r,serialiseAsFull:!1}),r.width&&!r.height&&e.width&&e.height){let x=e.height/e.width;r={...r,height:Math.ceil(r.width*x)}}r={...r,version:3}}}return[o,B(a),j(r),Q(n),`${f}.${s}`].filter(Boolean).join("/")}function ui(i,e){return H({...i,type:"info"},e)}function L(i){return i.endsWith("info.json")?i:i.endsWith("/")?`${i}info.json`:`${i}/info.json`}function hi(i){let e=O(L(i.id));if(e.type!=="info")throw new Error("Invalid service URL");let t=h(i);return{identifier:e.identifier,originalPath:"",server:e.server,prefix:e.prefix,scheme:e.scheme,type:"image",quality:t.extraQualities.indexOf("default")===-1?t.extraQualities[0]:"default",region:{full:!0},size:{max:!0,upscaled:!1,confined:!1},format:"jpg",rotation:{angle:0}}}function Si(i,e,t){let o=t.length,r=[];for(let a=0;a<o;a++){let n=t[a];if(!n)continue;let s=n.width;r.push(i/s)}return r}function zi(i,e,t){let o=t.length,r=[];for(let a=0;a<o;a++){let n=t[a];n&&r.push({width:Math.floor(i/n),height:Math.floor(e/n)})}return r}function S(i,e){if(e&&e.profile){let t=e.profile;if(t){let o=Array.isArray(t)?t:[t];if(o.includes(`level${i}`)||o.includes(`http://iiif.io/api/image/2/level${i}.json`)||o.includes(`http://iiif.io/api/image/1/level${i}.json`)||o.includes(`http://iiif.io/api/image/1/profiles/level${i}.json`))return!0;if(i===2){for(let r of o)if(g.includes(r))return!0}if(i===1){for(let r of o)if(u.includes(r))return!0}if(i===0){for(let r of o)if(c.includes(r))return!0}}}return!1}function Pi(i){return m(i)?S(0,i)?0:S(1,i)?1:S(2,i)?2:null:null}function Oi(i){let e=i.service?Array.isArray(i.service)?i.service:[i.service]:[],t=e.length,o=[];for(let r=0;r<t;r++)m(e[r])&&o.push(e[r]);return o}function Wi(i){if(i["@type"])return i["@type"];if(i.type)return i.type}function ji(i){let e=i.replace(/(https?:\/\/)?(www.)?/i,"");return e.indexOf("/")!==-1?e.split("/")[0]:e}export{_ as IIIF_1_IMAGE_LEVEL_0,q as IIIF_1_IMAGE_LEVEL_0_PROFILE,ee as IIIF_1_IMAGE_LEVEL_1,ie as IIIF_1_IMAGE_LEVEL_1_PROFILE,te as IIIF_1_IMAGE_LEVEL_2,re as IIIF_1_IMAGE_LEVEL_2_PROFILE,oe as IIIF_2_IMAGE_LEVEL_0,xe as IIIF_2_IMAGE_LEVEL_0_NO_JSON,ae as IIIF_2_IMAGE_LEVEL_0_PROFILE,ne as IIIF_2_IMAGE_LEVEL_1,ge as IIIF_2_IMAGE_LEVEL_1_NO_JSON,fe as IIIF_2_IMAGE_LEVEL_1_PROFILE,se as IIIF_2_IMAGE_LEVEL_2,ce as IIIF_2_IMAGE_LEVEL_2_NO_JSON,me as IIIF_2_IMAGE_LEVEL_2_PROFILE,ue as IIIF_3_IMAGE_LEVEL_0,pe as IIIF_3_IMAGE_LEVEL_1,le as IIIF_3_IMAGE_LEVEL_2,G as STANFORD_IIIF_1_IMAGE_COMPLIANCE_0,J as STANFORD_IIIF_1_IMAGE_COMPLIANCE_1,K as STANFORD_IIIF_1_IMAGE_COMPLIANCE_2,V as STANFORD_IIIF_1_IMAGE_CONFORMANCE_0,X as STANFORD_IIIF_1_IMAGE_CONFORMANCE_1,Y as STANFORD_IIIF_1_IMAGE_CONFORMANCE_2,U as STANFORD_IIIF_IMAGE_COMPLIANCE_0,N as STANFORD_IIIF_IMAGE_COMPLIANCE_1,C as STANFORD_IIIF_IMAGE_COMPLIANCE_2,k as STANFORD_IIIF_IMAGE_CONFORMANCE_0,Z as STANFORD_IIIF_IMAGE_CONFORMANCE_1,D as STANFORD_IIIF_IMAGE_CONFORMANCE_2,L as canonicalServiceUrl,h as combineProfiles,hi as createImageServiceRequest,z as extraFeatures,Si as extractFixedSizeScales,zi as fixedSizesFromScales,W as getId,Pi as getImageServiceLevel,Oi as getImageServices,Wi as getType,ji as identifyImageServer,I as imageServiceProfiles,ui as imageServiceRequestInfo,H as imageServiceRequestToString,Ye as imageServiceSupportsFormat,ei as imageServiceSupportsRequest,m as isImageService,S as isImageServiceLevel,Qe as isLevel0,v as level0,he as level0Support,w as level1,u as level1Support,F as level2,g as level2Support,b as levelToProfile,c as onlyLevel0,de as parseImageServerFromId,O as parseImageServiceRequest,R as parseImageServiceUrl,A as parseRegionParameter,$ as parseRotationParameter,P as parseSizeParameter,B as regionParameterToString,Q as rotationParameterToString,j as sizeParameterToString,d as supports,Ke as supportsCustomSizes};
{
"name": "@iiif/parser",
"version": "2.1.5",
"version": "2.1.6",
"license": "MIT",

@@ -97,7 +97,7 @@ "type": "module",

"@hyperion-framework/validator": "^1.1.0",
"@happy-dom/global-registrator": "^6.0.4",
"@happy-dom/global-registrator": "^16.3.0",
"prettier": "^3.2.5",
"tslib": "^2.6.2",
"typescript": "^5.4.4",
"vitest": "^1.4.0",
"vitest": "^2.1.8",
"publint": "^0.2.7",

@@ -104,0 +104,0 @@ "tsup": "^8.0.2"